
16 Mar
2005
16 Mar
'05
5:02 a.m.
On Wed, Mar 16, 2005 at 10:51:08AM +0100, Nicolas Oury wrote:
Thanks for your help.
Are there other ways to implement a counter in Haskell?
Using a State monad?
If I use your example on :
test = let Node x l = enumeratedTree ( Node 'a' [undefined, Node 'b' []]) in tail l
GHCI answers [Node (*** Exception: Prelude.undefined A monadic counter imposes an order of evaluation. In my program, I don't care about the order of the numbers. I only want them to be all different. I think a monad is too restrictive for what I need.
OK, I understand. In this situation you probably want either splittable name supply. Let me get back to your first post... Best regards Tomasz