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

Safe HaskellSafe-Infered

Generics.Deriving.Enum

Contents

Synopsis

Generic enum class

class GEnum a where

Methods

genum :: [a]

Instances

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

Default definitions for GEnum

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

Generic Ix class

class Ord a => GIx a where

Methods

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

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

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

The position of a subscript in the subrange.

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

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]

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

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