[GHC] #12418: Make `MonadCont (ContT r m)` polykinded (r::k), (m::k -> Type)

GHC ghc-devs at haskell.org
Fri Jul 22 02:48:35 UTC 2016


#12418: Make `MonadCont (ContT r m)` polykinded (r::k), (m::k -> Type)
-------------------------------------+-------------------------------------
        Reporter:  Iceland_jack      |                Owner:
            Type:  feature request   |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Core Libraries    |              Version:  8.0.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 Iceland_jack):

 In the syntax of #12045 (which I hope to continue working on soon), a
 fully explicit instance might look like:

 {{{#!hs
 instance forall k (r::k) (m::k -> Type). MonadCont (ContT @k r m) where
   callCC :: ((a -> ContT @k r m b) -> ContT @k r m a) -> ContT @k r m a
   callCC = callCC'
 }}}

 and if we wanted the current version for some reason as defined in
 [https://hackage.haskell.org/package/mtl-2.2.1/docs/src/Control-Monad-
 Cont-Class.html Control.Monad.Cont.Class] (which doesn't seem to have
 `PolyKinds` enabled)

 {{{#!hs
 instance forall (r::Type) (m::Type -> Type). MonadCont (ContT @Type r m)
 where
   callCC :: ((a -> ContT @Type r m b) -> ContT @Type r m a) -> ContT @Type
 r m a
   callCC = callCC'
 }}}

 This could be displayed in `:info`, possibly given some flag or hiding
 given some smart heuristic.

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


More information about the ghc-tickets mailing list