creatur-3.0.0: Framework for artificial life experiments.

Portabilityportable
Stabilityexperimental
Maintaineramy@nualeargais.ie
Safe HaskellNone

ALife.Creatur.Database

Description

Database interface for the Créatúr framework.

Synopsis

Documentation

class Database d whereSource

A database offering storage and retrieval for records.

Associated Types

type DBRecord d Source

Methods

keys :: StateT d IO [String]Source

Get a list of all keys in the database.

lookup :: Serialize (DBRecord d) => String -> StateT d IO (Either String (DBRecord d))Source

Read a record from the database.

store :: (Record (DBRecord d), Serialize (DBRecord d)) => DBRecord d -> StateT d IO ()Source

Write a record to the database. If an agent with the same name already exists, it will be overwritten.

delete :: Serialize (DBRecord d) => String -> StateT d IO ()Source

Remove a record from the database. The database may archive records rather than simply deleting them.

Instances

class Record r whereSource

Methods

key :: r -> StringSource