Open LightAndLight opened 3 years ago
Is that instance unnecessarily restrictive? I would have thought that
instance (MonadError e1 f, MonadError e2 g) => MonadError (e1, e2) (Product f g) where
would work as well. Your throwError
would then be \e -> throwError (e, e)
.
EDIT: Never mind. The catchError
method can't be defined with this alternate instance.
Is there a technical reason why this instance doesn't exist? It seems well-behaved (some sanity-check proofs are at the bottom of the page).