hedgehogqa / haskell-hedgehog-classes

Hedgehog will eat your typeclass bugs
BSD 3-Clause "New" or "Revised" License
57 stars 17 forks source link

eqLaws doesn't actually check substitutivity #11

Closed ocharles closed 5 years ago

ocharles commented 5 years ago

The documentation says that eqLaws tests substitutivity - http://hackage.haskell.org/package/hedgehog-classes-0.1.1.0/docs/Hedgehog-Classes.html#v:eqLaws. However, reading the source shows only transitivity, reflexivity, negation and symmetry.

chessai commented 5 years ago

That's true. I don't think we can actually check substitutivity, since the type Eq a => a is too polymorphic to check against some function f :: (Eq a, Eq b) => a -> b (how could it consume its argument without discarding it?). This should probably be noted in the docs, or at least the docs should be amended to remove the claim that they test substitutivity.

ocharles commented 5 years ago

I'm fine with the docs just saying that this isn't checked.