diff options
author | defanor <defanor@uberspace.net> | 2017-11-06 10:54:15 +0300 |
---|---|---|
committer | defanor <defanor@uberspace.net> | 2017-11-06 10:54:15 +0300 |
commit | e19d502ced73cf9fcbc5c8b7c2983983b48566d7 (patch) | |
tree | c2992caf8858595afd18d2b21f0b4fb0317cf702 /Pancake/Reading.hs | |
parent | 1f23441e61bf9ac4e4e9f5b9a42e77bed7140b4f (diff) |
Lint the code
Diffstat (limited to 'Pancake/Reading.hs')
-rw-r--r-- | Pancake/Reading.hs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Pancake/Reading.hs b/Pancake/Reading.hs index 2069f35..d54d7b3 100644 --- a/Pancake/Reading.hs +++ b/Pancake/Reading.hs @@ -30,6 +30,7 @@ import System.Environment import GHC.IO.Handle import Text.Parsec hiding ((<|>)) import Text.Parsec.ByteString +import Data.Maybe import Text.Pandoc.Readers.Plain import Text.Pandoc.Readers.Gopher @@ -57,8 +58,7 @@ pMeta = do -- | Document body + metadata parser. pWithMeta :: Parser (BS.ByteString, (Maybe URI, Maybe String)) -pWithMeta = (,) - <$> BS.pack <$> manyTill anyToken (try $ lookAhead pMeta) +pWithMeta = (,) . BS.pack <$> manyTill anyToken (try $ lookAhead pMeta) <*> pMeta -- | Retrieves a document. Prints an error message and returns an @@ -96,9 +96,9 @@ retrieve cmd uri = do hSetBinaryMode stdout' True out <- BS.hGetContents stdout' ec <- waitForProcess ph - if (ec /= ExitSuccess) + if ec /= ExitSuccess then do - putErrLn $ concat ["An error occured. Exit code: ", show ec] + putErrLn $ "An error occured. Exit code: " ++ show ec case stderr of Nothing -> pure () Just stderr' -> do @@ -140,7 +140,7 @@ readDoc out dt uri = do -- unknown or unrecognized item type _ -> byExtension ext <|> gopher (_, ext) -> byExtension ext - cols = maybe 80 id $ getCapability term termColumns + cols = fromMaybe 80 $ getCapability term termColumns opts = def { P.readerColumns = cols } case reader of (P.TextReader f, _) -> case decodeUtf8' out of |