aboutsummaryrefslogtreecommitdiff
path: root/src/Data/Array/Nested/Ranked
diff options
context:
space:
mode:
authorMikolaj Konarski <mikolaj.konarski@funktory.com>2025-12-20 18:23:34 +0100
committerMikolaj Konarski <mikolaj.konarski@funktory.com>2026-02-18 14:23:02 +0100
commitdc2c67e69d5e9617306afde45bcc69928614c065 (patch)
tree82c44661a6743cad49322ad9bfdfd60c5cdf0c70 /src/Data/Array/Nested/Ranked
parentebcef9c52fa12be13bbe8498d10107fbccd637d7 (diff)
Remove ixsFromIxR' and simplify ixsFromIxR
Diffstat (limited to 'src/Data/Array/Nested/Ranked')
-rw-r--r--src/Data/Array/Nested/Ranked/Shape.hs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/Data/Array/Nested/Ranked/Shape.hs b/src/Data/Array/Nested/Ranked/Shape.hs
index 2415e26..6d47ade 100644
--- a/src/Data/Array/Nested/Ranked/Shape.hs
+++ b/src/Data/Array/Nested/Ranked/Shape.hs
@@ -293,7 +293,7 @@ ixrToLinear :: Num i => IShR m -> IxR m i -> i
ixrToLinear (ShR sh) ix = ixxToLinear sh (ixxFromIxR ix)
ixxFromIxR :: IxR n i -> IxX (Replicate n Nothing) i
-ixxFromIxR = unsafeCoerce
+ixxFromIxR = unsafeCoerce -- TODO: switch to coerce once newtypes overhauled
{-# INLINEABLE ixrFromLinear #-}
ixrFromLinear :: forall i m. Num i => IShR m -> Int -> IxR m i
@@ -302,7 +302,7 @@ ixrFromLinear (ShR sh) i
= ixrFromIxX $ ixxFromLinear sh i
ixrFromIxX :: IxX sh i -> IxR (Rank sh) i
-ixrFromIxX = unsafeCoerce
+ixrFromIxX = unsafeCoerce -- TODO: switch to coerce once newtypes overhauled
shrEnum :: IShR n -> [IIxR n]
shrEnum = shrEnum'
@@ -312,7 +312,7 @@ shrEnum' :: forall i n. Num i => IShR n -> [IxR n i]
shrEnum' (ShR sh)
| Refl <- lemRankReplicate (Proxy @n)
= (unsafeCoerce :: [IxX (Replicate n Nothing) i] -> [IxR n i]) $ shxEnum' sh
-
+ -- TODO: switch to coerce once newtypes overhauled
-- * Ranked shapes