[GHC] #11539: Warn about missing forall when -XScopedTypeVariables is on

GHC ghc-devs at haskell.org
Thu Feb 4 22:02:11 UTC 2016


#11539: Warn about missing forall when -XScopedTypeVariables is on
-------------------------------------+-------------------------------------
           Reporter:  kanetw         |             Owner:
               Type:  feature        |            Status:  new
  request                            |
           Priority:  normal         |         Milestone:
          Component:  Compiler       |           Version:  7.10.3
           Keywords:                 |  Operating System:  Unknown/Multiple
       Architecture:                 |   Type of failure:  None/Unknown
  Unknown/Multiple                   |
          Test Case:                 |        Blocked By:
           Blocking:                 |   Related Tickets:
Differential Rev(s):                 |         Wiki Page:
-------------------------------------+-------------------------------------
 I've ran into a situation where I forgot to put an explicit forall to
 actually make type variables scoped, resulting in something like
 {{{
 Could not deduce (PacketTypeId s0 t0 a0)
       arising from a use of ‘fromPacketTypeId’
     from the context (PacketTypeId s t n)
 }}}
 with code like
 {{{
 getPacketTypeId :: PacketTypeId s t n => KnxPacket d s t -> Integer
 getPacketTypeId _ = fromPacketTypeId (Proxy :: Proxy s) (Proxy :: Proxy
 t)) :: Integer
 }}}

 It'd be nice if GHC printed an extra suggestion "Did you forget to include
 an explicit forall?" when something like that arises? Maybe even suggest
 ScopedTypeVariables if they're not on.

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


More information about the ghc-tickets mailing list