ANN: TextRegexLazy 0.44

Simon Marlow simonmarhaskell at
Wed Jul 19 05:09:59 EDT 2006

Chris Kuklewicz wrote:

> New Question: What do people think is the best way to use 
> data/newtype/class to allow for
>   1) Different regex syntax as different types

perhaps modules.  (e.g. import Text.Regex.Posix.Extended)

>   2) Different target [Char] or ByteString


>   3) Different engine in the back end.

definitely modules for this one, because different engines might be provided by 
separate packages.

I suspect that most uses of regexes don't care much about the engine used, and 
one syntax covers most uses (e.g. extended regex.h, which is the default syntax 
used by Text.Regex).  So Text.Regex should be mapped to something like 
Text.Regex.Posix.Extended, with overloading to provide the =~ operator with 
[Char] or ByteString.


More information about the Libraries mailing list