git.iko.soy/typeable/pandoc
on master help sign in
Change head/tail to pattern guards.
commitc15978ce5e0b9784de8aaba1f76f299ca5a996bf authorJesse Rosenthal <jrosenthal@jhu.edu> dateSun 10 Aug 2014, 09:10 (12 years ago) parenta02ce74
1 file changed+8−7
src/Text/Pandoc/Readers/Docx/Reducible.hs+8−7
src/Text/Pandoc/Readers/Docx/Reducible.hs+8−7
@@ -1,4 +1,4 @@
1−{-# LANGUAGE OverloadedStrings #-}
1+{-# LANGUAGE OverloadedStrings, PatternGuards #-}
22
33{-
44Copyright (C) 2014 Jesse Rosenthal <jrosenthal@jhu.edu>
@@ -87,12 +87,13 @@ combineReducibles r s =
8787 remaining' = conts' \\ shared
8888 in
8989 case null shared of
90− True -> case () of
91− _ | (not . null) rs && isSpace (last rs) ->
92− rebuild conts (init rs) ++ [last rs, s]
93− _ | (not . null) ss && isSpace (head ss) ->
94− [r, head ss] ++ rebuild conts' (tail ss)
95− _ -> [r,s]
90+ True | (x : xs) <- reverse rs
91+ , isSpace x ->
92+ rebuild conts (reverse xs) ++ [x, s]
93+ | (x : xs) <- ss
94+ , isSpace x ->
95+ [r, x] ++ rebuild conts' (xs)
96+ True -> [r,s]
9697 False -> rebuild
9798 shared $
9899 reduceList $