cooked-validators
Safe HaskellSafe-Inferred
LanguageHaskell2010

Cooked.Skeleton.Payable

Description

This module defines the notion of Payable elements with consist of the user API to build payments in a TxSkel

Synopsis

Documentation

data Payable :: [Symbol] -> Type where Source #

Payable elements. Created from concrete elements or composed. Notice that there is no way of building an element of Type Payable '[] so when using an element of Type Payable els we are sure that something was in fact paid.

Constructors

VisibleHashedDatum :: TxSkelOutDatumConstrs a => a -> Payable '["Datum"]

Hashed datums visible in the transaction are payable

InlineDatum :: TxSkelOutDatumConstrs a => a -> Payable '["Datum"]

Inline datums are payable

HiddenHashedDatum :: TxSkelOutDatumConstrs a => a -> Payable '["Datum"]

Hashed datums hidden from the transaction are payable

ReferenceScript :: ToVersioned Script s => s -> Payable '["Reference Script"]

Reference scripts are payable

Value :: ToValue a => a -> Payable '["Value"]

Values are payable and are subject to min ada adjustment

FixedValue :: ToValue a => a -> Payable '["Value"]

Fixed Values are payable but are NOT subject to min ada adjustment

StakingCredential :: ToMaybeStakingCredential cred => cred -> Payable '["Staking Credential"]

Staking credentials are payable

PayableAnd :: els els' => Payable els -> Payable els' -> Payable (els els')

Payables can be combined as long as their list of tags are disjoint

type family (el :: a) (els :: [a]) :: Constraint where ... Source #

Constraint that a given type does not appear in a list of types

Equations

x '[] = () 
x (x ': xs) = TypeError ('Text "Cannot have two payable elements of type: " ':<>: 'ShowType x) 
x (_ ': xs) = x xs 

type family (els :: [a]) (els' :: [a]) :: Constraint where ... Source #

Disjoint lists of types

Equations

'[] _ = () 
(x ': xs) ys = (x ys, xs ys) 

type family (xs :: [a]) (ys :: [a]) :: [a] where ... Source #

Union with duplicates, which will not occur by construction in the concrete implentation of Payable due to the constraint.

Equations

'[] ys = ys 
(x ': xs) ys = x ': (xs ys) 

(<&&>) :: els els' => Payable els -> Payable els' -> Payable (els els') Source #

An infix-usable alias for PayableAnd