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

Defining instances for "native" JS values (that are not Fantasy-Land compatible) #110

Open
masaeedu opened this issue Nov 16, 2018 · 2 comments

Comments

@masaeedu
Copy link
Member

It would be nice to be able to access the same facilities Sanctuary uses to define instances for types like Array, StrMap, etc. to define instances for even more "unwrapped" values, with type membership dictated by user-specifiable predicates.

I think this might eventually boil down to the same feature as "implement static land support", but there might be other ways to accomplish this.

@davidchambers
Copy link
Member

I love this proposal. Could you provide a rough idea of how it might work in practice?

@masaeedu
Copy link
Member Author

I'll put a longer response here when I have a bit of time, but unfortunately the answer so far is that I don't actually know. I've been reading a lot about various implementations of typeclass-ish things that allow for implementations to be grafted onto existing data, but there's various tradeoffs, and most of them seem to rely on information that isn't easy to obtain without static analysis.

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