aboutsummaryrefslogtreecommitdiff
path: root/src/Data/Array/Nested/Ranked/Base.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Data/Array/Nested/Ranked/Base.hs')
-rw-r--r--src/Data/Array/Nested/Ranked/Base.hs4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/Data/Array/Nested/Ranked/Base.hs b/src/Data/Array/Nested/Ranked/Base.hs
index babc809..fdad141 100644
--- a/src/Data/Array/Nested/Ranked/Base.hs
+++ b/src/Data/Array/Nested/Ranked/Base.hs
@@ -87,6 +87,8 @@ newtype instance MixedVecs s sh (Ranked n a) = MV_Ranked (MixedVecs s sh (Mixed
-- these instances allow them to also be used as elements of arrays, thus
-- making them first-class in the API.
instance Elt a => Elt (Ranked n a) where
+ type EltC (Ranked n a) = Elt a
+
mshape (M_Ranked arr) = mshape arr
mindex (M_Ranked arr) i = Ranked (mindex arr i)
@@ -178,6 +180,8 @@ instance Elt a => Elt (Ranked n a) where
vecs)
instance (KnownNat n, KnownElt a) => KnownElt (Ranked n a) where
+ type KnownEltC (Ranked n a) = (KnownNat n, KnownElt a)
+
memptyArrayUnsafe :: forall sh. IShX sh -> Mixed sh (Ranked n a)
memptyArrayUnsafe i
| Dict <- lemKnownReplicate (SNat @n)