| Maintainer | Toshio Ito <debug.ito@gmail.com> |
|---|---|
| Safe Haskell | None |
| Language | Haskell2010 |
Data.Greskell.AsLabel
Description
Since: 0.2.2.0
Synopsis
- newtype AsLabel a = AsLabel {}
- data SelectedMap a
- lookup :: AsLabel a -> SelectedMap b -> Maybe b
- lookupM :: MonadThrow m => AsLabel a -> SelectedMap b -> m b
- lookupAs :: FromGraphSON a => AsLabel a -> SelectedMap GValue -> Either AsLookupException a
- lookupAsM :: (MonadThrow m, FromGraphSON a) => AsLabel a -> SelectedMap GValue -> m a
- data AsLookupException
Documentation
AsLabel a represents a label string used in .as step
pointing to the data of type a.
Instances
| Functor AsLabel Source # | Unsafely convert the phantom type. |
| Eq (AsLabel a) Source # | |
| Ord (AsLabel a) Source # | |
| Show (AsLabel a) Source # | |
| ToGreskell (AsLabel a) Source # | Returns the |
Defined in Data.Greskell.AsLabel Associated Types type GreskellReturn (AsLabel a) :: Type # Methods toGreskell :: AsLabel a -> Greskell (GreskellReturn (AsLabel a)) # | |
| type GreskellReturn (AsLabel a) Source # | |
Defined in Data.Greskell.AsLabel | |
data SelectedMap a Source #
A map keyed with AsLabel. Obtained from .select step, for
example.
Instances
lookup :: AsLabel a -> SelectedMap b -> Maybe b Source #
Get value from SelectedMap.
lookupM :: MonadThrow m => AsLabel a -> SelectedMap b -> m b Source #
MonadThrow version of lookup. If there is no value for the
AsLabel, it throws NoSuchAsLabel.
lookupAs :: FromGraphSON a => AsLabel a -> SelectedMap GValue -> Either AsLookupException a Source #
Get value from SelectedMap and parse the value into a.
lookupAsM :: (MonadThrow m, FromGraphSON a) => AsLabel a -> SelectedMap GValue -> m a Source #
MonadThrow version of lookupAs.
data AsLookupException Source #
Constructors
| NoSuchAsLabel | The |
| ParseError String | Failed to parse the value into the type
that the |