lazy-hash-cache-0.1.0.0: Storing computed values for re-use when the same program runs again.

Copyright(c) Justus Sagemüller 2017
LicenseGPL v3
Maintainer(@) jsagemue $ uni-koeln.de
Stabilityexperimental
Portabilityportable
Safe HaskellNone
LanguageHaskell2010

Data.LazyHash.Cache.Int

Contents

Description

Identical interface to Data.LazyHash.Cache, but specialised to hashes of type Int (which are computed with Data.Hashable). At only 64 bits, collisions are likely with this type once you store a considerable number of values, so don't use it for serious applications.

Synopsis

The caching actions

cached :: (Binary a, Typeable a) => Prehashed Int a -> IO a Source #

Like cached, but specialised to Int hashes.

cached' Source #

Arguments

:: (Binary a, Typeable a) 
=> CacheAccessConf 
-> Prehashed Int a

Value to cache

-> IO a 

Like cached', but specialised to Int hashes.

Prehashing tools

fundamental :: QuasiQuoter #

Transform an ordinary value into a pre-hashed one. This hashes the source code contained in the quasi quote, making the assumption that the behaviour of anything invoked therein will never change.

Applying this to anything but named, fixed-predefined values (standard library functions etc.) is probably a bad idea.

(<#>) :: Hash h => Prehashed h (a -> b) -> Prehashed h a -> Prehashed h b infixl 4 #

Analogous to <$>: apply a hash-supported function to a hash-supported value.

liftPH2 :: Hash h => Prehashed h (a -> b -> c) -> Prehashed h a -> Prehashed h b -> Prehashed h c #

Configuration