
1 Jan
2007
1 Jan
'07
8:45 a.m.
On 01/01/07, Yitzchak Gale
It seems that I can't even use STRefs. Something is really wrong here.
Prelude Control.Monad.ST Data.STRef> runST $ do {r<-newSTRef 2; readSTRef r}
Again, this is due to section 7.4.8 [1] of the GHC user manual, which states that you can't instantiate a type variable with a type involving a forall. You're trying to unify the first parameter of ($) :: a -> b -> a with (forall s. ST s a -> a), which is illegal. Using parentheses works: runST (do r <- newSTRef 2; readSTRef r) However, I'm as much in the dark as you are as to _why_ this is illegal. [1]: http://haskell.org/ghc/docs/latest/html/users_guide/type-extensions.html#uni... -- -David House, dmhouse@gmail.com