Fix some more imports involving foldl'.

This commit is contained in:
John MacFarlane
2025-12-12 11:00:21 +01:00
parent d5e100eec2
commit e7e1f13bcb
2 changed files with 8 additions and 7 deletions
+6 -6
View File
@@ -57,7 +57,7 @@ module Text.Pandoc.Readers.Docx.Combine ( smushInlines
)
where
import Data.List
import qualified Data.List as L
import Data.Bifunctor
import Data.Sequence ( ViewL (..), ViewR (..), viewl, viewr, spanr, spanl
, (><), (|>) )
@@ -135,9 +135,9 @@ combineSingletonInlines :: Inlines -> Inlines -> Inlines
combineSingletonInlines x y =
let (xfs, xs) = unstackInlines x
(yfs, ys) = unstackInlines y
shared = xfs `intersect` yfs
x_remaining = xfs \\ shared
y_remaining = yfs \\ shared
shared = xfs `L.intersect` yfs
x_remaining = xfs L.\\ shared
y_remaining = yfs L.\\ shared
x_rem_attr = filter isAttrModifier x_remaining
y_rem_attr = filter isAttrModifier y_remaining
in
@@ -182,7 +182,7 @@ isAttrModifier _ = False
smushInlines :: [Inlines] -> Inlines
smushInlines xs = combineInlines xs' mempty
where xs' = foldl' combineInlines mempty xs
where xs' = L.foldl' combineInlines mempty xs
smushBlocks :: [Blocks] -> Blocks
smushBlocks xs = foldl' combineBlocks mempty xs
smushBlocks xs = L.foldl' combineBlocks mempty xs
+2 -1
View File
@@ -33,6 +33,7 @@ module Text.Pandoc.Readers.ODT.Arrows.State
, iterateS'
) where
import qualified Data.List as L
import Control.Arrow
import qualified Control.Category as Cat
import Control.Monad
@@ -135,7 +136,7 @@ iterateS a = ArrowState $ \(s,f) -> foldr a' (s,mzero) f
iterateSL :: (Foldable f, MonadPlus m)
=> ArrowState s x y
-> ArrowState s (f x) (m y)
iterateSL a = ArrowState $ \(s,f) -> foldl' a' (s,mzero) f
iterateSL a = ArrowState $ \(s,f) -> L.foldl' a' (s,mzero) f
where a' (s',m) x = second (mplus m.return) $ runArrowState a (s',x)