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

Move MonadRandom instances so they are no longer orphans #23

Closed
andrewthad opened this issue May 12, 2016 · 6 comments
Closed

Move MonadRandom instances so they are no longer orphans #23

andrewthad opened this issue May 12, 2016 · 6 comments

Comments

@andrewthad
Copy link

Since MonadRandom is an mtl style typeclass and this library depends on transformers, it seems like it should provide the usual pass through instances. Things like:

instance MonadRandom m => MonadRandom (ReaderT r m) where ...

Is there a reason these were omitted, or would you take a PR for this?

@byorgey
Copy link
Owner

byorgey commented May 12, 2016

But the library does provide these instances. For example, the one you mention is here:

https://github.com/byorgey/MonadRandom/blob/master/Control/Monad/Random.hs#L182

Did you encounter a situation where these did not work for you?

@andrewthad
Copy link
Author

andrewthad commented May 12, 2016

Ah, it looks like there are two problems. One is that I was trying to use the pass through instance for ListT, which doesn't exist. That's fine though because people shouldn't really use ListT anyway. The second problem is that these instances are all defined as orphans, and so they don't show up in the haddocks. I've actually run into this issue in both text-show and in aeson recently. There might be a haddock fix for this at some point in the future. In this case, it seems like the instances could just be moved to the Class module so that they would not longer be orphans.

@byorgey
Copy link
Owner

byorgey commented May 12, 2016

Ah, yes, making them non-orphans so they show up in the Haddocks is a good idea. Would you be willing to make a PR for that?

@andrewthad
Copy link
Author

Yeah.

@byorgey byorgey changed the title More MonadRandom instances Move MonadRandom instances so they are no longer orphans May 12, 2016
@byorgey
Copy link
Owner

byorgey commented May 12, 2016

Thanks! I'll leave this issue open with a different title.

@andrewthad
Copy link
Author

PR is up.

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

No branches or pull requests

2 participants