Trace is a simple pattern which allows for invoking a binary side-effect in composition - normally we want to stay away from side-effects, but here we're exploiting side-effects to very simply augment our composed pipeline:
import {__, pipe, curry} from 'ramda'
const traceSideEffect = curry((fn, a, b) => {
fn(a, b)
return b
})
const trace = traceSideEffect(console.log)
// OR (shameless plug)
// import {trace} from 'xtrace'
const addAndDivide = curry(
(a, b, c) => pipe(
add(a),
trace('a + b'),
divide(__, c),
trace('output')
)(b)
)