Reorder declarations

This commit is contained in:
Manuel Thalmann 2024-06-17 00:01:19 +02:00
parent f0673525ee
commit 05e5b9d300

View file

@ -1,3 +1,10 @@
data Term =
Nat Integer
| Abs String Term -- EAbs Abstraction
| Inv Term Term -- EApp Invocation (a.k.a. Application) of a function
| Var String -- EVar a variable
| Add
--------------------
-- Exercise 1
--------------------
@ -13,13 +20,6 @@
-- ((Lx.(x z)) (Ly.(w (Lw.(((w y) z) x)))))
-- (Lx.((x y) (Lx.(y x))))
data Term =
Nat Integer
| Abs String Term -- EAbs Abstraction
| Inv Term Term -- EApp Invocation (a.k.a. Application) of a function
| Var String -- EVar a variable
| Add
pretty x = case x of
(Abs name term) -> "L" ++ name ++ "." ++ pretty term
(Inv func param) -> "(" ++ pretty func ++ " " ++ pretty param ++ ")"