Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Module that defines Expression type, its related types and its JSON instance.
Synopsis
- data Exp x where
- ExpInt (XExpInt x) Integer
- ExpString (XExpString x) Text
- ExpBytes (XExpBytes x) ByteString
- ExpSeq (XExpSeq x) [Exp x]
- ExpPrim (XExpPrim x) (MichelinePrimAp x)
- ExpX (XExp x)
- pattern ExpPrim' :: XExpPrim x -> MichelinePrimitive -> [Exp x] -> [Annotation] -> Exp x
- expressionInt :: Integer -> Expression
- expressionString :: Text -> Expression
- expressionBytes :: ByteString -> Expression
- expressionSeq :: [Expression] -> Expression
- expressionPrim :: MichelinePrimAp RegularExp -> Expression
- expressionPrim' :: MichelinePrimitive -> [Expression] -> [Annotation] -> Expression
- data RegularExp :: ExpExtensionDescriptorKind
- type Expression = Exp RegularExp
- data MichelinePrimAp x = MichelinePrimAp {
- mpaPrim :: MichelinePrimitive
- mpaArgs :: [Exp x]
- mpaAnnots :: [Annotation]
- data MichelinePrimitive
- = Prim_parameter
- | Prim_storage
- | Prim_code
- | Prim_False
- | Prim_Elt
- | Prim_Left
- | Prim_None
- | Prim_Pair
- | Prim_Right
- | Prim_Some
- | Prim_True
- | Prim_Unit
- | Prim_PACK
- | Prim_UNPACK
- | Prim_BLAKE2B
- | Prim_SHA256
- | Prim_SHA512
- | Prim_ABS
- | Prim_ADD
- | Prim_AMOUNT
- | Prim_AND
- | Prim_BALANCE
- | Prim_CAR
- | Prim_CDR
- | Prim_CHECK_SIGNATURE
- | Prim_COMPARE
- | Prim_CONCAT
- | Prim_CONS
- | Prim_CREATE_ACCOUNT
- | Prim_CREATE_CONTRACT
- | Prim_IMPLICIT_ACCOUNT
- | Prim_DIP
- | Prim_DROP
- | Prim_DUP
- | Prim_EDIV
- | Prim_EMPTY_MAP
- | Prim_EMPTY_SET
- | Prim_EQ
- | Prim_EXEC
- | Prim_FAILWITH
- | Prim_GE
- | Prim_GET
- | Prim_GT
- | Prim_HASH_KEY
- | Prim_IF
- | Prim_IF_CONS
- | Prim_IF_LEFT
- | Prim_IF_NONE
- | Prim_INT
- | Prim_LAMBDA
- | Prim_LE
- | Prim_LEFT
- | Prim_LOOP
- | Prim_LSL
- | Prim_LSR
- | Prim_LT
- | Prim_MAP
- | Prim_MEM
- | Prim_MUL
- | Prim_NEG
- | Prim_NEQ
- | Prim_NIL
- | Prim_NONE
- | Prim_NOT
- | Prim_NOW
- | Prim_OR
- | Prim_PAIR
- | Prim_PUSH
- | Prim_RIGHT
- | Prim_SIZE
- | Prim_SOME
- | Prim_SOURCE
- | Prim_SENDER
- | Prim_SELF
- | Prim_STEPS_TO_QUOTA
- | Prim_SUB
- | Prim_SWAP
- | Prim_TRANSFER_TOKENS
- | Prim_SET_DELEGATE
- | Prim_UNIT
- | Prim_UPDATE
- | Prim_XOR
- | Prim_ITER
- | Prim_LOOP_LEFT
- | Prim_ADDRESS
- | Prim_CONTRACT
- | Prim_ISNAT
- | Prim_CAST
- | Prim_RENAME
- | Prim_bool
- | Prim_contract
- | Prim_int
- | Prim_key
- | Prim_key_hash
- | Prim_lambda
- | Prim_list
- | Prim_map
- | Prim_big_map
- | Prim_nat
- | Prim_option
- | Prim_or
- | Prim_pair
- | Prim_set
- | Prim_signature
- | Prim_string
- | Prim_bytes
- | Prim_mutez
- | Prim_timestamp
- | Prim_unit
- | Prim_operation
- | Prim_address
- | Prim_SLICE
- | Prim_DIG
- | Prim_DUG
- | Prim_EMPTY_BIG_MAP
- | Prim_APPLY
- | Prim_chain_id
- | Prim_CHAIN_ID
- | Prim_LEVEL
- | Prim_SELF_ADDRESS
- | Prim_never
- | Prim_NEVER
- | Prim_UNPAIR
- | Prim_VOTING_POWER
- | Prim_TOTAL_VOTING_POWER
- | Prim_KECCAK
- | Prim_SHA3
- | Prim_PAIRING_CHECK
- | Prim_bls12_381_g1
- | Prim_bls12_381_g2
- | Prim_bls12_381_fr
- | Prim_sapling_state
- | Prim_sapling_transaction_deprecated
- | Prim_SAPLING_EMPTY_STATE
- | Prim_SAPLING_VERIFY_UPDATE
- | Prim_ticket
- | Prim_TICKET_DEPRECATED
- | Prim_READ_TICKET
- | Prim_SPLIT_TICKET
- | Prim_JOIN_TICKETS
- | Prim_GET_AND_UPDATE
- | Prim_chest
- | Prim_chest_key
- | Prim_OPEN_CHEST
- | Prim_VIEW
- | Prim_view
- | Prim_constant
- | Prim_SUB_MUTEZ
- | Prim_tx_rollup_l2_address
- | Prim_MIN_BLOCK_TIME
- | Prim_sapling_transaction
- | Prim_EMIT
- | Prim_Lambda_rec
- | Prim_LAMBDA_REC
- | Prim_TICKET
- | Prim_BYTES
- | Prim_NAT
- data MichelinePrimitiveTag
- data SingMichelinePrimitiveTag :: MichelinePrimitiveTag -> Type where
- SMPTKeyword :: SingMichelinePrimitiveTag ('MPTKeyword :: MichelinePrimitiveTag)
- SMPTInstr :: SingMichelinePrimitiveTag ('MPTInstr :: MichelinePrimitiveTag)
- SMPTValue :: SingMichelinePrimitiveTag ('MPTValue :: MichelinePrimitiveTag)
- SMPTType :: SingMichelinePrimitiveTag ('MPTType :: MichelinePrimitiveTag)
- SMPTRemoved :: SingMichelinePrimitiveTag ('MPTRemoved :: MichelinePrimitiveTag)
- SMPTConstant :: SingMichelinePrimitiveTag ('MPTConstant :: MichelinePrimitiveTag)
- data ClassifiedMichelinePrimitive (tag :: MichelinePrimitiveTag) where
- C_Prim_parameter :: ClassifiedMichelinePrimitive 'MPTKeyword
- C_Prim_storage :: ClassifiedMichelinePrimitive 'MPTKeyword
- C_Prim_code :: ClassifiedMichelinePrimitive 'MPTKeyword
- C_Prim_False :: ClassifiedMichelinePrimitive 'MPTValue
- C_Prim_Elt :: ClassifiedMichelinePrimitive 'MPTValue
- C_Prim_Left :: ClassifiedMichelinePrimitive 'MPTValue
- C_Prim_None :: ClassifiedMichelinePrimitive 'MPTValue
- C_Prim_Pair :: ClassifiedMichelinePrimitive 'MPTValue
- C_Prim_Right :: ClassifiedMichelinePrimitive 'MPTValue
- C_Prim_Some :: ClassifiedMichelinePrimitive 'MPTValue
- C_Prim_True :: ClassifiedMichelinePrimitive 'MPTValue
- C_Prim_Unit :: ClassifiedMichelinePrimitive 'MPTValue
- C_Prim_PACK :: ClassifiedMichelinePrimitive 'MPTInstr
- C_Prim_UNPACK :: ClassifiedMichelinePrimitive 'MPTInstr
- C_Prim_BLAKE2B :: ClassifiedMichelinePrimitive 'MPTInstr
- C_Prim_SHA256 :: ClassifiedMichelinePrimitive 'MPTInstr
- C_Prim_SHA512 :: ClassifiedMichelinePrimitive 'MPTInstr
- C_Prim_ABS :: ClassifiedMichelinePrimitive 'MPTInstr
- C_Prim_ADD :: ClassifiedMichelinePrimitive 'MPTInstr
- C_Prim_AMOUNT :: ClassifiedMichelinePrimitive 'MPTInstr
- C_Prim_AND :: ClassifiedMichelinePrimitive 'MPTInstr
- C_Prim_BALANCE :: ClassifiedMichelinePrimitive 'MPTInstr
- C_Prim_CAR :: ClassifiedMichelinePrimitive 'MPTInstr
- C_Prim_CDR :: ClassifiedMichelinePrimitive 'MPTInstr
- C_Prim_CHECK_SIGNATURE :: ClassifiedMichelinePrimitive 'MPTInstr
- C_Prim_COMPARE :: ClassifiedMichelinePrimitive 'MPTInstr
- C_Prim_CONCAT :: ClassifiedMichelinePrimitive 'MPTInstr
- C_Prim_CONS :: ClassifiedMichelinePrimitive 'MPTInstr
- C_Prim_CREATE_ACCOUNT :: ClassifiedMichelinePrimitive 'MPTRemoved
- C_Prim_CREATE_CONTRACT :: ClassifiedMichelinePrimitive 'MPTInstr
- C_Prim_IMPLICIT_ACCOUNT :: ClassifiedMichelinePrimitive 'MPTInstr
- C_Prim_DIP :: ClassifiedMichelinePrimitive 'MPTInstr
- C_Prim_DROP :: ClassifiedMichelinePrimitive 'MPTInstr
- C_Prim_DUP :: ClassifiedMichelinePrimitive 'MPTInstr
- C_Prim_EDIV :: ClassifiedMichelinePrimitive 'MPTInstr
- C_Prim_EMPTY_MAP :: ClassifiedMichelinePrimitive 'MPTInstr
- C_Prim_EMPTY_SET :: ClassifiedMichelinePrimitive 'MPTInstr
- C_Prim_EQ :: ClassifiedMichelinePrimitive 'MPTInstr
- C_Prim_EXEC :: ClassifiedMichelinePrimitive 'MPTInstr
- C_Prim_FAILWITH :: ClassifiedMichelinePrimitive 'MPTInstr
- C_Prim_GE :: ClassifiedMichelinePrimitive 'MPTInstr
- C_Prim_GET :: ClassifiedMichelinePrimitive 'MPTInstr
- C_Prim_GT :: ClassifiedMichelinePrimitive 'MPTInstr
- C_Prim_HASH_KEY :: ClassifiedMichelinePrimitive 'MPTInstr
- C_Prim_IF :: ClassifiedMichelinePrimitive 'MPTInstr
- C_Prim_IF_CONS :: ClassifiedMichelinePrimitive 'MPTInstr
- C_Prim_IF_LEFT :: ClassifiedMichelinePrimitive 'MPTInstr
- C_Prim_IF_NONE :: ClassifiedMichelinePrimitive 'MPTInstr
- C_Prim_INT :: ClassifiedMichelinePrimitive 'MPTInstr
- C_Prim_LAMBDA :: ClassifiedMichelinePrimitive 'MPTInstr
- C_Prim_LE :: ClassifiedMichelinePrimitive 'MPTInstr
- C_Prim_LEFT :: ClassifiedMichelinePrimitive 'MPTInstr
- C_Prim_LOOP :: ClassifiedMichelinePrimitive 'MPTInstr
- C_Prim_LSL :: ClassifiedMichelinePrimitive 'MPTInstr
- C_Prim_LSR :: ClassifiedMichelinePrimitive 'MPTInstr
- C_Prim_LT :: ClassifiedMichelinePrimitive 'MPTInstr
- C_Prim_MAP :: ClassifiedMichelinePrimitive 'MPTInstr
- C_Prim_MEM :: ClassifiedMichelinePrimitive 'MPTInstr
- C_Prim_MUL :: ClassifiedMichelinePrimitive 'MPTInstr
- C_Prim_NEG :: ClassifiedMichelinePrimitive 'MPTInstr
- C_Prim_NEQ :: ClassifiedMichelinePrimitive 'MPTInstr
- C_Prim_NIL :: ClassifiedMichelinePrimitive 'MPTInstr
- C_Prim_NONE :: ClassifiedMichelinePrimitive 'MPTInstr
- C_Prim_NOT :: ClassifiedMichelinePrimitive 'MPTInstr
- C_Prim_NOW :: ClassifiedMichelinePrimitive 'MPTInstr
- C_Prim_OR :: ClassifiedMichelinePrimitive 'MPTInstr
- C_Prim_PAIR :: ClassifiedMichelinePrimitive 'MPTInstr
- C_Prim_PUSH :: ClassifiedMichelinePrimitive 'MPTInstr
- C_Prim_RIGHT :: ClassifiedMichelinePrimitive 'MPTInstr
- C_Prim_SIZE :: ClassifiedMichelinePrimitive 'MPTInstr
- C_Prim_SOME :: ClassifiedMichelinePrimitive 'MPTInstr
- C_Prim_SOURCE :: ClassifiedMichelinePrimitive 'MPTInstr
- C_Prim_SENDER :: ClassifiedMichelinePrimitive 'MPTInstr
- C_Prim_SELF :: ClassifiedMichelinePrimitive 'MPTInstr
- C_Prim_STEPS_TO_QUOTA :: ClassifiedMichelinePrimitive 'MPTRemoved
- C_Prim_SUB :: ClassifiedMichelinePrimitive 'MPTInstr
- C_Prim_SWAP :: ClassifiedMichelinePrimitive 'MPTInstr
- C_Prim_TRANSFER_TOKENS :: ClassifiedMichelinePrimitive 'MPTInstr
- C_Prim_SET_DELEGATE :: ClassifiedMichelinePrimitive 'MPTInstr
- C_Prim_UNIT :: ClassifiedMichelinePrimitive 'MPTInstr
- C_Prim_UPDATE :: ClassifiedMichelinePrimitive 'MPTInstr
- C_Prim_XOR :: ClassifiedMichelinePrimitive 'MPTInstr
- C_Prim_ITER :: ClassifiedMichelinePrimitive 'MPTInstr
- C_Prim_LOOP_LEFT :: ClassifiedMichelinePrimitive 'MPTInstr
- C_Prim_ADDRESS :: ClassifiedMichelinePrimitive 'MPTInstr
- C_Prim_CONTRACT :: ClassifiedMichelinePrimitive 'MPTInstr
- C_Prim_ISNAT :: ClassifiedMichelinePrimitive 'MPTInstr
- C_Prim_CAST :: ClassifiedMichelinePrimitive 'MPTInstr
- C_Prim_RENAME :: ClassifiedMichelinePrimitive 'MPTInstr
- C_Prim_bool :: ClassifiedMichelinePrimitive 'MPTType
- C_Prim_contract :: ClassifiedMichelinePrimitive 'MPTType
- C_Prim_int :: ClassifiedMichelinePrimitive 'MPTType
- C_Prim_key :: ClassifiedMichelinePrimitive 'MPTType
- C_Prim_key_hash :: ClassifiedMichelinePrimitive 'MPTType
- C_Prim_lambda :: ClassifiedMichelinePrimitive 'MPTType
- C_Prim_list :: ClassifiedMichelinePrimitive 'MPTType
- C_Prim_map :: ClassifiedMichelinePrimitive 'MPTType
- C_Prim_big_map :: ClassifiedMichelinePrimitive 'MPTType
- C_Prim_nat :: ClassifiedMichelinePrimitive 'MPTType
- C_Prim_option :: ClassifiedMichelinePrimitive 'MPTType
- C_Prim_or :: ClassifiedMichelinePrimitive 'MPTType
- C_Prim_pair :: ClassifiedMichelinePrimitive 'MPTType
- C_Prim_set :: ClassifiedMichelinePrimitive 'MPTType
- C_Prim_signature :: ClassifiedMichelinePrimitive 'MPTType
- C_Prim_string :: ClassifiedMichelinePrimitive 'MPTType
- C_Prim_bytes :: ClassifiedMichelinePrimitive 'MPTType
- C_Prim_mutez :: ClassifiedMichelinePrimitive 'MPTType
- C_Prim_timestamp :: ClassifiedMichelinePrimitive 'MPTType
- C_Prim_unit :: ClassifiedMichelinePrimitive 'MPTType
- C_Prim_operation :: ClassifiedMichelinePrimitive 'MPTType
- C_Prim_address :: ClassifiedMichelinePrimitive 'MPTType
- C_Prim_SLICE :: ClassifiedMichelinePrimitive 'MPTInstr
- C_Prim_DIG :: ClassifiedMichelinePrimitive 'MPTInstr
- C_Prim_DUG :: ClassifiedMichelinePrimitive 'MPTInstr
- C_Prim_EMPTY_BIG_MAP :: ClassifiedMichelinePrimitive 'MPTInstr
- C_Prim_APPLY :: ClassifiedMichelinePrimitive 'MPTInstr
- C_Prim_chain_id :: ClassifiedMichelinePrimitive 'MPTType
- C_Prim_CHAIN_ID :: ClassifiedMichelinePrimitive 'MPTInstr
- C_Prim_LEVEL :: ClassifiedMichelinePrimitive 'MPTInstr
- C_Prim_SELF_ADDRESS :: ClassifiedMichelinePrimitive 'MPTInstr
- C_Prim_never :: ClassifiedMichelinePrimitive 'MPTType
- C_Prim_NEVER :: ClassifiedMichelinePrimitive 'MPTInstr
- C_Prim_UNPAIR :: ClassifiedMichelinePrimitive 'MPTInstr
- C_Prim_VOTING_POWER :: ClassifiedMichelinePrimitive 'MPTInstr
- C_Prim_TOTAL_VOTING_POWER :: ClassifiedMichelinePrimitive 'MPTInstr
- C_Prim_KECCAK :: ClassifiedMichelinePrimitive 'MPTInstr
- C_Prim_SHA3 :: ClassifiedMichelinePrimitive 'MPTInstr
- C_Prim_PAIRING_CHECK :: ClassifiedMichelinePrimitive 'MPTInstr
- C_Prim_bls12_381_g1 :: ClassifiedMichelinePrimitive 'MPTType
- C_Prim_bls12_381_g2 :: ClassifiedMichelinePrimitive 'MPTType
- C_Prim_bls12_381_fr :: ClassifiedMichelinePrimitive 'MPTType
- C_Prim_sapling_state :: ClassifiedMichelinePrimitive 'MPTType
- C_Prim_sapling_transaction_deprecated :: ClassifiedMichelinePrimitive 'MPTType
- C_Prim_SAPLING_EMPTY_STATE :: ClassifiedMichelinePrimitive 'MPTInstr
- C_Prim_SAPLING_VERIFY_UPDATE :: ClassifiedMichelinePrimitive 'MPTInstr
- C_Prim_ticket :: ClassifiedMichelinePrimitive 'MPTType
- C_Prim_TICKET_DEPRECATED :: ClassifiedMichelinePrimitive 'MPTInstr
- C_Prim_READ_TICKET :: ClassifiedMichelinePrimitive 'MPTInstr
- C_Prim_SPLIT_TICKET :: ClassifiedMichelinePrimitive 'MPTInstr
- C_Prim_JOIN_TICKETS :: ClassifiedMichelinePrimitive 'MPTInstr
- C_Prim_GET_AND_UPDATE :: ClassifiedMichelinePrimitive 'MPTInstr
- C_Prim_chest :: ClassifiedMichelinePrimitive 'MPTType
- C_Prim_chest_key :: ClassifiedMichelinePrimitive 'MPTType
- C_Prim_OPEN_CHEST :: ClassifiedMichelinePrimitive 'MPTInstr
- C_Prim_VIEW :: ClassifiedMichelinePrimitive 'MPTInstr
- C_Prim_view :: ClassifiedMichelinePrimitive 'MPTKeyword
- C_Prim_constant :: ClassifiedMichelinePrimitive 'MPTConstant
- C_Prim_SUB_MUTEZ :: ClassifiedMichelinePrimitive 'MPTInstr
- C_Prim_tx_rollup_l2_address :: ClassifiedMichelinePrimitive 'MPTType
- C_Prim_MIN_BLOCK_TIME :: ClassifiedMichelinePrimitive 'MPTInstr
- C_Prim_sapling_transaction :: ClassifiedMichelinePrimitive 'MPTType
- C_Prim_EMIT :: ClassifiedMichelinePrimitive 'MPTInstr
- C_Prim_Lambda_rec :: ClassifiedMichelinePrimitive 'MPTValue
- C_Prim_LAMBDA_REC :: ClassifiedMichelinePrimitive 'MPTInstr
- C_Prim_TICKET :: ClassifiedMichelinePrimitive 'MPTInstr
- C_Prim_BYTES :: ClassifiedMichelinePrimitive 'MPTInstr
- C_Prim_NAT :: ClassifiedMichelinePrimitive 'MPTInstr
- withClassifiedPrim :: MichelinePrimitive -> (forall tag. Sing tag -> ClassifiedMichelinePrimitive tag -> r) -> r
- type ExpExtensionDescriptorKind = ExpExtensionTag -> Type
- class ExpExtensionDescriptor (x :: ExpExtensionDescriptorKind) where
- type ExpExtrasConstrained c x = Each '[c] [XExpInt x, XExpString x, XExpBytes x, XExpSeq x, XExpPrim x]
- type ExpAllExtrasConstrainted c x = (ExpExtrasConstrained c x, c (XExp x))
- data ExpExtras f x = ExpExtras {}
- mkUniformExpExtras :: (extra ~ XExpInt x, extra ~ XExpString x, extra ~ XExpBytes x, extra ~ XExpSeq x, extra ~ XExpPrim x) => f extra -> ExpExtras f x
- hoistExpExtras :: (forall extra. f1 extra -> f2 extra) -> ExpExtras f1 x -> ExpExtras f2 x
- data Annotation
- annotToText :: Annotation -> Text
- annotFromText :: forall m. MonadFail m => Text -> m Annotation
- isAnnotationField :: Annotation -> Bool
- isAnnotationType :: Annotation -> Bool
- isAnnotationVariable :: Annotation -> Bool
- isNoAnn :: Annotation -> Bool
- mkAnns :: [TypeAnn] -> [FieldAnn] -> [VarAnn] -> [Annotation]
- toAnnSet :: [Annotation] -> AnnotationSet
- mkAnnsFromAny :: [AnyAnn] -> [Annotation]
- _ExpInt :: forall x. Prism' (Exp x) (XExpInt x, Integer)
- _ExpString :: forall x. Prism' (Exp x) (XExpString x, Text)
- _ExpBytes :: forall x. Prism' (Exp x) (XExpBytes x, ByteString)
- _ExpSeq :: forall x. Prism' (Exp x) (XExpSeq x, [Exp x])
- _ExpPrim :: forall x. Prism' (Exp x) (XExpPrim x, MichelinePrimAp x)
- _ExpressionInt :: Prism' Expression Integer
- _ExpressionString :: Prism' Expression Text
- _ExpressionBytes :: Prism' Expression ByteString
- _ExpressionSeq :: Prism' Expression [Expression]
- _ExpressionPrim :: Prism' Expression (MichelinePrimAp RegularExp)
- _AnnotationField :: Prism' Annotation FieldAnn
- _AnnotationVariable :: Prism' Annotation VarAnn
- _AnnotationType :: Prism' Annotation TypeAnn
- mpaPrimL :: forall x. Lens' (MichelinePrimAp x) MichelinePrimitive
- mpaArgsL :: forall x x. Lens (MichelinePrimAp x) (MichelinePrimAp x) [Exp x] [Exp x]
- mpaAnnotsL :: forall x. Lens' (MichelinePrimAp x) [Annotation]
Documentation
Type for Micheline Expression with extension points.
Following the Trees-that-Grow approach, this type provides the core set
of constructors used by Tezos accompanied with additional data (XExp*
).
Plus additional constructors provided by XExp
.
The type argument x
will be called extension descriptor and it must have
ExpExtensionDescriptor
instance.
ExpInt (XExpInt x) Integer | |
ExpString (XExpString x) Text | |
ExpBytes (XExpBytes x) ByteString | |
ExpSeq (XExpSeq x) [Exp x] | |
ExpPrim (XExpPrim x) (MichelinePrimAp x) | |
ExpX (XExp x) |
pattern ExpPrim' :: XExpPrim x -> MichelinePrimitive -> [Exp x] -> [Annotation] -> Exp x |
Instances
FromJSON Expression Source # | |
Defined in Morley.Micheline.Expression parseJSON :: Value -> Parser Expression # parseJSONList :: Value -> Parser [Expression] # | |
ToJSON Expression Source # | |
Defined in Morley.Micheline.Expression toJSON :: Expression -> Value # toEncoding :: Expression -> Encoding # toJSONList :: [Expression] -> Value # toEncodingList :: [Expression] -> Encoding # | |
ToExpression Expression Source # | |
Defined in Morley.Micheline.Class toExpression :: Expression -> Expression Source # | |
Buildable Expression Source # | |
Defined in Morley.Micheline.Expression build :: Expression -> Doc buildList :: [Expression] -> Doc | |
ExpAllExtrasConstrainted (Lift :: Type -> Constraint) x => Lift (Exp x :: Type) Source # | |
(ExpAllExtrasConstrainted Data x, Typeable x) => Data (Exp x) Source # | |
Defined in Morley.Micheline.Expression gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Exp x -> c (Exp x) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Exp x) # dataTypeOf :: Exp x -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Exp x)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Exp x)) # gmapT :: (forall b. Data b => b -> b) -> Exp x -> Exp x # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Exp x -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Exp x -> r # gmapQ :: (forall d. Data d => d -> u) -> Exp x -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Exp x -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Exp x -> m (Exp x) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Exp x -> m (Exp x) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Exp x -> m (Exp x) # | |
ExpAllExtrasConstrainted Show x => Show (Exp x) Source # | |
ExpAllExtrasConstrainted Eq x => Eq (Exp x) Source # | |
(Typeable x, ExpAllExtrasConstrainted Data x, ExpAllExtrasConstrainted (Typeable :: Type -> Constraint) x) => Plated (Exp x) Source # | Default instance that uses If it tries to find expressions for polymorphic types too agressively
(requiring |
Defined in Morley.Micheline.Expression plate :: Traversal' (Exp x) (Exp x) # |
expressionInt :: Integer -> Expression Source #
expressionString :: Text -> Expression Source #
expressionSeq :: [Expression] -> Expression Source #
expressionPrim' :: MichelinePrimitive -> [Expression] -> [Annotation] -> Expression Source #
data RegularExp :: ExpExtensionDescriptorKind Source #
Extension descriptor for plain expressions without additional data.
Instances
type Expression = Exp RegularExp Source #
Simple expression without any extras.
data MichelinePrimAp x Source #
MichelinePrimAp | |
|
Instances
data MichelinePrimitive Source #
Instances
data MichelinePrimitiveTag Source #
Simple classification datakind for MichelinePrimitive
.
MPTKeyword | Keywords, like |
MPTInstr | Instructions, e.g. |
MPTValue | Value constructors like |
MPTType | Types, like |
MPTRemoved | Removed primitives: |
MPTConstant | Keyword |
Instances
data SingMichelinePrimitiveTag :: MichelinePrimitiveTag -> Type where Source #
Instances
TestCoercion SingMichelinePrimitiveTag Source # | |
Defined in Morley.Micheline.Expression.Internal.MichelinePrimitive testCoercion :: forall (a :: k) (b :: k). SingMichelinePrimitiveTag a -> SingMichelinePrimitiveTag b -> Maybe (Coercion a b) # | |
TestEquality SingMichelinePrimitiveTag Source # | |
Defined in Morley.Micheline.Expression.Internal.MichelinePrimitive testEquality :: forall (a :: k) (b :: k). SingMichelinePrimitiveTag a -> SingMichelinePrimitiveTag b -> Maybe (a :~: b) # |
data ClassifiedMichelinePrimitive (tag :: MichelinePrimitiveTag) where Source #
GADT that has the same shape as MichelinePrimitive
, but each constructor
carries a MichelinePrimitiveTag
tag with classification.
withClassifiedPrim :: MichelinePrimitive -> (forall tag. Sing tag -> ClassifiedMichelinePrimitive tag -> r) -> r Source #
Classify a MichelinePrimitive
. Intended to be used with LambdaCase
,
similar to withClassifiedInstr
.
type ExpExtensionDescriptorKind = ExpExtensionTag -> Type Source #
Kind of extension descriptors.
We use a dedicated open type for this, not just Type
, to notice earlier
when type arguments are mis-placed.
class ExpExtensionDescriptor (x :: ExpExtensionDescriptorKind) Source #
Defines details of extension descriptor.
type XExpInt x :: Type Source #
Additional data in ExpInt
constructor.
type XExpInt _ = ()
type XExpString x :: Type Source #
Additional data in ExpString
constructor.
type XExpString _ = ()
type XExpBytes x :: Type Source #
Additional data in ExpBytes
constructor.
type XExpBytes _ = ()
type XExpSeq x :: Type Source #
Additional data in ExpSeq
constructor.
type XExpSeq _ = ()
type XExpPrim x :: Type Source #
Additional data in ExpPrim
constructor.
type XExpPrim _ = ()
Additional constructors.
Instances
ExpExtensionDescriptor RegularExp Source # | |
Defined in Morley.Micheline.Expression type XExpInt RegularExp Source # type XExpString RegularExp Source # type XExpBytes RegularExp Source # type XExpSeq RegularExp Source # type XExpPrim RegularExp Source # type XExp RegularExp Source # | |
ExpExtensionDescriptor (WithMeta m) Source # | |
type ExpExtrasConstrained c x = Each '[c] [XExpInt x, XExpString x, XExpBytes x, XExpSeq x, XExpPrim x] Source #
Constraint all the extra fields provided by this extension.
type ExpAllExtrasConstrainted c x = (ExpExtrasConstrained c x, c (XExp x)) Source #
Constraint all the extra fields and the constructor provided by this extension.
A helper type that carries something for all extra fields.
Fields are carried in the given functor f
so that one could provide
a generator, parser or something else.
Extra constructor is not included here as it may need special treatment, you have to carry it separately.
mkUniformExpExtras :: (extra ~ XExpInt x, extra ~ XExpString x, extra ~ XExpBytes x, extra ~ XExpSeq x, extra ~ XExpPrim x) => f extra -> ExpExtras f x Source #
Fill ExpExtras
with the same data, assuming all types of extras are
the same.
hoistExpExtras :: (forall extra. f1 extra -> f2 extra) -> ExpExtras f1 x -> ExpExtras f2 x Source #
Change the functor used in ExpExtras
.
data Annotation Source #
Instances
annotToText :: Annotation -> Text Source #
annotFromText :: forall m. MonadFail m => Text -> m Annotation Source #
isAnnotationField :: Annotation -> Bool Source #
isAnnotationType :: Annotation -> Bool Source #
isNoAnn :: Annotation -> Bool Source #
toAnnSet :: [Annotation] -> AnnotationSet Source #
mkAnnsFromAny :: [AnyAnn] -> [Annotation] Source #
Prisms
_ExpString :: forall x. Prism' (Exp x) (XExpString x, Text) Source #
Lenses
mpaPrimL :: forall x. Lens' (MichelinePrimAp x) MichelinePrimitive Source #
mpaArgsL :: forall x x. Lens (MichelinePrimAp x) (MichelinePrimAp x) [Exp x] [Exp x] Source #
mpaAnnotsL :: forall x. Lens' (MichelinePrimAp x) [Annotation] Source #