[GHC] #15743: Nail down the Required/Inferred/Specified story

GHC ghc-devs at haskell.org
Mon Oct 15 20:42:13 UTC 2018


#15743: Nail down the Required/Inferred/Specified story
-------------------------------------+-------------------------------------
        Reporter:  simonpj           |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.6.1
      Resolution:                    |             Keywords:
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 goldfire):

 I'm having second thoughts about my more permissive approach.

 Consider

 {{{#!hs
   data SameKind :: k -> k -> *
   data Bad a (c :: Proxy b) (d :: Proxy a) (x :: SameKind b d)
 }}}

 We could infer this ordering for the tyvars of `Bad`: `@{k :: Type} (a ::
 k) @(b :: Proxy a) (c :: Proxy b) (d :: Proxy a) (x :: SameKind b d)`. My
 notation indicates that `k` is Inferred, `b` is Specified, and the rest
 are Required. Note that a Specified is going ''after'' a Required here.

 Is this too clever by half? Or is it snazzy that we can accept this?

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


More information about the ghc-tickets mailing list