simplelru

[ bsd3, library, program, unclassified ] [ Propose Tags ] [ Report a vulnerability ]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 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 1160 total (16 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2020-01-09 [all 1 reports]

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