Tnaks for the clarification, please see my further questions below On 10/25/08, Daniel Fischer <[EMAIL PROTECTED]> wrote: > > Sure, (g (flip readArray 0)) :: ST s Int, or, explicitly, forall s. ST s Int, > there's nothing to restrict the s, so it's legitimate to pass it to runST. ..[snipped].. > What would be a generic mapST, which type should it have?
I tried this type for mapST, it doesn't work: mapST :: (a -> ST s b) -> [a] -> [b] mapST f (x:xs) = runST (f x) : mapST f xs mapST f [] = [] By your reasoning, (f x) should have type forall s . ST s b, and should match what runST expects, but apparently GHC complains about it. Why? -- Regards, Paul Liu Yale Haskell Group http://www.haskell.org/yale _______________________________________________ Haskell-Cafe mailing list [email protected] http://www.haskell.org/mailman/listinfo/haskell-cafe
