Module

Test.Serialization.Symbiote

Package
purescript-symbiote
Repository
athanclark/purescript-symbiote

#SimpleSerialization Source

data SimpleSerialization a o op

The most trivial serialization medium for any a.

Constructors

Instances

#register Source

register :: forall m s op o a. Arbitrary a => Arbitrary op => Symbiote a o op s => Eq o => MonadEffect m => Topic -> Int -> Proxy { operation :: op, output :: o, value :: a } -> SymbioteT s m Unit

Register a topic in the test suite

#firstPeer Source

firstPeer :: forall s m. MonadEffect m => MonadAff m => Show s => (First s -> m Unit) -> m (Second s) -> (Topic -> m Unit) -> (Failure Second s -> m Unit) -> (Topic -> Number -> m Unit) -> SymbioteT s m Unit -> m Unit

Run the test suite as the first peer - see 'Test.Serialization.Symbiote.WebSocket' for end-user implementations.

#secondPeer Source

secondPeer :: forall m s. MonadEffect m => MonadAff m => Show s => (Second s -> m Unit) -> m (First s) -> (Topic -> m Unit) -> (Failure First s -> m Unit) -> (Topic -> Number -> m Unit) -> SymbioteT s m Unit -> m Unit

Run the test suite as the second peer - see 'Test.Serialization.Symbiote.WebSocket' for end-user implementations.

#First Source

data First s

Messages sent by the first peer

Constructors

Instances

#Second Source

data Second s

Messages sent by the second peer

Constructors

Instances

#Generating Source

data Generating s

Messages sent by a peer during their generating phase

Constructors

Instances

#Failure Source

data Failure them s

Constructors

Instances

#defaultSuccess Source

defaultSuccess :: Topic -> Effect Unit

Via putStrLn

#defaultFailure Source

defaultFailure :: forall s them. Failure them s -> Effect Unit

Via putStrLn

#defaultProgress Source

defaultProgress :: Topic -> Number -> Effect Unit

Via putStrLn

#nullProgress Source

nullProgress :: forall m. Applicative m => Topic -> Number -> m Unit

Do nothing

#simpleTest Source

simpleTest :: forall stM m s. MonadBaseControl Aff m stM => MonadAff m => MonadEffect m => Show s => SymbioteT s m Unit -> m Unit

Prints to stdout and uses a local channel for a sanity-check - doesn't serialize.

#simpleTest' Source

simpleTest' :: forall stM m s. MonadBaseControl Aff m stM => MonadAff m => MonadEffect m => Show s => (Topic -> m Unit) -> (Failure Second s -> m Unit) -> (Failure First s -> m Unit) -> (Topic -> Number -> m Unit) -> SymbioteT s m Unit -> m Unit

Re-exports from Test.Serialization.Symbiote.Core

#Symbiote Source

class (SymbioteOperation a o op) <= Symbiote a o op s | a -> op, op -> a, a -> o where

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

Members

#SymbioteOperation Source

class SymbioteOperation a o op | a -> op, op -> a, a -> o where

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

Members