Reorder all slide tasks

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

View file

@ -1,3 +1,7 @@
--------------------
-- Slides
--------------------
data Term = data Term =
Nat Integer Nat Integer
| Abs String Term -- EAbs Abstraction | Abs String Term -- EAbs Abstraction
@ -5,6 +9,16 @@ data Term =
| Var String -- EVar a variable | Var String -- EVar a variable
| Add | 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 -- Exercise 1
-------------------- --------------------
@ -19,13 +33,3 @@ data Term =
-- ((Lx.(x z)) (Ly.(x y))) -- ((Lx.(x z)) (Ly.(x y)))
-- ((Lx.(x z)) (Ly.(w (Lw.(((w y) z) x))))) -- ((Lx.(x z)) (Ly.(w (Lw.(((w y) z) x)))))
-- (Lx.((x y) (Lx.(y 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)"