Removed hush from Text.Pandoc.Shared.

Not used anywhere.
This commit is contained in:
John MacFarlane 2016-12-11 22:17:10 +01:00
parent 8165014df6
commit 00240ca7ed
2 changed files with 3 additions and 8 deletions

View file

@ -53,7 +53,7 @@ import Control.Monad
import Data.Bits
import Data.Binary
import Data.Binary.Get
import Text.Pandoc.Shared (safeRead, hush)
import Text.Pandoc.Shared (safeRead)
import Data.Default (Default)
import Numeric (showFFloat)
import Text.Pandoc.Definition
@ -240,7 +240,7 @@ pngSize img = do
([w1,w2,w3,w4,h1,h2,h3,h4] :: [Integer]) -> return
((shift w1 24) + (shift w2 16) + (shift w3 8) + w4,
(shift h1 24) + (shift h2 16) + (shift h3 8) + h4)
_ -> (hush . Left) "PNG parse error"
_ -> Nothing -- "PNG parse error"
let (dpix, dpiy) = findpHYs rest''
return $ ImageSize { pxX = x, pxY = y, dpiX = dpix, dpiY = dpiy }
@ -269,7 +269,7 @@ gifSize img = do
dpiX = 72,
dpiY = 72
}
_ -> (hush . Left) "GIF parse error"
_ -> Nothing -- "GIF parse error"
jpegSize :: ByteString -> Either String ImageSize
jpegSize img =

View file

@ -88,7 +88,6 @@ module Text.Pandoc.Shared (
err,
warn,
mapLeft,
hush,
-- * for squashing blocks
blocksToInlines,
-- * Safe read
@ -863,10 +862,6 @@ mapLeft :: (a -> b) -> Either a c -> Either b c
mapLeft f (Left x) = Left (f x)
mapLeft _ (Right x) = Right x
hush :: Either a b -> Maybe b
hush (Left _) = Nothing
hush (Right x) = Just x
-- | Remove intermediate "." and ".." directories from a path.
--
-- > collapseFilePath "./foo" == "foo"