function pipe(...functions) {
    return (...args) => functions.reduce((acc, curr, idx) => idx === 0 ? curr(...args) : curr(acc), args)
}