fclabels-1.1.4.3: First class accessor labels.

Safe Haskell | Safe-Inferred

Data.Label.MaybeM

Contents

- `MonadState` lens operations.
- `MonadReader` lens operations.

Synopsis

- gets :: (MonadState f m, MonadPlus m) => (f :~> a) -> m a
- asks :: (MonadReader f m, MonadPlus m) => (f :~> a) -> m a

# `MonadState` lens operations.

gets :: (MonadState f m, MonadPlus m) => (f :~> a) -> m aSource

Get a value out of state, pointed to by the specified lens that might fail. When the lens getter fails this computation will fall back to `mzero`.

# `MonadReader` lens operations.

asks :: (MonadReader f m, MonadPlus m) => (f :~> a) -> m aSource

Fetch a value, pointed to by a lens that might fail, out of a reader environment. When the lens getter fails this computation will fall back to `mzero`.