This commit is contained in:
2026-05-14 18:16:11 -06:00
parent 11e70f3ae1
commit ff6bddffb3
4 changed files with 58 additions and 19 deletions
+6 -4
View File
@@ -23,6 +23,7 @@ data Prim e
| PrimSub e e
| PrimMul e e
| PrimDiv e e
| PrimCons e e
deriving (Show, Generic, Functor, Foldable, Traversable)
instance Each (Prim e) (Prim e') e e'
@@ -47,10 +48,11 @@ data Exp
instance SexpIso a => SexpIso (Prim a) where
sexpIso = match
$ With (. binop "prim-+")
$ With (. binop "prim--")
$ With (. binop "prim-*")
$ With (. binop "prim-/")
$ With (. binop "prim:+")
$ With (. binop "prim:-")
$ With (. binop "prim:*")
$ With (. binop "prim:/")
$ With (. binop "prim:cons")
$ End
where
binop s = list $ el (sym s) >>> el sexpIso >>> el sexpIso