# The emgm package

EMGM is a general-purpose library for datatype-generic programming.

The design is based on the idea of modeling algebraic datatypes as sum-of-product structures. Many datatypes can be modeled this way, and because they all share a common structure, we can write generic functions that work on this structure.

The primary features of the library are:

*A foundation for building generic functions.*EMGM includes a collection of datatypes (e.g. sum, product, and unit) and type classes (e.g.`Generic`

and`Rep`

). Everything you need for defining generic functions and supporting datatypes can be found here.*Many useful generic functions.*These provide a wide range of functionality. For example, there is`crush`

, a generalization of the foldl/foldr functions, that allows you to flexibly extract the elements of a polymorphic container. Now, you can do many of the operations with your container that were previously only available for lists.*Support for standard datatypes.*EMGM supports standard types: primitives (e.g.`Int`

and`Float`

),`Bool`

, lists, tuples,`Maybe`

, etc.

*NOTE:* As of version 0.4, this library does not have Template Haskell for
generating the representation. We are working on another library for a
solution to this problem.

[Skip to Readme]

## Properties

Versions | 0.1, 0.2, 0.3, 0.3.1, 0.4 |
---|---|

Dependencies | base (>=3.0 && <5.0) [details] |

License | BSD3 |

Copyright | (c) 2008 - 2011 Universiteit Utrecht |

Author | Sean Leather, José Pedro Magalhães, Alexey Rodriguez, Andres Löh |

Maintainer | generics@haskell.org |

Category | Generics |

Home page | http://www.cs.uu.nl/wiki/GenericProgramming/EMGM |

Source repository | head: git clone git://github.com/spl/emgm.git |

Uploaded | Wed Sep 21 15:58:05 UTC 2011 by SeanLeather |

Distributions | NixOS:0.4 |

Downloads | 1340 total (21 in the last 30 days) |

Rating | (no votes yet) [estimated by rule of succession] |

Your Rating | |

Status | Docs uploaded by user Build status unknown [no reports yet] Hackage Matrix CI |

## Modules

*Generics*- Generics.EMGM
- Generics.EMGM.Base
*Data**Functions*- Generics.EMGM.Functions.Collect
- Generics.EMGM.Functions.Compare
- Generics.EMGM.Functions.Crush
- Generics.EMGM.Functions.Enum
- Generics.EMGM.Functions.Everywhere
- Generics.EMGM.Functions.Map
- Generics.EMGM.Functions.Meta
- Generics.EMGM.Functions.Read
- Generics.EMGM.Functions.Show
- Generics.EMGM.Functions.Transpose
- Generics.EMGM.Functions.UnzipWith
- Generics.EMGM.Functions.ZipWith

- Generics.EMGM.Representation

- Generics.EMGM

[Index]

## Downloads

- emgm-0.4.tar.gz [browse] (Cabal source package)
- Package description (included in the package)