Skip to main content
Tweeted twitter.com/StackMma/status/1140137192989368320
Became Hot Network Question
added 85 characters in body
Source Link
Roman
  • 49.8k
  • 2
  • 57
  • 131

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 {a+c,b+d} using only operator forms and function compositions?

So far I've figured out how to converttwo ways of converting f[a][b] to a+b:

Apply[Curry[Plus]] ~ Operate ~ f[a][b]
(*    a + b    *)

Plus @@ Apply[Curry[List]] ~ Operate ~ f[a][b]
(*    a + b    *)

but I'm stumped by the double-argument forms of the first problem, which interferes with currying. Do you know how to solve this?

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 {a+c,b+d} using only operator forms and function compositions?

So far I've figured out how to convert f[a][b] to a+b:

Apply[Curry[Plus]] ~ Operate ~ f[a][b]
(*    a + b    *)

but I'm stumped by the double-argument forms of the first problem, which interferes with currying. Do you know how to solve this?

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 {a+c,b+d} using only operator forms and function compositions?

So far I've figured out two ways of converting f[a][b] to a+b:

Apply[Curry[Plus]] ~ Operate ~ f[a][b]
(*    a + b    *)

Plus @@ Apply[Curry[List]] ~ Operate ~ f[a][b]
(*    a + b    *)

but I'm stumped by the double-argument forms of the first problem, which interferes with currying. Do you know how to solve this?

edited title
Link
Roman
  • 49.8k
  • 2
  • 57
  • 131

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

edited tags
Link
Roman
  • 49.8k
  • 2
  • 57
  • 131
Source Link
Roman
  • 49.8k
  • 2
  • 57
  • 131
Loading