yield: YieldT monad transformer

[ library, mit, streaming ] [ Propose Tags ] [ Report a vulnerability ]

This package defines a class MonadYield a for monads that can emit values values of type a while they run, and a monad transformer YieldT a which implements this class such that the emitted values can be captured in a streaming manner.

This is an amalgamation of concepts from pipes, conduit, foldl, and kan-extensions, combined into a small self-contained package.


[Skip to Readme]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.0.0.0
Change log CHANGELOG.md
Dependencies base (>=4.16.4.0 && <5), containers (>=0.6.5.1), mtl (>=2.2.2), transformers (>=0.5.6.2) [details]
License MIT
Author
Maintainer Freckle Education
Category Streaming
Home page https://github.com/freckle/yield#readme
Bug tracker https://github.com/freckle/yield/issues
Source repo head: git clone https://github.com/freckle/yield
Uploaded by PatrickBrisbin at 2024-11-26T18:32:09Z
Distributions
Downloads 13 total (13 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2024-11-26 [all 1 reports]

Readme for yield-0.0.0.0

[back to package description]

Yield

import Control.Monad.Yield
action1 :: MonadYield Char m => m Char
action1 = do
  yield 'a'
  yield 'b'
  pure 'c'
action2 :: forall m. Monad m => m (String, Char)
action2 = runYieldT listAggregation action1
-- returns ("ab", 'c')

LICENSE | CHANGELOG