Skip to content

Shaving behavior #29

@rtm

Description

@rtm

I am wondering if shaving is something that makes sense as a feature of curry-this.

Shaving is a good thing, and of course there are times when we want to do that. However, to me it makes more sense to have this be a separate feature (probably in some other functional library), rather than baked into currying. Is there a precedent for shaving in other currying libraries? If I need shaving, I can write it quite easily as:

function shave(fn, n) { 
  return function() { return fn.apply(this, [].slice.call(arguments, 0, n); }; 
}

I'd rather do this explicitly myself rather than have it be a side effect of passing placeholders to the curry function. In this approach, fn::curry(_, _) is equivalent to fn::curry(), with no shaving implications.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions