@@ -65,7 +65,7 @@ import Control.Monad
65import Control.Monad.State.Strict
65import Control.Monad.State.Strict
66import Data.Char (isSpace)
66import Data.Char (isSpace)
67import Data.Foldable (toList)
67import Data.Foldable (toList)
68−import Data.List (intersperse)
68+import Data.List (intersperse, foldl')
69import Data.Sequence (Seq, ViewL (..), fromList, mapWithIndex, singleton, viewl,
69import Data.Sequence (Seq, ViewL (..), fromList, mapWithIndex, singleton, viewl,
71import qualified Data.Sequence as Seq
71import qualified Data.Sequence as Seq
@@ -305,7 +305,7 @@ renderList (BreakingSpace : xs) = do
305 let xs' = dropWhile isBreakingSpace xs
305 let xs' = dropWhile isBreakingSpace xs
306 let next = takeWhile isText xs'
306 let next = takeWhile isText xs'
307 st <- get
307 st <- get
308− let off = sum $ map offsetOf next
308+ let off = foldl' (+) 0 $ map offsetOf next
309 case lineLength st of
309 case lineLength st of
310 Just l | column st + 1 + off > l -> do
310 Just l | column st + 1 + off > l -> do
311 outp (-1) "\n"
311 outp (-1) "\n"
@@ -540,4 +540,4 @@ charWidth c =
540-- | Get real length of string, taking into account combining and double-wide
540-- | Get real length of string, taking into account combining and double-wide
541-- characters.
541-- characters.
542realLength :: String -> Int
542realLength :: String -> Int
543−realLength = sum . map charWidth
543+realLength = foldl' (+) 0 . map charWidth