summaryrefslogtreecommitdiff
path: root/src/Obs/Syntax.idr
diff options
context:
space:
mode:
Diffstat (limited to 'src/Obs/Syntax.idr')
-rw-r--r--src/Obs/Syntax.idr25
1 files changed, 24 insertions, 1 deletions
diff --git a/src/Obs/Syntax.idr b/src/Obs/Syntax.idr
index 4a7ee0c..f1a552f 100644
--- a/src/Obs/Syntax.idr
+++ b/src/Obs/Syntax.idr
@@ -18,6 +18,11 @@ data Syntax : Type where
Pi : Bounds -> WithBounds String -> Syntax -> Syntax -> Syntax
Lambda : Bounds -> WithBounds String -> Syntax -> Syntax
App : Syntax -> Syntax -> Syntax
+ -- Dependent Sums
+ Sigma : Bounds -> WithBounds String -> Syntax -> Syntax -> Syntax
+ Pair : Bounds -> Syntax -> Syntax -> Syntax
+ Fst : Bounds -> Syntax -> Syntax
+ Snd : Bounds -> Syntax -> Syntax
-- True
Top : Bounds -> Syntax
Point : Bounds -> Syntax
@@ -55,8 +60,26 @@ Pretty Syntax where
parenthesise (d >= App) $
group $
fillSep [prettyPrec Open t, prettyPrec App u]
+ prettyPrec d (Sigma _ var a b) =
+ parenthesise (d >= App) $
+ group $
+ parens (pretty var.val <++> colon <+> softline <+> prettyPrec Open a) <++>
+ pretty "**" <+> softline <+>
+ prettyPrec Open b
+ prettyPrec d (Pair _ t u) =
+ angles $
+ group $
+ neutral <++> prettyPrec Open t <+> comma <+> softline <+> prettyPrec Open u <++> neutral
+ prettyPrec d (Fst _ t) =
+ parenthesise (d >= App) $
+ group $
+ fillSep [pretty "fst", prettyPrec App t]
+ prettyPrec d (Snd _ t) =
+ parenthesise (d >= App) $
+ group $
+ fillSep [pretty "snd", prettyPrec App t]
prettyPrec d (Top _) = pretty "()"
- prettyPrec d (Point _) = pretty "*"
+ prettyPrec d (Point _) = pretty "tt"
prettyPrec d (Bottom _) = pretty "Void"
prettyPrec d (Absurd _ a t) =
parenthesise (d >= App) $