MyNixOS website logo
Description

Extensible and Modular Generics for the Masses.

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.

Extensible and Modular Generics for the Masses

Extensible and Modular Generics for the Masses (EMGM) is a library for generic programming in Haskell.

Features

The primary features of EMGM include:

  • Datatype-generic programming using sum-of-product views
  • Large collection of ready-to-use generic functions
  • Included support for standard datatypes: lists, Maybe, tuples
  • Easy to add support for new datatypes
  • Type classes make writing new functions straightforward in a structurally inductive style
  • Generic functions are extensible with ad-hoc cases for arbitrary datatypes
  • Good performance of generic functions

The features of this distribution include:

  • The API is thoroughly documented with Haddock
  • Fully tested with QuickCheck and HUnit
  • Program coverage ensures that all useful code has been touched by tests

Examples

You can find examples of using EMGM in the examples directory of the source distribution.

Bugs & Support

To report bugs, use the Google Code project page for EMGM.

For general concerns and questions, use the Generics mailing list.

Metadata

Version

0.4

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows