git.iko.soy/purescript-intl
on master help sign in
Data.Intl.DateTimeFormat.Generic - code style
commit873af03528c566023e23b9e4cfa13074b6403ad7 authorMarcin Szamotulski <mszamot@gmail.com> dateSat 17 Jun 2017, 22:50 (9 years ago) parentca5d0b9
2 files changed+32−12
src/Data/Intl/DateTimeFormat.purs+1−1 src/Data/Intl/DateTimeFormat/Class.purs → src/Data/Intl/DateTimeFormat/Generic.purs+31−11
src/Data/Intl/DateTimeFormat.purs+1−1
@@ -28,7 +28,7 @@ module Data.Intl.DateTimeFormat
2828import Data.Intl.DateTimeFormat.Types
2929
3030import Data.Generic.Rep (class Generic)
31−import Data.Intl.DateTimeFormat.Class (class FormatComponent, defaultComponentRecord, formatComponent, genericFormatComponent)
31+import Data.Intl.DateTimeFormat.Generic (class FormatComponent, defaultComponentRecord, formatComponent, genericFormatComponent)
3232import Data.JSDate (JSDate)
3333import Data.Maybe (Maybe, fromMaybe, maybe)
3434import Data.Newtype (class Newtype)
src/Data/Intl/DateTimeFormat/Class.purs → src/Data/Intl/DateTimeFormat/Generic.pursrenamed+31−11
@@ -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