haskell / haskell/bytestring

Add Data.ByteString.Char8.to{Low,Upp}er

Open
#537 0 comments 1 reaction 0 assignees View on GitHub
enhancement
Dominant language
Haskell
Stars
301
Forks
144
Avg merge
7d 22h
Merged PRs (30d)
1

Description

Case conversions can benefit from low-level tricks. While `Data.ByteString.Char8.map Data.Char.toLower` converts byte by byte, one can actually read 8 bytes at once as `Word64` (or even more, when vectorised instructions are available), build a mask checking which bytes are uppercase (this can be done in a single instruction), then shift the mask by 5 and add to the original `Word64`.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.