months-0.2: MonthName
Safe HaskellTrustworthy
LanguageHaskell2010

Data.Time.MonthName

Description

Month data type.

Synopsis

Types

data MonthName Source #

We explicitly enumerate month names. Using an Int is unsafe.

Instances

Instances details
Bounded MonthName Source # 
Instance details

Defined in Data.Time.MonthName

Enum MonthName Source # 
Instance details

Defined in Data.Time.MonthName

Eq MonthName Source # 
Instance details

Defined in Data.Time.MonthName

Ord MonthName Source # 
Instance details

Defined in Data.Time.MonthName

Read MonthName Source # 
Instance details

Defined in Data.Time.MonthName

Show MonthName Source # 
Instance details

Defined in Data.Time.MonthName

Generic MonthName Source # 
Instance details

Defined in Data.Time.MonthName

Associated Types

type Rep MonthName :: Type -> Type #

Arbitrary MonthName Source # 
Instance details

Defined in Data.Time.MonthName

Hashable MonthName Source # 
Instance details

Defined in Data.Time.MonthName

ToJSON MonthName Source # 
Instance details

Defined in Data.Time.MonthName

ToJSONKey MonthName Source # 
Instance details

Defined in Data.Time.MonthName

FromJSON MonthName Source # 
Instance details

Defined in Data.Time.MonthName

FromJSONKey MonthName Source # 
Instance details

Defined in Data.Time.MonthName

NFData MonthName Source # 
Instance details

Defined in Data.Time.MonthName

Methods

rnf :: MonthName -> () #

type Rep MonthName Source # 
Instance details

Defined in Data.Time.MonthName

type Rep MonthName = D1 ('MetaData "MonthName" "Data.Time.MonthName" "months-0.2-FLbc3IJcdsp7dwyf9dWRNM" 'False) (((C1 ('MetaCons "January" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "February" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "March" 'PrefixI 'False) (U1 :: Type -> Type))) :+: (C1 ('MetaCons "April" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "May" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "June" 'PrefixI 'False) (U1 :: Type -> Type)))) :+: ((C1 ('MetaCons "July" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "August" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "September" 'PrefixI 'False) (U1 :: Type -> Type))) :+: (C1 ('MetaCons "October" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "November" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "December" 'PrefixI 'False) (U1 :: Type -> Type)))))

Conversion with Day

dayToYearMonthName :: Day -> (Year, MonthName) Source #

Extract Month from Day

>>> dayToYearMonthName (read "2017-02-03")
(2017,February)

firstDayOfYearMonthName :: (Year, MonthName) -> Day Source #

First day of the month.

>>> firstDayOfYearMonthName (2017, February)
2017-02-01

lastDayOfYearMonthName :: (Year, MonthName) -> Day Source #

Last day of the month

>>> lastDayOfYearMonthName (2017, February)
2017-02-28
>>> lastDayOfYearMonthName (2016, February)
2016-02-29

yearMonthNameInterval :: (Year, MonthName) -> Interval Day Source #

Day interval of month

>>> yearMonthNameInterval (2017, February)
2017-02-01 ... 2017-02-28

Conversions with Text