concrete functor and monad transformers
#56ExceptT should have a `finallyE` and other helpers
I think it would make sense to have:
finallyE :: Monad m => ExceptT e m a -> ExceptT e m () -> ExceptT e m a
finallyE op closer = do
x <- catchE (Right <$> op) (pure . Left)
case x of
Left e -> closer >> throwE e
Right r -> closer >> pure r
finallyE op closer = do x <- catchE (Right <$> op) (pure . Left) closer case x of Left e -> throwE e Right r -> pure r
- status set to closed
fixed, thanks