plutus-tx-1.60.0.0: Libraries for Plutus Tx and its prelude
Safe HaskellSafe-Inferred
LanguageHaskell2010

PlutusTx.Blueprint.Definition.Unroll

Synopsis

Documentation

class HasBlueprintDefinition (t :: Type) where #

Designates a class of types that could be used as a Blueprint Definition. Each such type: - could be unrolled to a list of all nested types (including the type itself). - has a unique DefinitionId.

Minimal complete definition

Nothing

Associated Types

type Unroll t :: [Type] #

Instances

Instances details
HasBlueprintDefinition Void # 
Instance details

Defined in PlutusTx.Blueprint.Definition.Unroll

Associated Types

type Unroll Void :: [Type] #

HasBlueprintDefinition BuiltinByteString # 
Instance details

Defined in PlutusTx.Blueprint.Definition.Unroll

Associated Types

type Unroll BuiltinByteString :: [Type] #

HasBlueprintDefinition BuiltinData # 
Instance details

Defined in PlutusTx.Blueprint.Definition.Unroll

Associated Types

type Unroll BuiltinData :: [Type] #

HasBlueprintDefinition BuiltinString # 
Instance details

Defined in PlutusTx.Blueprint.Definition.Unroll

Associated Types

type Unroll BuiltinString :: [Type] #

HasBlueprintDefinition BuiltinUnit # 
Instance details

Defined in PlutusTx.Blueprint.Definition.Unroll

Associated Types

type Unroll BuiltinUnit :: [Type] #

HasBlueprintDefinition Rational # 
Instance details

Defined in PlutusTx.Ratio

Associated Types

type Unroll Rational :: [Type] #

HasBlueprintDefinition Integer # 
Instance details

Defined in PlutusTx.Blueprint.Definition.Unroll

Associated Types

type Unroll Integer :: [Type] #

HasBlueprintDefinition () # 
Instance details

Defined in PlutusTx.Blueprint.Definition.Unroll

Associated Types

type Unroll () :: [Type] #

HasBlueprintDefinition Bool # 
Instance details

Defined in PlutusTx.Blueprint.Definition.Unroll

Associated Types

type Unroll Bool :: [Type] #

HasBlueprintDefinition Int # 
Instance details

Defined in PlutusTx.Blueprint.Definition.Unroll

Associated Types

type Unroll Int :: [Type] #

HasBlueprintDefinition a => HasBlueprintDefinition (BuiltinList a) # 
Instance details

Defined in PlutusTx.Blueprint.Definition.Unroll

Associated Types

type Unroll (BuiltinList a) :: [Type] #

HasBlueprintDefinition a => HasBlueprintDefinition (Maybe a) # 
Instance details

Defined in PlutusTx.Blueprint.Definition.Unroll

Associated Types

type Unroll (Maybe a) :: [Type] #

HasBlueprintDefinition a => HasBlueprintDefinition [a] # 
Instance details

Defined in PlutusTx.Blueprint.Definition.Unroll

Associated Types

type Unroll [a] :: [Type] #

(HasBlueprintDefinition k, HasBlueprintDefinition v) => HasBlueprintDefinition (Map k v) # 
Instance details

Defined in PlutusTx.AssocMap

Associated Types

type Unroll (Map k v) :: [Type] #

(HasBlueprintDefinition a, HasBlueprintDefinition b) => HasBlueprintDefinition (BuiltinPair a b) # 
Instance details

Defined in PlutusTx.Blueprint.Definition.Unroll

Associated Types

type Unroll (BuiltinPair a b) :: [Type] #

(Typeable a, Typeable b) => HasBlueprintDefinition (These a b) # 
Instance details

Defined in PlutusTx.These

Associated Types

type Unroll (These a b) :: [Type] #

(HasBlueprintDefinition a, HasBlueprintDefinition b) => HasBlueprintDefinition (a, b) # 
Instance details

Defined in PlutusTx.Blueprint.Definition.Unroll

Associated Types

type Unroll (a, b) :: [Type] #

(HasBlueprintDefinition a, HasBlueprintDefinition b, HasBlueprintDefinition c) => HasBlueprintDefinition (a, b, c) # 
Instance details

Defined in PlutusTx.Blueprint.Definition.Unroll

Associated Types

type Unroll (a, b, c) :: [Type] #

type family UnrollIsStuckError x where ... #

Compile-time error that happens when a type couldn't be unrolled (Unroll TF is "stuck").

Note: This error commonly occurs when using 'DefinitionsFor (UnrollAll '[a])' with an abstract type variable a. Type families like UnrollAll must be fully evaluated at compile time, which is not possible when the type is not yet known.

Equations

UnrollIsStuckError x = TypeError (((((((((((Text "Cannot unroll type '" :<>: ShowType x) :<>: Text "'.") :$$: Text "The 'Unroll' type family is stuck because:") :$$: Text " - The type may be abstract (a type variable), or") :$$: Text " - It lacks a 'HasBlueprintDefinition' instance, or") :$$: Text " - It lacks a 'Generic' instance for default unrolling.") :$$: Text "") :$$: Text "Tip: 'DefinitionsFor (UnrollAll ts)' requires all types in 'ts'") :$$: Text "to be concrete at compile time. Polymorphic constraints like") :$$: Text "'DefinitionsFor (UnrollAll '[a])' cannot be used as superclass") :$$: Text "constraints because 'a' is not known when the class is defined.") 

type family RepIsStuckError x where ... #

Compile-time error that happens when type's generic representation is not defined (Rep TF is "stuck")

Equations

RepIsStuckError x = TypeError (((((Text "Cannot derive generic representation for type '" :<>: ShowType x) :<>: Text "'.") :$$: Text "Add 'deriving Generic' to enable automatic blueprint unrolling,") :$$: Text "or provide a manual 'HasBlueprintDefinition' instance with") :$$: Text "an explicit 'Unroll' type instance.") 

type Unrolled t = Reverse (IfStuckUnroll (UnrollIsStuckError t) (Unroll t)) #

Same as Unroll but with a nicer error message

type family UnrollAll xs :: [Type] where ... #

Unrolls all types in the list xs

Equations

UnrollAll '[] = '[] 
UnrollAll (x ': xs) = Nub (Concat (Unrolled x) (UnrollAll xs)) 

type family GUnroll (t :: Type -> Type) :: [Type] where ... #

Unroll a generic representation of a type into a list of all nested types.

Equations

GUnroll (M1 _ _ f) = GUnroll f 
GUnroll (f :*: g) = GUnroll f ++ GUnroll g 
GUnroll (f :+: g) = GUnroll f ++ GUnroll g 
GUnroll (K1 _ c) = Unrolled c 
GUnroll U1 = '[]