Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- data Result s a = Result {
- resultState :: s
- output :: ~a
- mapResultState :: (s1 -> s2) -> Result s1 a -> Result s2 a
- apResult :: Result s1 (a -> b) -> Result s2 a -> Result (JointState s1 s2) b
- newtype ResultStateT s m a = ResultStateT {
- getResultStateT :: s -> m (Result s a)
Documentation
A tuple that is strict in its first argument.
This type is used in streams and automata to encode the result of a state transition. The new state should always be strict to avoid space leaks.
Result | |
|
mapResultState :: (s1 -> s2) -> Result s1 a -> Result s2 a Source #
Apply a function to the state of a Result
.
apResult :: Result s1 (a -> b) -> Result s2 a -> Result (JointState s1 s2) b Source #
Analogous to Applicative'
s (<*>)
.
newtype ResultStateT s m a Source #
A state transformer with Result
instead of a standard tuple as its result.
ResultStateT | |
|
Instances
Monad m => Applicative (ResultStateT s m) Source # | |
Defined in Data.Stream.Result pure :: a -> ResultStateT s m a # (<*>) :: ResultStateT s m (a -> b) -> ResultStateT s m a -> ResultStateT s m b # liftA2 :: (a -> b -> c) -> ResultStateT s m a -> ResultStateT s m b -> ResultStateT s m c # (*>) :: ResultStateT s m a -> ResultStateT s m b -> ResultStateT s m b # (<*) :: ResultStateT s m a -> ResultStateT s m b -> ResultStateT s m a # | |
Functor m => Functor (ResultStateT s m) Source # | |
Defined in Data.Stream.Result fmap :: (a -> b) -> ResultStateT s m a -> ResultStateT s m b # (<$) :: a -> ResultStateT s m b -> ResultStateT s m a # |