on master help sign in
cosmetic: more vertical whitespace
1305883Evan Czaplicki
src/Elm/Compiler/Module.hs+10
@@ -28,8 +28,10 @@ import qualified Elm.Compiler.Type.Extract as Extract
28import qualified Elm.Package as Package
28import qualified Elm.Package as Package
29
29
30
30
31+
31-- INTERFACES
32-- INTERFACES
32
33
34+
33type Interface = Module.Interface
35type Interface = Module.Interface
34
36
35
37
@@ -46,8 +48,10 @@ interfaceAliasedTypes interface =
46 Map.map Extract.toAliasedType (Module.iTypes interface)
48 Map.map Extract.toAliasedType (Module.iTypes interface)
47
49
48
50
51+
49-- NAMES
52-- NAMES
50
53
54+
51newtype Name = Name ModuleName.Raw
55newtype Name = Name ModuleName.Raw
52 deriving (Eq, Ord)
56 deriving (Eq, Ord)
53
57
@@ -65,8 +69,10 @@ defaultImports =
65 map (Name . fst) Imports.defaults
69 map (Name . fst) Imports.defaults
66
70
67
71
72+
68-- STRING CONVERSIONS for NAMES
73-- STRING CONVERSIONS for NAMES
69
74
75+
70nameToPath :: Name -> FilePath
76nameToPath :: Name -> FilePath
71nameToPath (Name names) =
77nameToPath (Name names) =
72 List.foldl1 (</>) names
78 List.foldl1 (</>) names
@@ -111,8 +117,10 @@ fromString sep raw =
111 Char.isAlphaNum char || char `elem` "_'"
117 Char.isAlphaNum char || char `elem` "_'"
112
118
113
119
120+
114-- JSON for NAME
121-- JSON for NAME
115
122
123+
116instance Json.ToJSON Name where
124instance Json.ToJSON Name where
117 toJSON name =
125 toJSON name =
118 Json.toJSON (nameToString name)
126 Json.toJSON (nameToString name)
@@ -128,8 +136,10 @@ instance Json.FromJSON Name where
128 parseJSON _ = mzero
136 parseJSON _ = mzero
129
137
130
138
139+
131-- BINARY for NAME
140-- BINARY for NAME
132
141
142+
133instance Binary Name where
143instance Binary Name where
134 get =
144 get =
135 fmap Name get
145 fmap Name get