HaskellWiki

Haskell | Wiki community | Recent changes
Random page | Special pages

 

Not logged in
Log in | Help

Applications and libraries/Generic programming/Template

< Applications and libraries | Generic programming

Contents

1 Approach: The name of the approach

2 Required features/Portability

3 Expressibility

4 Subset of data types covered

Here is a list provided by Stephanie:

  records
  nested datatypes
  higher-kinded types (what kinds?)
  datatypes with existential components (both of kind type and  
  higher kinds)
  datatypes with first-class polymorphic components (both of kind  
  type and higher kinds)
  above with class constraints
  GADTs (simple, and those that subsume existentials...)
  datatypes with higher-kinded type arguments

5 Usage

Stephanie Weirich gave a good description of possible users of the library. Here is that description (slightly modified):

A Generic library has several important components: the "framework" or way of representing a particular type, instances of this framework for the primitive types, helper functions for creating instances for new types, and a base set of generic operations/support code to get things started. The "Library writer" is responsible for all of these.

A user of the generic library may want to do two things:

  (a) define new type-indexed functions
  (b) ensure that their datatypes can be used with type-indexed functions

In Bruno's terminology,

  - Power User: does both of these
  - User: does (b) but not (a)
  - End User: does neither, just calls existing type-indexed functions on existing datatypes.

Note that we could imagine eliminating/automating (b) for some platforms with Template Haskell or an external tool like DrIFT.


6 Error Messages

7 Amount of work per data type (Boilerplate)

8 Extensibility

9 Reasoning

10 Performance considerations

11 Helpful extra features

12 Discussion

Overall discussion

Retrieved from "http://www.haskell.org/haskellwiki/Applications_and_libraries/Generic_programming/Template"

This page has been accessed 296 times. This page was last modified 12:53, 11 May 2007. Recent content is available under a simple permissive license.