@@ -63,25 +63,30 @@ generate options summary graph@(Crawl.Graph args _ _ _ _) =
6363
6464generateMonolith :: Options -> Summary.Summary -> Crawl.Result -> [Module.Raw] -> Task.Task ()
6565generateMonolith (Options debug target output_) summary@(Summary.Summary _ project _ ifaces _) graph names =
66− do
67− objectGraph <- organize summary graph
68− let pkg = Project.getName project
66+ do let pkg = Project.getName project
6967 let roots = map (Module.Canonical pkg) names
70− let (Right builder) = Obj.generate debug target ifaces objectGraph roots
71− let monolith =
72− "(function(scope){\n'use strict';" <> Functions.functions <> builder <> "}(this));"
73−
74− liftIO $
75− case output_ of
76− Nothing ->
77− IO.writeBuilder "elm.js" monolith
78−
79− Just None ->
80− return ()
81−
82− Just (Custom maybeDir fileName) ->
83− do path <- safeCustomPath maybeDir fileName
84− IO.writeBuilder path monolith
68+ objectGraph <- organize summary graph
69+ case Obj.generate debug target ifaces objectGraph roots of
70+ Nothing ->
71+ return ()
72+
73+ Just builder ->
74+ let
75+ monolith =
76+ "(function(scope){\n'use strict';"
77+ <> Functions.functions <> builder <> "}(this));"
78+ in
79+ liftIO $
80+ case output_ of
81+ Nothing ->
82+ IO.writeBuilder "elm.js" monolith
83+
84+ Just None ->
85+ return ()
86+
87+ Just (Custom maybeDir fileName) ->
88+ do path <- safeCustomPath maybeDir fileName
89+ IO.writeBuilder path monolith
8590
8691
8792