[GHC] #11376: Inconsistent specified type variables among functions and datatypes/classes when using -XTypeApplications
GHC
ghc-devs at haskell.org
Tue Mar 29 14:35:19 UTC 2016
#11376: Inconsistent specified type variables among functions and datatypes/classes
when using -XTypeApplications
-------------------------------------+-------------------------------------
Reporter: RyanGlScott | Owner: goldfire
Type: bug | Status: new
Priority: normal | Milestone:
Component: Compiler (Type | Version: 8.1
checker) | Keywords:
Resolution: | TypeApplications
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: Other | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s):
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by goldfire):
You're talking about `Note [Instantiate when inferring a type]` in
!TcBinds. Yes. When we infer a type, we instantiate. The Note has the
details, but this design makes it so that values with inferred types never
have any variables available for type application. This is good.
With `:type`, though, we don't want to instantiate, because doing so might
change specified variables to invisible ones. Or in cases like `forall a.
(a ~ Int) => ...`, instantiating and then solving will actually get rid of
a variable. Instantiating ''when there are no more specified variables''
isn't ruinous, but I'm sure implementing the special case will cause
confusion.
Given that this is, essentially, a pretty-printing issue, maybe it should
be controlled by `-fprint-explicit-foralls`? With the flag set, we never
instantiate. Otherwise, we always instantiate.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11376#comment:19>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list