how unsafe is this?

30 Dec
2006
30 Dec
'06
10:55 a.m.
I've defined a helper function to let me do regexps in functional style:
sed exp str = unsafePerformIO $ do regexp <- regcomp exp 0 regexec regexp str
Is this always safe? or where is it not? (I'm using any one regexp more than once so it doesn't bother me that it compiles each time) --

30 Dec
30 Dec
11:15 a.m.
benc:
I've defined a helper function to let me do regexps in functional style:
sed exp str = unsafePerformIO $ do regexp <- regcomp exp 0 regexec regexp str
Is this always safe? or where is it not?
(I'm using any one regexp more than once so it doesn't bother me that it compiles each time)
Hopefully regex(3) is referentially transparent, so this should be fine :) -- Don
6764
Age (days ago)
6764
Last active (days ago)
1 comments
2 participants
participants (2)
-
Ben Clifford
-
dons@cse.unsw.edu.au