lamlol
This commit is contained in:
@@ -41,9 +41,10 @@ data Kappa = MkKappa (List Name) Exp
|
||||
deriving (Show, Generic)
|
||||
|
||||
data Exp
|
||||
= ExpPrim (Prim Val) (List Name) (List Exp)
|
||||
= ExpPrim (Prim Val) (List Name) Exp
|
||||
| ExpFix (NonEmpty (Name, Kappa)) Exp
|
||||
| ExpApply Val (List Val)
|
||||
| ExpIf Val Exp Exp
|
||||
deriving (Show, Generic)
|
||||
|
||||
pattern Halt :: List Val -> Exp
|
||||
@@ -83,12 +84,14 @@ instance S.SexpIso Exp where
|
||||
$ With (. prim)
|
||||
$ With (. let_)
|
||||
$ With (. app)
|
||||
$ With (. if_)
|
||||
$ End
|
||||
where
|
||||
let_ = Gyehoek.Sexp.let_ "fix" S.sexpIso S.sexpIso S.sexpIso
|
||||
if_ = S.list $ S.el S.sexpIso >>> S.el S.sexpIso >>> S.el S.sexpIso
|
||||
app = S.list $ S.el S.sexpIso >>> S.rest S.sexpIso
|
||||
prim = S.list $
|
||||
S.el (S.sym "prim")
|
||||
>>> S.el (primSexpIso id (S.sexpIso @Val))
|
||||
>>> S.el S.sexpIso
|
||||
>>> S.rest S.sexpIso
|
||||
>>> S.el S.sexpIso
|
||||
|
||||
Reference in New Issue
Block a user