You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It appears the change proposed in issue 167 got committed so that title-casing only takes place after spaces. However, the documentation still reads: "The first letter of the input is converted to title case, as is every subsequent letter that immediately follows a non-letter".
I've opened #720 for this. It rewrites the toTitle docs to say what it actually does: only the first letter of each word is title cased, and words are split on white space, so "hello-world" becomes "Hello-world". As suggested above, it also includes the reference implementation the tests use for ASCII input. Same change in Data.Text.Lazy.
Activity
Bodigrim commentedon May 18, 2022
I think the easiest thing to do is to quote in haddocks a reference (but slow) impementation of
toTitle:text/tests/Tests/Properties/Text.hs
Lines 142 to 148 in 02ee677
swinilohani616-dot commentedon Nov 18, 2026
I've opened #720 for this. It rewrites the toTitle docs to say what it actually does: only the first letter of each word is title cased, and words are split on white space, so "hello-world" becomes "Hello-world". As suggested above, it also includes the reference implementation the tests use for ASCII input. Same change in Data.Text.Lazy.