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

Lifting functions like liftA2 should allow the lifted function to sit on the same line as the lift #1155

Open
endgame opened this issue Jan 14, 2025 · 0 comments
Labels
style Nitpicking and things related to purely visual aspect for formatting.

Comments

@endgame
Copy link

endgame commented Jan 14, 2025

Is your feature request related to a problem? Please describe.
I find the following code a bit unsightly:

foo = do
  ok <-
    liftA2
      (&&)
      (checkRedirects (snd <$> hrRedirects response))
      (checkResponse response)
  ...

Describe the solution you'd like
More than most other functions, I think of a lifting function like lift[A-Z][2-9] as a unary function that takes a function-to-be-lifted and returns a function of N arguments. I therefore think that this output shows what's going on more clearly and doesn't waste a vertical line (the first argument is often very short — nearly always an operator or a function with no arguments):

foo = do
  ok <-
    liftA2 (&&)
      (checkRedirects (snd <$> hrRedirects response))
      (checkResponse response)
  ...
@amesgen amesgen added the style Nitpicking and things related to purely visual aspect for formatting. label Jan 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
style Nitpicking and things related to purely visual aspect for formatting.
Projects
None yet
Development

No branches or pull requests

2 participants