eliperelman/fn.js — pull request #13 by jpotterm (2014-03-04 22:03:48+00:00)
Title: Make fn.flip only swap the first two arguments

Currently, flip will reverse all the arguments. This is a problem when working with functions that take optional parameters at the end. For example, say you have:
```javascript
var echo = function(a, b, includeNewline) {
if (includeNewline) {
return [a, b, "\n"];
} else {
return [a, b];
}
};
var flipEcho = fn.flip(echo);
```

where `includeNewline` is an optional parameter. You probably flipped it so you could partially apply `b`:
```javascript
var partialEcho = fn.partial(flipEcho, 1);
```

The problem is that the parameter you just partially applied is either `b` or `includeNewline` depending how many parameters you call it with:
```javascript
partialEcho(2); // a = 2, b = 1
partialEcho(2, true); // a = true, b = 2, includeNewline = 1
```

and this was not the intention. I think flip only really makes sense for the first two arguments anyway, and the use case is nearly always to partially apply the second argument. So this pull request makes flip only swap the first two arguments and leave the others in the same order.