ScopedTypeVariables does not solve the problem. As you noticed, new s is created and runST is not happy about this. It isOn Mon, Aug 19, 2013 at 1:36 AM, Aurimas <aurimas.anskaitis@vgtu.lt> wrote:
Thanks, this is clearly the most easy way to fix the problem. But the question remains - why the line
"do r1 <- uniformR (-1.0, 1.0 :: Double) gen" cannot be annotated with ST s Double?
Maybe you need ScopedTypeVariables? But I'd be suspicious that, given the forall in the definition of ST, that such a type annotation *always* creates a new `s` and some other way to "force" the type is needed.