Bulk types with class
Simon Peyton Jones · 1996
Bulk types --- such as lists, bags, sets, finite maps, and priority queues --- are ubiquitous in programming. Yet many languages don't support them well, even though they have received a great deal of attention, especially from the database community. Haskell is currently among the culprits. This paper has two aims: to identify some of the technical difficulties, and to attempt to address them using Haskell's constructor classes. This paper appears in the proceedings of the 1997 Haskell Workshop, Amsterdam, 7 June 1997. A slightly earlier version appears in the (electronic) proceedings of the 1996 Glasgow Functional Programming Workshop: http://www.dcs.gla.ac.uk/fp/workshops/fpw96/Proceedings96.html 1 Introduction Functional programs use a lot of lists, but often a list is actually used to represent: a stack, a queue, a deque, a bag, a set, a finite map (by way of an association list of (key,value) pairs), or a priority queue. Using lists for all of these so-called bulk types is bad ...