-
Notifications
You must be signed in to change notification settings - Fork 90
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
Ports purescript-proxy
into this repo
#230
Conversation
I'll have to get to this later:
|
src/Data/Symbol.purs
Outdated
|
||
-- local definition for use in `reifySymbol` | ||
foreign import unsafeCoerce :: forall a b. a -> b | ||
|
||
reifySymbol :: forall r. String -> (forall sym. IsSymbol sym => SProxy sym -> r) -> r | ||
reifySymbol s f = coerce f { reflectSymbol: \_ -> s } SProxy where | ||
reifySymbol :: forall r. String -> (forall sym. IsSymbol sym => Proxy sym -> r) -> r |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should use a type variable proxy
instead of Proxy
, for the same reason as reflectProxy
- that is, so that it works with both Proxy and SProxy until we update it again later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch! I've fixed that in latest commits.
Should the docs for |
I don't think that's necessary; it will be clear that Proxy can be used for any kind once someone has come across the idea of polymorphic kinds, and I think the documentation for polykinds would be a better place to introduce things like the fact that you can use Proxy with any kind. |
Ok. Then I think this PR is ready to be merged if there are no other changes I need to make. |
Since
SProxy
is defined in Prelude, we need to portpurescript-proxy
'sProxy
type to here instead now that it can be polykinded.Note: I assume that
IsSymbol
should useProxy
now rather thanSProxy
.