diff options
author | Tom Smeding <tom@tomsmeding.com> | 2024-04-15 23:30:23 +0200 |
---|---|---|
committer | Tom Smeding <tom@tomsmeding.com> | 2024-04-15 23:30:23 +0200 |
commit | a95ae379851158f48f90a0274ad74caa44f582e0 (patch) | |
tree | 0b0c15034520267f00b22c708715aa28c8f5ceda /src/Data/Array/Mixed.hs | |
parent | 690a74d571c61330978fdf5e4565ce0b8622030b (diff) |
Proper checking in *generate, plus warning in haddocks
Diffstat (limited to 'src/Data/Array/Mixed.hs')
-rw-r--r-- | src/Data/Array/Mixed.hs | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/Data/Array/Mixed.hs b/src/Data/Array/Mixed.hs index 9a8ccfd..17b0ab4 100644 --- a/src/Data/Array/Mixed.hs +++ b/src/Data/Array/Mixed.hs @@ -49,6 +49,7 @@ data IxX sh where (::@) :: Int -> IxX sh -> IxX (Just n : sh) (::?) :: Int -> IxX sh -> IxX (Nothing : sh) deriving instance Show (IxX sh) +deriving instance Eq (IxX sh) infixr 5 ::@ infixr 5 ::? @@ -81,15 +82,15 @@ type XArray :: [Maybe Nat] -> Type -> Type newtype XArray sh a = XArray (S.Array (FromINat (Rank sh)) a) deriving (Show) -zeroIdx :: StaticShapeX sh -> IxX sh -zeroIdx SZX = IZX -zeroIdx (_ :$@ ssh) = 0 ::@ zeroIdx ssh -zeroIdx (_ :$? ssh) = 0 ::? zeroIdx ssh +zeroIxX :: StaticShapeX sh -> IxX sh +zeroIxX SZX = IZX +zeroIxX (_ :$@ ssh) = 0 ::@ zeroIxX ssh +zeroIxX (_ :$? ssh) = 0 ::? zeroIxX ssh -zeroIdx' :: IxX sh -> IxX sh -zeroIdx' IZX = IZX -zeroIdx' (_ ::@ sh) = 0 ::@ zeroIdx' sh -zeroIdx' (_ ::? sh) = 0 ::? zeroIdx' sh +zeroIxX' :: IxX sh -> IxX sh +zeroIxX' IZX = IZX +zeroIxX' (_ ::@ sh) = 0 ::@ zeroIxX' sh +zeroIxX' (_ ::? sh) = 0 ::? zeroIxX' sh ixAppend :: IxX sh -> IxX sh' -> IxX (sh ++ sh') ixAppend IZX idx' = idx' |