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 oce, 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: Maini :type format (lit "hello world") String Maini format (lit "hello world") "hello world" Maini :type format int Int ! String Maini format int 5 "5" Maini :type format (int ^ lit " is " ^ str) Int ! String ! String Maini format (int ^ lit " is " ^ str) 5 "five" "5 is five": The format directive lit

Publication details
Download http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.9.3284
Source http://www.cs.bonn.edu/~ralf/publications/Format.ps.gz
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, 10.1.1.18.9093, 10.1.1.15.6106, 10.1.1.22.7806