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

Bad variable naming for functions with 2 arguments #2

Open
isovector opened this issue Jun 25, 2020 · 2 comments
Open

Bad variable naming for functions with 2 arguments #2

isovector opened this issue Jun 25, 2020 · 2 comments
Labels
bug Something isn't working

Comments

@isovector
Copy link

> quickCheck' $ property' $ \(foo :: Int -> Int -> Int) -> foo 2 1 == foo 1 2

*** Failed! Falsified (after 3 tests and 10 shrinks):    
\a0 -> case a0 :: Int of { 1 -> \a0 -> 0 ; _ -> \a0 -> 1 }

The counter example gives both arguments the name a0!

@Lysxia Lysxia added the bug Something isn't working label Jun 25, 2020
@Lysxia
Copy link
Owner

Lysxia commented Jun 25, 2020

Yeah that's definitely a problem.

That's hard to fix because this is currently using Show, and an instance Show a => Show (Int -> a) gives no way of telling a what names to use.

There are various non-ideal solutions (a different class, overlapping instances); I'll have to think about the trade-offs...

Suggestions welcome!

@isovector
Copy link
Author

An unsafePerformIO that updates a global name counter somewhere? :)

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

No branches or pull requests

2 participants