emgm: Extensible and Modular Generics for the Masses
EMGM is a general-purpose library for generic programming with type classes.
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 library provides three main components:
Common
- A common foundation for building generic functions and adding support for datatypes. This includes the collection of datatypes (e.g. sum, product, unit) and type classes (e.g.Generic
,Rep
), that are used throughout the library. This is what you need to define your own generic functions, to add generic support for your datatype, or to define ad-hoc cases.Functions
- A collection of useful generic functions. These work with a variety of datatypes and provide a wide range of operations. For example, there iscrush
, a generalization of the fold functions. It is one of the most useful functions, because it allows you to flexibly extract the elements of a polymorphic container.Data
- Support for using standard datatypes generically. Types such as[a]
, tuples, andMaybe
are built into Haskell or come included in the standard libraries. EMGM provides full support for generic functions on these datatypes. The modules in this component are also useful as guides when adding generic support for your own datatypes.
EMGM originated in the research of Ralf Hinze, Bruno Oliveira, and Andres Löh [1,2]. The library was further explored in a comparison of generic programming libraries by Alexey Rodriguez, et al [3]. Lastly, this released package was developed simultaneously with the writing of lecture notes for the 2008 Advanced Functional Programming Summer School 4. These are good resources for learning how the library works and how to use it, but be aware that names may have been changed to protect the innocent.
Ralf Hinze. Generics for the Masses. In ICFP 2004: Proceedings of the 9th ACM SIGPLAN international conference on Functional programming, pages 236-243. ACM Press, 2004. (http://www.informatik.uni-bonn.de/~ralf/publications.html#P21)
Bruno C. d. S. Oliveira, Ralf Hinze, and Andres Löh. Extensible and Modular Generics for the Masses. In Henrik Nilsson, editor, Trends in Functional Programming, pages 199-216, 2006. (http://web.comlab.ox.ac.uk/publications/publication444-abstract.html)
Alexey Rodriguez, Johan Jeuring, Patrik Jansson, Alex Gerdes, Oleg Kiselyov, and Bruno C. d. S. Oliveira. Comparing Libraries for Generic Programming in Haskell. Technical Report UU-CS-2008-010. Department of Information and Computing Sciences, Utrecht University. (http://www.cs.uu.nl/wiki/bin/view/Alexey/ComparingLibrariesForGenericProgrammingInHaskell)
Johan Jeuring, Sean Leather, José Pedro Magalhães, and Alexey Rodriguez Yakushev. Libraries for Generic Programming in Haskell. Technical Report UU-CS-2008-025. Department of Information and Computing Sciences, Utrecht University. (http://www.cs.uu.nl/research/techreps/UU-CS-2008-025.html)
[Skip to Readme]
Flags
Automatic Flags
Name | Description | Default |
---|---|---|
test | Enable the test configuration: Build the test executable, reduce build time. | Disabled |
hpc | Enable program coverage on test executable. | Disabled |
nolib | Don't build the library. This is useful for speeding up the modify-build-test loop. With "-ftest" (only), the build command will build both the library and the test executable. With "-ftest -fnolib", the build command builds only the test executable. | Disabled |
Use -f <flag> to enable a flag, or -f -<flag> to disable that flag. More info
Downloads
- emgm-0.1.tar.gz [browse] (Cabal source package)
- Package description (as included in the package)
Maintainer's Corner
For package maintainers and hackage trustees
Candidates
- No Candidates
Versions [RSS] | 0.1, 0.2, 0.3, 0.3.1, 0.4 |
---|---|
Dependencies | base (>=3.0), HUnit (>=1.2), QuickCheck (>=2.0) [details] |
Tested with | ghc ==6.8.3, ghc ==6.9.20080916 |
License | BSD-3-Clause |
Copyright | (c) 2008 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 |
Uploaded | by SeanLeather at 2008-09-19T15:33:03Z |
Distributions | |
Reverse Dependencies | 1 direct, 0 indirect [details] |
Executables | test |
Downloads | 4289 total (18 in the last 30 days) |
Rating | (no votes yet) [estimated by Bayesian average] |
Your Rating | |
Status | Docs uploaded by user Build status unknown [no reports yet] |