| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Test.Cardano.Ledger.Conformance.SpecTranslate.Base
Synopsis
- class SpecTranslate a where
- type SpecRep a
- type SpecContext a
- toSpecRep ∷ a → SpecTransM (SpecContext a) (SpecRep a)
- class SpecNormalize a where
- specNormalize ∷ a → a
- newtype OpaqueErrorString = OpaqueErrorString (NonEmpty Text)
- data SpecTransM ctx a
- runSpecTransM ∷ ctx → SpecTransM ctx a → Either Text a
- withSpecTransM ∷ (ctx → ctx') → SpecTransM ctx' a → SpecTransM ctx a
- withCtxSpecTransM ∷ ctx → SpecTransM ctx a → SpecTransM ctx' a
- askSpecTransM ∷ SpecTransM ctx ctx
- unComputationResult ∷ ComputationResult Text a → Either Text a
- unComputationResult_ ∷ ComputationResult Void a → Either e a
- toSpecRepTuple ∷ (SpecTranslate a, SpecTranslate b, SpecContext a ~ ctx, SpecContext b ~ ctx) ⇒ (a, b) → SpecTransM ctx (SpecRep a, SpecRep b)
- toSpecRepTupleGen ∷ (a → SpecTransM ctx c) → (b → SpecTransM ctx d) → (a, b) → SpecTransM ctx (c, d)
- toSpecRepOMap ∷ (Ord k, SpecTranslate k, SpecTranslate v, SpecContext k ~ ctx, SpecContext v ~ ctx) ⇒ OMap k v → SpecTransM ctx [(SpecRep k, SpecRep v)]
- toSpecRepMap ∷ (SpecTranslate k, SpecTranslate v, SpecContext k ~ ctx, SpecContext v ~ ctx) ⇒ Map k v → SpecTransM ctx (HSMap (SpecRep k) (SpecRep v))
Documentation
class SpecTranslate a where Source #
Methods
toSpecRep ∷ a → SpecTransM (SpecContext a) (SpecRep a) Source #
Instances
class SpecNormalize a where Source #
Minimal complete definition
Nothing
Methods
specNormalize ∷ a → a Source #
default specNormalize ∷ (Generic a, GSpecNormalize (Rep a)) ⇒ a → a Source #
Instances
| SpecNormalize OpaqueErrorString Source # | |
Defined in Test.Cardano.Ledger.Conformance.Orphans Methods specNormalize ∷ OpaqueErrorString → OpaqueErrorString Source # | |
| SpecNormalize CertState Source # | |
Defined in Test.Cardano.Ledger.Conformance.Orphans Methods | |
| SpecNormalize DState Source # | |
Defined in Test.Cardano.Ledger.Conformance.Orphans Methods specNormalize ∷ DState → DState Source # | |
| SpecNormalize DepositPurpose Source # | |
Defined in Test.Cardano.Ledger.Conformance.Orphans Methods | |
| SpecNormalize GState Source # | |
Defined in Test.Cardano.Ledger.Conformance.Orphans Methods specNormalize ∷ GState → GState Source # | |
| SpecNormalize PState Source # | |
Defined in Test.Cardano.Ledger.Conformance.Orphans Methods specNormalize ∷ PState → PState Source # | |
| SpecNormalize StakePoolParams Source # | |
Defined in Test.Cardano.Ledger.Conformance.Orphans Methods | |
| SpecNormalize EnactState Source # | |
Defined in Test.Cardano.Ledger.Conformance.Orphans Methods | |
| SpecNormalize EpochState Source # | |
Defined in Test.Cardano.Ledger.Conformance.Orphans Methods | |
| SpecNormalize GovActionState Source # | |
Defined in Test.Cardano.Ledger.Conformance.Orphans Methods | |
| SpecNormalize GovAction Source # | |
Defined in Test.Cardano.Ledger.Conformance.Orphans Methods | |
| SpecNormalize GovRole Source # | |
Defined in Test.Cardano.Ledger.Conformance.Orphans Methods | |
| SpecNormalize GovVotes Source # | |
Defined in Test.Cardano.Ledger.Conformance.Orphans Methods | |
| SpecNormalize VDeleg Source # | |
Defined in Test.Cardano.Ledger.Conformance.Orphans Methods specNormalize ∷ VDeleg → VDeleg Source # | |
| SpecNormalize Vote Source # | |
Defined in Test.Cardano.Ledger.Conformance.Orphans Methods specNormalize ∷ Vote → Vote Source # | |
| SpecNormalize LState Source # | |
Defined in Test.Cardano.Ledger.Conformance.Orphans Methods specNormalize ∷ LState → LState Source # | |
| SpecNormalize NewEpochState Source # | |
Defined in Test.Cardano.Ledger.Conformance.Orphans Methods | |
| SpecNormalize Acnt Source # | |
Defined in Test.Cardano.Ledger.Conformance.Orphans Methods specNormalize ∷ Acnt → Acnt Source # | |
| SpecNormalize DrepThresholds Source # | |
Defined in Test.Cardano.Ledger.Conformance.Orphans Methods | |
| SpecNormalize LanguageCostModels Source # | |
Defined in Test.Cardano.Ledger.Conformance.Orphans Methods specNormalize ∷ LanguageCostModels → LanguageCostModels Source # | |
| SpecNormalize PParams Source # | |
Defined in Test.Cardano.Ledger.Conformance.Orphans Methods | |
| SpecNormalize PParamsUpdate Source # | |
Defined in Test.Cardano.Ledger.Conformance.Orphans Methods | |
| SpecNormalize PoolThresholds Source # | |
Defined in Test.Cardano.Ledger.Conformance.Orphans Methods | |
| SpecNormalize RatifyEnv Source # | |
Defined in Test.Cardano.Ledger.Conformance.Orphans Methods | |
| SpecNormalize RatifyState Source # | |
Defined in Test.Cardano.Ledger.Conformance.Orphans Methods | |
| SpecNormalize StakeDistrs Source # | |
Defined in Test.Cardano.Ledger.Conformance.Orphans Methods | |
| SpecNormalize HsRewardUpdate Source # | |
Defined in Test.Cardano.Ledger.Conformance.Orphans Methods | |
| SpecNormalize Snapshot Source # | |
Defined in Test.Cardano.Ledger.Conformance.Orphans Methods | |
| SpecNormalize Snapshots Source # | |
Defined in Test.Cardano.Ledger.Conformance.Orphans Methods | |
| SpecNormalize HSLanguage Source # | |
Defined in Test.Cardano.Ledger.Conformance.Orphans Methods | |
| SpecNormalize HSPlutusScript Source # | |
Defined in Test.Cardano.Ledger.Conformance.Orphans Methods | |
| SpecNormalize HSTimelock Source # | |
Defined in Test.Cardano.Ledger.Conformance.Orphans Methods | |
| SpecNormalize Timelock Source # | |
Defined in Test.Cardano.Ledger.Conformance.Orphans Methods | |
| SpecNormalize TxId Source # | |
Defined in Test.Cardano.Ledger.Conformance.Orphans Methods specNormalize ∷ TxId → TxId Source # | |
| SpecNormalize UTxOState Source # | |
Defined in Test.Cardano.Ledger.Conformance.Orphans Methods | |
| SpecNormalize BaseAddr Source # | |
Defined in Test.Cardano.Ledger.Conformance.Orphans Methods | |
| SpecNormalize BootstrapAddr Source # | |
Defined in Test.Cardano.Ledger.Conformance.Orphans Methods | |
| SpecNormalize Credential Source # | |
Defined in Test.Cardano.Ledger.Conformance.Orphans Methods | |
| SpecNormalize RewardAddress Source # | |
Defined in Test.Cardano.Ledger.Conformance.Orphans Methods | |
| SpecNormalize Rational Source # | |
Defined in Test.Cardano.Ledger.Conformance.Orphans Methods | |
| SpecNormalize Void Source # | |
Defined in Test.Cardano.Ledger.Conformance.Orphans Methods specNormalize ∷ Void → Void Source # | |
| SpecNormalize Text Source # | |
Defined in Test.Cardano.Ledger.Conformance.Orphans Methods specNormalize ∷ Text → Text Source # | |
| SpecNormalize () Source # | |
Defined in Test.Cardano.Ledger.Conformance.Orphans Methods specNormalize ∷ () → () Source # | |
| SpecNormalize Bool Source # | |
Defined in Test.Cardano.Ledger.Conformance.Orphans Methods specNormalize ∷ Bool → Bool Source # | |
| SpecNormalize Char Source # | |
Defined in Test.Cardano.Ledger.Conformance.Orphans Methods specNormalize ∷ Char → Char Source # | |
| (Ord a, SpecNormalize a) ⇒ SpecNormalize (HSSet a) Source # | |
Defined in Test.Cardano.Ledger.Conformance.Orphans Methods specNormalize ∷ HSSet a → HSSet a Source # | |
| SpecNormalize a ⇒ SpecNormalize (NonEmpty a) Source # | |
Defined in Test.Cardano.Ledger.Conformance.Orphans Methods specNormalize ∷ NonEmpty a → NonEmpty a Source # | |
| SpecNormalize a ⇒ SpecNormalize (Maybe a) Source # | |
Defined in Test.Cardano.Ledger.Conformance.Orphans Methods specNormalize ∷ Maybe a → Maybe a Source # | |
| SpecNormalize a ⇒ SpecNormalize [a] Source # | |
Defined in Test.Cardano.Ledger.Conformance.Orphans Methods specNormalize ∷ [a] → [a] Source # | |
| (Eq v, Ord k, SpecNormalize k, SpecNormalize v) ⇒ SpecNormalize (HSMap k v) Source # | |
Defined in Test.Cardano.Ledger.Conformance.Orphans Methods specNormalize ∷ HSMap k v → HSMap k v Source # | |
| (SpecNormalize a, SpecNormalize b) ⇒ SpecNormalize (Either a b) Source # | |
Defined in Test.Cardano.Ledger.Conformance.Orphans Methods specNormalize ∷ Either a b → Either a b Source # | |
| (SpecNormalize a, SpecNormalize b) ⇒ SpecNormalize (a, b) Source # | |
Defined in Test.Cardano.Ledger.Conformance.Orphans Methods specNormalize ∷ (a, b) → (a, b) Source # | |
newtype OpaqueErrorString Source #
OpaqueErrorString behaves like unit in comparisons, but contains an error string that can be displayed.
Constructors
| OpaqueErrorString (NonEmpty Text) |
Instances
| SpecNormalize OpaqueErrorString Source # | |||||
Defined in Test.Cardano.Ledger.Conformance.Orphans Methods specNormalize ∷ OpaqueErrorString → OpaqueErrorString Source # | |||||
| NFData OpaqueErrorString Source # | |||||
Defined in Test.Cardano.Ledger.Conformance.SpecTranslate.Base Methods rnf ∷ OpaqueErrorString → () # | |||||
| Semigroup OpaqueErrorString Source # | |||||
Defined in Test.Cardano.Ledger.Conformance.SpecTranslate.Base Methods (<>) ∷ OpaqueErrorString → OpaqueErrorString → OpaqueErrorString # sconcat ∷ NonEmpty OpaqueErrorString → OpaqueErrorString # stimes ∷ Integral b ⇒ b → OpaqueErrorString → OpaqueErrorString # | |||||
| Generic OpaqueErrorString Source # | |||||
Defined in Test.Cardano.Ledger.Conformance.SpecTranslate.Base Associated Types
Methods from ∷ OpaqueErrorString → Rep OpaqueErrorString x # to ∷ Rep OpaqueErrorString x → OpaqueErrorString # | |||||
| Show OpaqueErrorString Source # | |||||
Defined in Test.Cardano.Ledger.Conformance.SpecTranslate.Base Methods showsPrec ∷ Int → OpaqueErrorString → ShowS # show ∷ OpaqueErrorString → String # showList ∷ [OpaqueErrorString] → ShowS # | |||||
| Eq OpaqueErrorString Source # | This implementation violates referential transparency. Do not rely on it unless you know what you're doing. | ||||
Defined in Test.Cardano.Ledger.Conformance.SpecTranslate.Base Methods | |||||
| ToExpr OpaqueErrorString Source # | |||||
| type Rep OpaqueErrorString Source # | |||||
Defined in Test.Cardano.Ledger.Conformance.SpecTranslate.Base type Rep OpaqueErrorString = D1 ('MetaData "OpaqueErrorString" "Test.Cardano.Ledger.Conformance.SpecTranslate.Base" "cardano-ledger-conformance-9.9.9.9-inplace" 'True) (C1 ('MetaCons "OpaqueErrorString" 'PrefixI 'False) (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (NonEmpty Text)))) | |||||
data SpecTransM ctx a Source #
Instances
| MonadError Text (SpecTransM ctx) Source # | |
Defined in Test.Cardano.Ledger.Conformance.SpecTranslate.Base Methods throwError ∷ Text → SpecTransM ctx a # catchError ∷ SpecTransM ctx a → (Text → SpecTransM ctx a) → SpecTransM ctx a # | |
| MonadReader ctx (SpecTransM ctx) Source # | |
Defined in Test.Cardano.Ledger.Conformance.SpecTranslate.Base Methods ask ∷ SpecTransM ctx ctx # local ∷ (ctx → ctx) → SpecTransM ctx a → SpecTransM ctx a # reader ∷ (ctx → a) → SpecTransM ctx a # | |
| Applicative (SpecTransM ctx) Source # | |
Defined in Test.Cardano.Ledger.Conformance.SpecTranslate.Base Methods pure ∷ a → SpecTransM ctx a # (<*>) ∷ SpecTransM ctx (a → b) → SpecTransM ctx a → SpecTransM ctx b # liftA2 ∷ (a → b → c) → SpecTransM ctx a → SpecTransM ctx b → SpecTransM ctx c # (*>) ∷ SpecTransM ctx a → SpecTransM ctx b → SpecTransM ctx b # (<*) ∷ SpecTransM ctx a → SpecTransM ctx b → SpecTransM ctx a # | |
| Functor (SpecTransM ctx) Source # | |
Defined in Test.Cardano.Ledger.Conformance.SpecTranslate.Base Methods fmap ∷ (a → b) → SpecTransM ctx a → SpecTransM ctx b # (<$) ∷ a → SpecTransM ctx b → SpecTransM ctx a # | |
| Monad (SpecTransM ctx) Source # | |
Defined in Test.Cardano.Ledger.Conformance.SpecTranslate.Base Methods (>>=) ∷ SpecTransM ctx a → (a → SpecTransM ctx b) → SpecTransM ctx b # (>>) ∷ SpecTransM ctx a → SpecTransM ctx b → SpecTransM ctx b # return ∷ a → SpecTransM ctx a # | |
runSpecTransM ∷ ctx → SpecTransM ctx a → Either Text a Source #
withSpecTransM ∷ (ctx → ctx') → SpecTransM ctx' a → SpecTransM ctx a Source #
withCtxSpecTransM ∷ ctx → SpecTransM ctx a → SpecTransM ctx' a Source #
askSpecTransM ∷ SpecTransM ctx ctx Source #
unComputationResult_ ∷ ComputationResult Void a → Either e a Source #
toSpecRepTuple ∷ (SpecTranslate a, SpecTranslate b, SpecContext a ~ ctx, SpecContext b ~ ctx) ⇒ (a, b) → SpecTransM ctx (SpecRep a, SpecRep b) Source #
toSpecRepTupleGen ∷ (a → SpecTransM ctx c) → (b → SpecTransM ctx d) → (a, b) → SpecTransM ctx (c, d) Source #
toSpecRepOMap ∷ (Ord k, SpecTranslate k, SpecTranslate v, SpecContext k ~ ctx, SpecContext v ~ ctx) ⇒ OMap k v → SpecTransM ctx [(SpecRep k, SpecRep v)] Source #
toSpecRepMap ∷ (SpecTranslate k, SpecTranslate v, SpecContext k ~ ctx, SpecContext v ~ ctx) ⇒ Map k v → SpecTransM ctx (HSMap (SpecRep k) (SpecRep v)) Source #