hunt-searchengine-0.3.0.1: A search and indexing engine.

Safe HaskellNone
LanguageHaskell98

Hunt.Interpreter

Contents

Description

The interpreter to evaluate Commands.

Synopsis

Initialization

initHunt :: DocTable dt => IO (HuntEnv dt) Source

Initialize the Hunt environment with default values.

Running Commands

runCmd :: (DocTable dt, Binary dt) => HuntEnv dt -> Command -> IO (Either CmdError CmdResult) Source

Run the command the supplied environment/state.

execCmd :: (Binary dt, DocTable dt) => Command -> Hunt dt CmdResult Source

Execute the command in the Hunt monad.

runHunt :: DocTable dt => HuntT dt m a -> HuntEnv dt -> m (Either CmdError a) Source

Run the Hunt monad with the supplied environment/state.

Types

type Hunt dt = HuntT dt IO Source

The Hunt monad on IO.

newtype HuntT dt m a Source

The Hunt transformer monad. Allows a custom monad to be embedded to combine with other DSLs.

Constructors

HuntT 

Fields

runHuntT :: ReaderT (HuntEnv dt) (ErrorT CmdError m) a
 

Instances

Monad m => MonadError CmdError (HuntT dt m) 
MonadTrans (HuntT dt) 
Monad m => MonadReader (HuntEnv dt) (HuntT dt m) 
Monad m => Monad (HuntT dt m) 
Functor m => Functor (HuntT dt m) 
(Monad m, Functor m) => Applicative (HuntT dt m) 
MonadIO m => MonadIO (HuntT dt m) 

data HuntEnv dt Source

The Hunt state and environment. Initialize with default values with initHunt.

Constructors

HuntEnv 

Fields

huntIndex :: DocTable dt => XMVar (ContextIndex dt)

The context index (indexes, document table and schema). Stored in an XMVar so that read access is always possible.

huntRankingCfg :: RankConfig (DValue dt)

Ranking configuration.

huntTypes :: ContextTypes

Available context types.

huntNormalizers :: [CNormalizer]

Available normalizers.

huntQueryCfg :: ProcessConfig

Query processor configuration.

Instances

Monad m => MonadReader (HuntEnv dt) (HuntT dt m) 

type DefHuntEnv = HuntEnv (Documents Document) Source

Default Hunt environment type.