aboutsummaryrefslogtreecommitdiff
path: root/src/Data
diff options
context:
space:
mode:
Diffstat (limited to 'src/Data')
-rw-r--r--src/Data/Array/Mixed.hs1
-rw-r--r--src/Data/Array/Nested/Internal.hs10
2 files changed, 7 insertions, 4 deletions
diff --git a/src/Data/Array/Mixed.hs b/src/Data/Array/Mixed.hs
index 8b90547..47027cb 100644
--- a/src/Data/Array/Mixed.hs
+++ b/src/Data/Array/Mixed.hs
@@ -54,6 +54,7 @@ data IxX sh i where
(:.?) :: 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)
+deriving instance Ord i => Ord (IxX sh i)
infixr 3 :.@
infixr 3 :.?
diff --git a/src/Data/Array/Nested/Internal.hs b/src/Data/Array/Nested/Internal.hs
index b758e55..4dc39c3 100644
--- a/src/Data/Array/Nested/Internal.hs
+++ b/src/Data/Array/Nested/Internal.hs
@@ -858,6 +858,7 @@ data ListR n i where
(:::) :: forall n i. i -> ListR n i -> ListR (S n) i
deriving instance Show i => Show (ListR n i)
deriving instance Eq i => Eq (ListR n i)
+deriving instance Ord i => Ord (ListR n i)
infixr 3 :::
deriving stock instance Functor (ListR n)
@@ -872,7 +873,7 @@ listRToList (i ::: is) = i : listRToList is
-- | An index into a rank-typed array.
type IxR :: INat -> Type -> Type
newtype IxR n i = IxR (ListR n i)
- deriving (Show, Eq)
+ deriving (Show, Eq, Ord)
deriving newtype instance Functor (IxR n)
@@ -902,7 +903,7 @@ type IIxR n = IxR n Int
type StaticShapeR :: INat -> Type -> Type
newtype StaticShapeR n i = StaticShapeR (ListR n i)
- deriving (Show, Eq)
+ deriving (Show, Eq, Ord)
deriving newtype instance Functor (StaticShapeR n)
@@ -1070,6 +1071,7 @@ data ListS sh i where
(::$) :: forall n sh i. i -> ListS sh i -> ListS (n : sh) i
deriving instance Show i => Show (ListS sh i)
deriving instance Eq i => Eq (ListS sh i)
+deriving instance Ord i => Ord (ListS sh i)
infixr 3 ::$
deriving stock instance Functor (ListS sh)
@@ -1089,7 +1091,7 @@ listSToList (i ::$ is) = i : listSToList is
-- from a 'KnownShape' dictionary.
type IxS :: [Nat] -> Type -> Type
newtype IxS sh i = IxS (ListS sh i)
- deriving (Show, Eq)
+ deriving (Show, Eq, Ord)
deriving newtype instance Functor (IxS sh)
@@ -1119,7 +1121,7 @@ type IIxS sh = IxS sh Int
type StaticShapeS :: [Nat] -> Type -> Type
newtype StaticShapeS sh i = StaticShapeS (ListS sh i)
- deriving (Show, Eq)
+ deriving (Show, Eq, Ord)
deriving newtype instance Functor (StaticShapeS sh)