cached-io: A simple library to cache IO actions

[ apache, development, library, program ] [ Propose Tags ] [ Report a vulnerability ]

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.21), 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]
Tested with ghc ==8.8.4 || ==8.10.7 || ==9.0.2 || ==9.2.4 || ==9.4.5 || ==9.6.2 || ==9.8.1
License Apache-2.0
Author SumAll, Inc.
Maintainer Bellroy Tech Team <haskell@bellroy.com>
Revised Revision 1 made by jack at 2024-06-26T08:36:38Z
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 2780 total (9 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