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]


[Index] [Quick Jump]


Manual Flags


compile with -Werror to make warnings fatal


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


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


Versions [RSS],,,,
Change log
Dependencies base (>= && <4.20), cached-io, exceptions (>=0.10.4 && <0.11), stm (>=2.5 && <2.6), time (>=1.9.3 && <1.13), transformers (>= && <0.7) [details]
License Apache-2.0
Author SumAll, Inc.
Maintainer Bellroy Tech Team <>
Revised Revision 2 made by HughDavidson at 2024-03-06T00:59:06Z
Category Development
Source repo head: git clone
Uploaded by LukeWorth at 2023-03-06T01:01:19Z
Distributions NixOS:
Executables test-cachedIO
Downloads 2633 total (18 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-

[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.


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

haskell-ci regenerate