Data.Time.Calendar.Quarter

time-1.12.2: A time library

Safe Haskell | Safe
Language | Haskell2010

Data.Time.Calendar.Quarter

Description

Year quarters.

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
- type DayOfQuarter = Int
- pattern QuarterDay :: Quarter -> DayOfQuarter -> Day

# Documentation

data QuarterOfYear Source #

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

Constructors

Q1 |
Q2 |
Q3 |
Q4 |

#### Instances

Instances details

NFData QuarterOfYear Source # |
Instance details Defined in Data.Time.Calendar.Quarter Methods rnf :: QuarterOfYear -> () Source #
Data QuarterOfYear Source # |
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 # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c QuarterOfYear # toConstr :: QuarterOfYear -> Constr # dataTypeOf :: QuarterOfYear -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c QuarterOfYear) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c QuarterOfYear) # gmapT :: (forall b. Data b => b -> b) -> QuarterOfYear -> QuarterOfYear # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> QuarterOfYear -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> QuarterOfYear -> r # gmapQ :: (forall d. Data d => d -> u) -> QuarterOfYear -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> QuarterOfYear -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> QuarterOfYear -> m QuarterOfYear # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> QuarterOfYear -> m QuarterOfYear # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> QuarterOfYear -> m QuarterOfYear #
Bounded QuarterOfYear Source # |
Instance details Defined in Data.Time.Calendar.Quarter Methods minBound :: QuarterOfYear # maxBound :: QuarterOfYear #
Enum QuarterOfYear Source # | maps Q1..Q4 to 1..4
Instance details Defined in Data.Time.Calendar.Quarter Methods succ :: QuarterOfYear -> QuarterOfYear # pred :: QuarterOfYear -> QuarterOfYear # toEnum :: Int -> QuarterOfYear # fromEnum :: QuarterOfYear -> Int # enumFrom :: QuarterOfYear -> [QuarterOfYear] # enumFromThen :: QuarterOfYear -> QuarterOfYear -> [QuarterOfYear] # enumFromTo :: QuarterOfYear -> QuarterOfYear -> [QuarterOfYear] # enumFromThenTo :: QuarterOfYear -> QuarterOfYear -> QuarterOfYear -> [QuarterOfYear] #
Ix QuarterOfYear Source # |
Instance details Defined in Data.Time.Calendar.Quarter Methods range :: (QuarterOfYear, QuarterOfYear) -> [QuarterOfYear] # index :: (QuarterOfYear, QuarterOfYear) -> QuarterOfYear -> Int # unsafeIndex :: (QuarterOfYear, QuarterOfYear) -> QuarterOfYear -> Int # inRange :: (QuarterOfYear, QuarterOfYear) -> QuarterOfYear -> Bool # rangeSize :: (QuarterOfYear, QuarterOfYear) -> Int # unsafeRangeSize :: (QuarterOfYear, QuarterOfYear) -> Int #
Read QuarterOfYear Source # |
Instance details Defined in Data.Time.Calendar.Quarter Methods readsPrec :: Int -> ReadS QuarterOfYear # readList :: ReadS [QuarterOfYear] # readPrec :: ReadPrec QuarterOfYear # readListPrec :: ReadPrec [QuarterOfYear] #
Show QuarterOfYear Source # |
Instance details Defined in Data.Time.Calendar.Quarter Methods showsPrec :: Int -> QuarterOfYear -> ShowS # show :: QuarterOfYear -> String # showList :: [QuarterOfYear] -> ShowS #
Eq QuarterOfYear Source # |
Instance details Defined in Data.Time.Calendar.Quarter Methods (==) :: QuarterOfYear -> QuarterOfYear -> Bool # (/=) :: QuarterOfYear -> QuarterOfYear -> Bool #
Ord QuarterOfYear Source # |
Instance details Defined in Data.Time.Calendar.Quarter Methods compare :: QuarterOfYear -> QuarterOfYear -> Ordering # (<) :: QuarterOfYear -> QuarterOfYear -> Bool # (<=) :: QuarterOfYear -> QuarterOfYear -> Bool # (>) :: QuarterOfYear -> QuarterOfYear -> Bool # (>=) :: QuarterOfYear -> QuarterOfYear -> Bool # max :: QuarterOfYear -> QuarterOfYear -> QuarterOfYear # min :: QuarterOfYear -> QuarterOfYear -> QuarterOfYear #

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

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

type DayOfQuarter = Int Source #

Day of quarter, in range 1 to 92.

pattern QuarterDay :: Quarter -> DayOfQuarter -> Day Source #

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

Since: time-1.12.1