On 08/19/2013 04:59 PM, Brandon Allbery wrote:
On Mon, Aug 19, 2013 at 1:36 AM, Aurimas
mailto: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.
ScopedTypeVariables does not solve the problem. As you noticed, new s is created and runST is not happy about this. It is strange that this type can be "forced" replacing given line by a function returning ST s a.