Skip to content

Passing ((-) x) as function to map functions is not intuitive #6

@kuon

Description

@kuon

I noticed that if we do:

desaturatedColor =
    Color.red
    |> mapSaturation ((-) 0.3)

We end up with a color with saturation -0.7 instead of 0.7.

I think being able to pass ((-) x) is good. One workaround would be to chain the passed function with abs, it wouldn't break (*), (+) and always as generating negative makes no real sense (it would change the behavior of (+) -0.5 if the value is less than 0.5 but is it an issue?).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions