[Haskell-cafe] Control.Monad.Cont fun

Thomas Jäger thjaeger at gmail.com
Mon Jul 25 21:06:46 EDT 2005


Hello Andrew,

On 7/25/05, Andrew Pimlott <andrew at pimlott.net> wrote:
>     getCC :: Cont r (Cont r a)
>     getCC = ccc (\(c :: Cont r a -> (forall b. Cont r b)) ->
>                     let x :: forall b. Cont r b = c x in x)
>
> gives
>
> [Error]
ghc-6.2 accepts this:
  getCC :: Cont r (Cont r a)
  getCC = ccc (\(c :: Cont r a -> (forall b. Cont r b)) ->
               let x :: forall b. Cont r b; x = c x in c x)

ghc-6.4/6.5 will also give the mysterious error above, but the
following works fine, thanks to scoped type variables:
  getCC :: forall a r. Cont r (Cont r a)
  getCC = ccc (\c ->
               let x :: forall b. Cont r b; x = c x in x)

> for which I have no riposte.  Is this a bug?
I would think so. I can't find anything in the documentation that
disallows such polymorphic type annotations.

Thomas


More information about the Haskell-Cafe mailing list