Although equal? treats the two as the *same*, they're different lists
because if we modify one (e.g by set-car!) the other won't be affected.
So here comes another question: when we say a function always give the
same output for the same input, what the *same* means here? ídentity
or
On Sun, 2009-01-04 at 16:19 +0800, Evan Laforge wrote:
Although equal? treats the two as the *same*, they're different lists
because if we modify one (e.g by set-car!) the other won't be affected.
So here comes another question: when we say a function always give the
same output for the
So it *looks* like there's only one list created in 'lvl1', but I
can't see where it's turning into a tuple, and I don't understand the
' = : ' stuff,
You're reading it wrong. : is a name.
It's lvl5 = (:) @ Char a2 ([] @ Char) where @ is type application
(instantiation). Triming that, it's
On Jan 3, 2009, at 7:28 AM, Xie Hanjian wrote:
Hi,
I tried this in ghci:
Prelude 1:2:[] == 1:2:[]
True
Does this mean (:) return the same object on same input, or
(==) is not for identity checking? If the later is true, how
can I check two object is the *same* object?
As others have
On 4 Jan 2009, at 18:08, Aaron Tomb wrote:
On Jan 3, 2009, at 7:28 AM, Xie Hanjian wrote:
Hi,
I tried this in ghci:
Prelude 1:2:[] == 1:2:[]
True
Does this mean (:) return the same object on same input, or
(==) is not for identity checking? If the later is true, how
can I check two
On Sun, Jan 04, 2009 at 04:19:38PM +0800, Evan Laforge wrote:
If you don't have set-car!, then identity and equality are impossible
to differentiate.
There's still eqv?. (I wish people wouldn't use eq? as an example of
an identity-comparison operation. It's as underdefined as
unsafePtrEq.)
So
Aaron Tomb at...@galois.com writes:
As others have explained, the == operator doesn't tell you whether two
values are actually stored at the same location in memory.
Nobody yet mentioned that (==) doesn't guarantee *anything* - it's a
user defined function. So while it may and should give
Maybe you could use stable names for this:
http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-Mem-StableName.html
Stable names are a way of performing fast (O(1)), not-quite-exact
comparison between objects. Stable names solve the following problem:
suppose you want to build a
Hi,
I tried this in ghci:
Prelude 1:2:[] == 1:2:[]
True
Does this mean (:) return the same object on same input, or
(==) is not for identity checking? If the later is true, how
can I check two object is the *same* object?
Thanks
Jan
--
jan=callcc{|jan|jan};jan.call(jan)
pgpJa3i8YUIrV.pgp
Thanks guys :-)
* Nicolas Pouillard nicolas.pouill...@gmail.com [2009-01-03 16:39:59 +0100]:
Excerpts from Xie Hanjian's message of Sat Jan 03 16:28:30 +0100 2009:
Hi,
I tried this in ghci:
Prelude 1:2:[] == 1:2:[]
True
Does this mean (:) return the same object on same input, or
2009/1/3 Xie Hanjian jan.h@gmail.com
Hi,
I tried this in ghci:
Prelude 1:2:[] == 1:2:[]
True
Does this mean (:) return the same object on same input,
Also, in functional programming, *every* function returns the same output
for the same input. That's part of the definition of
* Luke Palmer lrpal...@gmail.com [2009-01-03 18:46:50 -0700]:
2009/1/3 Xie Hanjian jan.h@gmail.com
Hi,
I tried this in ghci:
Prelude 1:2:[] == 1:2:[]
True
Does this mean (:) return the same object on same input,
Also, in functional programming, *every* function returns
2009/1/3 Xie Hanjian jan.h@gmail.com
* Luke Palmer lrpal...@gmail.com [2009-01-03 18:46:50 -0700]:
2009/1/3 Xie Hanjian jan.h@gmail.com
Hi,
I tried this in ghci:
Prelude 1:2:[] == 1:2:[]
True
Does this mean (:) return the same object on same input,
Also,
Luke Palmer wrote:
I, like many arrogant Haskellers, reject Scheme and other such impure
languages as functional. At least until I turn on my brain.
If Haskell is functional, then so is Scheme - it's just that Scheme lets
you use IORefs and the IO monad without going to nearly as much
14 matches
Mail list logo