haskell-checkers / checkers

Check properties on standard classes and data structures
Other
79 stars 13 forks source link

Updates `traversable` to test the correct laws #61

Closed solomon-b closed 2 years ago

solomon-b commented 2 years ago

Resolves issue #24

I wasn't able to implement the Naturality test correctly, but I left it in as a comment in case someone else can get it working. I think it follows from Identity and Composition so we are okay without it.

sjakobi commented 2 years ago

BTW, it would be nice to have tests for the sequenceA laws, too. Feel free to add them, but there's no obligation. :)

solomon-b commented 2 years ago

I think it follows from Identity and Composition so we are okay without it.

Do you know a proof?

hmm, i actually haven't been able to find a proof, but this link claims it is guaranteed to hold: https://en.wikibooks.org/wiki/Haskell/Traversable#The_Traversable_laws

solomon-b commented 2 years ago

Great!

sjakobi commented 2 years ago

Regarding naturality, note this change: https://gitlab.haskell.org/ghc/ghc/-/merge_requests/7492

solomon-b commented 2 years ago

Well there you go. Should we hold off on merging this until a working implementation is produced?

sjakobi commented 2 years ago

Well there you go. Should we hold off on merging this until a working implementation is produced?

When do you expect it to land?

IMHO the existing changes are good additions which shouldn't be held back for very long.

solomon-b commented 2 years ago

Well there you go. Should we hold off on merging this until a working implementation is produced?

When do you expect it to land?

IMHO the existing changes are good additions which shouldn't be held back for very long.

To be honest, I'm a little stumped on this how to fix it. Is there anyone with more quickcheck experience who we can ask? The issue is the rank2 type.

sjakobi commented 2 years ago

Published in v0.6.0: https://hackage.haskell.org/package/checkers-0.6.0