simplelru

[ bsd3, library, program, unclassified ] [ Propose Tags ]

Please see the README on GitHub at https://github.com/MurakamiKennzo/simplelru#readme


[Skip to Readme]
Versions [faq] 0.1.0.0, 0.1.0.1, 0.1.0.2, 0.1.0.3
Change log ChangeLog.md
Dependencies base (>=4.7 && <5), simplelru [details]
License BSD-3-Clause
Copyright Copyright (jp) 2020-present, murakami
Author murakami
Maintainer w18191263056@yahoo.co.jp
Home page https://github.com/MurakamiKennzo/simplelru#readme
Bug tracker https://github.com/MurakamiKennzo/simplelru/issues
Source repo head: git clone https://github.com/MurakamiKennzo/simplelru
Uploaded by Murakami at 2020-01-09T21:48:52Z
Distributions NixOS:0.1.0.3
Executables simplelru-exe
Downloads 673 total (14 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Hackage Matrix CI
Docs available [build log]
Last success reported on 2020-01-09 [all 1 reports]

Modules

[Index] [Quick Jump]

Downloads

Maintainer's Corner

For package maintainers and hackage trustees


Readme for simplelru-0.1.0.3

[back to package description]

simplelru

A simple LRU cache solution.

usage

Here is an example for using Data.LRUCache.IO:

{-# LANGUAGE ScopedTypeVariables #-}

module Main where

import Data.LRUCache.IO

main :: IO ()
main = do
  cache :: LRUCache Int Int <- empty 2
  (1, 1) -|> cache
  readLRU cache >>= print
  (2, 2) -|> cache
  readLRU cache >>= print
  1 <|- cache >>= print
  (3, 3) -|> cache
  readLRU cache >>= print
  2 <|- cache >>= print
  (4, 4) -|> cache
  readLRU cache >>= print
  1 <|- cache >>= print
  3 <|- cache >>= print
  4 <|- cache >>= print