aboutsummaryrefslogtreecommitdiff
path: root/src/Text
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2016-12-11 22:17:10 +0100
committerJohn MacFarlane <jgm@berkeley.edu>2017-01-25 17:07:41 +0100
commit00240ca7ed84c377880817c85c25dce8cfaff3cd (patch)
tree25eaedbcf7ef4a53b7a2ebd8ed5fe048ff5843ce /src/Text
parent8165014df679338d5bf228d84efc74b2c5ac39d2 (diff)
downloadpandoc-00240ca7ed84c377880817c85c25dce8cfaff3cd.tar.gz
Removed hush from Text.Pandoc.Shared.
Not used anywhere.
Diffstat (limited to 'src/Text')
-rw-r--r--src/Text/Pandoc/ImageSize.hs6
-rw-r--r--src/Text/Pandoc/Shared.hs5
2 files changed, 3 insertions, 8 deletions
diff --git a/src/Text/Pandoc/ImageSize.hs b/src/Text/Pandoc/ImageSize.hs
index e46c91eda..cc22c06ca 100644
--- a/src/Text/Pandoc/ImageSize.hs
+++ b/src/Text/Pandoc/ImageSize.hs
@@ -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 =
diff --git a/src/Text/Pandoc/Shared.hs b/src/Text/Pandoc/Shared.hs
index 6f52a8290..0ff30dcce 100644
--- a/src/Text/Pandoc/Shared.hs
+++ b/src/Text/Pandoc/Shared.hs
@@ -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"