Copyright | (c) Max Amanshauser 2016 |
---|---|
License | MIT |
Maintainer | max@lambdalifting.org |
Safe Haskell | None |
Language | Haskell2010 |
Documentation
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.
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 # | |
Defined in Mealstrom.PostgresJSONStore fsmRead :: PostgresJSONStore -> k -> Proxy k s e a -> IO (Maybe s) Source # fsmCreate :: PostgresJSONStore -> Instance k s e a -> IO (Maybe String) Source # fsmUpdate :: PostgresJSONStore -> k -> MachineTransformer s e a -> IO MealyStatus Source # | |
MealyInstance k s e a => FSMStore (MemoryStore k s e a) k s e a Source # | |
Defined in Mealstrom.MemoryStore 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 # |