Skip to content

Transform applied composition to application #339

@jfmengels

Description

@jfmengels

I suggest we transform the following code:

(f >> g) x
--> g (f x)

x |> (f >> g)
--> x |> f |> g

(f >> g) <| x
--> g <| f <| x

And the appropriate transformations for <<.

I think this makes the code a bit simpler.

There's also the rationale that this would be helpful to Simplify itself. We've recently added the following simplification:

List.length l /= 0
--> not (List.isEmpty l)

In the original implementation in #314, the original transformation was the following:

List.length l /= 0
--> (not << List.isEmpty) l

which I thought didn't look great. Changing it to not use << was unfortunately more work. However, if we have the suggested transformation, then this would be an okay intermediate transformation to have. It would take an additional fix step, but it would end up the way we would recommend it.

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