Is there an analogue of the stringsearch package for Data.Text instead of ByteString?

The stringsearch package provides a quick find / replace function for Haskell ByteStrings. Is there appropriate functionality for text strings defined in the Data.Text package?

The only approaches that I see at the moment include encoding in UTF8, using stringsearch, and then converting back, which is not ideal!

+6
source share
1 answer

Effective search Boyer-Moore Text is implemented in a package out of the box. See Source here: http://hackage.haskell.org/packages/archive/text/0.11.1.5/doc/html/src/Data-Text-Search.html

Access to this function is carried out through a standard text API - splitOn , breakOn , count , replace and isInfixOf in particular.

+4
source

Source: https://habr.com/ru/post/893836/


All Articles