{-# LANGUAGE Safe #-}
module Data.Time.Calendar.Types where
type Year = Integer
pattern CommonEra :: Integer -> Year
pattern $mCommonEra :: forall {r}. Year -> (Year -> r) -> ((# #) -> r) -> r
$bCommonEra :: Year -> Year
CommonEra n <-
((\Year
y -> if Year
y Year -> Year -> Bool
forall a. Ord a => a -> a -> Bool
> Year
0 then Year -> Maybe Year
forall a. a -> Maybe a
Just Year
y else Maybe Year
forall a. Maybe a
Nothing) -> Just n)
where
CommonEra Year
n = Year
n
pattern BeforeCommonEra :: Integer -> Year
pattern $mBeforeCommonEra :: forall {r}. Year -> (Year -> r) -> ((# #) -> r) -> r
$bBeforeCommonEra :: Year -> Year
BeforeCommonEra n <-
((\Year
y -> if Year
y Year -> Year -> Bool
forall a. Ord a => a -> a -> Bool
<= Year
0 then Year -> Maybe Year
forall a. a -> Maybe a
Just (Year
1 Year -> Year -> Year
forall a. Num a => a -> a -> a
- Year
y) else Maybe Year
forall a. Maybe a
Nothing) -> Just n)
where
BeforeCommonEra Year
n = Year
1 Year -> Year -> Year
forall a. Num a => a -> a -> a
- Year
n
{-# COMPLETE CommonEra, BeforeCommonEra #-}
type MonthOfYear = Int
pattern January :: MonthOfYear
pattern $mJanuary :: forall {r}. MonthOfYear -> ((# #) -> r) -> ((# #) -> r) -> r
$bJanuary :: MonthOfYear
January = 1
pattern February :: MonthOfYear
pattern $mFebruary :: forall {r}. MonthOfYear -> ((# #) -> r) -> ((# #) -> r) -> r
$bFebruary :: MonthOfYear
February = 2
pattern March :: MonthOfYear
pattern $mMarch :: forall {r}. MonthOfYear -> ((# #) -> r) -> ((# #) -> r) -> r
$bMarch :: MonthOfYear
March = 3
pattern April :: MonthOfYear
pattern $mApril :: forall {r}. MonthOfYear -> ((# #) -> r) -> ((# #) -> r) -> r
$bApril :: MonthOfYear
April = 4
pattern May :: MonthOfYear
pattern $mMay :: forall {r}. MonthOfYear -> ((# #) -> r) -> ((# #) -> r) -> r
$bMay :: MonthOfYear
May = 5
pattern June :: MonthOfYear
pattern $mJune :: forall {r}. MonthOfYear -> ((# #) -> r) -> ((# #) -> r) -> r
$bJune :: MonthOfYear
June = 6
pattern July :: MonthOfYear
pattern $mJuly :: forall {r}. MonthOfYear -> ((# #) -> r) -> ((# #) -> r) -> r
$bJuly :: MonthOfYear
July = 7
pattern August :: MonthOfYear
pattern $mAugust :: forall {r}. MonthOfYear -> ((# #) -> r) -> ((# #) -> r) -> r
$bAugust :: MonthOfYear
August = 8
pattern September :: MonthOfYear
pattern $mSeptember :: forall {r}. MonthOfYear -> ((# #) -> r) -> ((# #) -> r) -> r
$bSeptember :: MonthOfYear
September = 9
pattern October :: MonthOfYear
pattern $mOctober :: forall {r}. MonthOfYear -> ((# #) -> r) -> ((# #) -> r) -> r
$bOctober :: MonthOfYear
October = 10
pattern November :: MonthOfYear
pattern $mNovember :: forall {r}. MonthOfYear -> ((# #) -> r) -> ((# #) -> r) -> r
$bNovember :: MonthOfYear
November = 11
pattern December :: MonthOfYear
pattern $mDecember :: forall {r}. MonthOfYear -> ((# #) -> r) -> ((# #) -> r) -> r
$bDecember :: MonthOfYear
December = 12
{-# COMPLETE January, February, March, April, May, June, July, August, September, October, November, December #-}
type DayOfMonth = Int
type DayOfQuarter = Int
type DayOfYear = Int
type WeekOfYear = Int