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 :: 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
41deriving instance Show (ModeOptions mode)
44-- The data type of compiler options
46data Options mode = Options {
48 -- Disable inclusion of the built in Prelude
50 optionsNoPrelude :: Bool
52 -- Disable tail-call elimination
54 , optionsNoTco :: Bool
56 -- Disable inlining of calls to return and bind for the Eff monad
58 , optionsNoMagicDo :: Bool
60 -- When specified, checks the type of `main` in the module, and generate a call to run main
61 -- after the module definitions.
63 , optionsMain :: Maybe String
65 -- Skip all optimizations
67 , optionsNoOptimizations :: Bool
69 -- Verbose error message
71 , optionsVerboseErrors :: Bool
73 -- Remove the comments from the generated js
74 , optionsNoComments :: Bool
76 -- Specify the namespace that PureScript modules will be exported to when running in the
79 , optionsAdditional :: ModeOptions mode
83-- Default compiler options
85defaultCompileOptions :: Options Compile
86defaultCompileOptions = Options False False False Nothing False False False (CompileOptions "PS" [] [])
89-- Default make options
91defaultMakeOptions :: Options Make
92defaultMakeOptions = Options False False False Nothing False False False MakeOptions
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