generic-deriving-1.9.0: Generic programming library for generalised deriving.

Safe Haskell | None
Language | Haskell98

Generics.Deriving.Enum

Contents

- Generic enum class
- Default definitions for GEnum
- Generic Ix class
- Default definitions for GIx

Synopsis

- class GEnum a where
  - genum :: [a]
- genumDefault :: (Generic a, Enum' (Rep a)) => [a]
- toEnumDefault :: (Generic a, Enum' (Rep a)) => Int -> a
- fromEnumDefault :: (GEq a, Generic a, Enum' (Rep a)) => a -> Int
- class Ord a => GIx a where
  - range :: (a, a) -> [a]
  - index :: (a, a) -> a -> Int
  - inRange :: (a, a) -> a -> Bool
- rangeDefault :: (GEq a, Generic a, Enum' (Rep a)) => (a, a) -> [a]
- indexDefault :: (GEq a, Generic a, Enum' (Rep a)) => (a, a) -> a -> Int
- inRangeDefault :: (GEq a, Generic a, Enum' (Rep a)) => (a, a) -> a -> Bool

# Generic enum class

class GEnum a where Source

Minimal complete definition

Nothing

Methods

genum :: [a] Source

Instances

GEnum Bool Source |
GEnum Double Source |
GEnum Float Source |
GEnum Int Source |
GEnum Int8 Source |
GEnum Int16 Source |
GEnum Int32 Source |
GEnum Int64 Source |
GEnum Integer Source |
GEnum Ordering Source |
GEnum Word Source |
GEnum Word8 Source |
GEnum Word16 Source |
GEnum Word32 Source |
GEnum Word64 Source |
GEnum () Source |
GEnum CDev Source |
GEnum CIno Source |
GEnum CMode Source |
GEnum COff Source |
GEnum CPid Source |
GEnum CSsize Source |
GEnum CGid Source |
GEnum CNlink Source |
GEnum CUid Source |
GEnum CCc Source |
GEnum CSpeed Source |
GEnum CTcflag Source |
GEnum CRLim Source |
GEnum Fd Source |
GEnum WordPtr Source |
GEnum IntPtr Source |
GEnum CChar Source |
GEnum CSChar Source |
GEnum CUChar Source |
GEnum CShort Source |
GEnum CUShort Source |
GEnum CInt Source |
GEnum CUInt Source |
GEnum CLong Source |
GEnum CULong Source |
GEnum CLLong Source |
GEnum CULLong Source |
GEnum CFloat Source |
GEnum CDouble Source |
GEnum CPtrdiff Source |
GEnum CSize Source |
GEnum CWchar Source |
GEnum CSigAtomic Source |
GEnum CClock Source |
GEnum CTime Source |
GEnum CUSeconds Source |
GEnum CSUSeconds Source |
GEnum CIntPtr Source |
GEnum CUIntPtr Source |
GEnum CIntMax Source |
GEnum CUIntMax Source |
GEnum All Source |
GEnum Any Source |
GEnum Arity Source |
GEnum Fixity Source |
GEnum Associativity Source |
GEnum a => GEnum [a] Source |
GEnum (U1 p) Source |
GEnum p => GEnum (Par1 p) Source |
GEnum a => GEnum (Identity a) Source |
GEnum a => GEnum (ZipList a) Source |
GEnum a => GEnum (Dual a) Source |
GEnum a => GEnum (Sum a) Source |
GEnum a => GEnum (Product a) Source |
GEnum a => GEnum (First a) Source |
GEnum a => GEnum (Last a) Source |
GEnum a => GEnum (Maybe a) Source |
(GEnum a, GEnum b) => GEnum (Either a b) Source |
GEnum (f p) => GEnum (Rec1 f p) Source |
(GEnum a, GEnum b) => GEnum (a, b) Source |
GEnum a => GEnum (Const a b) Source |
GEnum (Proxy * s) Source |
GEnum c => GEnum (K1 i c p) Source |
(GEnum (f p), GEnum (g p)) => GEnum ((:+:) f g p) Source |
(GEnum (f p), GEnum (g p)) => GEnum ((:*:) f g p) Source |
GEnum (f (g p)) => GEnum ((:.:) f g p) Source |
(GEnum a, GEnum b, GEnum c) => GEnum (a, b, c) Source |
GEnum (f a) => GEnum (Alt * f a) Source |
GEnum (f p) => GEnum (M1 i c f p) Source |
(GEnum a, GEnum b, GEnum c, GEnum d) => GEnum (a, b, c, d) Source |
(GEnum a, GEnum b, GEnum c, GEnum d, GEnum e) => GEnum (a, b, c, d, e) Source |
(GEnum a, GEnum b, GEnum c, GEnum d, GEnum e, GEnum f) => GEnum (a, b, c, d, e, f) Source |
(GEnum a, GEnum b, GEnum c, GEnum d, GEnum e, GEnum f, GEnum g) => GEnum (a, b, c, d, e, f, g) Source |

# Default definitions for GEnum

genumDefault :: (Generic a, Enum' (Rep a)) => [a] Source

toEnumDefault :: (Generic a, Enum' (Rep a)) => Int -> a Source

fromEnumDefault :: (GEq a, Generic a, Enum' (Rep a)) => a -> Int Source

# Generic Ix class

class Ord a => GIx a where Source

Minimal complete definition

Nothing

Methods

range :: (a, a) -> [a] Source

The list of values in the subrange defined by a bounding pair.

index :: (a, a) -> a -> Int Source

The position of a subscript in the subrange.

inRange :: (a, a) -> a -> Bool Source

Returns `True` the given subscript lies in the range defined the bounding pair.

Instances

GIx Bool Source |
GIx Int Source |
GIx Int8 Source |
GIx Int16 Source |
GIx Int32 Source |
GIx Int64 Source |
GIx Integer Source |
GIx Ordering Source |
GIx Word Source |
GIx Word8 Source |
GIx Word16 Source |
GIx Word32 Source |
GIx Word64 Source |
GIx () Source |
GIx Natural Source |
GIx CIno Source |
GIx CMode Source |
GIx COff Source |
GIx CPid Source |
GIx CSsize Source |
GIx CGid Source |
GIx CNlink Source |
GIx CUid Source |
GIx CTcflag Source |
GIx CRLim Source |
GIx Fd Source |
GIx WordPtr Source |
GIx IntPtr Source |
GIx CChar Source |
GIx CSChar Source |
GIx CUChar Source |
GIx CShort Source |
GIx CUShort Source |
GIx CInt Source |
GIx CUInt Source |
GIx CLong Source |
GIx CULong Source |
GIx CLLong Source |
GIx CULLong Source |
GIx CPtrdiff Source |
GIx CSize Source |
GIx CWchar Source |
GIx CSigAtomic Source |
GIx CIntPtr Source |
GIx CUIntPtr Source |
GIx CIntMax Source |
GIx CUIntMax Source |
GIx All Source |
GIx Any Source |
GIx Arity Source |
GIx Fixity Source |
GIx Associativity Source |
(GEq a, GEnum a, GIx a) => GIx [a] Source |
(GEq a, GEnum a, GIx a) => GIx (Identity a) Source |
(GEq a, GEnum a, GIx a) => GIx (Dual a) Source |
(GEq a, GEnum a, GIx a) => GIx (Sum a) Source |
(GEq a, GEnum a, GIx a) => GIx (Product a) Source |
(GEq a, GEnum a, GIx a) => GIx (First a) Source |
(GEq a, GEnum a, GIx a) => GIx (Last a) Source |
(GEq a, GEnum a, GIx a) => GIx (Maybe a) Source |
(GEq a, GEnum a, GIx a, GEq b, GEnum b, GIx b) => GIx (Either a b) Source |
(GEq a, GEnum a, GIx a, GEq b, GEnum b, GIx b) => GIx (a, b) Source |
GIx (Proxy * s) Source |
(GEq a, GEnum a, GIx a, GEq b, GEnum b, GIx b, GEq c, GEnum c, GIx c) => GIx (a, b, c) Source |
(GEq (f a), GEnum (f a), GIx (f a)) => GIx (Alt * f a) Source |
(GEq a, GEnum a, GIx a, GEq b, GEnum b, GIx b, GEq c, GEnum c, GIx c, GEq d, GEnum d, GIx d) => GIx (a, b, c, d) Source |
(GEq a, GEnum a, GIx a, GEq b, GEnum b, GIx b, GEq c, GEnum c, GIx c, GEq d, GEnum d, GIx d, GEq e, GEnum e, GIx e) => GIx (a, b, c, d, e) Source |
(GEq a, GEnum a, GIx a, GEq b, GEnum b, GIx b, GEq c, GEnum c, GIx c, GEq d, GEnum d, GIx d, GEq e, GEnum e, GIx e, GEq f, GEnum f, GIx f) => GIx (a, b, c, d, e, f) Source |
(GEq a, GEnum a, GIx a, GEq b, GEnum b, GIx b, GEq c, GEnum c, GIx c, GEq d, GEnum d, GIx d, GEq e, GEnum e, GIx e, GEq f, GEnum f, GIx f, GEq g, GEnum g, GIx g) => GIx (a, b, c, d, e, f, g) Source |

# Default definitions for GIx

rangeDefault :: (GEq a, Generic a, Enum' (Rep a)) => (a, a) -> [a] Source

indexDefault :: (GEq a, Generic a, Enum' (Rep a)) => (a, a) -> a -> Int Source

inRangeDefault :: (GEq a, Generic a, Enum' (Rep a)) => (a, a) -> a -> Bool Source