| Maintainer | Toshio Ito <debug.ito@gmail.com> |
|---|---|
| Safe Haskell | None |
| Language | Haskell2010 |
NetSpider.GraphML.Attribute
Description
Since: 0.4.1.0
Synopsis
- type AttributeKey = Text
- data AttributeValue
- class ToAttributes a where
- toAttributes :: a -> [(AttributeKey, AttributeValue)]
- valueFromAeson :: Value -> Maybe AttributeValue
- attributesFromAeson :: Value -> Maybe [(AttributeKey, AttributeValue)]
- attributesToAeson :: [(AttributeKey, AttributeValue)] -> Value
Documentation
type AttributeKey = Text Source #
Key of attribute.
data AttributeValue Source #
Typed value of attribute.
Constructors
| AttrBoolean Bool | |
| AttrInt Int | |
| AttrLong Integer | |
| AttrFloat Float | |
| AttrDouble Double | |
| AttrString Text |
Instances
class ToAttributes a where Source #
Type that can be converted to list of attributes.
Methods
toAttributes :: a -> [(AttributeKey, AttributeValue)] Source #
Instances
| ToAttributes () Source # | |
Defined in NetSpider.GraphML.Attribute Methods toAttributes :: () -> [(AttributeKey, AttributeValue)] Source # | |
| ToAttributes TimeZone Source # | Since: 0.4.1.0 |
Defined in NetSpider.GraphML.Attribute Methods toAttributes :: TimeZone -> [(AttributeKey, AttributeValue)] Source # | |
| ToAttributes Timestamp Source # | Since: 0.4.1.0 |
Defined in NetSpider.Timestamp Methods toAttributes :: Timestamp -> [(AttributeKey, AttributeValue)] Source # | |
| ToAttributes [(AttributeKey, AttributeValue)] Source # | |
Defined in NetSpider.GraphML.Attribute Methods toAttributes :: [(AttributeKey, AttributeValue)] -> [(AttributeKey, AttributeValue)] Source # | |
| ToAttributes a => ToAttributes (Maybe a) Source # |
|
Defined in NetSpider.GraphML.Attribute Methods toAttributes :: Maybe a -> [(AttributeKey, AttributeValue)] Source # | |
valueFromAeson :: Value -> Maybe AttributeValue Source #
Make AttributeValue from aeson's Value. It returns
Nothing, if the input is null, an object or an array. If the
input is a number, the output uses AttrDouble.
attributesFromAeson :: Value -> Maybe [(AttributeKey, AttributeValue)] Source #
Make attributes from aeson's Value. It assumes the input
is an object, and its values can be converted by
valueFromAeson. Otherwise, it returns Nothing.
attributesToAeson :: [(AttributeKey, AttributeValue)] -> Value Source #