I'm creating an object as JSON using aeson
. How to add a field "email" to the object?
> import Data.Aeson
> let alice = object ["name" .= "Alice", "age" .= 20]
I tried to use <>
but didn't work
> import Data.Monoid
> alice <> object ["email" .= "alice@example.org"]
<interactive>:12:1: error:
• No instance for (Monoid Value) arising from a use of ‘<>’
• In the expression:
alice <> object ["email" .= "alice@example.org"]
In an equation for ‘it’:
it = alice <> object ["email" .= "alice@example.org"]