Re: Glasgow haskell vs. Lispworks



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?

.



Relevant Pages

  • Re: Glasgow haskell vs. Lispworks
    ... SML and Haskell do that automatically, ... It could be different string types (fixed length, growing strings, ... and Haskell can use the appropriate comparison function automatically. ... The compiler can't discover my intentions. ...
    (comp.lang.functional)
  • Re: Verbose functional languages?
    ... Yeah, I'd love to have higher-rank types in SML, too. ... I find that the value of laziness is overrated and that strict ... Haskell paper extols laziness, but when it comes down to the details, I've ...
    (comp.lang.functional)
  • is laziness leakier?
    ... After having learned SML and Scheme I've ... "Real World Haskell" yet, so my impressions are just that - ... Abstractions": All non-trivial abstractions, to some degree, are leaky ...
    (comp.lang.functional)
  • Re: Whoa! Do Python and Lisp really have LAMBDA ?
    ... What about Scheme and ML? ... Indeed Haskell does this right. ... SML doesn't have a for loop. ... In Java I think you can't reference a mutable variable from a local class ...
    (comp.lang.lisp)
  • Re: Whoa! Do Python and Lisp really have LAMBDA ?
    ... What about Scheme and ML? ... Indeed Haskell does this right. ... SML doesn't have a for loop. ... In Java I think you can't reference a mutable variable from a local class ...
    (comp.lang.python)