time-compat-1.9.6.1: Compatibility package for time

Safe Haskell | Trustworthy
Language | Haskell2010

Data.Time.Calendar.Quarter.Compat

Contents

- time-compat extras

Synopsis

- data QuarterOfYear
  - = Q1
  - | Q2
  - | Q3
  - | Q4
- addQuarters :: Integer -> Quarter -> Quarter
- diffQuarters :: Quarter -> Quarter -> Integer
- newtype Quarter = MkQuarter Integer
- pattern YearQuarter :: Year -> QuarterOfYear -> Quarter
- monthOfYearQuarter :: MonthOfYear -> QuarterOfYear
- monthQuarter :: Month -> Quarter
- dayQuarter :: Day -> Quarter
- fromYearQuarter :: Year -> QuarterOfYear -> Quarter
- toYearQuarter :: Quarter -> (Year, QuarterOfYear)

# Documentation

data QuarterOfYear Source #

Quarters of each year. Each quarter corresponds to three months.

Constructors

Q1 |
Q2 |
Q3 |
Q4 |

#### Instances

Instances details

Data QuarterOfYear |

Instance details

Defined in Data.Time.Calendar.Quarter

Methods

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

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

toConstr :: QuarterOfYear -> Constr Source #

dataTypeOf :: QuarterOfYear -> DataType Source #

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

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

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

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

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

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

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

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

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

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

Bounded QuarterOfYear |
Instance details Defined in Data.Time.Calendar.Quarter Methods minBound :: QuarterOfYear Source # maxBound :: QuarterOfYear Source #
Enum QuarterOfYear | maps Q1..Q4 to 1..4

Instance details

Defined in Data.Time.Calendar.Quarter

Methods

succ :: QuarterOfYear -> QuarterOfYear Source #

pred :: QuarterOfYear -> QuarterOfYear Source #

toEnum :: Int -> QuarterOfYear Source #

fromEnum :: QuarterOfYear -> Int Source #

enumFrom :: QuarterOfYear -> [QuarterOfYear] Source #

enumFromThen :: QuarterOfYear -> QuarterOfYear -> [QuarterOfYear] Source #

enumFromTo :: QuarterOfYear -> QuarterOfYear -> [QuarterOfYear] Source #

enumFromThenTo :: QuarterOfYear -> QuarterOfYear -> QuarterOfYear -> [QuarterOfYear] Source #

Ix QuarterOfYear |

Instance details

Defined in Data.Time.Calendar.Quarter

Methods

range :: (QuarterOfYear, QuarterOfYear) -> [QuarterOfYear] Source #

index :: (QuarterOfYear, QuarterOfYear) -> QuarterOfYear -> Int Source #

unsafeIndex :: (QuarterOfYear, QuarterOfYear) -> QuarterOfYear -> Int Source #

inRange :: (QuarterOfYear, QuarterOfYear) -> QuarterOfYear -> Bool Source #

rangeSize :: (QuarterOfYear, QuarterOfYear) -> Int Source #

unsafeRangeSize :: (QuarterOfYear, QuarterOfYear) -> Int Source #

Read QuarterOfYear |
Instance details Defined in Data.Time.Calendar.Quarter Methods readsPrec :: Int -> ReadS QuarterOfYear Source # readList :: ReadS [QuarterOfYear] Source # readPrec :: ReadPrec QuarterOfYear Source # readListPrec :: ReadPrec [QuarterOfYear] Source #
Show QuarterOfYear |
Instance details Defined in Data.Time.Calendar.Quarter Methods showsPrec :: Int -> QuarterOfYear -> ShowS Source # show :: QuarterOfYear -> String Source # showList :: [QuarterOfYear] -> ShowS Source #
NFData QuarterOfYear |
Instance details Defined in Data.Time.Calendar.Quarter Methods rnf :: QuarterOfYear -> () Source #
Eq QuarterOfYear |
Instance details Defined in Data.Time.Calendar.Quarter Methods (==) :: QuarterOfYear -> QuarterOfYear -> Bool Source # (/=) :: QuarterOfYear -> QuarterOfYear -> Bool Source #
Ord QuarterOfYear |

Instance details

Defined in Data.Time.Calendar.Quarter

Methods

compare :: QuarterOfYear -> QuarterOfYear -> Ordering Source #

(<) :: QuarterOfYear -> QuarterOfYear -> Bool Source #

(<=) :: QuarterOfYear -> QuarterOfYear -> Bool Source #

(>) :: QuarterOfYear -> QuarterOfYear -> Bool Source #

(>=) :: QuarterOfYear -> QuarterOfYear -> Bool Source #

max :: QuarterOfYear -> QuarterOfYear -> QuarterOfYear Source #

min :: QuarterOfYear -> QuarterOfYear -> QuarterOfYear Source #

Hashable QuarterOfYear Source # |
Instance details Defined in Data.Time.Orphans Methods hashWithSalt :: Int -> QuarterOfYear -> Int Source # hash :: QuarterOfYear -> Int Source #

addQuarters :: Integer -> Quarter -> Quarter Source #

diffQuarters :: Quarter -> Quarter -> Integer Source #

newtype Quarter Source #

An absolute count of year quarters. Number is equal to `(year * 4) + (quarterOfYear - 1)`.

Constructors

MkQuarter Integer |

#### Instances

Instances details

Data Quarter |

Instance details

Defined in Data.Time.Calendar.Quarter

Methods

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

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

toConstr :: Quarter -> Constr Source #

dataTypeOf :: Quarter -> DataType Source #

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

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

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

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

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

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

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

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

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

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

Enum Quarter |

Instance details

Defined in Data.Time.Calendar.Quarter

Methods

succ :: Quarter -> Quarter Source #

pred :: Quarter -> Quarter Source #

toEnum :: Int -> Quarter Source #

fromEnum :: Quarter -> Int Source #

enumFrom :: Quarter -> [Quarter] Source #

enumFromThen :: Quarter -> Quarter -> [Quarter] Source #

enumFromTo :: Quarter -> Quarter -> [Quarter] Source #

enumFromThenTo :: Quarter -> Quarter -> Quarter -> [Quarter] Source #

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

pattern YearQuarter :: Year -> QuarterOfYear -> Quarter Source #

Bidirectional abstract constructor.

monthOfYearQuarter :: MonthOfYear -> QuarterOfYear Source #

The `QuarterOfYear` this `MonthOfYear` is in.

monthQuarter :: Month -> Quarter Source #

The `Quarter` this `Month` is in.

dayQuarter :: Day -> Quarter Source #

The `Quarter` this `Day` is in.

# time-compat extras

fromYearQuarter :: Year -> QuarterOfYear -> Quarter Source #

Part of `YearQuarter` pattern

toYearQuarter :: Quarter -> (Year, QuarterOfYear) Source #

Part of `YearQuarter` pattern