1-----------------------------------------------------------------------------
3-- Module : Language.PureScript.Options
4-- Copyright : (c) Phil Freeman 2013
7-- Maintainer : Phil Freeman <paf31@cantab.net>
8-- Stability : experimental
12-- The data type of compiler options
14-----------------------------------------------------------------------------
16{-# LANGUAGE GADTs, DataKinds, StandaloneDeriving #-}
18module Language.PureScript.Options where
21-- Indicates the mode of the compiler. Lifted using DataKinds to refine the Options type.
23data Mode = Compile | Make
28data ModeOptions mode where
29 CompileOptions :: String -> [String] -> [String] -> ModeOptions Compile
30 MakeOptions :: Maybe FilePath -> ModeOptions Make
32browserNamespace :: ModeOptions Compile -> String
33browserNamespace (CompileOptions ns _ _) = ns
35entryPointModules :: ModeOptions Compile -> [String]
36entryPointModules (CompileOptions _ ms _) = ms
38codeGenModules :: ModeOptions Compile -> [String]
39codeGenModules (CompileOptions _ _ ms) = ms
41requirePath :: ModeOptions Make -> Maybe FilePath
42requirePath (MakeOptions mp) = mp
44deriving instance Show (ModeOptions mode)
47-- The data type of compiler options
49data Options mode = Options {
51 -- Disable tail-call elimination
55 -- Disable inlining of calls to return and bind for the Eff monad
57 , optionsNoMagicDo :: Bool
59 -- When specified, checks the type of `main` in the module, and generate a call to run main
60 -- after the module definitions.
62 , optionsMain :: Maybe String
64 -- Skip all optimizations
66 , optionsNoOptimizations :: Bool
68 -- Verbose error message
70 , optionsVerboseErrors :: Bool
72 -- Remove the comments from the generated js
73 , optionsNoComments :: Bool
75 -- Specify the namespace that PureScript modules will be exported to when running in the
78 , optionsAdditional :: ModeOptions mode
82-- Default compiler options
84defaultCompileOptions :: Options Compile
85defaultCompileOptions = Options False False Nothing False False False (CompileOptions "PS" [] [])
88-- Default make options
90defaultMakeOptions :: Options Make
91defaultMakeOptions = Options False False Nothing False False False (MakeOptions Nothing)
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list