klmr / klmr/fun

Add `curry` and `uncurry`

Open
#9 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
R
Stars
19
Forks
0
PR merge metrics
No merged PRs in 30d

Description

Add curry and uncurry functions. I’m not sure they’re particularly useful to be honest but given the confusion between currying and partial application in the R community it would have a nice educational effect to contrast the two operations of currying and partial function application.

Semantics (WLOG):

  1. curry(f) returns a function that’s a curried version of f.
  2. uncurry(g) returns a function that’s an uncurried version of g.
  3. length(args(curry(f))) == 1.
  4. identical(uncurry(curry(f)), f).

Point (4) in particular might require some gymnastics if f is a closure — although strict identity is probably not required as long as the observable effect is identical.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No repository file or test is named in the issue. Start by reading the linked init.r reference and inspecting existing functional helpers in the repository; define completion against the listed curry/uncurry semantics, including argument length and round-trip behavior for closures.

Written by the indexing model from the issue text.

Assessment

Tech stack
r
Domain
tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.