[GHC] #14734: QuantifiedConstraints conflated with impredicative polymorphism?
GHC
ghc-devs at haskell.org
Wed Feb 21 22:11:04 UTC 2018
#14734: QuantifiedConstraints conflated with impredicative polymorphism?
-------------------------------------+-------------------------------------
Reporter: Iceland_jack | Owner: (none)
Type: bug | Status: closed
Priority: normal | Milestone:
Component: Compiler | Version: 8.5
Resolution: invalid | Keywords:
| QuantifiedConstraints wipT2893
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: None/Unknown | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s):
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by simonpj):
The difficulty with impredicativity is that, during inference, a
unification variable may be unified with a polytype. Thus
{{{
f :: forall a. [a] -> [a]
xs :: [forall b. b->b]
...(f xs)..
}}}
Here f really has a type argument, and that type is polymorphic. We
really have
{{{
...(f @(forall b b->b) xs)...
}}}
The hard bit is infeering the implicit, invisible type arguments.
But here we are the level of types. With explicit arguments there should
be nothing wrong with allowing polytypes. (It's a different matter for the
implicit kind arguments, of course.)
So... may it'd be OK. I'm just not sure what a principled story is.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/14734#comment:5>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list