generic-data-0.1.0.0: Utilities for GHC.Generics

Safe HaskellNone
LanguageHaskell2010

Generic.Data.Internal.Enum

Synopsis

Documentation

gtoEnum :: forall a. (Generic a, GEnum (Rep a)) => Int -> a Source #

Generic toEnum.

instance Enum MyType where
  toEnum = gtoEnum
  fromEnum = gfromEnum

gfromEnum :: (Generic a, GEnum (Rep a)) => a -> Int Source #

Generic fromEnum.

See also gtoEnum.

gminBound :: (Generic a, GBounded (Rep a)) => a Source #

Generic minBound.

instance Bounded MyType where
  minBound = gminBound
  maxBound = gmaxBound

gmaxBound :: (Generic a, GBounded (Rep a)) => a Source #

Generic maxBound.

See also gminBound.

class GEnum f where Source #

Generic representation of Enum types.

Minimal complete definition

gCardinality, gFromEnum, gToEnum

Methods

gCardinality :: proxy f -> Int Source #

gFromEnum :: f p -> Int Source #

gToEnum :: Int -> f p Source #

Instances

GEnum (U1 *) Source # 

Methods

gCardinality :: proxy (U1 *) -> Int Source #

gFromEnum :: U1 * p -> Int Source #

gToEnum :: Int -> U1 * p Source #

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

Methods

gCardinality :: proxy ((* :+: f) g) -> Int Source #

gFromEnum :: (* :+: f) g p -> Int Source #

gToEnum :: Int -> (* :+: f) g p Source #

GEnum f => GEnum (M1 * i c f) Source # 

Methods

gCardinality :: proxy (M1 * i c f) -> Int Source #

gFromEnum :: M1 * i c f p -> Int Source #

gToEnum :: Int -> M1 * i c f p Source #

class GBounded f where Source #

Generic representation of Bounded types.

Minimal complete definition

gMinBound, gMaxBound

Methods

gMinBound :: f p Source #

gMaxBound :: f p Source #

Instances

GBounded (U1 *) Source # 
Bounded c => GBounded (K1 * i c) Source # 

Methods

gMinBound :: K1 * i c p Source #

gMaxBound :: K1 * i c p Source #

(GBounded f, GBounded g) => GBounded ((:+:) * f g) Source # 

Methods

gMinBound :: (* :+: f) g p Source #

gMaxBound :: (* :+: f) g p Source #

(GBounded f, GBounded g) => GBounded ((:*:) * f g) Source # 

Methods

gMinBound :: (* :*: f) g p Source #

gMaxBound :: (* :*: f) g p Source #

GBounded f => GBounded (M1 * i c f) Source # 

Methods

gMinBound :: M1 * i c f p Source #

gMaxBound :: M1 * i c f p Source #