HORIZON HASKELLDocslts/ghc-9.14.xd82dee82026-10-12Search names, modules, packages, or :: a typeCtrl K

GHC 9.14.1 · lts/ghc-9.14.x · d82dee8 · 2026-10-12

Modulebyron-spec-ledger-1.1.0.1Haskell2010

Byron.Spec.Ledger.Update

  • 48 types
  • 64 values
valuefindKey :: (v -> Bool) -> Map k v -> Maybe (k, v)
#

Find the key that corresponds to the value satisfying the given predicate. In case zero or more than one key is found this function returns Nothing.

valueinMap :: (Ord key, Eq v) => key -> v -> Map key v -> Bool
#

Test if a pair is present in a map.

valueincreasingProbabilityAt :: Gen a -> (a, a) -> Gen a
#

Generate values the given distribution in 90% of the cases, and values at the bounds of the range in 10% of the cases.

This can be used to generate enough extreme values. The exponential and linear distributions provided by hedgehog will generate a small percentage of these (0-1%).

valueinvertBijection :: Ord v => Map k v -> Map v k
#

Invert a map which we assert to be a bijection. If this map is not a bijection, the behaviour is not guaranteed.

Examples:

Example2 expressions
import qualified Data.Map.Strict as MapinvertBijection (Map.fromList [('a', 1 :: Int), ('b', 2), ('c', 3)])fromList [(1,'a'),(2,'b'),(3,'c')]
valueinvertMap :: (Ord k, Ord v) => Map k v -> Map v (Set k)
#

Invert a map

Examples:

Example3 expressions
import qualified Data.Map.Strict as Mapimport Byron.Spec.Ledger.Update (invertMap)invertMap (Map.fromList [('a', 1 :: Int), ('b', 2), ('c', 3), ('d', 1)])fromList [(1,fromList "ad"),(2,fromList "b"),(3,fromList "c")]

Generate a protocol parameter update from a given set of current protocol-parameters, ensuring the consistency of the new protocol parameters w.r.t. the current ones, according to the canUpdate predicate in the formal specification.

TODO: we can move this into a Generator's module, but first we need to disentangle the dependencies. Moving this to Byron.Spec.Ledger.Update.Generators will cause a circular dependency. I think the rules need to be moved into their own modules.

valuepvCanFollow
  1. :: ProtVer

    Next protocol version

  2. -> ProtVer

    Previous protocol version

  3. -> Bool
#

Check whether a protocol version can follow the current protocol version.

valuerandomUpId :: Gen UpId
#

Generate a random update proposal id, by picking a large number so that the probability of having an update proposal with that id is nearly zero.

Generate an optional update-proposal and a list of votes, given an update environment and state.

The update proposal and votes need to be generated at the same time, since this allow us to generate update votes for update proposals issued in the same block as the votes.

datadata ADDVOTE
#
Instances11Data, Generic, STS, Embed, Rep, BaseM, …
datadata APPLYVOTES
#
Instances12Data, Generic, STS, Embed, Rep, BaseM, …
Instances6Eq, Data, Show, Generic, NoThunks, Rep
newtypenewtype ApName
#

Constructors

Instances9Eq, Data, Ord, Show, Generic, Hashable, …
newtypenewtype ApVer
#

Application version

Constructors

Instances10Eq, Data, Num, Ord, Show, Generic, …
Instances6Eq, Data, Show, Generic, NoThunks, Rep
newtypenewtype BkSgnCntT
#

Constructors

Instances11Eq, Fractional, Data, Num, Ord, Show, …
datadata FADS
#
Instances11Data, Generic, STS, Embed, Rep, BaseM, …
  • Data FADSDefined in byron-spec-ledger-1.1.0.1 · Byron.Spec.Ledger.Update
  • Generic FADSDefined in byron-spec-ledger-1.1.0.1 · Byron.Spec.Ledger.Update
  • STS FADSDefined in byron-spec-ledger-1.1.0.1 · Byron.Spec.Ledger.Update
  • Embed FADS UPENDDefined in byron-spec-ledger-1.1.0.1 · Byron.Spec.Ledger.Update
  • type Rep FADS = D1 ('MetaData "FADS" "Byron.Spec.Ledger.Update" "byron-spec-ledger-1.1.0.1-IG07fLX99Su7spby3aHJ3g" 'False) V1Defined in byron-spec-ledger-1.1.0.1 · Byron.Spec.Ledger.Update
  • type BaseM FADS = IdentityDefined in byron-spec-ledger-1.1.0.1 · Byron.Spec.Ledger.Update
  • type Environment FADS = ()Defined in byron-spec-ledger-1.1.0.1 · Byron.Spec.Ledger.Update
  • type Event FADS = VoidDefined in byron-spec-ledger-1.1.0.1 · Byron.Spec.Ledger.Update
  • type PredicateFailure FADS = FadsPredicateFailureDefined in byron-spec-ledger-1.1.0.1 · Byron.Spec.Ledger.Update
  • type Signal FADS = (Slot, (ProtVer, PParams))Defined in byron-spec-ledger-1.1.0.1 · Byron.Spec.Ledger.Update
  • type State FADS = [(Slot, (ProtVer, PParams))]Defined in byron-spec-ledger-1.1.0.1 · Byron.Spec.Ledger.Update
newtypenewtype FactorA
#

Constructors

Instances9Eq, Data, Ord, Show, Generic, Hashable, …
newtypenewtype FactorB
#

Constructors

Instances9Eq, Data, Ord, Show, Generic, Hashable, …
datadata FadsPredicateFailure
#
Instances5Eq, Data, Show, Generic, Rep
datadata Metadata
#

For now we do not have any requirements on metadata.

Instances10Eq, Data, Ord, Show, Generic, Hashable, …
datadata PParams
#

Protocol parameters.

Constructors

Instances10Eq, Data, Ord, Show, Generic, Hashable, …
datadata PVBUMP
#
Instances11Data, Generic, STS, Embed, Rep, BaseM, …
datadata ProtVer
#

Protocol version

Instances10Eq, Data, Ord, Show, Generic, Hashable, …
Instances6Eq, Data, Show, Generic, NoThunks, Rep
typetype STag = String
#

System tag, this represents a target operating system for the update (e.g. linux, win64, or mac32).

datadata SwVer
#

Constructors

Instances9Eq, Data, Show, Generic, Hashable, NoThunks, …
datadata UPEND
#
Instances12Data, Generic, STS, Embed, Rep, BaseM, …
datadata UPIEC
#
Instances11Data, Generic, STS, Embed, Rep, BaseM, …
  • Data UPIECDefined in byron-spec-ledger-1.1.0.1 · Byron.Spec.Ledger.Update
  • Generic UPIECDefined in byron-spec-ledger-1.1.0.1 · Byron.Spec.Ledger.Update
  • STS UPIECDefined in byron-spec-ledger-1.1.0.1 · Byron.Spec.Ledger.Update
  • Embed PVBUMP UPIECDefined in byron-spec-ledger-1.1.0.1 · Byron.Spec.Ledger.Update
  • type Rep UPIEC = D1 ('MetaData "UPIEC" "Byron.Spec.Ledger.Update" "byron-spec-ledger-1.1.0.1-IG07fLX99Su7spby3aHJ3g" 'False) V1Defined in byron-spec-ledger-1.1.0.1 · Byron.Spec.Ledger.Update
  • type BaseM UPIEC = IdentityDefined in byron-spec-ledger-1.1.0.1 · Byron.Spec.Ledger.Update
  • type Environment UPIEC = (Epoch, BlockCount)Defined in byron-spec-ledger-1.1.0.1 · Byron.Spec.Ledger.Update
  • type Event UPIEC = VoidDefined in byron-spec-ledger-1.1.0.1 · Byron.Spec.Ledger.Update
  • type PredicateFailure UPIEC = UpiecPredicateFailureDefined in byron-spec-ledger-1.1.0.1 · Byron.Spec.Ledger.Update
  • type Signal UPIEC = ()Defined in byron-spec-ledger-1.1.0.1 · Byron.Spec.Ledger.Update
  • type State UPIEC = UPIStateDefined in byron-spec-ledger-1.1.0.1 · Byron.Spec.Ledger.Update
datadata UPIEND
#
Instances11Data, Generic, STS, Embed, Rep, BaseM, …
  • Data UPIENDDefined in byron-spec-ledger-1.1.0.1 · Byron.Spec.Ledger.Update
  • Generic UPIENDDefined in byron-spec-ledger-1.1.0.1 · Byron.Spec.Ledger.Update
  • STS UPIENDDefined in byron-spec-ledger-1.1.0.1 · Byron.Spec.Ledger.Update
  • Embed UPEND UPIENDDefined in byron-spec-ledger-1.1.0.1 · Byron.Spec.Ledger.Update
  • type Rep UPIEND = D1 ('MetaData "UPIEND" "Byron.Spec.Ledger.Update" "byron-spec-ledger-1.1.0.1-IG07fLX99Su7spby3aHJ3g" 'False) V1Defined in byron-spec-ledger-1.1.0.1 · Byron.Spec.Ledger.Update
  • type BaseM UPIEND = IdentityDefined in byron-spec-ledger-1.1.0.1 · Byron.Spec.Ledger.Update
  • type Environment UPIEND = UPIEnvDefined in byron-spec-ledger-1.1.0.1 · Byron.Spec.Ledger.Update
  • type Event UPIEND = VoidDefined in byron-spec-ledger-1.1.0.1 · Byron.Spec.Ledger.Update
  • type PredicateFailure UPIEND = UpiendPredicateFailureDefined in byron-spec-ledger-1.1.0.1 · Byron.Spec.Ledger.Update
  • type Signal UPIEND = (ProtVer, VKey)Defined in byron-spec-ledger-1.1.0.1 · Byron.Spec.Ledger.Update
  • type State UPIEND = UPIStateDefined in byron-spec-ledger-1.1.0.1 · Byron.Spec.Ledger.Update
datadata UPIREG
#
Instances13Data, Generic, STS, HasTrace, Embed, Rep, …
  • Data UPIREGDefined in byron-spec-ledger-1.1.0.1 · Byron.Spec.Ledger.Update
  • Generic UPIREGDefined in byron-spec-ledger-1.1.0.1 · Byron.Spec.Ledger.Update
  • STS UPIREGDefined in byron-spec-ledger-1.1.0.1 · Byron.Spec.Ledger.Update
  • HasTrace UPIREGDefined in byron-spec-ledger-1.1.0.1 · Byron.Spec.Ledger.Update
  • Embed UPREG UPIREGDefined in byron-spec-ledger-1.1.0.1 · Byron.Spec.Ledger.Update
  • type Rep UPIREG = D1 ('MetaData "UPIREG" "Byron.Spec.Ledger.Update" "byron-spec-ledger-1.1.0.1-IG07fLX99Su7spby3aHJ3g" 'False) V1Defined in byron-spec-ledger-1.1.0.1 · Byron.Spec.Ledger.Update
  • type BaseM UPIREG = IdentityDefined in byron-spec-ledger-1.1.0.1 · Byron.Spec.Ledger.Update
  • type Environment UPIREG = UPIEnvDefined in byron-spec-ledger-1.1.0.1 · Byron.Spec.Ledger.Update
  • type Event UPIREG = VoidDefined in byron-spec-ledger-1.1.0.1 · Byron.Spec.Ledger.Update
  • type PredicateFailure UPIREG = UpiregPredicateFailureDefined in byron-spec-ledger-1.1.0.1 · Byron.Spec.Ledger.Update
  • type Signal UPIREG = UPropDefined in byron-spec-ledger-1.1.0.1 · Byron.Spec.Ledger.Update
  • type State UPIREG = UPIStateDefined in byron-spec-ledger-1.1.0.1 · Byron.Spec.Ledger.Update
  • type BaseEnv UPIREG = ()Defined in byron-spec-ledger-1.1.0.1 · Byron.Spec.Ledger.Update
datadata UPIVOTE
#
Instances12Data, Generic, STS, Embed, Rep, BaseM, …
datadata UPIVOTES
#
Instances13Data, Generic, STS, HasTrace, Embed, Rep, …
  • Data UPIVOTESDefined in byron-spec-ledger-1.1.0.1 · Byron.Spec.Ledger.Update
  • Generic UPIVOTESDefined in byron-spec-ledger-1.1.0.1 · Byron.Spec.Ledger.Update
  • STS UPIVOTESDefined in byron-spec-ledger-1.1.0.1 · Byron.Spec.Ledger.Update
  • HasTrace UPIVOTESDefined in byron-spec-ledger-1.1.0.1 · Byron.Spec.Ledger.Update
  • Embed APPLYVOTES UPIVOTESDefined in byron-spec-ledger-1.1.0.1 · Byron.Spec.Ledger.Update
  • type Rep UPIVOTES = D1 ('MetaData "UPIVOTES" "Byron.Spec.Ledger.Update" "byron-spec-ledger-1.1.0.1-IG07fLX99Su7spby3aHJ3g" 'False) V1Defined in byron-spec-ledger-1.1.0.1 · Byron.Spec.Ledger.Update
  • type BaseM UPIVOTES = IdentityDefined in byron-spec-ledger-1.1.0.1 · Byron.Spec.Ledger.Update
  • type Environment UPIVOTES = UPIEnvDefined in byron-spec-ledger-1.1.0.1 · Byron.Spec.Ledger.Update
  • type Event UPIVOTES = VoidDefined in byron-spec-ledger-1.1.0.1 · Byron.Spec.Ledger.Update
  • type PredicateFailure UPIVOTES = UpivotesPredicateFailureDefined in byron-spec-ledger-1.1.0.1 · Byron.Spec.Ledger.Update
  • type Signal UPIVOTES = [Vote]Defined in byron-spec-ledger-1.1.0.1 · Byron.Spec.Ledger.Update
  • type State UPIVOTES = UPIStateDefined in byron-spec-ledger-1.1.0.1 · Byron.Spec.Ledger.Update
  • type BaseEnv UPIVOTES = ()Defined in byron-spec-ledger-1.1.0.1 · Byron.Spec.Ledger.Update
datadata UPPVV
#
Instances11Data, Generic, STS, Embed, Rep, BaseM, …
  • Data UPPVVDefined in byron-spec-ledger-1.1.0.1 · Byron.Spec.Ledger.Update
  • Generic UPPVVDefined in byron-spec-ledger-1.1.0.1 · Byron.Spec.Ledger.Update
  • STS UPPVVDefined in byron-spec-ledger-1.1.0.1 · Byron.Spec.Ledger.Update
  • Embed UPPVV UPVDefined in byron-spec-ledger-1.1.0.1 · Byron.Spec.Ledger.Update
  • type Rep UPPVV = D1 ('MetaData "UPPVV" "Byron.Spec.Ledger.Update" "byron-spec-ledger-1.1.0.1-IG07fLX99Su7spby3aHJ3g" 'False) V1Defined in byron-spec-ledger-1.1.0.1 · Byron.Spec.Ledger.Update
  • type BaseM UPPVV = IdentityDefined in byron-spec-ledger-1.1.0.1 · Byron.Spec.Ledger.Update
  • type Environment UPPVV = (ProtVer, PParams)Defined in byron-spec-ledger-1.1.0.1 · Byron.Spec.Ledger.Update
  • type Event UPPVV = VoidDefined in byron-spec-ledger-1.1.0.1 · Byron.Spec.Ledger.Update
  • type PredicateFailure UPPVV = UppvvPredicateFailureDefined in byron-spec-ledger-1.1.0.1 · Byron.Spec.Ledger.Update
  • type Signal UPPVV = UPropDefined in byron-spec-ledger-1.1.0.1 · Byron.Spec.Ledger.Update
  • type State UPPVV = Map UpId (ProtVer, PParams)Defined in byron-spec-ledger-1.1.0.1 · Byron.Spec.Ledger.Update
datadata UPREG
#
Instances12Data, Generic, STS, Embed, Rep, BaseM, …
datadata UPSVV
#

Update Proposal Software Version Validation

Instances11Data, Generic, STS, Embed, Rep, BaseM, …
datadata UPV
#

Update proposal validity

Instances13Data, Generic, STS, Embed, Rep, BaseM, …
datadata UPVOTE
#
Instances12Data, Generic, STS, Embed, Rep, BaseM, …
datadata UProp
#

Update proposal

Constructors

Instances9Eq, Data, Show, Generic, Hashable, NoThunks, …
newtypenewtype UpAdptThd
#

Constructors

Instances13Eq, Fractional, Data, Num, Ord, Real, …
newtypenewtype UpId
#

Constructors

Instances9Eq, Data, Ord, Show, Generic, Hashable, …
Instances7Eq, Data, Ord, Show, Generic, NoThunks, …

S_TryNextRule is a structural PredicateFailure, used to fail from one transition rule to the other. The other PredicateFailures are all throwable.

Instances6Eq, Data, Show, Generic, NoThunks, Rep
Instances6Eq, Data, Show, Generic, NoThunks, Rep
Instances6Eq, Data, Show, Generic, NoThunks, Rep
Instances6Eq, Data, Show, Generic, NoThunks, Rep
Instances6Eq, Data, Show, Generic, NoThunks, Rep
Instances6Eq, Data, Show, Generic, NoThunks, Rep

These PredicateFailures are all "throwable". The disjunction of the rules' preconditions is not True - the PredicateFailures represent False cases.

Instances6Eq, Data, Show, Generic, NoThunks, Rep
Instances6Eq, Data, Show, Generic, NoThunks, Rep

These PredicateFailures are all "throwable". The disjunction of the rules' preconditions is not True - the PredicateFailures represent False cases.

Instances6Eq, Data, Show, Generic, NoThunks, Rep
datadata UpvPredicateFailure
#
Instances6Eq, Data, Show, Generic, NoThunks, Rep

The 3 non-embedded PredicateFailures here are all structural. The disjuntion of the preconditions is True - one rule either fires or the other does.

Instances6Eq, Data, Show, Generic, NoThunks, Rep
datadata Vote
#
Instances9Eq, Data, Show, Generic, Hashable, NoThunks, …
familytype family PredicateFailure a
#
Instances25PredicateFailure, …

Orphan instances

3 instances
  • Field1 (a, b, c, d, e, f, g, h, i) (a', b, c, d, e, f, g, h, i) a a'
  • Field2 (a, b, c, d, e, f, g, h, i) (a, b', c, d, e, f, g, h, i) b b'
  • Field3 (a, b, c, d, e, f, g, h, i) (a, b, c', d, e, f, g, h, i) c c'