Skip to content

Simplify Maybe.map foo |> Maybe.withDefault Nothing to Maybe.andThen foo #367

@harmboschloo

Description

@harmboschloo

What the rule should do:

Simplify Maybe.map foo |> Maybe.withDefault Nothing to Maybe.andThen foo

What problems does it solve:

Should remove unnecessary code.

Example of things the rule would report:

Maybe.map foo |> Maybe.withDefault Nothing
--> Maybe.andThen foo

Maybe.map (\a -> ...) |> Maybe.withDefault Nothing
--> Maybe.andThen (\a -> ...)

Should this be part of the Simplify rule or should it be a new rule?

Part of Simplify.

I am looking for:

Just reporting this because I found occurrences of this in our code-base. Might be a nice addition.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions