The enumerate package

[Tags:library, mit, program]

provides

see the Enumerable module for extensive documentation.


[Skip to Readme]

Properties

Versions 0.0.0, 0.1.0, 0.1.1, 0.2.1, 0.2.2
Dependencies array (>=0.5), base (>=4.7 && <5), containers (>=0.5), deepseq (>=1.3), dump-core, enumerate, ghc-prim (>=0.3), spiros, template-haskell (>=2.9), vinyl (>=0.5) [details]
License MIT
Author Sam Boosalis
Maintainer samboosalis@gmail.com
Category Data
Home page https://github.com/sboosali/enumerate
Source repository head: git clone https://github.com/sboosali/enumerate
Uploaded Tue May 2 20:11:49 UTC 2017 by sboo
Distributions NixOS:0.2.2
Downloads 244 total (78 in the last 30 days)
Votes
0 []
Status Docs available [build log]
Last success reported on 2017-05-02 [all 1 reports]

Modules

[Index]

Flags

NameDescriptionDefaultType
dump-coreDump HTML for the core generated by GHC during compilationDisabledAutomatic

Use -f <flag> to enable a flag, or -f -<flag> to disable that flag. More info

Downloads

Maintainer's Corner

For package maintainers and hackage trustees

Readme for enumerate

Readme for enumerate-0.2.2

enumerate

Hackage Build Status

Enumerate all the values in a finite type (automatically). Provides:

  1. a typeclass for enumerating all values in a finite type,
  2. a generic instance for automatically deriving it, and

example

    {-# LANGUAGE DeriveGeneric, DeriveAnyClass #-}
    import Data.Enumerate (Enumerable(..))
    import Data.Generics (Generics)

    data CrudOp = Add | Edit | Delete | View
     deriving (Eq,Ord,Enum,Bounded,Generic,Enumerable)
    data Route = Home | Person CrudOp | House CrudOp
     deriving (Eq,Ord,Generic,Enumerable)

    >>> enumerated :: [Route]
    [Home, Person Add, Person Edit, Person Delete, Person View, House Add, House Edit, House Delete, House View]

(extensive) documentation:

https://hackage.haskell.org/package/enumerate/docs/Enumerate.html

http://sboosali.github.io/documentation/enumerate/Enumerate.html (when hackage won't build the haddocks)

related:

To reify functions, partial or total, into a Map, see enumerate-function.