summaryrefslogtreecommitdiff
path: root/src/Obs/Term.idr
diff options
context:
space:
mode:
Diffstat (limited to 'src/Obs/Term.idr')
-rw-r--r--src/Obs/Term.idr21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/Obs/Term.idr b/src/Obs/Term.idr
index 446fdcb..be3721f 100644
--- a/src/Obs/Term.idr
+++ b/src/Obs/Term.idr
@@ -24,6 +24,11 @@ data Term : Nat -> Type where
Pair : WithBounds (Term n) -> WithBounds (Term n) -> Term n
Fst : WithBounds (Term n) -> Term n
Snd : WithBounds (Term n) -> Term n
+ -- Disjoint Coproducts
+ Sum : WithBounds (Term n) -> WithBounds (Term n) -> Term n
+ Left : WithBounds (Term n) -> Term n
+ Right : WithBounds (Term n) -> Term n
+ Case : WithBounds (Term n) -> WithBounds (Term n) -> WithBounds (Term n) -> WithBounds (Term n) -> WithBounds (Term n) -> Term n
-- True
Top : Term n
Point : Term n
@@ -90,6 +95,22 @@ prettyPrec d (Snd t) =
parenthesise (d >= App) $
group $
fillSep [pretty "snd", prettyPrecBounds App t]
+prettyPrec d (Sum a b) =
+ parenthesise (d >= App) $
+ group $
+ fillSep [pretty "Either", prettyPrecBounds App a, prettyPrecBounds App b]
+prettyPrec d (Left t) =
+ parenthesise (d >= App) $
+ group $
+ fillSep [pretty "Left", prettyPrecBounds App t]
+prettyPrec d (Right t) =
+ parenthesise (d >= App) $
+ group $
+ fillSep [pretty "Right", prettyPrecBounds App t]
+prettyPrec d (Case t s b f g) =
+ parenthesise (d >= App) $
+ group $
+ fillSep [pretty "case", prettyPrecBounds App t, prettyPrecBounds App s, prettyPrecBounds App b, prettyPrecBounds App f, prettyPrecBounds App g]
prettyPrec d Top = pretty "()"
prettyPrec d Point = pretty "tt"
prettyPrec d Bottom = pretty "Void"