[Haskell-cafe] Composing functions with runST

Yitzchak Gale gale at sefer.org
Mon Jan 1 06:02:13 EST 2007


Can anyone explain the following behavior (GHCi 6.6):

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'
    In the second argument of `(.)', namely `return'
    In the expression: (runST . return) 42
    In the definition of `it': it = (runST . return) 42

Thanks,
Yitz


More information about the Haskell-Cafe mailing list