{-# LANGUAGE DeriveDataTypeable #-} module Main where import Data.Either (lefts, rights) import Data.List (intersect, intercalate) import Data.Maybe (fromMaybe) import Data.Version (showVersion) import System.Console.CmdArgs 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 Paths_Elm data ELM = ELM { make :: Bool , files :: [FilePath] , runtime :: Maybe FilePath , separate_js :: Bool , only_js :: Bool , import_js :: [FilePath] , generate_noscript :: Bool , minify :: Bool } 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." , generate_noscript = True &= help "Add generated