Commit d763b2e7 authored by Rinat Striungis's avatar Rinat Striungis Committed by Marge Bot

User's Guide: extensions compatibility

Adds the mention that extensions "AllowAmbiguousTypes" and "RankNTypes"
are not always compatible with each other.
Specifies the conditions and causes of failing in resolving
of ambiguity.
parent cd85f8a7
......@@ -10358,6 +10358,24 @@ function that can *never* be called, such as this one: ::
f :: (Int ~ Bool) => a -> a
Sometimes :extension:`AllowAmbiguousTypes` does not mix well with :extension:`RankNTypes`.
For example: ::
foo :: forall r. (forall i. (KnownNat i) => r) -> r
foo f = f @1
boo :: forall j. (KnownNat j) => Int
boo = ....
h :: Int
h = foo boo
This program will be rejected as ambiguous because GHC will not unify
the type variables `j` and `i`.
Unlike the previous examples, it is not currently possible
to resolve the ambiguity manually by using :extension:`TypeApplications`.
.. note::
*A historical note.* GHC used to impose some more restrictive and less
principled conditions on type signatures. For type
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment