@@ -1,4 +1,14 @@
1−module Data.Intl.DateTimeFormat.Class where
1+module Data.Intl.DateTimeFormat.Generic
2+ ( class FormatComponent
3+ , formatComponent
4+ , class GenericFormatComponent
5+ , genericFormatComponent'
6+ , genericFormatComponent
7+ , class GenericFormatComponentFields
8+ , genericFormatComponentFields
9+ , defaultComponentRecord
10+ , FormatComponentRecord
11+ ) where
212
313import Data.Generic.Rep (class Generic, Constructor(Constructor), Field(..), NoConstructors, Product(..), Rec(..), from)
414import Data.Intl.DateTimeFormat.Types (MonthRep, NumericRep, TimeZoneNameRep, StringRep)
@@ -20,15 +30,15 @@ type FormatComponentRecord =
2030
2131defaultComponentRecord :: FormatComponentRecord
2232defaultComponentRecord =
23− { era : Nothing
24− , weekday : Nothing
25− , year : Nothing
26− , month : Nothing
27− , day : Nothing
28− , hour : Nothing
29− , minute : Nothing
30− , second : Nothing
31− , timeZoneName : Nothing
33+ { era: Nothing
34+ , weekday: Nothing
35+ , year: Nothing
36+ , month: Nothing
37+ , day: Nothing
38+ , hour: Nothing
39+ , minute: Nothing
40+ , second: Nothing
41+ , timeZoneName: Nothing
3242 }
3343
3444class FormatComponent a where
@@ -44,7 +54,17 @@ class GenericFormatComponentFields a where
4454 genericFormatComponentFields :: a -> StrMap String
4555
4656instance genericFormatComponentNoConsturctors :: GenericFormatComponent NoConstructors where
47− genericFormatComponent' a = { era: Nothing, weekday: Nothing, year: Nothing, month: Nothing, day: Nothing, hour: Nothing, minute: Nothing, second: Nothing, timeZoneName: Nothing }
57+ genericFormatComponent' a =
58+ { era: Nothing
59+ , weekday: Nothing
60+ , year: Nothing
61+ , month: Nothing
62+ , day: Nothing
63+ , hour: Nothing
64+ , minute: Nothing
65+ , second: Nothing
66+ , timeZoneName: Nothing
67+ }
4868
4969instance genericFormatComponentConstructor :: (GenericFormatComponent a) => GenericFormatComponent (Constructor name a) where
5070 genericFormatComponent' (Constructor a) = genericFormatComponent' a