git.iko.soy/typeable/pandoc
on master help sign in
Removed hush from Text.Pandoc.Shared.

Not used anywhere.

commit00240ca7ed84c377880817c85c25dce8cfaff3cd authorJohn MacFarlane <jgm@berkeley.edu> dateSun 11 Dec 2016, 22:17 (10 years ago) parent8165014
2 files changed+3−8
src/Text/Pandoc/ImageSize.hs+3−3 src/Text/Pandoc/Shared.hs−5
src/Text/Pandoc/ImageSize.hs+3−3
@@ -53,7 +53,7 @@ import Control.Monad
5353import Data.Bits
5454import Data.Binary
5555import Data.Binary.Get
56−import Text.Pandoc.Shared (safeRead, hush)
56+import Text.Pandoc.Shared (safeRead)
5757import Data.Default (Default)
5858import Numeric (showFFloat)
5959import Text.Pandoc.Definition
@@ -240,7 +240,7 @@ pngSize img = do
240240 ([w1,w2,w3,w4,h1,h2,h3,h4] :: [Integer]) -> return
241241 ((shift w1 24) + (shift w2 16) + (shift w3 8) + w4,
242242 (shift h1 24) + (shift h2 16) + (shift h3 8) + h4)
243− _ -> (hush . Left) "PNG parse error"
243+ _ -> Nothing -- "PNG parse error"
244244 let (dpix, dpiy) = findpHYs rest''
245245 return $ ImageSize { pxX = x, pxY = y, dpiX = dpix, dpiY = dpiy }
246246
@@ -269,7 +269,7 @@ gifSize img = do
269269 dpiX = 72,
270270 dpiY = 72
271271 }
272− _ -> (hush . Left) "GIF parse error"
272+ _ -> Nothing -- "GIF parse error"
273273
274274jpegSize :: ByteString -> Either String ImageSize
275275jpegSize img =
src/Text/Pandoc/Shared.hs−5
@@ -88,7 +88,6 @@ module Text.Pandoc.Shared (
8888 err,
8989 warn,
9090 mapLeft,
91− hush,
9291 -- * for squashing blocks
9392 blocksToInlines,
9493 -- * Safe read
@@ -863,10 +862,6 @@ mapLeft :: (a -> b) -> Either a c -> Either b c
863862mapLeft f (Left x) = Left (f x)
864863mapLeft _ (Right x) = Right x
865864
866−hush :: Either a b -> Maybe b
867−hush (Left _) = Nothing
868−hush (Right x) = Just x
869−
870865-- | Remove intermediate "." and ".." directories from a path.
871866--
872867-- > collapseFilePath "./foo" == "foo"