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 instances for List, Tuple and Map? #30

Closed
anttih opened this Issue Aug 28, 2015 · 3 comments

Comments

Projects
None yet
2 participants
@anttih
Copy link
Contributor

anttih commented Aug 28, 2015

Maps could be read in from a list of pairs, using the List and Tuple IsForeign instances.

I think there should be a defacto way to read in key-value pairs somehow, but I'm not sure if they should be added to this project or to those specific libraries. I could wrap Map in a newtype, but like I said, I really think we should be able to read Maps.

@anttih

This comment has been minimized.

Copy link
Contributor

anttih commented Aug 28, 2015

Avoiding creating lots of dependencies here, or foreign dependency in lists, maps and tuples, maybe this warrants it's own foreign-extras library?

Edit: obviously this would require newtypes...

@garyb

This comment has been minimized.

Copy link
Member

garyb commented Aug 28, 2015

I think from previous discussions we'd kinda agreed to avoid providing default IsForeign instances for PureScript types. The meaning of Foreign currently is purely about direct safe coercion of types from Javascript - if we add instances for common PureScript types it confuses the matter a little, as it's more like a parser then.

@anttih

This comment has been minimized.

Copy link
Contributor

anttih commented Aug 28, 2015

Yeah, that makes sense. Maybe the answer here is use argonaut or a newtype.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment