aboutsummaryrefslogtreecommitdiff
path: root/src/CHAD/AST/Types.hs
diff options
context:
space:
mode:
authorTom Smeding <tom@tomsmeding.com>2026-05-25 14:08:07 +0200
committerTom Smeding <tom@tomsmeding.com>2026-05-25 14:08:07 +0200
commitac13ffebefb22ec45e29e7f4bb6d53fa46cf6475 (patch)
treea4edfb35804ce46dcf683c35b5988cb003afb218 /src/CHAD/AST/Types.hs
parentf5b1b405fa4ba63bdffe0f2998f655f0b06534bf (diff)
Up 'some' to 1.1HEADmaster
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