lib/shrink.js
function roseify(f) {
  var roseified = function() {
    var restArgs = [].slice.call(arguments, 1);
    return arrayToRoseTrees(
      f.apply(null, arguments),
      function(value) {
        return roseified.apply(null, [value].concat(restArgs));
      }
    );
  };
  return roseified;
}
function roseify(f) {
  var roseified = function() {
    var restArgs = [].slice.call(arguments, 1);
    return arrayToRoseTrees(
      f.apply(null, arguments),
      function(value) {
        return roseified.apply(null, [value].concat(restArgs));
      }
    );
  };
  return roseified;
}
function roseify ( f ) { var roseified = function ( ) { var restArgs = [ ] . slice . call ( arguments , 1 ) ; return arrayToRoseTrees ( f . apply ( null , arguments ) , function ( value ) { return roseified . apply ( null , [ value ] . concat ( restArgs ) ) ; } ) ; } ; return roseified ; }
Takes a shrink function that returns a list of smaller values, and returns a shrink function that returns a rose tree, with the same shrink function used for further shrinks.  (a -> [a]) -> (a -> [RoseTree a]) ... with a caveat:  If f takes 2 or more args, we assume the first arg is the value to shrink and we replace that in recursive calls while propagating the rest.
Takes a shrink function that returns a list of smaller values and returns a shrink function that returns a rose tree with the same shrink function used for further shrinks . ( a - > [ a ] ) - > ( a - > [ RoseTree a ] ) ... with a caveat : If f takes 2 or more args we assume the first arg is the value to shrink and we replace that in recursive calls while propagating the rest .