mealstrom-0.0.0.1: Manipulate FSMs and store them in PostgreSQL.

Copyright(c) Max Amanshauser 2016
LicenseMIT
Maintainermax@lambdalifting.org
Safe HaskellNone
LanguageHaskell2010

Mealstrom.FSMStore

Description

 

Synopsis

Documentation

data Proxy k s e a Source #

Constructors

Proxy 

class FSMStore st k s e a where Source #

Even the Read method needs type parameters e and a because it needs to deserialise the entry from storage. Implementations are expected to not throw exceptions in fsmRead/fsmCreate. Throwing in fsmUpdate is OK.

Minimal complete definition

fsmRead, fsmCreate, fsmUpdate

Methods

fsmRead :: st -> k -> Proxy k s e a -> IO (Maybe s) Source #

fsmCreate :: st -> Instance k s e a -> IO (Maybe String) Source #

fsmUpdate :: st -> k -> MachineTransformer s e a -> IO MealyStatus Source #

Instances

(FromJSON s, FromJSON e, FromJSON a, ToJSON s, ToJSON e, ToJSON a, Typeable * s, Typeable * e, Typeable * a, MealyInstance k s e a) => FSMStore PostgresJSONStore k s e a Source # 
MealyInstance k s e a => FSMStore (MemoryStore k s e a) k s e a Source # 

Methods

fsmRead :: MemoryStore k s e a -> k -> Proxy k s e a -> IO (Maybe s) Source #

fsmCreate :: MemoryStore k s e a -> Instance k s e a -> IO (Maybe String) Source #

fsmUpdate :: MemoryStore k s e a -> k -> MachineTransformer s e a -> IO MealyStatus Source #