Safe Haskell | None |
---|---|
Language | Haskell98 |
Convert JSON to BSON and the other way around.
Note that BSON has more data types than JSON, so some BSON to JSON conversions are not bijective and somewhat arbitrary.
This means that for some BSON objects:
bsonify . aesonify /= id bsonifyValue . aesonifyValue /= id
We tried to choose sensible translations on those cases.
Synopsis
- aesonify :: Document -> Object
- aesonifyValue :: Value -> Value
- bsonify :: (Scientific -> Value) -> Object -> Document
- bsonifyValue :: (Scientific -> Value) -> Value -> Value
- bsonifyError :: Object -> Document
- bsonifyBound :: Object -> Document
- errorRange :: Scientific -> Value
- bound :: Scientific -> Value
Documentation
aesonifyValue :: Value -> Value Source #
Converts a BSON value to JSON.
bsonify :: (Scientific -> Value) -> Object -> Document Source #
Converts an AESON object to a BSON document. The user can provide a function to deal with JSON numbers that are too big.
bsonifyValue :: (Scientific -> Value) -> Value -> Value Source #
Helpers
Converts a JSON value to BSON.
bsonifyError :: Object -> Document Source #
Converts an AESON object to a BSON document. Will yeld an error for JSON numbers that are too big.
bsonifyBound :: Object -> Document Source #
Converts an AESON object to a BSON document. Will bound JSON numbers that are too big.
errorRange :: Scientific -> Value Source #
bound :: Scientific -> Value Source #