[Haskell-cafe] Re: Wikipedia on first-class object

Cristian Baboi cristian.baboi at gmail.com
Sun Dec 30 13:31:16 EST 2007


On Sun, 30 Dec 2007 20:24:23 +0200, Daniel Fischer  
<daniel.is.fischer at web.de> wrote:

> Am Sonntag, 30. Dezember 2007 19:04 schrieb Cristian Baboi:
>> On Sun, 30 Dec 2007 20:00:05 +0200, Daniel Fischer
>>
>> <daniel.is.fischer at web.de> wrote:
>> > Am Sonntag, 30. Dezember 2007 18:16 schrieb Cristian Baboi:
>> >> A simple question:
>> >>
>> >> Can you write the value of x to a file where x = (1:x) ?
>> >
>> > Not in finite time and space :)
>>
>> I used the word 'value' by mistake.
>> A notation of the value of x.

> I suppose
> let x = 1:x in x
> is not what you're after?

Yes! Can Haskell do the same ?

I mean this:

module Module where

a= let x=1:x in x

main = <do something to write a (a notation for a) to file>

The function must work if one change a to let x=2:x in x, let x=1:2:3:x  
and variations on the same theme.





More information about the Haskell-Cafe mailing list