• Sylvain Henry's avatar
    Optimize pprASCII · d887f374
    Sylvain Henry authored
    * Use `ByteString.foldr` instead of `(List.foldr . BS.unpack)`
    * Avoid calling `chr` and its test that checks for invalid Unicode
    codepoints: we stay in the ASCII range so we know we're ok
    * Avoid calling `isPrint` (unsafe FFI call): we can check the ASCII
    printable range directly
    * Use bit operations (`unsafeShiftR`, `.&.`) instead of `div` and `mod`
PprBase.hs 7.71 KB