I have a for comprehension over Scalaz disjunctions. The left types on these can be different types of error case classes from other libraries. For example, one failure case can be due to an HTTP timeout while another can represent a Json parsing error in Play.
Is there a way of using some form of type class to declare 'these 4 classes/traits are all of this type of error' without actually having them inherit from a common trait? If this does exist, it would also need to be able to be inferred within a for comprehension.
I'm new to scalaz, but this is how I'd have handled the issue:
Define our decorators
Use
leftMap