Skip to content

Instantly share code, notes, and snippets.

@tkers
Created April 19, 2016 15:32
Show Gist options
  • Save tkers/b2b72a8bf5dac0f336e47d6e7be2fe7e to your computer and use it in GitHub Desktop.
Save tkers/b2b72a8bf5dac0f336e47d6e7be2fe7e to your computer and use it in GitHub Desktop.
// comp :: (F, G, H) => (x, y, z) => F(G(H(x, y, z)))
const comp = (...fns) => (...args) => fns.reduceRight((arg, fn) => [fn(...arg)], args)[0];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment