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

GHC ghc-devs at haskell.org
Fri Mar 25 12:54:15 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 RyanGlScott):

 I suppose the behavior is unchanged, but cosmetically, the type
 signature's appearance seems off, especially when combined with
 `-XTypeApplications`:

 {{{
 $ /opt/ghc/8.0.1/bin/ghci
 GHCi, version 8.0.0.20160324: http://www.haskell.org/ghc/  :? for help
 Loaded GHCi configuration from /home/ryanglscott/.ghci
 λ> :set -XTypeApplications -XDataKinds -fprint-explicit-foralls
 λ> import GHC.Generics
 λ> :t datatypeName @('MetaData "Void" "Data.Void" "base" 'False)
 datatypeName @('MetaData "Void" "Data.Void" "base" 'False)
   :: Datatype ('MetaData "Void" "Data.Void" "base" 'False) =>
      forall {k1} (t :: Meta -> (* -> *) -> k1 -> *) (f :: *
                                                           -> *) (a :: k1).
      t ('MetaData "Void" "Data.Void" "base" 'False) f a -> [Char]
 }}}

 1. You would expect the context to go away once you apply `'MetaData
 "Void" "Data.Void" "base" 'False`.
 2. You certainly wouldn't expect the context to appear //before// the list
 of quantified type variables.

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


More information about the ghc-tickets mailing list