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

Make Automatic serialize lists and tuples #251

Closed
chrisdone opened this issue Feb 22, 2013 · 3 comments
Closed

Make Automatic serialize lists and tuples #251

chrisdone opened this issue Feb 22, 2013 · 3 comments

Comments

@chrisdone
Copy link
Contributor

Automatic only serializes data-declared non-parametric data types. People want lists and tuples to work:
#244
#250

Someone's gonna have to extend the Automatic serialization for lists, tuples, etc. It should be just a case of typeof x == Fay$$Cons conditions.

@mgsloan
Copy link
Contributor

mgsloan commented Mar 13, 2013

Note that ideally this would convert lists of chars into js strings. Here's an example application of this, for a better JQuery API:

class Selectable a where

instance Selectable String
instance Selectable Text
instance Selectable Element
instance Selectable [Element]
instance Selectable JQuery

select :: Selectable a => Automatic a -> Fay JQuery
select = ffi "$(%1)"

bergmark added a commit that referenced this issue Jul 1, 2013
@bergmark
Copy link
Member

bergmark commented Jul 1, 2013

This has been dangling for quite a while :( I'm not sure if I'm covering all the cases here, anyone see any tests that should be added?

@bergmark
Copy link
Member

bergmark commented Jul 1, 2013

@mgsloan the problem with Automatic String is that we won't be able to tell whether [] should be encoded into "" or null (empty list). Trying to decode it would break Automatic a for all Text values. Not sure if there is a good enough solution for this, other than sticking to Text.

bergmark added a commit that referenced this issue Jul 27, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants