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