ramda/ramda — pull request #467 by TheLudd (2014-10-21 08:09:31+00:00)
Title: Add R.replace

This adds R.replace witch replaces parts of a string with a replacement
string. All it really does is to call the replace method on the string
object.

The order of the argumens is:
1. RegExp or substring to match what is to be replaced
2. The replacement string
3. The string to do the replacement in.
It could perhaps be argued that the order of the first two arguments
should be reversed. With the current implementation it is possible to
construct functions like these:

var replaceSemicolons = R.replace(';');
var removeSemicolons = replaceSemicolons('');

If the arguments were reversed, this would be possible:

var clearStringOf = R.replace('');
var removeSemicolons = clearStringOf(';');

I choose this way since it is the order that the underlying
string.replace() method accepts them.

It could also be argued that ramda should not have a function that can
accept _either_ a string or a RegExp as one of its arguments, but if the
function was split in two, it would still just call the same underlying
method.