Re: Glasgow haskell vs. Lispworks
- From: rossberg@xxxxxxxxxxxx
- Date: Sat, 11 Aug 2007 13:41:15 -0700
On 11 Aug., 14:22, Rainer Joswig <jos...@xxxxxxx> wrote:
* identity (is this really the same thing?)
* value (does it have the same value?)
* structural (does is have the same structure?)
* fuzzy (is it same up to some limit?)
and so on.
Neither of these does The Right Thing in general. E.g. when you have
data structures that are largely structural, but contain a few mutable
nodes somewhere inside (say a tree carrying some mutable infos). The
right thing would be choosing different notions of equality on
different nodes. SML and Haskell do that automatically, thanks to
typing. E.g. in SML,
val r = ref 1
[r, r] = [r, r] (* true *)
[r, r] = [r, ref 1] (* false *)
Note that the lists are compared structurally, while the contained
references are compared by identity - which is the only definition of
equality properly mirroring observational equivalence.
Haskell denies you this particular flexibility, but in exchange you
gain the ability to have compiler discover your intentions using the
types of your terms. Pairs, lists and trees all have distinct types,
and Haskell can use the appropriate comparison function automatically.
The compiler can't discover my intentions. That would be AI.
I'm confused. Is that a proof that SML and Haskell do not exist?
.
- Follow-Ups:
- Re: Glasgow haskell vs. Lispworks
- From: Rainer Joswig
- Re: Glasgow haskell vs. Lispworks
- References:
- Glasgow haskell vs. Lispworks
- From: Rene de Visser
- Re: Glasgow haskell vs. Lispworks
- From: Rainer Joswig
- Re: Glasgow haskell vs. Lispworks
- From: Stuart Cook
- Re: Glasgow haskell vs. Lispworks
- From: Rainer Joswig
- Glasgow haskell vs. Lispworks
- Prev by Date: Re: Newbie Question: Is it allowed for the function to change the value of parameters?
- Next by Date: Re: Glasgow haskell vs. Lispworks
- Previous by thread: Re: Glasgow haskell vs. Lispworks
- Next by thread: Re: Glasgow haskell vs. Lispworks
- Index(es):
Relevant Pages
|