Mjahaja
This commit is contained in:
@ -26,6 +26,7 @@ If you want to use Haskell then there is also a wrapper module ([[https://chalme
|
||||
(code =<< code (parse "\\x. x"))))
|
||||
#+end_src
|
||||
|
||||
\newpage
|
||||
* Exercises
|
||||
In order to pass this assignment you have to get at least four points.
|
||||
|
||||
@ -85,7 +86,7 @@ Test your implementation. Here are some test cases that must work:
|
||||
| ~z~ | $C(\lambda z . z)$ | $\text{case}\ z\ \text{of}\ \{ C(z) \rightarrow z \}$ | $\text{case}\ C(\lambda z. z) \ \text{of}\ \{ C(z) \rightarrow z \}$ |
|
||||
|
||||
*** Answer
|
||||
See =Assignment.hs=.
|
||||
See =Main.hs=.
|
||||
|
||||
** (1p)
|
||||
Implement multiplication of natural numbers in $\chi$, using the representation of natural numbers given in the $\chi$ specification.
|
||||
@ -131,4 +132,4 @@ Test your implementation, for instance by testing that addition (defined in the
|
||||
Note that implementing a call-by-value semantics properly in a language like Haskell, which is by default non-strict, can be tricky. However, you will not fail if the only problem with your implementation is that some programs that should fail to terminate instead terminate with a “reasonable” result.
|
||||
|
||||
*** Answer
|
||||
See =Assignment.hs=.
|
||||
See =Main.hs=.
|
||||
@ -3,7 +3,7 @@ module Main where
|
||||
|
||||
import Chi
|
||||
import Data.Functor ( (<&>) )
|
||||
import Control.Monad.Identity (Identity(runIdentity))
|
||||
import Control.Monad.Identity ( Identity( runIdentity ) )
|
||||
|
||||
-- Task 3
|
||||
subst :: Variable -> Exp -> Exp -> Exp
|
||||
|
||||
Reference in New Issue
Block a user