Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify Task.perform/Task.attempt when used with identity and Cmd #316

Open
jfmengels opened this issue Aug 1, 2024 · 1 comment
Open
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@jfmengels
Copy link
Owner

jfmengels commented Aug 1, 2024

x |> Task.attempt identity |> Cmd.map fn
--> x |> Task.attempt fn

x |> Task.perform identity |> Cmd.map fn
--> x |> Task.perform fn

(seen in https://github.com/Flyp-Inc/lamdera-extra/blob/05c8c59187730265f0a9fd2312e3171171ccf3ac/src/Counter.elm#L192C22-L192C29)

Should we also simplify the following?

x |> Task.map fn |> Task.attempt identity
-->  x |> Task.attempt fn

x |> Task.map fn |> Task.perform identity
-->  x |> Task.perform fn
@jfmengels jfmengels added enhancement New feature or request help wanted Extra attention is needed labels Aug 1, 2024
@jmpavlick
Copy link

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants