@@ -6,7 +6,6 @@ where
66
77import Control.Monad (forM)
88import Data.Char (generalCategory, GeneralCategory(..))
9−import Data.Maybe (catMaybes)
109import System.Console.ANSI (getCursorPosition)
1110import Text.Printf (printf)
1211
@@ -64,10 +63,8 @@ unicodeTableUpperBound = '\x2FFFF'
6463-- system performance.
6564buildUnicodeWidthTable :: IO UnicodeWidthTable
6665buildUnicodeWidthTable = do
67− pairs <- fmap catMaybes $ forM ['\0'..unicodeTableUpperBound] $ \i ->
68− if shouldConsider i
69− then (Just . (i,)) <$> charWidth i
70− else return Nothing
66+ pairs <- forM (filter shouldConsider ['\0'..unicodeTableUpperBound]) $ \i ->
67+ (i,) <$> charWidth i
7168
7269 return UnicodeWidthTable { unicodeWidthTableRanges = reverse $ mkRanges pairs
7370 }