aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Krotov <ilabdsf@gmail.com>2018-10-10 01:26:50 +0300
committerAlexander Krotov <ilabdsf@gmail.com>2018-10-10 01:26:50 +0300
commit7556dc9e494d33bde276b0c3333e0a666338ad89 (patch)
treed87de530fb13ead28027f458ee29d5dae84c3ee7
parent2537c338fa270511149f994257d989fbbceb8fb9 (diff)
downloadpandoc-7556dc9e494d33bde276b0c3333e0a666338ad89.tar.gz
Reimplement mapLeft using Bifunctor.first
-rw-r--r--src/Text/Pandoc/Shared.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Shared.hs b/src/Text/Pandoc/Shared.hs
index 9f48080b8..78a5a6a54 100644
--- a/src/Text/Pandoc/Shared.hs
+++ b/src/Text/Pandoc/Shared.hs
@@ -111,6 +111,7 @@ import qualified Control.Exception as E
import Control.Monad (MonadPlus (..), msum, unless)
import qualified Control.Monad.State.Strict as S
import qualified Data.ByteString.Lazy as BL
+import qualified Data.Bifunctor as Bifunctor
import Data.Char (isAlpha, isDigit, isLetter, isLower, isSpace, isUpper,
toLower)
import Data.Data (Data, Typeable)
@@ -637,8 +638,7 @@ inDirectory path action = E.bracket
--
mapLeft :: (a -> b) -> Either a c -> Either b c
-mapLeft f (Left x) = Left (f x)
-mapLeft _ (Right x) = Right x
+mapLeft = Bifunctor.first
-- | Remove intermediate "." and ".." directories from a path.
--