Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
This module defines a generalised notion of a "value" - that is, something with which we may quantify a transaction output.
Documentation
class (Compactible t, Inject Coin t, EncCBOR (CompactForm t), DecCBOR (CompactForm t), Abelian t, NoThunks t, EncCBOR t, DecCBOR t, ToJSON t, NFData t, Show t, Eq t) ⇒ Val t where Source #
(<×>), coin, modifyCoin, size, pointwise, isAdaOnly, isAdaOnlyCompact, coinCompact, injectCompact, modifyCompactCoin
the value with nothing in it
(<+>) ∷ t → t → t infixl 6 Source #
add two value
(<×>) ∷ Integral i ⇒ i → t → t infixl 7 Source #
scale a value by an Integral constant
(<->) ∷ t → t → t infixl 6 Source #
subtract two values
Is the argument zero?
Get the ADA present in the value (since ADA is our "blessed" currency)
modifyCoin ∷ (Coin → Coin) → t → t Source #
modify the blessed Coin part of t
pointwise ∷ (Integer → Integer → Bool) → t → t → Bool Source #
used to compare values pointwise. Rather than using: (v1 <= v2) use: pointwise (<=) v1 v2
| If a quantity is stored in only one of v1
or v2
, we use 0 for the missing quantity.
Check if value contains only ADA. Must hold property:
inject (coin v) == v
isAdaOnlyCompact ∷ CompactForm t → Bool Source #
coinCompact ∷ CompactForm t → CompactForm Coin Source #
injectCompact ∷ CompactForm Coin → CompactForm t Source #
modifyCompactCoin ∷ (CompactForm Coin → CompactForm Coin) → CompactForm t → CompactForm t Source #