File tree 1 file changed +13
-2
lines changed
1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -23,15 +23,26 @@ foreign import match
23
23
\ };\
24
24
\}" :: Regex -> String -> [String ]
25
25
26
- foreign import replaceR
27
- " function replaceR (r) {\
26
+ foreign import replace
27
+ " function replace (r) {\
28
28
\ return function(s1) {\
29
29
\ return function(s2) {\
30
30
\ return s2.replace(r, s1);\
31
31
\ };\
32
32
\ };\
33
33
\}" :: Regex -> String -> String -> String
34
34
35
+ foreign import replace'
36
+ " function replace$prime(r) {\
37
+ \ return function(f) {\
38
+ \ return function(s2) {\
39
+ \ return s2.replace(r, function (match) {\
40
+ \ return f(match)(Array.prototype.splice.call(arguments, 1, arguments.length - 3));\
41
+ \ });\
42
+ \ };\
43
+ \ };\
44
+ \}" :: Regex -> (String -> [String ] -> String ) -> String -> String
45
+
35
46
foreign import search
36
47
" function search(r) {\
37
48
\ return function (s) {\
You can’t perform that action at this time.
0 commit comments