git.iko.soy/typeable/pandoc
on master help sign in
hlint refactoring.
commit17ce81306043b14a67f3af40f77e5f860ffc4719 authorJohn MacFarlane <jgm@berkeley.edu> dateSat 4 Mar 2017, 12:02 (10 years ago) parentbeb94c5
1 file changed+9−12
src/Text/Pandoc/App.hs+9−12
src/Text/Pandoc/App.hs+9−12
@@ -1,4 +1,4 @@
1−{-# LANGUAGE CPP, TupleSections, ScopedTypeVariables, PatternGuards #-}
1+{-# LANGUAGE CPP, TupleSections, ScopedTypeVariables #-}
22{-
33Copyright (C) 2006-2016 John MacFarlane <jgm@berkeley.edu>
44
@@ -224,9 +224,8 @@ convertWithOpts opts = do
224224 let withList _ [] vars = return vars
225225 withList f (x:xs) vars = f x vars >>= withList f xs
226226
227− variables <- return (optVariables opts)
228− >>=
229− (\vars -> return $ ("outputfile", optOutputFile opts) : vars)
227+ variables <-
228+ return (("outputfile", optOutputFile opts) : optVariables opts)
230229 >>=
231230 withList (addStringAsVariable "sourcefile")
232231 (reverse $ optInputFiles opts)
@@ -707,7 +706,7 @@ expandFilterPath mbDatadir fp = liftIO $ do
707706 then return fp
708707 else case mbDatadir of
709708 Just datadir | isRelative fp -> do
710− let filterPath = (datadir </> "filters" </> fp)
709+ let filterPath = datadir </> "filters" </> fp
711710 filterPathExists <- doesFileExist filterPath
712711 if filterPathExists
713712 then return filterPath
@@ -733,7 +732,7 @@ readURI :: MonadIO m => FilePath -> m String
733732readURI src = liftIO $ (UTF8.toString . fst) <$> openURL src
734733
735734readFile' :: MonadIO m => FilePath -> m B.ByteString
736−readFile' "-" = liftIO $ B.getContents
735+readFile' "-" = liftIO B.getContents
737736readFile' f = liftIO $ B.readFile f
738737
739738writeFnBinary :: MonadIO m => FilePath -> B.ByteString -> m ()
@@ -783,7 +782,7 @@ options =
783782 (ReqArg
784783 (\arg opt ->
785784 case safeRead arg of
786− Just t | t > 0 && t < 6 -> do
785+ Just t | t > 0 && t < 6 ->
787786 return opt{ optBaseHeaderLevel = t }
788787 _ -> err 19
789788 "base-header-level must be 1-5")
@@ -1353,8 +1352,7 @@ options =
13531352 , Option "" ["list-highlight-styles"]
13541353 (NoArg
13551354 (\_ -> do
1356− mapM_ (UTF8.hPutStrLn stdout) $
1357− map fst highlightingStyles
1355+ mapM_ (UTF8.hPutStrLn stdout . fst) highlightingStyles
13581356 exitSuccess ))
13591357 ""
13601358
@@ -1416,9 +1414,9 @@ handleUnrecognizedOption "--reference-docx" =
14161414handleUnrecognizedOption "--reference-odt" =
14171415 ("--reference-odt has been removed. Use --reference-doc instead." :)
14181416handleUnrecognizedOption "--parse-raw" =
1419− (("--parse-raw/-R has been removed. Use +raw_html or +raw_tex extension.\n") :)
1417+ ("--parse-raw/-R has been removed. Use +raw_html or +raw_tex extension.\n" :)
14201418handleUnrecognizedOption "--epub-stylesheet" =
1421− (("--epub-stylesheet has been removed. Use --css instead.\n") :)
1419+ ("--epub-stylesheet has been removed. Use --css instead.\n" :)
14221420handleUnrecognizedOption "-R" = handleUnrecognizedOption "--parse-raw"
14231421handleUnrecognizedOption x =
14241422 (("Unknown option " ++ x ++ ".") :)
@@ -1438,4 +1436,3 @@ splitField s =
14381436 case break (`elem` ":=") s of
14391437 (k,_:v) -> (k,v)
14401438 (k,[]) -> (k,"true")
1441−