Module

Cardano.Plutus.DataSchema.Indexed

#ConsI

data ConsI :: forall (k :: Type). Symbol -> k -> Nat -> RowListI k -> RowListI kdata ConsI t0 t1 t2 t3

Instances

#RowListI

data RowListI :: forall (k :: Type). k -> Typedata RowListI k

A kind for unordered RowLists which contain a Nat representation of their intended position in a non-lexicographic order. Actual RowLists are automagically ordered lexicographically, Haskell records are not ordered lexicographically, so we need this to encode the structure of Haskell records precisely.

#AllUniqueLabelsI

class AllUniqueLabelsI :: forall (k :: Type). RowListI k -> Constraintclass AllUniqueLabelsI list 

Uniqueness constraint on the labels of a RowListI which asserts that all labels are unique. Again, this is needed so that the lookup functions perform in the expected manner.

Instances

#GetIndexWithLabel

class GetIndexWithLabel :: forall (k :: Type). Symbol -> RowListI k -> Nat -> Constraintclass (IsSymbol label) <= GetIndexWithLabel label list n | label list -> n

Get the Nat index corresponding to a given symbol index in a RowListI. This is meant to be used primarily in the context of an instance declaration for some other class (see examples in ToData.purs), and is probably not particularly useful outside of those instance contexts.

Instances

#GetLabelIndex

class GetLabelIndex :: forall (k :: Type). Symbol -> RowList k -> Nat -> Constraintclass GetLabelIndex label list result | label list -> result

Get the nat index at a symbol in a RowList (Note: Not a RowListI! Use GetIndexWithLabel for a RowListI)

Instances

#GetLabelWithIndex

class GetLabelWithIndex :: forall (k :: Type). Nat -> RowListI k -> Symbol -> Constraintclass (KnownNat ix, AllUniqueLabelsI list, UniqueIndices list) <= GetLabelWithIndex ix list label | ix list -> label

Given a Nat which appears as an index in the given RowListI, get its corresponding Symbol label

Instances

#GetWithLabel

class GetWithLabel :: forall (k :: Type). Symbol -> RowListI k -> k -> Constraintclass GetWithLabel label rlist result | label rlist -> result

Given a Symbol which appears as a label in the given RowListI, get ahold of the type indexed by that symbol. Note that this does not "return" a value of that type, but the type itself, and is therefore only suitable for type class instance contexts (& other type level computational contexts if any exist)

Instances

#IndexRowList

class IndexRowList :: forall (k :: Type). RowList k -> RowListI k -> Constraintclass IndexRowList list result | list -> result

Helper class for GetLabelIndex. Converts a RowList into a RowListI using its natural order (beginning with Z)

Instances

#IndexRowListWithAcc

class IndexRowListWithAcc :: forall (k :: Type). Nat -> RowList k -> RowListI k -> Constraintclass IndexRowListWithAcc acc list result | acc list -> result

Helper class for IndexRowListWithAcc.

Instances

#UniqueIndices

class UniqueIndices :: forall (k :: Type). RowListI k -> Constraintclass UniqueIndices list 

Uniqueness constraint on the Nat indices of a RowListI which asserts that all indices are unique. This is needed to ensure that the various "lookup" classes return the "values" (types) that we expect.

Instances

Modules