Typeclasses: ad-hoc polymorphism in Haskell
Due Wednesday Sept 11 @ 9 am
From this assignment, students will show...
Functional Programming - Recall
by using functions that use ad hoc polymorphism (via typeclasses).
Abstractions and Representations - Recall
by instantiating typeclasses for a new datatype.
You will need...
- a git client (command line) or access to the web cs github interface
- a text editor
- access to the Exemplars GitHub Repo and your private homework repo
- access to stack and haskell-platform -- either locally or on the homework servers.
Let's begin
Please do the 5 examples outlined in comments in src/Lib.hs
Step-by-step instruction
Typeclasses: Ad-hoc polymorphism (vs parametric polymorphism)
Using common Typeclasses
Typeclasses and inference
Defining new Typeclasses
META.md
META.md should include
- your name
- your utln
- how much time you spent on this assignment
- the witness "proof" for how you earned each learning objective
Further Reading
Ch. 6 of Haskell Programming from first principles has great activities on
Typeclasses.
Please Submit
Contents to be submitted
- your copy of the typeclasses project
- META.md
Method of submission
Please commit your changes in the hw02-1 directory of your private repo.