,       !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~portable provisionalotakar.smrz cmu.edu Safe-InferredHThe data type  SimpleDoc& represents rendered documents and is  used by the display functions. The Int in SText( contains the length of the string. The Int  in SLine5 contains the indentation for that line. The library ( provides two default display functions  and  9. You can provide your own display function by writing a  function from a  SimpleDoc to your own output format. The abstract data type Doc represents pretty documents. Doc is an instance of the  class.  (show doc) pretty  prints document doc+ with a page width of 100 characters and a  ribbon width of 40 characters.  & show (text "hello" <$> text "world") Which would return the string "hello\nworld", i.e.   hello  world  The member  prettyList is only used to define the instance Pretty  a => Pretty [a]#. In normal circumstances only the pretty function  is used.  The document  (list xs) comma separates the documents xs and > encloses them in square brackets. The documents are rendered @ horizontally if that fits the page. Otherwise they are aligned D vertically. All comma separators are put in front of the elements.  The document  (tupled xs) comma separates the documents xs and : encloses them in parenthesis. The documents are rendered @ horizontally if that fits the page. Otherwise they are aligned D vertically. All comma separators are put in front of the elements.  The document (semiBraces xs) separates the documents xs with E semi colons and encloses them in braces. The documents are rendered @ horizontally if that fits the page. Otherwise they are aligned ? vertically. All semi colons are put in front of the elements.  The document (encloseSep l r sep xs) concatenates the documents  xs separated by sep( and encloses the resulting document by l  and r;. The documents are rendered horizontally if that fits the E page. Otherwise they are aligned vertically. All separators are put 7 in front of the elements. For example, the combinator  can be  defined with  encloseSep:  1 list xs = encloseSep lbracket rbracket comma xs : test = text "list" <+> (list (map int [10,200,3000])) /Which is layed out with a page width of 20 as:    list [10,200,3000] 3But when the page width is 15, it is layed out as:   list [10  ,200  ,3000] (punctuate p xs) concatenates all documents in xs with  document p except for the last document.  0 someText = map text ["words","in","a","tuple"] < test = parens (align (cat (punctuate comma someText))) ,This is layed out on a page width of 20 as:    (words,in,a,tuple) 3But when the page width is 15, it is layed out as:    (words,  in,  a,  tuple) B(If you want put the commas in front of their elements instead of  at the end, you should use  or, in general, .)  The document (sep xs) concatenates all documents xs either  horizontally with (<+>)*, if it fits the page, or vertically with  (<$>).  sep xs = group (vsep xs)  The document  (fillSep xs) concatenates documents xs  horizontally with (<+>)$ as long as its fits the page, than  inserts a line/ and continues doing that for all documents in  xs. ' fillSep xs = foldr (\<\/\>) empty xs  The document  (hsep xs) concatenates all documents xs  horizontally with (<+>).  The document  (vsep xs) concatenates all documents xs  vertically with (<$>). If a  undoes the line breaks  inserted by vsep,, all documents are separated with a space.  1 someText = map text (words ("text to lay out"))  * test = text "some" <+> vsep someText This is layed out as:    some text  to  lay  out The 5 combinator can be used to align the documents under  their first element  2 test = text "some" <+> align (vsep someText) Which is printed as:   some text  to  lay  out  The document (cat xs) concatenates all documents xs either  horizontally with (<>)*, if it fits the page, or vertically with  (<$$>).  cat xs = group (vcat xs)  The document  (fillCat xs) concatenates documents xs  horizontally with (<>), as long as its fits the page, than inserts  a  linebreak/ and continues doing that for all documents in xs. ) fillCat xs = foldr (\<\/\/\>) empty xs  The document  (hcat xs) concatenates all documents xs  horizontally with (<>).  The document  (vcat xs) concatenates all documents xs  vertically with (<$$>). If a  undoes the line breaks  inserted by vcat+, all documents are directly concatenated.  The document (x <> y) concatenates document x and document  y(. It is an associative operation having  as a left and  right unit. (infixr 6)  The document (x <+> y) concatenates document x and y with a  space in between. (infixr 6)  The document (x </> y) concatenates document x and y with a  # in between. This effectively puts x and y either  next to each other (with a space in between) or underneath each  other. (infixr 5)  The document (x <//> y) concatenates document x and y with  a # in between. This effectively puts x and y either ? right next to each other or underneath each other. (infixr 5)  The document (x <$> y) concatenates document x and y with a   in between. (infixr 5)  The document (x <$$> y) concatenates document x and y with  a  linebreak in between. (infixr 5)  The document softline behaves like  if the resulting 1 output fits the page, otherwise it behaves like .  softline = group line  The document  softbreak behaves like  if the resulting 1 output fits the page, otherwise it behaves like .  softbreak = group linebreak  Document  (squotes x) encloses document x with single quotes  "'".  Document  (dquotes x) encloses document x with double quotes  '"'.  Document  (braces x) encloses document x in braces, "{" and  "}".  Document  (parens x) encloses document x in parenthesis, "("  and ")".  Document  (angles x) encloses document x in angles, "<" and  ">".  Document  (brackets x) encloses document x in square brackets,  "[" and "]".  The document (enclose l r x) encloses document x between  documents l and r using (<>).  enclose l r x = l <> x <> r  The document lparen contains a left parenthesis, "(".  The document rparen contains a right parenthesis, ")".  The document langle contains a left angle, "<".  The document rangle contains a right angle, ">".  The document lbrace contains a left brace, "{".  The document rbrace contains a right brace, "}".  The document lbracket! contains a left square bracket, "[".  The document rbracket" contains a right square bracket, "]".  The document squote contains a single quote, "'".  The document dquote contains a double quote, '"'.  The document semi contains a semi colon, ";".  The document colon contains a colon, ":".  The document comma contains a comma, ",".  The document space contains a single space, " ".  x <+> y = x <> space <> y  The document dot contains a single dot, ".".  The document  backslash contains a back slash, "\".  The document equals contains an equal sign, "=".  The document  (string s) concatenates all characters in s  using line for newline characters and char for all other # characters. It is used instead of  whenever the text contains  newline characters.  The document (int i) shows the literal integer i using  .  The document  (integer i) shows the literal integer i using  .  The document  (float f) shows the literal float f using  .  The document  (double d) shows the literal double d using  .  The document  (rational r) shows the literal rational r using  .  The document (fillBreak i x) first renders document x. It  than appends spaces until the width is equal to i . If the  width of x is already larger than i, the nesting level is  increased by i and a line is appended. When we redefine ptype  in the previous example to use  fillBreak, we get a useful # variation of the previous output:   ptype (name,tp) < = fillBreak 6 (text name) <+> text "::" <+> text tp The output will now be:   let empty :: Doc ! nest :: Int -> Doc -> Doc  linebreak  :: Doc  The document  (fill i x) renders document x. It than appends  spaces until the width is equal to i. If the width of x is ? already larger, nothing is appended. This combinator is quite @ useful in practice to output a list of bindings. The following  example demonstrates this.   types = [("empty","Doc") ( ,("nest","Int -> Doc -> Doc")  ,("linebreak","Doc")]   ptype (name,tp) 7 = fill 6 (text name) <+> text "::" <+> text tp  8 test = text "let" <+> align (vcat (map ptype types)) Which is layed out as:   let empty :: Doc ! nest :: Int -> Doc -> Doc  linebreak :: Doc  The document  (indent i x) indents document x with i spaces.  % test = indent 4 (fillSep (map text A (words "the indent combinator indents these words !"))) +Which lays out with a page width of 20 as:   the indent  combinator  indents these  words ! AThe hang combinator implements hanging indentation. The document   (hang i x) renders document x! with a nesting level set to the  current column plus i%. The following example uses hanging  indentation for some text:  # test = hang 4 (fillSep (map text ? (words "the hang combinator indents these words !"))) ;Which lays out on a page with a width of 20 characters as:    the hang combinator  indents these  words ! The hang combinator is implemented as:  hang i x = align (nest i x)  The document  (align x) renders document x with the nesting < level set to the current column. It is used for example to  implement . ?As an example, we will put a document right above another one, * regardless of the current nesting level:   x $$ y = align (x <$> y)  7 test = text "hi" <+> (text "nice" $$ text "world") which will be layed out as:   hi nice  world /The empty document is, indeed, empty. Although empty has no  content, it does have a 'height' of 1 and behaves exactly like  (text "")! (and is therefore not a unit of <$>).  The document (char c) contains the literal character c. The  character shouldn't be a newline ('\n'), the function  ! should be used for line breaks.  The document (text s) contains the literal string s. The  string shouldn't contain any newline ('\n') characters. If the 2 string contains newline characters, the function  should be  used. The line7 document advances to the next line and indents to the ! current nesting level. Document line behaves like (text " ")  if the line break is undone by . The  linebreak3 document advances to the next line and indents to % the current nesting level. Document  linebreak behaves like   if the line break is undone by .  The document  (nest i x) renders document x with the current , indentation level increased by i (See also ,  and  ).  5 nest 2 (text "hello" <$> text "world") <$> text "!"  outputs as:   hello  world  ! The group+ combinator is used to specify alternative  layouts. The document  (group x) undoes all line breaks in  document x5. The resulting line is added to the current line if - that fits the page. Otherwise, the document x is rendered without  any changes. 4This is the default pretty printer which is used by ,   and . !(renderPretty ribbonfrac width x) renders  document x with a page width of width and a ribbon width of  (ribbonfrac * width)- characters. The ribbon width is the maximal ? amount of non-indentation characters on a line. The parameter   ribbonfrac should be between 0.0 and 1.0. If it is lower or ' higher, the ribbon width will be 0 or width respectively. (renderCompact x) renders document x without adding any  indentation. Since no 'pretty' printing is involved, this < renderer is very fast. The resulting output contains fewer E characters than a pretty printed version and can be used for output ! that is read by other programs. (displayS simpleDoc) takes the output  simpleDoc from a + rendering function and transforms it to a  type (for use in  the  class). # showWidth :: Int -> Doc -> String 6 showWidth w x = displayS (renderPretty 0.4 w x) "" (displayIO handle simpleDoc) writes  simpleDoc to the file  handle handle'. This function is used for example by : C hPutDoc handle doc = displayIO handle (renderPretty 0.4 100 doc)  The action  (putDoc doc) pretty prints document doc to the C standard output, with a page width of 100 characters and a ribbon  width of 40 characters.   main :: IO () 5 main = do{ putDoc (text "hello" <+> text "world") } Which would output   hello world (hPutDoc handle doc) pretty prints document doc to the file  handle handle2 with a page width of 100 characters and a ribbon  width of 40 characters. 2 main = do{ handle <- openFile "MyFile" WriteMode + ; hPutDoc handle (vcat (map text 2 ["vertical","text"]))  ; hClose handle  } r     Sa       Safe-Inferred7 Lua tokens  end of file  identifier string constant number constant while until true then return repeat or not nil local in if goto  function for false end elseif else do break and ... .. . !, ": #; $:: %] &[ '} ({ )) *( += ,> -< .>= /<= 0~= 1== 2# 3^ 4% 5/ 6* 7- 8+ 9#Partial function, returns value of ,  and . 8  !"#$%&'()*+,-./01234567897  !"#$%&'()*+,-./01234567897876543210/.-,+*)('&%$#"!  95876543210/.-,+*)('&%$#"!  9None:%Lua token with position information. CEncode a Haskell String to a list of Word8 values, in UTF8 format. = Lua lexer. >Run Lua lexer on a file. : !"#$%&'()*+,-./01234;<56789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcd=>efghijklmnopqrstuvwxyz{|}~:;<=>=>:;<t: !"#$%&'()*+,-./01234;<56789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcd=>efghijklmnopqrstuvwxyz{|}~None@PThis parser succeeds whenever the given predicate returns true when called with  parsed : . Same as  . A Parses given . B Parses a . C Parses a . D Parses a . ?@ABCD?@ABCD?@ABCD?@ABCD Safe-Inferred#F(Retrieve the annotation of an AST node. GGChange the annotation of an AST node. Note that only the annotation of L the node itself is affected, and not the annotations of any child nodes. 8 if all nodes in the AST tree are to be affected, use . Istring Jtable constructor K list of args Mprefixexp : name ( funarg ) Nprefixexp ( funarg ) P(args, vararg, block) U>A block is list of statements with optional return statement. Y name = exp Z [exp] = exp \list of table fields vtable.variable w table[exp] x variable zunary operators, - not # {binary operators, #+ - * ^ % .. < <= > >= == ~= and or |table constructor ~function (..) .. end ... ; $local var1, var2 .. = exp1, exp2 .. local function <var> (..) .. end  function <var> (..) .. end for x in .. do .. end for x=start, end [, step] do .. end if .. then .. [elseif ..] [else ..] end repeat .. until .. while .. do .. end  do .. end  goto label break label for goto function call var1, var2 .. = exp1, exp2 .. _EFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~QEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~Qy~}|{zuxwvetsrqponmlkjihgfadcb]`_^[\WZYXUVSTQROPLNMHKJIEFGEFGHKJILNMOPQRSTUVWZYX[\]`_^adcbetsrqponmlkjihgfuxwvy ~}|{zNone#Runs Lua lexer before parsing. Use parseText stat to parse  statements, and  parseText exp to parse expressions. Parse a Lua file. You can use parseText chunk to parse a file from a string. Expression parser. Statement parser. Lua file parser. >7 Safe-Inferred None%=>UVyz{|}~%=>UVy~}|{z    !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJ KLMNOPQRSTUVWXYYZZ[[\\]^_`aabcdefghijklmnopqrstuvwxyz{|}ufj~bVN      !"#$%%&''()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXKYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~language-lua-0.2.3Language.Lua.PrettyPrinterLanguage.Lua.TokenLanguage.Lua.LexerText.Parsec.LTokLanguage.Lua.TypesLanguage.Lua.ParserText.PrettyPrint.LeijenText.Parsec.Charsatisfy Language.Lua renderPrettydisplayS displayIOLTokenLTokEof LTokIdentLTokSLitLTokNum LTokWhile LTokUntilLTokTrueLTokThen LTokReturn LTokRepeatLTokOrLTokNotLTokNil LTokLocalLTokInLTokIfLTokGoto LTokFunctionLTokFor LTokFalseLTokEnd LTokElseIfLTokElseLTokDo LTokBreakLTokAnd LTokEllipsisLTokDDotLTokDot LTokComma LTokColon LTokSemic LTokDColon LTokRBracket LTokLBracket LTokRBrace LTokLBrace LTokRParen LTokLParen LTokAssignLTokGTLTokLTLTokGEqLTokLEq LTokNotequal LTokEqualLTokShLTokExp LTokPercent LTokSlashLTokStar LTokMinusLTokPlus tokenValueLTokAlexPosnAlexPnllexllexFileParsertokanyIdentanyNumstring AnnotatedannamapFunArg StringArgTableArgArgsFunCall MethodCall NormalFunCallFunBodyFunDefFunNameBlock TableFieldField NamedFieldExpFieldTable PrefixExpParen PEFunCallPEVarUnopLenNotNegBinopOrAndNEQEQGTEGTLTELTConcatModExpDivMulSubAddVar SelectNameSelectVarName TableConstEFunDefVarargStringNumberBoolNilStat EmptyStat LocalAssignLocalFunAssign FunAssignForInForRangeIfRepeatWhileDoGotoBreakLabelAssignName parseText parseFileexpstatchunkLPrettypprint SimpleDocDocbaseGHC.ShowShowPrettylisttupled semiBraces encloseSep punctuatesepfillSephsepvsepgroupaligncatfillCathcatvcat<>empty<+>softline softbreak<$>line<$$>spacesquotesdquotesbracesparensanglesbracketsencloselparenrparenlangleranglelbracerbracelbracketrbracketsquotedquotesemicoloncommadot backslashequalstextintintegerfloatdoublerational fillBreakfillindenthangchar linebreaknestshowputDochPutDoc renderCompactShowSDocsConsSLineSTextSCharSEmptyNestingColumnUnionNestCatLineTextCharEmptypretty prettyListfoldboolwidthisEmptybesidecolumnnestingflattenfitsspaces indentation $fShowDoc $fPrettyMaybe $fPretty(,,) $fPretty(,)$fPrettyDouble $fPrettyFloat$fPrettyInteger $fPrettyInt $fPrettyChar $fPrettyBool $fPretty() $fPrettyDoc $fPretty[] $fShowLToken utf8EncodeAlexAcc AlexAccSkip AlexAccNone AlexLastAcc AlexLastSkipAlexNone AlexReturn AlexTokenAlexSkip AlexErrorAlexEOFAlexAddrAlexA#EOF AlexUserState stringStatestringDelimLen stringPosn stringValue commentState AlexActionAlexunAlex AlexStatealex_posalex_inpalex_chr alex_bytesalex_scdalex_ust AlexInputByteignorePendingBytesalexInputPrevChar alexGetByte alexStartPosalexMoverunAlex alexGetInput alexSetInput alexErroralexGetStartCodealexSetStartCodealexGetUserStatealexSetUserState alexMonadScanskipbeginandBegintoken alex_base alex_table alex_check alex_deflt alex_acceptalexInitUserState initString initCommentgetStringDelimLen getStringPosngetStringValuegetStringStategetCommentStateaddCharToStringValue enterString enterComment addStringaddCharToString endString endCommenttestAndEndCommenttestAndEndString tokWValueidentalexEOFalexMonadScan'scanner state_comment state_string alex_action_1 alex_action_2 alex_action_3 alex_action_4 alex_action_5 alex_action_6 alex_action_7 alex_action_8 alex_action_9alex_action_10alex_action_11alex_action_12alex_action_13alex_action_15alex_action_16alex_action_17alex_action_18alex_action_19alex_action_20alex_action_21alex_action_22alex_action_23alex_action_24alex_action_25alex_action_26alex_action_27alex_action_28alex_action_29alex_action_30alex_action_31alex_action_32alex_action_33alex_action_34alex_action_35alex_action_36alex_action_37alex_action_38alex_action_39alex_action_40alex_action_41alex_action_42alex_action_43alex_action_44alexIndexInt16OffAddralexIndexInt32OffAddr quickIndexalexScan alexScanUser alex_scan_tkniUnbox$fFunctorAlexLastAcc $fMonadAlexGHC.Basefmap$fAnnotatedFunArg$fAnnotatedFunCall$fAnnotatedFunBody$fAnnotatedFunDef$fAnnotatedFunName$fAnnotatedBlock$fAnnotatedTableField$fAnnotatedTable$fAnnotatedPrefixExp$fAnnotatedUnop$fAnnotatedBinop$fAnnotatedVar$fAnnotatedExp$fAnnotatedStat SuffixExpSFunCall SSelectMethod SSelectExpSSelect SuffixedExp PrimaryExpPParenPNamenamenumber primaryExp suffixedExp suffixExp sexpToPexp sexpToVar sexpToFunCallvarfunCall stringlitfunArgfunBodyblockretstat tableFieldtablenilExpboolExp numberExp stringExp varargExp fundefExp prefixexpExp tableconstExpbinaryprefixopTableopExpexp' emptyStat assignStat funCallStat labelStat breakStatgotoStatdoStat whileStat repeatStatifStat forRangeStat forInStat funAssignStatlocalFunAssignStatlocalAssignStat intercalatepprintFunction $fLPrettyStat$fLPrettyFunArg$fLPrettyFunCall$fLPrettyFunBody$fLPrettyFunDef$fLPrettyFunName$fLPrettyBlock$fLPrettyTableField$fLPrettyTable$fLPrettyPrefixExp $fLPrettyUnop$fLPrettyBinop $fLPrettyVar $fLPrettyExp $fLPrettyName $fLPrettyBool $fLPretty[]