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.
Instances
Eq Dict Source # | |
Data Dict Source # | |
Defined in Data.Aeson.AutoType.Type gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Dict -> c Dict # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Dict # dataTypeOf :: Dict -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Dict) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Dict) # gmapT :: (forall b. Data b => b -> b) -> Dict -> Dict # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Dict -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Dict -> r # gmapQ :: (forall d. Data d => d -> u) -> Dict -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Dict -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Dict -> m Dict # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Dict -> m Dict # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Dict -> m Dict # | |
Ord Dict Source # | |
Show Dict Source # | |
Generic Dict Source # | |
Out Dict Source # | |
type Rep Dict Source # | |
Defined in Data.Aeson.AutoType.Type |
Union types for JSON values.
Instances
extractType :: Value -> Type Source #
Check if a number is integral, or floating point
| Extract Type
from the JSON Value
.
Unifying types of array elements, if necessary.