X-Git-Url: http://lambda.jimpryor.net/git/gitweb.cgi?p=lambda.git;a=blobdiff_plain;f=exercises%2Fassignment5.mdwn;h=5dd1cbb24a6f8982e29b464a4d6a262d7b6675ae;hp=7bcbbee0a716388961f007d9ee65019a137e5a53;hb=6e4c74e721473056aa6c1cd6573a95d4d83938f3;hpb=eff268fb93d6caecb49638c23d54241f48dabc77;ds=sidebyside diff --git a/exercises/assignment5.mdwn b/exercises/assignment5.mdwn index 7bcbbee0..5dd1cbb2 100644 --- a/exercises/assignment5.mdwn +++ b/exercises/assignment5.mdwn @@ -252,6 +252,8 @@ Again, we've left some gaps. (The use of `type` for the first line in Haskell an 15. Choose one of these languages and fill in the gaps to complete the definition. + + 16. Write a function `occurs_free` that has the following type: occurs_free : identifier -> lambda_term -> bool @@ -329,7 +331,7 @@ any type `α`, as long as your function is of type `α -> α` and you have a bas -- Or this: let sysf_true = (\y n -> y) :: Sysf_bool a - Note that in both OCaml and the Haskell code, the generalization `∀'a` on the free type variable `'a` is implicit. If you really want to, you can supply it explicitly in Haskell by saying: + Note that in both OCaml and Haskell code, the generalization `∀α` on the free type variable `α` is implicit. If you really want to, you can supply it explicitly in Haskell by saying: :set -XExplicitForAll let { sysf_true :: forall a. Sysf_bool a; ... } @@ -408,7 +410,7 @@ Be sure to test your proposals with simple lists. (You'll have to `sysf_cons` up # k 1 true ;; - : int = 1 - If you can't understand how one term can have several types, recall our discussion in this week's notes of "principal types". (WHERE?) + If you can't understand how one term can have several types, recall our discussion in this week's notes of "principal types".