On 10/29/11 7:33 PM, Brandon Allbery wrote:
On Sat, Oct 29, 2011 at 16:18, Bas van Dijk<[email protected]>  wrote:

type Run t = ∀ n β. Monad n ⇒ t n β → n (St t β)

foo :: (Monad m, MonadTransControl t) =>  (Run t ->  m α) ->  t m α
foo f = liftControl f

Type checking 'foo' this gives the following error:

    Couldn't match expected type `Run t' with actual type `Run t'

I *think* this might be odd reporting combined with an expected behavior:
  since the forall is embedded in the "type" declaration, the "t" inside the
parens is not the same as the one outside (because each one has its own
"forall" associated with it).

But t is an argument to the type alias, not quantified in it. Shouldn't the type of foo be:

    forall t m a
    .  (Monad m, MonadTransControl t)
    => (Run t -> m a)
    -> t m a

?

--
Live well,
~wren

_______________________________________________
Glasgow-haskell-users mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

Reply via email to