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

Left-to-right arrow application is mirrored (AST differs) #737

Closed
robx opened this issue Aug 4, 2021 · 0 comments · Fixed by #738
Closed

Left-to-right arrow application is mirrored (AST differs) #737

robx opened this issue Aug 4, 2021 · 0 comments · Fixed by #738
Labels
bug Something isn't working

Comments

@robx
Copy link
Contributor

robx commented Aug 4, 2021

Describe the bug

Ormolu formats proc a -> x >- a to proc a -> a -< x, which has a different AST.

To Reproduce

$ cat test.hs
{-# LANGUAGE Arrows #-}

foo x = proc a -> x >- a
$ ormolu test.hs
test.hs
  AST of input and AST of formatted code differ.
    at test.hs:3:19-24
  Please, consider reporting the bug.
$ ormolu --unsafe test.hs
{-# LANGUAGE Arrows #-}

foo x = proc a -> a -< x

Expected behavior
ormolu should not fail.

Probably, it shouldn't reformat the example at all, though I suppose an argument could be made for normalizing the direction. In that case, the ASTs should be considered equivalent.

Environment
current master on macos

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants