[Haskell-cafe] partial inheritance
Jerzy Karczmarczuk
jerzy.karczmarczuk at unicaen.fr
Sun Jul 17 12:14:44 CEST 2011
Patrick Browne :
> For example, if the class Bird has a flying method can we represent
Penguins
> as a sub-class of Bird without a flying method?
The silliest - from the pedagogical perspective - answer to any
question, is "you don't need it".
But ... in most cases you really don't need it...
When instancing your Bird class you may "forget" to define the flying
methods.
Is this unsuitable for you? The compiler will yell, but this is harmless.
Jerzy Karczmarczuk
PS. Penguins DO fly.
http://www.telegraph.co.uk/news/worldnews/1583517/Flying-penguins-found-by-BBC-programme.html
More information about the Haskell-Cafe
mailing list