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

Distributive class for pulling a transformer out to the top level #83

Merged
merged 1 commit into from
Jun 11, 2017

Conversation

jacobstanley
Copy link
Member

Perhaps adding a type class here is overkill, but I think we need the type family instances to make it manageable to use, so 🤷‍♂️

I think I'm going to go for it and see what happens.

--
withExceptT :: (Monad m, Show x, HasCallStack) => Test (ExceptT x m) a -> Test m a
withExceptT m =
withFrozenCallStack liftEither =<< runExceptT (distribute m)
Copy link
Member Author

Choose a reason for hiding this comment

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

I'm aware that this clashes with Control.Monad.Trans.Except.withExceptT but I'm not sure what else to call it. Whatever it's called it should be the same prefix as withResourceT I think.

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm going to go with this for now, if we decide to pick a different name it will be a breaking change anyway because of withResourceT so I don't see a reason to hold this up.

@jacobstanley jacobstanley merged commit ec3090d into master Jun 11, 2017
@jacobstanley jacobstanley deleted the topic/distribute branch June 11, 2017 00:42
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

1 participant