[GHC] #11376: Inconsistent specified type variables among functions and datatypes/classes when using -XTypeApplications

GHC ghc-devs at haskell.org
Sun Jan 10 16:24:04 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 rwbarton):

 >  Is there a way to mention a type/kind variable but to still make it
 implicit?

 I doubt it. You don't even have to write `forall a .` to make `a` explicit
 in `prox1`.
 {{{
 rwbarton at morphism:~/zulip$ ~/ghc-newest/inplace/bin/ghc-stage2
 --interactive
 GHCi, version 8.1.20160107: http://www.haskell.org/ghc/  :? for help
 Prelude> :set -XTypeInType -XTypeApplications -XScopedTypeVariables
 -fprint-explicit-foralls
 Prelude> data Prox a = Prox
 Prelude> prox0 :: Prox a; prox1 = Prox
 Prelude> :t prox0
 prox0 :: forall {k} (a :: k). Prox a
 }}}

 Based on experimentation, the rule seems to be: all type variables
 mentioned in the type signature are explicit, from left to right as they
 appear in the signature. I guess `k` counts as to the left of `a` in `a ::
 k`, though, since it is implicitly quantified earlier.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11376#comment:8>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list