A (simple) usecase could be to check if the item is valid, and if not fail with the (list) of errors.
So something as:
validateFail :: MonadFail m => a -> m a
validateFail = either fail pure . prettyValidate
A simple use case for this would be m ~ Q for example: a QuasiQuoter where we want to raise a compile error if the quasi quoted value has some invalid properties.
A (simple) usecase could be to check if the item is valid, and if not fail with the (list) of errors.
So something as:
A simple use case for this would be
m ~ Qfor example: aQuasiQuoterwhere we want to raise a compile error if the quasi quoted value has some invalid properties.