
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
overloading
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. Cheers, Simon