@@ -59,7 +59,7 @@ type Days = Int
59
59
-- <https://en.wikipedia.org/wiki/Julian_day#Variants Modified Julian Day>
60
60
-- (MJD) epoch.
61
61
--
62
- -- To convert a 'Day' to the corresponding 'YearMonthDay' in the W_GREGORIAN
62
+ -- To convert a 'Day' to the corresponding 'YearMonthDay' in the <https://en.wikipedia.org/wiki/Gregorian_calendar Gregorian>
63
63
-- calendar, see 'gregorian'.
64
64
--
65
65
-- @
@@ -84,7 +84,7 @@ type Days = Int
84
84
-- Other ways of viewing a 'Day' include 'ordinalDate', and 'weekDate'.
85
85
newtype Day = ModifiedJulianDay
86
86
{ toModifiedJulianDay :: Int
87
- } deriving (INSTANCES_NEWTYPE , CoArbitrary )
87
+ } deriving (Eq , Ord , Data , Typeable , Generic , Enum , Ix , Hashable , NFData , CoArbitrary )
88
88
89
89
instance AffineSpace Day where
90
90
type Diff Day = Days
@@ -110,7 +110,7 @@ instance AffineSpace Day where
110
110
modifiedJulianDay :: Iso' Day Int
111
111
modifiedJulianDay = iso toModifiedJulianDay ModifiedJulianDay
112
112
113
- -- | Conversion between a W_GREGORIAN 'OrdinalDate' and the corresponding
113
+ -- | Conversion between a <https://en.wikipedia.org/wiki/Gregorian_calendar Gregorian> 'OrdinalDate' and the corresponding
114
114
-- 'YearMonthDay'.
115
115
--
116
116
-- @
@@ -204,7 +204,7 @@ data YearMonthDay = YearMonthDay
204
204
{ ymdYear :: {-# UNPACK #-}! Year
205
205
, ymdMonth :: {-# UNPACK #-}! Month
206
206
, ymdDay :: {-# UNPACK #-}! DayOfMonth
207
- } deriving (INSTANCES_USUAL , Show )
207
+ } deriving (Eq , Ord , Data , Typeable , Generic , Show )
208
208
209
209
LENS (YearMonthDay ,ymdYear,Year )
210
210
LENS (YearMonthDay ,ymdMonth,Month )
@@ -215,7 +215,7 @@ instance NFData YearMonthDay
215
215
216
216
------------------------------------------------------------------------
217
217
218
- -- | Is it a leap year according to the W_GREGORIAN calendar?
218
+ -- | Is it a leap year according to the <https://en.wikipedia.org/wiki/Gregorian_calendar Gregorian> calendar?
219
219
isLeapYear :: Year -> Bool
220
220
isLeapYear y = y .&. 3 == 0 && (r100 /= 0 || q100 .&. 3 == 0 ) where
221
221
(q100, r100) = y `quotRem` 100
@@ -228,7 +228,7 @@ type DayOfYear = Int
228
228
data OrdinalDate = OrdinalDate
229
229
{ odYear :: {-# UNPACK #-}! Year
230
230
, odDay :: {-# UNPACK #-}! DayOfYear
231
- } deriving (INSTANCES_USUAL , Show )
231
+ } deriving (Eq , Ord , Data , Typeable , Generic , Show )
232
232
233
233
LENS (OrdinalDate ,odYear,Year )
234
234
LENS (OrdinalDate ,odDay,DayOfYear )
@@ -368,7 +368,7 @@ randomIsoR l (x, y) = first (^. l) . randomR (l # x, l # y)
368
368
data MonthDay = MonthDay
369
369
{ mdMonth :: {-# UNPACK #-}! Month
370
370
, mdDay :: {-# UNPACK #-}! DayOfMonth
371
- } deriving (INSTANCES_USUAL , Show )
371
+ } deriving (Eq , Ord , Data , Typeable , Generic , Show )
372
372
373
373
LENS (MonthDay ,mdMonth,Month )
374
374
LENS (MonthDay ,mdDay,DayOfMonth )
@@ -512,7 +512,7 @@ data WeekDate = WeekDate
512
512
-- belong to the previous year.
513
513
, wdDay :: {-# UNPACK #-}! DayOfWeek
514
514
-- ^ /1 = Monday/ … /7 = Sunday/.
515
- } deriving (INSTANCES_USUAL , Show )
515
+ } deriving (Eq , Ord , Data , Typeable , Generic , Show )
516
516
517
517
LENS (WeekDate ,wdYear,Year )
518
518
LENS (WeekDate ,wdWeek,WeekOfYear )
@@ -602,7 +602,7 @@ data SundayWeek = SundayWeek
602
602
-- /Sunday/ of the year as the first day of week /01/.
603
603
, swDay :: {-# UNPACK #-}! DayOfWeek
604
604
-- ^ /0 = Sunday/.
605
- } deriving (INSTANCES_USUAL , Show )
605
+ } deriving (Eq , Ord , Data , Typeable , Generic , Show )
606
606
607
607
LENS (SundayWeek ,swYear,Year )
608
608
LENS (SundayWeek ,swWeek,WeekOfYear )
@@ -668,7 +668,7 @@ data MondayWeek = MondayWeek
668
668
-- /Monday/ of the year as the first day of week /01/.
669
669
, mwDay :: {-# UNPACK #-}! DayOfWeek
670
670
-- ^ /7 = Sunday/.
671
- } deriving (INSTANCES_USUAL , Show )
671
+ } deriving (Eq , Ord , Data , Typeable , Generic , Show )
672
672
673
673
LENS (MondayWeek ,mwYear,Year )
674
674
LENS (MondayWeek ,mwWeek,WeekOfYear )
0 commit comments