!K +      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrs t u v w x y z { | } ~                                   ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A BCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+, - . / 0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~                                  ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7! 8! 9! :! ;! <! =! >! ?! @! A! B! C! D! E" F" G" H" I" J" K" L" M" N" O" P" Q" R" S" T" U" V" W" X" Y# Z# [# \# ]# ^# _# `# a# b# c# d# e# f# g# h# i# j# k$ l$ m$ n$ o$ p$ q$ r$ s$ t$ u$ v$ w$ x$ y$ z$ {$ |$ }$ ~$ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & ' ' ' ' !' "' #' $' %' &' '( (( )( *(+(C) CSIRO 2017-2018BSD3%Isaac Elliott <isaace71295@gmail.com> experimental non-portableSafe -.=?@AHUV1 hpythonDetermine whether type a is a member of type-level list shpython5Remove adjacent equal elements from a type-level list  (C) CSIRO 2017-2018BSD3%Isaac Elliott <isaace71295@gmail.com> experimental non-portableNoneMSXvhpythonThe composition of  + with another  , functor. + is not a  -, and  is not a monad transformer. It is equipped with a useful bind function, but that function does not have the right type to make  a  -) (besides which it would break the laws)hpython Unwrap a hpython Bind into a #. Note that the first parameter is m a, not ValidateM e m a.hpython!Lift into a succeeding validationhpython$Run a natural transformation across  to alter mhpythonLift an error into hpythonLift an error in an  , into 5. This is especially useful if you're using list or )* to collect errors.  (C) CSIRO 2017-2018BSD3%Isaac Elliott <isaace71295@gmail.com> experimental non-portableNone-.8HhpythonA type class for things for which we can strip the validation information. This can help types line up when they need to, for example to put many things of various validation statuses together in a list.(C) CSIRO 2017-2018BSD3%Isaac Elliott <isaace71295@gmail.com> experimental non-portableNone456hpython<A Python single-line comment, such as on the following line: 'y = x + 4 # add four to the value of x +In this case, the structure parsed would be +MkComment () " add four to the value of x" Kwith the hash being inferred, and the space after the hash being preserved.Python does not have multi-line comments. There is a common convention of using a multi-line string expression as a multi-line comment, since a string expression is a no-op statement. Such multi-line comments are NOTh represented with this data type, but rather as normal string expressions (since that's what they are).! ! (C) CSIRO 2017-2018BSD3%Isaac Elliott <isaace71295@gmail.com> experimental non-portableNone456_{*hpythonAn integer literal value.5 is an integer literal.6.2# is a literal but is not an integerx* might be an integer, but is not a literalSee Lhttps://docs.python.org/3.5/reference/lexical_analysis.html#integer-literals+hpythonDecimal 1234,hpythonBinary 0b10110-hpythonOctal 0o1367.hpythonMixed-case hexadecimal 0x18B4f=hpythonA literal floating point value.Eg. 7.63See Shttps://docs.python.org/3.5/reference/lexical_analysis.html#floating-point-literals>hpython'Complete' floats 12. 12.34 12.e34 12.34e56?hpython&Floats that begin with a decimal point .12 .12e34@hpythonFloats with no decimal points 12e34Hhpython)The exponent of a floating point literal.An e, followed by an optional M!, followed by at least one digit.JhpythonTWhen a floating point literal is in scientific notation, it includes the character e#, which can be lower or upper case.MhpythonPositive or negative, as in -7`hpythonImaginary number literalsSee Nhttps://docs.python.org/3.5/reference/lexical_analysis.html#imaginary-literalsahpython#A decimal integer followed by a 'j' 12jbhpythonA float followed by a 'j' 12.j 12.3j .3j+*+,-./0123456=>?@ABCDEFGHIJKLMNO`abcdefnopq+*+,-./0123456MNOJKLHI=>?@ABCDEFG`abcdefnpoq Safe.shpythons- represents unvalidated, un-annotated terms. ss (C) CSIRO 2017-2018BSD3%Isaac Elliott <isaace71295@gmail.com> experimental non-portableNone.456@AHMVָ thpythonA possibly annotated list of xs.{hpython{Python has rules regarding the expansion of tabs into spaces and how to go about computing indentation after this is done.See Ghttps://docs.python.org/3.5/reference/lexical_analysis.html#indentation7This data structure implements those rules as a monoid.|hpythoncLines which are "blank", meaning that they contain, if anything, only whitespace and/or a comment.hpython8A statement-containing thing may have a trailing newline Some forms always> have a trailing newline, which is why this class isn't just trailingNewline ::  . (s v a) ( / )hpythonLEvery syntactic element contains the whitespace that immediately follows it.dThis type class lets us access this trailing whitespace in many different types throughout hpython.hpythonQWhitespace is either a space, a tab, a newline that continues the logical line ()), a newline that ends the logical line ( ), or a .gDespite not literally being whitespace, comments inside enclosed forms are treated as whitespace. See Qhttps://docs.python.org/3.5/reference/lexical_analysis.html#implicit-line-joining4Example and counterexample of comments as whitespace 8( 1 + # here's a comment 2 + 3 # another comment )  =x = 5 + 5 # this line is not considered whitespace y = x * 2 1[ 1 , 2 # I'm whitespace , 3 # also whitespace ] hpythonbA newline is either a carriage return, a line feed, or a carriage return followed by a line feed.hpython"Indent some indentation by a chunkhpython!Deent some indentation by a chunkhpythonAn x is isomorphic to a list of hpython<Subtract the first argument from the beginning of the secondReturns  01 if the first list is not a prefix of the second.%tuvwxyz{|}~%|}~{xyztuvw (C) CSIRO 2017-2018BSD3%Isaac Elliott <isaace71295@gmail.com> experimental non-portableNone456_hpythonZA character in a string literal. This is a large sum type, with a catch-all of a Haskell  1.hpython \newlinehpython \1hpython \12hpython \123hpython \xFbhpython \u12aDhpython  \Udeadbeefhpython \\hpython \'hpython \"hpython \ahpython \bhpython \fhpython \nhpython \rhpython \thpython \vhpython Any characterhpythonA R, complete with a prefix, information about quote type and number, and a list of s.ULike many other data types in hpython, it has an annotation and trailing whitespace.hpython>A string of raw bytes can be indicated by a number of prefixeshpythonHThis prefix indicates it's a bytes literal rather than a string literal.hpython%Raw strings are prefixed with either r or R.hpythonIn Python 3.5, a prefix of u or Ua is allowed, but doesn't have any meaning. They exist for backwards compatibility with Python 2.See )https://www.python.org/dev/peps/pep-0414/hpython!Three pairs of quotations or one? L"""Long string""" '''Also long string''' "Short string" 'Also short string' hpython!Double or single quotation marks? H"Double quotes" """Double quotes""" 'Single quotes' '''Single quotes''' hpythonMost types of V have prefixes. Plain old strings may have an optional prefix, but it is meaningless.hpythonDetermine whether a  is an escape character or not.hpython&Convert a Haskell string to a list of 1. This is useful when writing Python in Haskell.EE (C) CSIRO 2017-2018BSD3%Isaac Elliott <isaace71295@gmail.com> experimental non-portableNone456hpythonThe venerable comma separator!hpython9A period character, possibly followed by some whitespace.  !" !"  (C) CSIRO 2017-2018BSD3%Isaac Elliott <isaace71295@gmail.com> experimental non-portableNone456_Y8hpythonAn 8( is a unary operator in Python, such as -U for negation. An operator is stored with an annotation and its trailing whitespace.9hpython -a:hpython +a;hpython ~a8;9:8;9:(C) CSIRO 2017-2018BSD3%Isaac Elliott <isaace71295@gmail.com> experimental non-portableNone 456=?@A_ Bhpython8An operator along with its precedence and associativity.Ghpython`The associativity of an operator. Each operator is either left-associative or right associative.Left associative: x + y + z = (x + y) + z Right associative: x + y + z = x + (y + z) Jhpython"A Python binary operator, such as +, along with its trailing @The type variable allows annotations, but it can simply be made () for an unannotated BinOp.Khpython a is bLhpython  a is not bMhpython a in bNhpython  a not in bOhpython a - bPhpython a ** bQhpython a and bRhpython a or bShpython a == bThpython a < bUhpython a <= bVhpython a > bWhpython a >= bXhpython a != bYhpython a * bZhpython a / b[hpython a // b\hpython a % b]hpython a + b^hpython a | b_hpython a ^ b`hpython a & bahpython a << bbhpython a >> bchpythona  b@ohpythono= is a list of all operators in ascending order of precedence.phpython Compare two Jfs to determine whether they represent the same operator, ignoring annotations and trailing whitespace.qhpythonIs a J a comparison, such as <=rhpythonFRetrieve the information for a given operator from the operator table.)BCFEDGHIJba`_^\[ZYXWVUTRQONLK]cMPSlmnopqr)Jba`_^\[ZYXWVUTRQONLK]cMPSGHIBCFEDnmlopqr(C) CSIRO 2017-2018BSD3%Isaac Elliott <isaace71295@gmail.com> experimental non-portableNone.456=?HshpythonmAn identifier. Like many types in hpython, it has an optional annotation and tracks its trailing whitespace.s s s have an  2 instance.See Ghttps://docs.python.org/3.5/reference/lexical_analysis.html#identifiersxhpython?Determine whether this character could start a valid identifieryhpythonDDetermine whether this character could be part of a valid identifier stuvwxyz{| stuvw{z|xy(C) CSIRO 2017-2018BSD3%Isaac Elliott <isaace71295@gmail.com> experimental non-portableNone .456=?@A_hpythonuA module name. It can be a single segment, or a sequence of them which are implicitly separated by period character. a a.bhpython .a.b . ...See Jhttps://docs.python.org/3.5/tutorial/modules.html#intra-package-referenceshpythonGet the annotation from a hpythonConvenience constructor for (C) CSIRO 2017-2018BSD3%Isaac Elliott <isaace71295@gmail.com> experimental non-portableNone456_1? hpython Non-empty ", optionally terminated by a comma6Assumes that the contents consumes trailing whitespacehpython Non-empty hpythonHItems separated by commas, with optional whitespace following each commahpython Traversal= targeting the trailing whitespace in a comma separated list.This can't be an instance of  because  never has trailing whitespace.hpython*Convert a maybe to a singleton or nullary hpythonConvert a list to a IAnywhere where whitespace is ambiguous, this function puts a single spacehpython,Appends two comma separated values together.EThe provided whitespace is to follow the joining comma which is addedhpythonGet the first element of a hpython6Appends two non-empty comma separated values together.EThe provided whitespace is to follow the joining comma which is addedhpython Convert a  3 to a IAnywhere where whitespace is ambiguous, this function puts a single spacehpythonIso to unpack a hpythonIso to unpack a hpythonYAttempt to insert comma separators into a list, which will not be terminated by a comma.If the list is empty,  0 is returned.  (C) CSIRO 2017-2018BSD3%Isaac Elliott <isaace71295@gmail.com> experimental non-portableNone.456_8hpythonThe targets of a from ... import ... statementhpython from x import *hpython from x import a, b, chpython from x import (a, b, c)hpython!Some data optionally followed by as identUsed in:  import a as b from a import b as c, d as e from a import (b as c, d as e)  (C) CSIRO 2017-2018BSD3%Isaac Elliott <isaace71295@gmail.com> experimental non-portableNone.4567=?@AEHX_6hpython,This large sum type covers all valid Python  expressionshpython () Hhttps://docs.python.org/3/reference/expressions.html#parenthesized-formshpython lambda x, y: x ;https://docs.python.org/3/reference/expressions.html#lambdahpython yield yield a  yield a, b Fhttps://docs.python.org/3/reference/expressions.html#yield-expressionshpython  yield from a Fhttps://docs.python.org/3/reference/expressions.html#yield-expressionshpython  a if b else c Lhttps://docs.python.org/3/reference/expressions.html#conditional-expressionshpython [a for b in c if d] Bhttps://docs.python.org/3/reference/expressions.html#list-displayshpython  [a, b, c] Bhttps://docs.python.org/3/reference/expressions.html#list-displayshpython {a: b for c in d if e} Hhttps://docs.python.org/3/reference/expressions.html#dictionary-displayshpython {} {a: 1, b: 2, c: 3} Hhttps://docs.python.org/3/reference/expressions.html#dictionary-displayshpython {a for b in c if d} Ahttps://docs.python.org/3/reference/expressions.html#set-displayshpython  {a, b, c} Ahttps://docs.python.org/3/reference/expressions.html#set-displayshpython a.b Ihttps://docs.python.org/3/reference/expressions.html#attribute-referenceshpython a[b] a[:] a[:, b:]etc. Bhttps://docs.python.org/3/reference/expressions.html#subscriptionshpython f(x) :https://docs.python.org/3/reference/expressions.html#callshpython None 5https://docs.python.org/3/library/constants.html#Nonehpython ... 9https://docs.python.org/3/library/constants.html#Ellipsishpython a + b Ghttps://docs.python.org/3/reference/expressions.html#the-power-operator Qhttps://docs.python.org/3/reference/expressions.html#binary-arithmetic-operations Hhttps://docs.python.org/3/reference/expressions.html#shifting-operations Nhttps://docs.python.org/3/reference/expressions.html#binary-bitwise-operations @https://docs.python.org/3/reference/expressions.html#comparisons Ohttps://docs.python.org/3/reference/expressions.html#membership-test-operations ;https://docs.python.org/3/reference/expressions.html#is-not Ghttps://docs.python.org/3/reference/expressions.html#boolean-operationshpython -a ~a +a \https://docs.python.org/3/reference/expressions.html#unary-arithmetic-and-bitwise-operationshpython a Ehttps://docs.python.org/3/reference/expressions.html#atom-identifiershpython 1@0xF3A@0o177 0b1011 Ohttps://docs.python.org/3/reference/lexical_analysis.html#grammar-token-integerhpython 1. 3.14 10e100 Qhttps://docs.python.org/3/reference/lexical_analysis.html#floating-point-literalshpython 10j 5.j Qhttps://docs.python.org/3/reference/lexical_analysis.html#floating-point-literalshpython True False 5https://docs.python.org/3/library/constants.html#True 6https://docs.python.org/3/library/constants.html#Falsehpython "asdf" b"asdf"  "asdf" 'asdf'  '''asdf''' Uhttps://docs.python.org/3/reference/lexical_analysis.html#grammar-token-stringliteralhpython a, b, c (a, b) (a,) Ehttps://docs.python.org/3/reference/expressions.html#expression-listshpython not a Ghttps://docs.python.org/3/reference/expressions.html#boolean-operationshpython (a for b in c) Jhttps://docs.python.org/3/reference/expressions.html#generator-expressionshpython await a :https://docs.python.org/3/reference/expressions.html#awaitAhpythona or *aUsed to construct tuples, e.g. (1, x, **c)Ihpythona or *aUsed to construct sets, e.g. { 1, x, **c } Ahttps://docs.python.org/3/reference/expressions.html#set-displaysQhpythona or *aUsed to construct lists, e.g. [ 1, x, **c ] Bhttps://docs.python.org/3/reference/expressions.html#list-displaysYhpythonMSyntax for things that can be used as subscripts (inside the square brackets)e.g. a[b] a[:] a[b:] a[:b] a[b:c] a[b:c:d] Bhttps://docs.python.org/3/reference/expressions.html#subscriptions\hpythona : b or **a%Used to construct dictionaries, e.g. { 1: a, 2: b, **c } Hhttps://docs.python.org/3/reference/expressions.html#dictionary-displaysehpythonA nested comprehesion, e.g.  [(x, y) for x in xs for y in ys]ghpython)A condition inside a comprehension, e.g. [x for x in xs if even(x)]ihpython#A Python for comprehension, such as  x for y in z jhpython expr  comp_for (comp_for | comp_if)*khpythonActual parameters for functionsIn the following examples, x is an actual parameter. 5y = foo(x) y = bar(quux=x) y = baz(*x) y = flux(**x) vhpythonFormal parameters for functionsSee Nhttps://docs.python.org/3.5/reference/compound_stmts.html#function-definitionswhpython  def foo(a):xhpython def foo(bar=None):yhpython  def foo(*xs):zhpython  def foo(*):{hpython def foo(**dict):hpython 4# over all the expressions in a termhpython2Lens on the syntrax tree annotation on a parameterhpythonOA faux-lens on the optional Python type annotation which may follow a parameterThis is not a lawful  5 because setting an UnnamedStarParam's type won't have any effect.LThis optic, like many others in hpython, loses validation information (the v type parameter)#The following is an example, where int is the paramtype: def foo(x: int): hpython 4C targeting the Python type annotations which may follow a parameterhpython (affine)  4 on the name of a parameter The name is x in the following examples: 8def foo(x): def foo(x=None): def foo(*x): def foo(**x): *But the following example does not have a :  def foo(*): hpython=Lens on the Python expression which is passed as the argumenthpython1Lens on the top-level annotation in an expressionhpythonshouldGroupLeft op left returns true if left< needs to be parenthesised when it is the left argument of ophpythonshouldGroupRight op right returns true if right= needs to be parenthesised when it is the right argument of op      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@vwxyz{|}~klmnopqrstuijghef\]^_`abcdQRSTUVWXIJKLMNOPABCDEFGHYZ[(C) CSIRO 2017-2018BSD3%Isaac Elliott <isaace71295@gmail.com> experimental non-portableNone456\hpythonAugmented assignment operatorshpython +=hpython -=hpython *=hpython @=hpython /=hpython %=hpython &=hpython |=hpython ^=hpython <<=hpython >>=hpython **=hpython //=hpython)Augmented assignments (PEP 203), such as: x += y or x <<= 8 An  has an P and trailing whitespace. There is an optional annotation, which can simply be () if no annotation is desired.(C) CSIRO 2017-2018BSD3%Isaac Elliott <isaace71295@gmail.com> experimental non-portableNone.4567=?@AHV_ZhpythonSee 9https://docs.python.org/3.5/reference/compound_stmts.htmlhpython Nhttps://docs.python.org/3.5/reference/compound_stmts.html#function-definitions Whttps://docs.python.org/3.5/reference/compound_stmts.html#coroutine-function-definitionhpython Jhttps://docs.python.org/3.5/reference/compound_stmts.html#the-if-statementhpython Mhttps://docs.python.org/3.5/reference/compound_stmts.html#the-while-statementhpython Khttps://docs.python.org/3.5/reference/compound_stmts.html#the-try-statementhpython Khttps://docs.python.org/3.5/reference/compound_stmts.html#the-try-statementhpython Khttps://docs.python.org/3.5/reference/compound_stmts.html#the-for-statement Qhttps://docs.python.org/3.5/reference/compound_stmts.html#the-async-for-statementhpython Khttps://docs.python.org/3.5/reference/compound_stmts.html#class-definitionshpython Lhttps://docs.python.org/3.5/reference/compound_stmts.html#the-with-statement Rhttps://docs.python.org/3.5/reference/compound_stmts.html#the-async-with-statementhpython Preceding 5s hpythonPreceding indentation hpython ['async' <spaces>] hpython 'def' <spaces> hpython <ident> hpython  '(' <spaces>hpython  <parameters>hpython  ')' <spaces>hpython ['->' <spaces> <expr>]hpython <suite>hpython  'if' <spaces>hpython <expr>hpython <suite>hpython !('elif' <spaces> <expr> <suite>)*hpython ['else' <spaces> <suite>]hpython 'while' <spaces>hpython <expr>hpython <suite>hpython ['else' <spaces> <suite>]hpython 'try' <spaces>hpython <suite>hpython (('except' <spaces> <except_as> <suite>)+hpython ['else' <spaces> <suite>]hpython ['finally' <spaces> <suite>] hpython 'try' <spaces>!hpython <suite>#hpython 'finally' <spaces>$hpython <suite>%hpython ['async' <spaces>]&hpython 'for' <spaces>'hpython <expr>(hpython  'in' <spaces>)hpython <exprs>*hpython <suite>+hpython ['else' <spaces> <suite>],hpython Preceding 5s-hpython 'class' <spaces>.hpython <ident>/hpython $['(' <spaces> [<args>] ')' <spaces>]0hpython <suite>1hpython ['async' <spaces>]2hpython 'with' <spaces>3hpython  <with_items>4hpython <suite>5hpython"Decorators on function definitions Nhttps://docs.python.org/3.5/reference/compound_stmts.html#function-definitions 8https://docs.python.org/3.5/glossary.html#term-decorator8hpythonPreceding indentation9hpython  '@' <spaces>:hpython <expr>;hpythonTrailing comment<hpythonTrailing newline=hpythonTrailing blank lines>hpythonSee Lhttps://docs.python.org/3.5/reference/compound_stmts.html#the-with-statementAhpython <expr>Bhpython ['as' <spaces> <expr>]ChpythonaA compound statement consists of one or more clauses. A clause consists of a header and a suite.FhpythonSee Khttps://docs.python.org/3.5/reference/compound_stmts.html#the-try-statementIhpython <expr>Jhpython ['as' <ident>]Khpython 7https://docs.python.org/3.5/reference/simple_stmts.htmlLhpython 'return' <spaces> [<expr>] Lhttps://docs.python.org/3.5/reference/simple_stmts.html#the-return-statementMhpython <expr> Mhttps://docs.python.org/3.5/reference/simple_stmts.html#expression-statementsNhpython <expr> ('=' <spaces> <expr>)+ Mhttps://docs.python.org/3.5/reference/simple_stmts.html#assignment-statementsOhpython <expr> <augassign> <expr> Whttps://docs.python.org/3.5/reference/simple_stmts.html#augmented-assignment-statementsPhpython 'pass' <spaces> Jhttps://docs.python.org/3.5/reference/simple_stmts.html#the-pass-statementQhpython 'break' <spaces> Khttps://docs.python.org/3.5/reference/simple_stmts.html#the-break-statementRhpython 'continue' <spaces> Nhttps://docs.python.org/3.5/reference/simple_stmts.html#the-continue-statementShpython 'global' <spaces> <idents> Lhttps://docs.python.org/3.5/reference/simple_stmts.html#the-global-statementThpython 'nonlocal' <spaces> <idents> Nhttps://docs.python.org/3.5/reference/simple_stmts.html#the-nonlocal-statementUhpython 'del' <spaces> <exprs> Ihttps://docs.python.org/3.5/reference/simple_stmts.html#the-del-statementVhpython 'import' <spaces> <modulenames> Lhttps://docs.python.org/3.5/reference/simple_stmts.html#the-import-statementWhpython I'from' <spaces> <relative_module_name> 'import' <spaces> <import_targets> Lhttps://docs.python.org/3.5/reference/simple_stmts.html#the-import-statementXhpython 0'raise' <spaces> [<expr> ['as' <spaces> <expr>]] Khttps://docs.python.org/3.5/reference/simple_stmts.html#the-raise-statementYhpython .'assert' <spaces> <expr> [',' <spaces> <expr>] Lhttps://docs.python.org/3.5/reference/simple_stmts.html#the-assert-statementZhpythonA Z is either a ] or a Z Mhttps://docs.python.org/3.5/reference/compound_stmts.html#compound-statements]hpythonSee  simpl_stmt at  2https://docs.python.org/3.5/reference/grammar.htmlI. The grammar has the terminology mixed up - it should really be called  small_stmt there.`hpython 4 targeting all the as in a structureahpythonA a= is an indented multi-line chunk of code, forming part of a C.chpython)Blank lines at the beginning of the blockdhpython The first statement of the blockehpythonHThe remaining items of the block, which may be statements or blank linesfhpython 4 over all the Z s in a terms      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKPMOVRULNQSTWXYZ\[]^_`abcdefgsZ\[fg56789:;<=      !"#$%&'()*+,-./01234]^KPMOVRULNQSTWXY>?@ABFGHIJCDEabcde_`(C) CSIRO 2017-2018BSD3%Isaac Elliott <isaace71295@gmail.com> experimental non-portableNone.H      !"#$'()*+,-./01456789:;<=>?@CDEFGHIJKLMNOPQRSTWXYZ[\]^_`abcdghijklmnorstuvwxyz{|}~     #$456789:;<NTSPOQR'()*+,@?>=CDEFGHIJKLM\d]b^c`_arstuvwxyzghijkl~|}{WXYZ[onm !"-/0.1(C) CSIRO 2017-2018BSD3%Isaac Elliott <isaace71295@gmail.com> experimental non-portableNone456hpython A Python g, which is stored as a sequence of statements. A module corresponds to one source file of Python code.+(C) CSIRO 2017-2018BSD3%Isaac Elliott <isaace71295@gmail.com> experimental non-portableNoneJ !*+,-./0123456=>?@ABCDEFGHIJKLMNO`abcdefnopqtuvwxyz{|}~ !"8:9;BCDEFGIHJSPMc]KLNOQRTUVWXYZ[\^_`ablmnopqrstuvwxyz{|      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKPMOVRULNQSTWXYZ\[]^_`abcdefg      !"#$'()*+,-./01456789:;<=>?@CDEFGHIJKLMNOPQRSTWXYZ[\]^_`abcdghijklmnorstuvwxyz{|}~(C) CSIRO 2017-2018BSD3%Isaac Elliott <isaace71295@gmail.com> experimental non-portableNonehpython 6 targeting all of thie s in a structure*This only targets places that contain the Q datatype; it doesn't target newline characters in string literals, for example.(C) CSIRO 2017-2018BSD3%Isaac Elliott <isaace71295@gmail.com> experimental non-portableNone4/hpythonA // is a single lexical token of Python source. A /N has an optional annotation, which can be '()' when no annotation is desired.hpythonGet the annotation from a /.a/~}|{zyxwvutsrqponmlkjihgfedcba`_^]\[ZYXWVUTSRQPONMLKJIHGFEDCBA@?>=<;:9876543210a/~}|{zyxwvutsrqponmlkjihgfedcba`_^]\[ZYXWVUTSRQPONMLKJIHGFEDCBA@?>=<;:9876543210(C) CSIRO 2017-2018BSD3%Isaac Elliott <isaace71295@gmail.com> experimental non-portableNone.=?@AC)ehpython 6- targeting the indentation inside a structurebNote: whitespace inside 'enclosed forms' (such as lists or tuples) is not considered indentation.e.g.>In the following code, there is only one chunk of indentation: 'def a(): [ b , c , d ]  it's here: ,def a(): [ b ^^^^ , c , d ] 4The rest is whitespace that is internal to the list.hpython 6+ targeting the indent-chunks in a structuree.g.This is one indent chunk: .def a(): pass if b: pass ^^^^ and this is another 2def a(): pass if b: pass ^^^^ (C) CSIRO 2017-2018BSD3%Isaac Elliott <isaace71295@gmail.com> experimental non-portableNone -./=>?@AHX_0hpython 4I targeting the variables that would modified as a result of an assignment-Here are some examples of assignment targets: a = b ^  (a, b, c) = d ^ ^ ^  [a, b, *c] = d ^ ^ ^ >These expressions have variables on the left hand side of the =9, but those variables don't count as assignment targets:  a[b] = c   a(b) = c  {a: b} = c +$(C) CSIRO 2017-2018BSD3%Isaac Elliott <isaace71295@gmail.com> experimental non-portableNone .456@AC_F-hpython expr  comp_for (comp_for | comp_if)*hpythonfor  any_spaces  targets 'in'  any_spaces exprhpython'if'  any_spaces exprhpython ['async' <spaces>]hpython 'def' <spaces>hpython <ident>hpython  '(' <spaces>hpython  <parameters>hpython  ')' <spaces>hpython ['->' <spaces> <expr>]hpython <suite>hpython  'if' <spaces>hpython <expr>hpython <suite>hpython !('elif' <spaces> <expr> <suite>)*hpython ['else' <spaces> <suite>]hpython 'while' <spaces>hpython <expr>hpython <suite>hpython ['else' <spaces> <suite>]hpython 'try' <spaces>hpython <suite>hpython (('except' <spaces> <except_as> <suite>)+hpython ['else' <spaces> <suite>]hpython ['finally' <spaces> <suite>]hpython 'try' <spaces>hpython <suite>hpython 'finally' <spaces>hpython <suite>hpython ['async' <spaces>]hpython 'for' <spaces>hpython <expr>hpython  'in' <spaces>hpython <exprs>hpython <suite>hpython ['else' <spaces> <suite>]hpython 'class' <spaces>hpython <ident>hpython $['(' <spaces> [<args>] ')' <spaces>]hpython <suite>hpython ['async' <spaces>]hpython 'with' <spaces>hpython  <with_items>hpython <suite>hpython Unpacking ( *value" ) was used in an invalid position      +*%! (")$'&#n.-vutsrqpomlkjihgfedcba`_^]\[ZYXWVUTSRQPONMLKJIHGFEDCBA@?>=<;:9876543210/,w{zyx~}|PQRSTUVWXYZ[\]^_`abcde w{zyx~}| +*%! (")$'&#n.-vutsrqpomlkjihgfedcba`_^]\[ZYXWVUTSRQPONMLKJIHGFEDCBA@?>=<;:9876543210/,    PQRSTUVWXYZ[\]^_`abcde(C) CSIRO 2017-2018BSD3%Isaac Elliott <isaace71295@gmail.com> experimental non-portableNone_q fhpythonTrailing commas can only be present in a parameter list of entirely positional arguments. This removes the bad trailing comma, and appends the comma's trailing whitespace to the previous tokenihpythonfTwo non-typed single-quoted strings cannot be lexically adjacent, because this would be a parse erroreg. '''' or """"Nwe correct for this by inserting a single space where required '' '' or "" ""lhpythonWhen a backslash character, precedes an escape sequence it needs to be escaped so that it doesn't interfere with the backslash that begins the escape sequence. For example:[ '\\', Char_esc_n]6 would naively render to '\\n', which would parse to [,  'n'], breaking the  parse . print identitynhpython(as, bs) = span p xs bs9 is the longest suffix that satisfies the predicate, and as is the prefix up to that pointIt's like the reverse of  7ohpythonSometimes strings need to be corrected when certain characters follow a literal backslash. For example, a literal backslash followed by an escape sequence means that the literal backslash actually needs to be escaped, so that it doesn't get combined+ with the backslash in the escape sequence.phpythonIt turns out that raw strings can only ever be constructed with an even number of trailing backslash characters. This functon corrects raw strings with an odd number of trailing backslash charactersqhpythonDEvery quote in a string of a particular quote type should be escapedrhpythonUEvery quote in short raw string that isn't preceded by a backslash should be escapedshpythonXEvery third literal quote at the beginning of a long (non-raw) string should be escapedthpythonNLiteral quotes at the beginning and end of a long raw string should be escapeduhpythonTLiteral quotes at the beginning and end of a long (non-raw) string should be escapedvhpythonIt's possible that successive statements have no newlines in between them. This would cause them to be displayed on the same line. In every line where this would be the case, we explicitly insert a line-feed character.fghijklmnopqrstuvfghijklmnopqrstuv(C) CSIRO 2017-2018BSD3%Isaac Elliott <isaace71295@gmail.com> experimental non-portableNone=?@AM whpythonA wL is an intermediate form used during rendering with efficient concatenation 8hpython`Treats the input as a terminating statement (does not cause additional newlines to be inserted) 9hpython\Treats the input as a non-terminating statement (causes additional newlines to be inserted) :hpython7Are we inside a terminating or non-terminating context?xhpythonRender a single token as a wyhpythonRun a w to produce a final  ;.These  ;Qs should then not be appended any more. All appending should be done during the w phase. <hpythonIParenthesise a term, but put its trailing whitespace *outside* the parenshpython"Render an entire Python module to  ;hpython$Render a single Python statement to  ;hpython%Render a single Python expression to  ;1wxyz{|}~1wyx{|~}z,(C) CSIRO 2017-2018BSD3%Isaac Elliott <isaace71295@gmail.com> experimental non-portableNone(C) CSIRO 2017-2018BSD3%Isaac Elliott <isaace71295@gmail.com> experimental non-portableNone >@ACHMV_k hpython(Tabs and spaces were used inconsistentlyhpythonDThe dedent at the end of a block doesn't match and preceding indentse.g. >def a(): if b: pass else: pass pass The final line will cause an  errorhpythonConvert a concrete $ to a value that has an instance of <This function is partial, because our parser will never use hpythonYConvert some input to a sequence of tokens. Indent and dedent tokens are not added (see ) =hpythonaActs like break, but encodes the "insignificant whitespace" rule for parens, braces and bracketshpythonConvert a concrete $ to a value that has an instance of  >hpythonGiven a list of indentation jumps (first to last) and some whitespace, divide the whitespace up into "blocks" which correspond to each jumphpythonInsert indent and dedent tokens Ghttps://docs.python.org/3.5/reference/lexical_analysis.html#indentationhpythonxTokenize an input file, inserting indent/level/dedent tokens in appropriate positions according to the block structure.hpython File namehpythonInput to tokenizehpythonInitial source annotationhpython Token streamhpython File namehpythonInput to tokenize(C) CSIRO 2017-2018BSD3%Isaac Elliott <isaace71295@gmail.com> experimental non-portableNone .>@ACHSVX_hpythonConvert a concrete $ to a value that has an instance of ;This function is partial because our parser will never use hpythonRun a parser on some inputhpython File namehpythonParserhpythonInput to parseM     M     None=?@A_ hpythonKAn error occured during tokenization (this is a re-packed megaparsec error)!hpythonFAn error occured during parsing (this is a re-packed megaparsec error)"hpython(Tabs and spaces were used inconsistently#hpythonDThe dedent at the end of a block doesn't match and preceding indentse.g. >def a(): if b: pass else: pass pass The final line will cause an # error$hpython Unpacking ( *value" ) was used in an invalid position  !"$# !"$#   (C) CSIRO 2017-2018BSD3%Isaac Elliott <isaace71295@gmail.com> experimental non-portableNone.=>?@A^,hpythonParse a module Ghttps://docs.python.org/3/reference/toplevel_components.html#file-input-hpythonParse a statement Ohttps://docs.python.org/3/reference/compound_stmts.html#grammar-token-statement.hpython0Parse an expression list (unparenthesised tuple) Thttps://docs.python.org/3.5/reference/expressions.html#grammar-token-expression_list/hpythonParse an expression Ohttps://docs.python.org/3.5/reference/expressions.html#grammar-token-expression,hpython File namehpythonInput to parse-hpython File namehpythonInput to parse.hpython File namehpythonInput to parse/hpython File namehpythonInput to parse(  !"$# ,-./,-/.(C) CSIRO 2017-2018BSD3%Isaac Elliott <isaace71295@gmail.com> experimental non-portableNone"#.=>?@ACHSVX_kcB0hpython One or more lines of Python code3hpython has an -.3 instance, but when a type class dispatches on an - we will run into ambiguity if we try to use OverloadedStrings. In these cases we can use 3& to provide the extra type information4hpython Create a module_#[ line_ $ def_ "a" [] [line_ pass_], blank_#, line_ $ def_ "b" [] [line_ pass_]]def a(): passdef b(): pass8hpython Create a A?hpython You can use ? without a binder: ? :: s K -> [s 0] -> s s -> s r ? ( "Exception") body or with a binder: ? :: s F -> [s 0] -> s s -> s r ? ( "Exception" `<` 3 "a") body Khpython#var_ "a" `in_` [var_ "b", var_ "c"] a in b, cMhpythonvar_ "a" `in_` var_ "b"a in bOhpythondict_ [var_ "a" .: 1]{a: 1}dict_ [ss_ $ var_ "a"]{**a}%dict_ [var_ "a" .: 1, ss_ $ var_ "b"] {a: 1, **b}}dict_ $ comp_ (var_ "a" .: 1) (for_ $ var_ "a" `in_` list_ [li_ $ int_ 1, li_ $ int_ 2, li_ $ int_ 3]) [if_ $ var_ "a" .== 2]#{a: 1 for a in [1, 2, 3] if a == 2}Rhpython Create a IShpythonset_ []set()set_ [si_ $ var_ "a"]{a}set_ [s_ $ var_ "a"]{*a}$set_ [si_ $ var_ "a", s_ $ var_ "b"]{a, *b}vset_ $ comp_ (var_ "a") (for_ $ var_ "a" `in_` set_ [si_ $ int_ 1, si_ $ int_ 2, si_ $ int_ 3]) [if_ $ var_ "a" .== 2] {a for a in [1, 2, 3] if a == 2}]hpython Create a Q^hpythonlist_ [li_ $ var_ "a"][a]list_ [s_ $ var_ "a"][*a]%list_ [li_ $ var_ "a", s_ $ var_ "b"][a, *b]xlist_ $ comp_ (var_ "a") (for_ $ var_ "a" `in_` list_ [li_ $ int_ 1, li_ $ int_ 2, li_ $ int_ 3]) [if_ $ var_ "a" .== 2] [a for a in [1, 2, 3] if a == 2]hhpython"A faux-Lens that allows targeting vjs in-between existing formatting, and adding appropriate formatting when extra parameters are introduced.showStatement myStatement"def a(b , c ):\n pass"DshowStatement (myStatement & _Fundef.parameters_ .~ [p_ "d", p_ "e"]"def a(d , e ):\n pass"LshowStatement (myStatement & _Fundef.parameters_ .~ [p_ "d", p_ "e", p_ "f"] "def a(d , e , f):\n pass"--- It's not a Lens because repeated  ?+s can drop trailing commas, violating the Lens laws. For example: someFunction def a(b, c,): pass1set parameters_ [var_ "d", var_ "e"] someFunction def a(d, e,): passset parameters_ [] someFunctiondef a(): passFset parameters_ [var_ "d", var_ "e"] (set parameters_ [] someFunction) def a(d, e): passlhpythonKeyword parameters/arguments p_ :: s K -> s K -> s k p_ :: s  -> s K -> s v phpythonPositional parameters/arguments p_ :: s K -> s k p_ :: s  -> s v uhpythonfA faux-Lens that targets lines in the body of some statement-piece, but does so 'around' indentation.(def_ "a" [] [ line_ pass_, line_ pass_ ] def a (): pass pass1def_ "a" [] [ line_ pass_, line_ pass_ ] ^. body_passpassMdef_ "a" [] [ line_ pass_, line_ pass_ ] & body_ .~ [ line_ $ var_ "b" += 1 ]def a(): b += 1Ndef_ "a" [] [ line_ pass_, line_ pass_ ] & body_ <>~ [ line_ $ var_ "b" += 1 ]def a(): pass pass b += 16def_ "a" [] [ line_ pass_, line_ pass_ ] & body_ .~ []def a(): pass--- It's a fake LensW because it violates some of the laws. The most obvious violation is that setting the uD to the empty list actually sets it to a singleton list containing >. (This is because blocks must contain one or more statements)whpythonConvert some data to a 0yhpythonCreate a blank 0zhpythonUnnamed starred parameter*def_ "a" [ p_ "b", star_ ] [ line_ pass_ ] def a(b, *): pass}hpython*Create a minimal valid function definition~hpython'def_ "f" [p_ "x"] [line_ $ return_ "x"] def f(x): return x1def_ "f" [p_ "x", k_ "y" 2] [line_ $ return_ "x"]def f(x, y=2): return x9def_ "f" [p_ "x", k_ "y" 2, s_ "z"] [line_ $ return_ "x"]def f(x, y=2, *z): return xBdef_ "f" [p_ "x", k_ "y" 2, s_ "z", ss_ "w"] [line_ $ return_ "x"]def f(x, y=2, *z, **w) return x3def_ "f" [p_ "x" .: "String"] [line_ $ return_ "x"]def f(x: String): return xhpythonCreate a minimal valid hpythoncall_ "f" [p_ $ var_ "x"]f(x)#call_ "f" [p_ $ var_ "x", k_ "y" 2] f(x, y=2)+call_ "f" [p_ $ var_ "x", k_ "y" 2, s_ "z"] f(x, y=2, *z)4call_ "f" [p_ $ var_ "x", k_ "y" 2, s_ "z", ss_ "w"]f(x, y=2, *z, **w)hpythonreturn_ (var_ "a")return ahpython Turns an K into a Zexpr_ (int_ 3)3hpythonwgen_ $ comp_ (var_ "a") (for_ $ var_ "a" `in_` list_ [li_ $ int_ 1, li_ $ int_ 2, li_ $ int_ 3]) [if_ $ var_ "a" .== 2] (a for a in [1, 2, 3] if a == 2)hpython a is bhpython a and bDoes not have a precedencehpython a or bDoes not have a precedencehpython  a not in bhpython  a is not bhpython not ahpython a == bhpython a < bhpython a <= bhpython a > bhpython a >= bhpython a != bhpython a | bhpython a ^ bhpython a & bhpython a << bhpython a >> bhpython a + bhpython a - bhpython a * bhpython a @ bhpython a / bhpython a // bhpython a % bhpython a ** bhpythonvar_ "a" /> var_ "b"a.bhpython -ahpython +ahpython ~a @hpythonConvert a list of 0s to a a%, giving them 4 spaces of indentationhpythonConvert a list of 0s to a a, without indenting themhpythonCreate a minimal valid hpythonCreate a minimal valid 4hpythonnone_Nonehpythons K has a  A= instance, but sometimes we need to name integers explicitlyint_ 1010hpythonpass_passhpythonCreate a minimal valid 'hpythonCreate a minimal valid hpythontrue_Truehpythonfalse_FalsehpythonDouble-quoted string str_ "asdf""asdf"hpythonSingle-quoted string str_ "asdf"'asdf'hpythonLong double-quoted stringlongStr_ "asdf" """asdf"""hpythonLong single-quoted stringlongStr'_ "asdf" '''asdf'''hpythonChained assignmentchainEq (var_ "a") []a'chainEq (var_ "a") [var_ "b", var_ "c"] a = b = chpython a = bhpython a += bhpython a -= bhpython a *= bhpythona = b@hpython a /= bhpython a %= bhpython a &= bhpython a |= bhpython a ^= bhpython a <<= bhpython a >>= bhpython a **= bhpython a //= bhpythonCreate a minimal valid WhpythonCreate a minimal valid ghpythonCreate a minimal valid rhpythonCreate a minimal valid hpythontry ... except with optional else and optional finally'tryE_ [line_ pass_] [line_ ("a" .+= 1)]try: passexcept a += 1hpython try ... finally'tryF_ [line_ pass_] [line_ ("a" .+= 1)]try: passfinally: a += 1hpythonclass_ "A" [] [line_ pass_]class A: passhpythonCreate a minimal hpythonCreate a minimal valid hpython  with_ ::  3 (s K) -> [s 0] -> s Z with_ ::  3 (s >) -> [s 0] -> s Z #with_ [var_ "a"] [line_ $ var_ "b"]with a: b4with_ [var_ "a" `as_` id_ "name"] [line_ $ var_ "b"]with a as name: b.with_ [withItem_ e Nothing] [line_ $ var_ "b"]with a: bhpython ellipsis_...hpython tuple_ []()tuple_ [ti_ $ var_ "a"]a,tuple_ [s_ $ var_ "a"](*a),'tuple_ [ti_ $ var_ "a", ti_ $ var_ "b"]a, b&tuple_ [ti_ $ var_ "a", s_ $ var_ "b"]a, *bhpythonawait (var_ "a")await ahpython,ifThenElse_ (var_ "a") (var_ "b") (var_ "c") a if b else chpythonlambda_ [p_ "x"] "x" lambda x: x'lambda_ [p_ "x", k_ "y" 2] ("x" .+ "y")lambda x, y=2: x + y&lambda_ [p_ "x", k_ "y" 2, s_ "z"] "a"lambda x, y=2, *z: a/lambda_ [p_ "x", k_ "y" 2, s_ "z", ss_ "w"] "a"lambda x, y=2, *z, **w: ahpython yield_ []yieldyield_ [var_ "a"]yield ayield_ [var_ "a", var_ "b"] yield a, bhpythonyieldFrom_ (var_ "a") yield from ahpythonThe slice with no boundssubs_ (var_ "a") fullSlice_a[:] fullSlice_slice(None, None, None)hpythonSlice with *step* x&subs_ (var_ "a") (sliceS_ $ int_ (-1))a[::-1]sliceS_ $ int_ (-1)slice(None, None, -1)hpython Slice *from* x#subs_ (var_ "a") (sliceF_ $ int_ 0)a[1:]sliceF_ $ int_ 0slice(1, None, None)hpython Slice *from* x, with *step* y-subs_ (var_ "a") (sliceFS_ (int_ 0) (int_ 2))a[1::2]sliceFS_ (int_ 0) (int_ 2)slice(1, None, 2)hpythonSlice To x$subs_ (var_ "a") (sliceT_ $ int_ 10)a[:10]sliceT_ $ int_ 10slice(None, 10, None)hpythonSlice To x, with Step y.subs_ (var_ "a") (sliceTS_ (int_ 10) (int_ 2))a[:10:2]sliceTS_ (int_ 10) (int_ 2)slice(None, 10, 2)hpythonSlice From x To y.subs_ (var_ "a") (sliceFT_ (int_ 1) (int_ 10))a[1:10]sliceFT_ (int_ 1) (int_ 10)slice(1, 10, None)hpythonSlice From x To y, with Step z8subs_ (var_ "a") (sliceFTS_ (int_ 1) (int_ 10) (int_ 2)) a[1:10:2]%sliceFTS_ (int_ 1) (int_ 10) (int_ 2)slice(1, 10, 2)hpythonA slice object&Represents a call to a function named slice), with 3 arguments. If an argument is a  0 then it becomes , and if the argument is a  B! then the contents are extracted.hpythonsubs_ (var_ "a") (int_ 1)a[1](subs_ (var_ "a") (tuple_ [ti_ $ int_ 1])a[1,]6subs_ (var_ "a") (tuple_ [ti_ $ int_ 1, ti_ $ int_ 2])a[1, 2])subs_ (var_ "a") (tuple_ [s_ $ var_ "b"]) a[((*b),)]7subs_ (var_ "a") (tuple_ [ti_ $ int_ 1, s_ $ var_ "b"]) a[(1, *b)]hpython#Function parameter type annotations (s) :: s v -> s K -> s vz can be annotated using sp, but it will have no effect on the output program, as unnamed starred parameters cannot have type annotations.See ~hpythonConstructing dictionary items (s) :: s K -> s K -> s \ hpythonSee  hpythonSee ~ hpythonSee  hpythonSee T hpythonSee _ hpythonSee  hpythonSee ~ hpythonSee  hpythonSee ~ hpythonSee P hpythonSee  hpythonSee ~ hpython V :: s K -> [s 0] -> s 4%if_ (var_ "a" .< 10) [var_ "a" .+= 1] if a < 10: a += 1 hpython V :: s K -> s YOcomp_ (var_ "a") (for_ $ var_ "a" `in_` var_ "b") [if_ $ var_ "c" .== var_ "d"]a for a in b if c == d hpython P :: s (i \) -> s K hpython P :: [s \] -> s K hpython X :: s M -> s YRcomp_ (var_ "a") (for_ $ var_ "a" `in_` var_ "b") [for_ $ var_ "c" `in_` var_ "d"]a for a in b for c in d hpython X :: s M -> s e4comp_ (var_ "a") (for_ $ var_ "a" `in_` var_ "b") [] a for a in b hpython X :: s K -> [s 0] -> s Z@for_ (var_ "a" `in_` [var_ "b"]) [line_ (var_ "c" .+= var_ "a")] for a in b: c += a hpythonSee X !hpythonvar_ "a" `in_` var_ "b"a in b +hpython,tryE_ [line_ pass_] & finally_ [line_ pass_]try: passfinally: pass>tryF_ [line_ pass_] [line_ (a .+= 1)] & finally_ [line_ pass_]try: passfinally: pass,tryF_ [line_ pass_] & finally_ [line_ pass_]try: passfinally: pass .hpython > :: [s 0] -> s  -> s r ? :: AsExceptAs => s e -> [s 0] -> s  -> s r (someTryStatement :: s )  > [x ] (someTryStatement :: s )  ? ( "Exception" `<` 3 "b") [x ] /hpython > :: [s 0] -> s r -> s r ? :: AsExceptAs => s e -> [s 0] -> s r -> s r (someTryStatement :: s r)  > [x ] (someTryStatement :: s r)  ? ( "Exception" `<` 3 "b") [x ] 0hpython > :: [s 0] -> (s g -> s r) -> s r ? :: @ e => s e -> [s 0] -> (s g -> s r) -> s r/tryE_ [var_ "a" .= 2] & except_ [var_ "a" .= 3]try: a = 2except: a = 3RtryE_ [var_ "a" .= 2] & exceptAs_ (var_ "Exception" `as_` id_ "b") [var_ "a" .= 3]try: a = 2except Exception as b: a = 3 1hpythonSee  2hpythonSee ?sstuvwz{|AIQ\klmnopqrstuvwxyz{|}~>?@ABFGHIJZ  !"'()*+,-./01456789:;<=>?@CDEFGHIJKLMNOPQRSTWXYZ[ghijklmnorstuvwxyz{|}~01234789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`cabdefghijklmnopqrstuvwxyz{|}~sZ4ywx0123stuvw{z|nozjk;<UVWXIJMNKLrsYZ[vwxyz{|}~ghiklmnopqrstudefpq lm{`cabDEtuv~}=>?BCrstuvwxyzFGHIJ@AghijklWXYZ[~|}{onm9:>?@ABFGHCDEFGHIJKLM456789:;<'()*+,NTSPOQR@?>=78A !"-/0.1^_\]QOP\STQRI|'J1s011111111123455667777789 00000000000000!(C) CSIRO 2017-2018BSD3%Isaac Elliott <isaace71295@gmail.com> experimental non-portableNone .=?@ACH_u  7 8 9 : ; < = > ? @ < = > ? @ 7 8 9 : ;"(C) CSIRO 2017-2018BSD3%Isaac Elliott <isaace71295@gmail.com> experimental non-portableNone.UVX_kx3 Fhpython"The next line must be..."3 C D E F G H I J K L M N O P Q + R S T U V 7 8 9 : ; < = > ? @ E F G H I J K L M N O P Q R S T U V I E J V U O F G H L K Q M T S R P N#(C) CSIRO 2017-2018BSD3%Isaac Elliott <isaace71295@gmail.com> experimental non-portableNone .=?@ACHH ZhpythonUsing nonlocal; to modify function scopes makes scope checking intractible [hpythonUsing globalI to add identifiers to the global scope makes scope checking intractible \hpythonUsing delB to remove identifiers from scope makes scope checking intractible ]hpythonfVariable assignments deep in control flow can modify the scope outside the control flow. For example: )if a: x = 0 else: pass print(x) x will be in scope if the True$ branch was entered, but not if the False branch was entered. This kind of behaviour makes scope checking intractible, so programs like this are considered scope errors. ^hpythonAn identifier is not in scope _hpython4For loops don't execute in a fresh scope, so if the counterE of the loop shadows a variable, then that variable will be mutated.e.g. )x = 0 for x in 1, 2, 3: pass print(x) outputs 3,This error occurs when we spot this pattern. Y _ ^ ] \ [ Z b i h g f e d c Y _ ^ ] \ [ Z b i h g f e d c$(C) CSIRO 2017-2018BSD3%Isaac Elliott <isaace71295@gmail.com> experimental non-portableNone.=>?@AHMSUVX_kK C D E F G H I J K L M N O P Q + R S T U V Y Z [ \ ] ^ _ b c d e f g h i k l m n o p q r s y z { | } ~  ' s y ~ k l m n o z | {  } p q r %(C) CSIRO 2017-2018BSD3%Isaac Elliott <isaace71295@gmail.com> experimental non-portableNone .=?@ACH~S S &(C) CSIRO 2017-2018BSD3%Isaac Elliott <isaace71295@gmail.com> experimental non-portableNone-.=>?@AHMSUVX_ hpython$These are the parameters to a lambda C D E F G H I J K L M N O P Q + R S T U V                       0                       'None=?@A_vr 7 8 9 : ; < = > ? @ Y Z [ \ ] ^ _ b c d e f g h i      ((C) CSIRO 2017-2018BSD3%Isaac Elliott <isaace71295@gmail.com> experimental non-portableNone.>UV? *hpythonBValidate a datatype for indentation, syntax, and scope correctnesse.g.  ' =  *  V      'hpython to validate (hpythonZ to validate )hpythonK to validate *hpythonIndentation validatorhpythonSyntax validatorhpythonScope validator C D E F G H I J K L M N O P Q + R S T U V 7 8 9 : ; < = > ? @ E F G H I J K L M N O P Q R S T U V Y Z [ \ ] ^ _ b c d e f g h i k l m n o p q r s y z { | } ~                            ' ( ) * ' ( ) */(C) CSIRO 2017-2018BSD3%Isaac Elliott <isaace71295@gmail.com> experimental non-portableNoneE  C D E F G H I J K L M N O P Q + R S T U V !*+,-./0123456=>?@ABCDEFGHIJKLMNO`abcdefnopqstuvwxyz{|}~ !"8:9;BCDEFGIHJSPMc]KLNOQRTUVWXYZ[\^_`ablmnopqrstuvwxyz{|      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKPMOVRULNQSTWXYZ\[]^_`abcdefg      !"#$'()*+,-./01456789:;<=>?@CDEFGHIJKLMNOPQRSTWXYZ[\]^_`abcdghijklmnorstuvwxyz{|}~!"$# ,-./01234789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`cabdefghijklmnopqrstuvwxyz{|}~ 7 8 9 : ; < = > ? @ E F G H I J K L M N O P Q R S T U V Y Z [ \ ] ^ _ b c d e f g h i k l m n o p q r s y z { | } ~                            ' ( ) * W01234534634734834934:34;3<=3<>3<?3<@3<@ABCDEEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{{|}~                Q                                                              ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] ^ _ ` a b c d e f g h i j k l m noopqrstuvwxyz{|}~D     ve !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghhijklmnoopqrstuvvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTTUVWXYZ[\\]^_`abccdefghijklmnopqrstuuvwxyyz{|}~       !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQ#RSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~!"$% wi      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ccdefTTUVWXYZ[\\]^_yyz{|`ab     ve !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^`abcdefg}~ghijklmnopqrs !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRStuuv      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYYZ[\]]^_`abcdefghijklmnopqrstuvwxyz{|}}~;;YZ    y      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~!!!!!!!!!!!!!!""""""""""""""""""""################ # # $ $ $ $$$$$$$$$$$$$$$$$$$ $!$"$#$$$%$&$'$($)$*$+$,$-$.$/$0$1$2$3$4$5$6%7%8%9%:%;%<%=%>%?%@%A%B%C%D%E%F%G%H%I%J%K%L%M%N%O%P%Q%R%S%T%U%V%W%X%Y%Z%[%\%]%^%_%`%a%b%c%d%e%f%g%h%i%j%k%l%m%n%o%p%q%r%s%t%u%v%w%x%y%z%{%|%}%~%%%%%%%%%%%%%%&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&''''7''''''((((00000-.0*000"hpython-0.1-AGWlxbmKlB6B0gKumFrQ3aLanguage.Python.DSLLanguage.Python.Parse.ErrorLanguage.Python.Internal.Lexer Data.Type.SetData.Validate.Monadic Language.Python.Optics.ValidatedLanguage.Python.Syntax.CommentLanguage.Python.Syntax.NumbersLanguage.Python.Syntax.Raw!Language.Python.Syntax.WhitespaceLanguage.Python.Syntax.Strings"Language.Python.Syntax.Punctuation%Language.Python.Syntax.Operator.Unary&Language.Python.Syntax.Operator.BinaryLanguage.Python.Syntax.Ident"Language.Python.Syntax.ModuleNamesLanguage.Python.Syntax.CommaSepLanguage.Python.Syntax.ImportLanguage.Python.Syntax.Expr Language.Python.Syntax.AugAssign Language.Python.Syntax.StatementLanguage.Python.Syntax.TypesLanguage.Python.Syntax.ModuleLanguage.Python.Optics.NewlinesLanguage.Python.Internal.TokenLanguage.Python.Optics.IndentsLanguage.Python.Optics"Language.Python.Internal.Syntax.IR*Language.Python.Internal.Render.CorrectionLanguage.Python.Internal.RenderLanguage.Python.Internal.ParseLanguage.Python.Parse*Language.Python.Validate.Indentation.Error$Language.Python.Validate.Indentation$Language.Python.Validate.Scope.ErrorLanguage.Python.Validate.Scope%Language.Python.Validate.Syntax.ErrorLanguage.Python.Validate.SyntaxLanguage.Python.Validate.ErrorLanguage.Python.ValidateData.List.NonEmptyNonEmptyLanguage.Python.SyntaxLanguage.Python.Render Data.StringIsStringLanguage.Pythonbase Data.Function&'megaparsec-6.5.0-CK6UWBz91u27EgbRYoKlk2Text.Megaparsec.Error EndOfInputLabelTokens ErrorItem FancyError TrivialError ParseErrorText.Megaparsec.Pos sourceColumn sourceLine sourceName SourcePosMemberNub $fMemberk[]a: $fMembera[]a: ValidateM unValidateM runValidateMbindVMliftVM0liftVM1errorVMerrorVM1$fFunctorValidateM$fApplicativeValidateM Validated unvalidatedComment MkComment _commentAnn _commentValue $fEqComment $fOrdComment $fShowComment$fFunctorComment$fFoldableComment$fTraversableComment $fEq1Comment $fOrd1Comment IntLiteral IntLiteralDec IntLiteralBin IntLiteralOct IntLiteralHex_intLiteralAnn_unsafeIntLiteralDecValue_unsafeIntLiteralBinUppercase_unsafeIntLiteralBinValue_unsafeIntLiteralOctUppercase_unsafeIntLiteralOctValue_unsafeIntLiteralHexUppercase_unsafeIntLiteralHexValue$fEqIntLiteral$fShowIntLiteral$fFunctorIntLiteral$fFoldableIntLiteral$fTraversableIntLiteral$fEq1IntLiteral FloatLiteralFloatLiteralFullFloatLiteralPointFloatLiteralWhole_floatLiteralAnn_floatLiteralFullLeft_floatLiteralFullRight_floatLiteralPointRight_floatLiteralPointExponent_floatLiteralWholeRight_floatLiteralWholeExponent FloatExponentEEeEESignPosNeg$fOrd1IntLiteral$fEqSign $fOrdSign $fShowSign$fEqE$fOrdE$fShowE$fEqFloatExponent$fOrdFloatExponent$fShowFloatExponent$fEqFloatLiteral$fShowFloatLiteral$fFunctorFloatLiteral$fFoldableFloatLiteral$fTraversableFloatLiteral$fEq1FloatLiteral ImagLiteralImagLiteralIntImagLiteralFloat_imagLiteralAnn_unsafeImagLiteralIntValue_imagLiteralUppercase_unsafeImagLiteralFloatValue$fOrd1FloatLiteral$fEqImagLiteral$fShowImagLiteral$fFunctorImagLiteral$fFoldableImagLiteral$fTraversableImagLiteral$fEq1ImagLiteralshowIntLiteralshowFloatExponentshowFloatLiteralshowImagLiteral$fOrd1ImagLiteralRawIndents _indentsValue _indentsAnnIndentMkIndentunIndent IndentLevelBlank _blankAnn_blankWhitespaces _blankCommentHasTrailingNewlinetrailingNewlinesetTrailingNewlineHasTrailingWhitespacetrailingWhitespace WhitespaceSpaceTab ContinuedNewlineCRLFCRLF indentLevelgetIndentLevelabsoluteIndentLevelindentItdedentItindentWhitespaces subtractStart$fHasTrailingWhitespaceNonEmpty$fMeasuredIndentLevelWhitespace$fIsListIndent$fSemigroupIndents $fEqNewline $fOrdNewline $fShowNewline$fEqWhitespace$fOrdWhitespace$fShowWhitespace $fEqBlank $fShowBlank$fFunctorBlank$fFoldableBlank$fTraversableBlank$fSemigroupIndentLevel$fMonoidIndentLevel $fEqIndent $fOrdIndent $fShowIndent$fSemigroupIndent$fMonoidIndent $fEqIndents $fShowIndents$fFunctorIndents$fFoldableIndents$fTraversableIndents indentsAnn indentsValue $fEq1Indents $fOrd1IndentsPyChar Char_newline Char_octal1 Char_octal2 Char_octal3Char_hex Char_uni16 Char_uni32Char_esc_bslashChar_esc_singlequoteChar_esc_doublequote Char_esc_a Char_esc_b Char_esc_f Char_esc_n Char_esc_r Char_esc_t Char_esc_vChar_lit StringLiteralRawStringLiteralRawBytesLiteral BytesLiteral_stringLiteralAnn_unsafeRawStringLiteralPrefix_stringLiteralStringType_stringLiteralQuoteType_stringLiteralValue_stringLiteralWhitespace_unsafeStringLiteralPrefix_unsafeRawBytesLiteralPrefix_unsafeBytesLiteralPrefixRawBytesPrefix Prefix_br Prefix_Br Prefix_bR Prefix_BR Prefix_rb Prefix_rB Prefix_Rb Prefix_RB BytesPrefixPrefix_bPrefix_BRawStringPrefixPrefix_rPrefix_R StringPrefixPrefix_uPrefix_U StringType ShortString LongString QuoteType SingleQuote DoubleQuote hasPrefixisEscapefromHaskellStringshowStringPrefixshowRawStringPrefixshowBytesPrefixshowRawBytesPrefix showQuoteType$$fHasTrailingWhitespaceStringLiteral $fEqQuoteType$fOrdQuoteType$fShowQuoteType$fEqStringType$fOrdStringType$fShowStringType$fEqStringPrefix$fOrdStringPrefix$fShowStringPrefix$fEqRawStringPrefix$fOrdRawStringPrefix$fShowRawStringPrefix$fEqBytesPrefix$fOrdBytesPrefix$fShowBytesPrefix$fEqRawBytesPrefix$fOrdRawBytesPrefix$fShowRawBytesPrefix $fEqPyChar $fOrdPyChar $fShowPyChar$fEqStringLiteral$fOrdStringLiteral$fShowStringLiteral$fFunctorStringLiteral$fFoldableStringLiteral$fTraversableStringLiteralstringLiteralQuoteTypestringLiteralStringTypestringLiteralValuestringLiteralWhitespaceAtMkAtEqualsMkEquals Semicolon MkSemicolonColonMkColonCommaMkCommaDotMkDot$fHasTrailingWhitespaceDot$fHasTrailingWhitespaceComma$fHasTrailingWhitespaceColon $fHasTrailingWhitespaceSemicolon$fHasTrailingWhitespaceEquals$fHasTrailingWhitespaceAt$fEqDot $fShowDot $fEqComma $fShowComma $fEqColon $fShowColon $fEqSemicolon$fShowSemicolon$fFunctorSemicolon$fFoldableSemicolon$fTraversableSemicolon $fEqEquals $fShowEquals$fEqAt$fShowAtUnOpNegatePositive Complement$fHasTrailingWhitespaceUnOp$fEqUnOp $fShowUnOp $fFunctorUnOp$fFoldableUnOp$fTraversableUnOpOpEntry _opOperator_opPrec_opAssocAssocLRBinOpIsIsNotInNotInMinusExpBoolAndBoolOrEqLtLtEqGtGtEqNotEqMultiplyDivide FloorDividePercentPlusBitOrBitXorBitAnd ShiftLeft ShiftRight$fHasTrailingWhitespaceBinOp $fEqBinOp $fShowBinOp$fFunctorBinOp$fFoldableBinOp$fTraversableBinOp $fEqAssoc $fShowAssocopAssoc opOperatoropPrec operatorTable sameOperator isComparison lookupOpEntryIdentMkIdent _identAnn _identValue_identWhitespaceisIdentifierStartisIdentifierChar identValueidentAnnidentWhitespace$fValidatedIdent$fHasTrailingWhitespaceIdent$fIsStringIdent $fEqIdent $fShowIdent$fFunctorIdent$fFoldableIdent$fTraversableIdent ModuleName ModuleNameOneModuleNameManyRelativeModuleNameRelativeWithNameRelative_moduleNameAnnmakeModuleName!$fHasTrailingWhitespaceModuleName)$fHasTrailingWhitespaceRelativeModuleName$fEqModuleName$fShowModuleName$fFunctorModuleName$fFoldableModuleName$fTraversableModuleName$fEqRelativeModuleName$fShowRelativeModuleName$fFunctorRelativeModuleName$fFoldableRelativeModuleName$fTraversableRelativeModuleName CommaSep1' CommaSepOne1'CommaSepMany1' CommaSep1 CommaSepOne1 CommaSepMany1CommaSep CommaSepNone CommaSepOne CommaSepManycsTrailingWhitespacemaybeToCommaSeplistToCommaSepappendCommaSep commaSep1HeadappendCommaSep1listToCommaSep1 _CommaSep _CommaSep1'listToCommaSep1'$fMonoidCommaSep$fSemigroupCommaSep $fHasTrailingWhitespaceCommaSep1$fSemigroupCommaSep1!$fHasTrailingWhitespaceCommaSep1' $fEqCommaSep$fShowCommaSep$fFunctorCommaSep$fFoldableCommaSep$fTraversableCommaSep $fEqCommaSep1$fShowCommaSep1$fFunctorCommaSep1$fFoldableCommaSep1$fTraversableCommaSep1$fEqCommaSep1'$fShowCommaSep1'$fFunctorCommaSep1'$fFoldableCommaSep1'$fTraversableCommaSep1' ImportTargets ImportAll ImportSomeImportSomeParensImportAs _importAsAnn _importAsName _importAsQual importAsAnn importAsName importAsQual$fHasTrailingWhitespaceImportAs$fValidatedImportAs$$fHasTrailingWhitespaceImportTargets $fEqImportAs$fShowImportAs$fFunctorImportAs$fFoldableImportAs$fTraversableImportAs$fEqImportTargets$fShowImportTargets$fFunctorImportTargets$fFoldableImportTargets$fTraversableImportTargetsExprUnitLambdaYield YieldFromTernaryListCompListDictCompDictSetCompSetDeref SubscriptCallNoneEllipsisParensIntFloatImagBoolStringTupleNot GeneratorAwait_unsafeExprAnn_unsafeUnitWhitespaceInner_unsafeUnitWhitespaceRight_unsafeLambdaWhitespace_unsafeLambdaArgs_unsafeLambdaColon_unsafeLambdaBody_unsafeYieldWhitespace_unsafeYieldValue_unsafeFromWhitespace_unsafeYieldFromValue_unsafeTernaryValue_unsafeTernaryWhitespaceIf_unsafeTernaryCond_unsafeTernaryWhitespaceElse_unsafeTernaryElse_unsafeListCompWhitespaceLeft_unsafeListCompValue_unsafeListCompWhitespaceRight_unsafeListWhitespaceLeft_unsafeListValues_unsafeListWhitespaceRight_unsafeDictCompWhitespaceLeft_unsafeDictCompValue_unsafeDictCompWhitespaceRight_unsafeDictWhitespaceLeft_unsafeDictValues_unsafeDictWhitespaceRight_unsafeSetCompWhitespaceLeft_unsafeSetCompValue_unsafeSetCompWhitespaceRight_unsafeSetWhitespaceLeft_unsafeSetValues_unsafeSetWhitespaceRight_unsafeDerefValueLeft_unsafeDerefWhitespaceLeft_unsafeDerefValueRight_unsafeSubscriptValueLeft_unsafeSubscriptWhitespaceLeft_unsafeSubscriptValueRight_unsafeSubscriptWhitespaceRight_unsafeCallFunction_unsafeCallWhitespaceLeft_unsafeCallArguments_unsafeCallWhitespaceRight_unsafeNoneWhitespace_unsafeEllipsisWhitespace_unsafeBinOpExprLeft_unsafeBinOpOp_unsafeBinOpExprRight _unsafeUnOpOp_unsafeUnOpValue_unsafeParensWhitespaceLeft_unsafeParensValue_unsafeParensWhitespaceAfter_unsafeIdentValue_unsafeIntValue_unsafeIntWhitespace_unsafeFloatValue_unsafeFloatWhitespace_unsafeImagValue_unsafeImagWhitespace_unsafeBoolValue_unsafeBoolWhitespace_unsafeStringValue_unsafeTupleHead_unsafeTupleWhitespace_unsafeTupleTail_unsafeNotWhitespace_unsafeNotValue_generatorValue_unsafeAwaitWhitespace_unsafeAwaitValue TupleItem TupleUnpack _tupleItemAnn_unsafeTupleItemValue_unsafeTupleUnpackParens_unsafeTupleUnpackWhitespace_unsafeTupleUnpackValueSetItem SetUnpack _setItemAnn_unsafeSetItemValue_unsafeSetUnpackParens_unsafeSetUnpackWhitespace_unsafeSetUnpackValueListItem ListUnpack _listItemAnn_unsafeListItemValue_unsafeListUnpackParens_unsafeListUnpackWhitespace_unsafeListUnpackValue SubscriptExprSubscriptSliceDictItem DictUnpack _dictItemAnn_unsafeDictItemKey_unsafeDictItemColon_unsafeDictItemValue_unsafeDictItemUnpackWhitespace_unsafeDictItemUnpackValueCompForCompIf ComprehensionArg PositionalArg KeywordArgStarArg DoubleStarArg_argAnn_argExpr_unsafeKeywordArgName _unsafeKeywordArgWhitespaceRight_unsafeStarArgWhitespace_unsafeDoubleStarArgWhitespaceParamPositionalParam KeywordParam StarParamUnnamedStarParamDoubleStarParam _paramAnn _paramName _paramType"_unsafeKeywordParamWhitespaceRight_unsafeKeywordParamExpr_unsafeStarParamWhitespace_unsafeStarParamName!_unsafeUnnamedStarParamWhitespace _unsafeDoubleStarParamWhitespaceHasExprs_ExprsparamAnn paramType_ paramType paramNameargExprexprAnnshouldGroupLeftshouldGroupRight $fPlatedExpr $fNumExpr$fIsStringExpr$fHasTrailingWhitespaceExpr $fHasTrailingWhitespaceTupleItem$fHasTrailingWhitespaceSetItem$fHasTrailingWhitespaceListItem $fHasTrailingWhitespaceSubscript$fHasTrailingWhitespaceDictItem$fHasTrailingWhitespaceCompFor$fHasTrailingWhitespaceCompIf$fTraversableComprehension$fFoldableComprehension$fFunctorComprehension$$fHasTrailingWhitespaceComprehension $fIsStringArg$fHasTrailingWhitespaceParam$fIsStringParam$fValidatedListItem$fValidatedTupleItem$fValidatedSetItem$fValidatedDictItem$fValidatedArg$fValidatedParam$fValidatedExpr$fHasExprsExpr$fHasExprsTupleItem$fHasExprsSetItem$fHasExprsListItem $fHasExprsArg$fHasExprsParam$fEqExpr $fShowExpr $fFunctorExpr$fFoldableExpr$fTraversableExpr $fGenericExpr $fEqTupleItem$fShowTupleItem$fFunctorTupleItem$fFoldableTupleItem$fTraversableTupleItem $fEqSetItem $fShowSetItem$fFunctorSetItem$fFoldableSetItem$fTraversableSetItem $fEqListItem$fShowListItem$fFunctorListItem$fFoldableListItem$fTraversableListItem $fEqSubscript$fShowSubscript$fFunctorSubscript$fFoldableSubscript$fTraversableSubscript $fEqDictItem$fShowDictItem$fFunctorDictItem$fFoldableDictItem$fTraversableDictItem$fEqComprehension$fShowComprehension $fEqCompFor $fShowCompFor$fFunctorCompFor$fFoldableCompFor$fTraversableCompFor $fEqCompIf $fShowCompIf$fFunctorCompIf$fFoldableCompIf$fTraversableCompIf$fEqArg $fShowArg $fFunctorArg $fFoldableArg$fTraversableArg $fEqParam $fShowParam$fFunctorParam$fFoldableParam$fTraversableParam AugAssignOpPlusEqMinusEqStarEqAtEqSlashEq PercentEq AmpersandEqPipeEqCaretEq ShiftLeftEq ShiftRightEq DoubleStarEq DoubleSlashEq AugAssign MkAugAssign_augAssignType _augAssignAnn_augAssignWhitespace $fHasTrailingWhitespaceAugAssign$fEqAugAssignOp$fShowAugAssignOp $fEqAugAssign$fShowAugAssign$fFunctorAugAssign$fFoldableAugAssign$fTraversableAugAssignCompoundStatementFundefIfWhile TryExcept TryFinallyForClassDefWith_csAnn_unsafeCsFundefDecorators _csIndents_unsafeCsFundefAsync_unsafeCsFundefDef_unsafeCsFundefName_unsafeCsFundefLeftParen_unsafeCsFundefParameters_unsafeCsFundefRightParen_unsafeCsFundefReturnType_unsafeCsFundefBody _unsafeCsIfIf_unsafeCsIfCond_unsafeCsIfBody_unsafeCsIfElifs_unsafeCsIfElse_unsafeCsWhileWhile_unsafeCsWhileCond_unsafeCsWhileBody_unsafeCsWhileElse_unsafeCsTryExceptTry_unsafeCsTryExceptBody_unsafeCsTryExceptExcepts_unsafeCsTryExceptElse_unsafeCsTryExceptFinally_unsafeCsTryFinallyTry_unsafeCsTryFinallyTryBody!_unsafeCsTryFinallyFinallyIndents_unsafeCsTryFinallyFinally_unsafeCsTryFinallyFinallyBody_unsafeCsForAsync_unsafeCsForFor_unsafeCsForBinder_unsafeCsForIn_unsafeCsForCollection_unsafeCsForBody_unsafeCsForElse_unsafeCsClassDefDecorators_unsafeCsClassDefClass_unsafeCsClassDefName_unsafeCsClassDefArguments_unsafeCsClassDefBody_unsafeCsWithAsync_unsafeCsWithWith_unsafeCsWithItems_unsafeCsWithBody Decorator _decoratorAnn_decoratorIndents _decoratorAt_decoratorExpr_decoratorComment_decoratorNewline_decoratorBlankLinesWithItem _withItemAnn_withItemValue_withItemBinderSuiteSuiteOne SuiteManyExceptAs _exceptAsAnn _exceptAsExpr _exceptAsNameSimpleStatementReturnAssignPassBreakContinueGlobalNonlocalDelImportFromRaiseAssert StatementSmallStatementMkSmallStatement HasBlocks_BlocksBlock_blockBlankLines _blockHead _blockTail HasStatements _Statements$fHasExprsSimpleStatement$fPlatedSimpleStatement$fValidatedSimpleStatement"$fHasTrailingNewlineSmallStatement$fHasExprsSmallStatement$fValidatedSmallStatement$fHasExprsExceptAs$fValidatedExceptAs$fHasExprsWithItem$fValidatedWithItem$fHasExprsDecorator$fValidatedDecorator%$fHasTrailingNewlineCompoundStatement$fHasTrailingNewlineBlock$fHasTrailingNewlineSuite$fHasTrailingNewlineStatement$fHasExprsCompoundStatement$fHasExprsSuite$fHasExprsBlock$fHasExprsStatement$fTraversableBlock$fFoldableBlock$fFunctorBlock$fValidatedSuite$fValidatedBlock$fValidatedCompoundStatement$fValidatedStatement$fHasBlocksStatement$fHasBlocksSmallStatement$fHasBlocksCompoundStatement$fHasBlocksSuite$fPlatedStatement$fHasStatementsSuite$fHasStatementsBlock$fEqSimpleStatement$fShowSimpleStatement$fFunctorSimpleStatement$fFoldableSimpleStatement$fTraversableSimpleStatement$fGenericSimpleStatement$fEqSmallStatement$fShowSmallStatement$fFunctorSmallStatement$fFoldableSmallStatement$fTraversableSmallStatement $fEqExceptAs$fShowExceptAs$fFunctorExceptAs$fFoldableExceptAs$fTraversableExceptAs $fEqWithItem$fShowWithItem$fFunctorWithItem$fFoldableWithItem$fTraversableWithItem $fEqDecorator$fShowDecorator$fFunctorDecorator$fFoldableDecorator$fTraversableDecorator$fEqCompoundStatement$fShowCompoundStatement$fFunctorCompoundStatement$fFoldableCompoundStatement$fTraversableCompoundStatement $fEqSuite $fShowSuite$fFunctorSuite$fFoldableSuite$fTraversableSuite $fEqBlock $fShowBlock $fEqStatement$fShowStatement$fFunctorStatement$fFoldableStatement$fTraversableStatement withItemAnnwithItemBinder withItemValue exceptAsAnn exceptAsExpr exceptAsNameblockBlankLines blockHead blockTailMkFundef_fdAnn _fdDecorators _fdIndents_fdAsync _fdDefSpaces_fdName_fdLeftParenSpaces _fdParameters_fdRightParenSpaces _fdReturnType_fdBody $fEqFundef $fShowFundefElseMkElse _elseIndents _elseElse _elseBodyfdAnnfdAsyncfdBody fdDecorators fdDefSpaces fdIndentsfdLeftParenSpacesfdName fdParameters fdReturnTypefdRightParenSpaces$fEqElse $fShowElseMkWhile _whileAnn _whileIndents _whileWhile _whileCond _whileBody _whileElseelseBodyelseElse elseIndents $fEqWhile $fShowWhileMkKeywordParam_kpAnn_kpName_kpType _kpEquals_kpExprwhileAnn whileBody whileCond whileElse whileIndents whileWhile$fEqKeywordParam$fShowKeywordParamMkPositionalParam_ppAnn_ppName_ppTypekpAnnkpEqualskpExprkpNamekpType$fEqPositionalParam$fShowPositionalParam MkStarParam_spAnn _spWhitespace_spName_spTypeppAnnppNameppType $fEqStarParam$fShowStarParamMkUnnamedStarParam_uspAnn_uspWhitespacespAnnspNamespType spWhitespace$fEqUnnamedStarParam$fShowUnnamedStarParamMkCall_callAnn _callFunction_callLeftParen_callArguments_callRightParenuspAnn uspWhitespace$fEqCall $fShowCallElifMkElif _elifIndents _elifElif _elifCond _elifBodycallAnn callArguments callFunction callLeftParencallRightParen$fEqElif $fShowElifMkIf_ifAnn _ifIndents_ifIf_ifCond_ifBody_ifElifs_ifElseelifBodyelifCondelifElif elifIndents$fEqIf$fShowIfMkFor_forAnn _forIndents _forAsync_forFor _forBinder_forIn_forCollection_forBody_forElseifAnnifBodyifCondifElifsifElseifIf ifIndents$fEqFor $fShowForFinally MkFinally_finallyIndents_finallyFinally _finallyBodyforAnnforAsync forBinderforBody forCollectionforElseforForforIn forIndents $fEqFinally $fShowFinallyExceptMkExcept_exceptIndents _exceptExcept_exceptExceptAs _exceptBody finallyBodyfinallyFinallyfinallyIndents $fEqExcept $fShowExcept MkTryExcept_teAnn _teIndents_teTry_teBody _teExcepts_teElse _teFinally exceptBody exceptExceptexceptExceptAs exceptIndents $fEqTryExcept$fShowTryExcept MkTryFinally_tfAnn _tfIndents_tfTry_tfBody _tfFinallyteAnnteBodyteElse teExcepts teFinally teIndentsteTry$fEqTryFinally$fShowTryFinally MkClassDef_cdAnn _cdDecorators _cdIndents_cdClass_cdName _cdArguments_cdBodytfAnntfBody tfFinally tfIndentstfTry $fEqClassDef$fShowClassDefMkWith_withAnn _withIndents _withAsync _withWith _withItems _withBodycdAnn cdArgumentscdBodycdClass cdDecorators cdIndentscdName$fEqWith $fShowWithMkTuple _tupleAnn _tupleHead _tupleComma _tupleTailwithAnn withAsyncwithBody withIndents withItemswithWith $fEqTuple $fShowTupleMkList_listAnn_listWhitespaceLeft _listBody_listWhitespaceRighttupleAnn tupleComma tupleHead tupleTail$fEqList $fShowList MkListUnpack_listUnpackAnn_listUnpackParens_listUnpackWhitespace_listUnpackValuelistAnnlistBodylistWhitespaceLeftlistWhitespaceRight$fEqListUnpack$fShowListUnpackMkNone_noneAnn_noneWhitespace listUnpackAnnlistUnpackParenslistUnpackValuelistUnpackWhitespace$fEqNone $fShowNone MkTupleUnpack_tupleUnpackAnn_tupleUnpackParens_tupleUnpackWhitespace_tupleUnpackValuenoneAnnnoneWhitespace$fEqTupleUnpack$fShowTupleUnpacktupleUnpackAnntupleUnpackParenstupleUnpackValuetupleUnpackWhitespaceModule ModuleEmptyModuleBlankFinal ModuleBlankModuleStatement$fHasStatementsModule $fEqModule $fShowModule$fFunctorModule$fFoldableModule$fTraversableModule HasNewlines _Newlines$fHasNewlinesModule$fHasNewlinesStatement$fHasNewlinesSmallStatement$fHasNewlinesSimpleStatement$fHasNewlinesImportTargets$fHasNewlinesModuleName$fHasNewlinesCompoundStatement$fHasNewlinesWithItem$fHasNewlinesExceptAs$fHasNewlinesDecorator$fHasNewlinesExpr$fHasNewlinesStringLiteral$fHasNewlinesNonEmpty$fHasNewlinesSubscript$fHasNewlinesDictItem$fHasNewlinesSetItem$fHasNewlinesListItem$fHasNewlinesTupleItem$fHasNewlinesComprehension$fHasNewlinesCompIf$fHasNewlinesCompFor$fHasNewlinesArg$fHasNewlinesParam$fHasNewlinesMaybe$fHasNewlinesIdent$fHasNewlinesCommaSep1'$fHasNewlinesCommaSep1$fHasNewlinesCommaSep$fHasNewlinesBinOp$fHasNewlinesUnOp$fHasNewlinesIndents$fHasNewlinesIndent$fHasNewlinesSuite$fHasNewlinesEquals$fHasNewlinesSemicolon$fHasNewlinesAt$fHasNewlinesComma$fHasNewlinesDot$fHasNewlinesColon$fHasNewlinesBlock$fHasNewlinesBlank$fHasNewlinesWhitespace$fHasNewlines[]$fHasNewlinesNewline$fHasNewlinesEither$fHasNewlinesRelativeModuleName$fHasNewlinesImportAs$fHasNewlines(,,,)$fHasNewlines(,,)$fHasNewlines(,)PyTokenTkIfTkElseTkElifTkWhileTkAssertTkDefTkReturnTkPassTkBreak TkContinueTkTrueTkFalseTkNone TkEllipsisTkOrTkAndTkIsTkNotTkGlobal TkNonlocalTkDelTkLambdaTkImportTkFromTkAsTkRaiseTkTryTkExcept TkFinallyTkClass TkRightArrowTkWithTkForTkInTkYieldTkIntTkFloatTkImagTkIdentTkStringTkBytes TkRawString TkRawBytesTkSpaceTkTab TkNewline TkLeftBracketTkRightBracket TkLeftParen TkRightParen TkLeftBrace TkRightBraceTkLtTkLteTkEq TkDoubleEqTkBangEqTkGtTkGte TkContinuedTkColon TkSemicolonTkCommaTkDotTkPlusTkMinusTkTilde TkCommentTkStar TkDoubleStarTkSlash TkDoubleSlash TkPercent TkShiftLeft TkShiftRightTkPlusEq TkMinusEqTkStarEqTkAtEqTkAt TkSlashEq TkPercentEq TkAmpersandEqTkPipeEq TkCaretEq TkShiftLeftEqTkShiftRightEqTkDoubleStarEqTkDoubleSlashEqTkPipeTkCaret TkAmpersandTkIndentTkLevelTkDedent $fShowPyToken$fFunctorPyToken $fEq1PyToken pyTokenAnn $fOrdPyToken $fEqPyToken $fOrd1PyToken HasIndents_Indents_Indent$fHasIndentsCompoundStatementa$fHasIndentsWitha$fHasIndentsClassDefa$fHasIndentsDecoratora$fHasIndentsSuitea$fHasIndentsBlocka$fHasIndentsStatementa$fHasIndentsSmallStatementa$fHasIndentsElsea$fHasIndentsElifa$fHasIndentsWhilea$fHasIndentsIfa$fHasIndentsFinallya$fHasIndentsExcepta$fHasIndentsTryExcepta$fHasIndentsTryFinallya$fHasIndentsFora$fHasIndentsFundefa$fHasIndentsPyTokenaHasWith_With HasClassDef _ClassDefHasFor_For HasTryFinally _TryFinally HasTryExcept _TryExceptHasIf_IfHasWhile_While HasFundef_FundefHasCompoundStatement_CompoundStatement _TupleUnpack_Tuple tupleItems _ListUnpack_List listItems_None _KeywordParam_PositionalParam _StarParam_UnnamedStarParam_Else_Elif_Finally_Except_Call_Ident assignTargets$fHasCompoundStatementStatement'$fHasCompoundStatementCompoundStatement$fHasFundefStatement$fHasFundefCompoundStatement$fHasFundefFundef$fHasWhileStatement$fHasWhileCompoundStatement$fHasWhileWhile$fHasIfStatement$fHasIfCompoundStatement $fHasIfIf$fHasTryExceptStatement$fHasTryExceptCompoundStatement$fHasTryExceptTryExcept$fHasTryFinallyStatement $fHasTryFinallyCompoundStatement$fHasTryFinallyTryFinally$fHasForStatement$fHasForCompoundStatement $fHasForFor$fHasClassDefStatement$fHasClassDefCompoundStatement$fHasClassDefClassDef$fHasWithStatement$fHasWithCompoundStatement $fHasWithWith FromIRContext _allowStarredStarExpr_unsafeStarExprWhitespace_unsafeStarExprValue_unsafeStringLiteralValue_unsafeDictItemvalueIRErrorInvalidUnpacking AsIRError_InvalidUnpacking fromIRError $fEqIRError $fShowIRError allowStarred fromIR_expr fromIR_suite fromIR_param fromIR_argfromIR_decoratorfromIR_exceptAsfromIR_withItemfromIR_comprehensionfromIR_dictItemfromIR_subscript fromIR_blockfromIR_compFor fromIR_compIffromIR_smallStatementfromIR_statementfromIR_SimpleStatementfromIR_compoundStatementfromIR_listItemfromIR_tupleItemfromIR_setItemfromIR correctParams correctSpacescorrectNewlinescorrectAdjacentStrings quoteCharquotecorrectBackslashEscapescorrectBackslashesnapscorrectBackslashEscapesRawcorrectBackslashesRaw correctQuotescorrectQuotesRawcorrectInitialQuotes correctInitialFinalQuotesLongRawcorrectInitialFinalQuotesLongcorrectTrailingNewline RenderOutput singletonshowRenderOutput renderComment commentTokensparensbracketsbraces escapeCharsintToHex renderPyChars showTokens expandIndents showTokenwhitespaceTokensrenderWhitespacerenderCommaSeprenderCommaSep1renderCommaSep1' renderIdent renderCompFor renderCompIfrenderComprehensionrenderSubscript renderExprrenderModuleName renderDotrenderRelativeModuleNamerenderImportAsrenderImportTargetsrenderSimpleStatement renderBlockrenderCompoundStatement renderIndentrenderStatementrenderExceptAs renderArg renderParams renderParam renderUnOp renderBinOp renderIndents renderModule showModule showStatementshowExpr$fFunctorRenderOutput$fApplicativeRenderOutput$fMonadRenderOutputAsIncorrectDedent_IncorrectDedent AsTabError _TabErrorTabErrorIncorrectDedentAsLexicalError _LexicalErrorSrcInfo _srcInfoName_srcInfoLineStart_srcInfoLineEnd_srcInfoColStart_srcInfoColEnd_srcInfoOffsetStart_srcInfoOffsetEndinitialSrcInfo withSrcInfounsafeFromLexicalErrortokenize fromTabError insertTabstokenizeWithTabs$fSemigroupSrcInfo$fMeasuredSumSummed $fEqSrcInfo $fShowSrcInfo$fEqLogicalLine$fShowLogicalLine$fEqIndentedLine$fShowIndentedLine $fEqTabError$fShowTabError $fEqSummed $fShowSummed $fOrdSummed $fNumSummedParser AsParseError _ParseErrorPyTokens unPyTokensunsafeFromParseError runParsereoldedentspace continuednewlineanySpacetoken identifierboolnoneellipsisintegerfloatimag stringOrBytescommentindentlevelcommadotatcolonequals semicolonexprListexprOrStarListcompIfcompFor commaSepRestexprCompstarstarExpr exprListComp orExprListbinOporTest yieldExprlambda lambdaNoCond exprNoCondexpr rightParen doubleStarorExprsimpleStatementsepBy1'smallStatement statementblanksuitecommaSep commaSep1 commaSep1' someParams upPositionalupStar upDoubleStar untypedParamstyAnn tpPositionaltpStar tpDoubleStar typedParamsargdecoratorValue decorator decoratorscompoundStatementmodule_$fStreamPyTokens $fEqPyTokens $fOrdPyTokens LexicalError$fAsIRErrorParseErrora$fAsParseErrorParseErrorPyToken$fAsIncorrectDedentParseErrora$fAsTabErrorParseErrora$fAsLexicalErrorParseErrorChar$fEqParseError$fShowParseError parseModuleparseStatement parseExprList parseExprLineunLineid_$fEqLine $fShowLine AsTupleItemti_ AsWithItem toWithItemAsas_ ExceptSyntaxexcept_ exceptAs_ AsExceptAs toExceptAs FinallySyntaxfinally_ AsyncSyntaxasync_ ElseSyntaxgetElsesetElseInSyntaxin_InListMkInListMkInAsDictdict_ AsSetItemsi_AsSetset_IfSyntaxif_ ForSyntaxfor_GuardMkGuardunGuard AsListItemli_AsListlist_DecoratorsSyntax setDecorators getDecoratorsArgumentsSyntax setArguments getArgumentsParametersSyntax parameters_ parametersDoubleStarSyntaxss_ KeywordSyntaxk_ StarSyntaxs_PositionalSyntaxp_ ColonSyntax.: BodySyntaxbody_bodyAsLineline_blank_star_ decorated_ blockToLinesmkFundefdef_mkCallcall_return_expr_comp_gen_is_and_or_notIn_isNot_not_.==.<.<=.>.>=.!=.|.^.&.<<.>>.+.-.*.@././/.%.**/>neg_pos_compl_ linesToBlockmkWhilewhile_mkIfifThen_var_none_int_pass_mkElifelif_mkElseelse_break_true_false_str_str'_longStr_ longStr'_chainEq.=.+=.-=.*=.@=./=.%=.&=.|=.^=.<<=.>>=.**=.//=mkForforSt_ mkFinallymkExcept mkTryExcept mkTryFinallytryE_tryF_class_ mkClassDefmkWithwith_ withItem_ ellipsis_tuple_await_ ifThenElse_lambda_yield_ yieldFrom_ fullSlice_sliceS_sliceF_sliceFS_sliceT_sliceTS_sliceFT_ sliceFTS_slice_subs_$fHasStatementsLine$fHasExprsLine $fWrappedLine$fRewrappedLinet$fAsLineTryFinally$fAsLineTryExcept $fAsLineFor $fAsLineExpr$fAsLineStatement $fAsLineWith $fAsLineWhile $fAsLineIf$fAsLineFundef$fAsLineClassDef$fAsLineCompoundStatement$fAsLineSimpleStatement$fAsLineSmallStatement$fBodySyntaxWith$fBodySyntaxClassDef$fBodySyntaxTryFinally$fBodySyntaxTryExcept$fBodySyntaxFor$fBodySyntaxIf$fBodySyntaxElse$fBodySyntaxElif$fBodySyntaxWhile$fBodySyntaxFundef$fColonSyntaxParamParam$fColonSyntaxExprDictItem$fPositionalSyntaxArgExpr$fPositionalSyntaxParamIdent$fStarSyntaxExprTupleItem$fStarSyntaxExprSetItem$fStarSyntaxExprListItem$fStarSyntaxExprArg$fStarSyntaxIdentParam$fKeywordSyntaxArg$fKeywordSyntaxParam$fDoubleStarSyntaxExprDictItem$fDoubleStarSyntaxExprArg$fDoubleStarSyntaxIdentParam$fParametersSyntaxFundef$fArgumentsSyntaxClassDef$fArgumentsSyntaxCall$fDecoratorsSyntaxClassDef$fDecoratorsSyntaxFundef $fAsListe $fAsList[]$fAsListItemExpr$fAsListItemListItem $fIfSyntax->$fIfSyntaxGuard$fAsSete $fAsSet[]$fAsSetItemExpr$fAsSetItemSetItem $fAsDicte $fAsDict[]$fForSyntaxGuardIn$fForSyntaxCompForIn$fForSyntax->InList$fInSyntaxInList[]$fInSyntaxExprExpr$fElseSyntaxTryExcept$fElseSyntaxIf$fElseSyntaxFor$fElseSyntaxWhile$fAsyncSyntaxWith$fAsyncSyntaxFor$fAsyncSyntaxFundef$fFinallySyntax->TryFinally#$fFinallySyntaxTryFinallyTryFinally!$fFinallySyntaxTryExceptTryExcept$fAsExceptAsExpr$fAsExceptAsExceptAs$fExceptSyntaxTryFinally$fExceptSyntaxTryExcept$fExceptSyntax->$fAsExprExprWithItem$fAsExprIdentExceptAs$fAsWithItemWithItem$fAsWithItemExpr$fAsTupleItemTupleItem$fAsTupleItemExprAsIndentationError_IndentationError_ExpectedGreaterThan_ExpectedEqualTo_EmptyContinuedLineIndentationErrorIndentationTabErrorExpectedGreaterThanExpectedEqualToEmptyContinuedLine$fAsTabErrorIndentationErrora%$fAsIndentationErrorIndentationErrora$fEqIndentationError$fShowIndentationErrorValidateIndentation NextIndent GreaterThanEqualTo IndentationrunValidateIndentationrunValidateIndentation'equivalentIndentationvalidateBlockIndentationvalidateSuiteIndentationvalidateExprIndentationvalidateParamsIndentationvalidateArgsIndentationvalidateExceptAsIndentationvalidateDecoratorIndentation$validateCompoundStatementIndentationvalidateStatementIndentationvalidateModuleIndentation$fEqNextIndent$fShowNextIndent ScopeError FoundNonlocal FoundGlobal DeletedIdent FoundDynamic NotInScope BadShadowing$fEqScopeError$fShowScopeError AsScopeError _ScopeError_FoundNonlocal _FoundGlobal _DeletedIdent _FoundDynamic _NotInScope _BadShadowing$fAsScopeErrorScopeErrora ScopeContext_scGlobalScope _scLocalScope_scImmediateScopeBindingCleanDirtyScope $fEqBinding $fOrdBinding $fShowBinding$fEqScopeContext$fShowScopeContext ValidateScope scGlobalScopescImmediateScope scLocalScopeinitialScopeContextrunValidateScoperunValidateScope' extendScope locallyOverlocallyExtendOverinScopevalidateExceptAsScopevalidateSuiteScopevalidateDecoratorScopevalidateCompoundStatementScopevalidateSimpleStatementScopevalidateStatementScopevalidateIdentScopevalidateArgScopevalidateParamScopevalidateBlockScopevalidateComprehensionScopevalidateAssignExprScopevalidateDictItemScopevalidateSubscriptScopevalidateListItemScopevalidateSetItemScopevalidateTupleItemScopevalidateExprScopevalidateModuleScope SyntaxErrorPositionalAfterKeywordArgPositionalAfterKeywordUnpackingCannotAssignTo CannotDeleteCannotAugAssignToNoBindingNonlocalPositionalAfterKeywordParamUnexpectedDoubleStarParamDuplicateArgumentUnexpectedNewlineUnexpectedCommentIdentifierReservedWordEmptyIdentifier BadCharacterBreakOutsideLoopContinueOutsideLoopReturnOutsideFunctionNonlocalOutsideFunctionParametersNonlocalCan'tJoinStringAndBytesYieldOutsideGeneratorMalformedDecoratorInvalidDictUnpackingInvalidSetUnpackingTypedParamInLambdaAsyncWithOutsideCoroutineAsyncForOutsideCoroutineYieldFromInsideCoroutineYieldInsideCoroutineAwaitOutsideCoroutineAwaitInsideComprehensionNullByteNonAsciiInBytesDefaultExceptMustBeLastWildcardImportInDefinitionNoKeywordsAfterEmptyStarArgManyStarredTargetsManyStarredParamsContinueInsideFinallyParameterMarkedGlobal$fEqSyntaxError$fShowSyntaxError AsSyntaxError _SyntaxError_PositionalAfterKeywordArg _PositionalAfterKeywordUnpacking_CannotAssignTo _CannotDelete_CannotAugAssignTo_NoBindingNonlocal_PositionalAfterKeywordParam_UnexpectedDoubleStarParam_DuplicateArgument_UnexpectedNewline_UnexpectedComment_IdentifierReservedWord_EmptyIdentifier _BadCharacter_BreakOutsideLoop_ContinueOutsideLoop_ReturnOutsideFunction_NonlocalOutsideFunction_ParametersNonlocal_Can'tJoinStringAndBytes_YieldOutsideGenerator_MalformedDecorator_InvalidDictUnpacking_InvalidSetUnpacking_TypedParamInLambda_AsyncWithOutsideCoroutine_AsyncForOutsideCoroutine_YieldFromInsideCoroutine_YieldInsideCoroutine_AwaitOutsideCoroutine_AwaitInsideComprehension _NullByte_NonAsciiInBytes_DefaultExceptMustBeLast_WildcardImportInDefinition_NoKeywordsAfterEmptyStarArg_ManyStarredTargets_ManyStarredParams_ContinueInsideFinally_ParameterMarkedGlobal$fAsSyntaxErrorSyntaxErrora FunctionInfo_functionParams_asyncFunctionSyntax deleteBy'deleteFirstsBy' reservedWords SyntaxContext_inLoop _inFinally _inFunction _inGenerator_inClass _inParensValidateSyntax inFunction inGeneratorinLoopinParensrunValidateSyntaxrunValidateSyntax'localNonlocalsinitialSyntaxContextvalidateIdentSyntaxvalidateWhitespacevalidateComprehensionSyntaxvalidateStringLiteralSyntaxvalidateDictItemSyntaxvalidateSubscriptSyntaxvalidateListItemSyntaxvalidateSetItemSyntaxvalidateTupleItemSyntaxvalidateExprSyntaxvalidateBlockSyntaxvalidateSuiteSyntaxvalidateDecoratorSyntaxvalidateCompoundStatementSyntaxvalidateExceptAsSyntaxvalidateImportAsSyntaxvalidateImportTargetsSyntaxvalidateSimpleStatementSyntaxvalidateStatementSyntax canAssignTovalidateArgsSyntaxvalidateParamsSyntaxvalidateModuleSyntaxValidationError$fAsSyntaxErrorValidationErrora$fAsScopeErrorValidationErrora$$fAsIndentationErrorValidationErrora$fAsTabErrorValidationErrora$fEqValidationError$fShowValidationErrorvalidateModuleAllvalidateStatementAllvalidateExprAll validateAll#validation-1-JvgPAAITBmhACfHiuMDOIHData.Validation ValidationGHC.Base ApplicativeMonad lens-4.17-EALdarGCXihHZl8pEd1LaEControl.Lens.TypeLens' GHC.MaybeMaybeNothingghc-prim GHC.TypesChar TraversalLens Traversal'GHC.ListspanfinalnotFinalisFinal text-1.2.3.1Data.Text.InternalText parensDistTWSbreakOnNewline splitIndentsControl.Lens.SettersetlinesToBlockIndentedGHC.NumNumJust revalidate_Success_FailurebindValidation validationedensure codiagonalvalueOrorElsetoEither validation liftError fromEither validationNelvalidateSuccessFailureValidate _Validation_Either