X-Git-Url: http://lambda.jimpryor.net/git/gitweb.cgi?p=lambda.git;a=blobdiff_plain;f=exercises%2Fassignment5.mdwn;h=5dd1cbb24a6f8982e29b464a4d6a262d7b6675ae;hp=73889482c1999d37564b214af2e9419da50d9d7f;hb=442a8534983a824eec968ce2bb113fe60e0b1007;hpb=ff9ff96c9806b28eaa3b443df3a47d74da0ec089 diff --git a/exercises/assignment5.mdwn b/exercises/assignment5.mdwn index 73889482..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,9 @@ 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 - :set -XExplicitForAll + 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; ... } -- or let { sysf_true :: forall a. a -> a -> a; ... }