time-compat-1.9.6.1: Compatibility package for time

Safe Haskell | Trustworthy
Language | Haskell2010

Data.Time.Calendar.Month.Compat

Contents

- time-compat extras

Synopsis

- newtype Month = MkMonth Integer
- addMonths :: Integer -> Month -> Month
- diffMonths :: Month -> Month -> Integer
- pattern YearMonth :: Year -> MonthOfYear -> Month
- fromYearMonthValid :: Year -> MonthOfYear -> Maybe Month
- pattern MonthDay :: Month -> DayOfMonth -> Day
- fromMonthDayValid :: Month -> DayOfMonth -> Maybe Day
- fromYearMonth :: Year -> MonthOfYear -> Month
- toYearMonth :: Month -> (Year, MonthOfYear)
- fromMonthDay :: Month -> DayOfMonth -> Day
- toMonthDay :: Day -> (Month, DayOfMonth)

# Documentation

newtype Month Source #

An absolute count of common calendar months. Number is equal to `(year * 12) + (monthOfYear - 1)`.

Constructors

MkMonth Integer |

#### Instances

Instances details

Data Month |

Instance details

Defined in Data.Time.Calendar.Month

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Month -> c Month Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Month Source #

toConstr :: Month -> Constr Source #

dataTypeOf :: Month -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Month) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Month) Source #

gmapT :: (forall b. Data b => b -> b) -> Month -> Month Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Month -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Month -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> Month -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Month -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Month -> m Month Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Month -> m Month Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Month -> m Month Source #

Enum Month |
Instance details Defined in Data.Time.Calendar.Month Methods succ :: Month -> Month Source # pred :: Month -> Month Source # toEnum :: Int -> Month Source # fromEnum :: Month -> Int Source # enumFrom :: Month -> [Month] Source # enumFromThen :: Month -> Month -> [Month] Source # enumFromTo :: Month -> Month -> [Month] Source # enumFromThenTo :: Month -> Month -> Month -> [Month] Source #
Ix Month |
Instance details Defined in Data.Time.Calendar.Month Methods range :: (Month, Month) -> [Month] Source # index :: (Month, Month) -> Month -> Int Source # unsafeIndex :: (Month, Month) -> Month -> Int Source # inRange :: (Month, Month) -> Month -> Bool Source # rangeSize :: (Month, Month) -> Int Source # unsafeRangeSize :: (Month, Month) -> Int Source #
Read Month | Read as `yyyy-mm`.
Instance details Defined in Data.Time.Calendar.Month Methods readsPrec :: Int -> ReadS Month Source # readList :: ReadS [Month] Source # readPrec :: ReadPrec Month Source # readListPrec :: ReadPrec [Month] Source #
Show Month | Show as `yyyy-mm`.
Instance details Defined in Data.Time.Calendar.Month Methods showsPrec :: Int -> Month -> ShowS Source # show :: Month -> String Source # showList :: [Month] -> ShowS Source #
NFData Month |
Instance details Defined in Data.Time.Calendar.Month Methods rnf :: Month -> () Source #
Eq Month |
Instance details Defined in Data.Time.Calendar.Month Methods (==) :: Month -> Month -> Bool Source # (/=) :: Month -> Month -> Bool Source #
Ord Month |
Instance details Defined in Data.Time.Calendar.Month Methods compare :: Month -> Month -> Ordering Source # (<) :: Month -> Month -> Bool Source # (<=) :: Month -> Month -> Bool Source # (>) :: Month -> Month -> Bool Source # (>=) :: Month -> Month -> Bool Source # max :: Month -> Month -> Month Source # min :: Month -> Month -> Month Source #
Hashable Month Source # |
Instance details Defined in Data.Time.Orphans Methods hashWithSalt :: Int -> Month -> Int Source # hash :: Month -> Int Source #
DayPeriod Month |
Instance details Defined in Data.Time.Calendar.Month Methods periodFirstDay :: Month -> Day Source # periodLastDay :: Month -> Day Source # dayPeriod :: Day -> Month Source #

addMonths :: Integer -> Month -> Month Source #

diffMonths :: Month -> Month -> Integer Source #

pattern YearMonth :: Year -> MonthOfYear -> Month Source #

Bidirectional abstract constructor. Invalid months of year will be clipped to the correct range.

fromYearMonthValid :: Year -> MonthOfYear -> Maybe Month Source #

pattern MonthDay :: Month -> DayOfMonth -> Day Source #

Bidirectional abstract constructor. Invalid days of month will be clipped to the correct range.

fromMonthDayValid :: Month -> DayOfMonth -> Maybe Day Source #

# time-compat extras

fromYearMonth :: Year -> MonthOfYear -> Month Source #

Part of `YearMonth` pattern

toYearMonth :: Month -> (Year, MonthOfYear) Source #

Part of `YearMonth` pattern

fromMonthDay :: Month -> DayOfMonth -> Day Source #

Part of `MonthDay` pattern

toMonthDay :: Day -> (Month, DayOfMonth) Source #

Part of `MonthDay` pattern