h&YnȰ$            ! " # $ % & ' ()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~                !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""#########$$$$%%%%%%%%%%%%%%%%%%%%%%%%&&'''(((((((((((((((((((((((((((((((((((((((((((((((((((((((())))))))))))))))***************************+++++++++++++++,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,-----....................................................................................................................        / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 99999:::::::::::::::::;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<                            ===============>>>>>>>>>>>>??????@@@@@@@@@@@@@AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBCCCCDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEFFFFGGHIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIJJJJJJJKKKKLLLMNNNNNNNNNNNNNNNNNNNNNNNNNNOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUVVVVVVVVVWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYZZZZZZZZZZZZZZZZZZZZZZ[[[[[[[[[[[[[[[[[[[[[[[\\\\\\\\\\\\\\\\\\]]]]]]]]]]]]]]]]]]]]]]^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^________````````````````````````````````aaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbccccccddddddddddddddddddddddddddddddddddddddddddddddddeeeeeeeeeeeeeeeeeeeeeeeeeeeeeffghhhhhhhhhhhhhhhiiiiiiiiiiiiiiijjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj j j j j j k k k k k k l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l m m m m n n n n n n n n n n n o o o o o o o o ! ! ! ! ! ! ! ! ! !p!p!q!q!q!q!r!r!r!r!r!r!r!r!r!r!r!s!s!s!s!s!s!s!s!s!s!s!s!s!s!s!s!s!s!s!s!s!s!s!s!s!s!s!s!s!s!s!s!s!s!s!s!s!s!s!t!t!t!u!u!u!u!u!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!v!w!w!w!w!w!w!w!w!w!w!w!w!w!w!w!w!x!x!x!x!x"x"x"x"x"x"x"x"x"x"x"x"x"x"x"x"x"x"x"x"x"x"x"x"x"x"x"x"x"x"x"x"x"x"x"x"x"x"x"x"x"x"x"x"x"x"x"x"x"x"x"x"x"x"x"x"x"x"x"x"x"x"x"x"x"x"x"x"x"x"x"x"x"x"x"x"x"x"x"x"x"x"x"x"x"x"x"x"x"x"x"x"x"x"x"x"x"x"x"x"x"x"x"x"x"x"x"x"x"x"x"x"x"y"y"y"y"y"y"y"y"z"z"z"z"z"z"z"z#z#z#z#z#z#z#z#z#z#z#z#z#z#z#z#z#z#z#z#z#z#z#z#z#z#z#z#z#z#z#z#z#z#z#z#z#z#z#z#z#z#z#z#z#z#z#z#z#z#z#z#z#z#z#z#z#z#z#z#z#z#z#z#z#z#z#z#z#z#z#z#z#{#{#{#{#{#{#{#{#{#{#{#{#{#{#{#{#{#{#{#{#{#{#{#{#{#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#}#}#}#}#}#}#}#}#}#}$}$}$}$}$}$}$}$}$}$}$}$}$}$}$}$}$}$}$}$}$}$}$}$}$}$}$}$}$}$}$}$}$}$}$}$}$}$}$}$}$}$}$}$}$}$}$}$} Safe-Inferred:!#$%&'(),./0245789:;<>?\93morleyBuild a binary representation of a Zarith natural. This function is partial, only defined for nonnegative $s.(The reason it's not defined to accept a $ is mostly to avoid $/$ conversions at the use sites, since not all libraries, notably  cryptonite , support $.-./0123456789:-./0523419768: Safe-Inferred:!#$%&'(),./0245789:;<>?]N;morley#Encode a number as tezos does this.>In the Tezos reference implementation this encoding is called zarith.;; Safe-Inferred:!#$%&'(),./0245789:;<>?f<morleyA new type that can wrap values so that the RenderDoc instances of the combined value can have a different behavior for the pretty printer.>morleyGeneralize converting a type into a Text.PrettyPrint.Leijen.Text.Doc. Used to pretty print Michelson code and define Fmt.Buildable instances.@morleyWhether a value can be represented in Michelson code. Normally either all values of some type are renderable or not renderable. However, in case of instructions we have extra instructions which should not be rendered. Note: it's not sufficient to just return $ for such instructions, because sometimes we want to print lists of instructions and we need to ignore them complete (to avoid putting redundant separators).Amorley/Environment carried during recursive rendering.$morleyWhether the current expression is going to be used as part of top-level expression or in a similar context. When set to $, you may need to wrap your rendered expression into parentheses.BmorleyRenders a list of > elements surrounded with square brackets, separated by a comma and a space.DmorleyConvert $ to $ with a line width of 80.EmorleyConvert $ to $ in the same manner as D.FmorleyConvert $ to $ in the same manner as D.GmorleyGeneric way to render the different op types that get passed to a contract.$morleyJoin a non-empty list of $ by spacesHmorley0Render a comma-separated list of items in bracesImorley5Render a comma-separated list of items without bracesJmorley#Create a specific number of spaces.KmorleyWrap documents in parentheses if there are two or more in the list.Lmorley#Turn something that is instance of > into a $". It's formatted the same way as D formats docs.Mmorley Works as L; above, but doesn't force the doc to be printed in one line$morley9Here using a page width of 80 and a ribbon width of 1.0 https://hackage.haskell.org/package/wl-pprint-1.2.1/docs/Text-PrettyPrint-Leijen.htmlNmorleyConstructors for AOmorleyConstructors for APmorleyAdd parentheses if needed.QmorleyEnsure parentheses are not required, for case when you cannot sensibly wrap your expression into them.<=>?@ABCDEFGHIJKLMNOPQ>?@<=DEFGHICJKLMBANOPQ Safe-Inferred:!#$%&'(),./0245789:;<>?iSmorleyPath to a leaf (some field or constructor) in generic tree representation.TmorleyWhich branch to choose in generic tree representation: left, straight or right. V is used when there is one constructor with one field (something newtype-like).The reason why we need V can be explained by this example: data A = A1 B | A2 Integer data B = B Bool Now we may search for A1 constructor or B constructor. Without V, in both cases path will be the same ([L]).STUWVTUWVS Safe-Inferred:!#$%&'(),./0245789:;<>?p $morleyCheck that Generic representation for a constructor has given field  fieldName.$morleyCheck that Generic $ has given field  fieldName in a given constructor conName.$morley#Actual recursive implementation of $.$morley9Check whether all fields described for given constructor conName are present in the datatype.This family also checks whether the constructor is present and fails with a  otherwise.$morley%Check whether given constructor name conName is present in $ of a datatype.$morley$Actual recursive implementation for X.XmorleyThis type family checks that field descriptions mention only existing constructors and fields.When descr is empty this family does nothing, to avoid breaking for built-in, non-ADT types.When descr' is not empty, this family will demand $ instance for typ and fail with a  if there none.YmorleyValue-level counterpart to Z.Zmorley8Description of constructors and fields of some datatype.This type is just two nested maps represented as associative lists. It is supposed to be interpreted like this: [(Constructor name, (Maybe constructor description, [(Field name, Field description)]))]"Example with a concrete data type: data Foo = Foo { fFoo :: Int } | Bar { fBar :: Text } deriving (Generic) type FooDescriptions = '[ '( "Foo", '( 'Just "foo constructor", , '[ '("fFoo", "some number") ]) ) , '( "Bar", '( 'Nothing, , '[ '("fBar", "some string") ]) ) ]XYZZYX Safe-Inferred:!#$%&'(),./0245789:;<>?t<[morleyCompute a cryptographic hash of a bytestring using the Blake2b_256 cryptographic hash function. It's used by the BLAKE2B instruction in Michelson.\morleyCompute a cryptographic hash of a bytestring using the Blake2b_160 cryptographic hash function.]morleyCompute a cryptographic hash of a bytestring using the Sha256 cryptographic hash function.^morleyCompute a cryptographic hash of a bytestring using the Sha512 cryptographic hash function._morleyCompute a cryptographic hash of a bytestring using the Sha3_256 cryptographic hash function. It is used by the SHA3 Michelson instruction.`morleyCompute a cryptographic hash of a bytestring using the Keccak_256 cryptographic hash function. It is used by the KECCAK Michelson instruction.[\]^_`[\`]_^ Safe-Inferred:!#$%&'(),./0245789:;<>?u(amorleyOptions that we use in morley-based packages (including morley ) by default.aa Safe-Inferred;!#$%&'(),./0245789:;<=>?&bmorley+Datatype representing arbitrary annotation.fmorley*Field annotation for the entire parameter.gmorley#A convenience synonym for variable whmorley A convenience synonym for field wimorleyA convenience synonym for type wjmorley'Type-level tag for variable annotationskmorley$Type-level tag for field annotationslmorley#Type-level tag for type annotationsmmorleyA constraint representing that type-level annotation tag is known at compile-timenmorleyWhat prefix is used for the given annotation type (identified by tag) in Michelson code, i.e. % for field annotations, @ for variable annotations, : for type annotationsomorleyAn o contains all the typefield variable ws , with each group in order, associated with an entity. Note that in its rendering/show instances the unnecessary annotations will be omitted, as well as in some of the functions operating with it. Necessary ws are the ones strictly required for a consistent representation. In particular, for each group (tf v): - if all annotations are * they are all omitted - if one or more  follow a non-empty w', they are omitted - if one or more  precede a non-empty w%, they are kept - every non-empty w is obviously kept This is why order for each group is important as well as separation of different groups of ws.tmorley&Either one or two variable annotationswmorley Generic TypeFieldVariable AnnotationAs per Michelson documentation, this type has an invariant: (except for the first character, here parametrized in the type tag) the allowed character set is the one matching the following regexp: %|%%|%|[:%][_0-9a-zA-Z][_0-9a-zA-Z.%@]*zmorley8Unidirectional pattern synonym used to pattern-match on w without invoking x{morleyAn o without any w.|morleyAn o with only a single w (of any kind).}morleyAn o with several ws of the same kind.~morleyAn o built from all 3 kinds of w.morleyReturns $ if all ws in the Set are unnecessaryempty. False otherwise.morleyReturns the amount of w;s that are necessary for a consistent representation. See o.morleyRemoves all unnecessary ws. See o.$morleyRemoves all unnecessary ws from a list of the same typemorley%Returns the number of annotations in o for each type.morleyReturns the first annotation in a list of annotations of a specific type in o, or  if this list is empty.morleyReturns the second annotation in a list of annotations of a specific type in o, or , if this list contains less than 2 elements.$morley0Retrieves an annotation of a specific type from o using the passed function.$morleyRenders a single w, this is used in every rendering instance of it. Note that this also renders empty ones/s because a single w does not have enough context to know if it can be omitted, use |! if you want to hide it instead.$morleyRenders a list of w#s, omitting unnecessary empty ones/'. This is used (3 times) to render an o.morleyEmpty w, i.e. no annotationmorley Makes an w" from its textual value, prefix (%@:) excluded Returns a $ error message if the given $ contains invalid charactersmorley :t [annQ||],... :: forall {k} {tag :: k}. Annotation tag:t [annQ|abc|],... :: forall {k} {tag :: k}. Annotation tagmorley:t [typeAnnQ||]... :: TypeAnn:t [typeAnnQ|abc|]... :: TypeAnnmorley:t [fieldAnnQ||]... :: FieldAnn:t [fieldAnnQ|abc|]... :: FieldAnnmorley:t [varAnnQ||] ... :: VarAnn:t [varAnnQ|abc|] ... :: VarAnnmorley>List of all the special Variable Annotations, only allowed in CAR and CDR instructions, prefix (@) excluded. These do not respect the rules of  and .morley3The only special Field Annotation, only allowed in PAIR, LEFT and RIGHT instructions, prefix (%) excluded. This does not respect the rules of  and .morley Checks if a $6 is valid to be the first of an annotation, prefix (%@8:) excluded, the ones following should be checked with  instead. Note that this does not check Special Annotations, see  and morley Checks if a $ is valid to be part of an annotation, following a valid first character (see ) and the prefix (%@<:). Note that this does not check Special Annotations, see  and .bcdefghijklmnopqrstuvwxyz{|}~.wxytuvzopqrs{~|}mnihgflkjbcde Safe-Inferred:!#$%&'(),./0245789:;<>?   Safe-Inferred:!#$%&'(),./0245789:;<>?morleyDescribes how  should decode tag-dependent data. We expect bytes of such structure: 5 followed by a bytestring which will be parsed with .morleyAny decoding error.morley Alias for  constructor.morleyGet a bytestring of the given length leaving no references to the original data in serialized form.morleyGet remaining available bytes.Note that reading all remaining decoded input may be expensive and is thus discouraged, use can use this function only when you know that amount of data to be consumed is limited, e.g. within  call.morleyFail with "unknown tag" error.0 Safe-Inferred:!#$%&'(),./0245789:;<>? morleyError that can happen during parsing of cryptographic primitive types.morley*Encode a bytestring in Base58Check format.morley,Decode a bytestring from Base58Check format.morleyParse a base58check encoded value expecting some prefix. If the actual prefix matches the expected one, it's stripped of and the resulting payload is returned.morley!Template for 'format*' functions.morley Template for 'parse*' functions.morleyReturns first encountered $2 in a list. If there are none, returns arbitrary $%. It is useful to implement parsing.morley*Do randomized action using specified seed.morleyMake a $ from raw bytes.Raw bytes are in the format of Compressed SEC Format. Refer to this article on how this is parsed: https://www.oreilly.com/library/view/programming-bitcoin/9781492031482/ch04.htmlmorley Convert a $ to raw bytes.morley Convert a $ to raw bytes.morley Convert a $ to raw bytes.morleyMake a $ from raw bytes.morleyMake a $* from raw bytes representing a secret key. Safe-Inferred:!#$%&'(),./0245789:;<>?imorleyNewtype wrapper for ByteString which uses hexadecimal representation for JSON serialization. Safe-Inferred:!#$%&'(),./0245789:;<>? Safe-Inferred:!#$%&'(),./0245789:;<>?morleyIf monadic action returns a $ value, it will be thrown. Otherwise the returned value will be returned as is. Safe-Inferred:!#$%&'(),./0245789:;<>?morley Similar to ~, but compares types via  DefaultEq& used in singletons comparisons (see Data.Eq.Singletons module). Safe-Inferred:!#$%&'(),./0245789:;<>?Smorley5Extract datatype name via its Generic representation.:For polymorphic types this throws away all type arguments.morleyRebuild a list into a binary tree of exactly the same form which  Data.Generics uses to represent datatypes.Along with the original list you have to provide constructor for intermediate nodes - it accepts zero-based index of the leftmost element of the right tree and merged trees themselves. Safe-Inferred:!#$%&'(),./0245789:;<>? Safe-Inferred:!#$%&'(),./0245789:;<>?MmorleyA $ of morleyDatatype encoding transformations we apply to a quoter input and output. Note the order is important! We first unescape, then unindent, then trim.morleyUsed to generate quasi-quotersmorley Generate TH $/ for a quoter based on a set of transformationsmorleyMake a $$ using a given set of transformaions$morley A version of  Fmt.indentF' that doesn't indent the first line, and keeps the final line break intact.    Safe-Inferred:!#$%&'(),./0245789:;<>?7morley?For datatype with "myNyan" field it will create "myNyanL" lens. Safe-Inferred:!#$%&'(),./0245789:;<>?ImorleySome defaults in Haskell are debatable and we typically want to customize them in our applications. Some customizations are done at the level of main!. Currently we have two of them: $ from the  with-utf8 package.$ from the uncaught-exception package.'This function is supposed to apply all main- customizations that we typcally want to do.  Safe-Inferred:!#$%&'(),./0245789:;<>?EmorleyA helper record datatype representing a mismatch between two values of some type. One is assumed to be in some sense the "expected" value, the other one is assumed to be the "actual" value.morleyExpected valuemorley Actual valuemorley$Render a mismatch error with a diff.1This is intended to be used with types for which > outputs multiline $'. Generally those are types wrapped in <.morley-Render a mismatch error of lists with a diff.1This is intended to be used with types for which > outputs multiline $'. Generally those are types wrapped in <.! Safe-Inferred;!#$%&'(),./0245789:;<=>?morleyMichelson Typemorley>Since Babylon parameter type can have special root annotation.morley,Annotated Michelson type. We don't name it $ to avoid conflicts with .morley2Extract a raw Michelson type from an annotated onemorleyRender a type representationOrdering between different kinds of annotations is not significant, but ordering among annotations of the same kind is. Annotations of a same kind must be grouped together. (prim @v :t %x arg1 arg2 ...)these are equivalent -PAIR :t @my_pair %x %y PAIR %x %y :t @my_pairmorleyConstruct non-annotated option type from an annotated typemorleyConstruct non-annotated pair type from two annotated typesmorleyConstruct non-annotated or type from two annotated typesmorleyConstruct annotated int type with an empty annotationmorleyConstruct annotated nat type with an empty annotationmorleyConstruct annotated unit type with an empty annotationmorleyConstruct annotated bool type with an empty annotationmorleyConstruct annotated pair type with an empty annotationmorleyConstruct annotated or type with an empty annotationmorleyFor implicit account, which Ty its parameter seems to have from outside.morleyCheck if type is atomic.morleyPredicate checking if type is key$morleyPredicate checking if type is unitmorleyPredicate checking if type is  signature$morleyPredicate checking if type is  operationmorley8Predicate checking if type is comparable, i.e. true for int, nat, string , etc. see  ,https://tezos.gitlab.io/michelson-reference/) for a complete list of comparable types.morleyPredicate checking if type is mutezmorleyPredicate checking if type is  timestampmorleyPredicate checking if type is keyhashmorleyPredicate checking if type is boolmorleyPredicate checking if type is stringmorley-Predicate checking if type is integral, i.e. nat, int, mutez, or  timestampmorleyPredicate checking if type is natmorleyPredicate checking if type is intmorleyPredicate checking if type is bytes??" Safe-Inferred:!#$%&'(),./0245789:;<>? morleyAn inline test assertionmorley!A comment with optional embedded  s. Used with PRINT extended instruction.morleyA stack pattern-matchmorley"A type-variable or a type-constantmorleyA (named) type variablemorleyA reference into the stack.morley3Implementation-specific instructions embedded in a NOP primitive, which mark a specific point during a contract's typechecking or execution.These instructions are not allowed to modify the contract's stack, but may impose additional constraints that can cause a contract to report errors in type-checking or testing.Additionaly, some implementation-specific language features such as type-checking of LetMacro6s are implemented using this mechanism (specifically FN and FN_END).morley,Matches current stack against a type-patternmorley8Copy the current stack and run an inline assertion on itmorley'Print a comment with optional embedded StackRefsmorleyA comment in Michelson codemorleyConvert # to a list of types. Also returns $ which is $. if the pattern is a fixed list of types and $2 if it's a pattern match on the head of the stack.morley+Get the set of variables in a stack pattern# Safe-Inferred:!#$%&'(),./0245789:;<>?zmorley Version of $ that uses )morleySuppose you have a data type X with parameter a and you have two values:  x1 :: X a1 and  x2 :: X a2 . You can't compare them using $, because they have different types. However, you can compare them using  as long as both parameters have SingI instances and their kind is $.morley Version of  for types with 2 parameters.morley Version of  for types with 3 parameters.morley Version of  for types with 3 parameters.morleyHelper function to generate ) and  instances using Sing" as prefix for the type names and S for constructors'.  $ Safe-Inferred:!#$%&'(),./0245789:;<>?Qmorley)Generates an NFData instance for a GADT. Note: This will not generate additional constraints to the generated instance if those are required.morleyCheck if name is a typemorleyAccepts a type constructor and fills it with variables until getting a type of kind *.% Safe-Inferred:!#$%&'(),./0245789:;<>?9.$morley0Reorders entries corresponding to constructors (a) and fields (b) according to some rule.$morleySimple type synonym used (internally) between functions, basically extending $ with the $s of the constructor and its fields. For fields it carries both names in the original order and in the order specified by the strategy (and the latter is paired with depths).$morleyConstructor's depth$morleyConstructor's name$morley2Names of constructor fields in the original order.$morleys for it. This function should when possible make checks and $, using the constructors' $ provided by the $.$morley'Reorder constructors given their names.$morleyReorder fields given their names, the argument depends on whether fields are part of record (and thus named) or not (unnamed).$morleySimple tuple that carries basic info about a constructor: it's name, number of its fields and their names. Used only in this module.$morleySimple tuple that defines the "shape" of a constructor: it's name and number of fields. Used only in this module.$morleySimple tuple specifying the depth of a constuctor and a list of depths for its fields.This is used as a way to specify the tree topology of the Generic instance to derive.morleyIn this strategy the desired depths of contructors (in the type tree) and fields (in each constructor's tree) are provided manually and simply checked against the number of actual constructors and fields.morleyStrategy to make right-balanced instances (both in constructors and fields)..This will try its best to produce a flat tree:4the balances of all leaves differ no more than by 1;leaves at left will have equal or lesser depth than leaves at right.morleyStrategy to make left-balanced instances (both in constructors and fields).)This is the same as symmetrically mapped .morleyStrategy to make fully right-leaning instances (both in constructors and fields).morleyStrategy to make fully left-leaning instances (both in constructors and fields).morleyStrategy to make Haskell's Generics-like instances (both in constructors and fields).This is similar to , except for the "flat" part:for each node, size of the left subtree is equal or less by one than size of the right subtree.This strategy matches A1.1.!customGeneric "T" haskellBalanced is equivalent to mere deriving stock Generic T.morley.Modify given strategy to reorder constructors.The reordering will take place before depths are evaluated and structure of generic representation is formed. Example: .reorderingConstrs alphabetically rightBalanced.morley(Modify given strategy to reorder fields.Same notes as for  apply here. Example: reorderingFields forbidUnnamedFields alphabetically rightBalanced.morley9Modify given strategy to reorder constructors and fields.Same notes as for  apply here. Example: ?reorderingData forbidUnnamedFields alphabetically rightBalanced.morley$Sort entries by name alphabetically.morley4Leave unnamed fields intact, without any reordering.morleyFail in case records are unnamed and we cannot figure out the necessary reordering.$morleyConstruct a strategy that only constructs Generic instance of given form, without e.g. changing the order of entries.morleyHelper to make a strategy that created depths for constructor and fields in the same way, just from their number.The provided function f" must satisfy the following rules: length (f n) D n"sum $ (x -> 2 ^^ (-x)) <$> f n D 1 (unless n = 0)morleyLike , but allows specifying different strategies for constructors and fields.morley&Helper for making a constructor depth.Note that this is only intended to be more readable than directly using a tuple with 1 and for the ability to be used in places where RebindableSyntax) overrides the number literal resolution.morley Helper for making a field depth.Note that this is only intended to be more readable than directly using a tuple with 1 and for the ability to be used in places where RebindableSyntax) overrides the number literal resolution.morleyIf a $2 type is given, this function will generate a new $ instance with it, and generate the appropriate "to" and "from" methods. Otherwise, it'll generate a new $ instance as well.$morleyApply a reordering strategy.This uses given  [CstrNames] to understand how constructors and their fields should be reordered, and applies the same transposition to entries within $.morley*Reifies info from a type name (given as a $<). The lookup happens from the current splice's scope (see $) and the only accepted result is a "plain" data type (no GADTs).morleyDerives, as well as possible, a type definition from its name, its kind (where known) and its variables.$morley4Extract the info for each of the given constructors.$morley#Combines depths with constructors, $*ing in case of mismatches, and generates $"s for the constructors' arguments.$morley Creates the $ type for an unbalanced $ instance, for a type given its name, constructors' depths and derived full type.Note: given that these types definition can be very complex to generate, especially in the metadata, here we let generic-deriving# make a balanced value first (see $!) and then de-balance the result.$morleyBreaks down a tree of Generic types from the contructor of "nodes" and the constructor for "leaves" metadata.This expects (and should always be the case) the "root" to be a Generic metadata contructor, which is returned in the result alongside the list of leaves (in order).$morleyCreate the unbalanced $ fuction declaration for a type starting from its list of weighted constructors.$morleyCreate the unbalanced $ fuction declaration for a type starting from its list of weighted constructors.$morleyRecursively aggregates the values in the given list by merging (with the given function) the ones that are adjacent and with the same depth.This will fail for every case in which the list cannot be folded into a single 0-depth value.$morley(Original name of a constructor or field.morleyPatch a given strategy by applying a transformation function to constructor names before passing them through ordering function.morleyPatch a given strategy by applying a transformation function to field names before passing them through ordering function.& Safe-Inferred:!#$%&'(),./0245789:;<>?׻morleyDefault layout in LIGO.To be used with  , see this method for more info.This is similar to , but!fields are sorted alphabetically;always puts as large complete binary subtrees as possible at left.morleyComb layout in LIGO ( [@layout:comb] ).To be used with .Note: to make comb layout work for sum types, make sure that in LIGO all the constructors are preceded by the bar symbol in your type declaration: type my_type = [@layout:comb] | Ctor1 of nat C bar symbol _must_ be here | Ctor2 of int ... !Though the situation may change:  .https://gitlab.com/ligolang/ligo/-/issues/1104.' Safe-Inferred:!#$%&'(),./0245789:;<>?آmorley,Leads first character of text to lower case.(For empty text this will throw an error. Safe-Inferred:!#$%&'(),./0245789:;<>?morley*Constaints that can be provided on demand.Needless to say, this is a pretty unsafe operation. This typeclass makes using it safer in a sense that getting a segfault becomes harder, but still it deceives the type system and should be used only if providing a proper proof would be too difficult.morley%Produce a constraint out of thin air.morley"A value of type parametrized with some type parameter.morleyData.List.Singletons.SList analogue for .morley Similar to SingI [], but does not require individual elements to be also instance of SingI.morleyBring type-level list at term-level using given function to demote its individual elements.morleyMake sure given type is evaluated. This type family fits only for types of $ kind.morley-Fail with given error if the condition holds.morley5Fail with given error if the condition does not hold.morleyDifference between two lists.morley+Remove all occurences of the given element.morley+Equality constraint in form of a typeclass.morleyA natural conclusion from the fact that an error has not occurred.morley*Reify type equality from boolean equality.morley Given a type-level list that is )(, construct evidence that it is also a  . Note that 8 is weaker, hence this construction is always possible.morleySplit a record into two pieces.morleyGHC can't deduce this itself because in general a type family might be not associative, what brings extra difficulties and redundant constraints, especially if you have complex types. But (++) type family is associative, so let's define this small hack.morleyUtility function to help transform the first argument of a binfunctor.morleyIn majority of the cases we don't want to mock typeclass constraints since coercing instances of typeclasses with methods is utterly unsafe.# ,# , Safe-Inferred;!#$%&'(),./0245789:;<=>?morleyA convenient alias.We are going to use . numbers for type-dependent logic and normal $0s in user API, need to distinguish them somehow.morleyWe can have `RequireLongerOrSameLength = (RequireLongerOrSameLength' l a, LongerOrSameLength l a)`, but apparently the printed error message can be caused by  rather than `. We do not know for sure how it all works, but we think that if we require constraint X before Y (using multiple `=>`)s) then X will always be evaluated first.$morley in form of constraint that produces good error message. Should be used together with  because  gives GHC more information. We use it in combination, so that it gives enough information to GHC and also producess good error messages.$morleyComparison of type-level naturals, raises human-readable compile error when does not hold.%Here we use the same approach as for  , this type family is internal.$morleyEvaluates list length.This type family is a best-effort attempt to display neat error messages when list is known only partially.For instance, when called on Int ': Int ': s, the result will be OfLengthWithTail 2 s! - compare with result of simple  - 1 + 1 + Length s.5For concrete types this will be identical to calling FromPeano (Length l).morley; in form of constraint that gives most information to GHC.morley Similar to , but returns $/ when list length equals to the passed number.morley3Comparison of type-level naturals, as a constraint.morley1Comparison of type-level naturals, as a function.It is as lazy on the list argument as possible - there is no need to know the whole list if the natural argument is small enough. This property is important if we want to be able to extract reusable parts of code which are aware only of relevant part of stack.morley Out of two  naturals, return the larger onemorley Out of two ! naturals, return the smaller onemorley naturals subtractionmorley naturals additionmorley naturals comparissonmorley naturals comparissonmorleyA synonym for SingI (ToPeano n).. Essentialy requires that we can construct a  singleton for a given $morley"A constraint asserting that GHC's Nat n and Peano p% are the same (up to an isomorphism)morley;Get the peano singleton for a given type-level nat literal. peanoSing @2 SS (SS SZ)morleySame as , but only requires $ instance.'Witnesses half the equivalence between  KnownNat n and SingI (ToPeano n)morleyRun a computation requiring SingI (ToPeano n) in a context which only has  KnownNat n. Mostly useful when used with %morleyLift a given term-level $ to the type level for a given computation. The computation is expected to accept a % for the sake of convenience: it's easier to get at the type-level natural with ScopedTypeVariables) when pattern-matching on the proxy, e.g. (x :: Natural) `withSomePeano` \(_ :: Proxy n) -> doSomeNatComputation @nmorley Utility to  a Peano %leton.'Useful when dealing with the constraintmorleySingleton additionmorleyConvenience synonym for %morleyProof that for naturals, k + (m + 1) = n entails n > kmorleyProof that for naturals, x + (y + 1) = (x + y) + 1morley Proof that  x + y = y + xmorleyProof that for naturals,  min(n, n) = nmorleyProof that for naturals,  x >= y > z implies x > z-*+-*+1( Safe-Inferred:!#$%&'(),./0245789:;<>?!morleyExistential capturing a fixed-size list whose length is only known at runtime.In most cases, it's probably better to use regular lists, but this can be occasionally useful.We do not provide the % and % instances, since "zipper" applicative is ill-defined for lists of different length, and having inconsistent instances between this and  is more confusing than useful.Unlike regular sized list,  SomeSizedList is a % and a %:>fromList "ab" <> fromList "de" <> mempty :: SomeSizedList CharSomeSizedList (SS (SS (SS (SS SZ)))) ('a' :< 'b' :< 'd' :< 'e' :< Nil)morley-Actual fixed-size list GADT, parametrized by  natural. You generally don't want to use this directly, since % is not very ergonomic. Prefer using  unless writing utility functions that need to do type-level arithmetic..Note that while this has the usual instances, % and % are not the same as for regular lists: they implement "zipper" semantics, i.e. f <*> x is the same as zipWith ($) f xmorley?The primary fixed-size list type. Parametrized by a type-level %% as length and type as element type.Internally powered by  numbersmorleySized list Nil pattern. Unlike  this pattern can be used to auto-deduce the type of the result, see .morley Sized list cons pattern. Unlike  this pattern can be used to auto-deduce the type of the result, e.g.!a ::< b ::< c ::< Nil' = pure 'a' (a, b, c) ('a','a','a')morley;Try to make a fixed-size list from a regular list, given a % . Returns %+ if the regular list has incorrect length.fromListMaybe @3 [1, 2, 3]Just (1 :< 2 :< 3 :< Nil)fromListMaybe @4 [1, 2, 3]NothingmorleySame as , but accepts an explicit  singleton.morleyRun some computation with a % list converted to ". Similar to pattern-matching on , but asserts on the type level that list is in fact not empty.morley.Run some computation with a list converted to #. The same as pattern-matching on .morleyConstruct a list of given length from a regular list. Raise error if length is inconsistent.unsafeFromList @3 [1, 2, 3]1 :< 2 :< 3 :< NilunsafeFromList @1 [1, 2, 3]*** Exception: Invalid list size in Morley.Util.SizedList.unsafeFromList...%morleySame as , but accepts explicit  singletonmorley Convert a  to %morleyReplicate a value n times. This is a version returning an existential. You probably want  or `.morleyReplicate a value n times, where n is passed as a type-level natural. This is essentially a synonym for %.replicateT @5 'a'&'a' :< 'a' :< 'a' :< 'a' :< 'a' :< NilmorleyAs , but accepts an explicit  singleton.morleyZip two lists of potentially different lengths. If one list is longer, extraneous elements will be ignored.8zip (unsafeFromList @3 "abc") (unsafeFromList @4 "defg")*('a','d') :< ('b','e') :< ('c','f') :< NilmorleyZip using a binary operation.morleyGiven a type-level %" and a generator function, make a Indexing starts at 0generate @3 (+1)1 :< 2 :< 3 :< NilmorleySame as , but accepts an explicit  singleton, and passes an explicit singleton as index to the generator functionmorley Reverse a reverse $ generate @3 (+1)3 :< 2 :< 1 :< NilmorleyAppend two sized lists.+generate @3 (+1) `append` generate @3 (+11)$1 :< 2 :< 3 :< 11 :< 12 :< 13 :< Nilmorley#Unzip a sized list using a functionmorleyUnzip a sized list of pairsmorley-Index into a list using a type-level constant#index @2 $ unsafeFromList @5 [1..5]3morleySame as , but accepts an explicit  singleton(Note, that if you wish to use this with `, indexing into some other list, for one, you may want to rethink your approach, since it's pretty inefficient. For two, you may run into arcane compiler error messages, e.g.'let someList = 'a' :< 'b' :< 'c' :< Nilgenerate' @_ @Char (peanoSing @2) $ \(sg, _) -> index' sg someList...5 @ Could not deduce: ('S ('S ('S 'Z)) > m) ~ 'True...To make this work, use  proof:let slLen = length' someListlet len = peanoSing @2generate' @_ @Char len $ \(sg, _) -> transitivity slLen len sg |- index' sg someList'a' :< 'b' :< NilmorleyUse a term-level $ to index into a list. Since the natural can be larger than the length of the list, returns a %.morley)Get the first element of a non-empty listmorleyGet elements after the firstmorleyConstruct a list of one elementmorley7Take a fixed number of elements, given by a type-level %,. Must be smaller than the size of the list"take @3 $ unsafeFromList @5 [1..5]1 :< 2 :< 3 :< Nilmorley7Drop a fixed number of elements, given by a type-level %,. Must be smaller than the size of the list"drop @3 $ unsafeFromList @5 [1..5] 4 :< 5 :< Nilmorley(splitAt @n xs = (take @n xs, drop @n xs)#, but traverses the list only once%splitAt @3 $ unsafeFromList @5 [1..5]"(1 :< 2 :< 3 :< Nil,4 :< 5 :< Nil)morley5Return a Peano singleton representing the list lengthmorley Empty listmorleyCons&(555 Safe-Inferred:!#$%&'(),./0245789:;<>?  ) Safe-Inferred:!#$%&'(),./0245789:;<>? t* Safe-Inferred:!#$%&'(),./0245789:;<>?morley"Picking anchor for various things.What you want here is potentially adding some prefix to ensure anchors uniqueness. It is not necessary to preprocess the text to fit anchor format - that will happen when the anchor is embedded into .morleyAnchor with given text.morley!Level of header, starting from 1.morleyA piece of markdown document.This is opposed to $ type, which in turn is not supposed to contain markup elements.morleyTurn text into valid anchor. Human-readability is not preserved.morley#Text which is hidden until clicked.morleyQuasi quoter for Markdown. This supports interpolation via #{name} syntax.Please note that we previously supported expressions inside interpolated splices. This is no longer the case. Only literal variable names can be used. is implemented in terms of , see Morley.Util.Interpolate2 for more information on how interpolation works.+ Safe-Inferred:!#$%&'(),./0245789:;<>?morleyPeanoNatural data typeThe PN constructor stores s :: SingNat n and  k :: Natural$ with the following invariant: if PN s k :: PeanoNatural n, then k == n. This definition allows extracting values of Natural without O(n) conversion from  SingNat n.morleyThe following patterns are introduced for convenience. This allow us to avoid writing Succ (Succ Zero) in several places.morley Patterns  and  We introduce pattern synonyms  and  assuming that  and  cover all possible cases that satisfy the invariant. Using these patterns, we also avoid cases when `k /= peanoValSing @n s`morleytoPeanoNatural and toPeanoNatural' connect PeanoNatural with natural numbers known at run-time.morley Check if two s are equal, and return evidence of type equality between the corresponding %s.morleyGet a corresponding  from a . , Safe-Inferred:!#$%&'(),./0245789:;<>?/morley6Michelson language type with annotations stripped off.morleyConverts from  to .morley"Format type stack in a pretty way.$$- Safe-Inferred:!#$%&'(),./0245789:;<>?morleyFor a given node index i7, this type family checks whether a pair has at least i+1 nodes.Note that the index 0 is always valid, even if the input type is not a pair.morley(Checks whether a pair contains at least n elements.morley3Returns the number of nodes in a right-combed pair.morley4Returns the number of leaves in a right-combed pair. CombedPairLeafCount ('TPair 'TInt ('TPair 'TString 'TUnit)) ~ ToPeano 3If the pair contains sub-trees to the left, they will not be accounted for. E.g. the length of pair w (pair x y) z is 3.. Safe-Inferred:!#$%&'(),./0245789:;<>?%morley) and  instances for the  kind.morleyMonadic version of >. Throws an error using the given function if the cast fails.morleyMonadic version of . Throws an error using the given function if the two types are not equal.morley Version of  that uses %morleyPreviously, we were using ) constraints in  constructors. That was not so optimal because we have been spending too much space at runtime. Instead of that, we process values of  using the function  in those places where the ) constraint is required.  allows one to create the ) context for a given .&& Safe-Inferred:!#$%&'(),./0245789:;<>??[morley.Error type for when a value is not well-typed.morleyThis class encodes Michelson rules w.r.t where it requires comparable types. Earlier we had a dedicated type for representing comparable types CT,. But then we integreated those types into T. This meant that some of the types that could be formed with various combinations of T would be illegal as per Michelson typing rule. Using this class, we inductively enforce that a type and all types it contains are well typed as per Michelson's rules.morley2Constraints required for instance of a given type.morley2Constraints required for instance of a given type.morleyAllows using a scope that can be proven true with a De Morgan law.Many scopes are defined as not a (or rather  a ~ 'False) where a/ is a negative property we want to avoid as a %. The negative constraints are implemented with a type family that for some combination types resolves to itself applied to the type arguments in an or , e.g. A pair l r has x if l or r contain x.Because of the De Morgan laws  not (a or b) implies (not a) and (not b) or in our case: pair does not contain x -> a and b don't contain x.GHC is however not able to prove this, so we need to use another (impossible) %& to forcefully "prove" the two scopes.morleyAlias for comparable types.morley$Should be present for common scopes.morley,Check that constraint hold for a given type.morleyAlias for constraints which are required for untyped representation.morleySet of constraints that Michelson applies to argument type and return type of views. All info related to views can be found in  https://gitlab.com/tezos/tzip/-/blob/master/drafts/current/draft_views.mdTZIP.?Not just a type alias in order to be able to partially apply itmorley=Set of constraints that Michelson applies to unpacked values.It is different from , e.g. contract- type cannot appear in a value we unpack to.?Not just a type alias in order to be able to partially apply itmorley;Set of constraints that Michelson applies to packed values.?Not just a type alias in order to be able to partially apply itmorley$Returns whether the type is dupable.morley2Alias for constraints which Michelson requires in DUP instruction.morley>Set of constraints that Michelson applies to pushed constants.?Not just a type alias in order to be able to partially apply itmorley>Set of constraints that Michelson applies to contract storage.?Not just a type alias in order to be able to partially apply itmorley8Set of constraints that Michelson applies to parameters.?Not just a type alias in order to be able to partially apply it%morley-Whether a value of this type _may_ contain a  sapling_state value.%morleyA value of type t may or may not contain a  sapling_state value.%morleyA value of type t cannot contain  sapling_state values.morley2Whether a value of this type _may_ contain nested big_maps.morleyA value of type t may or may not contain nested big_maps.morleyA value of type t cannot contain nested big_maps.morley-Whether a value of this type _may_ contain a big_map value.morleyA value of type t may or may not contain a big_map value.morleyA value of type t cannot contain big_map values.morley-Whether a value of this type _may_ contain a ticket value.morleyA value of type t may or may not contain a ticket value.morleyA value of type t cannot contain ticket values.morley-Whether a value of this type _may_ contain a contract value.morleyA value of type t may or may not contain a contract value.morleyA value of type t cannot contain contract values.morley8Whether a value of this type _may_ contain an operation.morleyA value of type t% may or may not contain an operation.morleyA value of type t cannot contain big_map values.morleyConstraint that rises human-readable error message, in case given value can't be comparedmorley This is like ., it raises a more human-readable error when t type is concrete, but GHC cannot make any conclusions from such constraint as it can for (. Though, hopefully, it will someday:  /https://gitlab.haskell.org/ghc/ghc/issues/11503#11503. Use this constraint in our eDSL.morleyReport a human-readable error that given value is not comparablemorley#Report a human-readable error that  contains another morley$Report a human-readable error about  at a wrong place.%morley$Report a human-readable error about  at a wrong place.morley$Report a human-readable error about  at a wrong place.morley$Report a human-readable error about  at a wrong place.morley$Report a human-readable error about  at a wrong place.morley:Constraint which ensures that there are no nested bigmaps.%morley.Constraint which ensures that a value of type t does not contain  sapling_state values.morley.Constraint which ensures that a value of type t does not contain big_map values.morley.Constraint which ensures that a value of type t does not contain ticket values.morley.Constraint which ensures that a value of type t does not contain contract values.morley.Constraint which ensures that a value of type t does not contain operations.Not just a type alias in order to be able to partially apply it (e.g. in %).morley1Constraint which ensures that type is comparable.%morley-Whether a value of this type _may_ contain a  samping_state value.morley2Whether a value of this type _may_ contain nested big_maps.Nested big_maps (i.e. big_map which contains another big_map inside of it's value type) are prohibited in all contexts. Some context such as PUSH, APPLY, PACK/UNPACK instructions are more strict because they don't work with big_map at all.morley-Whether a value of this type _may_ contain a big_map value.morley-Whether a value of this type _may_ contain a ticket value.morley-Whether a value of this type _may_ contain a contract value.In some scopes (constants, storage) appearing for contract type is prohibited. Contracts in input/output of lambdas are allowed without limits though.morley8Whether a value of this type _may_ contain an operation.In some scopes (constants, parameters, storage) appearing for operation type is prohibited. Operations in input/output of lambdas are allowed without limits though.%morleyEvidence of that  is deducable from .morleyReify  contraint from . Left for backward compatibility.%morleyReify  contraint from .morleyReify  contraint from .%morleyReify  contraint from .%morleyReify % contraint from %.morleyCheck at runtime whether a value of the given type _may_ contain an operation.morleyCheck at runtime whether a value of the given type _may_ contain a contract value.morleyCheck at runtime whether a value of the given type _may_ contain a ticket value.morleyCheck at runtime whether a value of the given type _may_ contain a big_map value.morleyCheck at runtime whether a value of the given type _may_ contain nested big_maps.%morleyCheck at runtime whether a value of the given type _may_ contain a  sapling_state value.morleyCheck at runtime that a value of the given type cannot contain operations.morley?Check at runtime that a value of the given type cannot contain contract values.%morley?Check at runtime that a value of the given type cannot contain ticket values.morleyCheck at runtime that a value of the given type cannot containt big_map values%morleyCheck at runtime that a value of the given type cannot containt  sapling_state valuesmorleyCheck at runtime that a value of the given type cannot contain nested big_maps.%morleyHelper to build a  by using a  that we know cannot fail.morleyGiven a type, provide evidence that it is well typed w.r.t to the Michelson rules regarding where comparable types are required.morley Version of  that accepts % at term-level.)()( Safe-Inferred:!#$%&'(),./0245789:;<>?Gmorley6Condition Error helper to check if two types are equal:k! AssertTypesEqual Int Int ('Text "This should not result in a failure")AssertTypesEqual Int Int ('Text "This should not result in a failure") :: Constraint= (() :: Constraint, Int ~ Int):k! AssertTypesEqual Bool Int ('Text "This should result in a failure")AssertTypesEqual Bool Int ('Text "This should result in a failure") :: Constraint= ((TypeError ...), Bool ~ Int)morleyConditional type error.*There is a very subtle difference between  and the following type family: type family TypeErrorUnlessAlternative (cond :: Bool) (err :: ErrorMessage) :: Constraint where TypeErrorUnlessAlternative cond err = ( If cond (() :: Constraint) (TypeError err) , cond ~ 'True )If cond? cannot be fully reduced (e.g. it's a stuck type family), then:TypeErrorUnless2 will state that the constraint cannot be deduced.TypeErrorUnlessAlternative( will fail with the given error message err. For example: -- Partial function type family IsZero (n :: Peano) :: Bool where IsZero ('S _) = 'False f1 :: TypeErrorUnless (IsZero n) ('Text "Expected zero") => () f1 = () f2 :: TypeErrorUnlessAlternative (IsZero n) ('Text "Expected zero") => () f2 = () f1res = f1 @'Z -- @ Couldn't match type @IsZero 'Z@ with @'True@ f2res = f2 @'Z -- @ Expected zero%As you can see, the error message in f2res is misleading (because the type argument actually _is_ zero), so it's preferable to fail with the standard GHC error message.     Safe-Inferred:!#$%&'(),./0245789:;<>?H morley)Proxy for a label type that includes the  constraint morleyUtility function to get the $ representation of a      Safe-Inferred:!#$%&'(),./0245789:;<>?M morley7Isomorphism between named entity and the entity itself. morleyConvenience pattern synonym. Use to construct an optional named value.1To pattern-match on an optional named value, use  or  in a view pattern::{let someFunc (argDef #arg1 "" ->arg1) (argDef #arg2 "" -> arg2) = arg1 <> arg2'in someFunc ! #arg1 "asd" ! #arg2 "efg":}"asdefg" morley arg1) (arg #arg2 -> arg2) = arg1 + arg2in someFunc ! #arg1 1 ! #arg2 2:}3 morleySpecial version of 'Morley.Util.Named.(:!)' for monadic operations morleySpecial version of 'Morley.Util.Named.(:?)' for monadic operations%morleyIsomorphism between named entity and the entity itself wrapped into the respective functor." !#$% #$ " ! % 4 4  Safe-Inferred:!#$%&'(),./0245789:;<>?S; morleySupporting typeclass for  . It specifies how a value should be parsed from command line. Even though the main purpose of this class is to implement helpers below, feel free to use it for other goals. morley"This string will be passed to the % function, hence we use $ type rather $ (even though we use $ almost everywhere). morleyMaybe add the default value and make sure it will be shown in help message. morley6Parser for path to a file where output will be writen. morley7Parse a number, checking for overflows and other stuff. morley Create a % for a value using   instance (hence CL in the name). It uses reader and metavar from that class, the rest should be supplied as arguments.We expect some common modifiers to be always provided, a list of extra modifies can be provided as well. morleyA more general version of  = which takes a list of extra (not as widely used) modifiers. morleyAkin to  (, but for arguments rather than options. morleyAkin to  (, but for arguments rather than options. morleyParser for command options morley Create a %' for a value using its type-level name.This expects type-level name to be in camelCase as appropriate for Haskell and transforms the variable inside.&'  &' / Safe-Inferred:!#$%&'(),./0245789:;<>?bb morley The result of opening the chest. morleyThe chest was opened correctly. morleyThe chest was opened correctly, but the contents do not decode with the given symmetric key. morleyThe chest was not opened correctly, i.e. proof verification failed. morleyA locked chest morley:A chest "key" with proof that it was indeed opened fairly. morleyCiphertext with nonce.%morley!A nonce for symmetric encryption. morleyNumber of steps a timelock needs to be opened without knowing a "secret", i.e. modulo factorization.(The reference implementation uses OCaml int, and it can only be positive, so on 64-bit architecture it's actually a 62-bit natural. We use % to represent it.The constructor is marked Unsafe since GHC does not warn on overflowing literals (exceeding custom %# type bounds), thus the resultant  " value may get truncated silently. UnsafeTLTime 4611686018427387906UnsafeTLTime {unTLTime = 2}%morleyA "proof" that the chest was opened fairly, i.e. the key wasn't just guessed.&The proof is verified by checking that) a ^ (2 ^ t) = (p ^ l) (a ^ r) \pmod n which is equivalent to 2 ^ t = (((2 ^ t) / l) * l) + (2 ^ t \mod l) \pmod {\phi(n)} where a is a % value, t is  , p is %, n is %, l is a prime, chosen deterministically from the hash of the puzzle, and r = 2^t \pmod lWhat this essentially boils down to, is that we can compute the "proof" either as* p = a^{2^t / l \mod {\phi(n)}} \pmod n 'if we know the modulo factorization, or p = a^{2^t / l} \pmod n  if we don't.See  $https://eprint.iacr.org/2018/712.pdf section 3.2.%morley&The key for the symmetric encryption, K.%morleyThe "unlocked" value, i.e. a^{2^t} \pmod n, where a is % value, t is   and n is %.%morleyThe "locked" value. Essentially a random integer between 0 and % (exclusive).%morley RSA-inspired semi-prime modulus.%morley:RSA-inspired prime factors, which produce (literally) the %.!This value should be kept secret. morleySafely creates   checking for overflow and underflow. Accepts a number of any type. morleySafely creates  .&This is the recommended way to create   values.When constructing literals, you'll need to specify the type of the literal. Bear in mind that GHC will check for literal overflow on builtin types like % and % , but not on %, so be aware that   from % will overflow silently. Prefer using builtin types when possible.3unTLTime $ toTLTime (4611686018427387903 :: Word62)46116860184273879033unTLTime $ toTLTime (4611686018427387904 :: Word62)0 morley#Create a timelock puzzle and a key. morleyForge a chest key the hard way. morleyTry to (quickly) open a chest with the given key, verifying the proof. morley Convert a  ( to binary representation, used by Tezos morley Convert a  ( to binary representation, used by Tezos morleyRead a  * from binary representation, used by Tezos morleyRead a  * from binary representation, used by Tezos morleyConstruct a chest purely based on a seed for pseudorandom generator. This is not suitable for cryptography, used in tests. morley Chest contentmorley1Time (in elementary actions) to open without key. morleyPseudo-random seedmorley Chest contentmorley3TLTime (in elementary actions) to open without key. 0 Safe-Inferred:!#$%&'(),./0245789:;<>?s morleyEntrypoint name.'There are two properties we care about: Special treatment of the default entrypoint name. default is prohibited in the CONTRACT instruction and in values of address and contract. types. However, it is not prohibited in the SELF' instruction. Hence, the value inside EpName can be  "default", so that we can distinguish SELF and  SELF %default. It is important to distinguish them because their binary representation that is inserted into blockchain is different. For example, typechecking  SELF %default consumes more gas than SELF. In this module, we provide several smart constructors with different handling of default3, please use the appropriate one for your use case.The set of permitted characters. Intuitively, an entrypoint name should be valid only if it is a valid annotation (because entrypoints are defined using field annotations). However, it is not enforced in Tezos. It is not clear whether this behavior is intended. There is an upstream  +https://gitlab.com/tezos/tezos/-/issues/851issue which received bug label, so probably it is considered a bug. Currently we treat it as a bug and deviate from upstream implementation by probiting entrypoint names that are not valid annotations. If Tezos developers fix it soon, we will be happy. If they don't, we should (maybe temporarily) remove this limitation from our code. There is an  7https://gitlab.com/morley-framework/morley/-/issues/275issue in our repo as well. morleyThis is a bidirectional pattern that can be used for two purposes:  Construct an  % referring to the default entrypoint.Use it in pattern-matching or in equality comparison to check whether   refers to the default entrypoint. This is trickier because there are two possible  / values referring to the default entrypoints.   will match only the most common one (no entrypoint). However, there is a special case: SELF instruction can have explicit %default7 reference. For this reason, it is recommended to use   instead. Pattern-matching on   is still permitted for backwards compatibility and for the cases when you are sure that   does not come from the SELF instruction. morleyCheck whether given  + refers to the default entrypoint. Unlike   pattern, this function correctly handles all cases, including the SELF instruction. morleyMake up  / from annotation in parameter type declaration.Returns %# if no entrypoint is assigned here. morleyTurn entrypoint name into annotation for contract parameter declaration. morleyMake up   from annotation which is reference to an entrypoint. Note that it's more common for Michelson to prohibit explicit default entrypoint reference.Specifically, %default' annotation is probitited in values of address and contract$ types. It's also prohibited in the CONTRACT/ instruction. However, there is an exception:  SELF %default is a perfectly valid instruction. Hence, when you construct an  $ from an annotation that's part of SELF, you should use   instead. morley Make up an  * from an annotation which is part of the SELF instruction. morleyTurn entrypoint name into annotation used as reference to entrypoint. morleyMake a valid entrypoint name from an arbitrary text. This function prohibits explicit default= entrypoint name which is permitted by Michelson inside the SELF instruction. This limitation shouldn't be restrictive because SELF is equivalent to  SELF %default. morleyGiven an untyped parameter type, extract a map that maps entrypoint names to the their parameter types. If there are duplicate entrypoints in the given Type then the duplicate entrypoints at a deeper nesting level will get overwritten with the ones that are on top.%morley Version of   for plain untyped type.  1 Safe-Inferred:!#$%&'(),./0245789:;<>?R&%morley? morleyA type error asking to use   instead of $. morleyMichelson string value.This is basically a mere text with limits imposed by the language:  9https://tezos.gitlab.io/whitedoc/michelson.html#constants Although, this document seems to be not fully correct, and thus we applied constraints deduced empirically.You construct an item of this type using one of the following ways:6With QuasyQuotes when need to create a string literal.[mt|Some text|]#UnsafeMText {unMText = "Some text"}With  - when constructing from a runtime text value.With   when absolutelly sure that given string does not violate invariants.With   when not sure about text contents and want to make it compliant with Michelson constraints. morley?E morley"Secp256k1 cryptographic signature. morley#Secp256k1 secret cryptographic key. morley#Secp256k1 public cryptographic key. morley1Deterministicaly generate a secret key from seed. morley&Create a public key from a secret key. morley Convert a   to raw bytes. morleyMake a   from raw bytes. morley Convert a   to raw bytes. morleyMake a   from raw bytes.%morley Convert a   to raw bytes.%morleyBase16 format is 11a2e0c9 morley$Sign a message using the secret key. morleyCheck that a sequence of bytes has been signed with a given key.  4 Safe-Inferred:!#$%&'(),./0245789:;<>? morleyP256 cryptographic signature. morleyP256 secret cryptographic key. morleyP256 public cryptographic key. morley1Deterministicaly generate a secret key from seed. morley&Create a public key from a secret key. morley Convert a   to raw bytes. morleyMake a   from raw bytes. morley Convert a   to raw bytes. morleyMake a   from raw bytes.%morley Convert a   to raw bytes.%morleyBase16 format is 1051eebd morley$Sign a message using the secret key. morleyCheck that a sequence of bytes has been signed with a given key.  5 Safe-Inferred:!#$%&'(),./0245789:;<>? morley ED25519 cryptographic signature. morley!ED25519 secret cryptographic key. morley!ED25519 public cryptographic key. morley1Deterministicaly generate a secret key from seed. morleyGenerate a random secret key. morley&Create a public key from a secret key. morley Convert a   to raw bytes. morleyMake a   from raw bytes. morley Convert a   to raw bytes. morleyMake a   from raw bytes. morley$Sign a message using the secret key. morleyCheck that a sequence of bytes has been signed with a given key.  6 Safe-Inferred;!#$%&'(),./0245789:;<=>?! morley+What specific type of hash is used for the  . morley2A kind of a hash: it may be a public key hash for tz1, tz2 and tz35 addresses, it may be a level-2 public key hash for tz4 addresses, it may be a contract hash for contract addresses, or it may be a transaction rollup hash for txr1 addresses. morley2Convenience synonym for a transaction rollup hash. morley(Convenience synonym for a contract hash. morley2Convenience synonym for a level-2 public key hash. morley4Convenience synonym for an on-chain public key hash. morleyBlake2b_160 hash of something. morleyWhich kind of hash. morley Hash itself.%morley List all  s for a given  . morley2A compatibility synonym for a public key hash tag. morleyCryptographic signatures used by Tezos. Constructors correspond to   constructors.Tezos distinguishes signatures for different curves. For instance, ed25519 signatures and secp256k1 signatures are printed differently (have different prefix). However, signatures are packed without information about the curve. For this purpose there is a generic signature which only stores bytes and doesn't carry information about the curve. Apparently unpacking from bytes always produces such signature. Unpacking from string produces a signature with curve information. morley4Signature that uses the ed25519 cryptographic curve. morley6Siganture that uses the secp256k1 cryptographic curve. morley7Signature that uses the NIST P-256 cryptographic curve. morley-Generic signature for which curve is unknown. morleySecret cryptographic key used by Tezos. Constructors correspond to   constructors. morley5Secret key that uses the ed25519 cryptographic curve. morley7Secret key that uses the secp256k1 cryptographic curve. morley8Secret key that uses the NIST P-256 cryptographic curve. morleyPublic cryptographic key used by Tezos. There are three cryptographic curves each represented by its own constructor. morley5Public key that uses the ed25519 cryptographic curve. morley7Public key that uses the secp256k1 cryptographic curve. morley8Public key that uses the NIST P-256 cryptographic curve. morleyDeterministicaly generate a secret key from seed. Type of the key depends on seed length. morley&Create a public key from a secret key. morley Convert a   to raw bytes. morleyMake a  4 from raw bytes. Can return only generic signature. morleyCheck that a sequence of bytes has been signed with a given key. morleyParse  unencrypted secret key. It accepts formats containing either with or without the  unecrypted prefix. morleyLength of a hash in bytes (only the hash itself, no tags, checksums or anything). morley*Compute the b58check of a public key hash.%morleyMagic constants used by Tezos to encode hashes with proper prefixes.[\]^_`  [\`]_^  7 Safe-Inferred:!#$%&'(),./0245789:;<>? morleyIdentifier of a network (babylonnet, mainnet, test network or other). Evaluated as hash of the genesis block.The only operation supported for this type is packing. Use case: multisig contract, for instance, now includes chain ID into signed data "in order to add extra replay protection between the main chain and the test chain". morleyTime in the real world. Use the functions below to convert it to/from Unix time in seconds. morleyMutez is a wrapper over integer data type. 1 mutez is 1 token (Tz).The constructor is marked Unsafe since GHC does not warn on overflowing literals (exceeding custom %# type bounds), thus the resultant  " value may get truncated silently.UnsafeMutez 9223372036854775809UnsafeMutez {unMutez = 1} morley Quotes a   value.The value is in XTZ, i.e. 1e6  +, with optional suffix representing a unit:k, kilo -- 1000 XTZM, Mega, mega -- 1000000 XTZm, milli -- 0.001 XTZu, , micro -- 0.000001 XTZ1This is the safest and recommended way to create   from a numeric literal.The suffix can be separated from the number by whitespace. You can also use underscores as a delimiter (those will be ignored), and scientific notation, e.g.  123.456e6. Note that if the scientific notation represents a mutez fraction, that is a compile-time error. [tz|123|]!UnsafeMutez {unMutez = 123000000} [tz|123k|]$UnsafeMutez {unMutez = 123000000000}[tz|123 kilo|]$UnsafeMutez {unMutez = 123000000000} [tz|123M|]'UnsafeMutez {unMutez = 123000000000000}[tz|123 Mega|]'UnsafeMutez {unMutez = 123000000000000}[tz|123 mega|]'UnsafeMutez {unMutez = 123000000000000} [tz|123e6|]'UnsafeMutez {unMutez = 123000000000000} [tz|123m|]UnsafeMutez {unMutez = 123000}[tz|123 milli|]UnsafeMutez {unMutez = 123000} [tz|123u|]UnsafeMutez {unMutez = 123} [tz|123|]UnsafeMutez {unMutez = 123}[tz|123 micro|]UnsafeMutez {unMutez = 123}[tz| 123.456_789 |]!UnsafeMutez {unMutez = 123456789}[tz|123.456u|]... ... error:... @ The number is a mutez fraction. The smallest possible subdivision is 0.000001 XTZ...[tz|0.012_345_6|]... ... error:... @ The number is a mutez fraction. The smallest possible subdivision is 0.000001 XTZ...[tz| 9223372.036854775807 M |]+UnsafeMutez {unMutez = 9223372036854775807}[tz| 9223372.036854775808 M |]... ... error:... @ The number is out of mutez bounds. It must be between 0 and 9223372036854.775807 XTZ (inclusive).... [tz| -1 |]... ... error:... @ The number is out of mutez bounds. It must be between 0 and 9223372036854.775807 XTZ (inclusive).... morleySafely creates   checking for overflow and underflow. Accepts a number of any type. morleySafely create  .When constructing literals, you'll need to specify the type of the literal. GHC will check for literal overflow on builtin types like % and % , but not on % or %!, so those can overflow silently.It's recommended to use  ! quasiquote for literals instead. morley Addition of   values. Returns % in case of overflow. morleyPartial addition of  >, should be used only if you're sure there'll be no overflow. morleySubtraction of   values. Returns %7 when the subtrahend is greater than the minuend, and % otherwise. morleyPartial subtraction of  ?, should be used only if you're sure there'll be no underflow. morleyMultiplication of  " and an integral number. Returns % in case of overflow. morleyPartial multiplication of   and an Natural number. Should be used only if you're sure there'll be no overflow. morleyEuclidian division of two   values. morleyEuclidian division of   and a number. morley putTextLn $ prettyTez [tz|420u|] 0.00042 putTextLn $ prettyTez [tz|42|]42  morley!Add given amount of seconds to a  . morleyDisplay timestamp in human-readable way as used by Michelson. Uses UTC timezone, though maybe we should take it as an argument.? 9 Safe-Inferred;!#$%&'(),./0245789:;<=>?; morley:Raw bytes representation of an address has invalid length. morleyRaw bytes representation of an address does not end with "00". morley.Errors that can happen during address parsing. morley%Address is not in Base58Check format. morley+All address parsers failed with some error. morley(Represents the network's global counter.We store the current value of this counter in the operation at the time of its creation for the following reasons: * to guarantee the uniqueness of contract addresses upon origination (see 'Morley.Michelson.Typed.Operation.mkContractAddress) * to prevent replay attacks by checking that an operation with the same counter value con't be performed twice.The counter is incremented after every operation execution and interpretation of instructions CREATE_CONTRACT and TRANSFER_TOKENS, and thus ensures that these addresses are unique (i.e. origination of identical contracts with identical metadata will result in different addresses.)Our counter is represented as %, while in Tezos it is unbounded. We believe that for our interpreter it should not matter. morleytz4 level-2 public key hash address, used with transaction rollups, corresponds to tx_rollup_l2_address Michelson type. morley6Data type corresponding to address structure in Tezos. morleytz1, tz2 or tz3) address which is a hash of a public key. morleyKT2 address which corresponds to a callable contract. morleytxr13 address which corresponds to a transaction rollup. morleyReturns True if given address is implicit. morleySmart constructor for  . morley$Deterministically generate a random   and discard its secret key. morleyCreate a dummy   value by hashing given %.Use in tests **only**. morleyParse an address from its human-readable textual representation used by Tezos (e. g. "tz1faswCTDciRzE4oJ9jn2Vm2dvjeyA9fUzU"). Or fail if it's invalid. morleyParse the given address in its raw byte form used by Tezos (e.g "01521139f84791537d54575df0c74a8084cc68861c00")) . Or fail otherwise if it's invalid. morley-QuasyQuoter for constructing Tezos addresses.3Validity of result will be checked at compile time.  : Safe-Inferred:!#$%&'(),./0245789:;<>?Ʃmorley"Representation of an address that  tezos-client7 uses. It can be an address itself or a textual alias.morley"Address itself, can be used as is.morley%Address alias, should be resolved by  tezos-client.morley tezos-client can associate addresses with textual aliases. This type denotes such an alias.morleyExtract $ from .; Safe-Inferred:!#$%&'(),./0245789:;<>?/ morleyUntyped view in a contract.morley View namemorleyView argument typemorleyView return typemorley View codemorleyName of the view. #It must not exceed 31 chars length;!Must use [a-zA-Z0-9_.%@] charset.morley0Whether the given character is valid for a view.morley'Maximum allowed name length for a view.morley Construct  performing all the checks.morley8Valid view names form a subset of valid Michelson texts.< Safe-Inferred:!#$%&'(),./0245789:;<>?Xmorley(General untyped contract representation.morleyContract parameter typemorleyContract storage typemorley%Contract code as a list of operationsmorleyOriginal order of contract blocks, so that we can print them in the same order they were readmorleyContract viewsmorleyConvenience synonym for  representing the storage typemorley'Contract block, convenient when parsingmorleyTop-level entries order of the contract. This is preserved due to the fact that it affects the output of pretty-printing and serializing contract.morley9The canonical entries order which is ordered as follow:  parameter, storage, and code.morley(Int, Int, Int) is the positions of  parameter, storage, and code respectively.morleyConstruct a contract representation from the contract blocks (i.e. parameters, storage, code blocks, etc.) in arbitrary order. This makes sure that unique blocks like code do not duplicate, and saves the order in the contract so that it can print the contract blocks in the same order it was parsed. TODO [#698]: this is not fully true now.morleyMap each contract fields by the given function and sort the output based on the .morley3Map all the instructions appearing in the contract.  Safe-Inferred:!#$%&'(),./0245789:;<>?M  = Safe-Inferred:!#$%&'(),./0245789:;<>?Vmorley2Where a contract or value in Michelson comes from.morleyFrom given file.morleyOnly source name is known.morleyDefined in Haskell code.morleySome unknown source.morley%Designates command line input source.morley Designates stdin source.morley% that points to the current position.  > Safe-Inferred:!#$%&'(),./0245789:;<>?  ? Safe-Inferred:!#$%&'(),./0245789:;<>?նmorley Version of % returning a % listmorley Version of % returning a % listmorley Version of % returning a % listmorley endBy2 p sep# parses two or more occurrences of p, separated by sep.morley8Apply given parser and return default value if it fails.morleyParse expression n times, where n? is a type-level natural. Essentially, a type-safe version of %8, but requires the count to be known on the type level.@ Safe-Inferred:!#$%&'(),./0245789:;<>?ؐmorley General TV2F Annotation parser, including Special AnnotationsmorleyParse arbitrary annotation.morleyParse 012 var anns and 012 field anns. It doesn't matter which come first, so long as annotations of the same type appear together.E.g.: "" is valid "%a" is valid"%a @c" is valid"%a %b c  d" is valid"c d %a %b" is valid"c %a %b d" is not valid, because the two var anns are not "grouped" together."%a c d %b" is not valid, because the two fields anns are not "grouped" together.A Safe-Inferred:!#$%&'(),./0245789:;<>?x morleyByteString does not have an instance for ToJSON and FromJSON, to avoid orphan type class instances, make a new type wrapper around it.morleyA sequence of elements: can be a list, a set or a pair. We can't distinguish lists and sets during parsing.morleyHelper function to render None ValuemorleyHelper functions to render ValuesmorleyHelper functions to render ValuesmorleyHelper functions to render ValuesmorleyHelper function to render Pair ValuemorleyHelper function to render Eltmorley Converts Pair a (Pair b c) to  [a, b, c].morley!A helper function that renders a % list of items in Michelson-readable format, given a rendering function for a single item.B Safe-Inferred:!#$%&'(),./0245789:;<>?,morley.Michelson instruction with abstract parameter op. This parameter is necessary, because at different stages of our pipeline it will be different. Initially it can contain macros and non-flattened instructions, but then it contains only vanilla Michelson instructions.morley"DROP n" instruction. Note: reference implementation permits int16 here. Negative numbers are parsed successfully there, but rejected later. Morley is more permissive, so we use % here, i. e. permit more positive numbers. We do not permit negative numbers at type level. In practice, probably nobody will ever have numbers greater than D1000 here, at least due to gas limits. Same reasoning applies to other instructions which have a numeric parameter representing number of elements on stack.morley$ is essentially as special case for 8, but we need both because they are packed differently.morley Flatten all  in . This function is mostly for testing. It returns instructions with the same logic, but they are not strictly equivalent, because they are serialized differently (grouping instructions into sequences affects the way they are PACK'ed).C Safe-Inferred:!#$%&'(),./0245789:;<>?w Safe-Inferred:!#$%&'(),./0245789:;<>?becdfghijklmnopsqrtuvwxyz{|}~ D Safe-Inferred;!#$%&'(),./0245789:;<=>?Rmorley>Data type, holding annotation data for a given Michelson type t.;Each constructor corresponds to exactly one constructor of  and holds all type and field annotations that can be attributed to a Michelson type corresponding to t.morleyA typed heterogenous list of annotations. Simplified pattern synonyms for common use cases are provided.morleyForget information about annotations, pick singleton with the same type.morleyGet term-level type of notes.morley9Get the term-level type of notes, preserving annotations.morley In memory of NStar5 constructor. Generates notes with no annotations.morley%Checks if no annotations are present.morleyConvenience pattern synonym matching three simple annotations.morleyConvenience pattern synonym matching two annotations, first being a simple one, the second being &, corresponding to an annotated type.morley? morley.Errors possible when constructing 'ViewsSet''.morley"Views that belong to one contract.%Invariant: all view names are unique.=Implementation note: lookups still take linear time. We use % for simplicity, as in either case we need to preserve the order of views (so that decoding/encoding roundtrip).morleyContract view.morleyName of the view.morleyArgument type annotations.morleyReturn type annotations.morley View code.morleyObtain the name of the view.morleyConstruct views set.morley No views.morleyAdd a view to set.morleyFind a view in the set.morley!Get all taken names in views set.!F Safe-Inferred:!#$%&'(),./0245789:;<>?morley Similar to , but also gives % for given type.morley Transparently represent untyped  as wrapper over Notes t from typed world with SingI t constraint.$As expression this carries logic of , and as pattern it performs ! but may make code a bit cleaner.Note about constraints: pattern signatures usually require two constraints - one they require and another one which they provide. In our case we require nothing (thus first constraint is ()#) and provide some knowledge about t.morleyConvert 7 to the isomorphic set of information from typed world.G Safe-Inferred:!#$%&'(),./0245789:;<>?morley'This parses arbitrary type expressions.=Note that this includes parenthesized ones. That is to say, int, (int), ((int))., etc will match with this parser and produce TInt.%morley Parses a unit type.H Safe-Inferred:!#$%&'(),./0245789:;<>?-I Safe-Inferred;!#$%&'(),./0245789:;<=>?5morley%Simple expression without any extras.morleyExtension descriptor for plain expressions without additional data.morley: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.morleyConstraint all the extra fields and the constructor provided by this extension.morley;Constraint all the extra fields provided by this extension.morley(Defines details of extension descriptor.morleyAdditional data in  constructor.morleyAdditional data in  constructor.morleyAdditional data in  constructor.morleyAdditional data in  constructor.morleyAdditional data in  constructor.morleyAdditional constructors.morleyKind of extension descriptors.0We use a dedicated open type for this, not just Type8, to notice earlier when type arguments are mis-placed.morley4Type 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.morleyFill  with the same data, assuming all types of extras are the same.morleyChange the functor used in .morleyDefault instance that uses uniplate as implementation.If it tries to find expressions for polymorphic types too agressively (requiring % where you don't what that), feel free to define an overlapping manual instance.J Safe-Inferred:!#$%&'(),./0245789:;<>?morley%Alias for expression with given meta.morleyExpression that has the same type of metadata attached to each of its constructors.morley,Traversal that visits all the extra fields ( and others) in DFS order assuming they are the same for every constructor.+It is generic enough to work not only with , but with any  that has all the extra fields of the same type; hence, this traversal is applicable to  too.0This also supports additional constructors. Use % if you have none.>Moreover, when used as setter, it can change the type of meta.morley,Lens for getting immediate meta of the node.morleyTraversal that visits all the metas in DFS order. This is a specialization of .This is pretty similar to 1, but picks meta of all the transitive children.4When used as setter, it can change the type of meta.morley Lift plain  to .K Safe-Inferred:!#$%&'(),./0245789:;<>?morleyEncode  to %.morleySame as , for strict bytestring.morleyDecode  from %.morleyPartial version of .L Safe-Inferred:!#$%&'(),./0245789:;<>? morleyBuilding a record from tuple.%It differs from similar typeclass in Data.Vinyl.FromTuple module in that it allows type inference outside-in - knowing desired $ you know which tuple should be provided - this improves error messages when constructing concrete $ objects.M Safe-Inferred:!#$%&'(),./0245789:;<>? pmorleyProduce ( instance for tuple of the given length.N Safe-Inferred:!#$%&'(),./0245789:;<>?  Safe-Inferred:!#$%&'(),./0245789:;<>? g Safe-Inferred:!#$%&'(),./0245789:;<>?morleySuppose you have a data type X with parameter a and you have two values:  x1 :: X a1 and  x2 :: X a2 . You can't compare them using $, because they have different types. However, you can compare them using ! as long as both parameters are %.morley Version of  for types with 2 parameters.morley Version of  for types with 3 parameters.morley2Compare two entries of completely different types.morley Extension of  to % function.morleyCast to a type with phantom type argument without matching this argument. The phantom type must be the last type argument of the type.Example of use: imagine a type data MyType a = MyType Normally, if object of this type was hidden under existential quantification with %/ constraint, then in order to get it back with  you need to know the exact type of the hidden object, including its phantom type parameter. With  you get a way to extract this object no matter which phantom argument it had.morley)Match given type against another type of * -> *. kind without caring about its type argument.   O Safe-Inferred:!#$%&'(),./0245789:;<>?morleyDescribes how to construct full contract parameter from given entrypoint argument. This could be just wrapper over Value arg -> Value param, but we cannot use Value type in this module easily.morley