@@ -21,6 +21,7 @@ import qualified Reporting.Exit.Deps as Deps
2121import qualified Reporting.Exit.Diff as Diff
2222import qualified Reporting.Exit.Help as Help
2323import qualified Reporting.Exit.Http as Http
24+import qualified Reporting.Exit.Make as Make
2425import qualified Reporting.Exit.Publish as Publish
2526
2627
@@ -37,13 +38,12 @@ data Exit
3738 | Cycle [Module.Raw] -- TODO write docs to help with this scenario
3839 | Deps Deps.Exit
3940 | Diff Diff.Exit
41+ | Make Make.Exit
4042 | Publish Publish.Exit
4143 | BadHttp String Http.Exit
4244
4345 -- misc
4446 | NoSolution [Pkg.Name]
45− | CannotMakeNothing
46− | CannotOptimizeDebug Module.Raw [Module.Raw]
4747
4848
4949
@@ -86,17 +86,17 @@ toReport exit =
8686 "Whatever your scenario, I hope you have a lovely time using Elm!"
8787 ]
8888
89− Assets assetError ->
90− Asset.toReport assetError
89+ Assets assetExit ->
90+ Asset.toReport assetExit
9191
92− Bump bumpError ->
93− Bump.toReport bumpError
92+ Bump bumpExit ->
93+ Bump.toReport bumpExit
9494
9595 Compile e es ->
9696 Help.compilerReport e es
9797
98− Crawl crawlError ->
99− Crawl.toReport crawlError
98+ Crawl crawlExit ->
99+ Crawl.toReport crawlExit
100100
101101 Cycle names ->
102102 Help.report "IMPORT CYCLE" Nothing
@@ -107,17 +107,20 @@ toReport exit =
107107 ++ D.makeLink "import-cycles"
108108 ]
109109
110− Deps depsError ->
111− Deps.toReport depsError
110+ Deps depsExit ->
111+ Deps.toReport depsExit
112112
113− Diff commandsError ->
114− Diff.toReport commandsError
113+ Diff commandsExit ->
114+ Diff.toReport commandsExit
115115
116− Publish publishError ->
117− Publish.toReport publishError
116+ Make makeExit ->
117+ Make.toReport makeExit
118118
119− BadHttp url httpError ->
120− Http.toReport url httpError
119+ Publish publishExit ->
120+ Publish.toReport publishExit
121+
122+ BadHttp url httpExit ->
123+ Http.toReport url httpExit
121124
122125 NoSolution badPackages ->
123126 case badPackages of
@@ -148,36 +151,3 @@ toReport exit =
148151 \ goals, etc. They face obstacles outside of their technical work you will never\
149152 \ know about, so please assume the best and try to be patient and supportive!"
150153 ]
151−
152− CannotMakeNothing ->
153− Help.report "NO INPUT" Nothing
154− "What should I make though? I need more information, like:"
155− [ D.vcat
156− [ D.indent 4 $ D.green "elm make MyThing.elm"
157− , D.indent 4 $ D.green "elm make This.elm That.elm"
158− ]
159− , D.reflow
160− "However many files you give, I will create one JS file out of them."
161− ]
162−
163− CannotOptimizeDebug m ms ->
164− Help.report "DEBUG REMNANTS" Nothing
165− "There are uses of the `Debug` module in the following modules:"
166− [ D.indent 4 $ D.red $ D.vcat $ map (D.fromString . Module.nameToString) (m:ms)
167− , D.reflow "But the --optimize flag only works if all `Debug` functions are removed!"
168− , D.toSimpleNote $
169− "The issue is that --optimize strips out info needed by `Debug` functions.\
170− \ Here are two examples:"
171− , D.indent 4 $ D.reflow $
172− "(1) It shortens record field names. This makes the generated JavaScript is\
173− \ smaller, but `Debug.toString` cannot know the real field names anymore."
174− , D.indent 4 $ D.reflow $
175− "(2) Values like `type Height = Height Float` are unboxed. This reduces\
176− \ allocation, but it also means that `Debug.toString` cannot tell if it is\
177− \ looking at a `Height` or `Float` value."
178− , D.reflow $
179− "There are a few other cases like that, and it will be much worse once we start\
180− \ inlining code. That optimization could move `Debug.log` and `Debug.todo` calls,\
181− \ resulting in unpredictable behavior. I hope that clarifies why this restriction\
182− \ exists!"
183− ]