From c5b9ae3060e4bd767945f012a7e5ca9d63e92211 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sat, 21 Nov 2015 08:46:01 -0800 Subject: ImageSize: use safeRead instead of readMaybe. readMaybe is only provided in base 4.6+. --- src/Text/Pandoc/ImageSize.hs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/Text/Pandoc') diff --git a/src/Text/Pandoc/ImageSize.hs b/src/Text/Pandoc/ImageSize.hs index 5c775c908..571fdd665 100644 --- a/src/Text/Pandoc/ImageSize.hs +++ b/src/Text/Pandoc/ImageSize.hs @@ -56,7 +56,6 @@ import Data.Binary.Get import Text.Pandoc.Shared (safeRead, hush) import Data.Default (Default) import Numeric (showFFloat) -import Text.Read (readMaybe) import Text.Pandoc.Definition import Text.Pandoc.Options import qualified Data.Map as M @@ -185,7 +184,7 @@ showInPixel opts dim = numUnit :: String -> Maybe (Double, String) numUnit s = let (nums, unit) = span (\c -> isDigit c || ('.'==c)) s - in case readMaybe nums of + in case safeRead nums of Just n -> Just (n, unit) Nothing -> Nothing -- cgit v1.2.3