Either naturally generalises as a monad transformer, ExceptT, and we've recently established that this is a bona fide Selective transformer, meaning that there is a natural instance Selective f => Selective (ExceptT e f). I wonder whether there is also such an instance for
newtype ValidationT e f a = ValidationT { runValidationT :: f (Validation e a) }
The obvious question is whether this has the same Selective instance like ExceptT would have. I believe the instances of Either e and Validation e are isomorphic. But for a selective transformer, we probably also demand that lift :: f a -> ValidationT e f a defined by Validation . fmap Success should be a Selective morphism, and that law should be checked.
If this all works out, then maybe it makes sense to simply rename Control.Selective.Trans.Except to Control.Selective.Trans.Validation.
Eithernaturally generalises as a monad transformer,ExceptT, and we've recently established that this is a bona fideSelectivetransformer, meaning that there is a natural instanceSelective f => Selective (ExceptT e f). I wonder whether there is also such an instance forThe obvious question is whether this has the same
Selectiveinstance likeExceptTwould have. I believe the instances ofEither eandValidation eare isomorphic. But for a selective transformer, we probably also demand thatlift :: f a -> ValidationT e f adefined byValidation . fmap Successshould be aSelectivemorphism, and that law should be checked.If this all works out, then maybe it makes sense to simply rename
Control.Selective.Trans.ExcepttoControl.Selective.Trans.Validation.