
9 Feb
2009
9 Feb
'09
12:06 p.m.
Don Stewart
You can use one of the haskell regex libraries and define an operator for the managehook like so:
import Text.Regex.Posix ((=~))
q ~? x = fmap (=~ x) q
and then your example is simply
className ~? "Google .*" --> doShift "1"
Having someone interested write an extension module of regex combinators for this kind of thing would be useful.
-- Don
Other than lifting (=~) and possibly another function or two, what would this do? I'd be happy to put the two lines it takes to define (~?) into a module, but that seems a bit slim (I guess it couldn't hurt though). -- Gravity brings me down.