cache-effectful: A Cache effect for the effectful ecosystem.

[ cache, library, mit ] [ Propose Tags ] [ Report a vulnerability ]

Modules

[Index] [Quick Jump]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.0.1.0
Change log CHANGELOG.md
Dependencies base (<4.23), cache (>=0.1.3 && <0.2), effectful-core (>=2.6 && <2.7), hashable (>=1.5.1 && <1.6) [details]
Tested with ghc ==9.10.3 || ==9.12.4 || ==9.14.1
License MIT
Author Hécate Moonlight
Maintainer Hécate Moonlight
Uploaded by hecate at 2026-08-16T21:16:54Z
Category cache
Home page https://github.com/haskell-effectful/cache-effectful/tree/main/cache-effectful#readme
Bug tracker https://github.com/haskell-effectful/cache-effectful/issues
Source repo head: git clone https://github.com/haskell-effectful/cache-effectful
Distributions
Downloads 1 total (1 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 cache-effectful-0.0.1.0

[back to package description]

cache-effectful

A Cache effect for the effectful ecosystem.

How to use

This library exposes the following elements:

  • Cache — The type-level effect that you can declare in your type signatures.
populateIntCache :: (Cache Int Int :> es) => Eff es ()
  • insert, lookup, keys, delete, filterWithKey – Operations on Cache. They should always be used with Type Applications when using literals:
insertAndLookup :: (Cache Int Int :> es) => Eff es (Maybe Int)
insertAndLookup = do
  insert @Int @Int 3 12
  lookup @Int 3

listKeys :: (Cache Int Int :> es) => Eff es [Int]
listKeys = do
  populateIntCache
  keys @Int @Int
  • An IO Runner
runCacheIO (cache :: Data.Cache Int Int)

See the tests to see an example use.