@hackage derive-enumerable0.2.0
Generic instances for enumerating complex data types
Categories
License
GPL-3.0-only
Maintainer
Evan Cofsky <evan@theunixman.com>
Links
Versions
Installation
Dependencies (2)
- base >=4.7 && <4.8
- data-default >=0.5.0 Show all…
Dependents (1)
@hackage/acme-everything
Derive-enumerable
Generalized equivalent to doing [minBound..maxBound]
but on complex types.
λ :m +Data.Enumerable.Generic
λ :set -XDeriveGeneric
λ data Flag = Flag Bool Word8 deriving (Show, Generic)
λ instance Enumerable Flag
λ instance Default Flag where def = Flag False 0
λ allEnum :: [Flag]
[Flag False 0,Flag True 0,Flag False 1, (..snip..) Flag False 255,Flag True 255]