{"id":18003464,"url":"https://github.com/iokasimov/observable","last_synced_at":"2025-06-19T02:38:55.620Z","repository":{"id":56874010,"uuid":"137220825","full_name":"iokasimov/observable","owner":"iokasimov","description":"Make your actions observable and listen events from them, algebraically.","archived":false,"fork":false,"pushed_at":"2024-12-04T06:10:58.000Z","size":27,"stargazers_count":17,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-11T22:48:50.202Z","etag":null,"topics":["continuation","observer"],"latest_commit_sha":null,"homepage":"http://hackage.haskell.org/package/observable","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/iokasimov.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2018-06-13T13:39:53.000Z","updated_at":"2025-06-05T00:29:19.000Z","dependencies_parsed_at":"2022-08-20T22:30:22.656Z","dependency_job_id":null,"html_url":"https://github.com/iokasimov/observable","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/iokasimov/observable","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iokasimov%2Fobservable","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iokasimov%2Fobservable/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iokasimov%2Fobservable/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iokasimov%2Fobservable/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iokasimov","download_url":"https://codeload.github.com/iokasimov/observable/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iokasimov%2Fobservable/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260674296,"owners_count":23045052,"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":["continuation","observer"],"created_at":"2024-10-29T23:28:44.406Z","updated_at":"2025-06-19T02:38:50.601Z","avatar_url":"https://github.com/iokasimov.png","language":"Haskell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Make your actions to be observable and listen to events from them, algebraically.\n\nLet's imagine simple example: we want to listen to STDIN. We have `getLine` function that can capture a list of ASCII-symbols - all we need is to make this action to be observable.\n\n```haskell\nobs :: Monad f =\u003e f a -\u003e Observable f a r\n```\nGood, now we want to subscribe on events and set up callback, if we want to listen to events forever, we need `subscribe` function:\n\n```haskell\nsubscribe :: Applicative f =\u003e Observable f a r -\u003e (a -\u003e f r) -\u003e f r\n```\n\nFirst, we make action to be observable, then set up callback and at the end, subscribe on events:\n\n```haskell\nsubscribe (obs getLine) handler\n```\n\nOur handler will count amount of characters in strings and send this into STDOUT:\n\n```haskell\nhandler = print . (\u003c\u003e) \"Length of string was: \" . show . length\n```\n\nLet's try it out:\n```haskell\n\u003e hello, my dear friend!\n\u003e \"Length of string was: 22\"\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiokasimov%2Fobservable","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fiokasimov%2Fobservable","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiokasimov%2Fobservable/lists"}