global variable

Chris Johansen johansen at main.nc.us
Wed Oct 22 23:40:12 EDT 2003


On Sun, 12 Oct 2003 19:32:14 +0100, Glynn Clements 
<glynn.clements at virgin.net> wrote:

> Jose Morais wrote:
>
>> 	I need a function called, say, newItem :: Int,
>> that when first called returns 1, the next time it
>> is called it would return 2, then 3 and so
>> on.
>
> That isn't a function. A function is a mapping from
> argument values to result values; the result depends
> solely upon the argument.

Why isn't newItem a function that maps an argument (say lastValue) to the 
same argument (lastValue) incremented by one?

Does Haskell support recursion?

Just a learner's ignorant questions.

Regards,
-- 
Chris Johansen {johansen at main dot nc dot us}


More information about the Hugs-Users mailing list