From f29e8a37daf2ed55ea849c286e1bfb1025b67329 Mon Sep 17 00:00:00 2001 From: Mikolaj Konarski Date: Sun, 21 Apr 2024 23:07:33 +0200 Subject: Swap arguments of sized lists to derive Functor, etc. --- src/Data/Array/Mixed.hs | 16 ++++++++-------- 1 file changed, 8 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 d2765b6..8b90547 100644 --- a/src/Data/Array/Mixed.hs +++ b/src/Data/Array/Mixed.hs @@ -47,17 +47,17 @@ lemAppAssoc _ _ _ = unsafeCoerce Refl -- TODO: ListX? But if so, why is StaticShapeX not defined as a newtype -- over IxX (so that we can make IxX and StaticShapeX a newtype over ListX)? -type IxX :: Type -> [Maybe Nat] -> Type -data IxX i sh where - ZIX :: IxX i '[] - (:.@) :: forall n sh i. i -> IxX i sh -> IxX i (Just n : sh) - (:.?) :: forall sh i. i -> IxX i sh -> IxX i (Nothing : sh) -deriving instance Show i => Show (IxX i sh) -deriving instance Eq i => Eq (IxX i sh) +type IxX :: [Maybe Nat] -> Type -> Type +data IxX sh i where + ZIX :: IxX '[] i + (:.@) :: forall n sh i. i -> IxX sh i -> IxX (Just n : sh) i + (:.?) :: forall sh i. i -> IxX sh i -> IxX (Nothing : sh) i +deriving instance Show i => Show (IxX sh i) +deriving instance Eq i => Eq (IxX sh i) infixr 3 :.@ infixr 3 :.? -type IIxX = IxX Int +type IIxX sh = IxX sh Int -- | The part of a shape that is statically known. type StaticShapeX :: [Maybe Nat] -> Type -- cgit v1.2.3-70-g09d2