On 01/01/07, Yitzchak Gale <[EMAIL PROTECTED]> wrote:
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#universal-quantification -- -David House, [EMAIL PROTECTED] _______________________________________________ Haskell-Cafe mailing list [email protected] http://www.haskell.org/mailman/listinfo/haskell-cafe
