explicit foralls do not distinguish applicable types
From the documentation for TypeApplications:
"When printing types with -fprint-explicit-foralls enabled, type variables not available for visible type application are printed in braces. Thus, if you write myLength = length without a type signature, myLength‘s inferred type will be forall {f} {a}. Foldable f => f a -> Int."
This implies that type variables that are available for type application are not printed braces (though I admit that it doesn't say so outright!). With that in mind, I find the following behavior confusing:
> :set -XTypeApplications -fprint-explicit-foralls
> :t (1 :: Num a => a)
(1 :: Num a => a) :: forall {a}. Num a => a
> (1 :: Num a => a) @Int
1
The :t query seems to indicate that the type variable is not available, but the evaluation query seems to indicate that it is.
Trac metadata
Trac field | Value |
---|---|
Version | 8.0.1 |
Type | Bug |
TypeOfFailure | OtherFailure |
Priority | normal |
Resolution | Unresolved |
Component | Compiler |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | |
Operating system | |
Architecture |