haskell-phrasebook icon indicating copy to clipboard operation
haskell-phrasebook copied to clipboard

Type classes

Open BenBals opened this issue 6 years ago • 0 comments

I think the main aspect of typeclasses is defining common behavior for a set of types. In this playful example we have a set of character type belonging to the class Playable. Players have a healing power so the class reflects that. The example illustrates that the class instances can work differently from each other (warriors have a constant healing power, mages not).

I hope you like the example.

In reference to issue #10.

BenBals avatar Oct 09 '19 07:10 BenBals