equal?/2 began using assert internally as of 640c0fd.
This library assumes that functions avoid immediately blowing up errors (unless they have a !)
In proper functional style, we prefer keeping helpers "dumb" and delegate control to the caller
Critically, we need to be able to check equal?(a, b) or equal?(x, y)
Embedding an assert makes this impossible
Steps to Reproduce
On my machine, this does not occur when compiling Witchcraft with fresh deps and _build. I was able to reproduce with a new application that used Witchcraft as a dependency. This typically fails on Ord.ex prop checks.
Edited deps/type_class/lib/type_class/property.ex, removing the asserts, and everything works. The offending line requires checking two possible options with an or. Since assert will blow up on a single failure, this makes any boolean logic impossible.
Still Need Better Fail Reporting
While the errors generated by assert were more detailed, they were often of little use. For example, this doesn't tell me anything about the values that lead to failure:
Assertion with == failed
code: assert left == right
left: :equal
right: :lesser
Better error messages would be very useful. It's not new information that the prop-testing system could be improved, and this should be explored.
Some discussion occurred in that thread. For some reason, I did not receive an email until 5 days later. This isn't the first time this has happened. I will explore my spam filtering and GitHub email settings.
Root Issue
equal?/2
began usingassert
internally as of640c0fd
.!
)equal?(a, b) or equal?(x, y)
assert
makes this impossibleSteps to Reproduce
On my machine, this does not occur when compiling Witchcraft with fresh deps and
_build
. I was able to reproduce with a new application that used Witchcraft as a dependency. This typically fails onOrd.ex
prop checks.Edited
deps/type_class/lib/type_class/property.ex
, removing theassert
s, and everything works. The offending line requires checking two possible options with anor
. Sinceassert
will blow up on a single failure, this makes any boolean logic impossible.Still Need Better Fail Reporting
While the errors generated by
assert
were more detailed, they were often of little use. For example, this doesn't tell me anything about the values that lead to failure:Better error messages would be very useful. It's not new information that the prop-testing system could be improved, and this should be explored.
History
@SchrodingerZhu reported that Algae was unable to build, failing compile-time prop checks.
Some discussion occurred in that thread. For some reason, I did not receive an email until 5 days later. This isn't the first time this has happened. I will explore my spam filtering and GitHub email settings.