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

Note: This package has metadata revisions in the cabal description newer than included in the tarball. To unpack the package including the revisions, use 'cabal get'.

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.13), transformers (>=0.5.6.2 && <0.7) [details]
License Apache-2.0
Author SumAll, Inc.
Maintainer Bellroy Tech Team <haskell@bellroy.com>
Revised Revision 2 made by HughDavidson at 2024-03-06T00:59:06Z
Category Development
Source repo head: git clone https://github.com/bellroy/haskell-cached-io.git
Uploaded by LukeWorth at 2023-03-06T01:01:19Z
Distributions NixOS:1.3.0.0
Executables test-cachedIO
Downloads 2641 total (21 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs uploaded by user
Build status unknown [no reports yet]

Readme for cached-io-1.2.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