These are chat archives for evhub/coconut

13th
Nov 2018
yvendruscolo
@yvendruscolo
Nov 13 2018 13:48
Hello, is there such a thing as clojure’s 'juxt'? Where i can combine many functions into a function that when applied to a value, returns a collection os the results of applying such functions?
You could also think of it as a twisted ‘map’, exchanging values for fucntions and vice versa
Evan Hubinger
@evhub
Nov 13 2018 21:57
@yvendruscolo You could do something like
def juxt(*fns) = x -> map(f -> f(x), fns)
yvendruscolo
@yvendruscolo
Nov 13 2018 21:58
Nice, just thought it could already be there
Thanks