Maintainer | Toshio Ito <debug.ito@gmail.com> |
---|---|
Safe Haskell | None |
Language | Haskell2010 |
Deprecated: Use PMap instead
PropertyMap
was used in greskell prior than 1.0.0.0, but is now
deprecated. Use Data.Greskell.PMap instead.
Synopsis
- class PropertyMap m where
- lookupOne :: Text -> m p v -> Maybe (p v)
- lookupList :: Text -> m p v -> [p v]
- putProperty :: Property p => p v -> m p v -> m p v
- removeProperty :: Text -> m p v -> m p v
- allProperties :: m p v -> [p v]
- data PropertyMapSingle p v
- data PropertyMapList p v
- lookupOneValue :: (PropertyMap m, Property p) => Text -> m p v -> Maybe v
- lookupListValues :: (PropertyMap m, Property p) => Text -> m p v -> [v]
- parseOneValue :: (PropertyMap m, Property p, FromGraphSON v) => Text -> m p GValue -> Parser v
- parseListValues :: (PropertyMap m, Property p, FromGraphSON v) => Text -> m p GValue -> Parser [v]
- parseNonEmptyValues :: (PropertyMap m, Property p, FromGraphSON v) => Text -> m p GValue -> Parser (NonEmpty v)
- fromProperties :: (PropertyMap m, Property p, Monoid (m p v)) => [p v] -> m p v
- class FromGraphSONWithKey a
- data AProperty v = AProperty {}
- data AVertexProperty v = AVertexProperty {}
PropertyMap
class PropertyMap m where Source #
Common basic operations supported by maps of properties.
lookupOne :: Text -> m p v -> Maybe (p v) Source #
Look up a property associated with the given key.
lookupList :: Text -> m p v -> [p v] Source #
Look up all properties associated with the given key.
putProperty :: Property p => p v -> m p v -> m p v Source #
Put a property into the map.
removeProperty :: Text -> m p v -> m p v Source #
Remove all properties associated with the given key.
allProperties :: m p v -> [p v] Source #
Return all properties in the map.
Instances
PropertyMap PropertyMapList Source # | |
Defined in Data.Greskell.Graph.PropertyMap lookupOne :: Text -> PropertyMapList p v -> Maybe (p v) Source # lookupList :: Text -> PropertyMapList p v -> [p v] Source # putProperty :: Property p => p v -> PropertyMapList p v -> PropertyMapList p v Source # removeProperty :: forall (p :: Type -> Type) v. Text -> PropertyMapList p v -> PropertyMapList p v Source # allProperties :: PropertyMapList p v -> [p v] Source # | |
PropertyMap PropertyMapSingle Source # | |
Defined in Data.Greskell.Graph.PropertyMap lookupOne :: Text -> PropertyMapSingle p v -> Maybe (p v) Source # lookupList :: Text -> PropertyMapSingle p v -> [p v] Source # putProperty :: Property p => p v -> PropertyMapSingle p v -> PropertyMapSingle p v Source # removeProperty :: forall (p :: Type -> Type) v. Text -> PropertyMapSingle p v -> PropertyMapSingle p v Source # allProperties :: PropertyMapSingle p v -> [p v] Source # |
data PropertyMapSingle p v Source #
A PropertyMap
that has a single value per key.
putProperty
replaces the old property by the given property.
<>
returns the union of the two given property maps. If the two
property maps share some same keys, the value from the left map
wins.
Instances
data PropertyMapList p v Source #
A PropertyMap
that can keep more than one values per key.
lookupOne
returns the first property associated with the given
key.
putProperty
prepends the given property to the property list.
<>
returns the union of the two given property maps. If the two
property maps share some same keys, those property lists are
concatenated.
Instances
lookupOneValue :: (PropertyMap m, Property p) => Text -> m p v -> Maybe v Source #
Lookup a property value from a PropertyMap
by key.
lookupListValues :: (PropertyMap m, Property p) => Text -> m p v -> [v] Source #
Lookup a list of property values from a PropertyMap
by key.
parseOneValue :: (PropertyMap m, Property p, FromGraphSON v) => Text -> m p GValue -> Parser v Source #
Lookup a property GValue
by the given key, and parse it.
In version 0.1.1.0 and before, this function took an argument m p (GraphSON Value)
.
This has changed, because property types for AVertex
etc have changed.
parseListValues :: (PropertyMap m, Property p, FromGraphSON v) => Text -> m p GValue -> Parser [v] Source #
Lookup a list of property values from a PropertyMap
by the
given key, and parse them.
In version 0.1.1.0 and before, this function took an argument m p (GraphSON Value)
.
This has changed, because property types for AVertex
etc have changed.
parseNonEmptyValues :: (PropertyMap m, Property p, FromGraphSON v) => Text -> m p GValue -> Parser (NonEmpty v) Source #
Like parseListValues
, but this function fail
s when there is
no property with the given key.
In version 0.1.1.0 and before, this function took an argument m p (GraphSON Value)
.
This has changed, because property types for AVertex
etc have changed.
fromProperties :: (PropertyMap m, Property p, Monoid (m p v)) => [p v] -> m p v Source #
Create a PropertyMap
from list of Property
s.
Internal use
class FromGraphSONWithKey a Source #
This typeclass is for internal use.
GraphSON parser with a property key given from outside.
Since: 0.2.0.0
parseGraphSONWithKey
Instances
FromGraphSON v => FromGraphSONWithKey (AVertexProperty v) Source # | |
Defined in Data.Greskell.Graph.PropertyMap parseGraphSONWithKey :: Text -> GValue -> Parser (AVertexProperty v) | |
FromGraphSON v => FromGraphSONWithKey (AProperty v) Source # | |
Defined in Data.Greskell.Graph.PropertyMap parseGraphSONWithKey :: Text -> GValue -> Parser (AProperty v) |
Re-exports
General simple property type you can use for Property
class.
If you are not sure about the type v
, just use GValue
.
Instances
data AVertexProperty v Source #
General vertex property type you can use for VertexProperty.
If you are not sure about the type v
, just use GValue
.