2009/10/21 michael rice <nowg...@yahoo.com>
>
> There's a thread on the plt-scheme list about creating a function of NO 
> arguments named NEXT that just returns the number of times it's been called, 
> a piece of cake in Scheme, but how would one do this in Haskell? Would the 
> best approach be to use a State monad?

If you really want no argument, not just syntactically in the do
notation, you need ST or IO. Furthermore, you need ST or IO to
allocate a mutable variable that is accessible only to the next
function.

Cheers,
Thu
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to