{"id":32570085,"url":"https://github.com/siriuscourses/lazy-cache","last_synced_at":"2026-03-03T21:02:06.001Z","repository":{"id":56283920,"uuid":"312904171","full_name":"SiriusCourses/lazy-cache","owner":"SiriusCourses","description":"Caches IO action by relying on GHC RTS implementation","archived":false,"fork":false,"pushed_at":"2023-01-12T13:13:37.000Z","size":36,"stargazers_count":2,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-29T08:23:19.523Z","etag":null,"topics":["caching","haskell","library"],"latest_commit_sha":null,"homepage":"","language":"Haskell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SiriusCourses.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":"2020-11-14T21:21:54.000Z","updated_at":"2023-01-15T17:57:22.000Z","dependencies_parsed_at":"2023-02-09T12:00:54.321Z","dependency_job_id":null,"html_url":"https://github.com/SiriusCourses/lazy-cache","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/SiriusCourses/lazy-cache","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SiriusCourses%2Flazy-cache","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SiriusCourses%2Flazy-cache/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SiriusCourses%2Flazy-cache/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SiriusCourses%2Flazy-cache/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SiriusCourses","download_url":"https://codeload.github.com/SiriusCourses/lazy-cache/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SiriusCourses%2Flazy-cache/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30060632,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-03T18:21:05.932Z","status":"ssl_error","status_checked_at":"2026-03-03T18:20:59.341Z","response_time":61,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["caching","haskell","library"],"created_at":"2025-10-29T08:13:36.102Z","updated_at":"2026-03-03T21:02:05.984Z","avatar_url":"https://github.com/SiriusCourses.png","language":"Haskell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Library for caching values.\n\nThe library allows to cache result of an asynchronous computation for\nno longer than a given period of time.\n\n# How to use\n\nIn order to use the package you should add the package to the dependency\nsection of the cabal file of your package.\n\nIn order to use the cache you should create a 'Handle'\n\n```haskell\n{-# LANGUAGE ImportQualifiedPost #-}\n{-# LANGUAGE NumericUnderscores #-}\n{-# LANGUAGE BlockArguments #-}\nimport Control.Concurrent\n\nimport System.Cache qualified as Cache\nimport System.Cache.Impl.Ghc qualified as Cache.Ghc\nimport System.Clock.Seconds\n\nmain :: IO ()\nmain = do\n   cache \u003c- Cache.Ghc.new do\n     Cache.mkConfig 60 Monotonic\n   -- we create a cached version of computation\n   -- in order to hide implementation\n   let cachedTimeout input = Cache.cacheIO cache \\i -\u003e do\n         threadDelay $ i * 1_000_000\n         pure i\n   -- We use our cached function\n   print (cachedTimeout 1)\n   print (cachedTimeout 1)\n   print (cachedTimeout 2)\n```\n\n```\nsh-3.2$ runhaskell local.hs | ts -S\n00:00:03 2\n00:00:03 2\n00:00:06 3\n```\n\nWhen running the program first we wait for 2 seconds, the next call returns immediately.\nThe third one is long as it uses a new input value.\n\n\n# Developing the package\n\n```\ncabal configure\ncabal build\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsiriuscourses%2Flazy-cache","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsiriuscourses%2Flazy-cache","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsiriuscourses%2Flazy-cache/lists"}