You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For a key type of String, both libraries detect no problems (I suspect the monad is lawful for this monoid). For a key type of Sum Int however, quickcheck-classes finds a counterexample to the following associativity law:
m >>= (\x -> k x >>= h) == m >>= k >>= h
with the following inputs:
m :: { 0 -> 0, 3 -> 7 }
k :: \x -> if (odd x) then { -3 -> 1 } else { 0 -> 0 }
h :: \x -> if (odd x) then { } else { 0 -> 0 }
For these inputs (and probably others), Mapnad (Sum Int) does not satisfy the associativity law. Nevertheless, hedgehog-classes doesn't find any problems:
Hello. I was trying to find out when a map with a monoid key is a monad, so I defined this:
I tested this against the tests for monad laws exported from both
quickcheck-classes
andhedgehog-classes
.Here is what I did for quickcheck-classes:
And here is what I did for hedgehog-classes:
For a key type of
String
, both libraries detect no problems (I suspect the monad is lawful for this monoid). For a key type ofSum Int
however, quickcheck-classes finds a counterexample to the following associativity law:with the following inputs:
For these inputs (and probably others),
Mapnad (Sum Int)
does not satisfy the associativity law. Nevertheless, hedgehog-classes doesn't find any problems:/cc @chessai, who asked me to file an issue about this.
The text was updated successfully, but these errors were encountered: