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 primary features of the library are:
A platform for building generic functions and adding support for user-defined datatypes.
EMGM includes an important collection of datatypes (e.g. sum, product, and
unit) and type classes (e.g. Generic
and Rep
). Everything you need for
your own generic functions or datatypes can be found here.
Many useful generic functions.
These provide a wide range of functionality. For example, there is crush
(Generics.EMGM.Functions.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.
Different generic functions work with different kinds of types as well. For
example, collect
(Generics.EMGM.Functions.Collect) works with any fully
applied type while bimap
(Generics.EMGM.Functions.Map) only works with
bifunctor types such as Either
or (,)
(pairs).
Support for standard and user-defined datatypes.
EMGM provides full support for standard types such as []
(lists), tuples,
and Maybe
as well as many types you define in your own code. Using the
Template Haskell functions provided in Generics.EMGM.Derive, it is very
simple to add support for using generic functions with your datatype
For more information on EMGM, see http://www.cs.uu.nl/wiki/GenericProgramming/EMGM
[Skip to Readme]
Modules
[Index]
- Generics
- Generics.EMGM
- Generics.EMGM.Common
- Data
- Generics.EMGM.Derive
- Generics.EMGM.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.Read
- Generics.EMGM.Functions.Show
- Generics.EMGM.Functions.UnzipWith
- Generics.EMGM.Functions.ZipWith
- Generics.EMGM
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.3.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 && <4.0), HUnit (>=1.2 && <1.3), QuickCheck (>=2.1 && <2.2), template-haskell (>=2.2 && <2.4) [details] |
License | BSD-3-Clause |
Copyright | (c) 2008, 2009 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 2009-03-03T11:21:43Z |
Distributions | |
Reverse Dependencies | 1 direct, 0 indirect [details] |
Executables | test |
Downloads | 4131 total (6 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] |