jordan-0.2.0.0: JSON with Structure
Safe HaskellNone
LanguageHaskell2010

Jordan.ToJSON.Builder

Synopsis

Documentation

newtype JSONBuilder a Source #

JSON Serializer that makes use of Builder to do its work. Should be really fast.

Constructors

JSONBuilder 

Fields

Instances

Instances details
Contravariant JSONBuilder Source # 
Instance details

Defined in Jordan.ToJSON.Builder

Methods

contramap :: (a -> b) -> JSONBuilder b -> JSONBuilder a #

(>$) :: b -> JSONBuilder b -> JSONBuilder a #

JSONSerializer JSONBuilder Source # 
Instance details

Defined in Jordan.ToJSON.Builder

Methods

serializeObject :: (forall (objSerializer :: Type -> Type). JSONObjectSerializer objSerializer => objSerializer a) -> JSONBuilder a Source #

serializeDictionary :: Foldable t => (forall (jsonSerializer :: Type -> Type). JSONSerializer jsonSerializer => jsonSerializer a) -> JSONBuilder (t (Text, a)) Source #

serializeText :: JSONBuilder Text Source #

serializeTextConstant :: Text -> JSONBuilder a Source #

serializeNull :: JSONBuilder any Source #

serializeNumber :: JSONBuilder Scientific Source #

serializeBool :: JSONBuilder Bool Source #

serializeTuple :: (forall (tupleSerializer :: Type -> Type). JSONTupleSerializer tupleSerializer => tupleSerializer a) -> JSONBuilder a Source #

serializeArray :: ToJSON a => JSONBuilder [a] Source #

nameSerializer :: Text -> JSONBuilder a -> JSONBuilder a Source #

Selectable JSONBuilder Source # 
Instance details

Defined in Jordan.ToJSON.Builder

Methods

giveUp :: (arg -> Void) -> JSONBuilder arg Source #

select :: (arg -> Either lhs rhs) -> JSONBuilder lhs -> JSONBuilder rhs -> JSONBuilder arg Source #

Semigroup (JSONBuilder a) Source # 
Instance details

Defined in Jordan.ToJSON.Builder

Monoid (JSONBuilder a) Source # 
Instance details

Defined in Jordan.ToJSON.Builder

toJSONViaBuilder :: ToJSON a => a -> ByteString Source #

Serialize a Haskell datatype to a lazy ByteString.

toJSONAsBuilder :: ToJSON a => a -> Builder Source #

Serialize a Haskell datatype to a Builder.

This is available for performance reasons: you may wish to use hPutBuilder in order to (more or less) directly serialize some JSON object to a file handle.