aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Data/Array/Mixed.hs9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/Data/Array/Mixed.hs b/src/Data/Array/Mixed.hs
index 398a3de..fa61b01 100644
--- a/src/Data/Array/Mixed.hs
+++ b/src/Data/Array/Mixed.hs
@@ -243,9 +243,8 @@ instance KnownShX sh => IsList (ListX sh (Const i)) where
go ZKX [] = ZX
go (_ :!% sh) (i : is) = Const i ::% go sh is
go _ _ = error $ "IsList(ListX): Mismatched list length (type says "
- ++ show typelen ++ ", list has length "
+ ++ show (lengthStaticShX (knownShX @sh)) ++ ", list has length "
++ show (length topl) ++ ")"
- where typelen = let StaticShX l = knownShX @sh in lengthListX l
toList = go
where
go :: ListX sh' (Const i) -> [i]
@@ -261,7 +260,7 @@ instance KnownShX sh => IsList (IxX sh i) where
-- | Untyped: length and known dimensions are checked (at runtime).
instance KnownShX sh => IsList (ShX sh Int) where
type Item (ShX sh Int) = Int
- fromList = ShX . go (knownShX @sh)
+ fromList topl = ShX (go (knownShX @sh) topl)
where
go :: StaticShX sh' -> [Int] -> ListX sh' (SMayNat Int SNat)
go ZKX [] = ZX
@@ -270,7 +269,9 @@ instance KnownShX sh => IsList (ShX sh Int) where
| otherwise = error $ "IsList(ShX): Value does not match typing (type says "
++ show (fromSNat' sn) ++ ", list contains " ++ show i ++ ")"
go (SUnknown () :!% sh) (i : is) = SUnknown i ::% go sh is
- go _ _ = error "IsList(ShX): Mismatched list length"
+ go _ _ = error $ "IsList(ShX): Mismatched list length (type says "
+ ++ show (lengthStaticShX (knownShX @sh)) ++ ", list has length "
+ ++ show (length topl) ++ ")"
toList = go
where
go :: ShX sh' Int -> [Int]