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 tail-call elimination
52 -- Disable inlining of calls to return and bind for the Eff monad
54 , optionsNoMagicDo :: Bool
56 -- When specified, checks the type of `main` in the module, and generate a call to run main
57 -- after the module definitions.
59 , optionsMain :: Maybe String
61 -- Skip all optimizations
63 , optionsNoOptimizations :: Bool
65 -- Verbose error message
67 , optionsVerboseErrors :: Bool
69 -- Remove the comments from the generated js
70 , optionsNoComments :: Bool
72 -- Specify the namespace that PureScript modules will be exported to when running in the
75 , optionsAdditional :: ModeOptions mode
79-- Default compiler options
81defaultCompileOptions :: Options Compile
82defaultCompileOptions = Options False False Nothing False False False (CompileOptions "PS" [] [])
85-- Default make options
87defaultMakeOptions :: Options Make
88defaultMakeOptions = Options 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