haskell / aeson

A fast Haskell JSON library
Other
1.26k stars 321 forks source link

Add smart constructors for Value #975

Open Boarders opened 2 years ago

Boarders commented 2 years ago

Constructing a Value type by hand you can use .= and object. I think it would make sense to have a richer collection of ways to construct a Value mirroring the interface that is offered by Data.Aeson.Encoding.

Boarders commented 2 years ago

As an example, if one wants to create an array value then that should not mean you need to import Vector.

phadej commented 2 years ago

FWIW, Vector is an instance of https://hackage.haskell.org/package/base-4.14.1.0/docs/GHC-Exts.html#t:IsList