cached-io: A simple library to cache IO actions

[ apache, development, library, program ] [ Propose Tags ]

Provides functions that convert an IO action into a cached one by storing the original result for a period of time, or until some condition is met.


[Skip to Readme]

Modules

[Index] [Quick Jump]

Flags

Manual Flags

NameDescriptionDefault
developer

compile with -Werror to make warnings fatal

Disabled

Use -f <flag> to enable a flag, or -f -<flag> to disable that flag. More info

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

Versions [RSS] 0.1.0.1, 0.1.1.0, 1.1.0.0, 1.2.0.0, 1.3.0.0
Change log CHANGELOG.md
Dependencies base (>=4.13.0.0 && <4.20), cached-io, exceptions (>=0.10.4 && <0.11), stm (>=2.5 && <2.6), time (>=1.9.3 && <1.15), transformers (>=0.5.6.2 && <0.7) [details]
License Apache-2.0
Author SumAll, Inc.
Maintainer Bellroy Tech Team <haskell@bellroy.com>
Category Development
Source repo head: git clone https://github.com/bellroy/haskell-cached-io.git
Uploaded by jack at 2024-03-12T01:24:06Z
Distributions NixOS:1.3.0.0
Executables test-cachedIO
Downloads 2677 total (24 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-03-12 [all 1 reports]

Readme for cached-io-1.3.0.0

[back to package description]

cached-io: cache a single IO action

Sometimes you have an action that does something really expensive whose results don't change that much. This is a simple library that lets you cache the output of that expensive action for a developer-specified length of time.

test/test-cachedIO.hs shows a very basic usage example.

Developing this library

All standardised tooling is provided by flake.nix.

nix develop

Formatting code

To format use
*.cabal cabal-fmt (cabal-fmt --inplace *.cabal)
*.nix nixpkgs-fmt (nixpkgs-fmt *.nix)

We have not yet chosen a formatter for Haskell source. For now, try to follow the style of surrounding code.

CI

The GitHub Actions CI workflow for this repo is generated by haskell-ci:

haskell-ci regenerate