November 2015
Intermediate to advanced
166 pages
3h 14m
English
In this chapter, we seek a unified view of "Generic Programming", which comes in many guises; hence the statement,
"Genericity is in the eye of the beholder" | ||
| --Jeremy Gibbons, Datatype-Generic Programming | ||
We start with a broad perspective by reviewing Jeremy Gibbons' patterns of generic programming—many of which we have already encountered. Then we shift focus to one of the patterns—datatype-generic programming—which is characterized by generic functions parameterized by the shape of the datatype instead of the content.
To get a taste of datatype-generic programming, we'll sample three basic approaches: the sum of products, origami programming, and scrap your boilerplate.
Along the way, we'll encounter ...
Read now
Unlock full access