module Data.Accessor
( Accessor, accessor,
setVal, (Accessor.^=), getVal, (Accessor.^.), (Accessor.^:),
getA, putA, (=:), (State.%=), modA, (State.%:),
(.>), (<.),
)
where
import qualified Data.Accessor.Basic as Accessor
import qualified Data.Accessor.MonadStatePrivate as State
import Control.Monad.Trans.State (StateT, )
type Accessor r a = Accessor.T r a
accessor ::
(r -> a)
-> (a -> r -> r)
-> Accessor r a
accessor :: forall r a. (r -> a) -> (a -> r -> r) -> Accessor r a
accessor = forall a b c. (a -> b -> c) -> b -> a -> c
flip forall a r. (a -> r -> r) -> (r -> a) -> T r a
Accessor.fromSetGet
getVal ::
Accessor r a
-> r
-> a
getVal :: forall r a. Accessor r a -> r -> a
getVal = forall r a. Accessor r a -> r -> a
Accessor.get
setVal ::
Accessor r a
-> a
-> r
-> r
setVal :: forall r a. Accessor r a -> a -> r -> r
setVal = forall r a. Accessor r a -> a -> r -> r
Accessor.set
infixl 9 .>
(.>) :: Accessor a b -> Accessor b c -> Accessor a c
.> :: forall a b c. Accessor a b -> Accessor b c -> Accessor a c
(.>) = forall a b c. Accessor a b -> Accessor b c -> Accessor a c
(Accessor..>)
infixr 9 <.
(<.) :: Accessor b c -> Accessor a b -> Accessor a c
<. :: forall b c a. Accessor b c -> Accessor a b -> Accessor a c
(<.) = forall b c a. Accessor b c -> Accessor a b -> Accessor a c
(Accessor.<.)
infix 1 =:
{-# DEPRECATED (=:) "use (Data.Accessor.Monad.Trans.State.%=) from data-accessor-transformers package" #-}
(=:) :: Monad m => Accessor r a -> a -> StateT r m ()
=: :: forall (m :: * -> *) r a.
Monad m =>
Accessor r a -> a -> StateT r m ()
(=:) = forall (m :: * -> *) r a.
Monad m =>
Accessor r a -> a -> StateT r m ()
putA
{-# DEPRECATED getA "Data.Accessor.Monad.Trans.State.get from data-accessor-transformers package" #-}
getA :: Monad m => Accessor r a -> StateT r m a
getA :: forall (m :: * -> *) r a. Monad m => Accessor r a -> StateT r m a
getA = forall (m :: * -> *) r a. Monad m => Accessor r a -> StateT r m a
State.get
{-# DEPRECATED putA "Data.Accessor.Monad.Trans.State.set from data-accessor-transformers package" #-}
putA :: Monad m => Accessor r a -> a -> StateT r m ()
putA :: forall (m :: * -> *) r a.
Monad m =>
Accessor r a -> a -> StateT r m ()
putA = forall (m :: * -> *) r a.
Monad m =>
Accessor r a -> a -> StateT r m ()
State.set
{-# DEPRECATED modA "Data.Accessor.Monad.Trans.State.modify from data-accessor-transformers package" #-}
modA :: Monad m => Accessor r a -> (a -> a) -> StateT r m ()
modA :: forall (m :: * -> *) r a.
Monad m =>
Accessor r a -> (a -> a) -> StateT r m ()
modA = forall (m :: * -> *) r a.
Monad m =>
Accessor r a -> (a -> a) -> StateT r m ()
State.modify