{-# LANGUAGE DeriveDataTypeable #-} module Main where import Data.Either (lefts, rights) import Data.List (intersect, intercalate,lookup) import Data.Maybe (fromMaybe) import Data.Version (showVersion) import System.Console.CmdArgs import System.Exit import System.FilePath import Text.Blaze.Html.Renderer.String (renderHtml) import qualified Text.Jasmine as JS import qualified Data.ByteString.Lazy.Char8 as BS import Ast import Initialize import CompileToJS import GenerateHtml import qualified Libraries as Libraries import Paths_Elm data ELM = ELM { make :: Bool , files :: [FilePath] , runtime :: Maybe FilePath , separate_js :: Bool , only_js :: Bool , import_js :: [FilePath] , no_prelude :: Bool , noscript :: Bool , minify :: Bool , output_directory :: Maybe FilePath } deriving (Data,Typeable,Show,Eq) elm = ELM { make = False &= help "automatically compile dependencies." , files = def &= args &= typ "FILES" , runtime = Nothing &= typFile &= help "Specify a custom location for Elm's runtime system." , separate_js = False &= help "Compile to separate HTML and JS files." , only_js = False &= help "Compile only to JavaScript." , import_js = [] &= typFile &= help "Include a JavaScript file before the body of the Elm program. Can be used many times. Files will be included in the given order." , no_prelude = False &= help "Do not import Prelude by default, used only when compiling standard libraries." , noscript = True &= help "Add generated