:> > other languages like Python and Java use a more OO (and efficient) way
:> > of caching the pattern than using the method I described.
:> Why do you say "more efficient"
: All I was trying to say (and I didn't explain this very well) was that
: partial application does no actual computation, so if you partially apply a
: regex match function with a particular pattern (assuming pattern means a
: string, not a compiled regex), the regex could potentially be recompiled for
: each iteration.
That is probably the case for the Perl version (score one against
writing Perl in a functional style) but the Haskell version will
compile it the first time it is _used_ and then never again. That's
just as efficient in the general case and more efficient if your
list is empty.