[Haskell-cafe] type classes and logic
sebf at informatik.uni-kiel.de
Sat Aug 28 09:39:32 EDT 2010
> Daniel Fischer wrote:
>>> class BEING human => HUMAN human where
>>> Sub-classing is logical implication BEING(human) => HUMAN(human)
>>> All types t that make BEING(t) = true also make HUMAN(t)=true
>> No, it's the other way round. Every HUMAN is also a BEING, hence
>> HUMAN(t) => BEING(t)
> Could I say that HUMAN is a subset of BEING?
That depends on whether predicates are sets.. But yes, every instance
of HUMAN is also an instance of BEING, hence, the set of HUMAN
instances is a subset of the set of BEING instances.
> In the light of the above examples how should I interpret the
> class-to-subclass relation as logical implication? Is it
> a) If BEING then HUMAN (sufficient condition): BEING => HUMAN
> b) HUMAN is true only if BEING (necessary condition): HUMAN => BEING
> c) Neither?
b). Every HUMAN is a BEING.
Underestimating the novelty of the future is a time-honored tradition.
More information about the Haskell-Cafe