on master help sign in
Properly prettify import declarations
commit058b17a4cd771dec35acd7bcf30bc932509c6362 authorEvan Czaplicki <info@elm-lang.org> dateSun 1 Mar 2015, 11:56 (12 years ago) parentabb9633
1 file changed+10−2
src/AST/Module.hs+10−2
src/AST/Module.hs+10−2
@@ -155,7 +155,7 @@ instance Binary ImportMethod where
155155instance (Pretty exs, Pretty body) => Pretty (Module exs body) where
156156 pretty (Module names _ exs ims body) =
157157 P.vcat [modul, P.text "", prettyImports, P.text "", pretty body]
158− where
158+ where
159159 modul =
160160 P.text "module" <+> name <+> pretty exs <+> P.text "where"
161161
@@ -173,5 +173,13 @@ prettyMethod (name, ImportMethod maybeAlias exposedVars) =
173173 Nothing -> P.empty
174174 Just alias ->
175175 P.text "as" <+> P.text alias
176+
177+ prettyExposed =
178+ if exposedVars == Var.closedListing
179+ then P.empty
180+ else P.text "exposing" <+> pretty exposedVars
176181 in
177− prettyAlias <+> P.text "exposing" <+> pretty exposedVars
182+ P.text "import"
183+ <+> P.text (nameToString name)
184+ <+> prettyAlias
185+ <+> prettyExposed