Data.Time.Calendar.Quarter.Compat

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

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

Constructors

Q1 |
Q2 |
Q3 |
Q4 |

#### Instances

Instances details

NFData QuarterOfYear |
Instance details Defined in Data.Time.Calendar.Quarter Methods rnf :: QuarterOfYear -> () #
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 # 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 |
Instance details Defined in Data.Time.Calendar.Quarter Methods minBound :: QuarterOfYear # maxBound :: QuarterOfYear #
Enum QuarterOfYear | 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 |
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 |
Instance details Defined in Data.Time.Calendar.Quarter Methods readsPrec :: Int -> ReadS QuarterOfYear # readList :: ReadS [QuarterOfYear] # readPrec :: ReadPrec QuarterOfYear # readListPrec :: ReadPrec [QuarterOfYear] #
Show QuarterOfYear |
Instance details Defined in Data.Time.Calendar.Quarter Methods showsPrec :: Int -> QuarterOfYear -> ShowS # show :: QuarterOfYear -> String # showList :: [QuarterOfYear] -> ShowS #
Eq QuarterOfYear |
Instance details Defined in Data.Time.Calendar.Quarter Methods (==) :: QuarterOfYear -> QuarterOfYear -> Bool # (/=) :: QuarterOfYear -> QuarterOfYear -> Bool #
Ord QuarterOfYear |
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 #
Hashable QuarterOfYear # |
Instance details Defined in Data.Time.Orphans Methods hashWithSalt :: Int -> QuarterOfYear -> Int # hash :: QuarterOfYear -> Int #
Lift QuarterOfYear # |
Instance details Defined in Data.Time.Orphans Methods lift :: Quote m => QuarterOfYear -> m Exp # liftTyped :: forall (m :: Type -> Type). Quote m => QuarterOfYear -> Code m QuarterOfYear #

addQuarters :: Integer -> Quarter -> Quarter #

diffQuarters :: Quarter -> Quarter -> Integer #

newtype Quarter #

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

Constructors

MkQuarter Integer |

#### Instances

Instances details

NFData Quarter |
Instance details Defined in Data.Time.Calendar.Quarter Methods rnf :: Quarter -> () #
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 # 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 |
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] #
Generic Quarter # |
Instance details Defined in Data.Time.Orphans Associated Types
type Rep Quarter |
Instance details Defined in Data.Time.Orphans type Rep Quarter = D1 ('MetaData "Quarter" "Data.Time.Calendar.Quarter" "time-1.12.2-inplace" 'True) (C1 ('MetaCons "MkQuarter" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Integer)))
Methods from :: Quarter -> Rep Quarter x # to :: Rep Quarter x -> Quarter #
Ix Quarter |
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 | 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 | 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 |
Instance details Defined in Data.Time.Calendar.Quarter Methods (==) :: Quarter -> Quarter -> Bool # (/=) :: Quarter -> Quarter -> Bool #
Ord Quarter |
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 #
Hashable Quarter # |
Instance details Defined in Data.Time.Orphans Methods hashWithSalt :: Int -> Quarter -> Int # hash :: Quarter -> Int #
DayPeriod Quarter |
Instance details Defined in Data.Time.Calendar.Quarter Methods periodFirstDay :: Quarter -> Day # periodLastDay :: Quarter -> Day # dayPeriod :: Day -> Quarter #
type Rep Quarter # |
Instance details Defined in Data.Time.Orphans type Rep Quarter = D1 ('MetaData "Quarter" "Data.Time.Calendar.Quarter" "time-1.12.2-inplace" 'True) (C1 ('MetaCons "MkQuarter" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Integer)))

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

Bidirectional abstract constructor.

monthOfYearQuarter :: MonthOfYear -> QuarterOfYear #

The `QuarterOfYear` this `MonthOfYear` is in.

monthQuarter :: Month -> Quarter #

The `Quarter` this `Month` is in.

dayQuarter :: Day -> Quarter #

The `Quarter` this `Day` is in.

# time-compat extras

fromYearQuarter :: Year -> QuarterOfYear -> Quarter #

Part of `YearQuarter` pattern

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

Part of `YearQuarter` pattern