Jump to content

Inheritance/Single: Difference between revisions

Added Haskell.
m (Fixed lang tags.)
(Added Haskell.)
Line 226:
//contents go here...
}</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}}==
845

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.