@@ -15,6 +15,11 @@ A small strongly, statically typed compile-to-JS language with basic extensible
15- Functions with multiple arguments
15- Functions with multiple arguments
16- Pattern matching
16- Pattern matching
17- Simple FFI
17- Simple FFI
19+## Experimental Features
@@ -318,6 +323,29 @@ since the `bar` property is missing.
319Again, a type annotation can be provided if necessary.
324Again, a type annotation can be provided if necessary.
326+## Rank N Types (Experimental Feature)
328+It is also possible for the `forall` quantifier to appear on the left of a function arrow, inside types record fields and data constructors, and in type synonyms.
330+In most cases, a type annotation is necessary when using this feature.
332+As an example, we can pass a polymorphic function as an argument to another function:
335+poly :: (forall a. a -> a) -> Boolean
336+poly = \f -> (f 0 < 1) == f true
339+Notice that the polymorphic function's type argument is instantiated to both `Number` and `Boolean`.
341+An argument to `poly` must indeed be polymorphic. For example, the following fails:
344+test = poly (\n -> n + 1)
347+since the skolemized type variable `a` does not unify with `Number`.
321## Type Inference
349## Type Inference
323All types can be inferred, but annotations can optionally be provided.
351All types can be inferred, but annotations can optionally be provided.