Data.Time.Calendar.Month.Compat

time-compat-1.9.8: 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 #

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

Constructors

MkMonth Integer |

#### Instances

Instances details

NFData Month |
Instance details Defined in Data.Time.Calendar.Month Methods rnf :: Month -> () #
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 # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Month # toConstr :: Month -> Constr # dataTypeOf :: Month -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Month) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Month) # gmapT :: (forall b. Data b => b -> b) -> Month -> Month # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Month -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Month -> r # gmapQ :: (forall d. Data d => d -> u) -> Month -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Month -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Month -> m Month # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Month -> m Month # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Month -> m Month #
Enum Month |
Instance details Defined in Data.Time.Calendar.Month Methods succ :: Month -> Month # pred :: Month -> Month # toEnum :: Int -> Month # fromEnum :: Month -> Int # enumFrom :: Month -> [Month] # enumFromThen :: Month -> Month -> [Month] # enumFromTo :: Month -> Month -> [Month] # enumFromThenTo :: Month -> Month -> Month -> [Month] #
Ix Month |
Instance details Defined in Data.Time.Calendar.Month Methods range :: (Month, Month) -> [Month] # index :: (Month, Month) -> Month -> Int # unsafeIndex :: (Month, Month) -> Month -> Int # inRange :: (Month, Month) -> Month -> Bool # rangeSize :: (Month, Month) -> Int # unsafeRangeSize :: (Month, Month) -> Int #
Read Month | Read as `yyyy-mm`.
Instance details Defined in Data.Time.Calendar.Month Methods readsPrec :: Int -> ReadS Month # readList :: ReadS [Month] # readPrec :: ReadPrec Month # readListPrec :: ReadPrec [Month] #
Show Month | Show as `yyyy-mm`.
Instance details Defined in Data.Time.Calendar.Month Methods showsPrec :: Int -> Month -> ShowS # show :: Month -> String # showList :: [Month] -> ShowS #
Eq Month |
Instance details Defined in Data.Time.Calendar.Month Methods (==) :: Month -> Month -> Bool # (/=) :: Month -> Month -> Bool #
Ord Month |
Instance details Defined in Data.Time.Calendar.Month Methods compare :: Month -> Month -> Ordering # (<) :: Month -> Month -> Bool # (<=) :: Month -> Month -> Bool # (>) :: Month -> Month -> Bool # (>=) :: Month -> Month -> Bool # max :: Month -> Month -> Month # min :: Month -> Month -> Month #
Hashable Month # |
Instance details Defined in Data.Time.Orphans Methods hashWithSalt :: Int -> Month -> Int # hash :: Month -> Int #
DayPeriod Month |
Instance details Defined in Data.Time.Calendar.Month Methods periodFirstDay :: Month -> Day # periodLastDay :: Month -> Day # dayPeriod :: Day -> Month #
Lift Month # |
Instance details Defined in Data.Time.Orphans Methods lift :: Quote m => Month -> m Exp # liftTyped :: forall (m :: Type -> Type). Quote m => Month -> Code m Month #

addMonths :: Integer -> Month -> Month #

diffMonths :: Month -> Month -> Integer #

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

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

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

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

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

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

# time-compat extras

fromYearMonth :: Year -> MonthOfYear -> Month #

Part of `YearMonth` pattern

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

Part of `YearMonth` pattern

fromMonthDay :: Month -> DayOfMonth -> Day #

Part of `MonthDay` pattern

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

Part of `MonthDay` pattern