Pretty: simplified definition of realLength.

This commit is contained in:
John MacFarlane 2017-02-23 09:54:31 +01:00
parent 9614835ea7
commit 86d8e1ef89

View file

@ -554,4 +554,4 @@ charWidth c =
-- | Get real length of string, taking into account combining and double-wide
-- characters.
realLength :: String -> Int
realLength = foldr (\a b -> charWidth a + b) 0
realLength = sum . map charWidth