summaryrefslogtreecommitdiff
path: root/src/Data/Array
diff options
context:
space:
mode:
Diffstat (limited to 'src/Data/Array')
-rw-r--r--src/Data/Array/Nested/Internal.hs20
1 files changed, 4 insertions, 16 deletions
diff --git a/src/Data/Array/Nested/Internal.hs b/src/Data/Array/Nested/Internal.hs
index 4577967..18f458e 100644
--- a/src/Data/Array/Nested/Internal.hs
+++ b/src/Data/Array/Nested/Internal.hs
@@ -896,10 +896,7 @@ type role IxR nominal representational
type IxR :: INat -> Type -> Type
newtype IxR n i = IxR (ListR n i)
deriving (Show, Eq, Ord)
- deriving newtype (Functor)
-
-instance Foldable (IxR n) where
- foldr f z (IxR l) = foldr f z l
+ deriving newtype (Functor, Foldable)
pattern ZIR :: forall n i. () => n ~ Z => IxR n i
pattern ZIR = IxR ZR
@@ -928,10 +925,7 @@ type role ShR nominal representational
type ShR :: INat -> Type -> Type
newtype ShR n i = ShR (ListR n i)
deriving (Show, Eq, Ord)
- deriving newtype (Functor)
-
-instance Foldable (ShR n) where
- foldr f z (ShR l) = foldr f z l
+ deriving newtype (Functor, Foldable)
pattern ZSR :: forall n i. () => n ~ Z => ShR n i
pattern ZSR = ShR ZR
@@ -1115,10 +1109,7 @@ type role IxS nominal representational
type IxS :: [Nat] -> Type -> Type
newtype IxS sh i = IxS (ListS sh i)
deriving (Show, Eq, Ord)
- deriving newtype (Functor)
-
-instance Foldable (IxS sh) where
- foldr f z (IxS l) = foldr f z l
+ deriving newtype (Functor, Foldable)
pattern ZIS :: forall sh i. () => sh ~ '[] => IxS sh i
pattern ZIS = IxS ZS
@@ -1144,10 +1135,7 @@ type role ShS nominal representational
type ShS :: [Nat] -> Type -> Type
newtype ShS sh i = ShS (ListS sh i)
deriving (Show, Eq, Ord)
- deriving newtype (Functor)
-
-instance Foldable (ShS sh) where
- foldr f z (ShS l) = foldr f z l
+ deriving newtype (Functor, Foldable)
pattern ZSS :: forall sh i. () => sh ~ '[] => ShS sh i
pattern ZSS = ShS ZS