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

Safe HaskellNone
LanguageHaskell98

Hunt.Index.IndexImpl

Description

Heterogeneous indexes using ExistentialQuantification.

Indexes have to implement the Index type class as well as obey other constraints defined in IndexImplCon.

Note: Due to the nature of ExistentialQuantification, deserialization is tricky because the concrete implementation is not known. This is circumvented by storing the type representation of the index. Deserialization is possible if there is a matching type representation in the set of available types. This requires the use of the custom get functions.

Synopsis

Documentation

type IndexImplCon i = (Index i, Show i, ICon i, IndexValue (IVal i), Binary i, Typeable i, IKey i ~ Text) Source

Constraint for index implementations.

data IndexImpl Source

Index using ExistentialQuantification to allow heterogeneous index containers.

Constructors

forall i . IndexImplCon i => IndexImpl 

Fields

ixImpl :: i
 

Instances

Show IndexImpl 
Binary IndexImpl

FIXME: actually implement instance

Default IndexImpl 
NFData IndexImpl 

gets' :: [IndexImpl] -> Get [(Context, IndexImpl)] Source

Deserialize a set of IndexImpls. Requires a set of available index implementations.

Note: This will fail if a used index implementation is not provided.

get' :: [IndexImpl] -> Get IndexImpl Source

Deserialize an IndexImpl. Requires a set of available index implementations.

Note: This will fail if a used index implementation is not provided.

mkIndex :: IndexImplCon i => i -> IndexImpl Source

Wrap an index using ExistentialQuantification to allow heterogeneous containers.