From 153c179388bded9b5386b350c5405728a6e6e81c Mon Sep 17 00:00:00 2001 From: pingu Date: Thu, 20 Nov 2025 15:39:01 +0100 Subject: [PATCH] Mjahaja --- 3/{assig.org => 3.org} | 5 +++-- 3/interpreter/Main.hs | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) rename 3/{assig.org => 3.org} (99%) diff --git a/3/assig.org b/3/3.org similarity index 99% rename from 3/assig.org rename to 3/3.org index a9d6cf3..494f633 100644 --- a/3/assig.org +++ b/3/3.org @@ -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=. diff --git a/3/interpreter/Main.hs b/3/interpreter/Main.hs index 74e27cb..f2e4733 100644 --- a/3/interpreter/Main.hs +++ b/3/interpreter/Main.hs @@ -2,8 +2,8 @@ module Main where import Chi -import Data.Functor ( (<&>) ) -import Control.Monad.Identity (Identity(runIdentity)) +import Data.Functor ( (<&>) ) +import Control.Monad.Identity ( Identity( runIdentity ) ) -- Task 3 subst :: Variable -> Exp -> Exp -> Exp