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

Safe HaskellSafe-Inferred
LanguageHaskell98

Generics.Deriving.Enum

Contents

Synopsis

Generic enum class

class GEnum a where Source

Minimal complete definition

Nothing

Methods

genum :: [a] Source

Instances

GEnum Int 
GEnum a => GEnum [a] 
GEnum a => GEnum (Maybe a) 

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 Int 
(GEq a, GEnum a, GIx a) => GIx [a] 
(GEq a, GEnum a, GIx a) => GIx (Maybe a) 

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