aboutsummaryrefslogtreecommitdiff
path: root/src/CHAD/AST/Types.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/CHAD/AST/Types.hs')
-rw-r--r--src/CHAD/AST/Types.hs15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/CHAD/AST/Types.hs b/src/CHAD/AST/Types.hs
index f0feb55..006d023 100644
--- a/src/CHAD/AST/Types.hs
+++ b/src/CHAD/AST/Types.hs
@@ -68,6 +68,11 @@ instance TestEquality STy where testEquality = geq
instance GEq STy where geq = defaultGeq
instance GShow STy where gshowsPrec = defaultGshowsPrec
+instance Eq (STy t) where (==) = eqpFromGEq
+instance Ord (STy t) where compare = comparepFromGCompare
+instance EqP STy where eqp = eqpFromGEq
+instance OrdP STy where comparep = comparepFromGCompare
+
-- | Monoid types
type SMTy :: Ty -> Type
data SMTy t where
@@ -98,6 +103,11 @@ instance TestEquality SMTy where testEquality = geq
instance GEq SMTy where geq = defaultGeq
instance GShow SMTy where gshowsPrec = defaultGshowsPrec
+instance Eq (SMTy t) where (==) = eqpFromGEq
+instance Ord (SMTy t) where compare = comparepFromGCompare
+instance EqP SMTy where eqp = eqpFromGEq
+instance OrdP SMTy where comparep = comparepFromGCompare
+
fromSMTy :: SMTy t -> STy t
fromSMTy = \case
SMTNil -> STNil
@@ -132,6 +142,11 @@ instance TestEquality SScalTy where testEquality = geq
instance GEq SScalTy where geq = defaultGeq
instance GShow SScalTy where gshowsPrec = defaultGshowsPrec
+instance Eq (SScalTy t) where (==) = eqpFromGEq
+instance Ord (SScalTy t) where compare = comparepFromGCompare
+instance EqP SScalTy where eqp = eqpFromGEq
+instance OrdP SScalTy where comparep = comparepFromGCompare
+
scalRepIsShow :: SScalTy t -> Dict (Show (ScalRep t))
scalRepIsShow STI32 = Dict
scalRepIsShow STI64 = Dict