Safe Haskell | None |
---|---|
Language | Haskell2010 |
Extraction and unification of AutoType's Type
from Aeson Value
.
Documentation
valueSize :: Value -> Int Source
Compute total number of nodes (and leaves) within the value tree. Each simple JavaScript type (including String) is counted as of size 1, whereas both Array or object types are counted as 1+sum of the sizes of their member values.
valueTypeSize :: Value -> Int Source
Compute total size of the type of the Value
.
For:
* simple types it is always 1,
* for arrays it is just 1+_maximum_ size of the (single) element type,
* for objects it is _sum_ of the sizes of fields (since each field type
is assumed to be different.)
valueDepth :: Value -> Int Source
Compute total depth of the value. For: * simple types it is 1 * for either Array or Object, it is 1 + maximum of depths of their members
Dictionary of types indexed by names.
Union types for JSON values.
extractType :: Value -> Type Source
Extract Type
from the JSON Value
.
Unifying types of array elements, if necessary.
unifyTypes :: Type -> Type -> Type Source
Standard unification procedure on Type
s,
with inclusion of Type
unions.