4 ms·
For more realistic stuff, I generally use https://hackage.haskell.org/package/text-icu https://hackage.haskell.org/package/text-icu. For example, in an old proj
by ocharles 10y ago
For more realistic stuff, I generally use https://hackage.haskell.org/package/text-icu https://hackage.haskell.org/package/text-icu. For example, in an old project we had a type called `Texty`, which was roughly non-empty normalized text:
mkTexty :: Text -> Maybe Texty
mkTexty = \a ->
let a' = T.dropAround Char.isSpace (ICU.normalize ICU.NFC a)
in if T.null a' then Nothing
else Just (Texty a')
{-# INLINE mkTexty #-}
- IanCal 10y agoGreat, thanks for the link.