
27 Aug
2010
27 Aug
'10
9:19 a.m.
On Friday 27 August 2010 14:54:53, Patrick Browne wrote:
class BEING human => HUMAN human where
At this point there is no additional functionality is defined for the subclass HUMAN 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) Admittedly, the notation for subclasses in Haskell is backwards. The corresponding situation for Java interfaces (which are roughly analogous to type classes) would be interface BEING{ ... } interface HUMAN extends BEING{ ... }