-
Notifications
You must be signed in to change notification settings - Fork 71
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
Typeable constraint on fromAddHandler #12
Comments
I may be wrong, but it looks like the only use of Typeable is here. These should be replaceable with |
That would probably work, but I'm hesitant to use |
To be honest, I'm not entirely sure what the
where
where I admit that I can't figure out a use for these safe APIs — it seems like portals would only be useful through an existential, and I'm not sure how you'd achieve that in practice — but after looking at fromAddHandler's implementation I've implemented a variant of the first API with Unfortunately this required turning |
I think that the second API looks good. It must be safe because it can be implemented in terms of
Of course, the Since this is so very simple, it may not be worth adding it to the |
Hmm, yes, it can be implemented in terms of Vault, but the problem is that the same Portal can be used with multiple universes. There's no type error, but you can still get "the wrong value" out. I suppose this isn't a problem; you might even want to do it intentionally, to "modify" (persistently) the value inside the universe. |
Ah, I see. You mentioned the same issue with Thanks a lot for this discussion, I now have a clear idea of how to get rid of the |
I've removed the |
It would be very nice if we could get rid of the
Typeable
constraint on thefromAddHandler
function, so that its type signature becomesNot sure if that is possible, but this issue will remind me to look for a solution.
The text was updated successfully, but these errors were encountered: