Nigel writes:
> [Note: Hope+C is not totally sound - but this is not due to the type
> system itself but rather to the existance of the unsafe (and
> untypeable) polymorphic equality function (alpha # alpha -> truval).
> As in many (most?)  functional languages this function is a bit-level
> compare... you can apply it to functions... infinite objects and get
> true...
Which are these many languages?  In LML (what other example would I
choose :-) equality is a partial function, applying it to functions
or infinite values will give you bottom (as you would expect).

>         It should really be removed, but everybody likes it! The
> auto-generation of equality functions as in Haskell solves some of the
> problems (type unsoundnes) and not others (equality of user-defined
> abstract data types where structural equality is not correct), but is
> a step in the right direction.]
The equality in Haskell is only auto-generated if you ask for it.
If you want your own equality for an abstract type in Haskell you just
define it; it's dead easy.  If you don't want equality at all, just don't
define it and there will be none.  So Haskell solves those problems
in the right way.

        -- Lennart


Reply via email to