Currying a function with a variable in J -


i can create function multiplies 2 2&\*, , indeed 20 = (2&\*)10

what want create factory-function makes these order.

so, want monad f s.t. ( f y ) x == (y * x )

whilst (\*& 2) 3 works ((\*&) 2) 3 doesn't, trying explicitly:

(3 : 'y&*') 2 produces syntax error.

where going wrong ?

a verb creates verb adverb1 in j:

f =: 1 : 'm&*' 2 f 2&*  (2 f) 5 10  (i.10)f 5 0 5 10 15 20 25 30 35 40 45 

or tacitly:

f =: &* 2 f 2&* 

h =: 3 :'...' won't work because produces verb , h y wants noun.

g =: 4 :'x&* y' fine , equivalent f.

[1]: or conjunction


Comments

Popular posts from this blog

Payment information shows nothing in one page checkout page magento -

tcpdump - How to check if server received packet (acknowledged) -