Skip to content

Instantly share code, notes, and snippets.

@mrblueblue
Created March 21, 2017 22:02
Show Gist options
  • Select an option

  • Save mrblueblue/4fa78b9562c9b30661583290428a6624 to your computer and use it in GitHub Desktop.

Select an option

Save mrblueblue/4fa78b9562c9b30661583290428a6624 to your computer and use it in GitHub Desktop.
import R from "ramda"
function transducer (xform, stepper, init, input) {
const reducer = (accum, value) => stepper(accum, value)
const transduce = R.compose(R.reduce(reducer, init), xform)
return transduce(input)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment