summaryrefslogtreecommitdiff
path: root/src/AST.hs
diff options
context:
space:
mode:
authorTom Smeding <t.j.smeding@uu.nl>2023-09-20 15:53:59 +0200
committerTom Smeding <t.j.smeding@uu.nl>2023-09-20 15:53:59 +0200
commit897fefce372f00d3e904e83eb92c83e3e653b5be (patch)
treeb4b36b280ccdd26656723eb5d8b15b8042a97744 /src/AST.hs
parent183e8b4a07231aae904b8234ddeb1c646c031173 (diff)
Examples with conditionals
Diffstat (limited to 'src/AST.hs')
-rw-r--r--src/AST.hs2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/AST.hs b/src/AST.hs
index dfc114d..8d795bf 100644
--- a/src/AST.hs
+++ b/src/AST.hs
@@ -147,6 +147,7 @@ data SOp a t where
OLe :: SScalTy a -> SOp (TPair (TScal a) (TScal a)) (TScal TBool)
OEq :: SScalTy a -> SOp (TPair (TScal a) (TScal a)) (TScal TBool)
ONot :: SOp (TScal TBool) (TScal TBool)
+ OIf :: SOp (TScal TBool) (TEither TNil TNil)
deriving instance Show (SOp a t)
opt2 :: SOp a t -> STy t
@@ -158,6 +159,7 @@ opt2 = \case
OLe _ -> STScal STBool
OEq _ -> STScal STBool
ONot -> STScal STBool
+ OIf -> STEither STNil STNil
typeOf :: Expr x env t -> STy t
typeOf = \case