ouroboros-network-framework-0.1.0.1
Safe Haskell None
Language Haskell2010

Ouroboros.Network.Protocol.Handshake.Version

Synopsis

Documentation

newtype Versions vNum vData r Source #

The version map supported by the local agent keyed on the version identifier.

Each Version contains a function which takes negotiated version data and returns negotiated application (the r type variable).

If one needs to combine multiple versions the simplest way is to use one of the combinators: foldMapVersions , combineVersions or the Semigroup instance directly:

fold $ (simpleSingletonVersions ...)
      :| [ (simpleSingletonVersions ...)
         , (simpleSingletonVersions ...)
         , ...
         ]

Constructors

Versions

Fields

Instances

Instances details
Functor ( Versions vNum extra) Source #
Instance details

Defined in Ouroboros.Network.Protocol.Handshake.Version

Methods

fmap :: (a -> b) -> Versions vNum extra a -> Versions vNum extra b Source #

(<$) :: a -> Versions vNum extra b -> Versions vNum extra a Source #

Ord vNum => Semigroup ( Versions vNum vData r) Source #
Instance details

Defined in Ouroboros.Network.Protocol.Handshake.Version

Methods

(<>) :: Versions vNum vData r -> Versions vNum vData r -> Versions vNum vData r Source #

sconcat :: NonEmpty ( Versions vNum vData r) -> Versions vNum vData r Source #

stimes :: Integral b => b -> Versions vNum vData r -> Versions vNum vData r Source #

data Version vData r Source #

Constructors

Version

Fields

Instances

Instances details
Functor ( Version vData) Source #
Instance details

Defined in Ouroboros.Network.Protocol.Handshake.Version

Methods

fmap :: (a -> b) -> Version vData a -> Version vData b Source #

(<$) :: a -> Version vData b -> Version vData a Source #

Simple or no versioning

simpleSingletonVersions :: vNum -> vData -> r -> Versions vNum vData r Source #

Singleton smart constructor for Versions .

foldMapVersions :: ( Ord vNum, Foldable f, HasCallStack ) => (x -> Versions vNum extra r) -> f x -> Versions vNum extra r Source #

Useful for folding multiple Versions .

A foldMap restricted to the Versions Semigroup .

PRECONDITION: f x is non-empty.