I'm trying to adapt Discipline's testing approach, but I'm experiencing issues with comparing values in effectful context
The source of the problem is in discipline package in cats laws - there is an implicit converter from
Prop, requiring an
Eq[A] and a prettifier
A => Pretty.
A is actually an
IO[A], it means that to use
Pretty I have to reevaluate the effects I've already evaluated with
Eq or memoize them. I suppose I can come up with my own converter to
Prop which runs all effects and remembers their values at the beginning, but maybe I'm missing something and someone here can point me in the right direction.
PartialOrder also enables >, >=, <, and <= operators, but these are tricky to use because if you’re not careful you could end up using the built-in comparison operators.
Hmm. I didn’t see any cases of that problem in my usage.
On a related note: if you’re wirting tests and you need an
MonadError, do you just jump to using
IO (or, in my situation,
StateT[IO, MyState, ?] because I need
MonadError)? Or something less powerful than
Eitheris a pretty easy one
Coyonedaas well, so it's actually closer to