Ok , I admit that I ran a patch on hugs-1.4's type checker .... so this
may be a bug in the patch... but the type checker seems to be a bit
relaxed about runST
this program (due to John Launchbury) typechecks and runs in our Hugs :
unsafeST x = runST x
cast :: a -> b
cast x
= unsafeST $
do let v = unsafeST $ newVar undefined
writeVar v x
readVar v
however, cast' does not typecheck
cast' x
= runST (
do let v = runST ( newVar undefined)
writeVar v x
readVar v
)
byron
- Re: runST type error Byron Cook
- Re: runST type error Mark P Jones
