Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- data Schema (referencedTypes :: [Type])
- = SchemaInteger SchemaInfo IntegerSchema
- | SchemaBytes SchemaInfo BytesSchema
- | SchemaList SchemaInfo (ListSchema referencedTypes)
- | SchemaMap SchemaInfo (MapSchema referencedTypes)
- | SchemaConstructor SchemaInfo (ConstructorSchema referencedTypes)
- | SchemaBuiltInData SchemaInfo
- | SchemaBuiltInUnit SchemaInfo
- | SchemaBuiltInBoolean SchemaInfo
- | SchemaBuiltInInteger SchemaInfo
- | SchemaBuiltInBytes SchemaInfo
- | SchemaBuiltInString SchemaInfo
- | SchemaBuiltInPair SchemaInfo (PairSchema referencedTypes)
- | SchemaBuiltInList SchemaInfo (Schema referencedTypes)
- | SchemaOneOf (NonEmpty (Schema referencedTypes))
- | SchemaAnyOf (NonEmpty (Schema referencedTypes))
- | SchemaAllOf (NonEmpty (Schema referencedTypes))
- | SchemaNot (Schema referencedTypes)
- | SchemaDefinitionRef DefinitionId
- withSchemaInfo :: (SchemaInfo -> SchemaInfo) -> Schema referencedTypes -> Schema referencedTypes
- data IntegerSchema = MkIntegerSchema {}
- emptyIntegerSchema :: IntegerSchema
- data BytesSchema = MkBytesSchema {}
- emptyBytesSchema :: BytesSchema
- data ListSchema (referencedTypes :: [Type]) = MkListSchema {}
- mkListSchema :: Schema referencedTypes -> ListSchema referencedTypes
- data MapSchema (referencedTypes :: [Type]) = MkMapSchema {}
- data ConstructorSchema (referencedTypes :: [Type]) = MkConstructorSchema {
- index :: Natural
- fieldSchemas :: [Schema referencedTypes]
- data PairSchema (referencedTypes :: [Type]) = MkPairSchema {}
Documentation
data Schema (referencedTypes :: [Type]) Source #
Blueprint schema definition, as defined by the CIP-0057: https://github.com/cardano-foundation/CIPs/tree/master/CIP-0057#core-vocabulary
The referencedTypes
phantom type parameter is used to track the types used in the contract
making sure their schemas are included in the blueprint and that they are referenced
in a type-safe way.
SchemaInteger SchemaInfo IntegerSchema | |
SchemaBytes SchemaInfo BytesSchema | |
SchemaList SchemaInfo (ListSchema referencedTypes) | |
SchemaMap SchemaInfo (MapSchema referencedTypes) | |
SchemaConstructor SchemaInfo (ConstructorSchema referencedTypes) | |
SchemaBuiltInData SchemaInfo | |
SchemaBuiltInUnit SchemaInfo | |
SchemaBuiltInBoolean SchemaInfo | |
SchemaBuiltInInteger SchemaInfo | |
SchemaBuiltInBytes SchemaInfo | |
SchemaBuiltInString SchemaInfo | |
SchemaBuiltInPair SchemaInfo (PairSchema referencedTypes) | |
SchemaBuiltInList SchemaInfo (Schema referencedTypes) | |
SchemaOneOf (NonEmpty (Schema referencedTypes)) | |
SchemaAnyOf (NonEmpty (Schema referencedTypes)) | |
SchemaAllOf (NonEmpty (Schema referencedTypes)) | |
SchemaNot (Schema referencedTypes) | |
SchemaDefinitionRef DefinitionId |
Instances
withSchemaInfo :: (SchemaInfo -> SchemaInfo) -> Schema referencedTypes -> Schema referencedTypes Source #
data IntegerSchema Source #
MkIntegerSchema | |
|
Instances
data BytesSchema Source #
MkBytesSchema | |
|
Instances
data ListSchema (referencedTypes :: [Type]) Source #
MkListSchema | |
|
Instances
Typeable referencedTypes => Data (ListSchema referencedTypes) Source # | |
Defined in PlutusTx.Blueprint.Schema gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> ListSchema referencedTypes -> c (ListSchema referencedTypes) Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (ListSchema referencedTypes) Source # toConstr :: ListSchema referencedTypes -> Constr Source # dataTypeOf :: ListSchema referencedTypes -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (ListSchema referencedTypes)) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (ListSchema referencedTypes)) Source # gmapT :: (forall b. Data b => b -> b) -> ListSchema referencedTypes -> ListSchema referencedTypes Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> ListSchema referencedTypes -> r Source # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> ListSchema referencedTypes -> r Source # gmapQ :: (forall d. Data d => d -> u) -> ListSchema referencedTypes -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> ListSchema referencedTypes -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> ListSchema referencedTypes -> m (ListSchema referencedTypes) Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> ListSchema referencedTypes -> m (ListSchema referencedTypes) Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> ListSchema referencedTypes -> m (ListSchema referencedTypes) Source # | |
Generic (ListSchema referencedTypes) Source # | |
Defined in PlutusTx.Blueprint.Schema from :: ListSchema referencedTypes -> Rep (ListSchema referencedTypes) x Source # to :: Rep (ListSchema referencedTypes) x -> ListSchema referencedTypes Source # | |
Show (ListSchema referencedTypes) Source # | |
Defined in PlutusTx.Blueprint.Schema | |
Eq (ListSchema referencedTypes) Source # | |
Defined in PlutusTx.Blueprint.Schema (==) :: ListSchema referencedTypes -> ListSchema referencedTypes -> Bool Source # (/=) :: ListSchema referencedTypes -> ListSchema referencedTypes -> Bool Source # | |
Ord (ListSchema referencedTypes) Source # | |
Defined in PlutusTx.Blueprint.Schema compare :: ListSchema referencedTypes -> ListSchema referencedTypes -> Ordering Source # (<) :: ListSchema referencedTypes -> ListSchema referencedTypes -> Bool Source # (<=) :: ListSchema referencedTypes -> ListSchema referencedTypes -> Bool Source # (>) :: ListSchema referencedTypes -> ListSchema referencedTypes -> Bool Source # (>=) :: ListSchema referencedTypes -> ListSchema referencedTypes -> Bool Source # max :: ListSchema referencedTypes -> ListSchema referencedTypes -> ListSchema referencedTypes Source # min :: ListSchema referencedTypes -> ListSchema referencedTypes -> ListSchema referencedTypes Source # | |
type Rep (ListSchema referencedTypes) Source # | |
Defined in PlutusTx.Blueprint.Schema type Rep (ListSchema referencedTypes) = D1 ('MetaData "ListSchema" "PlutusTx.Blueprint.Schema" "plutus-tx-1.36.0.0-8y1X6QaF1WM5mIhDTsyzym" 'False) (C1 ('MetaCons "MkListSchema" 'PrefixI 'True) ((S1 ('MetaSel ('Just "itemSchema") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Schema referencedTypes)) :*: S1 ('MetaSel ('Just "minItems") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Natural))) :*: (S1 ('MetaSel ('Just "maxItems") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Natural)) :*: S1 ('MetaSel ('Just "uniqueItems") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Bool))))) |
mkListSchema :: Schema referencedTypes -> ListSchema referencedTypes Source #
data MapSchema (referencedTypes :: [Type]) Source #
Instances
Typeable referencedTypes => Data (MapSchema referencedTypes) Source # | |
Defined in PlutusTx.Blueprint.Schema gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> MapSchema referencedTypes -> c (MapSchema referencedTypes) Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (MapSchema referencedTypes) Source # toConstr :: MapSchema referencedTypes -> Constr Source # dataTypeOf :: MapSchema referencedTypes -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (MapSchema referencedTypes)) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (MapSchema referencedTypes)) Source # gmapT :: (forall b. Data b => b -> b) -> MapSchema referencedTypes -> MapSchema referencedTypes Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> MapSchema referencedTypes -> r Source # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> MapSchema referencedTypes -> r Source # gmapQ :: (forall d. Data d => d -> u) -> MapSchema referencedTypes -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> MapSchema referencedTypes -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> MapSchema referencedTypes -> m (MapSchema referencedTypes) Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> MapSchema referencedTypes -> m (MapSchema referencedTypes) Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> MapSchema referencedTypes -> m (MapSchema referencedTypes) Source # | |
Generic (MapSchema referencedTypes) Source # | |
Show (MapSchema referencedTypes) Source # | |
Eq (MapSchema referencedTypes) Source # | |
Ord (MapSchema referencedTypes) Source # | |
Defined in PlutusTx.Blueprint.Schema compare :: MapSchema referencedTypes -> MapSchema referencedTypes -> Ordering Source # (<) :: MapSchema referencedTypes -> MapSchema referencedTypes -> Bool Source # (<=) :: MapSchema referencedTypes -> MapSchema referencedTypes -> Bool Source # (>) :: MapSchema referencedTypes -> MapSchema referencedTypes -> Bool Source # (>=) :: MapSchema referencedTypes -> MapSchema referencedTypes -> Bool Source # max :: MapSchema referencedTypes -> MapSchema referencedTypes -> MapSchema referencedTypes Source # min :: MapSchema referencedTypes -> MapSchema referencedTypes -> MapSchema referencedTypes Source # | |
type Rep (MapSchema referencedTypes) Source # | |
Defined in PlutusTx.Blueprint.Schema type Rep (MapSchema referencedTypes) = D1 ('MetaData "MapSchema" "PlutusTx.Blueprint.Schema" "plutus-tx-1.36.0.0-8y1X6QaF1WM5mIhDTsyzym" 'False) (C1 ('MetaCons "MkMapSchema" 'PrefixI 'True) ((S1 ('MetaSel ('Just "keySchema") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Schema referencedTypes)) :*: S1 ('MetaSel ('Just "valueSchema") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Schema referencedTypes))) :*: (S1 ('MetaSel ('Just "minItems") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Natural)) :*: S1 ('MetaSel ('Just "maxItems") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Natural))))) |
data ConstructorSchema (referencedTypes :: [Type]) Source #
MkConstructorSchema | |
|
Instances
Typeable referencedTypes => Data (ConstructorSchema referencedTypes) Source # | |
Defined in PlutusTx.Blueprint.Schema gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> ConstructorSchema referencedTypes -> c (ConstructorSchema referencedTypes) Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (ConstructorSchema referencedTypes) Source # toConstr :: ConstructorSchema referencedTypes -> Constr Source # dataTypeOf :: ConstructorSchema referencedTypes -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (ConstructorSchema referencedTypes)) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (ConstructorSchema referencedTypes)) Source # gmapT :: (forall b. Data b => b -> b) -> ConstructorSchema referencedTypes -> ConstructorSchema referencedTypes Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> ConstructorSchema referencedTypes -> r Source # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> ConstructorSchema referencedTypes -> r Source # gmapQ :: (forall d. Data d => d -> u) -> ConstructorSchema referencedTypes -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> ConstructorSchema referencedTypes -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> ConstructorSchema referencedTypes -> m (ConstructorSchema referencedTypes) Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> ConstructorSchema referencedTypes -> m (ConstructorSchema referencedTypes) Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> ConstructorSchema referencedTypes -> m (ConstructorSchema referencedTypes) Source # | |
Generic (ConstructorSchema referencedTypes) Source # | |
Defined in PlutusTx.Blueprint.Schema from :: ConstructorSchema referencedTypes -> Rep (ConstructorSchema referencedTypes) x Source # to :: Rep (ConstructorSchema referencedTypes) x -> ConstructorSchema referencedTypes Source # | |
Show (ConstructorSchema referencedTypes) Source # | |
Defined in PlutusTx.Blueprint.Schema | |
Eq (ConstructorSchema referencedTypes) Source # | |
Defined in PlutusTx.Blueprint.Schema (==) :: ConstructorSchema referencedTypes -> ConstructorSchema referencedTypes -> Bool Source # (/=) :: ConstructorSchema referencedTypes -> ConstructorSchema referencedTypes -> Bool Source # | |
Ord (ConstructorSchema referencedTypes) Source # | |
Defined in PlutusTx.Blueprint.Schema compare :: ConstructorSchema referencedTypes -> ConstructorSchema referencedTypes -> Ordering Source # (<) :: ConstructorSchema referencedTypes -> ConstructorSchema referencedTypes -> Bool Source # (<=) :: ConstructorSchema referencedTypes -> ConstructorSchema referencedTypes -> Bool Source # (>) :: ConstructorSchema referencedTypes -> ConstructorSchema referencedTypes -> Bool Source # (>=) :: ConstructorSchema referencedTypes -> ConstructorSchema referencedTypes -> Bool Source # max :: ConstructorSchema referencedTypes -> ConstructorSchema referencedTypes -> ConstructorSchema referencedTypes Source # min :: ConstructorSchema referencedTypes -> ConstructorSchema referencedTypes -> ConstructorSchema referencedTypes Source # | |
type Rep (ConstructorSchema referencedTypes) Source # | |
Defined in PlutusTx.Blueprint.Schema type Rep (ConstructorSchema referencedTypes) = D1 ('MetaData "ConstructorSchema" "PlutusTx.Blueprint.Schema" "plutus-tx-1.36.0.0-8y1X6QaF1WM5mIhDTsyzym" 'False) (C1 ('MetaCons "MkConstructorSchema" 'PrefixI 'True) (S1 ('MetaSel ('Just "index") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Natural) :*: S1 ('MetaSel ('Just "fieldSchemas") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [Schema referencedTypes]))) |
data PairSchema (referencedTypes :: [Type]) Source #
Instances
Typeable referencedTypes => Data (PairSchema referencedTypes) Source # | |
Defined in PlutusTx.Blueprint.Schema gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> PairSchema referencedTypes -> c (PairSchema referencedTypes) Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (PairSchema referencedTypes) Source # toConstr :: PairSchema referencedTypes -> Constr Source # dataTypeOf :: PairSchema referencedTypes -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (PairSchema referencedTypes)) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (PairSchema referencedTypes)) Source # gmapT :: (forall b. Data b => b -> b) -> PairSchema referencedTypes -> PairSchema referencedTypes Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> PairSchema referencedTypes -> r Source # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> PairSchema referencedTypes -> r Source # gmapQ :: (forall d. Data d => d -> u) -> PairSchema referencedTypes -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> PairSchema referencedTypes -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> PairSchema referencedTypes -> m (PairSchema referencedTypes) Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> PairSchema referencedTypes -> m (PairSchema referencedTypes) Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> PairSchema referencedTypes -> m (PairSchema referencedTypes) Source # | |
Generic (PairSchema referencedTypes) Source # | |
Defined in PlutusTx.Blueprint.Schema from :: PairSchema referencedTypes -> Rep (PairSchema referencedTypes) x Source # to :: Rep (PairSchema referencedTypes) x -> PairSchema referencedTypes Source # | |
Show (PairSchema referencedTypes) Source # | |
Defined in PlutusTx.Blueprint.Schema | |
Eq (PairSchema referencedTypes) Source # | |
Defined in PlutusTx.Blueprint.Schema (==) :: PairSchema referencedTypes -> PairSchema referencedTypes -> Bool Source # (/=) :: PairSchema referencedTypes -> PairSchema referencedTypes -> Bool Source # | |
Ord (PairSchema referencedTypes) Source # | |
Defined in PlutusTx.Blueprint.Schema compare :: PairSchema referencedTypes -> PairSchema referencedTypes -> Ordering Source # (<) :: PairSchema referencedTypes -> PairSchema referencedTypes -> Bool Source # (<=) :: PairSchema referencedTypes -> PairSchema referencedTypes -> Bool Source # (>) :: PairSchema referencedTypes -> PairSchema referencedTypes -> Bool Source # (>=) :: PairSchema referencedTypes -> PairSchema referencedTypes -> Bool Source # max :: PairSchema referencedTypes -> PairSchema referencedTypes -> PairSchema referencedTypes Source # min :: PairSchema referencedTypes -> PairSchema referencedTypes -> PairSchema referencedTypes Source # | |
type Rep (PairSchema referencedTypes) Source # | |
Defined in PlutusTx.Blueprint.Schema type Rep (PairSchema referencedTypes) = D1 ('MetaData "PairSchema" "PlutusTx.Blueprint.Schema" "plutus-tx-1.36.0.0-8y1X6QaF1WM5mIhDTsyzym" 'False) (C1 ('MetaCons "MkPairSchema" 'PrefixI 'True) (S1 ('MetaSel ('Just "left") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Schema referencedTypes)) :*: S1 ('MetaSel ('Just "right") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Schema referencedTypes)))) |