@@ -438,10 +438,10 @@ toLower = caseConvert lowerMapping
438438-- | /O(n)/ Convert a string to title case, using simple case
439439-- conversion.
440440--
441−-- Unlike the other case conversion functions, this function does not
442−-- convert every letter of its input. Instead, the first letter is
443−-- converted to title case, as is every subsequent letter that
444−-- immediately follows a non-letter.
441+-- The first letter of the input is converted to title case, as is
442+-- every subsequent letter that immediately follows a non-letter.
443+-- Every letter that immediately follows another letter is converted
444+-- to lower case.
445445--
446446-- The result string may be longer than the input string. For example,
447447-- the Latin small ligature fl (U+FB02) is converted to the
@@ -458,13 +458,15 @@ toTitle (Stream next0 s0 len) = Stream next (CC (False :*: s0) '\0' '\0') len
458458 where
459459 next (CC (letter :*: s) '\0' _) =
460460 case next0 s of
461− Done -> Done
462− Skip s' -> Skip (CC (letter :*: s') '\0' '\0')
461+ Done -> Done
462+ Skip s' -> Skip (CC (letter :*: s') '\0' '\0')
463463 Yield c s'
464− | not letter && letter' -> titleMapping c (letter' :*: s')
465− | otherwise -> Yield c (CC (letter' :*: s') '\0' '\0')
464+ | letter' -> if letter
465+ then lowerMapping c (letter' :*: s')
466+ else titleMapping c (letter' :*: s')
467+ | otherwise -> Yield c (CC (letter' :*: s') '\0' '\0')
466468 where letter' = isLetter c
467− next (CC s a b) = Yield a (CC s b '\0')
469+ next (CC s a b) = Yield a (CC s b '\0')
468470{-# INLINE [0] toTitle #-}
469471
470472justifyLeftI :: Integral a => a -> Char -> Stream Char -> Stream Char