Writing for both State and StateT

Mark Carroll mark@chaos.x-philes.com
Wed, 23 Apr 2003 09:09:56 -0400 (EDT)


On Tue, 22 Apr 2003, Jon Cast wrote:
(snip)
> Ah, yes the good old monomorphism restriction.  Should have thought
> about that.  The way around this is to make the declaration a function:
>
> > next_random_probability () =
(snip)

Wow, bizarre. Thanks! (And also to Alastair and Derek.) I didn't realise
that my example uses multiparameter typeclasses - maybe that's why I've
had difficulty using the state monads, because I hadn't studied
multiparameter typeclasses, I'd just recognised that something new-to-me
was going on.

-- Mark