tamarin-prover-utils-1.2.2: Utility library for the tamarin prover.

Copyright | (c) 2011 Simon Meier
License | GPL v3 (see LICENSE)
Maintainer | Simon Meier <iridcode@gmail.com>
Portability | GHC only
Safe Haskell | None
Language | Haskell98

Extension.Data.Label

Contents

- Labels and applicative functors
- Labels and Monads

Description

Extensions to the first-class labels (fclabels) package.

Synopsis

- nthL :: Int -> [a] :-> a
- fstL :: (a, b) :-> a
- sndL :: (a, b) :-> b
- module Data.Label
- modA :: Applicative f => (a :-> b) -> (b -> f b) -> a -> f a
- askM :: MonadReader r m => (r :-> a) -> m a
- setM :: MonadState s m => (s :-> a) -> a -> m ()
- getM :: MonadState s m => (s :-> a) -> m a
- modM :: MonadState s m => (s :-> a) -> (a -> a) -> m ()
- (=:) :: MonadState f m => Lens (->) f o -> o -> m ()

# Documentation

nthL :: Int -> [a] :-> a #

Lens for the nth element of the list.

fstL :: (a, b) :-> a #

Lens for the first element of a tuple.

sndL :: (a, b) :-> b #

Lens for the second element of a tuple.

module Data.Label

# Labels and applicative functors

modA :: Applicative f => (a :-> b) -> (b -> f b) -> a -> f a #

Effectful modification of a labeled value.

# Labels and Monads

askM :: MonadReader r m => (r :-> a) -> m a #

Get part of the state from a reader.

setM :: MonadState s m => (s :-> a) -> a -> m () #

Set some part of the state.

getM :: MonadState s m => (s :-> a) -> m a #

Get some part of the state.

modM :: MonadState s m => (s :-> a) -> (a -> a) -> m () #

Modify some part of the state.

(=:) :: MonadState f m => Lens (->) f o -> o -> m () infixr 2 #

Alias for `puts` that reads like an assignment.