@@ -12,7 +12,6 @@
1212--
1313-----------------------------------------------------------------------------
1414
15−{-# LANGUAGE PatternGuards #-}
1615{-# LANGUAGE FlexibleContexts #-}
1716{-# LANGUAGE ScopedTypeVariables #-}
1817{-# LANGUAGE TupleSections #-}
@@ -53,16 +52,16 @@ data Options = Options
5352
5453-- | Given a filename, assuming it is in the correct place on disk, infer a ModuleIdentifier.
5554guessModuleIdentifier :: (Applicative m, MonadError ErrorMessage m) => FilePath -> m ModuleIdentifier
56−guessModuleIdentifier filename = ModuleIdentifier (takeFileName (takeDirectory filename)) <$> (guessModuleType (takeFileName filename))
55+guessModuleIdentifier filename = ModuleIdentifier (takeFileName (takeDirectory filename)) <$> guessModuleType (takeFileName filename)
5756 where
5857 guessModuleType "index.js" = pure Regular
59− guessModuleType "foreign.js" = pure Foreign
58+ guessModuleType "foreign.js" = pure Foreign
6059 guessModuleType name = throwError $ UnsupportedModulePath name
6160
6261-- | The main application function.
6362-- This function parses the input files, performs dead code elimination, filters empty modules
6463-- and generates and prints the final Javascript bundle.
65−app :: forall m. (Applicative m, MonadError ErrorMessage m, MonadIO m) => Options -> m String
64+app :: (Applicative m, MonadError ErrorMessage m, MonadIO m) => Options -> m String
6665app Options{..} = do
6766 inputFiles <- concat <$> mapM (liftIO . glob) optionsInputFiles
6867 when (null inputFiles) . liftIO $ do
@@ -72,11 +71,11 @@ app Options{..} = do
7271 js <- liftIO (readFile filename)
7372 mid <- guessModuleIdentifier filename
7473 return (mid, js)
75−
76− let entryIds = (map (`ModuleIdentifier` Regular) optionsEntryPoints)
74+
75+ let entryIds = map (`ModuleIdentifier` Regular) optionsEntryPoints
7776
7877 bundle input entryIds optionsMainModule optionsNamespace optionsRequirePath
79−
78+
8079-- | Command line options parser.
8180options :: Parser Options
8281options = Options <$> some inputFile
@@ -85,29 +84,29 @@ options = Options <$> some inputFile
8584 <*> optional mainModule
8685 <*> namespace
8786 <*> optional requirePath
88− where
87+ where
8988 inputFile :: Parser FilePath
9089 inputFile = strArgument $
9190 metavar "FILE"
9291 <> help "The input .js file(s)"
93−
92+
9493 outputFile :: Parser FilePath
9594 outputFile = strOption $
9695 short 'o'
9796 <> long "output"
9897 <> help "The output .js file"
99−
98+
10099 entryPoint :: Parser String
101100 entryPoint = strOption $
102101 short 'm'
103102 <> long "module"
104103 <> help "Entry point module name(s). All code which is not a transitive dependency of an entry point module will be removed."
105−
104+
106105 mainModule :: Parser String
107106 mainModule = strOption $
108107 long "main"
109108 <> help "Generate code to run the main method in the specified module."
110−
109+
111110 namespace :: Parser String
112111 namespace = strOption $
113112 short 'n'
@@ -122,8 +121,8 @@ options = Options <$> some inputFile
122121 <> long "require-path"
123122 <> Opts.value ""
124123 <> help "The path prefix used in require() calls in the generated JavaScript"
125−
126−-- | Make it go.
124+
125+-- | Make it go.
127126main :: IO ()
128127main = do
129128 opts <- execParser (info (version <*> helper <*> options) infoModList)