From 509d2ea525cd30425b4d8c408722a7492b95fde5 Mon Sep 17 00:00:00 2001 From: Alexander Krotov Date: Tue, 23 Oct 2018 13:35:29 +0300 Subject: Simplify Text.Pandoc.Pretty.offset --- src/Text/Pandoc/Pretty.hs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/Text') diff --git a/src/Text/Pandoc/Pretty.hs b/src/Text/Pandoc/Pretty.hs index de3d54ee2..f0990c1f8 100644 --- a/src/Text/Pandoc/Pretty.hs +++ b/src/Text/Pandoc/Pretty.hs @@ -438,9 +438,7 @@ afterBreak s = Doc $ singleton (AfterBreak s) -- | Returns the width of a 'Doc'. offset :: Doc -> Int -offset d = case map realLength . lines . render Nothing $ d of - [] -> 0 - os -> maximum os +offset d = maximum (0: map realLength (lines $ render Nothing d)) -- | Returns the minimal width of a 'Doc' when reflowed at breakable spaces. minOffset :: Doc -> Int -- cgit v1.2.3