{"id":17251047,"url":"https://github.com/fumieval/drinkery","last_synced_at":"2025-04-14T05:32:20.286Z","repository":{"id":27480129,"uuid":"109625982","full_name":"fumieval/drinkery","owner":"fumieval","description":"Boozy streaming library","archived":false,"fork":false,"pushed_at":"2022-05-14T13:39:04.000Z","size":90,"stargazers_count":16,"open_issues_count":0,"forks_count":1,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-27T19:52:04.910Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Haskell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fumieval.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-11-05T23:38:47.000Z","updated_at":"2022-05-14T13:39:08.000Z","dependencies_parsed_at":"2022-08-09T06:30:41.004Z","dependency_job_id":null,"html_url":"https://github.com/fumieval/drinkery","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fumieval%2Fdrinkery","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fumieval%2Fdrinkery/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fumieval%2Fdrinkery/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fumieval%2Fdrinkery/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fumieval","download_url":"https://codeload.github.com/fumieval/drinkery/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248643635,"owners_count":21138474,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-15T06:50:11.972Z","updated_at":"2025-04-14T05:32:20.022Z","avatar_url":"https://github.com/fumieval.png","language":"Haskell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# drinkery\n\ndrinkery is a yet another stream processing library themed on liquors. While it\noffers a simple interface, it also tries to be as expressive as possible.\n\n## Producers\n\ndrinkery supports three types of producers: `Producer`, `ListT`, and `Tap`.\n\n`Producer r s` is a monad transformer to produce a stream of type `s`. It is good\nat interactively serving values.\n`yield :: s -\u003e Producer r s m a` is the primary action.\nA barman can also accept requests from the downstream using `accept`.\n\n`ListT r` is a list-like backtracking monad (also known as ListT done right).\nIt is useful for sampling elements of containers with effects.\n`sample :: Foldable f =\u003e f s -\u003e ListT r m s` samples elements in any `Foldable`\ncontainer. `inquire` to interact with the downstream.\n\n`Tap` is an endless producer. This can be connected to a 'Patron' or a 'Distiller'.\n\n`Producer` and `ListT` are converted to `Tap`\nby `runProducer` and `runListT` respectively.\n\n## Consumer\n\n`Sink tap` is a monad transformer which consumes `tap`.\n\n* `drink :: m s` Get one element.\n* `leftover :: s -\u003e m ()` Leave one element.\n* `request :: r -\u003e m ()` Send a request.\n\n`(+\u0026) :: (Monoid r, CloseRequest r, Monad m) =\u003e Tap r s m -\u003e Sink (Tap r s) m a -\u003e m a`\nconnects a tap with a drinker.\n\n## Transducer\n\n`Distiller tap m r s` is a stream transducer which\n\n* Consumes `tap`\n* Receives `r`\n* Produces `s`\n\nIt is actually a `Tap` where the underlying monad is `Sink`.\n\nThere are two composition operators:\n\n* `++\u0026` Tap-drinker\n* `++$` Tap-distiller\n\n`+`, `\u0026`, and `$` means a tap, a drinker, and a distiller respectively. The middle\ncharacters of these operators signify the resulting structures.\n\n## Why drinkery?\n\ndrinkery is designed to be fully featured and complements other libraries' missing\nfunctionalities.\n\n### pipes\n\n`pipes` is quite similar in that both `Proxy` and `Distiller` are bidirectional.\nStill there are some differences:\n\n* `Distiller` does not terminate.\n* Unlike pipes' `\u003e-\u003e`, `++$` propagates inner requests:\n    * `(++$) :: Monad m =\u003e Distiller tap m p q -\u003e Distiller (Tap p q) (Sink tap m) r s -\u003e Distiller tap m r s`\n    * `(\u003e-\u003e) :: Proxy a' a () b m r\t-\u003e Proxy () b c' c m r -\u003e Proxy a' a c' c m r`\n* `Sink`, the consumer monad, may leave unconsumed inputs.\n* `drinkery` has much fewer operators.\n\n### conduit\n\nBoth `drinkery` and `conduit` support leftovers, closing operation, and end of stream.\nThe main difference is interactivity.\n\n### machines\n\n`machines` does not support leftovers, nor interactive producers.\nBoth `machines` and `drinkery` support multi-channel input.\n\n### iteratee\n\n`iteratee` has an ability to handle requests but those are untyped (`SomeException`).\n`drinkery` provides a more robust interface for handling requests, and monadic producers.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffumieval%2Fdrinkery","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffumieval%2Fdrinkery","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffumieval%2Fdrinkery/lists"}