
20 Feb
2021
20 Feb
'21
5:59 a.m.
With the "Data.Text.ICU.Char" module, it may be possible to determine grapheme boundaries:
https://hackage.haskell.org/package/text-icu-0.7.0.1/docs/Data-Text-ICU-Char...
I'll look into this and report back.
I'm quite prepared to believe this is wrong/misguided, but I was able to hack something together that works for my uses so far: import Data.Text.ICU.Char len = length . filter (==Nothing) . map (property GraphemeClusterBreak) . T.unpack Example: len ("🤣h👩🏻elloä❤️❤️👩❤️👩" :: Text) == 13 Tom