Bulat Ziganshin wrote:

the following code can't go through typechecking
> import Control.Monad.ST
> import Data.Array.ST
> main = print $ runST $
>            do arr <- newArray (1,10) 127
>               a <- readArray arr 1
>               writeArray arr 1 216
>               b <- readArray arr 1
>               return (a,b)


Indeed. The short answer: use 
        runST (long expression) 
rather than
        runST $ long expression 

when it comes to higher-ranked functions such as runST.
A longer answer:
        http://www.haskell.org/pipermail/haskell-cafe/2004-December/008062.html

> let me know what i need to read to fix it myself
MLF (see Daan Leijen, A. Loeh, `Qualified types for MLF', ICFP05)


_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to