diff options
| author | Mikolaj Konarski <mikolaj.konarski@funktory.com> | 2025-12-01 18:35:58 +0100 |
|---|---|---|
| committer | Mikolaj Konarski <mikolaj.konarski@funktory.com> | 2025-12-01 18:35:58 +0100 |
| commit | 45c429917c95713b339cc4d9210a842546e72a0d (patch) | |
| tree | c6f540f1478390c0874f4b566de480593db17e9b /src/Data/Array/Nested/Ranked/Shape.hs | |
| parent | 9faf7fb877119bd52d664940c4326d326b3326fa (diff) | |
Unify fromList functions for shapes
Diffstat (limited to 'src/Data/Array/Nested/Ranked/Shape.hs')
| -rw-r--r-- | src/Data/Array/Nested/Ranked/Shape.hs | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/src/Data/Array/Nested/Ranked/Shape.hs b/src/Data/Array/Nested/Ranked/Shape.hs index 4d581a0..ea22a2b 100644 --- a/src/Data/Array/Nested/Ranked/Shape.hs +++ b/src/Data/Array/Nested/Ranked/Shape.hs @@ -379,14 +379,7 @@ shrEnum' sh = [fromLin sh suffixes li# | I# li# <- [0 .. shrSize sh - 1]] -- | Untyped: length is checked at runtime. instance KnownNat n => IsList (ListR n i) where type Item (ListR n i) = i - fromList topl = go (SNat @n) topl - where - go :: SNat n' -> [i] -> ListR n' i - go SZ [] = ZR - go (SS n) (i : is) = i ::: go n is - go _ _ = error $ "IsList(ListR): Mismatched list length (type says " - ++ show (fromSNat (SNat @n)) ++ ", list has length " - ++ show (length topl) ++ ")" + fromList = listrFromList (SNat @n) toList = Foldable.toList -- | Untyped: length is checked at runtime. |
