Module
Test.Serialization.Symbiote
- Package
- purescript-symbiote
- Repository
- athanclark/purescript-symbiote
#SimpleSerialization Source
data SimpleSerialization a o opThe most trivial serialization medium for any a.
Constructors
Instances
(Generic a a', Generic o o', Generic op op') => Generic (SimpleSerialization a o op) _(Eq a, Eq o, Eq op) => Eq (SimpleSerialization a o op)(Show a, Show o, Show op) => Show (SimpleSerialization a o op)(SymbioteOperation a o op) => Symbiote a o op (SimpleSerialization a o op)
#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 UnitRun 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 UnitRun the test suite as the second peer - see 'Test.Serialization.Symbiote.WebSocket' for end-user implementations.
#First Source
data First sMessages sent by the first peer
Constructors
AvailableTopics (Map Topic Int)FirstGenerating { generating :: Generating s, topic :: Topic }FirstOperating { operating :: Operating s, topic :: Topic }
Instances
(Generic s s') => Generic (First s) _(Eq s, Generic s s') => Eq (First s)(Show s, Generic s s') => Show (First s)(Arbitrary s) => Arbitrary (First s)(EncodeJson s) => EncodeJson (First s)(DecodeJson s) => DecodeJson (First s)(DynamicByteLength s) => DynamicByteLength (First s)(EncodeArrayBuffer s) => EncodeArrayBuffer (First s)(DynamicByteLength s, DecodeArrayBuffer s) => DecodeArrayBuffer (First s)
#Second Source
data Second sMessages sent by the second peer
Constructors
BadTopics (Map Topic Int)StartSecondOperating { operating :: Operating s, topic :: Topic }SecondGenerating { generating :: Generating s, topic :: Topic }
Instances
(Generic s s') => Generic (Second s) _(Eq s, Generic s s') => Eq (Second s)(Show s, Generic s s') => Show (Second s)(Arbitrary s) => Arbitrary (Second s)(EncodeJson s) => EncodeJson (Second s)(DecodeJson s) => DecodeJson (Second s)(DynamicByteLength s) => DynamicByteLength (Second s)(EncodeArrayBuffer s) => EncodeArrayBuffer (Second s)(DynamicByteLength s, DecodeArrayBuffer s) => DecodeArrayBuffer (Second s)
#Generating Source
data Generating sMessages sent by a peer during their generating phase
Constructors
Generated { operation :: s, value :: s }BadResult sYourTurnImFinishedGeneratingNoParseOperated s
Instances
(Generic s s') => Generic (Generating s) _(Eq s, Generic s s') => Eq (Generating s)(Show s, Generic s s') => Show (Generating s)(Arbitrary s) => Arbitrary (Generating s)(EncodeJson s) => EncodeJson (Generating s)(DecodeJson s) => DecodeJson (Generating s)(DynamicByteLength s) => DynamicByteLength (Generating s)(EncodeArrayBuffer s) => EncodeArrayBuffer (Generating s)(DynamicByteLength s, DecodeArrayBuffer s) => DecodeArrayBuffer (Generating s)
#Operating Source
data Operating sMessages sent by a peer during their operating phase
Constructors
Instances
(Generic s s') => Generic (Operating s) _(Eq s, Generic s s') => Eq (Operating s)(Show s, Generic s s') => Show (Operating s)(Arbitrary s) => Arbitrary (Operating s)(EncodeJson s) => EncodeJson (Operating s)(DecodeJson s) => DecodeJson (Operating s)(DynamicByteLength s) => DynamicByteLength (Operating s)(EncodeArrayBuffer s) => EncodeArrayBuffer (Operating s)(DynamicByteLength s, DecodeArrayBuffer s) => DecodeArrayBuffer (Operating s)
#Failure Source
data Failure them sConstructors
BadTopicsFailure { first :: Map Topic Int, second :: Map Topic Int }OutOfSyncFirst (First s)OutOfSyncSecond (Second s)TopicNonexistent TopicWrongTopic { expected :: Topic, got :: Topic }CantParseOperated Topic sCantParseGeneratedValue Topic sCantParseLocalValue Topic sCantParseLocalOperation Topic sBadOperating Topic (Operating s)BadGenerating Topic (Generating s)BadThem Topic (them s)SafeFailure { expected :: s, got :: s, topic :: Topic }
Instances
#nullProgress Source
nullProgress :: forall m. Applicative m => Topic -> Number -> m UnitDo nothing
#simpleTest Source
simpleTest :: forall stM m s. MonadBaseControl Aff m stM => MonadAff m => MonadEffect m => Show s => SymbioteT s m Unit -> m UnitPrints to stdout and uses a local channel for a sanity-check - doesn't serialize.
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 whereA serialization format for a particular type, and serialized data type.
Members
#SymbioteOperation Source
class SymbioteOperation a o op | a -> op, op -> a, a -> o whereA type-level relation between a type and appropriate, testable operations on that type.
Members
perform :: op -> a -> o