Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
This module provides a functionality to derive and reference schema definitions.
Synopsis
- data Definition t ts = MkDefinition DefinitionId (Schema ts)
- data Definitions ts where
- NoDefinitions :: Definitions ts
- AddDefinition :: Definition t ts -> Definitions ts -> Definitions ts
- addDefinition :: Definitions ts -> Definition t ts -> Definitions ts
- definitionsToMap :: Definitions ts -> (forall xs. Schema xs -> v) -> Map DefinitionId v
- type HasSchemaDefinition t ts = HasSchemaDefinition' t ts ts
- type family HasSchemaDefinition' n xs xs0 where ...
Documentation
data Definition t ts Source #
A schema definition of a type t
with a list of referenced types ts
.
Instances
Show (Definition t ts) Source # | |
Defined in PlutusTx.Blueprint.Definition.Internal |
data Definitions ts where Source #
A registry of schema definitions.
NoDefinitions :: Definitions ts | |
AddDefinition :: Definition t ts -> Definitions ts -> Definitions ts |
Instances
Show (Definitions ts) Source # | |
Defined in PlutusTx.Blueprint.Definition.Internal |
addDefinition :: Definitions ts -> Definition t ts -> Definitions ts Source #
Add a schema definition to a registry.
definitionsToMap :: Definitions ts -> (forall xs. Schema xs -> v) -> Map DefinitionId v Source #
type HasSchemaDefinition t ts = HasSchemaDefinition' t ts ts Source #
A constraint that checks if a schema definition is present in a list of schema definitions. Gives a user-friendly error message if the schema definition is not found.
type family HasSchemaDefinition' n xs xs0 where ... Source #
HasSchemaDefinition' x (x ': xs) _ = () | |
HasSchemaDefinition' x (_ ': xs) xs0 = HasSchemaDefinition' x xs xs0 | |
HasSchemaDefinition' n xs xs0 = TypeError ((ShowType n :<>: Text " type was not found in the list of types having schema definitions: ") :<>: ShowType xs0) |