Closed pchiusano closed 1 year ago
Slightly modified:
Text.words : Text -> [Text]
Text.words t =
c = not Class.whitespace
word = join [capture (some (char c)), many space]
Pattern.captures (join [many space, many word]) t
Pushed to main. Thanks! 🌈⭐
nice! TIL about Pattern.captures
.
The existing implementation doesn't use pattern API. Here's an implementation that does:
Hereby MIT licensed for inclusion in base.
It looks to be about 15x faster: