[Haskell-cafe] Composing functions with runST
gale at sefer.org
Mon Jan 1 07:48:03 EST 2007
>> Prelude Control.Monad.ST> runST (return 42)
>> Prelude Control.Monad.ST> (runST . return) 42
>> Couldn't match expected type `forall s. ST s a'
>> against inferred type `m a1'
Brian Hulley wrote:
> Hazarding a guess, I suggest it *might* be due to the fact that
> forall s. ST s a
> forall s. (ST s a)
> whereas you'd need it to mean
> (forall s. ST s) a
> in order for it to unify with (m a).
But then why does "return 42" type successfully as
forall s. (ST s a)? It needs that same unification.
More information about the Haskell-Cafe