[GHC] #15008: Type synonyms with hidden, determined type variables

GHC ghc-devs at haskell.org
Fri Apr 6 16:37:54 UTC 2018


#15008: Type synonyms with hidden, determined type variables
-------------------------------------+-------------------------------------
        Reporter:  nomeata           |                Owner:  (none)
            Type:  feature request   |               Status:  new
        Priority:  normal            |            Milestone:  Research
                                     |  needed
       Component:  Compiler          |              Version:  8.5
      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 Iceland_jack):

 I consider this solved by QuantifiedConstraints

 {{{#!hs
 a :: (MonadReader r m, Show r) => m String
 a = fmap show ask
 }}}

 becomes

 {{{#!hs
 -- A type synonym works but is less useful
 class    (forall xx. (MonadReader xx m, Show xx)) => MyMonad m
 instance (forall xx. (monadReader xx m, Show xx)) => MyMonad m

 b :: MyMonad m => m String
 b = fmap show ask
 }}}

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


More information about the ghc-tickets mailing list