There are not a whole lot of exercises on this one, because there's a pretty limited scope of what you can do with these classes.
I included deriving-via and the generic-data package, in a "don't worry about how this works, but here's how you do it" presentation -- perhaps a bold choice, but it nicely fills in the gaps in GHC's stock deriving capability with little fuss, and I'm personally of the opinion that it's time to start talking about via as a normal thing to use.
This lesson covers the
Enum
andBounded
classes.There are not a whole lot of exercises on this one, because there's a pretty limited scope of what you can do with these classes.
I included deriving-via and the
generic-data
package, in a "don't worry about how this works, but here's how you do it" presentation -- perhaps a bold choice, but it nicely fills in the gaps in GHC's stock deriving capability with little fuss, and I'm personally of the opinion that it's time to start talking aboutvia
as a normal thing to use.