monad-memo-0.4.1: Memoization monad transformer

Portabilitynon-portable
Stabilityexperimental
Maintainereduard.sergeev@gmail.com
Safe HaskellSafe-Inferred

Control.Monad.Trans.Memo.ReaderCache

Description

Generic StateCache - similar to ReaderT but optimised for carrying cache container

Synopsis

Documentation

newtype ReaderCache c m a Source

Generic memoization cache which uses provided container This is pretty much identical to ReaderT, but is tuned to speed up implementations which use unboxed mutable containers

Constructors

ReaderCache 

Fields

evalReaderCache :: c -> m a
 

Instances

(PrimMonad m, ~ * (PrimState m) s, MaybeLike e v, MVector c e) => MonadMemo Int v (Cache c s e m) 
(PrimMonad m, ~ * (PrimState m) s, MaybeLike e v, MVector c e) => MonadMemo Int v (Cache c s e m) 
(Monad m, Ix k, MaybeLike e v, MArray c e m) => MonadMemo k v (Cache c k e m) 
(PrimMonad m, ~ * (PrimState m) s, MaybeLike e v, MVector c e) => MonadCache Int v (Cache c s e m) 
(PrimMonad m, ~ * (PrimState m) s, MaybeLike e v, MVector c e) => MonadCache Int v (Cache c s e m) 
(Monad m, Ix k, MaybeLike e v, MArray c e m) => MonadCache k v (Cache c k e m) 
MonadTrans (ReaderCache c) 
Monad m => Monad (ReaderCache c m) 
Functor m => Functor (ReaderCache c m) 
MonadFix m => MonadFix (ReaderCache c m) 
MonadPlus m => MonadPlus (ReaderCache c m) 
Applicative m => Applicative (ReaderCache arr m) 
Alternative m => Alternative (ReaderCache c m) 
MonadIO m => MonadIO (ReaderCache c m) 

container :: Monad m => ReaderCache c m cSource

Returns internal container