@@ -6,6 +6,7 @@ import Data.List (intersect, intercalate)
66import Data.Maybe (fromMaybe)
77import Data.Version (showVersion)
88import System.Console.CmdArgs
9+import System.FilePath
910import Text.Blaze.Html.Renderer.String (renderHtml)
1011
1112import qualified Text.Jasmine as JS
@@ -17,6 +18,7 @@ import CompileToJS
1718import GenerateHtml
1819import Paths_Elm
1920
21+import System.IO.Unsafe
2022
2123data ELM =
2224 ELM { make :: Bool
@@ -68,12 +70,10 @@ fileTo isMini get what jsFiles noscript outputDir rtLoc file = do
6870 case ems of
6971 Left err -> putStrLn $ "Error while compiling " ++ file ++ ":\n" ++ err
7072 Right ms ->
71− let path = case outputDir of
72− Nothing -> reverse . tail . dropWhile (/='.') $ reverse file
73− Just dir -> (\s -> dir ++ "/" ++ s) . reverse . takeWhile (/='/') . tail . dropWhile (/='.') $ reverse file
74− js = path ++ ".js"
75− html = path ++ ".html"
76− in case what of
73+ let path = fromMaybe "" outputDir </> file
74+ js = replaceExtension path ".js"
75+ html = replaceExtension path ".html"
76+ in case unsafePerformIO (print path) `seq` what of
7777 JS -> writeFile js . formatJS $ jss ++ concatMap jsModule ms
7878 HTML -> writeFile html . renderHtml $ modulesToHtml jsStyle "" rtLoc jss noscript ms
7979 Split -> do
@@ -105,10 +105,10 @@ toFilePath :: String -> FilePath
105105toFilePath modul = map (\c -> if c == '.' then '/' else c) modul ++ ".elm"
106106
107107builtInModules =
108− concat [ [ "List", "Char", "Maybe", "Dict", "Set", "Automaton" ]
108+ concat [ [ "List", "Char", "Maybe", "Dict", "Set", "Automaton", "Date" ]
109109 , [ "Signal", "Mouse", "Keyboard.Raw"
110110 , "Window", "Time", "HTTP", "Input", "Random" ]
111111 , [ "Graphics", "Text", "Color" ]
112− , map ("JavaScript"++) [ "", "Experimental" ]
112+ , map ("JavaScript"++) [ "", ".Experimental" ]
113113 , [ "Prelude", "JSON" ]
114114 ]