enumerate: enumerate all the values in a finite type (automatically)

[ data, library, mit, program ] [ Propose Tags ]

provides (1) a typeclass for enumerating all values in a finite type, (2) a generic instance for automatic deriving, and (3) helpers that reify functions (partial or total, monadic or pure) into a Map.


[Skip to Readme]

Modules

[Last Documentation]

  • Data
    • Data.Enumerate
      • Data.Enumerate.Example
      • Data.Enumerate.Extra
      • Data.Enumerate.Function
      • Data.Enumerate.Large
      • Data.Enumerate.Map
      • Data.Enumerate.Reify
      • Data.Enumerate.Types

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.0.0, 0.1.0, 0.1.1, 0.2.1, 0.2.2
Dependencies base (>=4.8 && <4.9), containers (>=0.5 && <0.6), deepseq (>=1.4 && <1.5), enumerate (==0.0.0), exceptions (>=0.8 && <0.9), ghc-prim (>=0.4 && <0.5), MemoTrie (>=0.6 && <0.7), semigroups (>=0.18 && <0.19), template-haskell (>=2.10 && <2.11), vinyl (>=0.5 && <0.6) [details]
License MIT
Author Sam Boosalis
Maintainer samboosalis@gmail.com
Category Data
Home page https://github.com/sboosali/enumerate
Uploaded by sboo at 2016-05-05T22:01:42Z
Distributions
Reverse Dependencies 1 direct, 0 indirect [details]
Executables example
Downloads 3827 total (13 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs not available [build log]
All reported builds failed as of 2016-11-26 [all 3 reports]

Readme for enumerate-0.1.0

[back to package description]

enumerate

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 automatic deriving, and (3) helpers that reify functions (partial or total, monadic or pure) into a Map.

example

    {-# LANGUAGE DeriveGeneric, DeriveAnyClass #-}
    import Data.Enumerable (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