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

Safe HaskellTrustworthy
LanguageHaskell2010

Generics.Deriving.Enum

Contents

Synopsis

Generic enum class

class GEnum a where Source #

Methods

genum :: [a] Source #

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

Instances

GEnum Bool Source # 

Methods

genum :: [Bool] Source #

GEnum Double Source # 

Methods

genum :: [Double] Source #

GEnum Float Source # 

Methods

genum :: [Float] Source #

GEnum Int Source # 

Methods

genum :: [Int] Source #

GEnum Int8 Source # 

Methods

genum :: [Int8] Source #

GEnum Int16 Source # 

Methods

genum :: [Int16] Source #

GEnum Int32 Source # 

Methods

genum :: [Int32] Source #

GEnum Int64 Source # 

Methods

genum :: [Int64] Source #

GEnum Integer Source # 

Methods

genum :: [Integer] Source #

GEnum Natural Source # 

Methods

genum :: [Natural] Source #

GEnum Ordering Source # 

Methods

genum :: [Ordering] Source #

GEnum Word Source # 

Methods

genum :: [Word] Source #

GEnum Word8 Source # 

Methods

genum :: [Word8] Source #

GEnum Word16 Source # 

Methods

genum :: [Word16] Source #

GEnum Word32 Source # 

Methods

genum :: [Word32] Source #

GEnum Word64 Source # 

Methods

genum :: [Word64] Source #

GEnum () Source # 

Methods

genum :: [()] Source #

GEnum CDev Source # 

Methods

genum :: [CDev] Source #

GEnum CIno Source # 

Methods

genum :: [CIno] Source #

GEnum CMode Source # 

Methods

genum :: [CMode] Source #

GEnum COff Source # 

Methods

genum :: [COff] Source #

GEnum CPid Source # 

Methods

genum :: [CPid] Source #

GEnum CSsize Source # 

Methods

genum :: [CSsize] Source #

GEnum CGid Source # 

Methods

genum :: [CGid] Source #

GEnum CNlink Source # 

Methods

genum :: [CNlink] Source #

GEnum CUid Source # 

Methods

genum :: [CUid] Source #

GEnum CCc Source # 

Methods

genum :: [CCc] Source #

GEnum CSpeed Source # 

Methods

genum :: [CSpeed] Source #

GEnum CTcflag Source # 

Methods

genum :: [CTcflag] Source #

GEnum CRLim Source # 

Methods

genum :: [CRLim] Source #

GEnum CBlkSize Source # 

Methods

genum :: [CBlkSize] Source #

GEnum CBlkCnt Source # 

Methods

genum :: [CBlkCnt] Source #

GEnum CClockId Source # 

Methods

genum :: [CClockId] Source #

GEnum CFsBlkCnt Source # 

Methods

genum :: [CFsBlkCnt] Source #

GEnum CFsFilCnt Source # 

Methods

genum :: [CFsFilCnt] Source #

GEnum CId Source # 

Methods

genum :: [CId] Source #

GEnum CKey Source # 

Methods

genum :: [CKey] Source #

GEnum Fd Source # 

Methods

genum :: [Fd] Source #

GEnum ExitCode Source # 

Methods

genum :: [ExitCode] Source #

GEnum All Source # 

Methods

genum :: [All] Source #

GEnum Any Source # 

Methods

genum :: [Any] Source #

GEnum Fixity Source # 

Methods

genum :: [Fixity] Source #

GEnum Associativity Source # 
GEnum CChar Source # 

Methods

genum :: [CChar] Source #

GEnum CSChar Source # 

Methods

genum :: [CSChar] Source #

GEnum CUChar Source # 

Methods

genum :: [CUChar] Source #

GEnum CShort Source # 

Methods

genum :: [CShort] Source #

GEnum CUShort Source # 

Methods

genum :: [CUShort] Source #

GEnum CInt Source # 

Methods

genum :: [CInt] Source #

GEnum CUInt Source # 

Methods

genum :: [CUInt] Source #

GEnum CLong Source # 

Methods

genum :: [CLong] Source #

GEnum CULong Source # 

Methods

genum :: [CULong] Source #

GEnum CLLong Source # 

Methods

genum :: [CLLong] Source #

GEnum CULLong Source # 

Methods

genum :: [CULLong] Source #

GEnum CBool Source # 

Methods

genum :: [CBool] Source #

GEnum CFloat Source # 

Methods

genum :: [CFloat] Source #

GEnum CDouble Source # 

Methods

genum :: [CDouble] Source #

GEnum CPtrdiff Source # 

Methods

genum :: [CPtrdiff] Source #

GEnum CSize Source # 

Methods

genum :: [CSize] Source #

GEnum CWchar Source # 

Methods

genum :: [CWchar] Source #

GEnum CSigAtomic Source # 

Methods

genum :: [CSigAtomic] Source #

GEnum CClock Source # 

Methods

genum :: [CClock] Source #

GEnum CTime Source # 

Methods

genum :: [CTime] Source #

GEnum CUSeconds Source # 

Methods

genum :: [CUSeconds] Source #

GEnum CSUSeconds Source # 

Methods

genum :: [CSUSeconds] Source #

GEnum CIntPtr Source # 

Methods

genum :: [CIntPtr] Source #

GEnum CUIntPtr Source # 

Methods

genum :: [CUIntPtr] Source #

GEnum CIntMax Source # 

Methods

genum :: [CIntMax] Source #

GEnum CUIntMax Source # 

Methods

genum :: [CUIntMax] Source #

GEnum WordPtr Source # 

Methods

genum :: [WordPtr] Source #

GEnum IntPtr Source # 

Methods

genum :: [IntPtr] Source #

GEnum a => GEnum [a] Source # 

Methods

genum :: [[a]] Source #

GEnum a => GEnum (Maybe a) Source # 

Methods

genum :: [Maybe a] Source #

GEnum p => GEnum (Par1 p) Source # 

Methods

genum :: [Par1 p] Source #

GEnum a => GEnum (Complex a) Source # 

Methods

genum :: [Complex a] Source #

GEnum a => GEnum (Min a) Source # 

Methods

genum :: [Min a] Source #

GEnum a => GEnum (Max a) Source # 

Methods

genum :: [Max a] Source #

GEnum a => GEnum (First a) Source # 

Methods

genum :: [First a] Source #

GEnum a => GEnum (Last a) Source # 

Methods

genum :: [Last a] Source #

GEnum m => GEnum (WrappedMonoid m) Source # 

Methods

genum :: [WrappedMonoid m] Source #

GEnum a => GEnum (Option a) Source # 

Methods

genum :: [Option a] Source #

GEnum a => GEnum (NonEmpty a) Source # 

Methods

genum :: [NonEmpty a] Source #

GEnum a => GEnum (ZipList a) Source # 

Methods

genum :: [ZipList a] Source #

GEnum a => GEnum (Identity a) Source # 

Methods

genum :: [Identity a] Source #

GEnum a => GEnum (Dual a) Source # 

Methods

genum :: [Dual a] Source #

GEnum a => GEnum (Sum a) Source # 

Methods

genum :: [Sum a] Source #

GEnum a => GEnum (Product a) Source # 

Methods

genum :: [Product a] Source #

GEnum a => GEnum (First a) Source # 

Methods

genum :: [First a] Source #

GEnum a => GEnum (Last a) Source # 

Methods

genum :: [Last a] Source #

(GEnum a, GEnum b) => GEnum (Either a b) Source # 

Methods

genum :: [Either a b] Source #

GEnum (U1 k p) Source # 

Methods

genum :: [U1 k p] Source #

(GEnum a, GEnum b) => GEnum (a, b) Source # 

Methods

genum :: [(a, b)] Source #

(GEnum a, GEnum b) => GEnum (Arg a b) Source # 

Methods

genum :: [Arg a b] Source #

GEnum (Proxy k s) Source # 

Methods

genum :: [Proxy k s] Source #

GEnum (f p) => GEnum (Rec1 k f p) Source # 

Methods

genum :: [Rec1 k f p] Source #

(GEnum a, GEnum b, GEnum c) => GEnum (a, b, c) Source # 

Methods

genum :: [(a, b, c)] Source #

GEnum a => GEnum (Const k a b) Source # 

Methods

genum :: [Const k a b] Source #

GEnum (f a) => GEnum (Alt k f a) Source # 

Methods

genum :: [Alt k f a] Source #

GEnum c => GEnum (K1 k i c p) Source # 

Methods

genum :: [K1 k i c p] Source #

(GEnum (f p), GEnum (g p)) => GEnum ((:+:) k f g p) Source # 

Methods

genum :: [(k :+: f) g p] Source #

(GEnum (f p), GEnum (g p)) => GEnum ((:*:) k f g p) Source # 

Methods

genum :: [(k :*: f) g p] Source #

(GEnum a, GEnum b, GEnum c, GEnum d) => GEnum (a, b, c, d) Source # 

Methods

genum :: [(a, b, c, d)] Source #

GEnum (f p) => GEnum (M1 k i c f p) Source # 

Methods

genum :: [M1 k i c f p] Source #

GEnum (f (g p)) => GEnum ((:.:) k2 k1 f g p) Source # 

Methods

genum :: [(k2 :.: k1) f g p] Source #

(GEnum a, GEnum b, GEnum c, GEnum d, GEnum e) => GEnum (a, b, c, d, e) Source # 

Methods

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 # 

Methods

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 # 

Methods

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 #

Internal enum class

class Enum' f where Source #

Minimal complete definition

enum'

Methods

enum' :: [f a] Source #

Instances

Enum' k (U1 k) Source # 

Methods

enum' :: [f a] Source #

(Enum' k f, Enum' k g) => Enum' k ((:*:) k f g) Source # 

Methods

enum' :: [f a] Source #

(Enum' k f, Enum' k g) => Enum' k ((:+:) k f g) Source # 

Methods

enum' :: [f a] Source #

GEnum c => Enum' k (K1 k i c) Source # 

Methods

enum' :: [f a] Source #

Enum' k f => Enum' k (M1 k i c f) Source # 

Methods

enum' :: [f a] Source #

Generic Ix class

class Ord a => GIx a where Source #

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.

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

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

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

The position of a subscript in the subrange.

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

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

Instances

GIx Bool Source # 

Methods

range :: (Bool, Bool) -> [Bool] Source #

index :: (Bool, Bool) -> Bool -> Int Source #

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

GIx Int Source # 

Methods

range :: (Int, Int) -> [Int] Source #

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

inRange :: (Int, Int) -> Int -> Bool Source #

GIx Int8 Source # 

Methods

range :: (Int8, Int8) -> [Int8] Source #

index :: (Int8, Int8) -> Int8 -> Int Source #

inRange :: (Int8, Int8) -> Int8 -> Bool Source #

GIx Int16 Source # 
GIx Int32 Source # 
GIx Int64 Source # 
GIx Integer Source # 
GIx Natural Source # 
GIx Ordering Source # 
GIx Word Source # 

Methods

range :: (Word, Word) -> [Word] Source #

index :: (Word, Word) -> Word -> Int Source #

inRange :: (Word, Word) -> Word -> Bool Source #

GIx Word8 Source # 
GIx Word16 Source # 
GIx Word32 Source # 
GIx Word64 Source # 
GIx () Source # 

Methods

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

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

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

GIx CIno Source # 

Methods

range :: (CIno, CIno) -> [CIno] Source #

index :: (CIno, CIno) -> CIno -> Int Source #

inRange :: (CIno, CIno) -> CIno -> Bool Source #

GIx CMode Source # 
GIx COff Source # 

Methods

range :: (COff, COff) -> [COff] Source #

index :: (COff, COff) -> COff -> Int Source #

inRange :: (COff, COff) -> COff -> Bool Source #

GIx CPid Source # 

Methods

range :: (CPid, CPid) -> [CPid] Source #

index :: (CPid, CPid) -> CPid -> Int Source #

inRange :: (CPid, CPid) -> CPid -> Bool Source #

GIx CSsize Source # 
GIx CGid Source # 

Methods

range :: (CGid, CGid) -> [CGid] Source #

index :: (CGid, CGid) -> CGid -> Int Source #

inRange :: (CGid, CGid) -> CGid -> Bool Source #

GIx CNlink Source # 
GIx CUid Source # 

Methods

range :: (CUid, CUid) -> [CUid] Source #

index :: (CUid, CUid) -> CUid -> Int Source #

inRange :: (CUid, CUid) -> CUid -> Bool Source #

GIx CTcflag Source # 
GIx CRLim Source # 
GIx CBlkSize Source # 
GIx CBlkCnt Source # 
GIx CClockId Source # 
GIx CFsBlkCnt Source # 
GIx CFsFilCnt Source # 
GIx CId Source # 

Methods

range :: (CId, CId) -> [CId] Source #

index :: (CId, CId) -> CId -> Int Source #

inRange :: (CId, CId) -> CId -> Bool Source #

GIx CKey Source # 

Methods

range :: (CKey, CKey) -> [CKey] Source #

index :: (CKey, CKey) -> CKey -> Int Source #

inRange :: (CKey, CKey) -> CKey -> Bool Source #

GIx Fd Source # 

Methods

range :: (Fd, Fd) -> [Fd] Source #

index :: (Fd, Fd) -> Fd -> Int Source #

inRange :: (Fd, Fd) -> Fd -> Bool Source #

GIx ExitCode Source # 
GIx All Source # 

Methods

range :: (All, All) -> [All] Source #

index :: (All, All) -> All -> Int Source #

inRange :: (All, All) -> All -> Bool Source #

GIx Any Source # 

Methods

range :: (Any, Any) -> [Any] Source #

index :: (Any, Any) -> Any -> Int Source #

inRange :: (Any, Any) -> Any -> Bool Source #

GIx Fixity Source # 
GIx Associativity Source # 
GIx CChar Source # 
GIx CSChar Source # 
GIx CUChar Source # 
GIx CShort Source # 
GIx CUShort Source # 
GIx CInt Source # 

Methods

range :: (CInt, CInt) -> [CInt] Source #

index :: (CInt, CInt) -> CInt -> Int Source #

inRange :: (CInt, CInt) -> CInt -> Bool Source #

GIx CUInt Source # 
GIx CLong Source # 
GIx CULong Source # 
GIx CLLong Source # 
GIx CULLong Source # 
GIx CBool 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 WordPtr Source # 
GIx IntPtr Source # 
(GEq a, GEnum a, GIx a) => GIx [a] Source # 

Methods

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

index :: ([a], [a]) -> [a] -> Int Source #

inRange :: ([a], [a]) -> [a] -> Bool Source #

(GEq a, GEnum a, GIx a) => GIx (Maybe a) Source # 

Methods

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

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

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

(GEq a, GEnum a, GIx a) => GIx (Min a) Source # 

Methods

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

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

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

(GEq a, GEnum a, GIx a) => GIx (Max a) Source # 

Methods

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

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

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

(GEq a, GEnum a, GIx a) => GIx (First a) Source # 

Methods

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

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

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

(GEq a, GEnum a, GIx a) => GIx (Last a) Source # 

Methods

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

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

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

(GEq m, GEnum m, GIx m) => GIx (WrappedMonoid m) Source # 
(GEq a, GEnum a, GIx a) => GIx (Option a) Source # 

Methods

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

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

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

(GEq a, GEnum a, GIx a) => GIx (NonEmpty a) Source # 
(GEq a, GEnum a, GIx a) => GIx (Identity a) Source # 
(GEq a, GEnum a, GIx a) => GIx (Dual a) Source # 

Methods

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

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

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

(GEq a, GEnum a, GIx a) => GIx (Sum a) Source # 

Methods

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

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

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

(GEq a, GEnum a, GIx a) => GIx (Product a) Source # 

Methods

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

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

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

(GEq a, GEnum a, GIx a) => GIx (First a) Source # 

Methods

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

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

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

(GEq a, GEnum a, GIx a) => GIx (Last a) Source # 

Methods

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

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

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

(GEq a, GEnum a, GIx a, GEq b, GEnum b, GIx b) => GIx (Either a b) Source # 

Methods

range :: (Either a b, Either a b) -> [Either a b] Source #

index :: (Either a b, Either a b) -> Either a b -> Int Source #

inRange :: (Either a b, Either a b) -> Either a b -> Bool Source #

(GEq a, GEnum a, GIx a, GEq b, GEnum b, GIx b) => GIx (a, b) Source # 

Methods

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

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

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

(GEq a, GEnum a, GIx a, GEnum b) => GIx (Arg a b) Source # 

Methods

range :: (Arg a b, Arg a b) -> [Arg a b] Source #

index :: (Arg a b, Arg a b) -> Arg a b -> Int Source #

inRange :: (Arg a b, Arg a b) -> Arg a b -> Bool Source #

GIx (Proxy k s) Source # 

Methods

range :: (Proxy k s, Proxy k s) -> [Proxy k s] Source #

index :: (Proxy k s, Proxy k s) -> Proxy k s -> Int Source #

inRange :: (Proxy k s, Proxy k s) -> Proxy k s -> Bool Source #

(GEq a, GEnum a, GIx a, GEq b, GEnum b, GIx b, GEq c, GEnum c, GIx c) => GIx (a, b, c) Source # 

Methods

range :: ((a, b, c), (a, b, c)) -> [(a, b, c)] Source #

index :: ((a, b, c), (a, b, c)) -> (a, b, c) -> Int Source #

inRange :: ((a, b, c), (a, b, c)) -> (a, b, c) -> Bool Source #

(GEq (f a), GEnum (f a), GIx (f a)) => GIx (Alt k f a) Source # 

Methods

range :: (Alt k f a, Alt k f a) -> [Alt k f a] Source #

index :: (Alt k f a, Alt k f a) -> Alt k f a -> Int Source #

inRange :: (Alt k f a, Alt k f a) -> Alt k f a -> Bool 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 # 

Methods

range :: ((a, b, c, d), (a, b, c, d)) -> [(a, b, c, d)] Source #

index :: ((a, b, c, d), (a, b, c, d)) -> (a, b, c, d) -> Int Source #

inRange :: ((a, b, c, d), (a, b, c, d)) -> (a, b, c, d) -> Bool 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 # 

Methods

range :: ((a, b, c, d, e), (a, b, c, d, e)) -> [(a, b, c, d, e)] Source #

index :: ((a, b, c, d, e), (a, b, c, d, e)) -> (a, b, c, d, e) -> Int Source #

inRange :: ((a, b, c, d, e), (a, b, c, d, e)) -> (a, b, c, d, e) -> Bool 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 # 

Methods

range :: ((a, b, c, d, e, f), (a, b, c, d, e, f)) -> [(a, b, c, d, e, f)] Source #

index :: ((a, b, c, d, e, f), (a, b, c, d, e, f)) -> (a, b, c, d, e, f) -> Int Source #

inRange :: ((a, b, c, d, e, f), (a, b, c, d, e, f)) -> (a, b, c, d, e, f) -> Bool 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 # 

Methods

range :: ((a, b, c, d, e, f, g), (a, b, c, d, e, f, g)) -> [(a, b, c, d, e, f, g)] Source #

index :: ((a, b, c, d, e, f, g), (a, b, c, d, e, f, g)) -> (a, b, c, d, e, f, g) -> Int Source #

inRange :: ((a, b, c, d, e, f, g), (a, b, c, d, e, f, g)) -> (a, b, c, d, e, f, g) -> Bool 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 #