Skip to content

Commit e2fc585

Browse files
committed
Add more docs.
1 parent 60d968c commit e2fc585

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

lazy-cache.cabal

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,20 @@ description: The library provides an interface for caching the results o
2929
6. outdated values are cleared only on accesses to the cache, so if no action is called
3030
the data will not be cleared.
3131
.
32+
The main entry point of the library is "System.Cache" module, it explains how to
33+
use the library and provides the public API, that does not depend on the actual
34+
store implementation.
35+
.
3236
The library provides an interface for caching, and three implementations:
3337
.
3438
1. "System.Cache.Impl.Ghc" — the main one based on GHC system;
3539

3640
2. "System.Cache.Impl.MVar" — implementation based on library functions;
3741

3842
3. "System.Cache.Impl.NoCache" — implementation that disables caching, but keeps the same interface
43+
.
44+
If you want to implement your own caching mechanism, or use internal API, you
45+
can refer to the "System.Cache.Internal.Interface" module for an additional documentation.
3946
extra-source-files:
4047
CHANGELOG.md
4148
Readme.md

src/System/Cache/Impl/NoCache.hs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
{-# LANGUAGE RecursiveDo #-}
2+
-- | Implementation that provides no caching at all.
3+
-- Can be useful in order to disable caching without changing
4+
-- the code at the use sites.
25
module System.Cache.Impl.NoCache
36
( new
47
) where
58

69
import System.Cache.Internal.Interface
710
import System.Clock.Seconds
811

12+
-- | Creates an implementation that does not cache anything.
13+
-- All actions runs as-is without locking.
914
new :: Config -> IO (Handle a b)
1015
new Config{..} = do
1116
pure $ Handle

0 commit comments

Comments
 (0)