Safe Haskell | None |
---|---|
Language | Haskell98 |
- type Getter s x = s -> x
- type Setter s x = x -> s -> s
- type Modifier s x = (x -> x) -> s -> s
- data Point s x
- newtype s :-> x = Label (Point s x)
- label :: Getter s x -> Setter s x -> s :-> x
- get :: (s :-> x) -> s -> x
- set :: (s :-> x) -> x -> s -> s
- mod :: (s :-> x) -> (x -> x) -> s -> s
- getM :: MonadState s m => (s :-> b) -> m b
- setM :: MonadState s m => (s :-> b) -> b -> m ()
- modM :: MonadState s m => (s :-> b) -> (b -> b) -> m ()
- (=:) :: MonadState s m => (s :-> b) -> b -> m ()
Getter, setter and modifier types.
Label type.
getM :: MonadState s m => (s :-> b) -> m b Source
Get a value out of state pointed to by the specified label.
setM :: MonadState s m => (s :-> b) -> b -> m () Source
Set a value somewhere in state pointed to by the specified label.
modM :: MonadState s m => (s :-> b) -> (b -> b) -> m () Source
Modify a value with a function somewhere in state pointed to by the specified label.
(=:) :: MonadState s m => (s :-> b) -> b -> m () infixr 7 Source
Alias for setM
that reads like an assignment.