I wrote:
Prelude Control.Monad.ST> runST (return 42)
42
Prelude Control.Monad.ST> (runST . return) 42

<interactive>:1:9:
   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

means

    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.

-Yitz
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to