Loading...
Please wait, while we are loading the content...
Similar Documents
A New Approach to Generic Functional Programming (1999)
| Content Provider | CiteSeerX |
|---|---|
| Abstract | This paper describes a new approach to generic functional programming, which allows us to define functions generically for all datatypes expressible in Haskell. A generic function is one that is defined by induction on the structure of types. Typical examples include pretty printers, parsers, and comparison functions. The advanced type system of Haskell presents a real challenge: datatypes may be parameterized not only by types but also by type constructors, type definitions may involve mutual recursion, and recursive calls of type constructors can be arbitrarily nested. We show that---despite this complexity---a generic function is uniquely defined by giving cases for primitive types and type constructors (such as disjoint unions and cartesian products). Given this information a generic function can be specialized to arbitrary Haskell datatypes. The key idea of the approach is to model types by terms of the simply typed -calculus augmented by a family of recursion operators. While con... |
| File Format | |
| Publisher Date | 1999-01-01 |
| Access Restriction | Open |
| Subject Keyword | Real Challenge Typed Calculus Generic Functional Programming Mutual Recursion Type Constructor Pretty Printer Generic Function Advanced Type System Disjoint Union Comparison Function Recursive Call Typical Example Haskell Datatypes Type Definition Recursion Operator Cartesian Product Key Idea Primitive Type |
| Content Type | Text |
| Resource Type | Article |