Copyright | (c) Justus Sagemüller 2017 |
---|---|
License | GPL v3 |
Maintainer | (@) jsagemue $ uni-koeln.de |
Stability | experimental |
Portability | portable |
Safe Haskell | None |
Language | Haskell2010 |
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.
- cached :: (Binary a, Typeable a) => Prehashed Int a -> IO a
- cached' :: (Binary a, Typeable a) => CacheAccessConf -> Prehashed Int a -> IO a
- fundamental :: QuasiQuoter
- (<#>) :: Hash h => Prehashed h (a -> b) -> Prehashed h a -> Prehashed h b
- liftPH2 :: Hash h => Prehashed h (a -> b -> c) -> Prehashed h a -> Prehashed h b -> Prehashed h c
The caching actions
cached :: (Binary a, Typeable a) => Prehashed Int a -> IO a Source #
Like cached
, but specialised to Int
hashes.
:: (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.