git.iko.soy/typeable/pandoc
on master help sign in
Changed § to % in operators from Odt.Arrows.Utils.

This prevents problems building haddocks with "C" locale. Closes #2457.

commit317d9eea17e9181e2e0b54651c7f04e6d0e8c230 authorJohn MacFarlane <jgm@berkeley.edu> dateThu 22 Oct 2015, 17:54 (11 years ago) parent48b68aa
5 files changed+42−43
src/Text/Pandoc/Readers/Odt/Arrows/Utils.hs+19−20 src/Text/Pandoc/Readers/Odt/ContentReader.hs+6−6 src/Text/Pandoc/Readers/Odt/Generic/XMLConverter.hs+14−14 src/Text/Pandoc/Readers/Odt/Namespaces.hs+1−1 src/Text/Pandoc/Readers/Odt/StyleReader.hs+2−2
src/Text/Pandoc/Readers/Odt/Arrows/Utils.hs+19−20
@@ -129,24 +129,23 @@ joinOn :: (Arrow a) => (x -> y -> z) -> a (x,y) z
129129joinOn = arr.uncurry
130130
131131-- | Applies a function to the uncurried result-pair of an arrow-application.
132−-- (The §-symbol was chosen to evoke an association with pairs through the
133−-- shared first character)
134−(>>§) :: (Arrow a) => a x (b,c) -> (b -> c -> d) -> a x d
135−a >>§ f = a >>^ uncurry f
132+-- (The %-symbol was chosen to evoke an association with pairs.)
133+(>>%) :: (Arrow a) => a x (b,c) -> (b -> c -> d) -> a x d
134+a >>% f = a >>^ uncurry f
136135
137−-- | '(>>§)' with its arguments flipped
138−(§<<) :: (Arrow a) => (b -> c -> d) -> a x (b,c) -> a x d
139−(§<<) = flip (>>§)
136+-- | '(>>%)' with its arguments flipped
137+(%<<) :: (Arrow a) => (b -> c -> d) -> a x (b,c) -> a x d
138+(%<<) = flip (>>%)
140139
141140-- | Precomposition with an uncurried function
142−(§>>) :: (Arrow a) => (b -> c -> d) -> a d r -> a (b,c) r
143−f §>> a = uncurry f ^>> a
141+(%>>) :: (Arrow a) => (b -> c -> d) -> a d r -> a (b,c) r
142+f %>> a = uncurry f ^>> a
144143
145144-- | Precomposition with an uncurried function (right to left variant)
146−(<<§) :: (Arrow a) => a d r -> (b -> c -> d) -> a (b,c) r
147−(<<§) = flip (§>>)
145+(<<%) :: (Arrow a) => a d r -> (b -> c -> d) -> a (b,c) r
146+(<<%) = flip (%>>)
148147
149−infixr 2 >>§, §<<, §>>, <<§
148+infixr 2 >>%, %<<, %>>, <<%
150149
151150
152151-- | Duplicate a value and apply an arrow to the second instance.
@@ -271,7 +270,7 @@ newtype ParallelArrow a b c = CoEval { evalParallelArrow :: a b c }
271270
272271instance (Arrow a, Monoid m) => Monoid (ParallelArrow a b m) where
273272 mempty = CoEval $ returnV mempty
274− (CoEval a) `mappend` (CoEval ~b) = CoEval $ a &&& b >>§ mappend
273+ (CoEval a) `mappend` (CoEval ~b) = CoEval $ a &&& b >>% mappend
275274
276275-- | Evaluates a collection of arrows in a parallel fashion.
277276--
@@ -433,29 +432,29 @@ a ^>>?^? f = a ^>> Left ^|||^ f
433432a >>?! f = a >>> right f
434433
435434---
436−(>>?§) :: (ArrowChoice a, Monoid f)
435+(>>?%) :: (ArrowChoice a, Monoid f)
437436 => FallibleArrow a x f (b,b')
438437 -> (b -> b' -> c)
439438 -> FallibleArrow a x f c
440−a >>?§ f = a >>?^ (uncurry f)
439+a >>?% f = a >>?^ (uncurry f)
441440
442441---
443−(^>>?§) :: (ArrowChoice a, Monoid f)
442+(^>>?%) :: (ArrowChoice a, Monoid f)
444443 => (x -> Either f (b,b'))
445444 -> (b -> b' -> c)
446445 -> FallibleArrow a x f c
447−a ^>>?§ f = arr a >>?^ (uncurry f)
446+a ^>>?% f = arr a >>?^ (uncurry f)
448447
449448---
450−(>>?§?) :: (ArrowChoice a, Monoid f)
449+(>>?%?) :: (ArrowChoice a, Monoid f)
451450 => FallibleArrow a x f (b,b')
452451 -> (b -> b' -> (Either f c))
453452 -> FallibleArrow a x f c
454−a >>?§? f = a >>?^? (uncurry f)
453+a >>?%? f = a >>?^? (uncurry f)
455454
456455infixr 1 >>?, >>?^, >>?^?
457456infixr 1 ^>>?, ^>>?^, ^>>?^?, >>?!
458−infixr 1 >>?§, ^>>?§, >>?§?
457+infixr 1 >>?%, ^>>?%, >>?%?
459458
460459-- | Keep values that are Right, replace Left values by a constant.
461460ifFailedUse :: (ArrowChoice a) => v -> a (Either f v) v
src/Text/Pandoc/Readers/Odt/ContentReader.hs+6−6
@@ -145,7 +145,7 @@ type OdtReaderSafe a b = XMLReaderSafe ReaderState a b
145145fromStyles :: (a -> Styles -> b) -> OdtReaderSafe a b
146146fromStyles f = keepingTheValue
147147 (getExtraState >>^ styleSet)
148− >>§ f
148+ >>% f
149149
150150--
151151getStyleByName :: OdtReader StyleName Style
@@ -162,7 +162,7 @@ lookupListStyle = fromStyles lookupListStyleByName >>^ maybeToChoice
162162--
163163switchCurrentListStyle :: OdtReaderSafe (Maybe ListStyle) (Maybe ListStyle)
164164switchCurrentListStyle = keepingTheValue getExtraState
165− >>§ swapCurrentListStyle
165+ >>% swapCurrentListStyle
166166 >>> first setExtraState
167167 >>^ snd
168168
@@ -170,7 +170,7 @@ switchCurrentListStyle = keepingTheValue getExtraState
170170pushStyle :: OdtReaderSafe Style Style
171171pushStyle = keepingTheValue (
172172 ( keepingTheValue getExtraState
173− >>§ pushStyle'
173+ >>% pushStyle'
174174 )
175175 >>> setExtraState
176176 )
@@ -470,7 +470,7 @@ matchingElement :: (Monoid e)
470470matchingElement ns name reader = (ns, name, asResultAccumulator reader)
471471 where
472472 asResultAccumulator :: (ArrowChoice a, Monoid m) => a m m -> a m (Fallible m)
473− asResultAccumulator a = liftAsSuccess $ keepingTheValue a >>§ (<>)
473+ asResultAccumulator a = liftAsSuccess $ keepingTheValue a >>% (<>)
474474
475475--
476476matchChildContent' :: (Monoid result)
@@ -497,14 +497,14 @@ matchChildContent ls fallback = returnV mempty >>> matchContent ls fallback
497497--
498498-- | Open Document allows several consecutive spaces if they are marked up
499499read_plain_text :: OdtReaderSafe (Inlines, XML.Content) Inlines
500−read_plain_text = fst ^&&& read_plain_text' >>§ recover
500+read_plain_text = fst ^&&& read_plain_text' >>% recover
501501 where
502502 -- fallible version
503503 read_plain_text' :: OdtReader (Inlines, XML.Content) Inlines
504504 read_plain_text' = ( second ( arr extractText )
505505 >>^ spreadChoice >>?! second text
506506 )
507− >>?§ (<>)
507+ >>?% (<>)
508508 --
509509 extractText :: XML.Content -> Fallible String
510510 extractText (XML.Text cData) = succeedWith (XML.cdData cData)
src/Text/Pandoc/Readers/Odt/Generic/XMLConverter.hs+14−14
@@ -331,7 +331,7 @@ convertingExtraState v a = withSubStateF setVAsExtraState modifyWithA
331331 where
332332 setVAsExtraState = liftAsSuccess $ extractFromState id >>^ replaceExtraState v
333333 modifyWithA = keepingTheValue (moreState ^>> a)
334− >>^ spreadChoice >>?§ flip replaceExtraState
334+ >>^ spreadChoice >>?% flip replaceExtraState
335335
336336-- | First sets the extra state to the new value. Then produces a new
337337-- extra state with a converter that uses the new state. Finally, the
@@ -413,14 +413,14 @@ elemName :: (NameSpaceID nsID)
413413 -> XMLConverter nsID extraState x XML.QName
414414elemName nsID name = lookupNSiri nsID
415415 &&& lookupNSprefix nsID
416− >>§ XML.QName name
416+ >>% XML.QName name
417417
418418-- | Checks if a given element matches both a specified namespace id
419419-- and a specified element name
420420elemNameIs :: (NameSpaceID nsID)
421421 => nsID -> ElementName
422422 -> XMLConverter nsID extraState XML.Element Bool
423−elemNameIs nsID name = keepingTheValue (lookupNSiri nsID) >>§ hasThatName
423+elemNameIs nsID name = keepingTheValue (lookupNSiri nsID) >>% hasThatName
424424 where hasThatName e iri = let elName = XML.elName e
425425 in XML.qName elName == name
426426 && XML.qURI elName == iri
@@ -461,8 +461,8 @@ currentElemIs'' nsID name = ( (getCurrentElement >>^ XML.elName >>>
461461 (XML.qName >>^ (&&).(== name) )
462462 ^&&&^
463463 (XML.qIRI >>^ (==) )
464− ) >>§ (.)
465− ) &&& lookupNSiri nsID >>§ ($)
464+ ) >>% (.)
465+ ) &&& lookupNSiri nsID >>% ($)
466466-}
467467
468468--
@@ -487,7 +487,7 @@ findChildren :: (NameSpaceID nsID)
487487 -> XMLConverter nsID extraState x [XML.Element]
488488findChildren nsID name = elemName nsID name
489489 &&& getCurrentElement
490− >>§ XML.findChildren
490+ >>% XML.findChildren
491491
492492--
493493filterChildren :: (XML.Element -> Bool)
@@ -508,7 +508,7 @@ findChild' :: (NameSpaceID nsID)
508508 -> XMLConverter nsID extraState x (Maybe XML.Element)
509509findChild' nsID name = elemName nsID name
510510 &&& getCurrentElement
511− >>§ XML.findChild
511+ >>% XML.findChild
512512
513513--
514514findChild :: (NameSpaceID nsID)
@@ -596,7 +596,7 @@ isThatTheAttrValue :: (NameSpaceID nsID)
596596isThatTheAttrValue nsID attrName
597597 = keepingTheValue
598598 (findAttr nsID attrName)
599− >>§ right.(==)
599+ >>% right.(==)
600600
601601-- | Lookup value in a dictionary, fail if no attribute found or value
602602-- not in dictionary
@@ -669,7 +669,7 @@ findAttr' :: (NameSpaceID nsID)
669669 -> XMLConverter nsID extraState x (Maybe AttributeValue)
670670findAttr' nsID attrName = elemName nsID attrName
671671 &&& getCurrentElement
672− >>§ XML.findAttr
672+ >>% XML.findAttr
673673
674674-- | Return value as string or fail
675675findAttr :: (NameSpaceID nsID)
@@ -787,7 +787,7 @@ prepareIteration :: (NameSpaceID nsID)
787787 -> XMLConverter nsID extraState b [(b, XML.Element)]
788788prepareIteration nsID name = keepingTheValue
789789 (findChildren nsID name)
790− >>§ distributeValue
790+ >>% distributeValue
791791
792792-- | Applies a converter to every child element of a specific type.
793793-- Collects results in a 'Monoid'.
@@ -877,9 +877,9 @@ makeMatcherE nsID name c = ( second (
877877 elemNameIs nsID name
878878 >>^ bool Nothing (Just tryC)
879879 )
880− >>§ (<|>)
880+ >>% (<|>)
881881 ) &&&^ snd
882− where tryC = (fst ^&&& executeThere c >>§ recover) &&&^ snd
882+ where tryC = (fst ^&&& executeThere c >>% recover) &&&^ snd
883883
884884-- Helper function: The @c@ is actually a converter that is to be selected by
885885-- matching XML content to the first two parameters.
@@ -899,14 +899,14 @@ makeMatcherC nsID name c = ( second ( contentToElem
899899 >>^ bool Nothing (Just cWithJump)
900900 )
901901 )
902− >>§ (<|>)
902+ >>% (<|>)
903903 ) &&&^ snd
904904 where cWithJump = ( fst
905905 ^&&& ( second contentToElem
906906 >>> spreadChoice
907907 ^>>? executeThere c
908908 )
909− >>§ recover)
909+ >>% recover)
910910 &&&^ snd
911911 contentToElem :: FallibleXMLConverter nsID extraState XML.Content XML.Element
912912 contentToElem = arr $ \e -> case e of
src/Text/Pandoc/Readers/Odt/Namespaces.hs+1−1
@@ -107,4 +107,4 @@ nsIDs = [
107107 ("http://www.w3.org/1999/xhtml" , NsXHtml ),
108108 ("http://www.w3.org/2002/xforms" , NsXForms ),
109109 ("http://www.w3.org/1999/xlink" , NsXLink )
110− ]
110+ ]
src/Text/Pandoc/Readers/Odt/StyleReader.hs+2−2
@@ -174,7 +174,7 @@ findPitch :: XMLReaderSafe FontPitches _x (Maybe FontPitch)
174174findPitch = ( lookupAttr NsStyle "font-pitch"
175175 `ifFailedDo` findAttr NsStyle "font-name"
176176 >>? ( keepingTheValue getExtraState
177− >>§ M.lookup
177+ >>% M.lookup
178178 >>^ maybeToChoice
179179 )
180180 )
@@ -447,7 +447,7 @@ readAllStyles :: StyleReader _x Styles
447447readAllStyles = ( readFontPitches
448448 >>?! ( readAutomaticStyles
449449 &&& readStyles ))
450− >>?§? chooseMax
450+ >>?%? chooseMax
451451 -- all top elements are always on the same hierarchy level
452452
453453--