!2m      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\] ^ _ ` 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 { | } ~        !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~                                                                                                                       ! " # $ %&'()*+,-./0123456789:;<=>?@ABCDEFGHIJK L M N O P Q R S T U VWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~!Safe4CdhallA  (Context a) associates  labels with values of type a . Each 1 label can correspond to multiple values of type aThe  is used for type-checking when  (a = Expr X) You create a  using  and  You transform a  using You consume a  using   and  The difference between a  and a  is that a ^ lets you have multiple ordered occurrences of the same key and you can query for the nth occurrence of a given key.dhall(An empty context with no key-value pairs dhallAdd a key-value pair to the  dhall"Pattern match" on a  Jmatch (insert k v ctx) = Just (k, v, ctx) match empty = Nothing dhallLook up a key by name and index lookup _ _ empty = Nothing lookup k 0 (insert k v c) = Just v lookup k n (insert k v c) = lookup k (n - 1) c lookup k n (insert j v c) = lookup k n c -- k /= j dhall+Return all key-value associations as a list JtoList empty = [] toList (insert k v ctx) = (k, v) : toList ctx  None7MCNone "#245679HV&!dhallA !- that remembers the original ordering of keys?This is primarily used so that formatting preserves field order0This is done primarily to avoid a dependency on insert-ordered-containers$ and also to improve performance"dhall Create a ! from a single key-value pairsingleton "A" 1fromList [("A",1)]#dhall Create a ! from a list of key-value pairs6fromList [("B",1),("A",2)] -- The map preserves orderfromList [("B",1),("A",2)]KfromList [("A",1),("A",2)] -- For duplicates, later values take precedencefromList [("A",2)]1Note that this handling of duplicates means that # is not a monoid homomorphism:-fromList [(1, True)] <> fromList [(1, False)]fromList [(1,True)]&fromList ([(1, True)] <> [(1, False)])fromList [(1,False)]$dhall Create a !: from a list of key-value pairs with a combining function.NfromListWithKey (\k v1 v2 -> k ++ v1 ++ v2) [("B","v1"),("A","v2"),("B","v3")]#fromList [("B","Bv3v1"),("A","v2")]dhallRemove duplicates from a listnubOrd [1,2,3][1,2,3]nubOrd [1,1,3][1,3]%dhall Create a ! from a single key-value pair.IAny further operations on this map will not retain the order of the keys.unorderedSingleton "A" 1fromList [("A",1)]&dhall Create a ! from a list of key-value pairsIAny further operations on this map will not retain the order of the keys.unorderedFromList [] fromList []HunorderedFromList [("B",1),("A",2)] -- The map /doesn't/ preserve orderfromList [("A",2),("B",1)]TunorderedFromList [("A",1),("A",2)] -- For duplicates, later values take precedencefromList [("A",2)]'dhallSort the keys of a !", forgetting the original ordering sort (sort x) = sort x!sort (fromList [("B",1),("A",2)])fromList [("A",2),("B",1)](dhallCheck if the keys of a ! are already sorted isSorted (sort m) = TrueJisSorted (fromList [("B",1),("A",2)]) -- Sortedness is based only on keysFalse%isSorted (fromList [("A",2),("B",1)])True)dhallInsert a key-value pair into a !N, overriding any previous value stored underneath the same key, if present insert = insertWith (\v _ -> v)Iinsert "C" 1 (fromList [("B",2),("A",3)]) -- Values are inserted on left"fromList [("C",1),("B",2),("A",3)]Hinsert "C" 1 (fromList [("C",2),("A",3)]) -- New value takes precedencefromList [("C",1),("A",3)]*dhallInsert a key-value pair into a !q, using the supplied function to combine the new value with any old value underneath the same key, if presentBinsertWith (+) "C" 1 (fromList [("B",2),("A",3)]) -- No collision"fromList [("C",1),("B",2),("A",3)]?insertWith (+) "C" 1 (fromList [("C",2),("A",3)]) -- CollisionfromList [("C",3),("A",3)]+dhallDelete a key from a !+ if present, otherwise return the original !/delete "B" (fromList [("C",1),("B",2),("A",3)])fromList [("C",1),("A",3)]/delete "D" (fromList [("C",1),("B",2),("A",3)])"fromList [("C",1),("B",2),("A",3)],dhall0Keep all values that satisfy the given predicate0filter even (fromList [("C",3),("B",2),("A",1)])fromList [("B",2)]/filter odd (fromList [("C",3),("B",2),("A",1)])fromList [("C",3),("A",1)]-dhall Restrict a ! to only those keys found in a Data.Set.Set.CrestrictKeys (fromList [("A",1),("B",2)]) (Data.Set.fromList ["A"])fromList [("A",1)].dhallTransform all values in a !K using the supplied function, deleting the key if the function returns ImapMaybe Data.Maybe.listToMaybe (fromList [("C",[1]),("B",[]),("A",[3])])fromList [("C",1),("A",3)]/dhallRetrieve a key from a ! Flookup k mempty = empty lookup k (x <> y) = lookup k y <|> lookup k x'lookup "A" (fromList [("B",1),("A",2)])Just 2'lookup "C" (fromList [("B",1),("A",2)])Nothing0dhall%Retrieve the first key, value of the !5, if present, and also returning the rest of the !. >uncons mempty = empty uncons (singleton k v) = (k, v, mempty)+uncons (fromList [("C",1),("B",2),("A",3)])'Just ("C",1,fromList [("B",2),("A",3)])uncons (fromList [])Nothing1dhallCheck if a key belongs to a ! Emember k mempty = False member k (x <> y) = member k x || member k y'member "A" (fromList [("B",1),("A",2)])True'member "C" (fromList [("B",1),("A",2)])False2dhallsize (fromList [("A",1)])13dhall Combine two !"s, preferring keys from the first ! union = unionWith (\v _ -> v)?union (fromList [("D",1),("C",2)]) (fromList [("B",3),("A",4)])*fromList [("D",1),("C",2),("B",3),("A",4)]?union (fromList [("D",1),("C",2)]) (fromList [("C",3),("A",4)])"fromList [("D",1),("C",2),("A",4)]4dhall Combine two !/s using a combining function for colliding keysGunionWith (+) (fromList [("D",1),("C",2)]) (fromList [("B",3),("A",4)])*fromList [("D",1),("C",2),("B",3),("A",4)]GunionWith (+) (fromList [("D",1),("C",2)]) (fromList [("C",3),("A",4)])"fromList [("D",1),("C",5),("A",4)]5dhallA generalised 4.^outerJoin Left Left (\k a b -> Right (k, a, b)) (fromList [("A",1),("B",2)]) (singleton "A" 3)-fromList [("A",Right ("A",1,3)),("B",Left 2)]&This function is much inspired by the Data.Semialign.Semialign class.6dhall Combine two !< on their shared keys, keeping the value from the first ! +intersection = intersectionWith (\v _ -> v)Fintersection (fromList [("C",1),("B",2)]) (fromList [("B",3),("A",4)])fromList [("B",2)]7dhall Combine two !ds on their shared keys, using the supplied function to combine values from the first and second !NintersectionWith (+) (fromList [("C",1),("B",2)]) (fromList [("B",3),("A",4)])fromList [("B",5)]8dhallCompute the difference of two !.s by subtracting all keys from the second ! from the first !Ddifference (fromList [("C",1),("B",2)]) (fromList [("B",3),("A",4)])fromList [("C",1)]9dhall%Fold all of the key-value pairs in a !, in their original order3foldMapWithKey (,) (fromList [("B",[1]),("A",[2])]) ("BA",[1,2]):dhallTransform the values of a ! using their corresponding key TmapWithKey (pure id) = id mapWithKey (liftA2 (.) f g) = mapWithKey f . mapWithKey g VmapWithKey f mempty = mempty mapWithKey f (x <> y) = mapWithKey f x <> mapWithKey f y+mapWithKey (,) (fromList [("B",1),("A",2)])&fromList [("B",("B",1)),("A",("A",2))];dhall)Traverse all of the key-value pairs in a !, in their original order0traverseWithKey (,) (fromList [("B",1),("A",2)])!("BA",fromList [("B",1),("A",2)])<dhallSame as ;[, except that the order of effects is not necessarily the same as the order of the keys=dhall)Traverse all of the key-value pairs in a !`, not preserving their original order, where the result of the computation can be forgotten.Note that this is a strict traversal, fully traversing the map even when the Applicative is lazy in the remaining elements.>dhall Convert a !; to a list of key-value pairs in the original order of keys#toList (fromList [("B",1),("A",2)])[("B",1),("A",2)]?dhall Convert a  Dhall.Map.! to a Data.Map.CtoMap (fromList [("B",1),("A",2)]) -- Order is lost upon conversionfromList [("A",2),("B",1)]@dhallReturn the keys from a ! in their original order!keys (fromList [("B",1),("A",2)]) ["B","A"]AdhallReturn the values from a ! in their original order."elems (fromList [("B",1),("A",2)])[1,2]Bdhall Return the Data.Set.Set of the keys$keysSet (fromList [("B",1),("A",2)])fromList ["A","B"]Fdhall'\x -> x <> mempty == (x :: Map Int Int)'\x -> mempty <> x == (x :: Map Int Int)Gdhall9\x y z -> x <> (y <> z) == (x <> y) <> (z :: Map Int Int)Kdhall7fromList [("A",1),("B",2)] < fromList [("B",1),("A",0)]True"!"#$%&'()*+,-./0123456789:;<=>?@AB"!"#$%&'()*+,-./102345678:;<=9>?@BASafeTdhall Identical to  Control.Lens.Udhall Identical to  Control.Lens.Vdhall Identical to  Control.Lens.Wdhall Identical to  Control.Lens. Xdhall Identical to  Control.Lens.!TUVWXTUVWX None279fdhallReturns, in order, all elements of the first Set not present in the second. (It doesn't matter in what order the elements appear in the second Set.)gdhall:Sort the set elements, forgetting their original ordering.)sort (fromList [2, 1]) == fromList [1, 2]TruehdhallisSorted (fromList [2, 1])FalseisSorted (fromList [1, 2])Trueidhallnull (fromList [1])Falsenull (fromList [])True ]^_`abcdefghi ]^a_`bcdefghi None279sdhallSource code extractstuvwstuvwNone"#1245679DSX_qdhall!Reference to an external resourcedhallSyntax tree for expressionsThe s< type parameter is used to track the presence or absence of s spans:If s = s then the code may contains s spans (either in a Noted> constructor or inline within another constructor, like )If s =  then the code has no s spansThe aC type parameter is used to track the presence or absence of importsIf a = & then the code may contain unresolved sIf a =  then the code has no sdhallLabel for a bound variableThe % field is the variable's name (i.e. "x").The ! field disambiguates variables with the same name if there are multiple bound variables of the same name in scope. Zero refers to the nearest bound variable and the index increases by one for each bound variable of the same name going outward. The following diagram may help: p % %%refers to%%% % % v % (x : Type) ! (y : Type) ! (x : Type) ! x@0 % %%%%%%%%%%%%%%%%%refers to%%%%%%%%%%%%%%%%%% % % v % (x : Type) ! (y : Type) ! (x : Type) ! x@1This _ behaves like a De Bruijn index in the special case where all variables have the same name.+You can optionally omit the index if it is 0:  % %refers to%% % % v % (x : Type) ! (y : Type) ! (x : Type) ! x.Zero indices are omitted when pretty-printing 6s and non-zero indices appear as a numeric suffix.dhall Constants for a pure type systemThe axioms are: " Type : Kind " Kind : Sort!... and the valid rule pairs are: " Type ! Type : Type -- Functions from terms to terms (ordinary functions) " Kind ! Type : Type -- Functions from types to terms (type-polymorphic functions) " Sort ! Type : Type -- Functions from kinds to terms " Kind ! Kind : Kind -- Functions from types to types (type-level functions) " Sort ! Kind : Sort -- Functions from kinds to types (kind-polymorphic functions) " Sort ! Sort : Sort -- Functions from kinds to kinds (kind-level functions)zNote that Dhall does not support functions from terms to types and therefore Dhall is not a dependently typed languagedhall Remove all  constructors from an  (i.e. de-)dhallRecord the binding part of a let expression.LFor example, > let x : Bool = True in x will be instantiated as follows: bindingSrc0 corresponds to the A comment.variable is "x" bindingSrc1 corresponds to the B comment. annotation is  a pair, corresponding to the C comment and Bool. bindingSrc2 corresponds to the D comment.value corresponds to True.dhall A reified U, which can be stored in structures without running into impredicative polymorphism.dhall-Use this to wrap you embedded functions (see 0) to make them polymorphic enough to be used.dhallThe body of an interpolated Text literaldhall -Const c ~ cdhall ]Var (V x 0) ~ x Var (V x n) ~ x@ndhall 9Lam x A b ~ (x : A) -> bdhall sPi "_" A B ~ A -> B Pi x A B ~ "(x : A) -> Bdhall /App f a ~ f adhall }Let (Binding _ x _ Nothing _ r) e ~ let x = r in e Let (Binding _ x _ (Just t ) _ r) e ~ let x : t = r in eThe difference between let x = a let y = b in eand let x = a in let y = b in eis only an additional  around  "y" & in the second example.See O for a representation of let-blocks that mirrors the source code more closely.dhall 1Annot x t ~ x : tdhall 0Bool ~ Booldhall -BoolLit b ~ bdhall 2BoolAnd x y ~ x && ydhall 2BoolOr x y ~ x || ydhall 2BoolEQ x y ~ x == ydhall 2BoolNE x y ~ x != ydhall >BoolIf x y z ~ if x then y else zdhall 3Natural ~ Naturaldhall -NaturalLit n ~ ndhall 8NaturalFold ~ Natural/folddhall 9NaturalBuild ~ Natural/builddhall :NaturalIsZero ~ Natural/isZerodhall 8NaturalEven ~ Natural/evendhall 7NaturalOdd ~ Natural/odddhall =NaturalToInteger ~ Natural/toIntegerdhall 8NaturalShow ~ Natural/showdhall <NaturalSubtract ~ Natural/subtractdhall 1NaturalPlus x y ~ x + ydhall 1NaturalTimes x y ~ x * ydhall 3Integer ~ Integerdhall .IntegerLit n ~ ndhall 8IntegerShow ~ Integer/showdhall <IntegerToDouble ~ Integer/toDoubledhall 2Double ~ Doubledhall -DoubleLit n ~ ndhall 7DoubleShow ~ Double/showdhall 0Text ~ Textdhall >TextLit (Chunks [(t1, e1), (t2, e2)] t3) ~ "t1${e1}t2${e2}t3"dhall 2TextAppend x y ~ x ++ ydhall 5TextShow ~ Text/showdhall 0List ~ Listdhall oListLit (Just t ) [x, y, z] ~ [x, y, z] : t ListLit Nothing [x, y, z] ~ [x, y, z]dhall 1ListAppend x y ~ x # ydhall 6ListBuild ~ List/builddhall 5ListFold ~ List/folddhall 7ListLength ~ List/lengthdhall 5ListHead ~ List/headdhall 5ListLast ~ List/lastdhall 8ListIndexed ~ List/indexeddhall 8ListReverse ~ List/reversedhall 4Optional ~ Optionaldhall 2Some e ~ Some edhall 0None ~ Nonedhall 9OptionalFold ~ Optional/folddhall :OptionalBuild ~ Optional/builddhall @Record [(k1, t1), (k2, t2)] ~ { k1 : t1, k2 : t1 }dhall @RecordLit [(k1, v1), (k2, v2)] ~ { k1 = v1, k2 = v2 }dhall ?Union [(k1, Just t1), (k2, Nothing)] ~ < k1 : t1 | k2 >dhall 1Combine x y ~ x "' ydhall 1CombineTypes x y ~ x *S ydhall 1Prefer x y ~ x * ydhall oMerge x y (Just t ) ~ merge x y : t Merge x y Nothing ~ merge x ydhall kToMap x (Just t) ~ toMap x : t ToMap x Nothing ~ toMap xdhall /Field e x ~ e.xdhall 4Project e (Left xs) ~ e.{ xs }5| > Project e (Right t) ~ e.(t)dhall 6Assert e ~ assert : edhall 1Equivalent x y ~ x "a ydhall -Note s x ~ edhall 3ImportAlt ~ e1 ? e2dhall 2Embed import ~ importdhallA = extended with an optional hash for semantic integrity checksdhallGHow to interpret the import's contents (i.e. as Dhall code or raw text)dhall:The type of import (i.e. local vs. remote vs. environment)dhall Local pathdhall?URL of remote resource and optional headers stored in an importdhallEnvironment variabledhallEThe beginning of a file path which anchors subsequent path componentsdhall Absolute pathdhallPath relative to .dhallPath relative to ..dhallPath relative to ~dhallA  is a @ followed by one additional path component representing the  namedhall[Internal representation of a directory that stores the path components in reverse orderIn other words, the directory  /foo/bar/baz is encoded as 2Directory { components = [ "baz", "bar", "foo" ] }dhallk is used by both normalization and type-checking to avoid variable capture by shifting variable indicesIFor example, suppose that you were to normalize the following expression: 4(a : Type) ! (x : a) ! ((y : a) ! (x : a) ! y) xIf you were to substitute y with x^ without shifting any variable indices, then you would get the following incorrect result: C(a : Type) ! (x : a) ! (x : a) ! x -- Incorrect normalized formIn order to substitute x in place of y we need to  x by 13 in order to avoid being misinterpreted as the x8 bound by the innermost lambda. If we perform that  then we get the correct result: '(a : Type) ! (x : a) ! (x : a) ! x@1ZAs a more worked example, suppose that you were to normalize the following expression: [ (a : Type) ! (f : a ! a ! a) ! (x : a) ! (x : a) ! ((x : a) ! f x x@1) x@1'The correct normalized result would be: J (a : Type) ! (f : a ! a ! a) ! (x : a) ! (x : a) ! f x@1 xuThe above example illustrates how we need to both increase and decrease variable indices as part of substitution:+We need to increase the index of the outer x@1 to x@2 before we substitute it into the body of the innermost lambda expression in order to avoid variable capture. This substitution changes the body of the lambda expression to  (f x@2 x@1)UWe then remove the innermost lambda and therefore decrease the indices of both xs in  (f x@2 x@1) to  (f x@1 x)) in order to reflect that one less x( variable is now bound within that scope Formally, (shift d (V x n) e) modifies the expression e by adding d+ to the indices of all variables named x$ whose indices are greater than (n + m), where mH is the number of bound variables of the same name within that scope In practice, d is always 1 or -1 because we either:increment variables by 1. to avoid variable capture during substitutiondecrement variables by 1) when deleting lambdas after substitutionn starts off at 0 when substitution begins and increments every time we descend into a lambda or let expression that binds a variable of the same name in order to avoid shifting the bound variables by mistake.dhall;Substitute all occurrences of a variable with an expression subst x C B ~ B[x := C]dhall6This function is used to determine whether folds like  Natural/fold or  List/foldW should be lazy or strict in their accumulator based on the type of the accumulatorIf this function returns , then they will be strict in their accumulator since we can guarantee an upper bound on the amount of work to normalize the accumulator on each step of the loop. If this function returns k then they will be lazy in their accumulator and only normalize the final result at the end of the folddhallThe "opposite" of , like  first absurd but fasterdhallkReduce an expression to its normal form, performing beta reduction and applying any custom definitions.& is designed to be used with function typeWith. The typeWithV function allows typing of Dhall functions in a custom typing context whereas 9 allows evaluating Dhall expressions in a custom context.To be more precise i applies the given normalizer when it finds an application term that it cannot reduce by other means.Note that the context used in normalization will determine the properties of normalization. That is, if the functions in custom context are not total then the Dhall language, evaluated with those functions is not total either. can fail with an - if you normalize an ill-typed expressiondhallThis function generalizes ; by allowing the custom normalizer to use an arbitrary  can fail with an - if you normalize an ill-typed expressiondhallTCheck if an expression is in a normal form given a context of evaluation. Unlike @, this will fully normalize and traverse through the expression.!It is much more efficient to use . can fail with an ' if you check an ill-typed expressiondhall0Quickly check if an expression is in normal formGiven a well-typed expression e,  e is equivalent to e ==  normalize e.Given an ill-typed expression, > may fail with an error, or evaluate to either False or True!dhall@Detect if the given variable is free within the given expression"x" `freeIn` "x"True"x" `freeIn` "y"False%"x" `freeIn` Lam "x" (Const Type) "x"FalsedhallUtility function used to throw internal errors that should never happen (in theory) but that are not enforced by the type system dhall6The set of reserved identifiers for the Dhall language dhall@A traversal over the immediate sub-expressions of an expression. dhallUtility used to implement the --censor flag, by:Replacing all s text with spacesReplacing all ( literals inside type errors with spaces dhallUtility used to censor ) by replacing all characters with a space dhall2A traversal over the immediate sub-expressions in .dhallReturns  if the given / is valid within an unquoted path component&This is exported for reuse within the Dhall.Parser.Token moduledhall#Convenience utility for converting -based exceptions to -based exceptionsdhall Generate a  from the contents of a .In the resulting  bs e, e is guaranteed not to be a , but it might be a ( & ( &)).Given parser output,  consolidates let5s that formed a let-block in the original source.dhall Wrap let- s around an .% can be understood as an inverse for : @let MultiLet bs e1 = multiLet b e0 wrapInLets bs e1 == Let b e0dhallTraverse over the immediate  children in a .dhall Construct a 3 with no source information and no type annotation.dhall-Generates a syntactically valid Dhall programdhallNote that this  instance inherits 's defects, e.g. nan = 0/0DoubleLit nan <= DoubleLit nanFalsedhallNote that this  instance inherits 's defects, e.g. nan = 0/0DoubleLit nan == DoubleLit nanFalse Z[      [   Z  "None"#8#None"#0YdhallfAnnotation type used to tag elements in a pretty-printed document for syntax highlighting purposesZdhall Escape a % literal using Dhall's escaping rules8Note that the result does not include surrounding quotes[dhallPretty-print a value\dhallPretty print an expressiondhallUsed for syntactic keywordsdhall:Syntax punctuation such as commas, parenthesis, and bracesdhall Record labelsdhall%Literals such as integers and stringsdhallBuiltin types and valuesdhall OperatorsdhallUConvert annotations to their corresponding color for syntax highlighting purposesdhallZInternal utility for pretty-printing, used when generating element lists to supply to  or  z. This utility indicates that the compact represent is the same as the multi-line representation for each element dhallUsed to render inline s# spans preserved by the syntax treeflet unusedSourcePos = Text.Megaparsec.SourcePos "" (Text.Megaparsec.mkPos 1) (Text.Megaparsec.mkPos 1)Plet nonEmptySrc = Src unusedSourcePos unusedSourcePos "-- Documentation for x\n"9"let" <> renderSrc (Just nonEmptySrc) " " <> "x = 1 in x"let -- Documentation for x x = 1 in x;let emptySrc = Src unusedSourcePos unusedSourcePos " "6"let" <> renderSrc (Just emptySrc) " " <> "x = 1 in x"let x = 1 in x."let" <> renderSrc Nothing " " <> "x = 1 in x"let x = 1 in x dhallPretty-print a list dhall%Pretty-print union types and literals dhall&Pretty-print record types and literalsdhall3Pretty-print anonymous functions and function typesdhallcFormat an expression that holds a variable number of elements, such as a list, record, or union dhallmFormat an expression that holds a variable number of elements without a trailing document such as nested `let`, nested lambdas, or nested sdhallPretty-print an  using the given . largely ignores s. 1s do however matter for the layout of let-blocks:klet inner = Let (Binding Nothing "x" Nothing Nothing Nothing (NaturalLit 1)) (Var (V "x" 0)) :: Expr Src ()aprettyCharacterSet ASCII (Let (Binding Nothing "y" Nothing Nothing Nothing (NaturalLit 2)) inner)let y = 2 let x = 1 in xprettyCharacterSet ASCII (Let (Binding Nothing "y" Nothing Nothing Nothing (NaturalLit 2)) (Note (Src unusedSourcePos unusedSourcePos "") inner))let y = 2 in let x = 1 in x;This means the structure of parsed let-blocks is preserved.dhall Escape a ; literal using Dhall's escaping rules for single-quoted Text dhall"Source span to render (if present)dhallUsed as the prefix (when the source span contains a comment) and as a fallback (when the source span is absent or comment-free)dhall-Beginning document for compact representationdhall0Beginning document for multi-line representationdhall$Separator for compact representationdhall'Separator for multi-line representationdhall*Ending document for compact representationdhall-Ending document for multi-line representationdhall-Elements to format, each of which is a pair: (compact, multi-line) dhall-Beginning document for compact representationdhall0Beginning document for multi-line representationdhall$Separator for compact representationdhall'Separator for multi-line representationdhall-Elements to format, each of which is a pair: (compact, multi-line)1YZ[\ !"#$%&'()*+,-./01NonedhallDefault layout optionsY\Y\$None9@AdhallA ! that is almost identical to Text.Megaparsec.29 except treating Haskell-style comments as whitespace3dhallDoesn't force the  part3456789:;<= None"#hffNone "#$XFdhall Similar to % except that this doesn't bother to render interpolated expressions to avoid a `Buildable a` constraint. The interpolated contents are not necessary for computing how much to dedent a multi-line stringjThis also doesn't include the surrounding quotes since they would interfere with the whitespace detection           None"#dhallA parsing errordhall'Parser for a top-level Dhall expressiondhallParser for a top-level Dhall expression. The expression is parameterized over any parseable type, allowing the language to be extended as needed. dhallAReplace the source code with spaces when rendering error messages&This utility is used to implement the --censor flag!dhallParse an expression from  containing a Dhall program"dhallLike !u but also returns the leading comments and whitespace (i.e. header) up to the last newline before the code begins5In other words, if you have a Dhall file of the form: -- Comment 1 2Then this will preserve  Comment 1 , but not  Comment 2This is used by  dhall-format, to preserve leading comments and whitespace!dhallUUser-friendly name describing the input expression, used in parsing error messagesdhallInput expression to parse"dhallUUser-friendly name describing the input expression, used in parsing error messagesdhallInput expression to parsestuvw !"!" stuvwNone%dhall(Automatically improve a Dhall expressionCurrently this:removes unused let bindings with &.consolidates nested let bindings to use a multiple-let binding with >%&%&None"#=>? N )dhall&Types that can be decoded from a CBOR ?+dhall$Types that can be encoded as a CBOR ?-dhallSupported version strings.dhallNo version string/dhallVersion "5.0.0"0dhallVersion "4.0.0"1dhallVersion "3.0.0"2dhallVersion "2.0.0"3dhallVersion "1.0.0"@dhallcConvert a function applied to multiple arguments to the base function and the list of arguments5dhall$Encode a Dhall expression as a CBOR ?This ts the expression before encoding it. To encode an already denoted expression, it is more efficient to directly use ,.6dhall&Decode a Dhall expression from a CBOR ?'()*+,-./0123456-./01234+,)*56'(&None %PSX_g/ dhall=-normalize an expression by renaming all bound variables to "_"4 and using De Bruijn indices to distinguish them\alphaNormalize (Lam "a" (Const Type) (Lam "b" (Const Type) (Lam "x" "a" (Lam "y" "b" "x"))))oLam "_" (Const Type) (Lam "_" (Const Type) (Lam "_" (Var (V "_" 1)) (Lam "_" (Var (V "_" 1)) (Var (V "_" 1)))))/-normalization does not affect free variables:alphaNormalize "x" Var (V "x" 0)dhallBReduce an expression to its normal form, performing beta reduction does not type-check the expression. You may want to type-check expressions before normalizing them since normalization can convert an ill-typed expression into a well-typed expression. can also fail with - if you normalize an ill-typed expression dhallReturns > if two expressions are -equivalent and -equivalent and  otherwise  can fail with an ) if you compare ill-typed expressionsAdhallSome information is lost when B converts a % or a built-in function from the  type to a C of the D type and EB needs that information in order to reconstruct an equivalent . This AO type holds that extra information necessary to perform that reconstructionFdhallDon't store any informationGdhall>Store the original name and type of the variable bound by the HdhallThe original function was a  Natural/foldA. We need to preserve this information in order to implement Natural/{build,fold} fusionIdhallThe original function was a  List/foldA. We need to preserve this information in order to implement List/{build,fold} fusionJdhallThe original function was an  Optional/foldA. We need to preserve this information in order to implement Optional/{build,fold} fusionKdhallThe original function was a Natural/subtract 07. We need to preserve this information in case the Natural/subtract` ends up not being fully saturated, in which case we need to recover the unsaturated built-inEdhall$Quote a value into beta-normal form.LdhallNormalize an expression in an environment of values. Any variable pointing out of the environment is treated as opaque free variable.W MNODCPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~BE5None"#3eFdhall@Render the difference between the normal form of two expressionsGdhall-Render the difference between two expressionsBCDEFGBCDEFG None<rdhall>Utility function to cut out the interior of a large text blockKdhall Path to inputNdhallSet to N< if you want to censor error text that might include secretsQdhallLike r , but for sNote that this has to be opinionated and render ANSI color codes, but that should be fine because we don't use this in a non-interactive contextRdhall/Function to insert an aligned pretty expressionSdhallPrefix used for error messagesTdhall/Convenient utility for retrieving an expressionUdhallEConvenient utility for retrieving an expression along with its header rKMLNPOQRSTU rQRSNPOKMLTUNone"#2SX^? VdhalloNewtype used to wrap error messages so that they render with a more detailed explanation of what went wrongXdhallGWrap a type error in this exception type to censor source code and  literals from the error message[dhall-A structured type error that includes contextdhall6Default succinct 1-line explanation of what went wrongdhall1Longer and more detailed explanation of the error`dhallThe specific type errordhall+Function that converts the value inside an & constructor into a new expressiondhallzType-check an expression and return the expression's type if type-checking succeeds or an error if type-checking fails does not necessarily normalize the type since full normalization is not necessary for just type-checking. If you actually care about the returned type then you may want to  it afterwards. The supplied h records the types of the names in scope. If these are ill-typed, the return value may be ill-typed.dhallGeneralization of  that allows type-checking the " constructor with custom logicdhall' is implemented internally in terms of / in order to speed up equivalence checking.Specifically, we extend the  to become a 0, which can store the entire contents of a `let`q expression (i.e. the type *and* the value of the bound variable). By storing this extra information in the % we no longer need to substitute `let`3 expressions at all (which is very expensive!).(However, this means that we need to use &'0 to perform equivalence checking instead of   since only judgmentallyEqualg is unable to use the information stored in the extended context for accurate equivalence checking.dhall is the same as  with an empty context, meaning that the expression must be closed (i.e. no free variables), otherwise type-checking will fail.dhall Traversal that traverses every  in a `dhallcThis function verifies that a custom context is well-formed so that type-checking will not loop Note that  already calls  for you on the  that you supplyLVWXZY[\]^_`gabcedfmonkihjslpqrtwuxyz{|}~vL[\]^_VWXZY`gabcedfmonkihjslpqrtwuxyz{|}~v(None"#y+ dhallWrapper around  HttpExceptions with a prettier  instance.8In order to keep the library API constant even when the  with-httpP Cabal flag is disabled the pretty error message is pre-rendered and the real  HttpExcepion is stored in a dhallfThis exception indicates that there was an internal error in Dhall's import-related logic the expected type then the extractB function must succeed. If not, then this exception is thrown)This exception indicates that an invalid Type was provided to the input functiondhall,State threaded throughout the import processdhall Stack of @s that we've imported along the way to get to the current pointdhallYGraph of all the imports visited so far, represented by a list of import dependencies.dhallCache of imported expressions with their node id in order to avoid importing the same expression twice with different valuesdhall:The remote resolver, fetches the content at the given URL.dhall imports (i.e. depends on) dhall7The fully resolved import, typechecked and beta-normal.dhallA fully chainedL import, i.e. if it contains a relative path that path is relative to the current directory. If it is a remote import with headers those are well-typed (either of type `List { header : Text, value Text}` or `List { mapKey : Text, mapValue Text})` and in normal form. These invariants are preserved by the API exposed by  Dhall.Import.dhallInitial W, parameterised over the remote resolver, importing relative to the given directory.!)None"#z None "#$29SXdhall A call to - failed because there was at least one importdhall.Exception thrown when an integrity check failsdhall *canonicalize . canonicalize = canonicalize Gcanonicalize (a <> b) = canonicalize (canonicalize a <> canonicalize b)dhallNException thrown when a HTTP url is imported but dhall was built without the  with-http Cabal flag.dhallCList of Exceptions we encounter while resolving Import Alternativesdhall8Exception thrown when an environment variable is missingdhall1Exception thrown when an imported file is missingdhall6Extend another exception with the current import stackdhall)Imports resolved so far, in reverse orderdhallThe nested exceptiondhallDhall tries to ensure that all expressions hosted on network endpoints are weakly referentially transparent, meaning roughly that any two clients will compile the exact same result given the same URL.To be precise, a strong interpretaton of referential transparency means that if you compiled a URL you could replace the expression hosted at that URL with the compiled result. Let's call this "static linking". Dhall (very intentionally) does not satisfy this stronger interpretation of referential transparency since "statically linking" an expression (i.e. permanently resolving all imports) means that the expression will no longer update if its dependencies change.`In general, either interpretation of referential transparency is not enforceable in a networked context since one can easily violate referential transparency with a custom DNS, but Dhall can still try to guard against common unintentional violations. To do this, Dhall enforces that a non-local import may not reference a local import.Local imports are defined as:A fileA URL with a host of  localhost or  127.0.0.1-All other imports are defined to be non-localdhallThe offending opaque importdhall7An import failed because of a cycle in the import graphdhallThe offending cyclic importdhallConstruct the file path corresponding to a local import. If the import is _relative_ then the resulting path is also relative.dhallGiven a - import construct the corresponding unhashed M import (interpreting relative path as relative to the current directory).dhall*Adjust the import mode of a chained importdhallZLoad an import, resulting in a fully resolved, type-checked and normalised expression.  loadImport handles the hot cache in Status and defers to  for imports that aren't in the Status cache already.dhall7Load an import from the 'semantic cache'. Defers to t for imports that aren't frozen (and therefore not cached semantically), as well as those that aren't cached yet.dhallwEnsure that the given expression is present in the semantic cache. The given expression should be alpha-beta-normal.dhallGiven a well-typed (of type `List { header : Text, value Text }` or `List { mapKey : Text, mapValue Text }`) headers expressions in normal form construct the corresponding binary http headers; otherwise return the empty list.dhallDefault starting ,, importing relative to the given directory.dhallGeneralized version of ;You can configure the desired behavior through the initial  that you supplydhall(Resolve all imports within an expressiondhallUResolve all imports within an expression, importing relative to the given directory.dhall Hash a fully resolved expressiondhalliConvenience utility to hash a fully resolved expression and return the base-16 encoded hash with the sha256: prefix{In other words, the output of this function can be pasted into Dhall source code to add an integrity check to an importdhall(Assert than an expression is import-freedhall3canonicalize (Directory {components = ["..",".."]})$Directory {components = ["..",".."]}dhall.( means to encode without the version tag@@NonedhallImplementation of the  dhall hash subcommandNone"# dhall5Specifies why we are adding semantic integrity checksdhallsProtect imports with an integrity check without a fallback so that import resolution fails if the import changesdhallProtect imports with an integrity check and also add a fallback import import without an integrity check. This is useful if you only want to cache imports when possible but still gracefully degrade to resolving them if the semantic integrity check has changed.dhall!Specifies which imports to freezedhall&Freeze only remote imports (i.e. URLs)dhall>Freeze all imports (including paths and environment variables) dhall Retrieve an 1 and update the hash to match the latest contents dhall)Freeze an import only if the import is a  import dhallImplementation of the  dhall freeze subcommand dhallCurrent working directory dhallCurrent working directory       None"#9v dhallThe  subcommand can either   its input or simply ( that the input is already formatteddhallArguments to the  subcommanddhallImplementation of the  dhall format subcommand      None"#,-1478=>?HMPSUVX`Fdhall allows you to build an %! injector for a Dhall record.8For example, let's take the following Haskell data type::{data Status = Queued Natural | Result Text | Errored Text:}WAnd assume that we have the following Dhall union that we would like to parse as a Status: R< Result : Text | Queued : Natural | Errored : Text >.Result "Finish successfully"Our injector has type % Status?, but we can't build that out of any smaller injectors, as %1s cannot be combined. However, we can use an  to build an % for Status::{ injectStatus :: InputType Status#injectStatus = adapt >$< inputUnion+ ( inputConstructorWith "Queued" inject+ >|< inputConstructorWith "Result" inject+ >|< inputConstructorWith "Errored" inject ) where adapt (Queued n) = Left n& adapt (Result t) = Right (Left t)' adapt (Errored e) = Right (Right e):}"Or, since we are simply using the #/ instance to inject each branch, we could write:{ injectStatus :: InputType Status#injectStatus = adapt >$< inputUnion ( inputConstructor "Queued" >|< inputConstructor "Result" >|< inputConstructor "Errored" ) where adapt (Queued n) = Left n& adapt (Result t) = Right (Left t)' adapt (Errored e) = Right (Right e):}dhallThe  monoid allows you to build a 7 parser from a Dhall union8For example, let's take the following Haskell data type::{data Status = Queued Natural | Result Text | Errored Text:}WAnd assume that we have the following Dhall union that we would like to parse as a Status: R< Result : Text | Queued : Natural | Errored : Text >.Result "Finish successfully"Our parser has type 7 Status=, but we can't build that out of any smaller parsers, as 7$s cannot be combined (they are only s). However, we can use a  to build a 7 for Status::{status :: Type Statusstatus = union2 ( ( Queued <$> constructor "Queued" natural )5 <> ( Result <$> constructor "Result" strictText )5 <> ( Errored <$> constructor "Errored" strictText ) ):}dhallThe + applicative functor allows you to build a 7 parser from a Dhall record.8For example, let's take the following Haskell data type::{data Project = Project { projectName :: Text , projectDescription :: Text , projectStars :: Natural }:}XAnd assume that we have the following Dhall record that we would like to parse as a Project: w{ name = "dhall-haskell" , description = "A configuration language guaranteed to terminate" , stars = 289 }Our parser has type 7 Project=, but we can't build that out of any smaller parsers, as 7$s cannot be combined (they are only s). However, we can use a  to build a 7 for Project::{project :: Type Project project = record) ( Project <$> field "name" strictText0 <*> field "description" strictText' <*> field "stars" natural ):}!dhall-This is the underlying class that powers the 5H class's support for automatically deriving a generic implementation#dhallThis class is used by 5 instance for functions: 6instance (Inject a, Interpret b) => Interpret (a -> b)You can convert Dhall functions with "simple" inputs (i.e. instances of this class) into Haskell functions. This works by:QMarshaling the input to the Haskell function into a Dhall expression (i.e. x :: Expr Src X)"Applying the Dhall function (i.e. f :: Expr Src X!) to the Dhall input (i.e. App f x)"Normalizing the syntax tree (i.e. normalize (App f x))CMarshaling the resulting Dhall expression back into a Haskell value%dhallAn  (InputType a)- represents a way to marshal a value of type 'a' from Haskell into Dhall'dhall,Embeds a Haskell value as a Dhall expression(dhallDhall type of the Haskell value)dhall-This is the underlying class that powers the 5H class's support for automatically deriving a generic implementation+dhallPThis type specifies how to model a Haskell constructor with 1 field in Dhall@For example, consider the following Haskell datatype definition: /data Example = Foo { x :: Double } | Bar DoubleJDepending on which option you pick, the corresponding Dhall type could be: 9< Foo : Double | Bar : Double > -- Bare << Foo : { x : Double } | Bar : { _1 : Double } > -- Wrapped :< Foo : { x : Double } | Bar : Double > -- Smart,dhall Never wrap the field in a record-dhall!Always wrap the field in a record.dhall)Only fields in a record if they are named/dhallMUse these options to tweak how Dhall derives a generic implementation of 51dhall\Function used to transform Haskell field names into their corresponding Dhall field names2dhallhFunction used to transform Haskell constructor names into their corresponding Dhall alternative names3dhallKSpecify how to handle constructors with only one field. The default is -B for backwards compatibility but will eventually be changed to .4dhallThis is only used by the 5z instance for functions in order to normalize the function input before marshaling the input into a Dhall expressiondhall!This type is exactly the same as  except with a different 5] instance. This intermediate type simplies the implementation of the inner loop for the 5 instance for 5dhallAny value that implements 5G can be automatically decoded based on the inferred return type of Q-input auto "[1, 2, 3]" :: IO (Vector Natural)[1,2,3]RThis class auto-generates a default implementation for records that implement C. This does not auto-generate an instance for recursive types.7dhallA (Type a)- represents a way to marshal a value of type 'a' from Dhall into HaskellYou can produce 7s either explicitly: 3example :: Type (Vector Text) example = vector text... or implicitly using g: ,example :: Type (Vector Text) example = autoYou can consume 7 s using the Q function: input :: Type a -> Text -> IO a9dhall0Extracts Haskell value from the Dhall expression:dhallDhall type of the Haskell value;dhall<dhall=dhall>dhallEvery 7I must obey the contract that if an expression's type matches the the : type then the 9S function must not fail with a type error. If not, then this value is returned.%This value indicates that an invalid 7 was provided to the Q functiondhallExtraction of a value can fail for two reasons, either a type mismatch (which should not happen, as expressions are type-checked against the expected type before being passed to extractC), or a term-level error, described with a freeform text value.IdhallSwitches from an  Applicative5 extraction result, able to accumulate errors, to a Monad7 extraction result, able to chain sequential operationsJdhallSwitches from a Monad< extraction result, able to chain sequential errors, to an  Applicative- extraction result, able to accumulate errorsKdhall5Default input settings: resolves imports relative to .@ (the current working directory), report errors as coming from (input)(, and default evaluation settings from N.Ldhall4Access the directory to resolve imports relative to.MdhallAccess the name of the source to report locations from; this is only used in error messages, so it's okay if this is a best guess or something symbolic.NdhallkDefault evaluation settings: no extra entries in the initial context, and no special normalizer behaviour.OdhallBAccess the starting context used for evaluation and type-checking.PdhallAccess the custom normalizer.QdhallIType-check and evaluate a Dhall program, decoding the result into Haskell@The first argument determines the type of value that you decode:input integer "+2"2"input (vector double) "[1.0, 2.0]" [1.0,2.0]Use gT to automatically select which type to decode based on the inferred return type:input auto "True" :: IO BoolTrueThis uses the settings from K.RdhallExtend Q with a root directory to resolve imports relative to, a file to mention in errors as the source, a custom typing context, and a custom normalization process.SdhallNType-check and evaluate a Dhall program that is read from the file-system.This uses the settings from N.TdhallExtend SE with a custom typing context and a custom normalization process.Udhall Similar to Q%, but without interpreting the Dhall  into a Haskell type.Uses the settings from K.VdhallExtend U with a root directory to resolve imports relative to, a file to mention in errors as the source, a custom typing context, and a custom normalization process.WdhallUse this function to extract Haskell values directly from Dhall AST. The intended use case is to allow easy extraction of Dhall values for making the function  easier to use.For other use cases, use Q from Dhall; module. It will give you a much better user experience.Xdhall0Use this to provide more detailed error messages {> input auto "True" :: IO Integer *** Exception: Error: Expression doesn't match annotation True : Integer (input):1:1  > detailed (input auto "True") :: IO Integer *** Exception: Error: Expression doesn't match annotation Explanation: You can annotate an expression with its type or kind using the 'p:'q symbol, like this: % %%%%%%%% % x : t % 'px'q is an expression and 'pt'q is the annotated type or kind of 'px'q %%%%%%%%% The type checker verifies that the expression's type or kind matches the provided annotation For example, all of the following are valid annotations that the type checker accepts: % %%%%%%%%%%%%%% % 1 : Natural % 'p1'q is an expression that has type 'pNatural'q, so the type %%%%%%%%%%%%%%% checker accepts the annotation % %%%%%%%%%%%%%%%%%%%%%%%% % Natural/even 2 : Bool % 'pNatural/even 2'q has type 'pBool'q, so the type %%%%%%%%%%%%%%%%%%%%%%%%% checker accepts the annotation % %%%%%%%%%%%%%%%%%%%%% % List : Type ! Type % 'pList'q is an expression that has kind 'pType ! Type'q, %%%%%%%%%%%%%%%%%%%%%% so the type checker accepts the annotation % %%%%%%%%%%%%%%%%%%% % List Text : Type % 'pList Text'q is an expression that has kind 'pType'q, so %%%%%%%%%%%%%%%%%%%% the type checker accepts the annotation However, the following annotations are not valid and the type checker will reject them: % %%%%%%%%%%% % 1 : Text % The type checker rejects this because 'p1'q does not have type %%%%%%%%%%%% 'pText'q % %%%%%%%%%%%%%% % List : Type % 'pList'q does not have kind 'pType'q %%%%%%%%%%%%%%% You or the interpreter annotated this expression: ! True ... with this type or kind: ! Integer ... but the inferred type or kind of the expression is actually: ! Bool Some common reasons why you might get this error: % The Haskell Dhall interpreter implicitly inserts a top-level annotation matching the expected type For example, if you run the following Haskell code: % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % >>> input auto "1" :: IO Text % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ... then the interpreter will actually type check the following annotated expression: % %%%%%%%%%%% % 1 : Text % %%%%%%%%%%%% ... and then type-checking will fail %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% True : Integer (input):1:1Ydhall Decode a input bool "True"TrueZdhall Decode a input natural "42"42[dhall Decode an input integer "+42"42\dhall Decode a input scientific "1e100"1.0e100]dhall Decode a input double "42.0"42.0^dhall Decode lazy input lazyText "\"Test\"""Test"_dhallDecode strict input strictText "\"Test\"""Test"`dhall Decode a input (maybe natural) "Some 1"Just 1adhall Decode a $input (sequence natural) "[1, 2, 3]"fromList [1,2,3]bdhall Decode a list input (list natural) "[1, 2, 3]"[1,2,3]cdhall Decode a "input (vector natural) "[1, 2, 3]"[1,2,3]ddhallDecode () from an empty record.=input unit "{=}" -- GHC doesn't print the result if it is ()edhall Decode a input string "\"ABC\"""ABC"fdhallGiven a pair of 7,s, decode a tuple-record into their pairing.3input (pair natural bool) "{ _1 = 42, _2 = False }" (42,False)gdhall=Use the default options for interpreting a configuration file 'auto = autoWith defaultInterpretOptionshdhallh# is the default implementation for g if you derive 5&. The difference is that you can use h- without having to explicitly provide an 55 instance for a type as long as the type derives idhallFDefault interpret options, which you can tweak or override, like this: \autoWith (defaultInterpretOptions { fieldModifier = Data.Text.Lazy.dropWhile (== '_') })jdhall-Use the default options for injecting a value 'inject = inject defaultInterpretOptionskdhallYUse the default options for injecting a value, whose structure is determined generically.&This can be used when you want to use #= on types that you don't want to define orphan instances for.ldhallRun a  parser to build a 7 parser.mdhall!Parse a single field of a record.ndhallRun a  parser to build a 7 parser.odhall%Parse a single constructor of a unionpdhallThe > divisible (contravariant) functor allows you to build an % injector for a Dhall record.8For example, let's take the following Haskell data type::{data Project = Project { projectName :: Text , projectDescription :: Text , projectStars :: Natural }:}XAnd assume that we have the following Dhall record that we would like to parse as a Project: w{ name = "dhall-haskell" , description = "A configuration language guaranteed to terminate" , stars = 289 }Our injector has type % Project?, but we can't build that out of any smaller injectors, as %$s cannot be combined (they are only s). However, we can use an InputRecordType to build an % for Project::{ "injectProject :: InputType ProjectinjectProject = inputRecord, ( adapt >$< inputFieldWith "name" inject3 >*< inputFieldWith "description" inject- >*< inputFieldWith "stars" inject ) whereK adapt (Project{..}) = (projectName, (projectDescription, projectStars)):}"Or, since we are simply using the #. instance to inject each field, we could write:{ "injectProject :: InputType ProjectinjectProject = inputRecord! ( adapt >$< inputField "name"( >*< inputField "description"" >*< inputField "stars" ) whereK adapt (Project{..}) = (projectName, (projectDescription, projectStars)):}Infix tdhall Combines two  values. See  for usage notes.Ideally, this matches *+; however, this allows  to not need a 2 instance itself (since no instance is possible).dhallKYou can use this instance to marshal recursive types from Dhall to Haskell.(Here is an example use of this instance: K{-# LANGUAGE DeriveAnyClass #-} {-# LANGUAGE DeriveFoldable #-} {-# LANGUAGE DeriveFunctor #-} {-# LANGUAGE DeriveTraversable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE KindSignatures #-} {-# LANGUAGE QuasiQuotes #-} {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TemplateHaskell #-} import Data.Fix (Fix(..)) import Data.Text (Text) import Dhall (Interpret) import GHC.Generics (Generic) import Numeric.Natural (Natural) import qualified Data.Fix as Fix import qualified Data.Functor.Foldable as Foldable import qualified Data.Functor.Foldable.TH as TH import qualified Dhall import qualified NeatInterpolation data Expr = Lit Natural | Add Expr Expr | Mul Expr Expr deriving (Show) TH.makeBaseFunctor ''Expr deriving instance Generic (ExprF a) deriving instance Interpret a => Interpret (ExprF a) example :: Text example = [NeatInterpolation.text| \(Expr : Type) -> let ExprF = < LitF : { _1 : Natural } | AddF : { _1 : Expr, _2 : Expr } | MulF : { _1 : Expr, _2 : Expr } > in \(Fix : ExprF -> Expr) -> let Lit = \(x : Natural) -> Fix (ExprF.LitF { _1 = x }) let Add = \(x : Expr) -> \(y : Expr) -> Fix (ExprF.AddF { _1 = x, _2 = y }) let Mul = \(x : Expr) -> \(y : Expr) -> Fix (ExprF.MulF { _1 = x, _2 = y }) in Add (Mul (Lit 3) (Lit 7)) (Add (Lit 1) (Lit 2)) |] convert :: Fix ExprF -> Expr convert = Fix.cata Foldable.embed main :: IO () main = do x <- Dhall.input Dhall.auto example :: IO (Fix ExprF) print (convert x :: Expr)Qdhall1The type of value to decode from Dhall to HaskelldhallThe Dhall programdhallThe decoded value in HaskellRdhall1The type of value to decode from Dhall to HaskelldhallThe Dhall programdhallThe decoded value in HaskellSdhall1The type of value to decode from Dhall to HaskelldhallThe path to the Dhall program.dhallThe decoded value in Haskell.Tdhall1The type of value to decode from Dhall to HaskelldhallThe path to the Dhall program.dhallThe decoded value in Haskell.UdhallThe Dhall programdhallThe fully normalized ASTVdhallThe Dhall programdhallThe fully normalized ASTWdhall1The type of value to decode from Dhall to HaskelldhallAa closed form Dhall program, which evaluates to the expected typedhallThe decoded value in Haskelle !"#$%&'()*+,-./0412356789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvweQRSTUVLMOPK=N<;X789: %&'(56>?@ABCDFEGHIJgh/04123+,-.iYZ[\]^_`abcdeflmno)*!"#$jkqrsvwutWpp5t5,NoneNonedhallkThis fully resolves, type checks, and normalizes the expression, so the resulting AST is self-contained.-SafeSafeANone"#$>6dhallImplementation of the  dhall repl subcommanddhall7Find the index for the current _active_ dhall save filedhall6Find the name for the current _active_ dhall save filedhall*Find the name for the next dhall save fileNone"#$9_)dhallThe subcommands for the dhall executabledhallTop-level program optionsdhall for the  typedhall for the  typedhall!Run the command specified by the  typedhallEntry point for the dhall executable((./0.12345.67.89:;<=>?@ABCDEFGHIJKLLMNOPQRSTU&V&W&XYZ[\]^_B`abcdDefghijklmnopqrEstuvwxyz{|}~ !####   E Z A m ^ _   JI25G      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~###########$$$$$                                                                                                       !"#$%&'(%)*+,-./ 0 0 1 2 3 4 5 6 7 8 9:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWWXYZ[\]^ _ `  a b a c B d e fgghihjjklmnopqrstuvwxyz{|}~(((((((((((((((((((((((((((     5  !"#$%&'())*+,-./012345567889:;<=>?@ABC2DEFGHIJKLMNOPQRSTUVWXYZ[\]^_h`abcdefghijklmnopqrstuvwxyz{|}~W55..:.8...."""#####T################## # # # # ################ $!$"$#$$$%$&$'$($)$*$s+,-./&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&{&|&}&~&&&&&&&&&&&'&&..(((((())))))))))J....6**--------"dhall-1.26.1-Fs3714EJk7m8v5347xUwBDhallDhall.TypeCheck Dhall.Context Dhall.Core Dhall.Crypto Dhall.Map Dhall.Optics Dhall.Pretty Dhall.Set Dhall.Util Dhall.Src Dhall.ParserDhall.Parser.TokenDhall.Parser.Expression Dhall.Lint Dhall.Binary Dhall.Diff Dhall.Import Dhall.Hash Dhall.Freeze Dhall.FormatDhall.TH Dhall.Version Dhall.Repl Dhall.MainData.MapMap Control.Lens rewriteOf transformOf rewriteMOf transformMOfmapMOf Dhall.URLDhall.Pretty.InternalDhall.Parser.Combinators renderChunks Dhall.EvalconvDhall.Import.TypesDhall.Import.HTTP$Data.Functor.Contravariant.DivisiblechosenDhall.Tutorial Paths_dhallbase GHC.GenericsGeneric GHC.NaturalNatural text-1.2.3.1Data.Text.InternalTextData.Functor.Contravariant>$< Data.Voidabsurdcontainers-0.6.0.1Data.Sequence.InternalSeq&vector-0.12.0.3-ChzWbiXyvuNAQj0dcU08Sg Data.VectorVectorContextemptyinsertmatchlookuptoList$fFunctorContextImportExprVarConstdenote SHA256DigestunSHA256Digestsha256DigestFromByteString sha256Hash$fShowSHA256Digest$fEqSHA256Digest$fGenericSHA256Digest$fOrdSHA256Digest$fNFDataSHA256Digest$fByteArrayAccessSHA256DigestalphaNormalize normalizejudgmentallyEqual singletonfromListfromListWithKeyunorderedSingletonunorderedFromListsortisSorted insertWithdeletefilter restrictKeysmapMaybeunconsmembersizeunion unionWith outerJoin intersectionintersectionWith differencefoldMapWithKey mapWithKeytraverseWithKeyunorderedTraverseWithKeyunorderedTraverseWithKey_toMapkeyselemskeysSet $fLiftKeys $fIsListMap $fShowMap $fMonoidMap$fSemigroupMap$fTraversableMap $fFoldableMap $fFunctorMap$fOrdMap$fEqMap $fLiftMap $fDataKeys $fGenericKeys $fNFDataKeys $fDataMap $fGenericMap $fNFDataMapAnn escapeTextpretty prettyExprSettoSettoSeqfromSetappendnull $fFoldableSet $fLiftSet$fOrdSet$fEqSet $fGenericSet $fShowSet $fDataSet $fNFDataSetsnipSrcsrcStartsrcEndsrcText $fPrettySrc $fLiftSrc $fDataSrc$fEqSrc $fGenericSrc$fOrdSrc $fShowSrc $fNFDataSrcBinding bindingSrc0variable bindingSrc1 annotation bindingSrc2valueMultiLetReifiedNormalizergetReifiedNormalizer Normalizer NormalizerMChunksLamPiAppLetAnnotBoolBoolLitBoolAndBoolOrBoolEQBoolNEBoolIf NaturalLit NaturalFold NaturalBuild NaturalIsZero NaturalEven NaturalOddNaturalToInteger NaturalShowNaturalSubtract NaturalPlus NaturalTimesInteger IntegerLit IntegerShowIntegerToDoubleDouble DoubleLit DoubleShowTextLit TextAppendTextShowListListLit ListAppend ListBuildListFold ListLengthListHeadListLast ListIndexed ListReverseOptionalSomeNone OptionalFold OptionalBuildRecord RecordLitUnionCombine CombineTypesPreferMergeToMapFieldProjectAssert EquivalentNote ImportAltEmbedV importHashed importMode ImportHashedhash importType ImportModeCodeRawTextLocation ImportTypeLocalRemoteEnvMissingURLscheme authoritypathqueryheadersSchemeHTTPHTTPS FilePrefixAbsoluteHereParentHomeFile directoryfile Directory componentsTypeKindSortshiftsubstrenote shallowDenote normalizeWithnormalizeWithMtextShowisNormalizedWith isNormalizedfreeIn internalErrorreservedIdentifierssubExpressionscensorExpression censorText chunkExprs pathCharacterthrowsmultiLet wrapInLets bindingExprs makeBinding $fPrettyConst $fLiftConst$fPrettyDirectory$fSemigroupDirectory$fSemigroupFile $fPrettyFile$fPrettyFilePrefix $fPrettyVar $fIsStringVar $fLiftVar$fBifunctorBinding $fPrettyExpr$fIsStringChunks$fMonoidChunks$fSemigroupChunks $fLiftChunks$fIsStringExpr$fBifunctorExpr $fMonadExpr$fApplicativeExpr $fFunctorExpr $fLiftExpr$fPrettyImport$fSemigroupImport$fPrettyImportHashed$fSemigroupImportHashed$fPrettyImportType$fSemigroupImportType $fPrettyURL $fShowConst $fEqConst $fOrdConst $fDataConst$fBoundedConst $fEnumConst$fGenericConst $fNFDataConst $fEqDirectory$fGenericDirectory$fOrdDirectory$fShowDirectory$fNFDataDirectory$fEqFile $fGenericFile $fOrdFile $fShowFile $fNFDataFile$fEqFilePrefix$fGenericFilePrefix$fOrdFilePrefix$fShowFilePrefix$fNFDataFilePrefix $fEqScheme$fGenericScheme $fOrdScheme $fShowScheme$fNFDataScheme$fEqImportMode$fGenericImportMode$fOrdImportMode$fShowImportMode$fNFDataImportMode $fDataVar $fGenericVar$fEqVar$fOrdVar $fShowVar $fNFDataVar $fDataBinding $fEqBinding$fFoldableBinding$fFunctorBinding$fGenericBinding$fNFDataBinding $fOrdBinding $fShowBinding$fTraversableBinding$fFoldableExpr $fGenericExpr$fTraversableExpr $fShowExpr $fDataExpr $fNFDataExpr$fFunctorChunks$fFoldableChunks$fGenericChunks$fTraversableChunks $fShowChunks $fEqChunks $fOrdChunks $fDataChunks$fNFDataChunks$fEqURL $fGenericURL$fOrdURL $fShowURL $fNFDataURL $fEqImport$fGenericImport $fOrdImport $fShowImport$fNFDataImport$fEqImportHashed$fGenericImportHashed$fOrdImportHashed$fShowImportHashed$fNFDataImportHashed$fEqImportType$fGenericImportType$fOrdImportType$fShowImportType$fNFDataImportType $fOrdExpr$fEqExpr CharacterSetASCIIUnicodeKeywordSyntaxLabelLiteralBuiltinOperatorannToAnsiStyleprettyCharacterSet layoutOptsParserunParserSourcedException ComponentType URLComponent FileComponentvalidCodepoint whitespacenonemptyWhitespacehexdig doubleLiteraldoubleInfinityintegerLiteralnaturalLiteral identifier hexNumberlabels labelOnlylabelanyLabelbashEnvironmentVariableposixEnvironmentVariablefile_httpRaw_if_then_else_letOnly_let_in_as_using_merge_toMap_assert_Some_None _NaturalFold _NaturalBuild_NaturalIsZero _NaturalEven _NaturalOdd_NaturalToInteger _NaturalShow_NaturalSubtract _IntegerShow_IntegerToDouble _DoubleShow _ListBuild _ListFold _ListLength _ListHead _ListLast _ListIndexed _ListReverse _OptionalFold_OptionalBuild_Bool _Optional_Natural_Integer_Double_Text _TextShow_List_True_False_NaN_Type_Kind_Sort _Location _equalOnly_equal_or_plus _textAppend _listAppend_and_times _doubleEqual _notEqual_dot _openBrace _closeBrace _openBracket _closeBracket _openAngle _closeAngle_bar_comma _openParens _closeParens _colonOnly_colon_at _equivalent_missing _importAlt_combine _combineTypes_prefer_lambda_forall_arrowParserscompleteExpression_importExpression_ getSourcePos getOffset setOffsetsrcnotedcompleteExpressionimportExpressionparsersenvlocalRawlocalhttpmissing importType_ importHash_ importHashed_import_splitOn linesLiteralunlinesLiteral emptyLine leadingSpaces dropLiteraltoDoubleQuoted ParseErrorunwrapinputexprexprAcensor exprFromTextexprAndHeaderFromText$fExceptionParseError$fShowParseErrorlintremoveUnusedBindingsDecodingFailureCBORIsNotDhallFromTermdecodeToTermencodeStandardVersion NoVersionV_5_0_0V_4_0_0V_3_0_0V_2_0_0V_1_0_0renderStandardVersionencodeExpressiondecodeExpression $fToTermVoid$fToTermImport $fToTermExpr$fFromTermVoid$fFromTermImport$fFromTermExpr$fShowDecodingFailure$fExceptionDecodingFailure$fEnumStandardVersion$fBoundedStandardVersion$fEqDecodingFailureDiffsamedocdiffNormalizeddiff$fIsStringDiff $fMonoidDiff$fSemigroupDiffInput StandardInputCensorNoCensorsnipDoc_ERROR getExpressiongetExpressionAndHeaderDetailedTypeErrorCensoredCensoredDetailed TypeErrorcontextcurrent typeMessage TypeMessageUnboundVariableInvalidInputTypeInvalidOutputType NotAFunction TypeMismatch AnnotMismatchUntypedMissingListTypeMismatchedListElementsInvalidListElementInvalidListType InvalidSomeInvalidPredicateIfBranchMismatchIfBranchMustBeTermInvalidFieldTypeInvalidAlternativeTypeAlternativeAnnotationMismatchListAppendMismatchMustCombineARecordCombineTypesRequiresRecordTypeRecordTypeMismatchFieldCollisionMustMergeARecordMustMergeUnionMustMapARecordInvalidToMapRecordKindHeterogenousRecordToMapInvalidToMapTypeMapTypeMismatchMissingToMapType UnusedHandlerMissingHandlerHandlerInputTypeMismatchHandlerOutputTypeMismatchInvalidHandlerOutputTypeMissingMergeTypeHandlerNotAFunction CantAccess CantProjectCantProjectByExpression MissingFieldMissingConstructorProjectionTypeMismatchAssertionFailedNotAnEquivalenceIncomparableExpressionEquivalenceTypeMismatchCantAndCantOrCantEQCantNECantInterpolateCantTextAppendCantListAppendCantAdd CantMultiplyTyperXtypeWith typeWithAtypeOfmessageExpressions checkContext$fPrettyTypeError$fExceptionTypeError$fShowTypeError$fPrettyDetailedTypeError$fExceptionDetailedTypeError$fShowDetailedTypeError$fPrettyCensored$fExceptionCensored$fShowCensored$fShowTypeMessagePrettyHttpExceptionStatus_stack_graph_cache_remote _normalizer_startingContext_semanticCacheModeSemanticCacheModeIgnoreSemanticCacheUseSemanticCacheDependsparentchildImportSemanticsChained chainedImportstackgraphcacheremote normalizerstartingContextImportResolutionDisabled HashMismatch expectedHash actualHashMissingImportsMissingEnvironmentVariablename MissingFileImported importStacknestedReferentiallyOpaque opaqueImportCycle cyclicImport localToPathchainedFromLocalHerechainedChangeMode chainImportwriteExpressionToSemanticCache toHeaderswarnAboutMissingCaches emptyStatusloadWithloadloadRelativeTohashExpressionhashExpressionToCodeassertNoImports $fShowCycle$fExceptionCycle$fShowReferentiallyOpaque$fExceptionReferentiallyOpaque$fShowImported$fExceptionImported$fShowMissingFile$fExceptionMissingFile $fShowMissingEnvironmentVariable%$fExceptionMissingEnvironmentVariable$fShowMissingImports$fExceptionMissingImports$fShowCannotImportHTTPURL$fExceptionCannotImportHTTPURL$fCanonicalizeImport$fCanonicalizeImportHashed$fCanonicalizeImportType$fCanonicalizeFile$fCanonicalizeDirectory$fShowHashMismatch$fExceptionHashMismatch$fShowImportResolutionDisabled#$fExceptionImportResolutionDisabledIntentSecureCacheScopeOnlyRemoteImports AllImports freezeImportfreezeRemoteImportfreeze FormatModeModifyCheckinplaceFormat characterSet formatModeformat$fShowNotFormatted$fExceptionNotFormattedUnionInputTypeRecordInputType UnionType RecordType GenericInjectgenericInjectWithInject injectWith InputTypeembeddeclaredGenericInterpretgenericAutoWithSingletonConstructorsBareWrappedSmartInterpretOptions fieldModifierconstructorModifiersingletonConstructorsinputNormalizer InterpretautoWithextractexpectedHasEvaluateSettingsEvaluateSettings InputSettings InvalidTypeinvalidTypeExpectedinvalidTypeExpression ExtractErrors getErrorsMonadicExtractor Extractor typeError extractError toMonadic fromMonadicdefaultInputSettings rootDirectory sourceNamedefaultEvaluateSettingsinputWithSettings inputFileinputFileWithSettings inputExprinputExprWithSettingsrawInputdetailedboolnaturalinteger scientificdoublelazyText strictTextmaybesequencelistvectorunitstringpairauto genericAutodefaultInterpretOptionsinject genericInjectrecordfield constructor>*<inputFieldWith inputField inputRecord>|< inputUnioninputConstructorWithinputConstructor$fShowInvalidType$fExceptionInvalidType$fExceptionExtractError$fShowExtractError$fExceptionExtractErrors$fShowExtractErrors%$fHasEvaluateSettingsEvaluateSettings"$fHasEvaluateSettingsInputSettings$fGenericInterpretk:*:$fGenericInterpretkU1$fGenericInterpretkM1$fGenericInterpretk:+:$fGenericInterpretk:+:0$fGenericInterpretk:+:1$fGenericInterpretk:+:2$fGenericInterpretkV1$fGenericInterpretkM10$fGenericInterpretkM11$fGenericInterpretk:*:0$fGenericInterpretk:*:1$fGenericInterpretk:*:2$fInterpretFix$fInterpretResult$fInterpret(,)$fInterpretVector $fInterpret[]$fInterpretSeq$fInterpretMaybe$fInterpretText$fInterpretText0$fInterpret[]0$fInterpretDouble$fInterpretScientific$fInterpretInteger$fInterpretNatural$fInterpretBool$fContravariantInputType$fGenericInjectkU1$fGenericInjectk:*:$fGenericInjectk:+:$fGenericInjectk:+:0$fGenericInjectk:+:1$fGenericInjectk:+:2$fGenericInjectkM1$fGenericInjectkM10$fGenericInjectk:*:0$fGenericInjectk:*:1$fGenericInjectk:*:2$fGenericInjectkM11 $fInject(,) $fInjectSet$fInjectVector $fInject[] $fInjectSeq $fInjectMaybe $fInject()$fInjectScientific$fInjectDouble$fInjectWord64$fInjectWord32$fInjectWord16 $fInjectWord8 $fInjectInt$fInjectInteger$fInjectNatural $fInject[]0 $fInjectText $fInjectText0 $fInjectBool $fInterpret->$fMonoidUnionType$fSemigroupUnionType$fDivisibleRecordInputType$fContravariantRecordInputType$fSemigroupExtractErrors $fFunctorType$fFunctorRecordType$fApplicativeRecordType$fFunctorUnionType$fContravariantUnionInputTypestaticDhallExpression dhallVersiondhallVersionStringreplModeDefaultVersionResolve NormalizeReplFreezeHashLintEncodeDecodeannotatealphasemanticCacheModeversion resolveModequietall_expr1expr2jsonOptionsmodeexplainplainascii parseOptionsparserInfoOptionscommandmainGHC.BasefmapnubOrd GHC.MaybeNothingData.Map.InternalVoidghc-prim GHC.TypesIntJust boundedTypeTrueFalseGHC.ErrerrorMonadChar Data.EitherEitherIO GHC.ClassesEqrenderComponent renderQuery renderURL duplicateencloseenclose' renderSrcanglesbracesarrowsforallescapeSingleQuotedText prettyConst prettyVar prettySrcExprkeywordliteralbuiltinoperatorcommalbracketrbracketlangleranglelbracerbracelparenrparenpipecolonequalsdotlambdararrow prettyLabelprettyAnyLabel prettyLabels prettyNumber prettyInt prettyNatural prettyDoubleprettyToStringdocToStrictTextprettyToStrictText'megaparsec-7.0.5-9jL5eSrnNXhFsdBflzRXU6Text.MegaparsecParseclaxSrcEqcountrangeoptionstarplussatisfy takeWhile takeWhile1 noDuplicatesremoveLetInLet$cborg-0.2.2.0-7XfLkHixUVtFyBgt4pVVc6Codec.CBOR.TermTermunApplyHLamInfoevalVHLamValquotePrimTyped NaturalFoldCl ListFoldClOptionalFoldClNaturalSubtractZeronfNamesBind EmptyNamesVPiVHPiVConstVVarVPrimVarVAppVLamVBoolVBoolLitVBoolAndVBoolOrVBoolEQVBoolNEVBoolIfVNatural VNaturalLit VNaturalFold VNaturalBuildVNaturalIsZero VNaturalEven VNaturalOddVNaturalToInteger VNaturalShowVNaturalSubtract VNaturalPlus VNaturalTimesVInteger VIntegerLit VIntegerShowVIntegerToDoubleVDouble VDoubleLit VDoubleShowVTextVTextLit VTextAppend VTextShowVListVListLit VListAppend VListBuild VListFold VListLength VListHead VListLast VListIndexed VListReverse VOptionalVSomeVNone VOptionalFoldVOptionalBuildVRecord VRecordLitVUnionVCombine VCombineTypesVPreferVMergeVToMapVFieldVInjectVProjectVAssert VEquivalentVEmbedClosure EnvironmentEmptyExtendSkiptoVHPi~>envNames countNames*prettyprinter-1.3.0-6qg3eRt5h66FauUzehlm4q"Data.Text.Prettyprint.Doc.InternalDocshortlonginferCtxGHC.ShowShow Data.DynamicDynamic InternalErrorimportSemanticsemptyStatusWith HTTPHeaderNotCORSCompliant actualOriginexpectedOriginsmkPrettyHttpExceptionrenderPrettyHttpException newManager corsCompliantfetchFromHttpUrl CanonicalizeCannotImportHTTPURL loadImportloadImportWithSemanticCacheloadImportWithSemisemanticCacheFunctorResult%data-fix-0.2.0-1uhrmMdZVS2IRXxxgCLu1bData.FixFix ExtractError)scientific-0.3.6.2-6bc2BhY5av25ENBHp3W8voData.Scientific ScientificMaybeString Contravariant*contravariant-1.5.2-1ZQM8SswnWXJmdlHRX0Vigdivided Divisible getBinDir getLibDir getDynLibDir getDataDir getLibexecDir getSysconfDirgetDataFileNamecurrentSaveFileIndexcurrentSaveFile nextSaveFile4optparse-applicative-0.15.1.0-9UvfO1o3i9s1TxVxKVEceUOptions.Applicative.Types ParserInfo