śĪŲĖÉĻ      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ”¢£¤„¦§Ø©Ŗ«¬­®Æ°±²³“µ¶·ø¹ŗ»¼½¾æĄĮĀĆÄÅĘĒČÉŹĖĢĶĪSafe 1—All of the keywords. This list is used when parsing and rendering because an unquoted string cannot have a name that is exactly the same as a keyword.   ĻSafeh DStart and end points for a span of text. When we parse text into an  Expression„, we annotate it with source ranges so error messages that refer to specific expressions can tell the user where in their Bricks code those expressions are defined. An endpoint of a . Safeh%5!qA string that can be rendered unquoted. Unquoted strings are restricted to a conservative set of characters; see % for the full rules.YThis type does not represent a particular part of Bricks syntax, but it is a wrapper for ŠQ that enforces the limitations of strings at various places in the Bricks syntax. Construction#$Deconstruction"See also%&# Properties)A text value may be used to construct an ! iff it satisfies %. % x = Ń (# x)$9Throws an exception if the string cannot render unquoted.%EWhether a string having this name can be rendered without quoting it.!Requirements for unquoted stringsEWe allow a string to render unquoted if all these conditions are met:The string is nonemptyAll characters satify &The string is not a keyword Properties)A text value may be used to construct an ! iff it satisfies %. % x = Ń (# x)Examplestext'canBeUnquoted "-ab_c"Truetext'canBeUnquoted ""Falsetext'canBeUnquoted "a\"b"Falsetext'canBeUnquoted "let"False&6Whether the character is allowed to be included in an !. Such characters are letters, +, -, *, /, and _.&This is used in the implementation of %. !"#$%&!"#$"%&!Ņ"Safe]hæƒ6(<A semicolon-terminated binding within the binding list of a + expression. )+A binding with an equals sign, of the form x = y;*A binding using the inherit keyword, of the form inherit (x) a b;+SyntaxA let-in expression (z) looks like this: Blet greet = x: "Hello, ${x}!"; name = "Chris"; in greet nameLet0 bindings, like dict bindings, may also use the inherit keyword. blet d = { greet = x: "Hello, ${x}!"; name = "Chris"; } inherit (d) greet name; in greet name=The previous example also demonstrates how the bindings in a let? expression may refer to each other (much like a dict with the recE keyword). As with dicts, the order of the bindings does not matter. -%The bindings (everything between the let and in keywords). The value (everything after the in keyword)0The dot= function looks up a value (or a list of values) from a dict.Syntax$A dot expression is named after the . character it contains. a.b looks up value at key b in the dict a./The examples in this section all reduce to "Z". { a = "Z"; }.a let x = { a = "Z"; }; in x.a { x = { a = "Z"; }; }.x.aHThe right-hand side of a dot may be a quoted string (in the traditional " ... " style, not the indented-string '' style): { a = "Z"; }."a"LThe right-hand side of a dot may even be an arbitrary expression, using the ${ ... } form: #{ a = "Z"; }.${ let b = "a"; in b }5A binding within a 9. 6A binding of the form x = y;97A dict is an unordered enumerated mapping from strings.SyntaxA dict expression (v) starts with { or rec { , ends with }, and contains any number of 5 s in between."The empty dict (with no bindings): { }A dict with two bindings: !{ a = "one"; b = "one two"; }MBy default, dict bindings cannot refer to each other. For that, you need the rec keyword to create a  recursive dict. &rec { a = "one"; b = "${a} two"; }:In either case, the order of the bindings does not matter.PThe left-hand side of a dict binding may be a quoted string (in the traditional " ... " style, not the indented-string ''ˆ style), which make it possible for them to be strings that otherwise couldn't be expressed unquoted, such as strings containing spaces: { "a b" = "c"; }LThe left-hand side of a dict may even be an arbitrary expression, using the ${ ... } form: !let x = "a b"; in { ${x} = "c"; }Dicts also support the inherit keyword: { inherit a; inherit (x) c d; })The previous expression is equivalent to: { a = a; c = x.c; d = x.d; };.Whether the dict is recursive (denoted by the rec keyword)<!The bindings (everything between { and })> A list is an ordered collection.SyntaxA list expression (u) starts with [ , ends with ]4, and contains any number of expressions in between.The empty list: [ ]"A list containing three variables:  [ a b c ] Lambdas, function applications, let-in expressions, and with2 expressions must be parenthesized when in a list. B[ (x: f x y) (g y) (let a = y; in f a a) (with d; f x a) ]BOne item within a F. D+The name of the key to pull out of the dictEBThe default value to be used if the key is not present in the dictFA type of function parameter (J ) that does dict destructuring. HUThe list of keys to pull out of the dict, along with any default value each may haveI[Whether to allow additional keys beyond what is listed in the items, corresponding to the ... keywordJA parameter to a S}. All functions have a single parameter, but it's more complicated than that because it may also include dict destructuring. K"A simple single-parameter functionLgDict destructuring, which gives you something resembling multiple named parameters with default valuesMBoth a param name and" a dict pattern, separated by the @ keywordN3The application of a function to a single argument.Syntax$An function application expression (y) looks like this: f xUIf a function has multiple (curried) parameters, you can chain them together like so: f x y zPThe function being calledQThe argument to the functionS-A function expressed as a lambda abstraction.SyntaxA lambda expression (x) has the form x: y where x8 is the function parameter to bind in the function body y.5This is a function that turns a name into a greeting: name: "Hello, ${name}!"%The function parameter can also be a  dict pattern, which looks like this: 7{ a, b, c ? "another" }: "Hello, ${a}, ${b}, and ${c}!"3That function accepts a dict and looks up the keys a, b, and c% from it, applying the default value  "another" to c’ if it is not present in the dict. Dict patterns therefore give us something that resembles functions with named parameters and default arguments.ĆBy default, a lambda defined with a dict pattern fails to evaluate if the dict argument contains keys that are not listed in the pattern. To prevent it from failing, you can end the pattern with  ... : %({ a, ... }: x) { a = "1"; b = "2"; }ZEvery function has a single parameter. If you need multiple parameters, you have to curry:  a: b: [ a b ]U'Declaration of the function's parameterV*Body of the function; what it evaluates toXOne line of an ^. Z_The number of leading space characters. We store this separately for easier implementation of Œ.[3The source position of the leading space characters\LThe meat of the line, after any leading spaces and before the line break.]YThe line break at the end, if any; all lines but the last one should have a line break^=An "indented string literal," delimited by two single-quotes ''.wThis type of literal is called "indented" because the parser automatically removes leading whitespace from the string (Œ±), which makes it convenient to use these literals for multi-line strings within an indented expression without the whitespace from indentation ending up as part of the string. bOne part of a e. eA dynamic stringB is a quoted string expression, which may be a simple string like "hello"8 or a more complex string containing antiquotation like "Hello, my name is ${name}!". See s.`We use the description "dynamic" to mean the string may contain antiquotation, in contrast with i which cannot.(This is the type of string expressions (s). String syntaxA stringK may be quoted either in the traditional form using a single double-quote (" ... "):  "one\ntwo":or in the "indented string" form using two single-quotes ('' ... ''): '' one two ''nBoth of these examples reduce to the same value, because leading whitespace is stripped from indented strings.ŽEither may contain "antiquotation" (also known as "string interpolation") to conveniently concatenate string-valued variables into the string. "Hello, my name is ${name}!":Normal strings may contain the following escape sequences:\\ !’ \\" !’ "\${ !’ ${\n !’ newline\r !’ carriage return\t !’ tabBThe indented string form does not interpret any escape sequences. iyA fixed string value. We use the description "static" to mean the string may not contain antiquotation, in contrast with e which can. mA variable x>, as in the lambda calculus sense, is in one of two positions: 6A binding, which may take a number of forms: - x: ... (K ) - let x = ... ; in ... () ) -  let inherit ( ... ) x; in ... (LetBinding'Inhherit)+A contextual reference to a lambda head or let binding in which x( is bound: - The expression x by itself - An inherit binding in a dict expression (8)Syntax,Variables are always written without quotes.)Unquoted strings are used for variables (r") and places that bind variables (S and +).rA variable, such as xsIA string, quoted in the traditional form using a single double-quote (" ... ")t@A string in "indented string" form, using two single-quotes ('' ... '')u/A list is an ordered collection of expressions.v7A dict is an unordered enumerated mapping from strings.w"A dot expression (named after the .L character it contains) looks up the value at a particular key in a dict.xA lambda expression x: y where x is the parameter.y3The application of a function to a single argument.zA let-inQ expression consists of a list of variable bindings followed by an expression.†ISimplify a dynamic string by combining consecutive pieces of static text.Examples:{str :: Text -> Str'1,str x = Str'1'Literal $ Str'Static x Nothingvar :: Text -> Str'1$var x = Str'1'Antiquote . Expr'Var $&Var (unquotedString'orThrow x) Nothing:}:{1str'dynamic'normalize $ Str'Dynamic (Seq.fromList?[str "a", str "b", var "x", var "y", str "c", str "d"]) Nothing:}:str ["ab", antiquote (var "x"), antiquote (var "y"), "cd"]‹NDetermine how many characters of whitespace to strip from an indented string. Œ|Determine the minimum indentation of any nonempty line, and remove that many space characters from the front of every line. Ž}Remove any empty lines from the beginning or end of an indented string, and remove the newline from the final nonempty line. Examples=str'dynamic'to'static $ Str'Dynamic (Seq.fromList []) NothingJust ""+a = Str'1'Literal (Str'Static "hi" Nothing)Ib = Str'1'Antiquote $ Expr'Var $ Var (unquotedString'orThrow "x") Nothing@str'dynamic'to'static $ Str'Dynamic (Seq.fromList [ a ]) Nothing Just "hi"Cstr'dynamic'to'static $ Str'Dynamic (Seq.fromList [ a, b ]) NothingNothing°This instance is designed for doctests and REPL experimentation. The format is designed to strike a balance in verbosity between the derived Ó’’ implementations (which are unwieldily long) and the Bricks language itself (which is quite terse but unsuitable for demonstrating the parser, as outputting a Bricks rendering of parse result wouldn't illumunate anyone's understanding of the AST that the Ó instances are here to depict). ’FunctionArgsFunction applicationšDictLookupsDot expressionv()*+,/-.0142356789:=;<>?A@BCDEFGHIJKLMNORPQSTWUVXYZ[\]^_a`bcdefhgijklmnpoqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œvqrstuvwxyz{|mnop}~€ijkl‚efghbcd…„†ƒ^_`a‹ŒŽ‡ˆXYZ[\]Љ>?@A—9:;<=˜5678™01234š›STUVW‘JKLM”FGHI•BCDE–NOPQR’“+,-./œ()*()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopq rstuvwxyzNone>?AKŹD“A newtype for b just so we can give it the Ō> instance which would be dubiously appropriate for the actual b type. Õ/Combine two params, merging dict patterns with Ö9 and preferring the right-hand-side when names conflict. ÖVCombine two dict patterns, taking the concatenation of the item list, and the Boolean or of the ellipsis flag. !q²³“µ¶·ø¹ŗ»¼½¾æĄĮĀĆÄÅĘĒČÉŹĖĢ!·ø¹ŗ»¼½¾æĄĮĀĆÄÅ“µ¶ĘDz³ČÉŹĖĢq²³“µ¶SafeĖ¢×ŲŁŚŪÜŻŽß        !"#$%&'()*+,-./012334567789:;<=>??@ABCCDEFFGHIIJKLMNOPPQRSTTUVWXXYZ[\]]^_`abccdeffghiijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ”¢£¤„¦§Ø©Ŗ«¬­­®®Æ°±²³“µ¶·ø¹ŗ»¼½¾æĄĮĀĆÄÅĘĒČÉŹĖĢ)ĶĪĻŠŃŅÓŌÕÖ×ŲŁŚŪ,bricks-syntax-0.0.0.4-JRgz4zpOZYOLMO0dGkWHnjBricks.Expression.ConstructionBricks.Keyword Bricks.SourceBricks.UnquotedStringBricks.ExpressionPaths_bricks_syntaxbaseData.Semigroup<>GHC.BaseMaybeNothingJust Data.Function&Keyword keywordTextkeywords keywordString keyword'rec keyword'let keyword'inkeyword'inheritkeyword'inlineComment SourceName SourceRangesourceRange'startsourceRange'endSourcePositionsourcePosition'linesourcePosition'columnshow'sourcePositionshow'sourceRangesourceRange'joinsourceRangeMaybe'join$fShowSourcePosition$fSemigroupSourceRange$fShowSourceRange$fEqSourcePosition$fOrdSourcePositionUnquotedStringunquotedString'textunquotedString'tryunquotedString'orThrowtext'canBeUnquotedchar'canBeUnquoted$fShowUnquotedString LetBinding LetBinding'EqLetBinding'InheritLet let'bindings let'value let'sourceDotdot'dictdot'key dot'source DictBindingDictBinding'EqDictBinding'Inherit'DictDictBinding'Inherit'VarDictdict'rec dict'bindings dict'sourceListlist'expressions list'source DictPattern'1dictPattern'1'namedictPattern'1'default DictPatterndictPattern'itemsdictPattern'ellipsisParam Param'NameParam'DictPattern Param'BothApply apply'func apply'arg apply'sourceLambda lambda'head lambda'body lambda'sourceInStr'1 inStr'1'levelinStr'1'indentSource inStr'1'strinStr'1'lineBreakInStr inStr'toSeq inStr'sourceStr'1 Str'1'LiteralStr'1'Antiquote Str'DynamicstrDynamic'toSeqstrDynamic'source Str'Staticstr'static'textstr'static'sourceVarvar'str var'source ExpressionExpr'VarExpr'StrExpr'Str'Indented Expr'List Expr'DictExpr'Dot Expr'Lambda Expr'ApplyExpr'Letexpression'sourceexpression'discardSourcevar'textvar'to'str'staticvar'to'str'dynamicvar'discardSourcestr'static'appendstr'static'discardSourcestr'dynamic'discardSourcestr'dynamic'appendstr'1'discardSourcestr'dynamic'normalize inStr'toListinStr'discardSourceinStr'1'discardSourceinStr'1'toStrParts inStr'level inStr'dedentinStr'to'strDynamic inStr'trimstr'dynamic'to'staticstr'static'to'dynamiclambda'discardSourceexpression'applyArgsapply'discardSourceparam'discardSourcedictPattern'discardSourcedictPattern'1'discardSourcelist'discardSourcedict'discardSourcedictBinding'discardSourceexpression'applyDotsdot'discardSourcelet'discardSourceletBinding'discardSource $fShowVar$fShowStr'Static$fSemigroupStr'Static$fShowLetBinding $fShowLet $fShowApply$fShowDictPattern'1$fShowDictPattern $fShowParam $fShowLambda $fShowDot$fShowDictBinding $fShowDict $fShowList $fShowInStr'1 $fShowInStr $fShowStr'1$fShowStr'Dynamic$fShowExpression$fSemigroupStr'Dynamic Param'BuilderStr'1'IsStringunStr'1'IsStringlambdaapplyvardotlistlet'inlet'eqlet'inherit'fromdictrec'dictdict'eqdict'inherit'from dict'inheritstr antiquote str'indentedindentparampattern dict'paramdefellipsis$fIsStringStr'1'IsString$fSemigroupParam'Builder#text-1.2.2.2-EakMpasry3jA6OIwSZhq9MData.Text.InternalText Data.MaybeisJustGHC.ShowShow Data.StringIsString mergeParamsmergeDictPatternsversion getBinDir getLibDir getDynLibDir getDataDir getLibexecDir getSysconfDirgetDataFileName