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

Safe HaskellSafe-Inferred

Generics.Deriving.Enum

Contents

Synopsis

Generic enum class

class GEnum a whereSource

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 -> aSource

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

Generic Ix class

class Ord a => GIx a whereSource

Methods

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

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

index :: (a, a) -> a -> IntSource

The position of a subscript in the subrange.

inRange :: (a, a) -> a -> BoolSource

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 -> IntSource

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