From a95ae379851158f48f90a0274ad74caa44f582e0 Mon Sep 17 00:00:00 2001 From: Tom Smeding Date: Mon, 15 Apr 2024 23:30:23 +0200 Subject: Proper checking in *generate, plus warning in haddocks --- src/Data/Array/Mixed.hs | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'src/Data/Array/Mixed.hs') 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' -- cgit v1.2.3-70-g09d2