Skip to content
This repository

Data.Aeson.Types.object #65

Closed
drdo opened this Issue · 2 comments

2 participants

Daniel Oliveira Bas van Dijk
Daniel Oliveira

Just a minor thing, but would it be possible for object to have type
ToJSON a ⇒ [(Text, a)] → Value
instead of
[(Text, Value)] → Value
?

Thank you

Bas van Dijk
Collaborator

Note that the recommended way to use object is to combine it with (.=) as in:

toJSON x = object [ "field1" .= field1 x
                  , "field2" .= field2 x
                  , "field3" .= field3 x
                  ]

This way you don't need an polymorphic object.

Daniel Oliveira

Oh, i had not noticed that (.=) existed. Thank you

Daniel Oliveira drdo closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.