X-Git-Url: http://lambda.jimpryor.net/git/gitweb.cgi?p=lambda.git;a=blobdiff_plain;f=exercises%2Fassignment5.mdwn;h=dabc1a03e77d6a3068ed8b64c99c76d49d344110;hp=73889482c1999d37564b214af2e9419da50d9d7f;hb=878a43a26bd41b5d2b228b9ea8ce5dfd3095dcba;hpb=ff9ff96c9806b28eaa3b443df3a47d74da0ec089 diff --git a/exercises/assignment5.mdwn b/exercises/assignment5.mdwn index 73889482..dabc1a03 100644 --- a/exercises/assignment5.mdwn +++ b/exercises/assignment5.mdwn @@ -252,6 +252,7 @@ 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 +330,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; ... }