on master help sign in
Allow Html types through main
commitf5236297c19913db12a66a3b09014e5ba2fcd8a4 authorEvan Czaplicki <info@elm-lang.org> dateSat 20 Dec 2014, 00:51 (12 years ago) parent26077fe
1 file changed+8−2
src/Type/ExtraChecks.hs+8−2
src/Type/ExtraChecks.hs+8−2
@@ -43,17 +43,23 @@ mainType environment =
4343 Nothing -> return env
4444 Just typeOfMain
4545 | tipe `elem` acceptable -> return env
46− | otherwise -> throwError err
46+ | otherwise -> throwError [ err ]
4747 where
4848 acceptable =
4949 [ "Graphics.Element.Element"
5050 , "Signal.Signal Graphics.Element.Element"
51+ , "Html.Html"
52+ , "Signal.Signal Html.Html"
5153 ]
5254
5355 tipe = PP.renderPretty typeOfMain
5456
5557 err =
56− [ P.text "Type Error: 'main' must have type Element or (Signal Element)."
58+ P.vcat
59+ [ P.text "Type Error: 'main' must have one of the following types:"
60+ , P.text " "
61+ , P.text " Element, Html, Signal Element, Signal Html"
62+ , P.text " "
5763 , P.text "Instead 'main' has type:\n"
5864 , P.nest 4 (PP.pretty typeOfMain)
5965 , P.text " "