diff options
| author | Mikolaj Konarski <mikolaj.konarski@funktory.com> | 2026-04-04 12:09:08 +0200 |
|---|---|---|
| committer | Mikolaj Konarski <mikolaj.konarski@funktory.com> | 2026-04-04 12:09:08 +0200 |
| commit | 53bc096c807fc63cfe5f1102131b475deb5e21ca (patch) | |
| tree | 63115ff12a4bb5cb656164718163b885f7b91d27 /src/Data/Array/Nested/Convert.hs | |
| parent | a9ac62f66e45e64f83043e0ebda04f0b4b80b913 (diff) | |
Remove almost all unsafeCoerce
Diffstat (limited to 'src/Data/Array/Nested/Convert.hs')
| -rw-r--r-- | src/Data/Array/Nested/Convert.hs | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/Data/Array/Nested/Convert.hs b/src/Data/Array/Nested/Convert.hs index d6bdc6a..155a1a7 100644 --- a/src/Data/Array/Nested/Convert.hs +++ b/src/Data/Array/Nested/Convert.hs @@ -57,10 +57,7 @@ import Data.Array.Nested.Types -- * To ranked --- TODO: change all those unsafeCoerces into coerces by defining shaped --- and ranked index types as newtypes of the mixed index type --- and similarly for the sized lists or, preferably, by defining --- all as newtypes over [], exploiting fusion and getting free toList. +-- This unsafeCoerce, exceptionally, can't be eliminated using newtype coercions. ixrFromIxS :: IxS sh i -> IxR (Rank sh) i ixrFromIxS = unsafeCoerce @@ -83,8 +80,9 @@ shrFromShX = coerce -- * To shaped +-- This unsafeCoerce, exceptionally, can't be eliminated using newtype coercions. ixsFromIxR :: IxR (Rank sh) i -> IxS sh i -ixsFromIxR = unsafeCoerce -- TODO: switch to coerce once newtypes overhauled +ixsFromIxR = unsafeCoerce -- ixsFromIxX re-exported |
