git.iko.soy/purescript-intl
on master help sign in
derive Newtype instances
commit2431d4694148d98ec81affece7b039069cf23df9 authorMarcin Szamotulski <mszamot@gmail.com> dateSun 25 Jun 2017, 23:27 (9 years ago) parent8c30a6c
1 file changed+14
src/Data/Intl/DateTimeFormat/Types.purs+14
src/Data/Intl/DateTimeFormat/Types.purs+14
@@ -110,6 +110,8 @@ newtype WeekdayYearMonthDayHourMinuteSecond = WeekdayYearMonthDayHourMinuteSecon
110110 , second :: NumericRep
111111 }
112112
113+derive instance newtypeWeekdayYearMonthDayHourMinuteSecond :: Newtype WeekdayYearMonthDayHourMinuteSecond _
114+
113115instance formatComponentWeekdayYearMonthDayHourMinuteSecond :: FormatComponent WeekdayYearMonthDayHourMinuteSecond where
114116 formatComponent (WeekdayYearMonthDayHourMinuteSecond { weekday, year, month, day, hour, minute, second }) = over FormatComponentRecord
115117 (\r -> r { weekday = Just (show weekday)
@@ -129,6 +131,8 @@ newtype WeekdayYearMonthDay = WeekdayYearMonthDay
129131 , day :: NumericRep
130132 }
131133
134+derive instance newtypeWeekdayYearMonthDay :: Newtype WeekdayYearMonthDay _
135+
132136instance formatComponentWeekdayYearMonthDay :: FormatComponent WeekdayYearMonthDay where
133137 formatComponent (WeekdayYearMonthDay { weekday, year, month, day }) = over FormatComponentRecord
134138 (\r -> r { weekday = Just (show weekday)
@@ -145,6 +149,8 @@ newtype YearMonthDay = YearMonthDay
145149 , day :: NumericRep
146150 }
147151
152+derive instance newtypeYearMonthDay :: Newtype YearMonthDay _
153+
148154instance formatComponentYearMonthDay :: FormatComponent YearMonthDay where
149155 formatComponent (YearMonthDay { year, month, day }) = over FormatComponentRecord
150156 (\r -> r { year = Just (show year)
@@ -159,6 +165,8 @@ newtype YearMonth = YearMonth
159165 , month :: MonthRep
160166 }
161167
168+derive instance newtypeYearMonth :: Newtype YearMonth _
169+
162170instance formatComponentYearMonth :: FormatComponent YearMonth where
163171 formatComponent (YearMonth { year, month }) = over FormatComponentRecord
164172 (\r -> r { year = Just (show year)
@@ -171,6 +179,8 @@ newtype MonthDay = MonthDay
171179 , day :: NumericRep
172180 }
173181
182+derive instance newtypeMonthDay :: Newtype MonthDay _
183+
174184instance formatComponentMonthDay :: FormatComponent MonthDay where
175185 formatComponent (MonthDay { month, day }) = over FormatComponentRecord
176186 (\r -> r { month = Just (show month)
@@ -184,6 +194,8 @@ newtype HourMinuteSecond = HourMinuteSecond
184194 , second :: NumericRep
185195 }
186196
197+derive instance newtypeHourMinuteSecond :: Newtype HourMinuteSecond _
198+
187199instance formatComponentHourMinuteSecond :: FormatComponent HourMinuteSecond where
188200 formatComponent (HourMinuteSecond { hour, minute, second }) = over FormatComponentRecord
189201 (\r -> r { hour = Just (show hour)
@@ -197,6 +209,8 @@ newtype HourMinute = HourMinute
197209 , minute :: NumericRep
198210 }
199211
212+derive instance newtypeHourMinute :: Newtype HourMinute _
213+
200214instance formatComponentHourMinute :: FormatComponent HourMinute where
201215 formatComponent (HourMinute { hour, minute }) = over FormatComponentRecord
202216 (\r -> r { hour = Just (show hour)