Skip to content

Simplify wrapping then destructuring #452

Description

@jfmengels
x |> Constructor |> (\(Constructor y) -> ...)
-->
x |> (\y -> ...)

Constructor >> (\(Constructor y) -> ...)
--> (\y -> ...)

(originally from #444 (review))

Similarily, there are other wrappers that we can simplify away:

-- If Constructor is just a single `FunctionOrValue` type constructor
-- then it HAS to be of shape `type alias Constructor = { y : ... }`
Constructor >> (\{y} -> ...)
--> (\y -> ...)

Tuple.pair x >> (\( _, y ) -> ...)
--> (\( y ) -> ...)

-- Same for first, second or third ignored tuple element
( x, y ) |> (\( a, _ ) -> ...)
--> x |> (\( a ) -> ...)

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