symbiote-0.0.0.1: Data serialization, communication, and operation verification implementation

Safe HaskellNone
LanguageHaskell2010

Test.Serialization.Symbiote.Core

Synopsis

Documentation

class SymbioteOperation a where Source #

A type-level relation between a type and appropriate, testable operations on that type.

Associated Types

data Operation a :: * Source #

Methods

perform :: Operation a -> a -> a Source #

class SymbioteOperation a => Symbiote a s where Source #

A serialization format for a particular type, and serialized data type.

Methods

encode :: a -> s Source #

decode :: s -> Maybe a Source #

encodeOp :: Operation a -> s Source #

decodeOp :: s -> Maybe (Operation a) Source #

newtype Topic Source #

Unique name of a type, for a suite of tests

Constructors

Topic Text 
Instances
Eq Topic Source # 
Instance details

Defined in Test.Serialization.Symbiote.Core

Methods

(==) :: Topic -> Topic -> Bool #

(/=) :: Topic -> Topic -> Bool #

Ord Topic Source # 
Instance details

Defined in Test.Serialization.Symbiote.Core

Methods

compare :: Topic -> Topic -> Ordering #

(<) :: Topic -> Topic -> Bool #

(<=) :: Topic -> Topic -> Bool #

(>) :: Topic -> Topic -> Bool #

(>=) :: Topic -> Topic -> Bool #

max :: Topic -> Topic -> Topic #

min :: Topic -> Topic -> Topic #

Show Topic Source # 
Instance details

Defined in Test.Serialization.Symbiote.Core

Methods

showsPrec :: Int -> Topic -> ShowS #

show :: Topic -> String #

showList :: [Topic] -> ShowS #

IsString Topic Source # 
Instance details

Defined in Test.Serialization.Symbiote.Core

Methods

fromString :: String -> Topic #

data SymbioteProtocol a s Source #

Protocol state for a particular topic

data SymbioteGeneration a s Source #

Protocol generation state

Constructors

SymbioteGeneration 

Fields

data SymbioteState s Source #

Internal existential state of a registered topic with type's facilities

Constructors

(Arbitrary a, Arbitrary (Operation a), Symbiote a s, Eq a) => SymbioteState 

Fields

runSymbioteT Source #

Arguments

:: Monad m 
=> SymbioteT s m () 
-> Bool

Is this the first peer to initiate the protocol?

-> m (Map Topic (SymbioteState s))