Skip to content

Converge via array in pipe/compose #1645

@dalgard

Description

@dalgard

It would be really convenient if pipe and compose accepted an array for an argument, so that these would all become equivalent:

R.pipe(f, [g, h], i)(x)
R.compose(i, [g, h], f)(x)
R.compose(R.converge(i, [g, h]), f)(x)
i(g(f(x)), h(f(x)))

It would give a slightly weird impression if the signature of pipe/compose had been different, with the supplied functions wrapped in an array (#1644), because the outer array would then not have the same meaning as the inner array. But since this is not the case, I think this syntax is nice.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions