Publication View

Under consideration for publication in J. Functional Programming 1 FUNCT I ONAL PEARL (2007)

Abstract
Introduction When I was a student, Simula was one of the languages taught in introductory programming language courses and I vividly remember a sticker one of our instructors had attached to the door of his o#ce, saying "Simula does it with class". I guess the same holds for Haskell except that Haskell replaces classes by type classes. Armed with singleton types, multiple-parameter type classes, and functional dependencies we reconsider a problem raised and solved by Danvy in a previous pearl (1998). The challenge is to implement a variant of C's printf function, called format below, in a statically typed language. Here is an interactive session that illustrates the problem. Main# :type format (lit "hello#world") Main# format (lit "hello#world") "hello#world" Main# :type format int Main# format int 5 "5" Main# :type format (int ^ lit "#is#" ^ str) Main# format (int ^ lit "#is#" ^ str) 5 "five" The format directive lit s means emit s literally. The directives int and st

Publication details
Download http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.5.3460
Source http://www.cs.nott.ac.uk/~gmh/wgp01/hinze-paper.pdf
Contributors CiteSeerX
Repository CiteSeerX - Scientific Literature Digital Library and Search Engine (United States)
Type text
Language English
Relation 10.1.1.47.155, 10.1.1.130.789, 10.1.1.16.3964