From bc8e904b3cc7b98a4809357321ce3d1196df3701 Mon Sep 17 00:00:00 2001 From: Mikolaj Konarski Date: Sat, 20 Dec 2025 18:23:34 +0100 Subject: Remove ixsFromIxR' and simplify ixsFromIxR --- src/Data/Array/Nested/Shaped/Shape.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/Data/Array/Nested/Shaped') diff --git a/src/Data/Array/Nested/Shaped/Shape.hs b/src/Data/Array/Nested/Shaped/Shape.hs index 8cd937c..c5e3202 100644 --- a/src/Data/Array/Nested/Shaped/Shape.hs +++ b/src/Data/Array/Nested/Shaped/Shape.hs @@ -275,14 +275,14 @@ ixsToLinear :: Num i => ShS sh -> IxS sh i -> i ixsToLinear (ShS sh) ix = ixxToLinear sh (ixxFromIxS ix) ixxFromIxS :: IxS sh i -> IxX (MapJust sh) i -ixxFromIxS = unsafeCoerce +ixxFromIxS = unsafeCoerce -- TODO: switch to coerce once newtypes overhauled {-# INLINEABLE ixsFromLinear #-} ixsFromLinear :: Num i => ShS sh -> Int -> IxS sh i ixsFromLinear (ShS sh) i = ixsFromIxX $ ixxFromLinear sh i ixsFromIxX :: IxX (MapJust sh) i -> IxS sh i -ixsFromIxX = unsafeCoerce +ixsFromIxX = unsafeCoerce -- TODO: switch to coerce once newtypes overhauled shsEnum :: ShS sh -> [IIxS sh] shsEnum = shsEnum' @@ -290,7 +290,7 @@ shsEnum = shsEnum' {-# INLINABLE shsEnum' #-} -- ensure this can be specialised at use site shsEnum' :: Num i => ShS sh -> [IxS sh i] shsEnum' (ShS sh) = (unsafeCoerce :: [IxX (MapJust sh) i] -> [IxS sh i]) $ shxEnum' sh - + -- TODO: switch to coerce once newtypes overhauled -- * Shaped shapes -- cgit v1.2.3-70-g09d2