Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- module Michelson.Typed.Value
- data CT
- data T
- type family ToCT a :: CT where ...
- type family ToT t :: T where ...
- data family Sing (a :: k) :: Type
- withSomeSingT :: T -> (forall (a :: T). (Typeable a, SingI a) => Sing a -> r) -> r
- withSomeSingCT :: CT -> (forall (a :: CT). (SingI a, Typeable a) => Sing a -> r) -> r
- fromSingT :: Sing (a :: T) -> T
- fromSingCT :: Sing (a :: CT) -> CT
- class EDivOp (n :: CT) (m :: CT) where
- class MemOp (c :: T) where
- class MapOp (c :: T) (b :: T) where
- class IterOp (c :: T) where
- class SizeOp (c :: T) where
- class GetOp (c :: T) where
- class UpdOp (c :: T) where
- class SliceOp (c :: T) where
- class ConcatOp (c :: T) where
- evalConcat :: Val cp c -> Val cp c -> Val cp c
- evalConcat' :: [Val cp c] -> Val cp c
- data Instr (inp :: [T]) (out :: [T]) where
- Seq :: Typeable b => Instr a b -> Instr b c -> Instr a c
- Nop :: Instr s s
- Ext :: ExtT Instr -> Instr s s
- Nested :: Instr inp out -> Instr inp out
- DROP :: Instr (a ': s) s
- DUP :: Instr (a ': s) (a ': (a ': s))
- SWAP :: Instr (a ': (b ': s)) (b ': (a ': s))
- PUSH :: forall t s. SingI t => Val Instr t -> Instr s (t ': s)
- SOME :: Instr (a ': s) (TOption a ': s)
- NONE :: forall a s. SingI a => Instr s (TOption a ': s)
- UNIT :: Instr s (TUnit ': s)
- IF_NONE :: (Typeable a, Typeable s) => Instr s s' -> Instr (a ': s) s' -> Instr (TOption a ': s) s'
- PAIR :: Instr (a ': (b ': s)) (TPair a b ': s)
- CAR :: Instr (TPair a b ': s) (a ': s)
- CDR :: Instr (TPair a b ': s) (b ': s)
- LEFT :: forall a b s. SingI b => Instr (a ': s) (TOr a b ': s)
- RIGHT :: forall a b s. SingI a => Instr (b ': s) (TOr a b ': s)
- IF_LEFT :: (Typeable s, Typeable a, Typeable b) => Instr (a ': s) s' -> Instr (b ': s) s' -> Instr (TOr a b ': s) s'
- IF_RIGHT :: (Typeable s, Typeable b, Typeable a) => Instr (b ': s) s' -> Instr (a ': s) s' -> Instr (TOr a b ': s) s'
- NIL :: SingI p => Instr s (TList p ': s)
- CONS :: Instr (a ': (TList a ': s)) (TList a ': s)
- IF_CONS :: (Typeable s, Typeable a) => Instr (a ': (TList a ': s)) s' -> Instr s s' -> Instr (TList a ': s) s'
- SIZE :: SizeOp c => Instr (c ': s) (Tc CNat ': s)
- EMPTY_SET :: SingI e => Instr s (TSet e ': s)
- EMPTY_MAP :: (SingI a, SingI b) => Instr s (TMap a b ': s)
- MAP :: (Typeable (MapOpInp c ': s), MapOp c b) => Instr (MapOpInp c ': s) (b ': s) -> Instr (c ': s) (MapOpRes c b ': s)
- ITER :: (Typeable (IterOpEl c ': s), IterOp c) => Instr (IterOpEl c ': s) s -> Instr (c ': s) s
- MEM :: MemOp c => Instr (Tc (MemOpKey c) ': (c ': s)) (Tc CBool ': s)
- GET :: GetOp c => Instr (Tc (GetOpKey c) ': (c ': s)) (TOption (GetOpVal c) ': s)
- UPDATE :: UpdOp c => Instr (Tc (UpdOpKey c) ': (UpdOpParams c ': (c ': s))) (c ': s)
- IF :: Typeable s => Instr s s' -> Instr s s' -> Instr (Tc CBool ': s) s'
- LOOP :: Typeable s => Instr s (Tc CBool ': s) -> Instr (Tc CBool ': s) s
- LOOP_LEFT :: (Typeable a, Typeable s) => Instr (a ': s) (TOr a b ': s) -> Instr (TOr a b ': s) (b ': s)
- LAMBDA :: forall i o s. (SingI i, SingI o) => Val Instr (TLambda i o) -> Instr s (TLambda i o ': s)
- EXEC :: Typeable t1 => Instr (t1 ': (TLambda t1 t2 ': s)) (t2 ': s)
- DIP :: Typeable a => Instr a c -> Instr (b ': a) (b ': c)
- FAILWITH :: Instr (a ': s) t
- CAST :: forall a s. SingI a => Instr (a ': s) (a ': s)
- RENAME :: Instr (a ': s) (a ': s)
- PACK :: Instr (a ': s) (Tc CBytes ': s)
- UNPACK :: SingI a => Instr (Tc CBytes ': s) (TOption a ': s)
- CONCAT :: ConcatOp c => Instr (c ': (c ': s)) (c ': s)
- CONCAT' :: ConcatOp c => Instr (TList c ': s) (c ': s)
- SLICE :: SliceOp c => Instr (Tc CNat ': (Tc CNat ': (c ': s))) (TOption c ': s)
- ISNAT :: Instr (Tc CInt ': s) (TOption (Tc CNat) ': s)
- ADD :: ArithOp Add n m => Instr (Tc n ': (Tc m ': s)) (Tc (ArithRes Add n m) ': s)
- SUB :: ArithOp Sub n m => Instr (Tc n ': (Tc m ': s)) (Tc (ArithRes Sub n m) ': s)
- MUL :: ArithOp Mul n m => Instr (Tc n ': (Tc m ': s)) (Tc (ArithRes Mul n m) ': s)
- EDIV :: EDivOp n m => Instr (Tc n ': (Tc m ': s)) (TOption (TPair (Tc (EDivOpRes n m)) (Tc (EModOpRes n m))) ': s)
- ABS :: UnaryArithOp Abs n => Instr (Tc n ': s) (Tc (UnaryArithRes Abs n) ': s)
- NEG :: UnaryArithOp Neg n => Instr (Tc n ': s) (Tc (UnaryArithRes Neg n) ': s)
- LSL :: ArithOp Lsl n m => Instr (Tc n ': (Tc m ': s)) (Tc (ArithRes Lsl n m) ': s)
- LSR :: ArithOp Lsr n m => Instr (Tc n ': (Tc m ': s)) (Tc (ArithRes Lsr n m) ': s)
- OR :: ArithOp Or n m => Instr (Tc n ': (Tc m ': s)) (Tc (ArithRes Or n m) ': s)
- AND :: ArithOp And n m => Instr (Tc n ': (Tc m ': s)) (Tc (ArithRes And n m) ': s)
- XOR :: ArithOp Xor n m => Instr (Tc n ': (Tc m ': s)) (Tc (ArithRes Xor n m) ': s)
- NOT :: UnaryArithOp Not n => Instr (Tc n ': s) (Tc (UnaryArithRes Not n) ': s)
- COMPARE :: ArithOp Compare n m => Instr (Tc n ': (Tc m ': s)) (Tc (ArithRes Compare n m) ': s)
- EQ :: UnaryArithOp Eq' n => Instr (Tc n ': s) (Tc (UnaryArithRes Eq' n) ': s)
- NEQ :: UnaryArithOp Neq n => Instr (Tc n ': s) (Tc (UnaryArithRes Neq n) ': s)
- LT :: UnaryArithOp Lt n => Instr (Tc n ': s) (Tc (UnaryArithRes Lt n) ': s)
- GT :: UnaryArithOp Gt n => Instr (Tc n ': s) (Tc (UnaryArithRes Gt n) ': s)
- LE :: UnaryArithOp Le n => Instr (Tc n ': s) (Tc (UnaryArithRes Le n) ': s)
- GE :: UnaryArithOp Ge n => Instr (Tc n ': s) (Tc (UnaryArithRes Ge n) ': s)
- INT :: Instr (Tc CNat ': s) (Tc CInt ': s)
- SELF :: forall (cp :: T) s. Instr s (TContract cp ': s)
- CONTRACT :: SingI p => Instr (Tc CAddress ': s) (TOption (TContract p) ': s)
- TRANSFER_TOKENS :: Typeable p => Instr (p ': (Tc CMutez ': (TContract p ': s))) (TOperation ': s)
- SET_DELEGATE :: Instr (TOption (Tc CKeyHash) ': s) (TOperation ': s)
- CREATE_ACCOUNT :: Instr (Tc CKeyHash ': (TOption (Tc CKeyHash) ': (Tc CBool ': (Tc CMutez ': s)))) (TOperation ': (Tc CAddress ': s))
- CREATE_CONTRACT :: (SingI p, SingI g, Typeable p, Typeable g) => Instr (Tc CKeyHash ': (TOption (Tc CKeyHash) ': (Tc CBool ': (Tc CBool ': (Tc CMutez ': (TLambda (TPair p g) (TPair (TList TOperation) g) ': (g ': s))))))) (TOperation ': (Tc CAddress ': s))
- CREATE_CONTRACT2 :: (SingI p, SingI g, Typeable p, Typeable g) => Instr '[TPair p g] '[TPair (TList TOperation) g] -> Instr (Tc CKeyHash ': (TOption (Tc CKeyHash) ': (Tc CBool ': (Tc CBool ': (Tc CMutez ': (g ': s)))))) (TOperation ': (Tc CAddress ': s))
- IMPLICIT_ACCOUNT :: Instr (Tc CKeyHash ': s) (TContract TUnit ': s)
- NOW :: Instr s (Tc CTimestamp ': s)
- AMOUNT :: Instr s (Tc CMutez ': s)
- BALANCE :: Instr s (Tc CMutez ': s)
- CHECK_SIGNATURE :: Instr (TKey ': (TSignature ': (Tc CBytes ': s))) (Tc CBool ': s)
- SHA256 :: Instr (Tc CBytes ': s) (Tc CBytes ': s)
- SHA512 :: Instr (Tc CBytes ': s) (Tc CBytes ': s)
- BLAKE2B :: Instr (Tc CBytes ': s) (Tc CBytes ': s)
- HASH_KEY :: Instr (TKey ': s) (Tc CKeyHash ': s)
- STEPS_TO_QUOTA :: Instr s (Tc CNat ': s)
- SOURCE :: Instr s (Tc CAddress ': s)
- SENDER :: Instr s (Tc CAddress ': s)
- ADDRESS :: Instr (TContract a ': s) (Tc CAddress ': s)
- (#) :: Typeable b => Instr a b -> Instr b c -> Instr a c
- type Contract cp st = Instr (ContractInp cp st) (ContractOut st)
- type family ExtT (instr :: [T] -> [T] -> Type) :: Type
- type InstrExtT = ExtT Instr
- extractNotes :: Type -> Sing t -> Either Text (Notes t)
- fromUType :: Type -> T
- mkUType :: Sing x -> Notes x -> Type
- toUType :: T -> Type
- data CVal t where
- CvInt :: Integer -> CVal CInt
- CvNat :: Natural -> CVal CNat
- CvString :: Text -> CVal CString
- CvBytes :: ByteString -> CVal CBytes
- CvMutez :: Mutez -> CVal CMutez
- CvBool :: Bool -> CVal CBool
- CvKeyHash :: KeyHash -> CVal CKeyHash
- CvTimestamp :: Timestamp -> CVal CTimestamp
- CvAddress :: Address -> CVal CAddress
- class ToCVal a
- class FromCVal t
- toCVal :: ToCVal a => a -> CVal (ToCT a)
- fromCVal :: FromCVal t => CVal (ToCT t) -> t
- convertContract :: forall param store. (SingI param, SingI store, ConversibleExt) => Contract param store -> UntypedContract
- instrToOps :: ConversibleExt => Instr inp out -> [ExpandedOp]
- unsafeValToValue :: (ConversibleExt, HasCallStack) => Val Instr t -> UntypedValue
- valToOpOrValue :: forall t. ConversibleExt => Val Instr t -> Maybe UntypedValue
- class Conversible ext1 ext2 where
- convert :: ext1 -> ext2
- type ConversibleExt = Conversible (ExtT Instr) (ExtU InstrAbstract ExpandedOp)
- class ArithOp aop (n :: CT) (m :: CT) where
- class UnaryArithOp aop (n :: CT) where
- type UnaryArithRes aop n :: CT
- evalUnaryArithOp :: proxy aop -> CVal n -> CVal (UnaryArithRes aop n)
- data ArithError n m = MutezArithError ArithErrorType n m
- data ArithErrorType
- data Add
- data Sub
- data Mul
- data Abs
- data Neg
- data Or
- data And
- data Xor
- data Not
- data Lsl
- data Lsr
- data Compare
- data Eq'
- data Neq
- data Lt
- data Gt
- data Le
- data Ge
- data Notes t
- data Notes' t where
- NTc :: TypeAnn -> Notes' (Tc ct)
- NTKey :: TypeAnn -> Notes' TKey
- NTUnit :: TypeAnn -> Notes' TUnit
- NTSignature :: TypeAnn -> Notes' TSignature
- NTOption :: TypeAnn -> FieldAnn -> Notes t -> Notes' (TOption t)
- NTList :: TypeAnn -> Notes t -> Notes' (TList t)
- NTSet :: TypeAnn -> TypeAnn -> Notes' (TSet ct)
- NTOperation :: TypeAnn -> Notes' TOperation
- NTContract :: TypeAnn -> Notes t -> Notes' (TContract t)
- NTPair :: TypeAnn -> FieldAnn -> FieldAnn -> Notes p -> Notes q -> Notes' (TPair p q)
- NTOr :: TypeAnn -> FieldAnn -> FieldAnn -> Notes p -> Notes q -> Notes' (TOr p q)
- NTLambda :: TypeAnn -> Notes p -> Notes q -> Notes' (TLambda p q)
- NTMap :: TypeAnn -> TypeAnn -> Notes v -> Notes' (TMap k v)
- NTBigMap :: TypeAnn -> TypeAnn -> Notes v -> Notes' (TBigMap k v)
- converge :: Notes t -> Notes t -> Either Text (Notes t)
- convergeAnns :: Show (Annotation tag) => Annotation tag -> Annotation tag -> Either Text (Annotation tag)
- notesCase :: r -> (Notes' t -> r) -> Notes t -> r
- isStar :: Notes t -> Bool
- mkNotes :: Notes' t -> Notes t
- orAnn :: Annotation t -> Annotation t -> Annotation t
Documentation
module Michelson.Typed.Value
Instances
Bounded CT Source # | |
Enum CT Source # | |
Eq CT Source # | |
Data CT Source # | |
Defined in Michelson.Untyped.Type gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> CT -> c CT # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c CT # dataTypeOf :: CT -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c CT) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c CT) # gmapT :: (forall b. Data b => b -> b) -> CT -> CT # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> CT -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> CT -> r # gmapQ :: (forall d. Data d => d -> u) -> CT -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> CT -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> CT -> m CT # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> CT -> m CT # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> CT -> m CT # | |
Ord CT Source # | |
Show CT Source # | |
Generic CT Source # | |
ToJSON CT Source # | |
Defined in Michelson.Untyped.Type | |
FromJSON CT Source # | |
Buildable CT Source # | |
Defined in Michelson.Untyped.Type | |
RenderDoc CT Source # | |
SingI CInt Source # | |
Defined in Michelson.Typed.Sing | |
SingI CNat Source # | |
Defined in Michelson.Typed.Sing | |
SingI CString Source # | |
Defined in Michelson.Typed.Sing | |
SingI CBytes Source # | |
Defined in Michelson.Typed.Sing | |
SingI CMutez Source # | |
Defined in Michelson.Typed.Sing | |
SingI CBool Source # | |
Defined in Michelson.Typed.Sing | |
SingI CKeyHash Source # | |
Defined in Michelson.Typed.Sing | |
SingI CTimestamp Source # | |
Defined in Michelson.Typed.Sing sing :: Sing CTimestamp # | |
SingI CAddress Source # | |
Defined in Michelson.Typed.Sing | |
type Rep CT Source # | |
Defined in Michelson.Untyped.Type type Rep CT = D1 (MetaData "CT" "Michelson.Untyped.Type" "morley-0.2.0-DKAk4nHfsQHKu9FVdoO5vJ" False) (((C1 (MetaCons "CInt" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "CNat" PrefixI False) (U1 :: Type -> Type)) :+: (C1 (MetaCons "CString" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "CBytes" PrefixI False) (U1 :: Type -> Type))) :+: ((C1 (MetaCons "CMutez" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "CBool" PrefixI False) (U1 :: Type -> Type)) :+: (C1 (MetaCons "CKeyHash" PrefixI False) (U1 :: Type -> Type) :+: (C1 (MetaCons "CTimestamp" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "CAddress" PrefixI False) (U1 :: Type -> Type))))) | |
data Sing (a :: CT) Source # | |
Defined in Michelson.Typed.Sing data Sing (a :: CT) where
|
Michelson language type with annotations stripped off.
Tc CT | |
TKey | |
TUnit | |
TSignature | |
TOption T | |
TList T | |
TSet CT | |
TOperation | |
TContract T | |
TPair T T | |
TOr T T | |
TLambda T T | |
TMap CT T | |
TBigMap CT T |
Instances
Eq T Source # | |
Show T Source # | |
SingI TKey Source # | |
Defined in Michelson.Typed.Sing | |
SingI TUnit Source # | |
Defined in Michelson.Typed.Sing | |
SingI TSignature Source # | |
Defined in Michelson.Typed.Sing sing :: Sing TSignature # | |
SingI TOperation Source # | |
Defined in Michelson.Typed.Sing sing :: Sing TOperation # | |
(SingI t, Typeable t) => SingI (Tc t :: T) Source # | |
Defined in Michelson.Typed.Sing | |
(SingI a, Typeable a) => SingI (TOption a :: T) Source # | |
Defined in Michelson.Typed.Sing | |
(SingI a, Typeable a) => SingI (TList a :: T) Source # | |
Defined in Michelson.Typed.Sing | |
(SingI a, Typeable a) => SingI (TSet a :: T) Source # | |
Defined in Michelson.Typed.Sing | |
(SingI a, Typeable a) => SingI (TContract a :: T) Source # | |
Defined in Michelson.Typed.Sing | |
(SingI a, Typeable a, Typeable b, SingI b) => SingI (TPair a b :: T) Source # | |
Defined in Michelson.Typed.Sing | |
(SingI a, Typeable a, Typeable b, SingI b) => SingI (TOr a b :: T) Source # | |
Defined in Michelson.Typed.Sing | |
(SingI a, Typeable a, Typeable b, SingI b) => SingI (TLambda a b :: T) Source # | |
Defined in Michelson.Typed.Sing | |
(SingI a, Typeable a, Typeable b, SingI b) => SingI (TMap a b :: T) Source # | |
Defined in Michelson.Typed.Sing | |
(SingI a, Typeable a, Typeable b, SingI b) => SingI (TBigMap a b :: T) Source # | |
Defined in Michelson.Typed.Sing | |
data Sing (a :: T) Source # | Instance of data family |
Defined in Michelson.Typed.Sing data Sing (a :: T) where
|
type family ToCT a :: CT where ... Source #
Type function that converts a regular Haskell type into a comparable type
(which has kind CT
)
type family ToT t :: T where ... Source #
Type function that converts a regular Haskell type into a T
type.
TODO: what should be done with TBigMap
?
ToT Integer = Tc (ToCT Integer) | |
ToT Int = Tc (ToCT Int) | |
ToT Natural = Tc (ToCT Natural) | |
ToT Word64 = Tc (ToCT Word64) | |
ToT Text = Tc (ToCT Text) | |
ToT Bool = Tc (ToCT Bool) | |
ToT ByteString = Tc (ToCT ByteString) | |
ToT Mutez = Tc (ToCT Mutez) | |
ToT Address = Tc (ToCT Address) | |
ToT KeyHash = Tc (ToCT KeyHash) | |
ToT Timestamp = Tc (ToCT Timestamp) | |
ToT () = TUnit | |
ToT (a, b) = TPair (ToT a) (ToT b) | |
ToT [a] = TList (ToT a) | |
ToT (Maybe a) = TOption (ToT a) | |
ToT (Either a b) = TOr (ToT a) (ToT b) | |
ToT (Set k) = TSet (ToCT k) | |
ToT (Map k v) = TMap (ToCT k) (ToT v) | |
ToT PublicKey = TKey | |
ToT Signature = TSignature |
data family Sing (a :: k) :: Type #
The singleton kind-indexed data family.
Instances
data Sing (a :: Bool) | |
data Sing (a :: Ordering) | |
data Sing (n :: Nat) | |
data Sing (n :: Symbol) | |
Defined in Data.Singletons.TypeLits.Internal | |
data Sing (a :: ()) | |
Defined in Data.Singletons.Prelude.Instances | |
data Sing (a :: Void) | |
Defined in Data.Singletons.Prelude.Instances | |
data Sing (a :: All) | |
data Sing (a :: Any) | |
data Sing (a :: CT) Source # | |
Defined in Michelson.Typed.Sing data Sing (a :: CT) where
| |
data Sing (a :: T) Source # | Instance of data family |
Defined in Michelson.Typed.Sing data Sing (a :: T) where
| |
data Sing (b :: [a]) | |
data Sing (b :: Maybe a) | |
data Sing (b :: Min a) | |
data Sing (b :: Max a) | |
data Sing (b :: First a) | |
data Sing (b :: Last a) | |
data Sing (a :: WrappedMonoid m) | |
Defined in Data.Singletons.Prelude.Semigroup.Internal data Sing (a :: WrappedMonoid m) where
| |
data Sing (b :: Option a) | |
data Sing (b :: Identity a) | |
data Sing (b :: First a) | |
data Sing (b :: Last a) | |
data Sing (b :: Dual a) | |
data Sing (b :: Sum a) | |
data Sing (b :: Product a) | |
data Sing (b :: Down a) | |
data Sing (b :: NonEmpty a) | |
data Sing (b :: Endo a) | |
data Sing (b :: MaxInternal a) | |
Defined in Data.Singletons.Prelude.Foldable data Sing (b :: MaxInternal a) where
| |
data Sing (b :: MinInternal a) | |
Defined in Data.Singletons.Prelude.Foldable data Sing (b :: MinInternal a) where
| |
data Sing (c :: Either a b) | |
data Sing (c :: (a, b)) | |
data Sing (c :: Arg a b) | |
newtype Sing (f :: k1 ~> k2) | |
data Sing (b :: StateL s a) | |
data Sing (b :: StateR s a) | |
data Sing (d :: (a, b, c)) | |
data Sing (c :: Const a b) | |
data Sing (e :: (a, b, c, d)) | |
data Sing (f :: (a, b, c, d, e)) | |
data Sing (g :: (a, b, c, d, e, f)) | |
Defined in Data.Singletons.Prelude.Instances | |
data Sing (h :: (a, b, c, d, e, f, g)) | |
Defined in Data.Singletons.Prelude.Instances |
fromSingT :: Sing (a :: T) -> T Source #
Version of fromSing
specialized for use with
data instance Sing :: T -> Type
which requires Typeable
constraint for some of its constructors
class EDivOp (n :: CT) (m :: CT) where Source #
evalEDivOp :: CVal n -> CVal m -> Val instr (TOption (TPair (Tc (EDivOpRes n m)) (Tc (EModOpRes n m)))) Source #
class MapOp (c :: T) (b :: T) where Source #
mapOpToList :: Val instr c -> [Val instr (MapOpInp c)] Source #
mapOpFromList :: Val instr c -> [Val instr b] -> Val instr (MapOpRes c b) Source #
class ConcatOp (c :: T) where Source #
evalConcat :: Val cp c -> Val cp c -> Val cp c Source #
evalConcat' :: [Val cp c] -> Val cp c Source #
data Instr (inp :: [T]) (out :: [T]) where Source #
Representation of Michelson instruction or sequence of instructions.
Each Michelson instruction is represented by exactly one
constructor of this data type. Sequence of instructions
is represented with use of Seq
constructor in following
way: SWAP; DROP ; DUP;
-> SWAP
.
Special case where there are no instructions is represented
by constructor Instr
DROP Instr
DUPNop
, e.g. IF_NONE {} { SWAP; DROP; }
->
IF_NONE Nop (SWAP
.Instr
DROP)
Type parameter inp
states for input stack type. That is,
type of the stack that is required for operation to execute.
Type parameter out
states for output stack type or type
of stack that will be left after instruction's execution.
Seq :: Typeable b => Instr a b -> Instr b c -> Instr a c | |
Nop :: Instr s s | Nop operation. Missing in Michelson spec, added to parse construction like `IF {} { SWAP; DROP; }`. |
Ext :: ExtT Instr -> Instr s s | |
Nested :: Instr inp out -> Instr inp out | Nested wrapper is going to wrap a sequence of instructions with { }. It is crucial because serialisation of a contract depends on precise structure of its code. |
DROP :: Instr (a ': s) s | |
DUP :: Instr (a ': s) (a ': (a ': s)) | |
SWAP :: Instr (a ': (b ': s)) (b ': (a ': s)) | |
PUSH :: forall t s. SingI t => Val Instr t -> Instr s (t ': s) | |
SOME :: Instr (a ': s) (TOption a ': s) | |
NONE :: forall a s. SingI a => Instr s (TOption a ': s) | |
UNIT :: Instr s (TUnit ': s) | |
IF_NONE :: (Typeable a, Typeable s) => Instr s s' -> Instr (a ': s) s' -> Instr (TOption a ': s) s' | |
PAIR :: Instr (a ': (b ': s)) (TPair a b ': s) | |
CAR :: Instr (TPair a b ': s) (a ': s) | |
CDR :: Instr (TPair a b ': s) (b ': s) | |
LEFT :: forall a b s. SingI b => Instr (a ': s) (TOr a b ': s) | |
RIGHT :: forall a b s. SingI a => Instr (b ': s) (TOr a b ': s) | |
IF_LEFT :: (Typeable s, Typeable a, Typeable b) => Instr (a ': s) s' -> Instr (b ': s) s' -> Instr (TOr a b ': s) s' | |
IF_RIGHT :: (Typeable s, Typeable b, Typeable a) => Instr (b ': s) s' -> Instr (a ': s) s' -> Instr (TOr a b ': s) s' | |
NIL :: SingI p => Instr s (TList p ': s) | |
CONS :: Instr (a ': (TList a ': s)) (TList a ': s) | |
IF_CONS :: (Typeable s, Typeable a) => Instr (a ': (TList a ': s)) s' -> Instr s s' -> Instr (TList a ': s) s' | |
SIZE :: SizeOp c => Instr (c ': s) (Tc CNat ': s) | |
EMPTY_SET :: SingI e => Instr s (TSet e ': s) | |
EMPTY_MAP :: (SingI a, SingI b) => Instr s (TMap a b ': s) | |
MAP :: (Typeable (MapOpInp c ': s), MapOp c b) => Instr (MapOpInp c ': s) (b ': s) -> Instr (c ': s) (MapOpRes c b ': s) | |
ITER :: (Typeable (IterOpEl c ': s), IterOp c) => Instr (IterOpEl c ': s) s -> Instr (c ': s) s | |
MEM :: MemOp c => Instr (Tc (MemOpKey c) ': (c ': s)) (Tc CBool ': s) | |
GET :: GetOp c => Instr (Tc (GetOpKey c) ': (c ': s)) (TOption (GetOpVal c) ': s) | |
UPDATE :: UpdOp c => Instr (Tc (UpdOpKey c) ': (UpdOpParams c ': (c ': s))) (c ': s) | |
IF :: Typeable s => Instr s s' -> Instr s s' -> Instr (Tc CBool ': s) s' | |
LOOP :: Typeable s => Instr s (Tc CBool ': s) -> Instr (Tc CBool ': s) s | |
LOOP_LEFT :: (Typeable a, Typeable s) => Instr (a ': s) (TOr a b ': s) -> Instr (TOr a b ': s) (b ': s) | |
LAMBDA :: forall i o s. (SingI i, SingI o) => Val Instr (TLambda i o) -> Instr s (TLambda i o ': s) | |
EXEC :: Typeable t1 => Instr (t1 ': (TLambda t1 t2 ': s)) (t2 ': s) | |
DIP :: Typeable a => Instr a c -> Instr (b ': a) (b ': c) | |
FAILWITH :: Instr (a ': s) t | |
CAST :: forall a s. SingI a => Instr (a ': s) (a ': s) | |
RENAME :: Instr (a ': s) (a ': s) | |
PACK :: Instr (a ': s) (Tc CBytes ': s) | |
UNPACK :: SingI a => Instr (Tc CBytes ': s) (TOption a ': s) | |
CONCAT :: ConcatOp c => Instr (c ': (c ': s)) (c ': s) | |
CONCAT' :: ConcatOp c => Instr (TList c ': s) (c ': s) | |
SLICE :: SliceOp c => Instr (Tc CNat ': (Tc CNat ': (c ': s))) (TOption c ': s) | |
ISNAT :: Instr (Tc CInt ': s) (TOption (Tc CNat) ': s) | |
ADD :: ArithOp Add n m => Instr (Tc n ': (Tc m ': s)) (Tc (ArithRes Add n m) ': s) | |
SUB :: ArithOp Sub n m => Instr (Tc n ': (Tc m ': s)) (Tc (ArithRes Sub n m) ': s) | |
MUL :: ArithOp Mul n m => Instr (Tc n ': (Tc m ': s)) (Tc (ArithRes Mul n m) ': s) | |
EDIV :: EDivOp n m => Instr (Tc n ': (Tc m ': s)) (TOption (TPair (Tc (EDivOpRes n m)) (Tc (EModOpRes n m))) ': s) | |
ABS :: UnaryArithOp Abs n => Instr (Tc n ': s) (Tc (UnaryArithRes Abs n) ': s) | |
NEG :: UnaryArithOp Neg n => Instr (Tc n ': s) (Tc (UnaryArithRes Neg n) ': s) | |
LSL :: ArithOp Lsl n m => Instr (Tc n ': (Tc m ': s)) (Tc (ArithRes Lsl n m) ': s) | |
LSR :: ArithOp Lsr n m => Instr (Tc n ': (Tc m ': s)) (Tc (ArithRes Lsr n m) ': s) | |
OR :: ArithOp Or n m => Instr (Tc n ': (Tc m ': s)) (Tc (ArithRes Or n m) ': s) | |
AND :: ArithOp And n m => Instr (Tc n ': (Tc m ': s)) (Tc (ArithRes And n m) ': s) | |
XOR :: ArithOp Xor n m => Instr (Tc n ': (Tc m ': s)) (Tc (ArithRes Xor n m) ': s) | |
NOT :: UnaryArithOp Not n => Instr (Tc n ': s) (Tc (UnaryArithRes Not n) ': s) | |
COMPARE :: ArithOp Compare n m => Instr (Tc n ': (Tc m ': s)) (Tc (ArithRes Compare n m) ': s) | |
EQ :: UnaryArithOp Eq' n => Instr (Tc n ': s) (Tc (UnaryArithRes Eq' n) ': s) | |
NEQ :: UnaryArithOp Neq n => Instr (Tc n ': s) (Tc (UnaryArithRes Neq n) ': s) | |
LT :: UnaryArithOp Lt n => Instr (Tc n ': s) (Tc (UnaryArithRes Lt n) ': s) | |
GT :: UnaryArithOp Gt n => Instr (Tc n ': s) (Tc (UnaryArithRes Gt n) ': s) | |
LE :: UnaryArithOp Le n => Instr (Tc n ': s) (Tc (UnaryArithRes Le n) ': s) | |
GE :: UnaryArithOp Ge n => Instr (Tc n ': s) (Tc (UnaryArithRes Ge n) ': s) | |
INT :: Instr (Tc CNat ': s) (Tc CInt ': s) | |
SELF :: forall (cp :: T) s. Instr s (TContract cp ': s) | |
CONTRACT :: SingI p => Instr (Tc CAddress ': s) (TOption (TContract p) ': s) | |
TRANSFER_TOKENS :: Typeable p => Instr (p ': (Tc CMutez ': (TContract p ': s))) (TOperation ': s) | |
SET_DELEGATE :: Instr (TOption (Tc CKeyHash) ': s) (TOperation ': s) | |
CREATE_ACCOUNT :: Instr (Tc CKeyHash ': (TOption (Tc CKeyHash) ': (Tc CBool ': (Tc CMutez ': s)))) (TOperation ': (Tc CAddress ': s)) | |
CREATE_CONTRACT :: (SingI p, SingI g, Typeable p, Typeable g) => Instr (Tc CKeyHash ': (TOption (Tc CKeyHash) ': (Tc CBool ': (Tc CBool ': (Tc CMutez ': (TLambda (TPair p g) (TPair (TList TOperation) g) ': (g ': s))))))) (TOperation ': (Tc CAddress ': s)) | |
CREATE_CONTRACT2 :: (SingI p, SingI g, Typeable p, Typeable g) => Instr '[TPair p g] '[TPair (TList TOperation) g] -> Instr (Tc CKeyHash ': (TOption (Tc CKeyHash) ': (Tc CBool ': (Tc CBool ': (Tc CMutez ': (g ': s)))))) (TOperation ': (Tc CAddress ': s)) | |
IMPLICIT_ACCOUNT :: Instr (Tc CKeyHash ': s) (TContract TUnit ': s) | |
NOW :: Instr s (Tc CTimestamp ': s) | |
AMOUNT :: Instr s (Tc CMutez ': s) | |
BALANCE :: Instr s (Tc CMutez ': s) | |
CHECK_SIGNATURE :: Instr (TKey ': (TSignature ': (Tc CBytes ': s))) (Tc CBool ': s) | |
SHA256 :: Instr (Tc CBytes ': s) (Tc CBytes ': s) | |
SHA512 :: Instr (Tc CBytes ': s) (Tc CBytes ': s) | |
BLAKE2B :: Instr (Tc CBytes ': s) (Tc CBytes ': s) | |
HASH_KEY :: Instr (TKey ': s) (Tc CKeyHash ': s) | |
STEPS_TO_QUOTA :: Instr s (Tc CNat ': s) | |
SOURCE :: Instr s (Tc CAddress ': s) | |
SENDER :: Instr s (Tc CAddress ': s) | |
ADDRESS :: Instr (TContract a ': s) (Tc CAddress ': s) |
type Contract cp st = Instr (ContractInp cp st) (ContractOut st) Source #
type family ExtT (instr :: [T] -> [T] -> Type) :: Type Source #
ExtT is extension of Instr by Morley instructions
extractNotes :: Type -> Sing t -> Either Text (Notes t) Source #
Extracts Notes t
type from Type
and corresponding
singleton.
Representation of comparable value in Michelson language.
By specification, we're allowed to compare only following types: int, nat, string, bytes, mutez, bool, key_hash, timestamp, address.
Only these values can be used as map keys or set elements.
CvInt :: Integer -> CVal CInt | |
CvNat :: Natural -> CVal CNat | |
CvString :: Text -> CVal CString | |
CvBytes :: ByteString -> CVal CBytes | |
CvMutez :: Mutez -> CVal CMutez | |
CvBool :: Bool -> CVal CBool | |
CvKeyHash :: KeyHash -> CVal CKeyHash | |
CvTimestamp :: Timestamp -> CVal CTimestamp | |
CvAddress :: Address -> CVal CAddress |
Instances
Eq (CVal t) Source # | |
Ord (CVal t) Source # | |
Show (CVal t) Source # | |
Arbitrary (CVal CInt) Source # | |
Arbitrary (CVal CMutez) Source # | |
Arbitrary (CVal CKeyHash) Source # | |
Arbitrary (CVal CTimestamp) Source # | |
Defined in Morley.Test.Gen arbitrary :: Gen (CVal CTimestamp) # shrink :: CVal CTimestamp -> [CVal CTimestamp] # |
Converts a single Haskell value into CVal
representation.
Instances
ToCVal Bool Source # | |
ToCVal Int Source # | |
ToCVal Integer Source # | |
ToCVal Natural Source # | |
ToCVal Word64 Source # | |
ToCVal ByteString Source # | |
Defined in Michelson.Typed.CValue toCVal :: ByteString -> CVal (ToCT ByteString) Source # | |
ToCVal Text Source # | |
ToCVal Timestamp Source # | |
ToCVal Mutez Source # | |
ToCVal KeyHash Source # | |
ToCVal Address Source # | |
Converts a CVal
value into a single Haskell value.
Instances
convertContract :: forall param store. (SingI param, SingI store, ConversibleExt) => Contract param store -> UntypedContract Source #
instrToOps :: ConversibleExt => Instr inp out -> [ExpandedOp] Source #
unsafeValToValue :: (ConversibleExt, HasCallStack) => Val Instr t -> UntypedValue Source #
Function unsafeValToValue
converts typed Val
to untyped Value
from Michelson.Untyped.Value
module
VOp cannot be represented in Value
from untyped types, so calling this function
on it will cause an error
valToOpOrValue :: forall t. ConversibleExt => Val Instr t -> Maybe UntypedValue Source #
Convert a typed Val
to an untyped Value
, or fail if it contains operations
which are unrepresentable there.
class Conversible ext1 ext2 where Source #
Instances
Conversible ExtInstr (UExtInstrAbstract ExpandedOp) Source # | |
Defined in Morley.Types |
type ConversibleExt = Conversible (ExtT Instr) (ExtU InstrAbstract ExpandedOp) Source #
class ArithOp aop (n :: CT) (m :: CT) where Source #
Class for binary arithmetic operation.
Takes binary operation marker as op
parameter,
types of left operand n
and right operand m
.
type ArithRes aop n m :: CT Source #
Type family ArithRes
denotes the type resulting from
computing operation op
from operands of types n
and m
.
For instance, adding integer to natural produces integer,
which is reflected in following instance of type family:
ArithRes Add CNat CInt = CInt
.
evalOp :: proxy aop -> CVal n -> CVal m -> Either (ArithError (CVal n) (CVal m)) (CVal (ArithRes aop n m)) Source #
Evaluate arithmetic operation on given operands.
Instances
class UnaryArithOp aop (n :: CT) where Source #
Marker data type for add operation.
type UnaryArithRes aop n :: CT Source #
evalUnaryArithOp :: proxy aop -> CVal n -> CVal (UnaryArithRes aop n) Source #
Instances
data ArithError n m Source #
Represents an arithmetic error of the operation.
Instances
(Eq n, Eq m) => Eq (ArithError n m) Source # | |
Defined in Michelson.Typed.Arith (==) :: ArithError n m -> ArithError n m -> Bool # (/=) :: ArithError n m -> ArithError n m -> Bool # | |
(Ord n, Ord m) => Ord (ArithError n m) Source # | |
Defined in Michelson.Typed.Arith compare :: ArithError n m -> ArithError n m -> Ordering # (<) :: ArithError n m -> ArithError n m -> Bool # (<=) :: ArithError n m -> ArithError n m -> Bool # (>) :: ArithError n m -> ArithError n m -> Bool # (>=) :: ArithError n m -> ArithError n m -> Bool # max :: ArithError n m -> ArithError n m -> ArithError n m # min :: ArithError n m -> ArithError n m -> ArithError n m # | |
(Show n, Show m) => Show (ArithError n m) Source # | |
Defined in Michelson.Typed.Arith showsPrec :: Int -> ArithError n m -> ShowS # show :: ArithError n m -> String # showList :: [ArithError n m] -> ShowS # | |
(Show n, Show m) => Buildable (ArithError n m) Source # | |
Defined in Michelson.Typed.Arith build :: ArithError n m -> Builder # |
data ArithErrorType Source #
Denotes the error type occured in the arithmetic operation.
Instances
Eq ArithErrorType Source # | |
Defined in Michelson.Typed.Arith (==) :: ArithErrorType -> ArithErrorType -> Bool # (/=) :: ArithErrorType -> ArithErrorType -> Bool # | |
Ord ArithErrorType Source # | |
Defined in Michelson.Typed.Arith compare :: ArithErrorType -> ArithErrorType -> Ordering # (<) :: ArithErrorType -> ArithErrorType -> Bool # (<=) :: ArithErrorType -> ArithErrorType -> Bool # (>) :: ArithErrorType -> ArithErrorType -> Bool # (>=) :: ArithErrorType -> ArithErrorType -> Bool # max :: ArithErrorType -> ArithErrorType -> ArithErrorType # min :: ArithErrorType -> ArithErrorType -> ArithErrorType # | |
Show ArithErrorType Source # | |
Defined in Michelson.Typed.Arith showsPrec :: Int -> ArithErrorType -> ShowS # show :: ArithErrorType -> String # showList :: [ArithErrorType] -> ShowS # | |
Buildable ArithErrorType Source # | |
Defined in Michelson.Typed.Arith build :: ArithErrorType -> Builder # |
Instances
ArithOp Add CInt CInt Source # | |
ArithOp Add CInt CNat Source # | |
ArithOp Add CInt CTimestamp Source # | |
Defined in Michelson.Typed.Arith evalOp :: proxy Add -> CVal CInt -> CVal CTimestamp -> Either (ArithError (CVal CInt) (CVal CTimestamp)) (CVal (ArithRes Add CInt CTimestamp)) Source # | |
ArithOp Add CNat CInt Source # | |
ArithOp Add CNat CNat Source # | |
ArithOp Add CMutez CMutez Source # | |
ArithOp Add CTimestamp CInt Source # | |
Defined in Michelson.Typed.Arith evalOp :: proxy Add -> CVal CTimestamp -> CVal CInt -> Either (ArithError (CVal CTimestamp) (CVal CInt)) (CVal (ArithRes Add CTimestamp CInt)) Source # | |
type ArithRes Add CInt CInt Source # | |
type ArithRes Add CInt CNat Source # | |
type ArithRes Add CInt CTimestamp Source # | |
Defined in Michelson.Typed.Arith | |
type ArithRes Add CNat CInt Source # | |
type ArithRes Add CNat CNat Source # | |
type ArithRes Add CMutez CMutez Source # | |
type ArithRes Add CTimestamp CInt Source # | |
Defined in Michelson.Typed.Arith |
Instances
Instances
ArithOp Mul CInt CInt Source # | |
ArithOp Mul CInt CNat Source # | |
ArithOp Mul CNat CInt Source # | |
ArithOp Mul CNat CNat Source # | |
ArithOp Mul CNat CMutez Source # | |
ArithOp Mul CMutez CNat Source # | |
type ArithRes Mul CInt CInt Source # | |
type ArithRes Mul CInt CNat Source # | |
type ArithRes Mul CNat CInt Source # | |
type ArithRes Mul CNat CNat Source # | |
type ArithRes Mul CNat CMutez Source # | |
type ArithRes Mul CMutez CNat Source # | |
Instances
UnaryArithOp Abs CInt Source # | |
Defined in Michelson.Typed.Arith evalUnaryArithOp :: proxy Abs -> CVal CInt -> CVal (UnaryArithRes Abs CInt) Source # | |
type UnaryArithRes Abs CInt Source # | |
Defined in Michelson.Typed.Arith |
Instances
UnaryArithOp Neg CInt Source # | |
Defined in Michelson.Typed.Arith evalUnaryArithOp :: proxy Neg -> CVal CInt -> CVal (UnaryArithRes Neg CInt) Source # | |
type UnaryArithRes Neg CInt Source # | |
Defined in Michelson.Typed.Arith |
Instances
UnaryArithOp Not CInt Source # | |
Defined in Michelson.Typed.Arith evalUnaryArithOp :: proxy Not -> CVal CInt -> CVal (UnaryArithRes Not CInt) Source # | |
UnaryArithOp Not CNat Source # | |
Defined in Michelson.Typed.Arith evalUnaryArithOp :: proxy Not -> CVal CNat -> CVal (UnaryArithRes Not CNat) Source # | |
UnaryArithOp Not CBool Source # | |
Defined in Michelson.Typed.Arith evalUnaryArithOp :: proxy Not -> CVal CBool -> CVal (UnaryArithRes Not CBool) Source # | |
type UnaryArithRes Not CInt Source # | |
Defined in Michelson.Typed.Arith | |
type UnaryArithRes Not CNat Source # | |
Defined in Michelson.Typed.Arith | |
type UnaryArithRes Not CBool Source # | |
Defined in Michelson.Typed.Arith |
Instances
Instances
UnaryArithOp Eq' CInt Source # | |
Defined in Michelson.Typed.Arith evalUnaryArithOp :: proxy Eq' -> CVal CInt -> CVal (UnaryArithRes Eq' CInt) Source # | |
type UnaryArithRes Eq' CInt Source # | |
Defined in Michelson.Typed.Arith |
Instances
UnaryArithOp Neq CInt Source # | |
Defined in Michelson.Typed.Arith evalUnaryArithOp :: proxy Neq -> CVal CInt -> CVal (UnaryArithRes Neq CInt) Source # | |
type UnaryArithRes Neq CInt Source # | |
Defined in Michelson.Typed.Arith |
Instances
UnaryArithOp Lt CInt Source # | |
Defined in Michelson.Typed.Arith evalUnaryArithOp :: proxy Lt -> CVal CInt -> CVal (UnaryArithRes Lt CInt) Source # | |
type UnaryArithRes Lt CInt Source # | |
Defined in Michelson.Typed.Arith |
Instances
UnaryArithOp Gt CInt Source # | |
Defined in Michelson.Typed.Arith evalUnaryArithOp :: proxy Gt -> CVal CInt -> CVal (UnaryArithRes Gt CInt) Source # | |
type UnaryArithRes Gt CInt Source # | |
Defined in Michelson.Typed.Arith |
Instances
UnaryArithOp Le CInt Source # | |
Defined in Michelson.Typed.Arith evalUnaryArithOp :: proxy Le -> CVal CInt -> CVal (UnaryArithRes Le CInt) Source # | |
type UnaryArithRes Le CInt Source # | |
Defined in Michelson.Typed.Arith |
Instances
UnaryArithOp Ge CInt Source # | |
Defined in Michelson.Typed.Arith evalUnaryArithOp :: proxy Ge -> CVal CInt -> CVal (UnaryArithRes Ge CInt) Source # | |
type UnaryArithRes Ge CInt Source # | |
Defined in Michelson.Typed.Arith |
Data type, holding annotation data for a given Michelson type t
or *
in case no data is provided for the tree.
There is a little semantical duplication between data type constructors.
Semantics behind NStar
constructor are exactly same as semantics behind
N
constructor with relevant Notes'
constructor be given all default
values (which means all annotations are empty).
Constructor NStar
is given as a tiny optimization to allow handling
no-annotation case completely for free (see converge
and mkNotes
functions).
Data type, holding annotation data for a given Michelson type t
.
Each constructor corresponds to exactly one constructor of T
and holds all type and field annotations that can be attributed to a
Michelson type corrspoding to t
.
NTc :: TypeAnn -> Notes' (Tc ct) | |
NTKey :: TypeAnn -> Notes' TKey | |
NTUnit :: TypeAnn -> Notes' TUnit | |
NTSignature :: TypeAnn -> Notes' TSignature | |
NTOption :: TypeAnn -> FieldAnn -> Notes t -> Notes' (TOption t) | |
NTList :: TypeAnn -> Notes t -> Notes' (TList t) | |
NTSet :: TypeAnn -> TypeAnn -> Notes' (TSet ct) | |
NTOperation :: TypeAnn -> Notes' TOperation | |
NTContract :: TypeAnn -> Notes t -> Notes' (TContract t) | |
NTPair :: TypeAnn -> FieldAnn -> FieldAnn -> Notes p -> Notes q -> Notes' (TPair p q) | |
NTOr :: TypeAnn -> FieldAnn -> FieldAnn -> Notes p -> Notes q -> Notes' (TOr p q) | |
NTLambda :: TypeAnn -> Notes p -> Notes q -> Notes' (TLambda p q) | |
NTMap :: TypeAnn -> TypeAnn -> Notes v -> Notes' (TMap k v) | |
NTBigMap :: TypeAnn -> TypeAnn -> Notes v -> Notes' (TBigMap k v) |
converge :: Notes t -> Notes t -> Either Text (Notes t) Source #
Same as converge'
but works with Notes
data type.
convergeAnns :: Show (Annotation tag) => Annotation tag -> Annotation tag -> Either Text (Annotation tag) Source #
Converge two type or field notes (which may be wildcards).
notesCase :: r -> (Notes' t -> r) -> Notes t -> r Source #
Helper function for work with Notes
data type.
notesCase f g notes
is equivalent to
case notes of NStar -> f N v -> g v
mkNotes :: Notes' t -> Notes t Source #
Checks whether given notes n
can be immediately converted to star
and returns either NStar
or N n
.
Given n :: Notes' t
can be immediately converted to star iff all nested
(sn :: Notes t) == NStar
and for each annotation an
: an == def
.
orAnn :: Annotation t -> Annotation t -> Annotation t Source #