Reorder all slide tasks
This commit is contained in:
parent
05e5b9d300
commit
e710a68bf3
1 changed files with 14 additions and 10 deletions
|
@ -1,3 +1,7 @@
|
|||
--------------------
|
||||
-- Slides
|
||||
--------------------
|
||||
|
||||
data Term =
|
||||
Nat Integer
|
||||
| Abs String Term -- EAbs Abstraction
|
||||
|
@ -5,6 +9,16 @@ data Term =
|
|||
| 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 ++ ")"
|
||||
(Var name) -> name
|
||||
Add -> "Add"
|
||||
|
||||
-- example
|
||||
-- >>> pretty (Abs "x" $ Abs "y" $ Inv (Inv Add (Var "x")) (Var "y"))
|
||||
-- "Lx.Ly.((Add x) y)"
|
||||
|
||||
--------------------
|
||||
-- Exercise 1
|
||||
--------------------
|
||||
|
@ -19,13 +33,3 @@ data Term =
|
|||
-- ((Lx.(x z)) (Ly.(x y)))
|
||||
-- ((Lx.(x z)) (Ly.(w (Lw.(((w y) z) x)))))
|
||||
-- (Lx.((x y) (Lx.(y x))))
|
||||
|
||||
pretty x = case x of
|
||||
(Abs name term) -> "L" ++ name ++ "." ++ pretty term
|
||||
(Inv func param) -> "(" ++ pretty func ++ " " ++ pretty param ++ ")"
|
||||
(Var name) -> name
|
||||
Add -> "Add"
|
||||
|
||||
-- example
|
||||
-- >>> pretty (Abs "x" $ Abs "y" $ Inv (Inv Add (Var "x")) (Var "y"))
|
||||
-- "Lx.Ly.((Add x) y)"
|
||||
|
|
Loading…
Reference in a new issue