Safe Haskell | None |
---|---|
Language | Haskell2010 |
Data.Machine.Runner
- foldrT :: Monad m => (o -> b -> b) -> b -> MachineT m k o -> m b
- foldlT :: Monad m => (b -> o -> b) -> b -> MachineT m k o -> m b
- foldMapT :: (Monad m, Monoid r) => (o -> r) -> MachineT m k o -> m r
- foldT :: (Monad m, Monoid o) => MachineT m k o -> m o
- runT1 :: Monad m => MachineT m k o -> m (Maybe o)
- runT :: Monad m => MachineT m k b -> m [b]
- runT_ :: Monad m => MachineT m k b -> m ()
Documentation
foldrT :: Monad m => (o -> b -> b) -> b -> MachineT m k o -> m b #
Right fold over a stream. This will be lazy if the underlying monad is.
runT = foldrT (:) []
foldMapT :: (Monad m, Monoid r) => (o -> r) -> MachineT m k o -> m r #
Strict fold over a stream. Items are accumulated on the right:
... ((f o1 <> f o2) <> f o3) ...
Where this is expensive, use the dual monoid instead.
foldT :: (Monad m, Monoid o) => MachineT m k o -> m o #
Strict fold over a monoid stream. Items are accumulated on the right:
... ((o1 <> o2) <> o3) ...
Where this is expensive, use the dual monoid instead.
foldT = foldMapT id