[Haskell-cafe] Re: Wikipedia on first-class object
Cristian Baboi
cristian.baboi at gmail.com
Fri Dec 28 12:33:55 EST 2007
On Fri, 28 Dec 2007 18:27:29 +0200, Achim Schneider <barsoap at web.de> wrote:
> Wolfgang Jeltsch <g9ks157k at acme.softbase.org> wrote:
>
>> Am Freitag, 28. Dezember 2007 07:49 schrieben Sie:
>> > On Thu, 27 Dec 2007 18:19:47 +0200, Wolfgang Jeltsch
>> > <g9ks157k at acme.softbase.org> wrote:
>> > > Am Donnerstag, 27. Dezember 2007 16:34 schrieb Cristian Baboi:
>> > >> I'll have to trust you, because I cannot test it.
>> > >>
>> > >> let x=(1:x); y=(1:y) in x==y .
>> > >>
>> > >> I also cannot test this:
>> > >>
>> > >> let x=(1:x); y=1:1:y in x==y
>> > >
>> > > In these examples, x and y denote the same value but the result
>> > > of x == y is _|_ (undefined) in both cases. So (==) is not
>> > > really equality in Haskell but a kind of weak equality: If x
>> > > doesn’t equal y, x == y is False, but if x equals y, x == y might
>> > > be True or undefined.
>> >
>> > Thank you.
>> >
>> > I can only notice that y always has an even number of 1, which is
>> > not the case for x :-)
>>
>> Both have an infinite number of 1. Why do you say “always”? It
>> seems that you think of x and y as “variables” whose values change
>> over time. This is not the case. They both have a single value for
>> all time: the infinite list consisting only of 1.
> Does that then mean that
> [1] = [1,1]
No. If you try to learn Haskell don't listen to me. :-)
More information about the Haskell-Cafe
mailing list