[Haskell-beginners] Pure Regex.PCRE Possible? (PLEAC, Fix Style)
yazicivo at ttmail.com
Sat Dec 19 08:37:45 EST 2009
I'm trying to implement FixStyle program of PLEAC for Haskell.
(It's missing in the Haskell version of PLEAC.) For this purpose, I
needed regular expressions. (Now, I have two problems!) Despite, my
code is, IMHO, quite purely functional, Regex.PCRE.String functions
totally mess up the design with impure functions they introduce even for
really simple string matching stuff.
If you'd check out the sources, you'll see below impure functions.
transDictRegex :: IO PCRE.Regex
matchRegex :: String -> IO (String, String, String)
translate :: String -> IO String
However, if I'm not mistaken, above functions _should_ be absolutely
pure. Is it possible to encapsulate impure PCRE functions into their
BTW, why are PCRE functions impure?
More information about the Beginners