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

An idempotence issue involving ($) and multi-way if #366

Closed
mrkkrp opened this issue Sep 7, 2019 · 2 comments
Closed

An idempotence issue involving ($) and multi-way if #366

mrkkrp opened this issue Sep 7, 2019 · 2 comments
Labels
bug Something isn't working idempotence Idempotence issues and solutions.

Comments

@mrkkrp
Copy link
Member

mrkkrp commented Sep 7, 2019

Here is an example from hledger (which should be enabled on CI when we fix this):

accts = dbg5 "accts to show" $ -- no need to nub/sort, accountTree will
  if | declared     && not used -> matcheddeclaredaccts
     | not declared && used     -> matchedusedaccts
     | otherwise                -> matcheddeclaredaccts ++ matchedusedaccts

On the first pass we get:

accts =
  dbg5 "accts to show"
    $ if -- no need to nub/sort, accountTree will
      | declared && not used -> matcheddeclaredaccts
      | not declared && used -> matchedusedaccts
      | otherwise -> matcheddeclaredaccts ++ matchedusedaccts

On the second pass:

accts =
  dbg5 "accts to show"
    $ if
      -- no need to nub/sort, accountTree will
      | declared && not used -> matcheddeclaredaccts
      | not declared && used -> matchedusedaccts
      | otherwise -> matcheddeclaredaccts ++ matchedusedaccts
@mrkkrp mrkkrp added bug Something isn't working idempotence Idempotence issues and solutions. labels Sep 7, 2019
@utdemir
Copy link
Contributor

utdemir commented Sep 13, 2019

I think this has the same underlying issue with #340.

@mrkkrp
Copy link
Member Author

mrkkrp commented May 6, 2020

Tested with current master; this is no longer an issue.

@mrkkrp mrkkrp closed this as completed May 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working idempotence Idempotence issues and solutions.
Projects
None yet
Development

No branches or pull requests

2 participants