hedgehogqa / haskell-hedgehog-classes

Hedgehog will eat your typeclass bugs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

eqLaws doesn't actually check substitutivity

ocharles opened this issue · comments

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.

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.

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