git.iko.soy/typeable/pandoc
on master help sign in
Require pandoc-types 1.17.4.

And a few tweaks related to the Semigroups/Monoid change. Closes #4448.

commit1b37e3b3c0708a5ddd500589edd10ced34bafae5 authorJohn MacFarlane <jgm@berkeley.edu> dateTue 13 Mar 2018, 22:26 (9 years ago) parentbcfc391
9 files changed+26−11
pandoc.cabal+2−2 src/Text/Pandoc/Parsing.hs+14−2 src/Text/Pandoc/Readers/Markdown.hs+1−1 src/Text/Pandoc/Readers/Odt/ContentReader.hs+3−3 src/Text/Pandoc/Readers/Org/DocumentTree.hs+1−1 src/Text/Pandoc/Readers/Org/Inlines.hs+1−1 src/Text/Pandoc/Readers/Vimwiki.hs+2−1 stack.lts9.yaml+1 stack.yaml+1
pandoc.cabal+2−2
@@ -370,7 +370,7 @@ library
370370 xml >= 1.3.12 && < 1.4,
371371 split >= 0.2 && < 0.3,
372372 random >= 1 && < 1.2,
373− pandoc-types >= 1.17.3 && < 1.18,
373+ pandoc-types >= 1.17.4 && < 1.18,
374374 aeson >= 0.7 && < 1.4,
375375 aeson-pretty >= 0.8.5 && < 0.9,
376376 tagsoup >= 0.14.6 && < 0.15,
@@ -605,7 +605,7 @@ test-suite test-pandoc
605605 hs-source-dirs: test
606606 build-depends: base >= 4.2 && < 5,
607607 pandoc,
608− pandoc-types >= 1.17.3 && < 1.18,
608+ pandoc-types >= 1.17.4 && < 1.18,
609609 bytestring >= 0.9 && < 0.11,
610610 base64-bytestring >= 0.1 && < 1.1,
611611 text >= 0.11 && < 1.3,
src/Text/Pandoc/Parsing.hs+14−2
@@ -1,3 +1,4 @@
1+{-# LANGUAGE CPP #-}
12{-# LANGUAGE ExplicitForAll #-}
23{-# LANGUAGE FlexibleContexts #-}
34{-# LANGUAGE FlexibleInstances #-}
@@ -202,7 +203,11 @@ import Data.Default
202203import Data.List (intercalate, isSuffixOf, transpose)
203204import qualified Data.Map as M
204205import Data.Maybe (mapMaybe, fromMaybe)
206+#if MIN_VERSION_base(4,9,0)
207+import Data.Semigroup (Semigroup, (<>))
208+#else
205209import Data.Monoid ((<>))
210+#endif
206211import qualified Data.Set as Set
207212import Data.Text (Text)
208213import Text.HTML.TagSoup.Entity (lookupEntity)
@@ -250,10 +255,17 @@ returnF = return . return
250255trimInlinesF :: Future s Inlines -> Future s Inlines
251256trimInlinesF = liftM trimInlines
252257
258+#if MIN_VERSION_base(4,9,0)
259+instance Semigroup a => Semigroup (Future s a) where
260+ (<>) = liftM2 (<>)
261+instance (Semigroup a, Monoid a) => Monoid (Future s a) where
262+ mempty = return mempty
263+ mappend = (<>)
264+#else
253265instance Monoid a => Monoid (Future s a) where
254266 mempty = return mempty
255267 mappend = liftM2 mappend
256− mconcat = liftM mconcat . sequence
268+#endif
257269
258270-- | Parse characters while a predicate is true.
259271takeWhileP :: Monad m
@@ -1437,7 +1449,7 @@ token pp pos match = tokenPrim pp (\_ t _ -> pos t) match
14371449
14381450infixr 5 <+?>
14391451(<+?>) :: (Monoid a) => ParserT s st m a -> ParserT s st m a -> ParserT s st m a
1440−a <+?> b = a >>= flip fmap (try b <|> return mempty) . (<>)
1452+a <+?> b = a >>= flip fmap (try b <|> return mempty) . mappend
14411453
14421454extractIdClass :: Attr -> Attr
14431455extractIdClass (ident, cls, kvs) = (ident', cls', kvs')
src/Text/Pandoc/Readers/Markdown.hs+1−1
@@ -39,7 +39,7 @@ import qualified Data.HashMap.Strict as H
3939import Data.List (intercalate, sortBy, transpose, elemIndex)
4040import qualified Data.Map as M
4141import Data.Maybe
42−import Data.Monoid ((<>))
42+import Data.Monoid
4343import Data.Ord (comparing)
4444import Data.Scientific (base10Exponent, coefficient)
4545import qualified Data.Set as Set
src/Text/Pandoc/Readers/Odt/ContentReader.hs+3−3
@@ -520,7 +520,7 @@ matchingElement :: (Monoid e)
520520matchingElement ns name reader = (ns, name, asResultAccumulator reader)
521521 where
522522 asResultAccumulator :: (ArrowChoice a, Monoid m) => a m m -> a m (Fallible m)
523− asResultAccumulator a = liftAsSuccess $ keepingTheValue a >>% (<>)
523+ asResultAccumulator a = liftAsSuccess $ keepingTheValue a >>% mappend
524524
525525--
526526matchChildContent' :: (Monoid result)
@@ -554,7 +554,7 @@ read_plain_text = fst ^&&& read_plain_text' >>% recover
554554 read_plain_text' = ( second ( arr extractText )
555555 >>^ spreadChoice >>?! second text
556556 )
557− >>?% (<>)
557+ >>?% mappend
558558 --
559559 extractText :: XML.Content -> Fallible String
560560 extractText (XML.Text cData) = succeedWith (XML.cdData cData)
@@ -565,7 +565,7 @@ read_text_seq = matchingElement NsText "sequence"
565565 $ matchChildContent [] read_plain_text
566566
567567
568−-- specifically. I honor that, although the current implementation of '(<>)'
568+-- specifically. I honor that, although the current implementation of 'mappend'
569569-- for 'Inlines' in "Text.Pandoc.Builder" will collapse them again.
570570-- The rational is to be prepared for future modifications.
571571read_spaces :: InlineMatcher
src/Text/Pandoc/Readers/Org/DocumentTree.hs+1−1
@@ -36,7 +36,7 @@ import Control.Arrow ((***))
3636import Control.Monad (guard, void)
3737import Data.Char (toLower, toUpper)
3838import Data.List (intersperse)
39−import Data.Monoid ((<>))
39+import Data.Monoid ((<>), mconcat)
4040import Text.Pandoc.Builder (Blocks, Inlines)
4141import Text.Pandoc.Class (PandocMonad)
4242import Text.Pandoc.Definition
src/Text/Pandoc/Readers/Org/Inlines.hs+1−1
@@ -55,7 +55,7 @@ import Data.Char (isAlphaNum, isSpace)
5555import Data.List (intersperse)
5656import qualified Data.Map as M
5757import Data.Maybe (fromMaybe)
58−import Data.Monoid ((<>))
58+import Data.Monoid
5959import Data.Traversable (sequence)
6060import Prelude hiding (sequence)
6161
src/Text/Pandoc/Readers/Vimwiki.hs+2−1
@@ -1,3 +1,4 @@
1+{-# LANGUAGE CPP #-}
12{-
23 Copyright (C) 2017-2018 Yuchen Pei <me@ypei.me>
34
@@ -68,7 +69,7 @@ import Control.Monad.Except (throwError)
6869import Data.Default
6970import Data.List (isInfixOf, isPrefixOf)
7071import Data.Maybe
71−import Data.Monoid ((<>))
72+import Data.Monoid
7273import Data.Text (Text, unpack)
7374import Text.Pandoc.Builder (Blocks, Inlines, fromList, toList, trimInlines)
7475import qualified Text.Pandoc.Builder as B (blockQuote, bulletList, code,
stack.lts9.yaml+1
@@ -27,4 +27,5 @@ extra-deps:
2727- hs-bibutils-6.2.0.1
2828- pandoc-citeproc-0.14.1.5
2929- tagsoup-0.14.6
30+- pandoc-types-1.17.4
3031resolver: lts-9.14
stack.yaml+1
@@ -21,6 +21,7 @@ extra-deps:
2121- tasty-1.0.0.1
2222- texmath-0.10.1.1
2323- tagsoup-0.14.6
24+- pandoc-types-1.17.4
2425ghc-options:
2526 "$locals": -fhide-source-paths
2627resolver: lts-10.3