Safe Haskell | None |
---|---|
Language | Haskell2010 |
Ouroboros.Network.Protocol.Handshake.Version
Contents
Synopsis
- newtype Versions vNum vData r = Versions {
- getVersions :: Map vNum (Version vData r)
- newtype Application vData r = Application {
- runApplication :: vData -> r
- data Version vData r = Version {
- versionApplication :: Application vData r
- versionData :: vData
- data Accept vData
- class Acceptable v where
- acceptableVersion :: v -> v -> Accept v
- data VersionMismatch vNum where
- NoCommonVersion :: VersionMismatch vNum
- InconsistentVersion :: vNum -> VersionMismatch vNum
- simpleSingletonVersions :: vNum -> vData -> r -> Versions vNum vData r
- foldMapVersions :: (Ord vNum, Foldable f, HasCallStack) => (x -> Versions vNum extra r) -> f x -> Versions vNum extra r
- combineVersions :: (Ord vNum, Foldable f, HasCallStack) => f (Versions vNum extra r) -> Versions vNum extra r
Documentation
newtype Versions vNum vData r Source #
The set of versions supported by the local agent are described by a map keyed on the version identifier.
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
|
newtype Application vData r Source #
Takes a pair of version data: local then remote.
Constructors
Application | |
Fields
|
Instances
Functor (Application vData) Source # | |
Defined in Ouroboros.Network.Protocol.Handshake.Version Methods fmap :: (a -> b) -> Application vData a -> Application vData b # (<$) :: a -> Application vData b -> Application vData a # |
Constructors
Version | |
Fields
|
A
like type which better explains its purpose.Maybe
data VersionMismatch vNum where Source #
Constructors
NoCommonVersion :: VersionMismatch vNum | |
InconsistentVersion :: vNum -> VersionMismatch vNum |
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 #
combineVersions :: (Ord vNum, Foldable f, HasCallStack) => f (Versions vNum extra r) -> Versions vNum extra r Source #