Skip to content

bank-account: Supress HLint suggestion #379

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

Merged
merged 1 commit into from
Sep 27, 2016
Merged

bank-account: Supress HLint suggestion #379

merged 1 commit into from
Sep 27, 2016

Conversation

rbasso
Copy link
Contributor

@rbasso rbasso commented Sep 26, 2016

Related to #355.

The following suggestion would probably make the tests
shorter, but harder to read:

./test/Tests.hs:29:9: Suggestion: Reduce duplication
Found:
  account <- openAccount
  getBalance account `shouldReturn` Just 0
  incrementBalance account 10 `shouldReturn` Just 10
Why not:
  Combine with ./test/Tests.hs:47:9

1 hint

It is not clear why, but hlint doesn't supresses the suggestions
if we use {-# ANN specs ..., only with {-# ANN module ....

@petertseng
Copy link
Member

Another possibility is... to no longer duplicate! For example if we change done of those 10 to a 15 or something.

It is not really important to me which of these two choices we take (ignore duplication hint, or change a value)

The following suggestion would probably make the tests
shorter, but harder to read:

```
./test/Tests.hs:29:9: Suggestion: Reduce duplication
Found:
  account <- openAccount
  getBalance account `shouldReturn` Just 0
  incrementBalance account 10 `shouldReturn` Just 10
Why not:
  Combine with ./test/Tests.hs:47:9

1 hint
```

So we just change one of the numbers to silence `hlint` by
removing the duplication.
@rbasso
Copy link
Contributor Author

rbasso commented Sep 27, 2016

Another possibility is... to no longer duplicate! For example if we change done of those 10 to a 15 or something.

That is a great idea! Let's try it! 😄

@rbasso rbasso merged commit 7075d13 into exercism:master Sep 27, 2016
@rbasso rbasso deleted the bank-account-supress-hlint-suggestion branch September 27, 2016 12:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants