Skip to content

Merge composition with lambdas #337

@jfmengels

Description

@jfmengels

Some of our fixes can/could lead to generating composition (f >> g), which could get a bit ugly when one of the functions is a lambda.

I think we could simplify them a bit like this:

(\singleArg -> x |> function) >> g
--> (\singleArg -> x |> function |> g)

f >> (\singleArg -> x |> function)
--> (\singleArg -> x |> f |> function)

We'd also have the symmetrical changes for <<.

I don't think we should do anything when the lambda has multiple arguments, and I don't think we should do anything when both functions are lambdas. At least, I haven't given it enough thought yet.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions