hercules-ci-api-core-0.1.6.0: Types and convenience modules use across Hercules CI API packages
Safe HaskellSafe-Inferred
LanguageHaskell2010

Hercules.API.DayOfWeek

Description

A day of week type. Integer representations are not used in the API, but are provided for convenience and will not change.

Synopsis

Documentation

data DayOfWeek Source #

Day of week representation used in the API.

Constructors

Mon 
Tue 
Wed 
Thu 
Fri 
Sat 
Sun 

Instances

Instances details
FromJSON DayOfWeek Source # 
Instance details

Defined in Hercules.API.DayOfWeek

ToJSON DayOfWeek Source # 
Instance details

Defined in Hercules.API.DayOfWeek

Generic DayOfWeek Source # 
Instance details

Defined in Hercules.API.DayOfWeek

Associated Types

type Rep DayOfWeek :: Type -> Type #

Show DayOfWeek Source # 
Instance details

Defined in Hercules.API.DayOfWeek

NFData DayOfWeek Source # 
Instance details

Defined in Hercules.API.DayOfWeek

Methods

rnf :: DayOfWeek -> () #

Eq DayOfWeek Source # 
Instance details

Defined in Hercules.API.DayOfWeek

ToSchema DayOfWeek Source # 
Instance details

Defined in Hercules.API.DayOfWeek

ToSchema DayOfWeek Source # 
Instance details

Defined in Hercules.API.DayOfWeek

type Rep DayOfWeek Source # 
Instance details

Defined in Hercules.API.DayOfWeek

type Rep DayOfWeek = D1 ('MetaData "DayOfWeek" "Hercules.API.DayOfWeek" "hercules-ci-api-core-0.1.6.0-inplace" 'False) ((C1 ('MetaCons "Mon" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "Tue" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Wed" 'PrefixI 'False) (U1 :: Type -> Type))) :+: ((C1 ('MetaCons "Thu" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Fri" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "Sat" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Sun" 'PrefixI 'False) (U1 :: Type -> Type))))

Conversions for time package

toTime :: DayOfWeek -> DayOfWeek Source #

Conversion to time package representation.

fromTime :: DayOfWeek -> DayOfWeek Source #

Conversion from time package representation.

Optional, stable, opinionated integer conversions

toNum :: Num n => DayOfWeek -> n Source #

Conversion to integers where Mon -> 1, Sun -> 7

fromNumMaybe :: (Num n, Eq n) => n -> Maybe DayOfWeek Source #

Conversion from integers where 1 -> Just Mon, 7 -> Just Sun, outside of 1..7 -> Nothing

fromNum :: (Integral n, Eq n) => n -> DayOfWeek Source #

Conversion from integers where {...,-7,0,7,...} -> Just Sun, {...,-6,1,8,...} -> Just Mon, etc.

Requires a sensible implementation of the Integral mod method that returns non-negative numbers. Integer, Int, Int8, etc are ok. So is the Word family of types, though beware of minBound overflows.