Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial conversion to ExceptT. #34

Merged
merged 2 commits into from Apr 11, 2015
Merged

Initial conversion to ExceptT. #34

merged 2 commits into from Apr 11, 2015

Conversation

twittner
Copy link
Contributor

Supporting issue #32.

I provisionally renamed throwE, catchE, handleE, and flipE to throwEither, catchEither, handleEither, and flipEither because throwE and catchE exist in Control.Monad.Trans.Except. I also removed throwT and catchT because of that and instead renamed handleT to handleE.

@brendanhay
Copy link

This looks great! Is there any outstanding work that can be done to assist in getting this merged/released?

@@ -59,57 +62,72 @@ import Data.Maybe (fromMaybe)
import System.Exit (ExitCode)
import System.IO (hPutStr, hPutStrLn, stderr)

exceptT :: Monad m => (a -> m c) -> (b -> m c) -> ExceptT a m b -> m c
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add the following documentation to these three functions:

-- | Fold an `ExceptT` by providing one continuation for each constructor
exceptT :: ...

-- | Transform the left and right value
bimapExceptT :: ...

-- | Upgrade an `Either` to an `ExceptT`
hoistEither :: ...

Gabriella439 added a commit that referenced this pull request Apr 11, 2015
Initial conversion to ExceptT.
@Gabriella439 Gabriella439 merged commit 7f0ee83 into Gabriella439:master Apr 11, 2015
@Gabriella439
Copy link
Owner

Alright, this looks good. Thanks for taking the time write up this large change. I'll put this up as errors-2.0 soon

@Gabriella439
Copy link
Owner

Alright, so the remaining work is that I need to get as many downstream packages to add an errors < 2.0 upper bound in order to minimize breakage. I've already opened up issues against all packages without an upper bound. After a week I'll create pull requests for them. Then, after another three weeks if they don't merge and upload the pull requests then I'll go ahead and upload errors-2.0 anyway.

@twittner twittner deleted the except branch April 17, 2015 15:18
@Gabriella439
Copy link
Owner

Alright, so I will upload this to Hackage next weekend. Most downstream packages have either added an upper bound or have been given sufficient notice (warnings, pull requests, reminders to upload to Hackage, etc.).

@Gabriella439
Copy link
Owner

Alright, this is up on Hackage errors-2.0. I'll announce it once the documentation builds.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants