
25 Oct
2008
25 Oct
'08
11:55 p.m.
Tnaks for the clarification, please see my further questions below
On 10/25/08, Daniel Fischer
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