-
Notifications
You must be signed in to change notification settings - Fork 45
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
Remove orphan instance for MonadRandom #91
Comments
It is needed by the test suite. I don't object to removing it (or rather, moving it to the test suite where it is actually used). However I don't plan on cutting a new release any time soon. So in the mean time, you can probably replace your |
@frasertweedale Is there anything I can do to help? I can submit a PR and prepare a release if that's helpful. |
@pjones the change is already committed on Per my previous comment, you should be able to instance |
@pjones sorry for misleading you - I'm actually going to revert the change I made yesterday. The example programs and typical application code rely on |
This reverts commit cfad613. See discussion: #91 (comment) See also cryptonite pull request: haskell-crypto/cryptonite#310
Thank you for trying to find a solution to this. The reason I can't use the For now I have a workaround, but it would be nice if I didn't have to deal with orphan instances. |
I realise this is old but I’d really appreciate if we could reconsider removing this instance from the library, for the same reason as the one given upstream in cryptonite: lifting is not the only valid implementation. Plus this is an orphan, which adds a new level of potential frustration as previously working code can stop working due to the orphan coming into scope. |
Reopening. Gonna deal with this properly, at long last. |
To avoid problems with orphan instances, introduce newtype JOSE e m a Which behaves like `Except e m a` but also has instance (MonadRandom m) => MonadRandom (JOSE e m) This is an API breaking change and therefore requires a major version bump before release. Fixes: #91
Seeking feedback on proposed solution: b163ce2. The diff in the |
Looks good to me! I’d suggest getting rid of the -fno-warn-orphans pragmas in src/ so that you get warnings if there are any other orphans in there. |
To avoid problems with orphan instances, introduce newtype JOSE e m a Which behaves like `Except e m a` but also has instance (MonadRandom m) => MonadRandom (JOSE e m) This is an API breaking change and therefore requires a major version bump before release. Fixes: #91
Thanks, I updated the commit. Some of the |
I merged the change in commit b163ce2. I plan to cut a new release in about one week. In the meantime please share any more feedback about the change. |
I have a
MonadRandom
instance in my application that looks like this:This generates an overlapping instance error due to the vagueness of the instance in
hs-jose
.I'm not sure why this package needs the orphan instance but is there a way to remove it or use a
newtype
wrapper?The text was updated successfully, but these errors were encountered: