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

Add roles declarations to allow safe coercions #29

Merged
merged 2 commits into from
Dec 4, 2020

Conversation

kl0tl
Copy link
Contributor

@kl0tl kl0tl commented Sep 12, 2020

This allows terms of type Nullable a to be coerced to type Nullable b when Coercible a b holds, hence allowing the zero cost coerce to introduce and eliminate newtypes under nullable values for instance.

@thomashoneyman
Copy link
Contributor

I’m not sure whether we want to introduce this or expect that users convert to Maybe first (we’ve intentionally kept this module restricted as it’s supposed to just be a thin layer over the FFI).

But I think @garyb or @hdgarrood may be better able to approve or close this than me as they have more context on that front.

@hdgarrood
Copy link
Contributor

I could go either way on this one, for that same reason (that you're not really supposed to do much with Nullable values on the PureScript side). I think I'm leaning towards approving adding this instance, since I don't think it violates any expectations or laws from the type class (unlike the Functor hierarchy instances for Nullable, which do violate laws).

@kl0tl kl0tl force-pushed the roles-declarations branch from 2e11a5b to 480a93d Compare December 3, 2020 20:37
@thomashoneyman
Copy link
Contributor

@JordanMartinez do you mind merging main and updating the hash on this branch so it builds successfully?

@JordanMartinez JordanMartinez merged commit c5c42c3 into purescript-contrib:main Dec 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants