summaryrefslogtreecommitdiff
path: root/src/compiler/GF/Compile
diff options
context:
space:
mode:
Diffstat (limited to 'src/compiler/GF/Compile')
-rw-r--r--src/compiler/GF/Compile/ReadFiles.hs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/compiler/GF/Compile/ReadFiles.hs b/src/compiler/GF/Compile/ReadFiles.hs
index 54abc7f48..5e65dcba6 100644
--- a/src/compiler/GF/Compile/ReadFiles.hs
+++ b/src/compiler/GF/Compile/ReadFiles.hs
@@ -212,11 +212,11 @@ importsOfModule (m,mi) = (modName m,depModInfo mi [])
-- | options can be passed to the compiler by comments in @--#@, in the main file
getOptionsFromFile :: (MonadIO m,ErrorMonad m) => FilePath -> m Options
getOptionsFromFile file = do
- s <- handle (liftIO $ BS.readFile file)
- (\_ -> raise $ "File " ++ file ++ " does not exist")
+ s <- either (\_ -> raise $ "File " ++ file ++ " does not exist") return =<<
+ liftIO (try $ BS.readFile file)
let ls = filter (BS.isPrefixOf (BS.pack "--#")) $ BS.lines s
fs = map (BS.unpack . BS.unwords . BS.words . BS.drop 3) ls
- liftErr $ parseModuleOptions fs
+ parseModuleOptions fs
getFilePath :: MonadIO m => [FilePath] -> String -> m (Maybe FilePath)
getFilePath paths file = liftIO $ get paths