úÎwDsÈ;      !"#$%&'()*+,-./0123456789:Abstract syntax description.(c) PaweB NowakMIT PaweB Nowak <pawel834@gmail.com> experimentalNone13=K-Execute a computation in an isolated context.4The motivating example: you want to write a function 5serializeList :: Syntax syn => syn () a -> syn () [a]9Notice that we cannot just use simany, because the first syn () a­ could eat the entire sequence (even though we printed more than 1 value!), so we have to insert some kind of separators between the element. But how can we be sure that syn () a™ will not eat our separators? We can't! Thats why we have to do the parsing in two stages: first extract the sequence between separators, then run the syn () a on this sequence.=Turns a computation into one executed in an isolated context.:An abstract syntax description based on semi-isomorphisms.;This class can be implemented by both parsers and printers.¾The usual use is to write a polymorphic syntax description and instantiate it both as a parser and a printer. Examples are available in 'syntax-example' and 'syntax-example-json' packages.#Methods of this class try to mimic Data.Attoparsec.Text interface.&The sequence type used by this syntax.Any character.A specific character.#Any character except the given one.%Any character satisfying a predicate.\Transforms a character using a SemiIso and filters out values not satisfying the predicate. A specific string. A string of length n. 2Maximal string which elements satisfy a predicate. <Maximal non-empty string which elements satisfy a predicate. 9Maximal string which elements do not satisfy a predicate.CMaximal non-empty string which elements do not satisfy a predicate.¹Constant size vector. The default implementation uses lists, but "syntax-attoparsec" and "syntax-printer" override it with an efficient implementation that works on a vector directly.vecN n e describes a size n vector with elements e. Also see .ÒConstant size vector with index-aware element. The default implementation uses lists, but "syntax-attoparsec" and "syntax-printer" override it with an efficient implementation that works on a vector directly. ivecN n e describes a size n vector with elements eQ. Each element gets its index and should output a value and the index unchanged. Also see .ÁConstant size unboxed vector. The default implementation uses lists, but "syntax-attoparsec" and "syntax-printer" override it with an efficient implementation that works on a vector directly.vecN n e describes a size n vector with elements e. Also see .ÚConstant size unboxed vector with index-aware element. The default implementation uses lists, but "syntax-attoparsec" and "syntax-printer" override it with an efficient implementation that works on a vector directly. ivecN n e describes a size n vector with elements eQ. Each element gets its index and should output a value and the index unchanged. Also see .=An isomorphism between a sequence and a list of its elements. ;   ;-Combinators that work with any sequence type.G(c) Daan Leijen 1999-2001, Bryan O'Sullivan 2007-2014, PaweB Nowak 2014MIT PaweB Nowak <pawel834@gmail.com> experimentalNone3HMOne or zero occurences of f.Like , but specialized for ().!Parser one or zero occurences of f, but prints nothing.yTries to apply the actions in the list in order, until one of them succeeds. Returns the value of the succeeding action.Combine two alternatives.manyTill p endn applies action p zero or more times until action end succeeds, and returns the list of values returned by p.Zero or more occurences of v separated by s.One or more occurences of v separated by s.A string of given length.%Constant size vector with separators.vecNSepBy n e sep describes a size n vector with elements e separated by sep.>Constant size vector with separators and index-aware elements.ivecNSepBy n e sep describes a size n vector with elements e separated by sepQ. Each element gets its index and should output a value and the index unchanged.LRuntime sized vector. The size can depend on the result of some computation.vec e" describes a vector with elements e. ]Runtime sized vector with separators. The size can depend on the result of some computation.vecSepBy e sep" describes a vector with elements e separated by sep.!gRuntime sized vector with index-aware elements. The size can depend on the result of some computation.ivec e" describes a vector with elements e."vRuntime sized vector with index-aware elements and separators. The size can depend on the result of some computation.ivecSepBy e sep" describes a vector with elements e separated by sep.#-Constant size unboxed vector with separators.uvecNSepBy n e sep describes a size n vector with elements e separated by sep.$FConstant size unboxed vector with separators and index-aware elements.uivecNSepBy n e sep describes a size n vector with elements e separated by sepQ. Each element gets its index and should output a value and the index unchanged.%TRuntime sized unboxed vector. The size can depend on the result of some computation.uvec e" describes a vector with elements e.&eRuntime sized unboxed vector with separators. The size can depend on the result of some computation.uvecSepBy e sep" describes a vector with elements e separated by sep.'oRuntime sized unboxed vector with index-aware elements. The size can depend on the result of some computation.uivec e" describes a vector with elements e.(~Runtime sized unboxed vector with index-aware elements and separators. The size can depend on the result of some computation.uivecSepBy e sep" describes a vector with elements e separated by sep. !"#$%&'( !"#$%&'( !"#$%&'( !"#$%&'(Char specific combinators.(c) PaweB NowakMIT PaweB Nowak <pawel834@gmail.com> experimentalNone&=K)6An useful synonym for SyntaxChars with Text sequences.**Syntax constrainted to sequences of chars.›Note: methods of this class do not have default implementations (for now), because their code is quite ugly and already written in most parser libraries.+An unsigned decimal number.,An unsigned hexadecimal number.-A signed real number..A scientific number./"A number with an optional leading < or = sign character.06Accepts zero or more spaces. Generates a single space.11Accepts zero or more spaces. Generates no output.25Accepts one or more spaces. Generates a single space.3.Accepts a single newline. Generates a newline.4A decimal digit.5An octal digit.6 A hex digit.)*+,-./0123456>)*+,-./0123456*+,-.)/0123456 )*+,-./0123456>Simple indentation.(c) PaweB NowakMIT PaweB Nowak <pawel834@gmail.com> experimentalNone24=BK7)Adds indentation to a syntax description.8runIndent m tab runs the 7 transformer using tab% once for each level of indentation.9Inserts a new line and correct indentation, but does not require any formatting when parsing (it just skips all white space).:7Increases the indentation level of its argument by one. 7?@89:ABC789:789:7?@89:ABCD      !"#$%&'()*+,-./0123456789:;<=>?@ABCABDE<FGHIJsyntax-1.0.0.0 Data.SyntaxData.Syntax.CombinatorData.Syntax.CharData.Syntax.IndentvecivecIsolableisolateSyntaxSeqanyCharcharnotCharsatisfy satisfyWithstringtake takeWhile takeWhile1takeTill takeTill1vecNivecNuvecNuivecNpackedoptionaloptopt_choiceeitherOfmanyTillsepBysepBy1takeArr vecNSepBy ivecNSepByvecSepBy ivecSepBy uvecNSepBy uivecNSepByuvec uvecSepByuivec uivecSepBy SyntaxText SyntaxChardecimal hexadecimal realFloat scientificsignedspacesspaces_spaces1 endOfLinedigitDecdigitOctdigitHexIndent runIndent breakLineindented$fSyntaxReaderCTbaseGHC.Num+-$fSyntaxCharReaderCT getIndent$fSyntaxCharIndent$fSyntaxIndent$fCatTransIndent