[Haskell-cafe] 0/0 > 1 == False

Ketil Malde ketil+haskell at ii.uib.no
Thu Jan 10 05:37:32 EST 2008


"Yitzchak Gale" <gale at sefer.org> writes:

>> In the semantic domain there is one bottom.
>> In Haskell there are many expressions that represent bottom.
>> One cannot test those for equality.

If we are being pedantic, I can define

    data Foo = Foo
    instance Eq Foo where _ == _ = True

    (undefined :: Foo) == Foo
    --> True

>> The result of a Haskell function applied to some arguments cannot be
>> bottom.

This function is bottom for any argument:

   f x = undefined

> I think you mean that they cannot be bottom if you want
> to compare them for equality. Yes.

See above.  What is the precise term for describing this?  Structural
equality?

On the other hand, some bottoms are exceptions, you may be able to
catch them and do something useful with them after all, no?  How does
that fit in?

-k
-- 
If I haven't seen further, it is by standing in the footprints of giants


More information about the Haskell-Cafe mailing list