Design of an Assertable
refactoring of postcondition
#18
Replies: 4 comments 13 replies
-
The wish-list for this extension is:
The idea is to do something like:
and
|
Beta Was this translation helpful? Give feedback.
-
My suggestion would be to drop the "must be backwards compatible" requirement. Then the closer analogy is I think QuickCheck's class Testable a where
property :: a -> Property Then you could make I think any of the alternatives are going to be a bit messy; as you point out, you'll need an additional parameter to the class (seems overkill). Wrapping it in some kind of existential wrapper won't help, because that will then immediately break the "backwards compatibility" requirement, in which case there are simpler solutions, I think. |
Beta Was this translation helpful? Give feedback.
-
I realised a major danger of using |
Beta Was this translation helpful? Give feedback.
-
@edsko and @abailly we found a nice design here. The version of |
Beta Was this translation helpful? Give feedback.
-
The
postcondition
interface does not give us a clean and easy way to give feedback about what went wrong in a postcondition. Instead you have to use themonitoring
function for that - leading to repeated logic. That's a bit of a shame and a good approach to fixing this issue was identified in #11 but unfortunately due to some miscommunication that work has stalled for the moment. Hopefully we can pick that up again and use the good work that's there!The idea is to use this issue to discuss the design of this refactoring here in a neutral manner that doesn't result in endless nit-picking of a PR.
Beta Was this translation helpful? Give feedback.
All reactions