Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type classes #26

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Type classes #26

wants to merge 1 commit into from

Conversation

BenBals
Copy link

@BenBals BenBals commented Oct 9, 2019

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 BenBals changed the title Type classes (#10) Type classes Oct 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant