Questions tagged [currying]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
4
votes
2answers
77 views

Define a curried anonymous function

I want to define a function like f[x_][y_][z_] := x + 2y + 3z but anonymously. The ways to do this that I've discovered so far are (1) define a normal function ...
5
votes
1answer
286 views

Operator currying: how to convert f[a,b][c,d] to {a+c,b+d}?

This question is related to this golfing question (but I'm not interested in golfing, only in functional operator composition): How can we convert f[a,b][c,d] to <...
24
votes
4answers
974 views

Pseudo-currying in one line

Often when I'm writing OOP code using an object-manager association I find myself doing something akin to currying the arguments to some form of delegate object or head. (Building a one-argument ...
4
votes
1answer
296 views

How to use currying to write a tail recursive function for summing factorials given a certain bound

I am very confused about how can i use currying to write a tail recursive function for summing factorials within a certain bound or summing the bounds i.e. given [1,5] i should be getting 1!+2!+3!+4!+...
34
votes
3answers
779 views

Is there a comprehensive list of functions with operator forms?

As of version 10, Mathematica sports operator forms for many functions like Map, SortBy, ...
33
votes
2answers
2k views

Going full functional (Haskell style)

I'm trying to define some notation so that Mathematica code would be more functional, similar to Haskell (just for fun): currying, lambdas, infix operator to function conversion, etc.. And I have some ...