haxl-0.1.0.0: A Haskell library for efficient, concurrent, and concise data access.

Safe HaskellNone

Haxl.Core.Env

Description

The Haxl monad environment.

Synopsis

Documentation

data Env u Source

The data we carry around in the Haxl monad.

Constructors

Env 

Fields

cacheRef :: IORef DataCache
 
memoRef :: IORef DataCache
 
flags :: Flags
 
userEnv :: u
 
statsRef :: IORef Stats
 
states :: StateStore

Data sources and other components can store their state in here. Items in this store must be instances of StateKey.

emptyEnv :: u -> IO (Env u)Source

A new, empty environment.

initEnv :: StateStore -> u -> IO (Env u)Source

Initializes an environment with DataStates and an input map.

initEnvWithData :: StateStore -> u -> Caches -> IO (Env u)Source

Initialize an environment with a StateStore, an input map, a preexisting DataCache, and a seed for the random number generator.

caches :: Env u -> CachesSource