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

Helpers for JSON mailbox messages #17

Open
jml opened this issue Jan 6, 2018 · 0 comments
Open

Helpers for JSON mailbox messages #17

jml opened this issue Jan 6, 2018 · 0 comments

Comments

@jml
Copy link
Collaborator

jml commented Jan 6, 2018

Lots of mailbox messages (i.e. the bytes in Messages.Body) are JSON encoded. The Magic Wormhole protocol documentation doesn't insist that this is the case, but all extant messages are JSON encoded.

There are some ways we can make this more convenient:

  • A pair of ToBody and FromBody typeclasses

    class ToBody a where
        toBody :: a -> Messages.Body
    
    class FromBody a where
        fromBody :: Messages.Body -> Maybe a
  • sendEncryptedJSON and receiveEncryptedJSON helpers

Probably other ways too.

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

1 participant