Inheritance/Single: Difference between revisions
Content added Content deleted
m (Fixed lang tags.) |
Underscore (talk | contribs) (Added Haskell.) |
||
Line 226: | Line 226: | ||
//contents go here... |
//contents go here... |
||
}</lang> |
}</lang> |
||
=={{header|Haskell}}== |
|||
A type can't inherit properties from other types, but it can belong to any number of type classes, which may themselves be subclasses of other type classes. |
|||
<lang haskell>class Animal a where |
|||
class Animal a => Cat a where |
|||
class Animal a => Dog a where |
|||
class Dog a => Lab a where |
|||
class Dog a => Collie a where</lang> |
|||
=={{header|HaXe}}== |
=={{header|HaXe}}== |