├── .gitattributes ├── .github ├── dependabot.yml └── workflows │ └── main.yml ├── .gitignore ├── .gitmodules ├── .hlint.yaml ├── .mergify.yml ├── .stylish-haskell.yaml ├── .travis.yml ├── CODE_OF_CONDUCT.md ├── LICENSE ├── README.md ├── appveyor.yml ├── cabal.project ├── default.nix ├── dhall-bash ├── LICENSE ├── README.md ├── Setup.hs ├── default.nix ├── dhall-bash.cabal ├── exec │ └── Main.hs ├── shell.nix └── src │ └── Dhall │ └── Bash.hs ├── dhall-csv ├── CHANGELOG.md ├── LICENSE ├── README.md ├── Setup.hs ├── csv-to-dhall │ └── Main.hs ├── default.nix ├── dhall-csv.cabal ├── dhall-to-csv │ └── Main.hs ├── shell.nix ├── src │ └── Dhall │ │ ├── Csv.hs │ │ ├── Csv │ │ └── Util.hs │ │ └── CsvToDhall.hs └── tasty │ ├── Main.hs │ └── data │ ├── .gitattributes │ ├── csv-to-dhall │ ├── basic_test.csv │ ├── basic_test.dhall │ ├── basic_test_schema.dhall │ ├── doubles_test.csv │ ├── doubles_test.dhall │ ├── doubles_test_schema.dhall │ ├── escaped_characters.csv │ ├── escaped_characters.dhall │ ├── escaped_characters_schema.dhall │ ├── integers_test.csv │ ├── integers_test.dhall │ ├── integers_test_schema.dhall │ ├── naturals_test.csv │ ├── naturals_test.dhall │ ├── naturals_test_schema.dhall │ ├── optionals_test.csv │ ├── optionals_test.dhall │ ├── optionals_test_schema.dhall │ ├── text_test.csv │ ├── text_test.dhall │ ├── text_test_schema.dhall │ ├── unions_test.csv │ ├── unions_test.dhall │ └── unions_test_schema.dhall │ ├── dhall-to-csv │ ├── basic_test.csv │ ├── basic_test.dhall │ ├── doubles_test.csv │ ├── doubles_test.dhall │ ├── escaped_characters.csv │ ├── escaped_characters.dhall │ ├── integers_test.csv │ ├── integers_test.dhall │ ├── naturals_test.csv │ ├── naturals_test.dhall │ ├── optionals_test.csv │ ├── optionals_test.dhall │ ├── text_test.csv │ ├── text_test.dhall │ ├── unions_test.csv │ └── unions_test.dhall │ └── no-header-csv-to-dhall │ ├── basic_test.csv │ ├── basic_test.dhall │ └── basic_test_schema.dhall ├── dhall-docs ├── CHANGELOG.md ├── LICENSE ├── README.md ├── Setup.hs ├── default.nix ├── dhall-docs.cabal ├── dhall-docs │ └── Main.hs ├── doctest │ └── Main.hs ├── shell.nix ├── src │ └── Dhall │ │ ├── Docs.hs │ │ ├── Docs │ │ ├── CodeRenderer.hs │ │ ├── Comment.hs │ │ ├── Core.hs │ │ ├── Embedded.hs │ │ ├── Html.hs │ │ ├── Markdown.hs │ │ ├── Store.hs │ │ └── Util.hs │ │ └── data │ │ ├── assets │ │ ├── dhall-icon.svg │ │ ├── index.css │ │ └── index.js │ │ └── man │ │ ├── dhall-docs.1 │ │ ├── dhall-docs.md │ │ └── gen-manpage.sh └── tasty │ ├── Main.hs │ └── data │ ├── comments │ ├── empty │ │ ├── Empty.txt │ │ ├── Mixed.txt │ │ ├── SeveralLines.txt │ │ ├── SingleBlock.txt │ │ └── SingleLine.txt │ ├── invalid │ │ ├── MissingNewLineBlock.txt │ │ ├── SingleLinesBadAligned.txt │ │ ├── TwoValidBlocks.txt │ │ ├── TwoValidMixed.txt │ │ └── TwoValidSingleLines.txt │ └── valid │ │ ├── BlockA.txt │ │ ├── BlockB.txt │ │ ├── BlockWithEmptyLinesIgnoredA.txt │ │ ├── BlockWithEmptyLinesIgnoredB.txt │ │ ├── BlockWithIndentationA.txt │ │ ├── BlockWithIndentationB.txt │ │ ├── BlockWithOtherCommentsA.txt │ │ ├── BlockWithOtherCommentsB.txt │ │ ├── BlockWithWhitespaceLinesA.txt │ │ ├── BlockWithWhitespaceLinesB.txt │ │ ├── SingleLInesWithIndentationA.txt │ │ ├── SingleLInesWithIndentationB.txt │ │ ├── SingleLineWithOtherCommentsA.txt │ │ ├── SingleLineWithOtherCommentsB.txt │ │ ├── SingleLineWithPrefixWhitespaceA.txt │ │ ├── SingleLineWithPrefixWhitespaceB.txt │ │ ├── SingleLinesA.txt │ │ ├── SingleLinesB.txt │ │ ├── SingleLinesEmptyLineA.txt │ │ ├── SingleLinesEmptyLineB.txt │ │ ├── SingleLinesEmptyLineWithoutCommentA.txt │ │ ├── SingleLinesEmptyLineWithoutCommentB.txt │ │ ├── SingleLinesIgnoreLInesBeforeMarkerA.txt │ │ └── SingleLinesIgnoreLInesBeforeMarkerB.txt │ ├── golden │ ├── AsText.dhall.html │ ├── ImportAsType.dhall.html │ ├── InvalidBlockComment.dhall.html │ ├── InvalidConsecutiveComments.dhall.html │ ├── InvalidMarkdown.dhall.html │ ├── InvalidMarkdownFile.md.html │ ├── JumpToDefOnUnused.dhall.html │ ├── JumpToHereImports.dhall.html │ ├── JumpToLamBindingComplex.dhall.html │ ├── JumpToLamBindingSimple.dhall.html │ ├── JumpToLamBindingWithIndex.dhall.html │ ├── JumpToLamBindingWithQuotes.dhall.html │ ├── JumpToLamBindingWithShadowing.dhall.html │ ├── JumpToLetBindingSimple.dhall.html │ ├── JumpToLetBindingWithIndex.dhall.html │ ├── JumpToLetBindingWithQuotes.dhall.html │ ├── JumpToLetBindingWithShadowing.dhall.html │ ├── JumpToLetbindingComplex.dhall.html │ ├── JumpToRecordFieldWhenFieldDoesNotExist.dhall.html │ ├── JumpToRecordFieldWhenLetAnnotationPresentShouldIgnoreAnnotation.dhall.html │ ├── JumpToRecordFieldWhenVarIsAnnotatedWithRecordType.dhall.html │ ├── JumpToRecordFieldWhenVarIsOfRecordType.dhall.html │ ├── JumpToRecordFieldWhenVarIsOfRecordTypeComplex.dhall.html │ ├── JumpToRecordFieldWhenVarIsOfRecordTypeDeep.dhall.html │ ├── JumpToRecordFieldWhenVarIsOfRecordTypeFromLamBinding.dhall.html │ ├── JumpToRecordFieldWhenVarIsOfRecordTypeOnPunnedEntry.dhall.html │ ├── JumpToRecordFieldWhenVarIsOfRecordTypeTransitivity.dhall.html │ ├── JumpToRecordFieldWhenVarIsOfRecordTypeWithDotSyntax.dhall.html │ ├── JumpToSelf.dhall.html │ ├── JumpToUrls.dhall.html │ ├── MarkdownExample.dhall.html │ ├── MarkdownFile.md.html │ ├── MultilineIndentationExample.dhall.html │ ├── NoDoc.dhall.html │ ├── NonDhallDocsCommentAfterValid.dhall.html │ ├── OrdinaryAnnotation.dhall.html │ ├── Pair.dhall.html │ ├── Plain.txt.html │ ├── RenderTypeIndexesExample.dhall.html │ ├── StandaloneTextFile.txt.html │ ├── TwoAnnotations.dhall.html │ ├── a │ │ ├── JumpToParent.dhall.html │ │ ├── b.dhall.html │ │ ├── b │ │ │ ├── JumpToGrandfather.dhall.html │ │ │ ├── c.dhall.html │ │ │ ├── c │ │ │ │ ├── a.dhall.html │ │ │ │ └── index.html │ │ │ └── index.html │ │ └── index.html │ ├── deep │ │ └── nested │ │ │ ├── folder │ │ │ ├── index.html │ │ │ └── my-even.dhall.html │ │ │ └── index.html │ ├── index.html │ └── package.dhall.html │ └── package │ ├── AsText.dhall │ ├── ImportAsType.dhall │ ├── InvalidBlockComment.dhall │ ├── InvalidConsecutiveComments.dhall │ ├── InvalidMarkdown.dhall │ ├── InvalidMarkdownFile.md │ ├── InvalidUnicode.dhall │ ├── JumpToDefOnUnused.dhall │ ├── JumpToHereImports.dhall │ ├── JumpToLamBindingComplex.dhall │ ├── JumpToLamBindingSimple.dhall │ ├── JumpToLamBindingWithIndex.dhall │ ├── JumpToLamBindingWithQuotes.dhall │ ├── JumpToLamBindingWithShadowing.dhall │ ├── JumpToLetBindingSimple.dhall │ ├── JumpToLetBindingWithIndex.dhall │ ├── JumpToLetBindingWithQuotes.dhall │ ├── JumpToLetBindingWithShadowing.dhall │ ├── JumpToLetbindingComplex.dhall │ ├── JumpToRecordFieldWhenFieldDoesNotExist.dhall │ ├── JumpToRecordFieldWhenLetAnnotationPresentShouldIgnoreAnnotation.dhall │ ├── JumpToRecordFieldWhenVarIsAnnotatedWithRecordType.dhall │ ├── JumpToRecordFieldWhenVarIsOfRecordType.dhall │ ├── JumpToRecordFieldWhenVarIsOfRecordTypeComplex.dhall │ ├── JumpToRecordFieldWhenVarIsOfRecordTypeDeep.dhall │ ├── JumpToRecordFieldWhenVarIsOfRecordTypeFromLamBinding.dhall │ ├── JumpToRecordFieldWhenVarIsOfRecordTypeOnPunnedEntry.dhall │ ├── JumpToRecordFieldWhenVarIsOfRecordTypeTransitivity.dhall │ ├── JumpToRecordFieldWhenVarIsOfRecordTypeWithDotSyntax.dhall │ ├── JumpToSelf.dhall │ ├── JumpToUrls.dhall │ ├── MarkdownExample.dhall │ ├── MarkdownFile.md │ ├── MultilineIndentationExample.dhall │ ├── NoDoc.dhall │ ├── NonDhallDocsCommentAfterValid.dhall │ ├── OrdinaryAnnotation.dhall │ ├── Pair.dhall │ ├── Plain.txt │ ├── RenderTypeIndexesExample.dhall │ ├── ShouldBeIgnored.dhall │ ├── StandaloneTextFile.txt │ ├── TwoAnnotations.dhall │ ├── a │ ├── JumpToParent.dhall │ ├── b.dhall │ └── b │ │ ├── JumpToGrandfather.dhall │ │ ├── c.dhall │ │ └── c │ │ └── a.dhall │ ├── deep │ └── nested │ │ └── folder │ │ └── my-even.dhall │ └── package.dhall ├── dhall-json ├── .gitignore ├── CHANGELOG.md ├── LICENSE ├── README.md ├── Setup.hs ├── default.nix ├── dhall-json.cabal ├── dhall-to-json │ └── Main.hs ├── dhall-to-yaml │ └── Main.hs ├── examples │ ├── bower.dhall │ ├── bower.json │ ├── bower.yaml │ ├── travis.dhall │ └── travis.yml ├── json-to-dhall │ └── Main.hs ├── shell.nix ├── src │ └── Dhall │ │ ├── DhallToYaml │ │ └── Main.hs │ │ ├── JSON.hs │ │ ├── JSON │ │ ├── Compat.hs │ │ ├── Util.hs │ │ └── Yaml.hs │ │ └── JSONToDhall.hs └── tasty │ ├── Main.hs │ └── data │ ├── emptyAlternative.dhall │ ├── emptyAlternative.json │ ├── emptyAlternativeSchema.dhall │ ├── emptyList.dhall │ ├── emptyList.json │ ├── emptyListSchema.dhall │ ├── emptyListStrongType.dhall │ ├── emptyListStrongType.json │ ├── emptyListStrongTypeSchema.dhall │ ├── emptyObject.dhall │ ├── emptyObject.json │ ├── emptyObjectSchema.dhall │ ├── emptyObjectStrongType.dhall │ ├── emptyObjectStrongType.json │ ├── emptyObjectStrongTypeSchema.dhall │ ├── error │ ├── mismatchMessage0.golden │ ├── mismatchMessage0.json │ ├── mismatchMessage0Schema.dhall │ ├── mismatchMessage1.golden │ ├── mismatchMessage1.json │ ├── mismatchMessage1Schema.dhall │ ├── mismatchMessage2.golden │ ├── mismatchMessage2.json │ ├── mismatchMessage2Schema.dhall │ ├── missingKey.golden │ ├── missingKey.json │ ├── missingKeySchema.dhall │ ├── unhandledKeys.golden │ ├── unhandledKeys.json │ └── unhandledKeysSchema.dhall │ ├── fromArbitraryJSON_12_0_0.dhall │ ├── fromArbitraryJSON_12_0_0.json │ ├── fromArbitraryJSON_12_0_0Schema.dhall │ ├── fromArbitraryJSON_13_0_0.dhall │ ├── fromArbitraryJSON_13_0_0.json │ ├── fromArbitraryJSON_13_0_0Schema.dhall │ ├── issue48.dhall │ ├── issue48.json │ ├── missingList.dhall │ ├── missingList.json │ ├── missingListSchema.dhall │ ├── nesting0.dhall │ ├── nesting0.json │ ├── nesting1.dhall │ ├── nesting1.json │ ├── nesting2.dhall │ ├── nesting2.json │ ├── nesting3.dhall │ ├── nesting3.json │ ├── nestingLegacy0.dhall │ ├── nestingLegacy0.json │ ├── nestingLegacy1.dhall │ ├── nestingLegacy1.json │ ├── potpourri.dhall │ ├── potpourri.json │ ├── time.dhall │ ├── time.json │ ├── toArbitraryJSON_12_0_0.dhall │ ├── toArbitraryJSON_12_0_0.json │ ├── toArbitraryJSON_13_0_0.dhall │ ├── toArbitraryJSON_13_0_0.json │ ├── unionKeys.dhall │ ├── unionKeys.json │ └── unionKeysSchema.dhall ├── dhall-lsp-server ├── LICENSE ├── README.md ├── Setup.hs ├── app │ └── Main.hs ├── default.nix ├── dhall-lsp-server.cabal ├── doctest │ └── Main.hs ├── shell.nix ├── src │ └── Dhall │ │ └── LSP │ │ ├── Backend │ │ ├── Completion.hs │ │ ├── Dhall.hs │ │ ├── Diagnostics.hs │ │ ├── Formatting.hs │ │ ├── Freezing.hs │ │ ├── Linting.hs │ │ ├── Parsing.hs │ │ ├── ToJSON.hs │ │ └── Typing.hs │ │ ├── Handlers.hs │ │ ├── Server.hs │ │ ├── State.hs │ │ └── Util.hs └── tests │ ├── Main.hs │ └── fixtures │ ├── completion │ ├── Bindings.dhall │ ├── CustomFunctions.dhall │ ├── CustomTypes.dhall │ ├── ImportedFunctions.dhall │ ├── Library.dhall │ └── Union.dhall │ ├── diagnostics │ ├── InvalidImport.dhall │ ├── InvalidSyntax.dhall │ ├── MissingImport.dhall │ ├── UnboundVar.dhall │ └── WrongType.dhall │ ├── hovering │ └── Types.dhall │ └── linting │ ├── SuperfluousIn.dhall │ └── UnusedBindings.dhall ├── dhall-nix ├── LICENSE ├── README.md ├── Setup.hs ├── default.nix ├── dhall-nix.cabal ├── exec │ └── Main.hs ├── release.nix ├── shell.nix └── src │ └── Dhall │ └── Nix.hs ├── dhall-nixpkgs ├── LICENSE ├── Main.hs ├── Setup.hs ├── dhall-nixpkgs.cabal └── shell.nix ├── dhall-openapi ├── LICENSE ├── README.md ├── default.nix ├── dhall-openapi.cabal ├── openapi-to-dhall │ └── Main.hs ├── shell.nix └── src │ └── Dhall │ └── Kubernetes │ ├── Convert.hs │ ├── Data.hs │ └── Types.hs ├── dhall-text └── README.md ├── dhall-toml ├── CHANGELOG.md ├── LICENSE ├── README.md ├── default.nix ├── dhall-to-toml │ └── Main.hs ├── dhall-toml.cabal ├── doctest │ └── Main.hs ├── shell.nix ├── src │ └── Dhall │ │ ├── DhallToToml.hs │ │ ├── Toml │ │ └── Utils.hs │ │ └── TomlToDhall.hs ├── tasty │ ├── Main.hs │ └── data │ │ ├── adjacent-tables-schema.dhall │ │ ├── adjacent-tables.dhall │ │ ├── adjacent-tables.toml │ │ ├── empty-schema.dhall │ │ ├── empty.dhall │ │ ├── empty.toml │ │ ├── float-schema.dhall │ │ ├── float.dhall │ │ ├── float.toml │ │ ├── inline-list-schema.dhall │ │ ├── inline-list.dhall │ │ ├── inline-list.toml │ │ ├── map-complex-schema.dhall │ │ ├── map-complex.dhall │ │ ├── map-complex.toml │ │ ├── map-empty-schema.dhall │ │ ├── map-empty.dhall │ │ ├── map-empty.toml │ │ ├── map-simple-schema.dhall │ │ ├── map-simple.dhall │ │ ├── map-simple.toml │ │ ├── multiple-fields-schema.dhall │ │ ├── multiple-fields.dhall │ │ ├── multiple-fields.toml │ │ ├── natural-schema.dhall │ │ ├── natural.dhall │ │ ├── natural.toml │ │ ├── nested-tables-schema.dhall │ │ ├── nested-tables.dhall │ │ ├── nested-tables.toml │ │ ├── optional-schema.dhall │ │ ├── optional.dhall │ │ ├── optional.toml │ │ ├── record-list-schema.dhall │ │ ├── record-list.dhall │ │ ├── record-list.toml │ │ ├── union-empty-schema.dhall │ │ ├── union-empty.dhall │ │ ├── union-empty.toml │ │ ├── union-nested.dhall │ │ ├── union-nested.toml │ │ ├── union-typed-schema.dhall │ │ ├── union-typed.dhall │ │ └── union-typed.toml └── toml-to-dhall │ └── Main.hs ├── dhall-try ├── LICENSE ├── README.md ├── Setup.hs ├── default.nix ├── dhall-try.cabal ├── shell.nix └── src │ └── Main.hs ├── dhall-yaml ├── CHANGELOG.md ├── LICENSE ├── README.md ├── default.nix ├── dhall-to-yaml-ng │ └── Main.hs ├── dhall-yaml.cabal ├── shell.nix ├── src │ └── Dhall │ │ ├── Yaml.hs │ │ └── YamlToDhall.hs ├── tasty │ ├── Main.hs │ └── data │ │ ├── boolean-quotes.dhall │ │ ├── boolean-quotes.yaml │ │ ├── emptyList.dhall │ │ ├── emptyList.yaml │ │ ├── emptyMap.dhall │ │ ├── emptyMap.yaml │ │ ├── mergify.dhall │ │ ├── mergify.yaml │ │ ├── normal-aeson.dhall │ │ ├── normal-aeson.yaml │ │ ├── normal.dhall │ │ ├── normal.yaml │ │ ├── preserve-header.dhall │ │ ├── preserve-header.yaml │ │ ├── quoted.dhall │ │ ├── quoted.yaml │ │ ├── single-document-bare.dhall │ │ ├── single-document-bare.yaml │ │ ├── single-document.dhall │ │ ├── single-document.yaml │ │ ├── special.dhall │ │ ├── special.yaml │ │ └── yaml.txt └── yaml-to-dhall │ └── Main.hs ├── dhall ├── CHANGELOG.md ├── LICENSE ├── README.md ├── Setup.hs ├── benchmark │ ├── deep-nested-large-record │ │ ├── BigEnum.dhall │ │ ├── LittleEnum.dhall │ │ ├── Main.hs │ │ └── prelude.dhall │ └── parser │ │ ├── Main.hs │ │ └── examples │ │ ├── cpkg.dhall │ │ ├── issue108.dhall │ │ ├── issue108.dhallb │ │ ├── kubernetes.dhallb │ │ └── normalize │ │ ├── ChurchEval.dhall │ │ ├── FunCompose.dhall │ │ ├── ListBench.dhall │ │ └── ListBenchAlt.dhall ├── default.nix ├── dhall.cabal ├── dhall │ └── Main.hs ├── doctest │ └── Main.hs ├── examples │ ├── True │ └── to-directory-tree.dhall ├── ghc-src │ └── Dhall │ │ ├── Crypto.hs │ │ └── Import │ │ ├── HTTP.hs │ │ └── Manager.hs ├── ghcjs-src │ └── Dhall │ │ ├── Crypto.hs │ │ └── Import │ │ ├── HTTP.hs │ │ └── Manager.hs ├── man │ ├── dhall.1 │ ├── dhall.md │ └── gen-manpage.sh ├── shell.nix ├── src │ ├── Dhall.hs │ └── Dhall │ │ ├── Binary.hs │ │ ├── Context.hs │ │ ├── Core.hs │ │ ├── Deriving.hs │ │ ├── Diff.hs │ │ ├── DirectoryTree.hs │ │ ├── DirectoryTree │ │ └── Types.hs │ │ ├── Eval.hs │ │ ├── Format.hs │ │ ├── Freeze.hs │ │ ├── Import.hs │ │ ├── Import │ │ ├── Headers.hs │ │ └── Types.hs │ │ ├── Lint.hs │ │ ├── Main.hs │ │ ├── Map.hs │ │ ├── Marshal │ │ ├── Decode.hs │ │ ├── Encode.hs │ │ └── Internal.hs │ │ ├── Normalize.hs │ │ ├── Optics.hs │ │ ├── Package.hs │ │ ├── Parser.hs │ │ ├── Parser │ │ ├── Combinators.hs │ │ ├── Expression.hs │ │ └── Token.hs │ │ ├── Pretty.hs │ │ ├── Pretty │ │ ├── Internal.hs │ │ └── Internal.hs-boot │ │ ├── Repl.hs │ │ ├── Schemas.hs │ │ ├── Set.hs │ │ ├── Src.hs │ │ ├── Substitution.hs │ │ ├── Syntax.hs │ │ ├── Syntax │ │ ├── Binding.hs │ │ ├── Chunks.hs │ │ ├── Chunks.hs-boot │ │ ├── Const.hs │ │ ├── Expr.hs │ │ ├── Expr.hs-boot │ │ ├── FunctionBinding.hs │ │ ├── Import.hs │ │ ├── Instances │ │ │ ├── Applicative.hs │ │ │ ├── Bifunctor.hs │ │ │ ├── Data.hs │ │ │ ├── Eq.hs │ │ │ ├── Foldable.hs │ │ │ ├── Functor.hs │ │ │ ├── Lift.hs │ │ │ ├── Monad.hs │ │ │ ├── NFData.hs │ │ │ ├── Ord.hs │ │ │ ├── Pretty.hs │ │ │ ├── Pretty.hs-boot │ │ │ ├── Show.hs │ │ │ └── Traversable.hs │ │ ├── MultiLet.hs │ │ ├── Operations.hs │ │ ├── Operations.hs-boot │ │ ├── RecordField.hs │ │ ├── Types.hs │ │ ├── Types.hs-boot │ │ └── Var.hs │ │ ├── TH.hs │ │ ├── Tags.hs │ │ ├── Tutorial.hs │ │ ├── TypeCheck.hs │ │ ├── URL.hs │ │ ├── Util.hs │ │ ├── Util.hs-boot │ │ └── Version.hs └── tests │ ├── Dhall │ └── Test │ │ ├── Dhall.hs │ │ ├── Diff.hs │ │ ├── DirectoryTree.hs │ │ ├── Format.hs │ │ ├── Freeze.hs │ │ ├── Import.hs │ │ ├── Lint.hs │ │ ├── Main.hs │ │ ├── Normalization.hs │ │ ├── Package.hs │ │ ├── Parser.hs │ │ ├── QuickCheck.hs │ │ ├── Regression.hs │ │ ├── Schemas.hs │ │ ├── SemanticHash.hs │ │ ├── Substitution.hs │ │ ├── TH.hs │ │ ├── Tags.hs │ │ ├── Tutorial.hs │ │ ├── TypeInference.hs │ │ └── Util.hs │ ├── diff │ ├── appList.txt │ ├── appListA.dhall │ ├── appListB.dhall │ ├── emptyList.txt │ ├── emptyListA.dhall │ ├── emptyListB.dhall │ ├── function.txt │ ├── functionA.dhall │ ├── functionB.dhall │ ├── insideList.txt │ ├── insideListA.dhall │ ├── insideListB.dhall │ ├── nonEmptyList.txt │ ├── nonEmptyListA.dhall │ ├── nonEmptyListB.dhall │ ├── with.txt │ ├── withA.dhall │ └── withB.dhall │ ├── format │ ├── applicationMultilineA.dhall │ ├── applicationMultilineB.dhall │ ├── asciiA.dhall │ ├── asciiB.dhall │ ├── concatSepA.dhall │ ├── concatSepB.dhall │ ├── dottedFieldsA.dhall │ ├── dottedFieldsB.dhall │ ├── dottedFieldsCommentsA.dhall │ ├── dottedFieldsCommentsB.dhall │ ├── doubleRoundA.dhall │ ├── doubleRoundB.dhall │ ├── duplicatesA.dhall │ ├── duplicatesB.dhall │ ├── emptyRecordA.dhall │ ├── emptyRecordB.dhall │ ├── envVarsA.dhall │ ├── envVarsB.dhall │ ├── escapeNumericLabelA.dhall │ ├── escapeNumericLabelB.dhall │ ├── escapeSingleQuotedOpenInterpolationA.dhall │ ├── escapeSingleQuotedOpenInterpolationB.dhall │ ├── fieldOrderA.dhall │ ├── fieldOrderB.dhall │ ├── functionLikeA.dhall │ ├── functionLikeB.dhall │ ├── headerA.dhall │ ├── headerB.dhall │ ├── headerNoNewlineA.dhall │ ├── headerNoNewlineB.dhall │ ├── ifThenElseA.dhall │ ├── ifThenElseB.dhall │ ├── importAccessA.dhall │ ├── importAccessB.dhall │ ├── importAltPrecedenceA.dhall │ ├── importAltPrecedenceB.dhall │ ├── importLines2A.dhall │ ├── importLines2B.dhall │ ├── importLinesA.dhall │ ├── importLinesB.dhall │ ├── importSuffixA.dhall │ ├── importSuffixB.dhall │ ├── innerMultilineA.dhall │ ├── innerMultilineB.dhall │ ├── interpolation0A.dhall │ ├── interpolation0B.dhall │ ├── ipfsA.dhall │ ├── ipfsB.dhall │ ├── issue1301A.dhall │ ├── issue1301B.dhall │ ├── issue1400-1A.dhall │ ├── issue1400-1B.dhall │ ├── issue1400-2A.dhall │ ├── issue1400-2B.dhall │ ├── issue1413A.dhall │ ├── issue1413B.dhall │ ├── issue1545-1A.dhall │ ├── issue1545-1B.dhall │ ├── issue1545-2A.dhall │ ├── issue1545-2B.dhall │ ├── issue1687A.dhall │ ├── issue1687B.dhall │ ├── issue1805KeywordRecordFieldShouldBeQuotedA.dhall │ ├── issue1805KeywordRecordFieldShouldBeQuotedB.dhall │ ├── issue1805SomeQuotedInLetButNotInRecordA.dhall │ ├── issue1805SomeQuotedInLetButNotInRecordB.dhall │ ├── issue183A.dhall │ ├── issue183B.dhall │ ├── issue2047A.dhall │ ├── issue2047B.dhall │ ├── issue2078A.dhall │ ├── issue2078B.dhall │ ├── issue2601A.dhall │ ├── issue2601B.dhall │ ├── largeExponentA.dhall │ ├── largeExponentB.dhall │ ├── largeRecordA.dhall │ ├── largeRecordB.dhall │ ├── letA.dhall │ ├── letAnnotatedShortA.dhall │ ├── letAnnotatedShortB.dhall │ ├── letB.dhall │ ├── letCommentsA.dhall │ ├── letCommentsB.dhall │ ├── letLineCommentsAfterVariableA.dhall │ ├── letLineCommentsAfterVariableB.dhall │ ├── letLongCommentsA.dhall │ ├── letLongCommentsB.dhall │ ├── letNewlineCommentsA.dhall │ ├── letNewlineCommentsB.dhall │ ├── letShortCommentsA.dhall │ ├── letShortCommentsB.dhall │ ├── multilineA.dhall │ ├── multilineArgumentA.dhall │ ├── multilineArgumentB.dhall │ ├── multilineB.dhall │ ├── multilineTrailingSingleQuoteA.dhall │ ├── multilineTrailingSingleQuoteB.dhall │ ├── multilineTrailingWhitespaceA.dhall │ ├── multilineTrailingWhitespaceB.dhall │ ├── negativeTimeZoneA.dhall │ ├── negativeTimeZoneB.dhall │ ├── nestedAnnotationA.dhall │ ├── nestedAnnotationB.dhall │ ├── numericLiteralsA.dhall │ ├── numericLiteralsB.dhall │ ├── parentA.dhall │ ├── parentB.dhall │ ├── parenthesizeUsingA.dhall │ ├── parenthesizeUsingB.dhall │ ├── preserveShebangA.dhall │ ├── preserveShebangB.dhall │ ├── projectionOrderA.dhall │ ├── projectionOrderB.dhall │ ├── punA.dhall │ ├── punB.dhall │ ├── punCommentsA.dhall │ ├── punCommentsB.dhall │ ├── recordCompletionA.dhall │ ├── recordCompletionB.dhall │ ├── recordLitComments0A.dhall │ ├── recordLitComments0B.dhall │ ├── recordLitComments1A.dhall │ ├── recordLitComments1B.dhall │ ├── recordLitMultilineBlockCommentsA.dhall │ ├── recordLitMultilineBlockCommentsB.dhall │ ├── recordTypeCommentsA.dhall │ ├── recordTypeCommentsB.dhall │ ├── sha256PrintingA.dhall │ ├── sha256PrintingB.dhall │ ├── significantLeadingSpacesA.dhall │ ├── significantLeadingSpacesB.dhall │ ├── stringWithNullA.dhall │ ├── stringWithNullB.dhall │ ├── textLitNewlinesOnlyA.dhall │ ├── textLitNewlinesOnlyB.dhall │ ├── timePrecisionA.dhall │ ├── timePrecisionB.dhall │ ├── unicodeA.dhall │ ├── unicodeB.dhall │ ├── urlsA.dhall │ ├── urlsB.dhall │ ├── usingToMapA.dhall │ ├── usingToMapB.dhall │ ├── withA.dhall │ ├── withB.dhall │ ├── withPrecedenceA.dhall │ ├── withPrecedenceB.dhall │ ├── withQuestionA.dhall │ └── withQuestionB.dhall │ ├── freeze │ ├── cached │ │ ├── True.dhall │ │ ├── cachedA.dhall │ │ ├── cachedB.dhall │ │ ├── idempotentA.dhall │ │ ├── idempotentB.dhall │ │ ├── incorrectHashA.dhall │ │ ├── incorrectHashB.dhall │ │ ├── protectedA.dhall │ │ ├── protectedB.dhall │ │ ├── unprotectedA.dhall │ │ └── unprotectedB.dhall │ └── secure │ │ ├── True.dhall │ │ ├── cachedA.dhall │ │ ├── cachedB.dhall │ │ ├── incorrectHashA.dhall │ │ ├── incorrectHashB.dhall │ │ ├── protectedA.dhall │ │ ├── protectedB.dhall │ │ ├── unprotectedA.dhall │ │ └── unprotectedB.dhall │ ├── lint │ └── success │ │ ├── PreludeExtensionA.dhall │ │ ├── PreludeExtensionB.dhall │ │ ├── assertA.dhall │ │ ├── assertB.dhall │ │ ├── fixAssertA.dhall │ │ ├── fixAssertB.dhall │ │ ├── issue1586A.dhall │ │ ├── issue1586B.dhall │ │ ├── multiletA.dhall │ │ ├── multiletB.dhall │ │ ├── regression0A.dhall │ │ └── regression0B.dhall │ ├── package │ ├── dir │ │ ├── package.dhall │ │ ├── subdirectory1 │ │ │ └── test.dhall │ │ ├── subdirectory2 │ │ │ └── wrong-extension.txt │ │ ├── test.dhall │ │ └── wrong-extension.txt │ ├── empty │ │ └── wrong-extension.txt │ ├── other │ │ └── package.dhall │ ├── package.dhall │ ├── test.dhall │ └── test │ │ └── test.dhall │ ├── recursive │ ├── expr0.dhall │ └── expr1.dhall │ ├── regression │ ├── issue151a.dhall │ ├── issue151b.dhall │ ├── issue1584.dhall │ ├── issue164.dhall │ ├── issue1646.dhall │ ├── issue1732.dhall │ ├── issue1884.dhall │ ├── issue201.dhall │ ├── issue2088.dhall │ ├── issue216a.dhall │ └── issue216b.dhall │ ├── schemas │ ├── multipleA.dhall │ ├── multipleB.dhall │ ├── multipleSchema.dhall │ ├── personA.dhall │ ├── personB.dhall │ └── personSchema.dhall │ ├── tags │ ├── all.tags │ ├── let.dhall │ ├── let.tags │ ├── nonunicode.dhall │ ├── nonunicode.tags │ ├── record.dhall │ ├── record.tags │ ├── recordlit.dhall │ ├── recordlit.tags │ ├── simple.dhall │ ├── simple.tags │ ├── unicode.dhall │ ├── unicode.tags │ ├── union.dhall │ └── union.tags │ ├── th │ ├── Department.dhall │ ├── Employee.dhall │ ├── HigherKindSingle.dhall │ ├── HigherKindUnion.dhall │ ├── Time.dhall │ ├── example.dhall │ └── issue2066.dhall │ ├── to-directory-tree │ ├── fixpoint-allow-path-separators.dhall │ ├── fixpoint-empty.dhall │ ├── fixpoint-helper.dhall │ ├── fixpoint-permissions.dhall │ ├── fixpoint-simple.dhall │ ├── fixpoint-usergroup.dhall │ └── type.dhall │ └── tutorial │ ├── Union.dhall │ ├── process.dhall │ ├── substitution1.dhall │ ├── substitution2.dhall │ ├── substitution3.dhall │ ├── unions0A.dhall │ ├── unions0B.dhall │ ├── unions1A.dhall │ ├── unions1B.dhall │ ├── unions3A.dhall │ ├── unions3B.dhall │ ├── unions4A.dhall │ └── unions4B.dhall ├── nix ├── dhall-docs-generator.nix ├── packages │ ├── .gitkeep │ ├── co-log-core.nix │ ├── hashable.nix │ ├── hnix.nix │ ├── lsp-test.nix │ ├── lsp-types.nix │ ├── lsp.nix │ ├── lucid.nix │ ├── mmark.nix │ ├── relude.nix │ ├── semialign.nix │ ├── tasty-bench.nix │ ├── text-rope.nix │ └── turtle.nix ├── pinnedNixpkgs.nix ├── sdist.nix ├── shared.nix └── test-dhall.nix ├── release.nix ├── scripts └── release.sh ├── shell.nix ├── stack.ghc-8.10.yaml ├── stack.ghc-9.2.yaml ├── stack.ghc-9.4.yaml ├── stack.ghc-9.6.yaml ├── stack.ghc-9.8.yaml └── stack.yaml /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto 2 | 3 | *B.dhall binary 4 | *B.txt binary 5 | *.golden binary 6 | dhall-csv/tasty/data/* binary 7 | dhall-docs/tasty/data/golden/**/*.html binary 8 | dhall-docs/tasty/data/package/StandaloneTextFile.txt binary 9 | dhall-docs/tasty/data/package/MarkdownFile.md binary 10 | dhall-docs/tasty/data/package/InvalidMarkdownFile.md binary 11 | dhall-yaml/tasty/data/* binary 12 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: "github-actions" 4 | directory: "/" 5 | schedule: 6 | interval: "weekly" 7 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | dist 2 | dist-* 3 | cabal-dev 4 | *.o 5 | *.hi 6 | *.chi 7 | *.chs.h 8 | *.dyn_o 9 | *.dyn_hi 10 | .hpc 11 | .hsenv 12 | .cabal-sandbox/ 13 | cabal.sandbox.config 14 | *.prof 15 | *.aux 16 | *.hp 17 | *.eventlog 18 | .stack-work/ 19 | cabal.project.local 20 | cabal.project.local~ 21 | .HTF/ 22 | .envrc 23 | .ghc.environment.* 24 | .cache 25 | .history 26 | stack*.yaml.lock 27 | .vscode 28 | docs 29 | result 30 | result-* 31 | report.html 32 | /dhall/tests/to-directory-tree/*.out/ 33 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "dhall/dhall-lang"] 2 | path = dhall/dhall-lang 3 | url = https://github.com/dhall-lang/dhall-lang.git 4 | -------------------------------------------------------------------------------- /.mergify.yml: -------------------------------------------------------------------------------- 1 | queue_rules: 2 | - name: default 3 | queue_conditions: 4 | - label=merge me 5 | - '#approved-reviews-by>=1' 6 | - '#changes-requested-reviews-by=0' 7 | merge_conditions: 8 | - check-success=hydra 9 | # Mergify explicitly recommends listing each status check separately: 10 | # https://docs.mergify.io/conditions/#validating-all-status-checks 11 | - check-success=macOS-latest - stack.yaml 12 | - check-success=ubuntu-latest - stack.yaml 13 | - check-success=windows-latest - stack.yaml 14 | merge_method: squash 15 | 16 | pull_request_rules: 17 | - actions: 18 | delete_head_branch: {} 19 | name: Delete head branch after merge 20 | conditions: 21 | - merged 22 | - name: Automatically merge pull requests 23 | conditions: [] 24 | actions: 25 | queue: 26 | -------------------------------------------------------------------------------- /.stylish-haskell.yaml: -------------------------------------------------------------------------------- 1 | steps: 2 | - imports: 3 | align: group 4 | pad_module_names: true 5 | long_list_align: multiline 6 | - language_pragmas: 7 | align: true 8 | remove_redundant: false 9 | 10 | # Language prefix to be used for pragma declaration, this allows you to 11 | # use other options non case-sensitive like "language" or "Language". 12 | # If a non correct String is provided, it will default to: LANGUAGE. 13 | language_prefix: LANGUAGE 14 | -------------------------------------------------------------------------------- /cabal.project: -------------------------------------------------------------------------------- 1 | packages: 2 | ./dhall 3 | ./dhall-bash 4 | ./dhall-csv 5 | ./dhall-docs 6 | ./dhall-json 7 | ./dhall-lsp-server 8 | ./dhall-openapi 9 | ./dhall-toml 10 | ./dhall-yaml 11 | 12 | if impl(ghc < 9.8) 13 | packages: 14 | ./dhall-nix 15 | ./dhall-nixpkgs 16 | 17 | if impl(ghc >= 9.12) 18 | allow-newer: repline:containers 19 | -------------------------------------------------------------------------------- /default.nix: -------------------------------------------------------------------------------- 1 | let 2 | shared = import ./nix/shared.nix {}; 3 | 4 | shared_ghcjs = import ./nix/shared.nix { compiler = "ghcjs"; }; 5 | 6 | in 7 | { inherit (shared.possibly-static) 8 | dhall 9 | dhall-bash 10 | dhall-csv 11 | dhall-docs 12 | dhall-json 13 | dhall-lsp-server 14 | dhall-openapi 15 | dhall-nix 16 | dhall-nixpkgs 17 | dhall-toml 18 | dhall-yaml 19 | ; 20 | 21 | # We can re-enable these once https://github.com/NixOS/nixpkgs/issues/133271 22 | # is fixed and Nixpkgs is upgraded to a version that incorporates GHCJS 23 | 24 | # inherit (shared_ghcjs) dhall-try; 25 | # dhall-ghcjs = shared_ghcjs.dhall; 26 | } 27 | -------------------------------------------------------------------------------- /dhall-bash/Setup.hs: -------------------------------------------------------------------------------- 1 | import Distribution.Simple 2 | main = defaultMain 3 | -------------------------------------------------------------------------------- /dhall-bash/default.nix: -------------------------------------------------------------------------------- 1 | (import ../nix/shared.nix {}).possibly-static.dhall-bash 2 | -------------------------------------------------------------------------------- /dhall-bash/shell.nix: -------------------------------------------------------------------------------- 1 | (import ../nix/shared.nix {}).shell-dhall-bash 2 | -------------------------------------------------------------------------------- /dhall-csv/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | 1.0.4 2 | 3 | * Build against `dhall-1.42.0` 4 | 5 | 1.0.3 6 | 7 | * Builds against newer dependencies 8 | * [`vector-0.13`](https://github.com/dhall-lang/dhall-haskell/pull/2427) 9 | 10 | 1.0.2 11 | 12 | * Build against `dhall-1.41` 13 | * [Build against `text-2.0`](https://github.com/dhall-lang/dhall-haskell/pull/2356) 14 | 1.0.1 15 | 16 | * [Build against `tasty-silver` 3.3](https://github.com/dhall-lang/dhall-haskell/pull/2307) 17 | 18 | 1.0.0 19 | 20 | * Initial release 21 | -------------------------------------------------------------------------------- /dhall-csv/README.md: -------------------------------------------------------------------------------- 1 | # `dhall-csv` 2 | 3 | For installation or development instructions, see: 4 | 5 | * [`dhall-haskell` - `README`](https://github.com/dhall-lang/dhall-haskell/blob/master/README.md) 6 | 7 | ## Introduction 8 | 9 | This `dhall-csv` package provides two executables to convert bidirectionally 10 | between Dhall and CSV files. 11 | -------------------------------------------------------------------------------- /dhall-csv/Setup.hs: -------------------------------------------------------------------------------- 1 | import Distribution.Simple 2 | main = defaultMain 3 | -------------------------------------------------------------------------------- /dhall-csv/default.nix: -------------------------------------------------------------------------------- 1 | (import ../nix/shared.nix {}).possibly-static.dhall-csv 2 | -------------------------------------------------------------------------------- /dhall-csv/shell.nix: -------------------------------------------------------------------------------- 1 | (import ../nix/shared.nix { coverage = true; }).shell-dhall-csv 2 | -------------------------------------------------------------------------------- /dhall-csv/tasty/data/.gitattributes: -------------------------------------------------------------------------------- 1 | *.csv binary 2 | *.dhall binary 3 | -------------------------------------------------------------------------------- /dhall-csv/tasty/data/csv-to-dhall/basic_test.csv: -------------------------------------------------------------------------------- 1 | testDouble,testNatural,testText 2 | 3.14,42,text 3 | 1.0e-4,4,dummy 4 | NaN,2,test 5 | 0.0,10,dhall 6 | -------------------------------------------------------------------------------- /dhall-csv/tasty/data/csv-to-dhall/basic_test.dhall: -------------------------------------------------------------------------------- 1 | [ { testDouble = 3.14, testNatural = 42, testText = "text" } 2 | , { testDouble = 1.0e-4, testNatural = 4, testText = "dummy" } 3 | , { testDouble = NaN, testNatural = 2, testText = "test" } 4 | , { testDouble = 0.0, testNatural = 10, testText = "dhall" } 5 | ] 6 | -------------------------------------------------------------------------------- /dhall-csv/tasty/data/csv-to-dhall/basic_test_schema.dhall: -------------------------------------------------------------------------------- 1 | List 2 | { testText : Text 3 | , testDouble : Double 4 | , testNatural : Natural 5 | } 6 | -------------------------------------------------------------------------------- /dhall-csv/tasty/data/csv-to-dhall/doubles_test.csv: -------------------------------------------------------------------------------- 1 | someDouble 2 | 3.14 3 | -2.68 4 | NaN 5 | 2.0e128 6 | 1.0e-12 7 | -------------------------------------------------------------------------------- /dhall-csv/tasty/data/csv-to-dhall/doubles_test.dhall: -------------------------------------------------------------------------------- 1 | [ { someDouble = 3.14 } 2 | , { someDouble = -2.68 } 3 | , { someDouble = NaN } 4 | , { someDouble = 2.0000000000000005e128 } 5 | , { someDouble = 1.0e-12 } 6 | ] 7 | -------------------------------------------------------------------------------- /dhall-csv/tasty/data/csv-to-dhall/doubles_test_schema.dhall: -------------------------------------------------------------------------------- 1 | List { someDouble : Double } 2 | -------------------------------------------------------------------------------- /dhall-csv/tasty/data/csv-to-dhall/escaped_characters.csv: -------------------------------------------------------------------------------- 1 | escapedText1,escapedText2 2 | " 3 | "," 4 | " 5 | \,\ 6 | """","""" 7 | /,/ 8 | $,$ 9 | , 10 | , 11 | , 12 | ☺,☺ 13 | ",","," 14 | -------------------------------------------------------------------------------- /dhall-csv/tasty/data/csv-to-dhall/escaped_characters.dhall: -------------------------------------------------------------------------------- 1 | [ { escapedText1 = "\n", escapedText2 = "\n" } 2 | , { escapedText1 = "\\", escapedText2 = "\\" } 3 | , { escapedText1 = "\"", escapedText2 = "\"" } 4 | , { escapedText1 = "/", escapedText2 = "/" } 5 | , { escapedText1 = "\$", escapedText2 = "\$" } 6 | , { escapedText1 = "\b", escapedText2 = "\b" } 7 | , { escapedText1 = "\f", escapedText2 = "\f" } 8 | , { escapedText1 = "\t", escapedText2 = "\t" } 9 | , { escapedText1 = "☺", escapedText2 = "☺" } 10 | , { escapedText1 = ",", escapedText2 = "," } 11 | ] 12 | -------------------------------------------------------------------------------- /dhall-csv/tasty/data/csv-to-dhall/escaped_characters_schema.dhall: -------------------------------------------------------------------------------- 1 | List 2 | { escapedText1 : Text 3 | , escapedText2 : Text 4 | } 5 | -------------------------------------------------------------------------------- /dhall-csv/tasty/data/csv-to-dhall/integers_test.csv: -------------------------------------------------------------------------------- 1 | someInteger 2 | 1 3 | -1 4 | 0 5 | 0 6 | 10000000000 7 | -10000000000 8 | -------------------------------------------------------------------------------- /dhall-csv/tasty/data/csv-to-dhall/integers_test.dhall: -------------------------------------------------------------------------------- 1 | [ { someInteger = +1 } 2 | , { someInteger = -1 } 3 | , { someInteger = +0 } 4 | , { someInteger = +0 } 5 | , { someInteger = +10000000000 } 6 | , { someInteger = -10000000000 } 7 | ] 8 | -------------------------------------------------------------------------------- /dhall-csv/tasty/data/csv-to-dhall/integers_test_schema.dhall: -------------------------------------------------------------------------------- 1 | List {someInteger : Integer} 2 | -------------------------------------------------------------------------------- /dhall-csv/tasty/data/csv-to-dhall/naturals_test.csv: -------------------------------------------------------------------------------- 1 | someNatural 2 | 42 3 | -------------------------------------------------------------------------------- /dhall-csv/tasty/data/csv-to-dhall/naturals_test.dhall: -------------------------------------------------------------------------------- 1 | [ { someNatural = 42 } ] 2 | -------------------------------------------------------------------------------- /dhall-csv/tasty/data/csv-to-dhall/naturals_test_schema.dhall: -------------------------------------------------------------------------------- 1 | List {someNatural : Natural} 2 | -------------------------------------------------------------------------------- /dhall-csv/tasty/data/csv-to-dhall/optionals_test.csv: -------------------------------------------------------------------------------- 1 | optDouble,optInteger,optNatural,optText 2 | 2.68,-1,1,Hello World! 3 | ,,, 4 | 1.0e-6,,12, 5 | ,-1,,Hello Dhall! 6 | -------------------------------------------------------------------------------- /dhall-csv/tasty/data/csv-to-dhall/optionals_test.dhall: -------------------------------------------------------------------------------- 1 | [ { optDouble = Some 2.68 2 | , optInteger = Some -1 3 | , optMissing = None Bool 4 | , optNatural = Some 1 5 | , optText = Some "Hello World!" 6 | } 7 | , { optDouble = None Double 8 | , optInteger = None Integer 9 | , optMissing = None Bool 10 | , optNatural = None Natural 11 | , optText = None Text 12 | } 13 | , { optDouble = Some 1.0e-6 14 | , optInteger = None Integer 15 | , optMissing = None Bool 16 | , optNatural = Some 12 17 | , optText = None Text 18 | } 19 | , { optDouble = None Double 20 | , optInteger = Some -1 21 | , optMissing = None Bool 22 | , optNatural = None Natural 23 | , optText = Some "Hello Dhall!" 24 | } 25 | ] 26 | -------------------------------------------------------------------------------- /dhall-csv/tasty/data/csv-to-dhall/optionals_test_schema.dhall: -------------------------------------------------------------------------------- 1 | List 2 | { optNatural : Optional Natural 3 | , optInteger : Optional Integer 4 | , optDouble : Optional Double 5 | , optText : Optional Text 6 | , optMissing : Optional Bool 7 | } 8 | -------------------------------------------------------------------------------- /dhall-csv/tasty/data/csv-to-dhall/text_test.csv: -------------------------------------------------------------------------------- 1 | someText 2 | Hello World! 3 | "Hello, World!" 4 | "Line1 5 | Line2 6 | Line3 7 | " 8 | "The answer to life, the universe, and everything: 42" 9 | Hello Dhall! 10 | -------------------------------------------------------------------------------- /dhall-csv/tasty/data/csv-to-dhall/text_test.dhall: -------------------------------------------------------------------------------- 1 | [ { someText = "Hello World!" } 2 | , { someText = "Hello, World!" } 3 | , { someText = 4 | '' 5 | Line1 6 | Line2 7 | Line3 8 | '' 9 | } 10 | , { someText = "The answer to life, the universe, and everything: 42" } 11 | , { someText = "Hello Dhall!" } 12 | ] 13 | -------------------------------------------------------------------------------- /dhall-csv/tasty/data/csv-to-dhall/text_test_schema.dhall: -------------------------------------------------------------------------------- 1 | List { someText : Text } 2 | -------------------------------------------------------------------------------- /dhall-csv/tasty/data/csv-to-dhall/unions_test.csv: -------------------------------------------------------------------------------- 1 | union1,union2,union3 2 | Option1,42,EmptyAlternative 3 | Option2,true,-1 4 | Option3,3.14,EmptyAlternative 5 | Option1,Hello world,1 6 | -------------------------------------------------------------------------------- /dhall-csv/tasty/data/csv-to-dhall/unions_test_schema.dhall: -------------------------------------------------------------------------------- 1 | let EmptyAlternatives = < Option1 | Option2 | Option3 > 2 | let NonEmptyAlternatives = < NaturalOption : Natural | BoolOption : Bool | DoubleOption : Double | TextOption : Text> 3 | let MixedAlternatives = < EmptyAlternative | NonEmptyAlternative : Integer > 4 | in 5 | List 6 | { union1 : EmptyAlternatives 7 | , union2 : NonEmptyAlternatives 8 | , union3 : MixedAlternatives 9 | } 10 | -------------------------------------------------------------------------------- /dhall-csv/tasty/data/dhall-to-csv/basic_test.csv: -------------------------------------------------------------------------------- 1 | testDouble,testNatural,testText 2 | 3.14,42,text 3 | 1.0e-4,4,dummy 4 | NaN,2,test 5 | 0.0,10,dhall 6 | -------------------------------------------------------------------------------- /dhall-csv/tasty/data/dhall-to-csv/basic_test.dhall: -------------------------------------------------------------------------------- 1 | [ { testNatural = 42, testText = "text", testDouble = 3.14 } 2 | , { testNatural = 4, testText = "dummy", testDouble = 1e-4 } 3 | , { testNatural = 2, testText = "test", testDouble = NaN } 4 | , { testNatural = 10, testText = "dhall", testDouble = 0.0 } 5 | ] 6 | -------------------------------------------------------------------------------- /dhall-csv/tasty/data/dhall-to-csv/doubles_test.csv: -------------------------------------------------------------------------------- 1 | someDouble 2 | 3.14 3 | -2.68 4 | NaN 5 | 2.0e128 6 | 1.0e-12 7 | -------------------------------------------------------------------------------- /dhall-csv/tasty/data/dhall-to-csv/doubles_test.dhall: -------------------------------------------------------------------------------- 1 | [ { someDouble = 3.14 } 2 | , { someDouble = -2.68 } 3 | , { someDouble = NaN } 4 | , { someDouble = 2e128 } 5 | , { someDouble = 1e-12 } 6 | ] 7 | -------------------------------------------------------------------------------- /dhall-csv/tasty/data/dhall-to-csv/escaped_characters.csv: -------------------------------------------------------------------------------- 1 | escapedText1,escapedText2 2 | " 3 | "," 4 | " 5 | \,\ 6 | """","""" 7 | /,/ 8 | $,$ 9 | , 10 | , 11 | , 12 | ☺,☺ 13 | ",","," 14 | -------------------------------------------------------------------------------- /dhall-csv/tasty/data/dhall-to-csv/escaped_characters.dhall: -------------------------------------------------------------------------------- 1 | [ { escapedText1 = "\n" , escapedText2 = "\n" } 2 | , { escapedText1 = "\\" , escapedText2 = "\\" } 3 | , { escapedText1 = "\"" , escapedText2 = "\"" } 4 | , { escapedText1 = "\/" , escapedText2 = "\/" } 5 | , { escapedText1 = "\$" , escapedText2 = "\$" } 6 | , { escapedText1 = "\b" , escapedText2 = "\b" } 7 | , { escapedText1 = "\f" , escapedText2 = "\f" } 8 | , { escapedText1 = "\t" , escapedText2 = "\t" } 9 | , { escapedText1 = "\u263A" , escapedText2 = "\u263A" } 10 | , { escapedText1 = "," , escapedText2 = "," } 11 | ] 12 | -------------------------------------------------------------------------------- /dhall-csv/tasty/data/dhall-to-csv/integers_test.csv: -------------------------------------------------------------------------------- 1 | someInteger 2 | 1 3 | -1 4 | 0 5 | 0 6 | 10000000000 7 | -10000000000 8 | -------------------------------------------------------------------------------- /dhall-csv/tasty/data/dhall-to-csv/integers_test.dhall: -------------------------------------------------------------------------------- 1 | [ {someInteger = +1} 2 | , {someInteger = -1} 3 | , {someInteger = +0} 4 | , {someInteger = -0} 5 | , {someInteger = +10000000000} 6 | , {someInteger = -10000000000} 7 | ] 8 | -------------------------------------------------------------------------------- /dhall-csv/tasty/data/dhall-to-csv/naturals_test.csv: -------------------------------------------------------------------------------- 1 | someNatural 2 | 42 3 | -------------------------------------------------------------------------------- /dhall-csv/tasty/data/dhall-to-csv/naturals_test.dhall: -------------------------------------------------------------------------------- 1 | [{someNatural = 42}] 2 | -------------------------------------------------------------------------------- /dhall-csv/tasty/data/dhall-to-csv/optionals_test.csv: -------------------------------------------------------------------------------- 1 | optDouble,optInteger,optNatural,optText 2 | 2.68,-1,1,Hello World! 3 | ,,, 4 | 1.0e-6,,12, 5 | ,-1,,Hello Dhall! 6 | -------------------------------------------------------------------------------- /dhall-csv/tasty/data/dhall-to-csv/optionals_test.dhall: -------------------------------------------------------------------------------- 1 | [ { optNatural = Some 1, optInteger = Some -1, optDouble = Some 2.68, optText = Some "Hello World!" } 2 | , { optNatural = None Natural, optInteger = None Integer, optDouble = None Double, optText = None Text } 3 | , { optNatural = Some 12, optInteger = None Integer, optDouble = Some 1e-6, optText = None Text } 4 | , { optNatural = None Natural, optInteger = Some -1, optDouble = None Double, optText = Some "Hello Dhall!" } 5 | ] 6 | -------------------------------------------------------------------------------- /dhall-csv/tasty/data/dhall-to-csv/text_test.csv: -------------------------------------------------------------------------------- 1 | someText 2 | Hello World! 3 | "Hello, World!" 4 | "Line1 5 | Line2 6 | Line3 7 | " 8 | "The answer to life, the universe, and everything: 42" 9 | Hello Dhall! 10 | -------------------------------------------------------------------------------- /dhall-csv/tasty/data/dhall-to-csv/text_test.dhall: -------------------------------------------------------------------------------- 1 | let multiLineText = '' 2 | Line1 3 | Line2 4 | Line3 5 | '' 6 | let answer = 42 7 | let dhall = "Dhall" 8 | 9 | in 10 | 11 | [ { someText = "Hello World!" } 12 | , { someText = "Hello, World!" } 13 | , { someText = multiLineText } 14 | , { someText = "The answer to life, the universe, and everything: ${Natural/show answer}" } 15 | , { someText = "Hello ${dhall}!" } 16 | ] 17 | -------------------------------------------------------------------------------- /dhall-csv/tasty/data/dhall-to-csv/unions_test.csv: -------------------------------------------------------------------------------- 1 | union1,union2,union3 2 | Option1,42,EmptyAlternative 3 | Option2,true,-1 4 | Option3,3.14,EmptyAlternative 5 | Option1,Hello world,1 6 | -------------------------------------------------------------------------------- /dhall-csv/tasty/data/dhall-to-csv/unions_test.dhall: -------------------------------------------------------------------------------- 1 | let EmptyAlternatives = < Option1 | Option2 | Option3 > 2 | let NonEmptyAlternatives = < NaturalOption : Natural | BoolOption : Bool | DoubleOption : Double | TextOption : Text> 3 | let MixedAlternatives = < EmptyAlternative | NonEmptyAlternative : Integer > 4 | in 5 | [ { union1 = EmptyAlternatives.Option1 6 | , union2 = NonEmptyAlternatives.NaturalOption 42 7 | , union3 = MixedAlternatives.EmptyAlternative 8 | } 9 | , { union1 = EmptyAlternatives.Option2 10 | , union2 = NonEmptyAlternatives.BoolOption True 11 | , union3 = MixedAlternatives.NonEmptyAlternative -1 12 | } 13 | , { union1 = EmptyAlternatives.Option3 14 | , union2 = NonEmptyAlternatives.DoubleOption 3.14 15 | , union3 = MixedAlternatives.EmptyAlternative 16 | } 17 | , { union1 = EmptyAlternatives.Option1 18 | , union2 = NonEmptyAlternatives.TextOption "Hello world" 19 | , union3 = MixedAlternatives.NonEmptyAlternative +1 20 | } 21 | ] 22 | -------------------------------------------------------------------------------- /dhall-csv/tasty/data/no-header-csv-to-dhall/basic_test.csv: -------------------------------------------------------------------------------- 1 | 3.14,42,text 2 | 1.0e-4,4,dummy 3 | NaN,2,test 4 | 0.0,10,dhall 5 | -------------------------------------------------------------------------------- /dhall-csv/tasty/data/no-header-csv-to-dhall/basic_test.dhall: -------------------------------------------------------------------------------- 1 | [ { _1 = 3.14, _2 = 42, _3 = "text" } 2 | , { _1 = 1.0e-4, _2 = 4, _3 = "dummy" } 3 | , { _1 = NaN, _2 = 2, _3 = "test" } 4 | , { _1 = 0.0, _2 = 10, _3 = "dhall" } 5 | ] 6 | -------------------------------------------------------------------------------- /dhall-csv/tasty/data/no-header-csv-to-dhall/basic_test_schema.dhall: -------------------------------------------------------------------------------- 1 | List 2 | { _1 : Double 3 | , _2 : Natural 4 | , _3 : Text 5 | } 6 | -------------------------------------------------------------------------------- /dhall-docs/Setup.hs: -------------------------------------------------------------------------------- 1 | import Distribution.Simple 2 | main = defaultMain 3 | -------------------------------------------------------------------------------- /dhall-docs/default.nix: -------------------------------------------------------------------------------- 1 | (import ../nix/shared.nix {}).possibly-static.dhall-docs 2 | -------------------------------------------------------------------------------- /dhall-docs/dhall-docs/Main.hs: -------------------------------------------------------------------------------- 1 | module Main where 2 | 3 | import qualified Dhall.Docs 4 | 5 | main :: IO () 6 | main = Dhall.Docs.main 7 | -------------------------------------------------------------------------------- /dhall-docs/doctest/Main.hs: -------------------------------------------------------------------------------- 1 | module Main (main) where 2 | 3 | import System.FilePath (()) 4 | 5 | import qualified GHC.IO.Encoding 6 | import qualified System.Directory 7 | import qualified System.Environment 8 | import qualified System.IO 9 | import qualified Test.DocTest 10 | 11 | main :: IO () 12 | main = do 13 | GHC.IO.Encoding.setLocaleEncoding System.IO.utf8 14 | args <- System.Environment.getArgs 15 | pwd <- System.Directory.getCurrentDirectory 16 | prefix <- System.Directory.makeAbsolute pwd 17 | let src = prefix "src" 18 | 19 | Test.DocTest.doctest $ 20 | [ "--fast" 21 | ] <> args <> 22 | [ src 23 | ] 24 | -------------------------------------------------------------------------------- /dhall-docs/shell.nix: -------------------------------------------------------------------------------- 1 | (import ../nix/shared.nix { coverage = false; }).shell-dhall-docs 2 | -------------------------------------------------------------------------------- /dhall-docs/src/Dhall/data/man/dhall-docs.1: -------------------------------------------------------------------------------- 1 | .\" Automatically generated by Pandoc 2.10.1 2 | .\" 3 | .TH "dhall-docs (1)" "" "" "" "" 4 | .hy 5 | .SH NAME 6 | .PP 7 | dhall-docs - Dhall documentation tool 8 | .SH DESCRIPTION 9 | .PP 10 | \f[B]dhall-docs\f[R] is a documentation generator for the Dhall language 11 | .SH SYNOPSIS 12 | .PP 13 | dhall-docs --input DIR 14 | .PP 15 | dhall-docs --input DIR --output-link SYMLINK_DIR 16 | .SH OPTIONS 17 | .TP 18 | \f[B]-h\f[R] \f[B]--help\f[R] 19 | Display help 20 | .TP 21 | \f[B]--input\f[R] 22 | Directory of Dhall package 23 | .TP 24 | \f[B]--output-link\f[R] 25 | Directory for generated documentation, or symlink to directory. 26 | Defaults to \[aq]./docs\[aq] 27 | .TP 28 | \f[B]--package-name\f[R] 29 | Package name; defaults to the input directory if not given. 30 | .TP 31 | \f[B]--ascii\f[R] 32 | Format rendered code using ASCII syntax 33 | .SH BUGS 34 | .PP 35 | Please report any bugs you may come across to 36 | https://github.com/dhall-lang/dhall-haskell/issues. 37 | -------------------------------------------------------------------------------- /dhall-docs/src/Dhall/data/man/dhall-docs.md: -------------------------------------------------------------------------------- 1 | % dhall-docs (1) 2 | 3 | # NAME 4 | 5 | dhall-docs - Dhall documentation tool 6 | 7 | # DESCRIPTION 8 | 9 | **dhall-docs** is a documentation generator for the Dhall language 10 | 11 | # SYNOPSIS 12 | 13 | dhall-docs -\-input DIR 14 | 15 | dhall-docs -\-input DIR -\-output-link SYMLINK\_DIR 16 | 17 | # OPTIONS 18 | 19 | **-h** **-\-help** 20 | : Display help 21 | 22 | **-\-input** 23 | : Directory of Dhall package 24 | 25 | **-\-output-link** 26 | : Directory for generated documentation, or symlink to directory. Defaults to 27 | \'./docs\' 28 | 29 | **-\-package-name** 30 | : Package name; defaults to the input directory if not given. 31 | 32 | **-\-ascii** 33 | : Format rendered code using ASCII syntax 34 | 35 | # BUGS 36 | 37 | Please report any bugs you may come across to 38 | https://github.com/dhall-lang/dhall-haskell/issues. 39 | -------------------------------------------------------------------------------- /dhall-docs/src/Dhall/data/man/gen-manpage.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | pandoc dhall-docs.md -s -t man -o dhall-docs.1 4 | -------------------------------------------------------------------------------- /dhall-docs/tasty/data/comments/empty/Empty.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhall-lang/dhall-haskell/2d8a3970808e205800ea8a007600ebd63cf24662/dhall-docs/tasty/data/comments/empty/Empty.txt -------------------------------------------------------------------------------- /dhall-docs/tasty/data/comments/empty/Mixed.txt: -------------------------------------------------------------------------------- 1 | {- foo -} 2 | -- bar 3 | -------------------------------------------------------------------------------- /dhall-docs/tasty/data/comments/empty/SeveralLines.txt: -------------------------------------------------------------------------------- 1 | -- foo 2 | -- bar 3 | -------------------------------------------------------------------------------- /dhall-docs/tasty/data/comments/empty/SingleBlock.txt: -------------------------------------------------------------------------------- 1 | {- foo -} 2 | -------------------------------------------------------------------------------- /dhall-docs/tasty/data/comments/empty/SingleLine.txt: -------------------------------------------------------------------------------- 1 | -- foo 2 | -------------------------------------------------------------------------------- /dhall-docs/tasty/data/comments/invalid/MissingNewLineBlock.txt: -------------------------------------------------------------------------------- 1 | {-| a new line needs to be here -} 2 | -------------------------------------------------------------------------------- /dhall-docs/tasty/data/comments/invalid/SingleLinesBadAligned.txt: -------------------------------------------------------------------------------- 1 | --| foo 2 | -- bar 3 | -- baz 4 | -------------------------------------------------------------------------------- /dhall-docs/tasty/data/comments/invalid/TwoValidBlocks.txt: -------------------------------------------------------------------------------- 1 | {-| 2 | foo -} 3 | {-| 4 | foo -} 5 | -------------------------------------------------------------------------------- /dhall-docs/tasty/data/comments/invalid/TwoValidMixed.txt: -------------------------------------------------------------------------------- 1 | {-| 2 | foo -} 3 | --| bla 4 | -- qux 5 | -------------------------------------------------------------------------------- /dhall-docs/tasty/data/comments/invalid/TwoValidSingleLines.txt: -------------------------------------------------------------------------------- 1 | --| bla 2 | -- qux 3 | 4 | --| error here 5 | -- foo 6 | -------------------------------------------------------------------------------- /dhall-docs/tasty/data/comments/valid/BlockA.txt: -------------------------------------------------------------------------------- 1 | {-| 2 | foo 3 | -} 4 | -------------------------------------------------------------------------------- /dhall-docs/tasty/data/comments/valid/BlockB.txt: -------------------------------------------------------------------------------- 1 | foo 2 | -------------------------------------------------------------------------------- /dhall-docs/tasty/data/comments/valid/BlockWithEmptyLinesIgnoredA.txt: -------------------------------------------------------------------------------- 1 | {-| 2 | foo 3 | 4 | bar 5 | -} 6 | -------------------------------------------------------------------------------- /dhall-docs/tasty/data/comments/valid/BlockWithEmptyLinesIgnoredB.txt: -------------------------------------------------------------------------------- 1 | foo 2 | 3 | bar 4 | -------------------------------------------------------------------------------- /dhall-docs/tasty/data/comments/valid/BlockWithIndentationA.txt: -------------------------------------------------------------------------------- 1 | {-| 2 | foo 3 | bar 4 | -} 5 | -------------------------------------------------------------------------------- /dhall-docs/tasty/data/comments/valid/BlockWithIndentationB.txt: -------------------------------------------------------------------------------- 1 | foo 2 | bar 3 | -------------------------------------------------------------------------------- /dhall-docs/tasty/data/comments/valid/BlockWithOtherCommentsA.txt: -------------------------------------------------------------------------------- 1 | -- qux 2 | {-| 3 | foo 4 | -} 5 | {- bar -} 6 | -------------------------------------------------------------------------------- /dhall-docs/tasty/data/comments/valid/BlockWithOtherCommentsB.txt: -------------------------------------------------------------------------------- 1 | foo 2 | -------------------------------------------------------------------------------- /dhall-docs/tasty/data/comments/valid/BlockWithWhitespaceLinesA.txt: -------------------------------------------------------------------------------- 1 | {-| 2 | foo 3 | 4 | bar 5 | -} 6 | -------------------------------------------------------------------------------- /dhall-docs/tasty/data/comments/valid/BlockWithWhitespaceLinesB.txt: -------------------------------------------------------------------------------- 1 | foo 2 | 3 | bar 4 | -------------------------------------------------------------------------------- /dhall-docs/tasty/data/comments/valid/SingleLInesWithIndentationA.txt: -------------------------------------------------------------------------------- 1 | --| first line 2 | -- indented with 4 spaces 3 | -- third line 4 | -------------------------------------------------------------------------------- /dhall-docs/tasty/data/comments/valid/SingleLInesWithIndentationB.txt: -------------------------------------------------------------------------------- 1 | first line 2 | indented with 4 spaces 3 | third line 4 | -------------------------------------------------------------------------------- /dhall-docs/tasty/data/comments/valid/SingleLineWithOtherCommentsA.txt: -------------------------------------------------------------------------------- 1 | -- bla 2 | 3 | --| recovered 4 | -- text 5 | {- 6 | foo-} 7 | {- bar -} 8 | -------------------------------------------------------------------------------- /dhall-docs/tasty/data/comments/valid/SingleLineWithOtherCommentsB.txt: -------------------------------------------------------------------------------- 1 | recovered 2 | text 3 | -------------------------------------------------------------------------------- /dhall-docs/tasty/data/comments/valid/SingleLineWithPrefixWhitespaceA.txt: -------------------------------------------------------------------------------- 1 | --| foo 2 | -- bar 3 | -------------------------------------------------------------------------------- /dhall-docs/tasty/data/comments/valid/SingleLineWithPrefixWhitespaceB.txt: -------------------------------------------------------------------------------- 1 | foo 2 | bar 3 | -------------------------------------------------------------------------------- /dhall-docs/tasty/data/comments/valid/SingleLinesA.txt: -------------------------------------------------------------------------------- 1 | --| first line 2 | -- second line 3 | -- third line 4 | -------------------------------------------------------------------------------- /dhall-docs/tasty/data/comments/valid/SingleLinesB.txt: -------------------------------------------------------------------------------- 1 | first line 2 | second line 3 | third line 4 | -------------------------------------------------------------------------------- /dhall-docs/tasty/data/comments/valid/SingleLinesEmptyLineA.txt: -------------------------------------------------------------------------------- 1 | --| foo 2 | -- 3 | -- bar 4 | -------------------------------------------------------------------------------- /dhall-docs/tasty/data/comments/valid/SingleLinesEmptyLineB.txt: -------------------------------------------------------------------------------- 1 | foo 2 | 3 | bar 4 | -------------------------------------------------------------------------------- /dhall-docs/tasty/data/comments/valid/SingleLinesEmptyLineWithoutCommentA.txt: -------------------------------------------------------------------------------- 1 | --| foo 2 | -- bar 3 | 4 | -- baz 5 | -------------------------------------------------------------------------------- /dhall-docs/tasty/data/comments/valid/SingleLinesEmptyLineWithoutCommentB.txt: -------------------------------------------------------------------------------- 1 | foo 2 | bar 3 | -------------------------------------------------------------------------------- /dhall-docs/tasty/data/comments/valid/SingleLinesIgnoreLInesBeforeMarkerA.txt: -------------------------------------------------------------------------------- 1 | -- ignored 2 | -- ignored 3 | -- ignored 4 | --| foo 5 | -- bar 6 | -------------------------------------------------------------------------------- /dhall-docs/tasty/data/comments/valid/SingleLinesIgnoreLInesBeforeMarkerB.txt: -------------------------------------------------------------------------------- 1 | foo 2 | bar 3 | -------------------------------------------------------------------------------- /dhall-docs/tasty/data/package/AsText.dhall: -------------------------------------------------------------------------------- 1 | ./Plain.txt as Text 2 | -------------------------------------------------------------------------------- /dhall-docs/tasty/data/package/ImportAsType.dhall: -------------------------------------------------------------------------------- 1 | {-| 2 | This example will show the link on the rendered source code _and_ on the index 3 | list 4 | -} 5 | {=} : ./MarkdownExample.dhall 6 | -------------------------------------------------------------------------------- /dhall-docs/tasty/data/package/InvalidBlockComment.dhall: -------------------------------------------------------------------------------- 1 | {-| This example should throw a warning since after the `|` marker of the opening brace 2 | there *must* be a newline (either \n or \r\n) -} 3 | {-| 4 | bar -} 5 | {=} 6 | -------------------------------------------------------------------------------- /dhall-docs/tasty/data/package/InvalidConsecutiveComments.dhall: -------------------------------------------------------------------------------- 1 | {-| 2 | This example should fail since two or more valid dhall-docs comment on the 3 | same section -} 4 | {-| 5 | bar -} 6 | {=} 7 | -------------------------------------------------------------------------------- /dhall-docs/tasty/data/package/InvalidMarkdown.dhall: -------------------------------------------------------------------------------- 1 | --| This file contains a markdown error right here ` 2 | -- did you notice it? 3 | 4 | let Pair = ./Pair.dhall 5 | 6 | let DeliveryStatus = 7 | < Sent: Pair Natural Text {-| Message has been _sent_. It carries a ./Pair.dhall reference 8 | containing on the `first` field number of retries 9 | and on the `second` field the delivered text 10 | -} 11 | | InProgress -- | Message is on the way! 12 | | InQueue -- | Delivery for this message **hasn't** started 13 | > 14 | 15 | in DeliveryStatus 16 | -------------------------------------------------------------------------------- /dhall-docs/tasty/data/package/InvalidMarkdownFile.md: -------------------------------------------------------------------------------- 1 | This file is not valid [Markdown](aaa 2 | -------------------------------------------------------------------------------- /dhall-docs/tasty/data/package/InvalidUnicode.dhall: -------------------------------------------------------------------------------- 1 | {- This file contains invalid unicode, it shouldn't be present on the generated 2 | documentation -} 3 | �� 4 | -------------------------------------------------------------------------------- /dhall-docs/tasty/data/package/JumpToDefOnUnused.dhall: -------------------------------------------------------------------------------- 1 | {-| 2 | `dhall-docs` will detect some names (record fields, let-bindings and lam-bindings) 3 | are unused and therefore won't be highlighted 4 | -} 5 | 6 | let unused = 1 7 | let used = 3 8 | 9 | let unusedRecord = { foo = 1 } 10 | let usedRecord = { foo = 1 } 11 | 12 | let f = 13 | \(unused : Bool) 14 | -> \(used : Natural) 15 | -> \(r : { unused : Text, used : Natural}) -> used + r.used 16 | 17 | in used + usedRecord.foo + f True 1 { unused = "foo", used = 3 } 18 | -------------------------------------------------------------------------------- /dhall-docs/tasty/data/package/JumpToHereImports.dhall: -------------------------------------------------------------------------------- 1 | let relatives = 2 | [ ./IndexesExample.dhall 3 | , ./MarkdownExample.dhall 4 | , ./NoDoc.dhall 5 | ] 6 | 7 | let moreRelatives = 8 | [ ./OrdinaryAnnotation.dhall , ./TwoAnnotations.dhall ] 9 | 10 | in relatives # moreRelatives 11 | -------------------------------------------------------------------------------- /dhall-docs/tasty/data/package/JumpToLamBindingComplex.dhall: -------------------------------------------------------------------------------- 1 | {-| 2 | A complex example of jump-to-definition on let-bindings 3 | -} 4 | let fun = 5 | λ(a : Text) -> 6 | λ(b : Text) -> 7 | λ(c : Text) -> 8 | λ(d : Text) -> 9 | [ a ++ b, b ++ c, c ++ d, d ++ a ] 10 | 11 | in fun 12 | -------------------------------------------------------------------------------- /dhall-docs/tasty/data/package/JumpToLamBindingSimple.dhall: -------------------------------------------------------------------------------- 1 | {-| 2 | This examples shows a demo of jumping to a let-binding definition. If you hover 3 | the `a` paramter, the front-end will highlight all of its usages and if you 4 | click it you will navigate to its definition. 5 | 6 | The amount of empty lines left are intentional to show you how the browser jumps 7 | to the declaration of a 8 | -} 9 | let fun = \(v : Text) -> 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | v 64 | 65 | 66 | 67 | in fun 68 | -------------------------------------------------------------------------------- /dhall-docs/tasty/data/package/JumpToLamBindingWithIndex.dhall: -------------------------------------------------------------------------------- 1 | {-| 2 | On this example, we introduce the `a` variable in the two parameters of the 3 | `fun` function and the jump-to-definition engine correctly highlights the usage 4 | when indexes are used 5 | -} 6 | let fun = 7 | λ(a : Text) -> 8 | λ(a : Text) -> 9 | [ a@1 ++ a@0 ] 10 | 11 | let example0 = assert : fun "a" "b" === ["ab"] 12 | 13 | in fun 14 | 15 | -------------------------------------------------------------------------------- /dhall-docs/tasty/data/package/JumpToLamBindingWithQuotes.dhall: -------------------------------------------------------------------------------- 1 | {-| 2 | This tests shows that the feature works for quoted vars on function parameters 3 | as well 4 | -} 5 | let fun = 6 | λ(`param 1` : Text) -> 7 | λ(`param 2` : Text) -> 8 | [ `param 1` ++ `param 2` ] 9 | 10 | let example0 = assert : fun "a" "b" === ["ab"] 11 | 12 | in fun 13 | 14 | -------------------------------------------------------------------------------- /dhall-docs/tasty/data/package/JumpToLamBindingWithShadowing.dhall: -------------------------------------------------------------------------------- 1 | {-| 2 | On this example, the first parameter `a` is shadowed with the second declaration. 3 | The jump-to-definintion on the usage of `a` should not highlight the first declaration, 4 | and interacting with the first declaration should not change the others 5 | -} 6 | let fun = 7 | λ(a : Text) -> 8 | λ(a : Text) -> 9 | [ a ++ a ] 10 | 11 | let example0 = assert : fun "a" "b" === ["bb"] 12 | 13 | in fun 14 | 15 | -------------------------------------------------------------------------------- /dhall-docs/tasty/data/package/JumpToLetBindingSimple.dhall: -------------------------------------------------------------------------------- 1 | {-| 2 | This examples shows a demo of jumping to a let-binding definition. If you hover 3 | the `a` variable, the front-end will highlight all of its usages and if you 4 | click it you will navigate to its definition. 5 | 6 | The amount of empty lines left are intentional to show you how the browser jumps 7 | to the declaration of a 8 | -} 9 | let a = 1 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | in 51 | 52 | a 53 | -------------------------------------------------------------------------------- /dhall-docs/tasty/data/package/JumpToLetBindingWithIndex.dhall: -------------------------------------------------------------------------------- 1 | {-| 2 | Although we have a similar example on this [file](./RenderTypeIndexesExample.dhall), 3 | this example showcases the jump-to-definition feature when indexes are used. 4 | -} 5 | let a = 1 6 | 7 | let a = 2 8 | 9 | in a@1 10 | -------------------------------------------------------------------------------- /dhall-docs/tasty/data/package/JumpToLetBindingWithQuotes.dhall: -------------------------------------------------------------------------------- 1 | {-| 2 | This test cases shows that the feature works with quoted variables 3 | -} 4 | let `quoted variable` = 1 5 | 6 | let nonQuoted = 2 7 | 8 | in `quoted variable` + `nonQuoted` 9 | -------------------------------------------------------------------------------- /dhall-docs/tasty/data/package/JumpToLetBindingWithShadowing.dhall: -------------------------------------------------------------------------------- 1 | {-| 2 | On this example, the first declaration of variable `a` is shadowed with the 3 | later declaration. The jump-to-definintion on the usage of `a` 4 | should not highlight the first declaration, and interacting with the first 5 | declaration should not change the others 6 | -} 7 | let a = 1 8 | 9 | let a = 2 10 | 11 | in a 12 | -------------------------------------------------------------------------------- /dhall-docs/tasty/data/package/JumpToLetbindingComplex.dhall: -------------------------------------------------------------------------------- 1 | {-| 2 | A complex example of jump-to-definition on let-bindings 3 | -} 4 | let f = \(f : Natural) -> 5 | let a = 1 in f + a 6 | 7 | let a = f 1 8 | 9 | let b = a + f 3 10 | 11 | in b 12 | -------------------------------------------------------------------------------- /dhall-docs/tasty/data/package/JumpToRecordFieldWhenFieldDoesNotExist.dhall: -------------------------------------------------------------------------------- 1 | {-| 2 | On this example, `dhall-docs` will detect that the variable `a` and `b` is of 3 | record-type. If on a selector-expression the field is not found on the type, 4 | no-link will be created 5 | 6 | -} 7 | let a = { x = "foo" } 8 | let b = False 9 | 10 | in a.y + b.`does not exist` 11 | -------------------------------------------------------------------------------- /dhall-docs/tasty/data/package/JumpToRecordFieldWhenLetAnnotationPresentShouldIgnoreAnnotation.dhall: -------------------------------------------------------------------------------- 1 | {-| 2 | On this example, `dhall-docs` will detect that the variable `a` is annotated 3 | with a type, but it will ignore it anyways. On let-bindings, `dhall-docs` infers 4 | the type of the variable from the bounded expression. As a consequence, on 5 | this example, hovering the `x` on the selector-expression will highlight the 6 | `x` label on the record-literal 7 | -} 8 | let a : Bool = { x = "foo" } 9 | 10 | in a.x 11 | -------------------------------------------------------------------------------- /dhall-docs/tasty/data/package/JumpToRecordFieldWhenVarIsAnnotatedWithRecordType.dhall: -------------------------------------------------------------------------------- 1 | {-| 2 | On this example, even when the variable `a` is annotated with a record-type, 3 | `dhall-docs` will infer the actual type from the bounded value. 4 | 5 | All interactions with fields on selector-expressions won't affect the rendered-type. 6 | 7 | (The example is intended to not type-check as a Dhall expression) 8 | -} 9 | let a : { x : Text } = { x = "foo", y = "bar" } 10 | 11 | in a.x ++ a.y 12 | -------------------------------------------------------------------------------- /dhall-docs/tasty/data/package/JumpToRecordFieldWhenVarIsOfRecordType.dhall: -------------------------------------------------------------------------------- 1 | {-| 2 | On this example, `dhall-docs` will detect that the variable `a` is bounded 3 | to a record-literal. When the user clicks on the `field` in the `a.field`, it 4 | will jump to the definition of that field in the source code i.e. to the `field` 5 | key in the record literal 6 | -} 7 | let a = { field = "foo" } 8 | 9 | in Text/show a.field 10 | -------------------------------------------------------------------------------- /dhall-docs/tasty/data/package/JumpToRecordFieldWhenVarIsOfRecordTypeComplex.dhall: -------------------------------------------------------------------------------- 1 | {-| 2 | A complex example of the jump-to-definition feature on record literals. 3 | -} 4 | let a = 5 | { foo = "bar", number = +1 } 6 | 7 | let b = 8 | { foo = "bar", number = +1 } 9 | 10 | in a.foo ++ Integer/show a.number ++ b.foo ++ Integer/show b.number 11 | -------------------------------------------------------------------------------- /dhall-docs/tasty/data/package/JumpToRecordFieldWhenVarIsOfRecordTypeDeep.dhall: -------------------------------------------------------------------------------- 1 | {-| 2 | On this example, `dhall-docs` will detect that the variable `a` is bounded 3 | to a record literal. It will also detect that the `field` key from the record 4 | literal is another record literal. When the user clicks `deep` from the 5 | `a.field.deep`, it will jump to the definition of that variable in the source 6 | code. 7 | -} 8 | let a = { field = { deep = "bar" } } 9 | 10 | in Text/show a.field.deep 11 | -------------------------------------------------------------------------------- /dhall-docs/tasty/data/package/JumpToRecordFieldWhenVarIsOfRecordTypeFromLamBinding.dhall: -------------------------------------------------------------------------------- 1 | {-| 2 | On this example, `dhall-docs` will detect that the argument `a` of the only 3 | function in this file is of record type. Therefore, any interactions on selector 4 | expressions over the `a` variable will interact with the fields on the record-type. 5 | 6 | Note that the treatment for `Lam` variables is different from `Let` bindings: 7 | the annotation doesn't affect on the later case. This can be seen in the 8 | [test case for let bindings](./JumpToRecordFieldWhenLetAnnotationPresentShouldIgnoreAnnotation.dhall) 9 | -} 10 | 11 | λ(b : Type) → 12 | λ(c : Type) → 13 | λ(a : { list : List b, cons : b → c → c, nil : c }) → 14 | List/fold b a.list c a.cons a.nil 15 | -------------------------------------------------------------------------------- /dhall-docs/tasty/data/package/JumpToRecordFieldWhenVarIsOfRecordTypeOnPunnedEntry.dhall: -------------------------------------------------------------------------------- 1 | {-| 2 | On this example, `dhall-docs` will detect that the variable `a` is bounded 3 | to a record literal. It will also be aware that that the attribute `x`. When 4 | the user clicks the `x` from `a.x`, it will jump to the `x` punned-entry 5 | -} 6 | let x = 1 7 | let a = { x } 8 | 9 | in a.x 10 | -------------------------------------------------------------------------------- /dhall-docs/tasty/data/package/JumpToRecordFieldWhenVarIsOfRecordTypeTransitivity.dhall: -------------------------------------------------------------------------------- 1 | {-| 2 | On this example, `dhall-docs` will detect that the variable `b` is bounded 3 | to the value of `a`, and the later is bounded to a record-literal. All selector 4 | expressions over `b` will interact with the record-literal assigned to `a`, since 5 | that is the actual definition of the fields. 6 | -} 7 | let a = { x = 1 } 8 | let b = a 9 | 10 | in a.x + b.x 11 | -------------------------------------------------------------------------------- /dhall-docs/tasty/data/package/JumpToRecordFieldWhenVarIsOfRecordTypeWithDotSyntax.dhall: -------------------------------------------------------------------------------- 1 | {-| 2 | On this example, `dhall-docs` will detect that the variable `a` is bounded 3 | to a record literal and it will be aware that it uses dot-syntax. 4 | 5 | When the user clicks `x` from `a.x`, it will jump to the `x` on the record-literal. 6 | The same applies for each other field. 7 | -} 8 | let a = { x.y.z = 1 } 9 | 10 | let ax = a.x 11 | let axy = a.x.y 12 | let axyz = a.x.y.z 13 | 14 | in ax.y.z + axy.z + axyz 15 | -------------------------------------------------------------------------------- /dhall-docs/tasty/data/package/JumpToSelf.dhall: -------------------------------------------------------------------------------- 1 | {-| 2 | Althtough Dhall forbids cyclic imports, `dhall-docs` can handle them properly 3 | -} 4 | let selfs = 5 | [ ./JumpToSelf.dhall 6 | , ../package/JumpToSelf.dhall ] 7 | in selfs 8 | -------------------------------------------------------------------------------- /dhall-docs/tasty/data/package/JumpToUrls.dhall: -------------------------------------------------------------------------------- 1 | {-| 2 | Example taken from [dhall documentation](https://docs.dhall-lang.org/tutorials/Language-Tour.html#prelude) 3 | -} 4 | 5 | 6 | let List/generate = https://prelude.dhall-lang.org/v15.0.0/List/generate 7 | 8 | in List/generate 10 Text (\(n : Natural) -> "Result #${Natural/show n}") 9 | 10 | -------------------------------------------------------------------------------- /dhall-docs/tasty/data/package/MarkdownExample.dhall: -------------------------------------------------------------------------------- 1 | {-| 2 | # Heading 1 3 | 4 | ## Heading 2 5 | 6 | ### Heading 3 7 | 8 | #### Heading 4 9 | 10 | ##### Heading 5 11 | 12 | ###### Heading 6 13 | 14 | Message data type for our _messaging-system_ config. 15 | 16 | It is similar to the `kafka` message dto. 17 | testing again another random text. 18 | 19 | **NOTE**: This is really important to know 20 | 21 | This allows you to: 22 | 23 | * Send messages 24 | * Receive messages, knowing that: 25 | - nothing works (?) 26 | - weird huh 27 | 28 | As somebody said, 29 | 30 | > The best way to code is to not code 31 | 32 | Here I show you some haskell code 33 | 34 | ```haskell 35 | main = putStrLn "dhall rulez" 36 | ``` 37 | -} 38 | { remitent: Text --| Remitent name 39 | , deliveryStatus: ./DeliveryStatus.dhall --| Status 40 | , body: Text --| Message body 41 | } 42 | -------------------------------------------------------------------------------- /dhall-docs/tasty/data/package/MarkdownFile.md: -------------------------------------------------------------------------------- 1 | # Title 2 | 3 | This is a *Markdown* file. 4 | 5 | |A very | nice | table| 6 | |---|---|---| 7 | |1|2|3| 8 | |4|5|6| 9 | 10 | -------------------------------------------------------------------------------- /dhall-docs/tasty/data/package/MultilineIndentationExample.dhall: -------------------------------------------------------------------------------- 1 | {-| 2 | Non indented text should remain as-is 3 | 4 | indented code block 5 | 6 | * item 1 7 | - item 2 8 | -} 9 | {=} : {} 10 | -------------------------------------------------------------------------------- /dhall-docs/tasty/data/package/NoDoc.dhall: -------------------------------------------------------------------------------- 1 | {=} 2 | -------------------------------------------------------------------------------- /dhall-docs/tasty/data/package/NonDhallDocsCommentAfterValid.dhall: -------------------------------------------------------------------------------- 1 | {-| 2 | This example shows that you can place non-dhall comments after a _valid_ 3 | dhall comment -} 4 | {- 5 | bar -} 6 | -- qux 7 | {=} 8 | -------------------------------------------------------------------------------- /dhall-docs/tasty/data/package/OrdinaryAnnotation.dhall: -------------------------------------------------------------------------------- 1 | {-| 2 | This file contains a Dhall expression with just a type annotation, which 3 | should be selected as the expression's type 4 | -} 5 | 1 : Natural 6 | -------------------------------------------------------------------------------- /dhall-docs/tasty/data/package/Pair.dhall: -------------------------------------------------------------------------------- 1 | 2 | {-| 3 | Just a *Pair* right here 4 | -} 5 | 6 | let Pair 7 | : forall(A: Type) -- | Type of first position 8 | -> forall(B: Type) -- | Type of second position 9 | -> Type 10 | = λ(A: Type) -> λ(B: Type) -> {first: A, second: B} 11 | 12 | in Pair 13 | -------------------------------------------------------------------------------- /dhall-docs/tasty/data/package/Plain.txt: -------------------------------------------------------------------------------- 1 | A plain text file that is imported `as Text` by `./AsText.dhall` 2 | -------------------------------------------------------------------------------- /dhall-docs/tasty/data/package/RenderTypeIndexesExample.dhall: -------------------------------------------------------------------------------- 1 | {-| 2 | This example shows that `dhall-docs` will find render the correct type on the 3 | index respecting variable indices 4 | -} 5 | 6 | let x : Bool = True 7 | let x : Natural = 1 8 | 9 | in x@1 10 | -------------------------------------------------------------------------------- /dhall-docs/tasty/data/package/ShouldBeIgnored.dhall: -------------------------------------------------------------------------------- 1 | {- 2 | Should be ignored since it's syntactically invalid 3 | -} 4 | { 5 | -------------------------------------------------------------------------------- /dhall-docs/tasty/data/package/StandaloneTextFile.txt: -------------------------------------------------------------------------------- 1 | This is a text file that is not referenced by any dhall file. 2 | 3 | +---------------------------------------------------+ 4 | | It should be displayed as
preformatted
| 5 | | text, with horizontal and vertical whitespace | 6 | | preserved, to keep it readable. | 7 | +---------------------------------------------------+ 8 | -------------------------------------------------------------------------------- /dhall-docs/tasty/data/package/TwoAnnotations.dhall: -------------------------------------------------------------------------------- 1 | {-| 2 | This expression contains type annotations on both the `let` binding and on the 3 | body of the `let` expression. The documentation generator prefers to use the 4 | latter annotation. 5 | -} 6 | let x = 1 7 | 8 | let y = Natural 9 | 10 | in x : y 11 | -------------------------------------------------------------------------------- /dhall-docs/tasty/data/package/a/JumpToParent.dhall: -------------------------------------------------------------------------------- 1 | let parents = 2 | [ ../IndexesExample.dhall 3 | ] 4 | 5 | in parents 6 | -------------------------------------------------------------------------------- /dhall-docs/tasty/data/package/a/b.dhall: -------------------------------------------------------------------------------- 1 | {- 2 | Hi there boys 3 | -} 4 | 5 | let b = 1 in b 6 | -------------------------------------------------------------------------------- /dhall-docs/tasty/data/package/a/b/JumpToGrandfather.dhall: -------------------------------------------------------------------------------- 1 | let parents = 2 | [ ../../IndexesExample.dhall 3 | ] 4 | 5 | in parents 6 | -------------------------------------------------------------------------------- /dhall-docs/tasty/data/package/a/b/c.dhall: -------------------------------------------------------------------------------- 1 | {- 2 | Hi there boys 3 | -} 4 | 5 | let c = 1 in c 6 | -------------------------------------------------------------------------------- /dhall-docs/tasty/data/package/a/b/c/a.dhall: -------------------------------------------------------------------------------- 1 | {- 2 | Hi there boys 3 | -} 4 | 5 | let a = 1 in a 6 | -------------------------------------------------------------------------------- /dhall-docs/tasty/data/package/deep/nested/folder/my-even.dhall: -------------------------------------------------------------------------------- 1 | {- 2 | Check if a natural is even or not returning an union data-type 3 | -} 4 | let my-even 5 | : Natural → < even | odd > 6 | = λ(n : Natural) → 7 | if Natural/even n then < even | odd>.even else < even | odd >.odd 8 | 9 | let example0 = assert : my-even 1 === .odd 10 | let example0 = assert : my-even 2 === .even 11 | 12 | in my-even 13 | -------------------------------------------------------------------------------- /dhall-docs/tasty/data/package/package.dhall: -------------------------------------------------------------------------------- 1 | {-| 2 | This is your package entrypoint documentation 3 | -} 4 | { Message = ./Message.dhall 5 | , DeliveryStatus = ./DeliveryStatus.dhall 6 | , Pair = ./Pair.dhall 7 | } 8 | -------------------------------------------------------------------------------- /dhall-json/.gitignore: -------------------------------------------------------------------------------- 1 | dist 2 | dist-* 3 | .stack-work/ 4 | -------------------------------------------------------------------------------- /dhall-json/Setup.hs: -------------------------------------------------------------------------------- 1 | import Distribution.Simple 2 | main = defaultMain 3 | -------------------------------------------------------------------------------- /dhall-json/default.nix: -------------------------------------------------------------------------------- 1 | (import ../nix/shared.nix {}).possibly-static.dhall-json 2 | -------------------------------------------------------------------------------- /dhall-json/dhall-to-yaml/Main.hs: -------------------------------------------------------------------------------- 1 | module Main where 2 | 3 | import qualified Dhall.DhallToYaml.Main 4 | import qualified Dhall.JSON.Yaml 5 | import qualified Paths_dhall_json as Meta 6 | 7 | main :: IO () 8 | main = Dhall.DhallToYaml.Main.main Meta.version Dhall.JSON.Yaml.dhallToYaml 9 | -------------------------------------------------------------------------------- /dhall-json/examples/bower.dhall: -------------------------------------------------------------------------------- 1 | -- Using this file: 2 | -- json-to-dhall ./bower.dhall < ./bower.json | dhall 3 | -- yaml-to-dhall ./bower.dhall < ./bower.yaml | dhall 4 | -- 5 | -- Round-trip test: 6 | -- json-to-dhall ./bower.dhall < ./bower.json | dhall | dhall-to-json 7 | -- yaml-to-dhall ./bower.dhall < ./bower.yaml | dhall | dhall-to-yaml 8 | 9 | { name : Text 10 | , description : Text 11 | , license : Text 12 | , keywords : List Text 13 | , repository : { type : Text, url : Text} 14 | , dependencies : List { mapKey: Text, mapValue: Text } 15 | , devDependencies : List { mapKey: Text, mapValue: Text } 16 | } 17 | -------------------------------------------------------------------------------- /dhall-json/examples/bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "purescript-package", 3 | "description": "A simple PS package", 4 | "keywords": [ 5 | "purescript" 6 | ], 7 | "license": "MIT", 8 | "repository": { 9 | "type": "git", 10 | "url": "git://github.com/purescript/purescript-package.git" 11 | }, 12 | "dependencies": { 13 | "purescript-prelude": "^4.0.0", 14 | "purescript-effect": "^2.0.0" 15 | }, 16 | "devDependencies": { 17 | "purescript-math": "^2.1.1", 18 | "purescript-integers": "^4.0.0" 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /dhall-json/examples/bower.yaml: -------------------------------------------------------------------------------- 1 | name: purescript-package 2 | description: A simple PS package 3 | keywords: 4 | - purescript 5 | license: MIT 6 | repository: 7 | type: git 8 | url: git://github.com/purescript/purescript-package.git 9 | dependencies: 10 | purescript-prelude: ^4.0.0 11 | purescript-effect: ^2.0.0 12 | devDependencies: 13 | purescript-math: ^2.1.1 14 | purescript-integers: ^4.0.0 15 | -------------------------------------------------------------------------------- /dhall-json/shell.nix: -------------------------------------------------------------------------------- 1 | (import ../nix/shared.nix {}).shell-dhall-json 2 | -------------------------------------------------------------------------------- /dhall-json/src/Dhall/JSON/Util.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE OverloadedStrings #-} 2 | {-# LANGUAGE PatternSynonyms #-} 3 | 4 | module Dhall.JSON.Util 5 | ( pattern V 6 | , pattern FA 7 | ) where 8 | 9 | import Data.Text (Text) 10 | import Dhall.Core (Expr, FieldSelection) 11 | 12 | import qualified Dhall.Core as Core 13 | 14 | pattern V :: Int -> Expr s a 15 | pattern V n = Core.Var (Core.V "_" n) 16 | 17 | pattern FA :: Text -> FieldSelection s 18 | pattern FA t <- Core.FieldSelection _ t _ 19 | where FA = Core.makeFieldSelection 20 | -------------------------------------------------------------------------------- /dhall-json/tasty/data/emptyAlternative.dhall: -------------------------------------------------------------------------------- 1 | < Bar | Foo >.Foo 2 | -------------------------------------------------------------------------------- /dhall-json/tasty/data/emptyAlternative.json: -------------------------------------------------------------------------------- 1 | "Foo" 2 | -------------------------------------------------------------------------------- /dhall-json/tasty/data/emptyAlternativeSchema.dhall: -------------------------------------------------------------------------------- 1 | < Bar | Foo > 2 | -------------------------------------------------------------------------------- /dhall-json/tasty/data/emptyList.dhall: -------------------------------------------------------------------------------- 1 | λ(JSON : Type) 2 | → λ ( json 3 | : { array : 4 | List JSON → JSON 5 | , bool : 6 | Bool → JSON 7 | , null : 8 | JSON 9 | , number : 10 | Double → JSON 11 | , object : 12 | List { mapKey : Text, mapValue : JSON } → JSON 13 | , string : 14 | Text → JSON 15 | } 16 | ) 17 | → json.array ([] : List JSON) 18 | -------------------------------------------------------------------------------- /dhall-json/tasty/data/emptyList.json: -------------------------------------------------------------------------------- 1 | [] 2 | -------------------------------------------------------------------------------- /dhall-json/tasty/data/emptyListSchema.dhall: -------------------------------------------------------------------------------- 1 | ∀(JSON : Type) 2 | → ∀ ( json 3 | : { array : 4 | List JSON → JSON 5 | , bool : 6 | Bool → JSON 7 | , null : 8 | JSON 9 | , number : 10 | Double → JSON 11 | , object : 12 | List { mapKey : Text, mapValue : JSON } → JSON 13 | , string : 14 | Text → JSON 15 | } 16 | ) 17 | → JSON 18 | -------------------------------------------------------------------------------- /dhall-json/tasty/data/emptyListStrongType.dhall: -------------------------------------------------------------------------------- 1 | [] : List Natural 2 | -------------------------------------------------------------------------------- /dhall-json/tasty/data/emptyListStrongType.json: -------------------------------------------------------------------------------- 1 | [] 2 | -------------------------------------------------------------------------------- /dhall-json/tasty/data/emptyListStrongTypeSchema.dhall: -------------------------------------------------------------------------------- 1 | List Natural 2 | -------------------------------------------------------------------------------- /dhall-json/tasty/data/emptyObject.dhall: -------------------------------------------------------------------------------- 1 | λ(JSON : Type) 2 | → λ ( json 3 | : { array : List JSON → JSON 4 | , bool : Bool → JSON 5 | , null : JSON 6 | , number : Double → JSON 7 | , object : List { mapKey : Text, mapValue : JSON } → JSON 8 | , string : Text → JSON 9 | } 10 | ) 11 | → json.object (toMap {=} : List { mapKey : Text, mapValue : JSON }) 12 | -------------------------------------------------------------------------------- /dhall-json/tasty/data/emptyObject.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /dhall-json/tasty/data/emptyObjectSchema.dhall: -------------------------------------------------------------------------------- 1 | ∀(JSON : Type) 2 | → ∀ ( json 3 | : { array : 4 | List JSON → JSON 5 | , bool : 6 | Bool → JSON 7 | , null : 8 | JSON 9 | , number : 10 | Double → JSON 11 | , object : 12 | List { mapKey : Text, mapValue : JSON } → JSON 13 | , string : 14 | Text → JSON 15 | } 16 | ) 17 | → JSON 18 | -------------------------------------------------------------------------------- /dhall-json/tasty/data/emptyObjectStrongType.dhall: -------------------------------------------------------------------------------- 1 | toMap {=} : List { mapKey : Text, mapValue : Natural } 2 | -------------------------------------------------------------------------------- /dhall-json/tasty/data/emptyObjectStrongType.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /dhall-json/tasty/data/emptyObjectStrongTypeSchema.dhall: -------------------------------------------------------------------------------- 1 | List { mapKey : Text, mapValue : Natural } 2 | -------------------------------------------------------------------------------- /dhall-json/tasty/data/error/mismatchMessage0.golden: -------------------------------------------------------------------------------- 1 |  2 | Error: $.a.b[1]: Dhall type expression and JSON value do not match: 3 | 4 | Expected Dhall type: 5 | Natural 6 | 7 | JSON: 8 | 0.5 9 | -------------------------------------------------------------------------------- /dhall-json/tasty/data/error/mismatchMessage0.json: -------------------------------------------------------------------------------- 1 | { 2 | "a": { 3 | "b": [ 4 | 10, 5 | 0.5 6 | ] 7 | }, 8 | "c": { 9 | "d": [ 10 | 10, 11 | 0.5 12 | ] 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /dhall-json/tasty/data/error/mismatchMessage0Schema.dhall: -------------------------------------------------------------------------------- 1 | { a : { b : List Natural } 2 | , c : { d : List Integer } 3 | } 4 | -------------------------------------------------------------------------------- /dhall-json/tasty/data/error/mismatchMessage1.golden: -------------------------------------------------------------------------------- 1 |  2 | Error: $: Dhall type expression and JSON value do not match: 3 | 4 | Expected Dhall type: 5 | Text 6 | 7 | JSON: 8 | 1 9 | -------------------------------------------------------------------------------- /dhall-json/tasty/data/error/mismatchMessage1.json: -------------------------------------------------------------------------------- 1 | 1 2 | -------------------------------------------------------------------------------- /dhall-json/tasty/data/error/mismatchMessage1Schema.dhall: -------------------------------------------------------------------------------- 1 | Text 2 | -------------------------------------------------------------------------------- /dhall-json/tasty/data/error/mismatchMessage2.golden: -------------------------------------------------------------------------------- 1 |  2 | Error: $[3]: Dhall type expression and JSON value do not match: 3 | 4 | Expected Dhall type: 5 | Natural 6 | 7 | JSON: 8 | "oh oh" 9 | -------------------------------------------------------------------------------- /dhall-json/tasty/data/error/mismatchMessage2.json: -------------------------------------------------------------------------------- 1 | [ 1, 2, 3, "oh oh" ] 2 | -------------------------------------------------------------------------------- /dhall-json/tasty/data/error/mismatchMessage2Schema.dhall: -------------------------------------------------------------------------------- 1 | List Natural 2 | -------------------------------------------------------------------------------- /dhall-json/tasty/data/error/missingKey.golden: -------------------------------------------------------------------------------- 1 |  2 | Error: $.a: Key b, expected by Dhall type: 3 | Bool 4 | is not present in JSON object: 5 | {} 6 | -------------------------------------------------------------------------------- /dhall-json/tasty/data/error/missingKey.json: -------------------------------------------------------------------------------- 1 | { 2 | "a": { 3 | } 4 | } 5 | -------------------------------------------------------------------------------- /dhall-json/tasty/data/error/missingKeySchema.dhall: -------------------------------------------------------------------------------- 1 | { a: { b: Bool } } 2 | -------------------------------------------------------------------------------- /dhall-json/tasty/data/error/unhandledKeys.golden: -------------------------------------------------------------------------------- 1 |  2 | Error: $[1]: Key(s) b present in the JSON object but not in the expected Dhall record type. This is not allowed unless you enable the --records-loose flag: 3 | 4 | Expected Dhall type: 5 | { a : Natural } 6 | 7 | JSON: 8 | { 9 | "b": 2 10 | } 11 | -------------------------------------------------------------------------------- /dhall-json/tasty/data/error/unhandledKeys.json: -------------------------------------------------------------------------------- 1 | [ 2 | { "a": 1 }, 3 | { "b": 2 } 4 | ] 5 | -------------------------------------------------------------------------------- /dhall-json/tasty/data/error/unhandledKeysSchema.dhall: -------------------------------------------------------------------------------- 1 | List { a: Natural } 2 | -------------------------------------------------------------------------------- /dhall-json/tasty/data/fromArbitraryJSON_12_0_0.dhall: -------------------------------------------------------------------------------- 1 | λ(JSON : Type) 2 | → λ ( json 3 | : { array : List JSON → JSON 4 | , bool : Bool → JSON 5 | , null : JSON 6 | , number : Double → JSON 7 | , object : List { mapKey : Text, mapValue : JSON } → JSON 8 | , string : Text → JSON 9 | } 10 | ) 11 | → json.object 12 | ( toMap 13 | { array = json.array ([] : List JSON) 14 | , bool = json.bool False 15 | , null = json.null 16 | , number = json.number 1.0 17 | , string = json.string "ABC" 18 | } 19 | ) 20 | -------------------------------------------------------------------------------- /dhall-json/tasty/data/fromArbitraryJSON_12_0_0.json: -------------------------------------------------------------------------------- 1 | { 2 | "array": [], 3 | "bool": false, 4 | "null": null, 5 | "number": 1, 6 | "string": "ABC" 7 | } 8 | -------------------------------------------------------------------------------- /dhall-json/tasty/data/fromArbitraryJSON_12_0_0Schema.dhall: -------------------------------------------------------------------------------- 1 | ∀(JSON : Type) 2 | → ∀ ( json 3 | : { array : List JSON → JSON 4 | , bool : Bool → JSON 5 | , null : JSON 6 | , number : Double → JSON 7 | , object : List { mapKey : Text, mapValue : JSON } → JSON 8 | , string : Text → JSON 9 | } 10 | ) 11 | → JSON 12 | -------------------------------------------------------------------------------- /dhall-json/tasty/data/fromArbitraryJSON_13_0_0.dhall: -------------------------------------------------------------------------------- 1 | λ(JSON : Type) 2 | → λ ( json 3 | : { array : List JSON → JSON 4 | , bool : Bool → JSON 5 | , double : Double → JSON 6 | , integer : Integer → JSON 7 | , null : JSON 8 | , object : List { mapKey : Text, mapValue : JSON } → JSON 9 | , string : Text → JSON 10 | } 11 | ) 12 | → json.object 13 | ( toMap 14 | { array = json.array ([] : List JSON) 15 | , bool = json.bool False 16 | , double = json.double 1.5 17 | , integer = json.integer +1 18 | , null = json.null 19 | , string = json.string "ABC" 20 | } 21 | ) 22 | -------------------------------------------------------------------------------- /dhall-json/tasty/data/fromArbitraryJSON_13_0_0.json: -------------------------------------------------------------------------------- 1 | { 2 | "array": [], 3 | "bool": false, 4 | "null": null, 5 | "double": 1.5, 6 | "integer": 1, 7 | "string": "ABC" 8 | } 9 | -------------------------------------------------------------------------------- /dhall-json/tasty/data/fromArbitraryJSON_13_0_0Schema.dhall: -------------------------------------------------------------------------------- 1 | ∀(JSON : Type) 2 | → ∀ ( json 3 | : { array : List JSON → JSON 4 | , bool : Bool → JSON 5 | , double : Double → JSON 6 | , integer : Integer → JSON 7 | , null : JSON 8 | , object : List { mapKey : Text, mapValue : JSON } → JSON 9 | , string : Text → JSON 10 | } 11 | ) 12 | → JSON 13 | -------------------------------------------------------------------------------- /dhall-json/tasty/data/issue48.dhall: -------------------------------------------------------------------------------- 1 | [ { mapKey = "somekey", mapValue = [ { mapKey = "\$gt", mapValue = 100 } ] } ] 2 | -------------------------------------------------------------------------------- /dhall-json/tasty/data/issue48.json: -------------------------------------------------------------------------------- 1 | { 2 | "somekey": { 3 | "$gt": 100 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /dhall-json/tasty/data/missingList.dhall: -------------------------------------------------------------------------------- 1 | { missingProp = [] : List Text 2 | , null = [] : List Text 3 | , present = ["some-stuff"] 4 | } 5 | -------------------------------------------------------------------------------- /dhall-json/tasty/data/missingList.json: -------------------------------------------------------------------------------- 1 | {"present": ["some-stuff"], "null": null} 2 | -------------------------------------------------------------------------------- /dhall-json/tasty/data/missingListSchema.dhall: -------------------------------------------------------------------------------- 1 | {present : List Text, null : List Text, missingProp : List Text} 2 | -------------------------------------------------------------------------------- /dhall-json/tasty/data/nesting0.dhall: -------------------------------------------------------------------------------- 1 | let Example = < Left : { foo : Natural } | Right : { bar : Bool } > 2 | 3 | let Nesting = < Inline | Nested : Text > 4 | 5 | in { field = "name" 6 | , nesting = Nesting.Inline 7 | , contents = Example.Left { foo = 2 } 8 | } 9 | -------------------------------------------------------------------------------- /dhall-json/tasty/data/nesting0.json: -------------------------------------------------------------------------------- 1 | { "foo": 2, "name": "Left" } 2 | -------------------------------------------------------------------------------- /dhall-json/tasty/data/nesting1.dhall: -------------------------------------------------------------------------------- 1 | let Example = < Left : { foo : Natural } | Right : { bar : Bool } > 2 | 3 | let Nesting = < Inline | Nested : Text > 4 | 5 | in { field = "name" 6 | , nesting = Nesting.Nested "value" 7 | , contents = Example.Left { foo = 2 } 8 | } 9 | -------------------------------------------------------------------------------- /dhall-json/tasty/data/nesting1.json: -------------------------------------------------------------------------------- 1 | { "name": "Left", "value": { "foo": 2 } } 2 | -------------------------------------------------------------------------------- /dhall-json/tasty/data/nesting2.dhall: -------------------------------------------------------------------------------- 1 | let Example = < Left : { foo : Natural } | Middle | Right : { bar : Bool } > 2 | 3 | let Nesting = < Inline | Nested : Text > 4 | 5 | in { field = "name" 6 | , nesting = Nesting.Inline 7 | , contents = Example.Middle 8 | } 9 | -------------------------------------------------------------------------------- /dhall-json/tasty/data/nesting2.json: -------------------------------------------------------------------------------- 1 | { "name": "Middle" } 2 | -------------------------------------------------------------------------------- /dhall-json/tasty/data/nesting3.dhall: -------------------------------------------------------------------------------- 1 | let Example = < Left : { foo : Natural } | Middle | Right : { bar : Bool } > 2 | 3 | let Nesting = < Inline | Nested : Text > 4 | 5 | in { field = "name" 6 | , nesting = Nesting.Nested "value" 7 | , contents = Example.Middle 8 | } 9 | -------------------------------------------------------------------------------- /dhall-json/tasty/data/nesting3.json: -------------------------------------------------------------------------------- 1 | { "name": "Middle", "value": null } 2 | -------------------------------------------------------------------------------- /dhall-json/tasty/data/nestingLegacy0.dhall: -------------------------------------------------------------------------------- 1 | let Example = < Left : { foo : Natural } | Right : { bar : Bool } > 2 | 3 | let Nesting = < Inline : {} | Nested : Text > 4 | 5 | in { field = "name" 6 | , nesting = Nesting.Inline {=} 7 | , contents = Example.Left { foo = 2 } 8 | } 9 | -------------------------------------------------------------------------------- /dhall-json/tasty/data/nestingLegacy0.json: -------------------------------------------------------------------------------- 1 | { "foo": 2, "name": "Left" } 2 | -------------------------------------------------------------------------------- /dhall-json/tasty/data/nestingLegacy1.dhall: -------------------------------------------------------------------------------- 1 | let Example = < Left : { foo : Natural } | Right : { bar : Bool } > 2 | 3 | let Nesting = < Inline : {} | Nested : Text > 4 | 5 | in { field = "name" 6 | , nesting = Nesting.Nested "value" 7 | , contents = Example.Left { foo = 2 } 8 | } 9 | -------------------------------------------------------------------------------- /dhall-json/tasty/data/nestingLegacy1.json: -------------------------------------------------------------------------------- 1 | { "name": "Left", "value": { "foo": 2 } } 2 | -------------------------------------------------------------------------------- /dhall-json/tasty/data/potpourri.json: -------------------------------------------------------------------------------- 1 | [ { "bool": true 2 | , "text": "abc" 3 | , "natural": 0 4 | , "integer": 0 5 | , "double": 0.0 6 | , "unifyEmpty": [] 7 | , "preferInteger": 0 8 | , "preferDouble": 0 9 | , "unifySimple": true 10 | , "optional": 1 11 | , "null": null 12 | , "arbitraryJSON": 1 13 | } 14 | , { "bool": false 15 | , "text": "def" 16 | , "natural": 1 17 | , "integer": -1 18 | , "double": 1.1 19 | , "unifyEmpty": [1] 20 | , "preferInteger": -1 21 | , "preferDouble": 1.1 22 | , "unifySimple": "abc" 23 | , "optional": null 24 | , "extraField": true 25 | , "arbitraryJSON": [] 26 | } 27 | ] 28 | -------------------------------------------------------------------------------- /dhall-json/tasty/data/time.dhall: -------------------------------------------------------------------------------- 1 | { example0 = 2020-01-01 2 | , example1 = 00:00:00 3 | , example2 = +00:00 4 | , example3 = 2020-01-01T00:00:00 5 | , example4 = 00:00:00+00:00 6 | , example5 = 2020-01-01T00:00:00+00:00 7 | } 8 | -------------------------------------------------------------------------------- /dhall-json/tasty/data/time.json: -------------------------------------------------------------------------------- 1 | { 2 | "example0": "2020-01-01", 3 | "example1": "00:00:00", 4 | "example2": "+00:00", 5 | "example3": "2020-01-01T00:00:00", 6 | "example4": "00:00:00+00:00", 7 | "example5": "2020-01-01T00:00:00+00:00" 8 | } 9 | -------------------------------------------------------------------------------- /dhall-json/tasty/data/toArbitraryJSON_12_0_0.dhall: -------------------------------------------------------------------------------- 1 | λ(_ : Type) 2 | → λ ( _ 3 | : { array : List _ → _@1 4 | , bool : Bool → _@1 5 | , null : _ 6 | , number : Double → _@1 7 | , object : List { mapKey : Text, mapValue : _ } → _@1 8 | , string : Text → _@1 9 | } 10 | ) 11 | → _.object 12 | [ { mapKey = "array", mapValue = _.array ([] : List _@1) } 13 | , { mapKey = "bool", mapValue = _.bool False } 14 | , { mapKey = "null", mapValue = _.null } 15 | , { mapKey = "number", mapValue = _.number 1.0 } 16 | , { mapKey = "string", mapValue = _.string "ABC" } 17 | ] 18 | -------------------------------------------------------------------------------- /dhall-json/tasty/data/toArbitraryJSON_12_0_0.json: -------------------------------------------------------------------------------- 1 | { 2 | "array": [], 3 | "bool": false, 4 | "null": null, 5 | "number": 1, 6 | "string": "ABC" 7 | } 8 | -------------------------------------------------------------------------------- /dhall-json/tasty/data/toArbitraryJSON_13_0_0.dhall: -------------------------------------------------------------------------------- 1 | λ(_ : Type) 2 | → λ ( _ 3 | : { array : List _ → _@1 4 | , bool : Bool → _@1 5 | , null : _ 6 | , double : Double → _@1 7 | , integer : Integer → _@1 8 | , object : List { mapKey : Text, mapValue : _ } → _@1 9 | , string : Text → _@1 10 | } 11 | ) 12 | → _.object 13 | [ { mapKey = "array", mapValue = _.array ([] : List _@1) } 14 | , { mapKey = "bool", mapValue = _.bool False } 15 | , { mapKey = "null", mapValue = _.null } 16 | , { mapKey = "double", mapValue = _.double 1.0 } 17 | , { mapKey = "integer", mapValue = _.integer +1 } 18 | , { mapKey = "string", mapValue = _.string "ABC" } 19 | ] 20 | -------------------------------------------------------------------------------- /dhall-json/tasty/data/toArbitraryJSON_13_0_0.json: -------------------------------------------------------------------------------- 1 | { 2 | "array": [], 3 | "bool": false, 4 | "null": null, 5 | "double": 1, 6 | "integer": 1, 7 | "string": "ABC" 8 | } 9 | -------------------------------------------------------------------------------- /dhall-json/tasty/data/unionKeys.dhall: -------------------------------------------------------------------------------- 1 | [ { mapKey = < A | B >.A, mapValue = 1 } 2 | , { mapKey = < A | B >.B, mapValue = 2 } 3 | ] 4 | -------------------------------------------------------------------------------- /dhall-json/tasty/data/unionKeys.json: -------------------------------------------------------------------------------- 1 | { "A": 1, "B": 2 } 2 | -------------------------------------------------------------------------------- /dhall-json/tasty/data/unionKeysSchema.dhall: -------------------------------------------------------------------------------- 1 | List { mapKey : < A | B >, mapValue : Natural } 2 | -------------------------------------------------------------------------------- /dhall-lsp-server/Setup.hs: -------------------------------------------------------------------------------- 1 | import Distribution.Simple 2 | main = defaultMain 3 | -------------------------------------------------------------------------------- /dhall-lsp-server/default.nix: -------------------------------------------------------------------------------- 1 | (import ../nix/shared.nix { }).possibly-static.dhall-lsp-server 2 | -------------------------------------------------------------------------------- /dhall-lsp-server/doctest/Main.hs: -------------------------------------------------------------------------------- 1 | module Main (main) where 2 | 3 | import System.FilePath (()) 4 | 5 | import qualified GHC.IO.Encoding 6 | import qualified System.Directory 7 | import qualified System.Environment 8 | import qualified System.IO 9 | import qualified Test.DocTest 10 | 11 | main :: IO () 12 | main = do 13 | GHC.IO.Encoding.setLocaleEncoding System.IO.utf8 14 | args <- System.Environment.getArgs 15 | pwd <- System.Directory.getCurrentDirectory 16 | prefix <- System.Directory.makeAbsolute pwd 17 | let src = prefix "src" 18 | 19 | Test.DocTest.doctest $ 20 | [ "--fast" 21 | , "-XOverloadedStrings" 22 | , "-XRecordWildCards" 23 | ] <> args <> 24 | [ "-i" <> src 25 | , src "Dhall/LSP/Backend/Diagnostics.hs" 26 | ] 27 | -------------------------------------------------------------------------------- /dhall-lsp-server/shell.nix: -------------------------------------------------------------------------------- 1 | (import ../nix/shared.nix {}).shell-dhall-lsp-server 2 | -------------------------------------------------------------------------------- /dhall-lsp-server/src/Dhall/LSP/Backend/ToJSON.hs: -------------------------------------------------------------------------------- 1 | module Dhall.LSP.Backend.ToJSON (CompileError, toJSON) where 2 | 3 | import Data.ByteString.Lazy (toStrict) 4 | import Data.Text (Text) 5 | import Data.Text.Encoding (decodeUtf8) 6 | import Dhall.JSON as Dhall 7 | import Dhall.LSP.Backend.Dhall 8 | 9 | import qualified Data.Aeson.Encode.Pretty as Aeson 10 | 11 | -- | Try to convert a given Dhall expression to JSON. 12 | toJSON :: WellTyped -> Either CompileError Text 13 | toJSON expr = fmap (decodeUtf8 . toStrict . Aeson.encodePretty' config) 14 | (Dhall.dhallToJSON $ fromWellTyped expr) 15 | where 16 | config = Aeson.Config 17 | { Aeson.confIndent = Aeson.Spaces 2 18 | , Aeson.confCompare = compare 19 | , Aeson.confNumFormat = Aeson.Generic 20 | , Aeson.confTrailingNewline = False } 21 | -------------------------------------------------------------------------------- /dhall-lsp-server/tests/fixtures/completion/Bindings.dhall: -------------------------------------------------------------------------------- 1 | let alice = "Alice" let bob = "Bob" in { result = bob ++ al } 2 | -------------------------------------------------------------------------------- /dhall-lsp-server/tests/fixtures/completion/CustomFunctions.dhall: -------------------------------------------------------------------------------- 1 | let makeUser = 2 | λ(user : Text) 3 | → let home = "/home/${user}" 4 | 5 | in { home = home } 6 | 7 | in [ m 8 | -------------------------------------------------------------------------------- /dhall-lsp-server/tests/fixtures/completion/CustomTypes.dhall: -------------------------------------------------------------------------------- 1 | let Config = { name : Text, age : Natural } 2 | 3 | in { name = "alice", age = 20 } : C 4 | -------------------------------------------------------------------------------- /dhall-lsp-server/tests/fixtures/completion/ImportedFunctions.dhall: -------------------------------------------------------------------------------- 1 | let Lib = ./Library.dhall in Lib. 2 | -------------------------------------------------------------------------------- /dhall-lsp-server/tests/fixtures/completion/Library.dhall: -------------------------------------------------------------------------------- 1 | let makeUser = λ(user : Text) → let home = "/home/${user}" in { home = home } 2 | 3 | in { makeUser = makeUser, `make user` = makeUser } 4 | -------------------------------------------------------------------------------- /dhall-lsp-server/tests/fixtures/completion/Union.dhall: -------------------------------------------------------------------------------- 1 | let Union = < A : Text | `B C` > 2 | 3 | in Union. 4 | -------------------------------------------------------------------------------- /dhall-lsp-server/tests/fixtures/diagnostics/InvalidImport.dhall: -------------------------------------------------------------------------------- 1 | ./InvalidSyntax.dhall 2 | -------------------------------------------------------------------------------- /dhall-lsp-server/tests/fixtures/diagnostics/InvalidSyntax.dhall: -------------------------------------------------------------------------------- 1 | let a = 2 + 2/ 2 | -------------------------------------------------------------------------------- /dhall-lsp-server/tests/fixtures/diagnostics/MissingImport.dhall: -------------------------------------------------------------------------------- 1 | ./NonExistent.dhall 2 | -------------------------------------------------------------------------------- /dhall-lsp-server/tests/fixtures/diagnostics/UnboundVar.dhall: -------------------------------------------------------------------------------- 1 | unboundVar 2 | -------------------------------------------------------------------------------- /dhall-lsp-server/tests/fixtures/diagnostics/WrongType.dhall: -------------------------------------------------------------------------------- 1 | let a = "dhall" : List Text in a 2 | -------------------------------------------------------------------------------- /dhall-lsp-server/tests/fixtures/hovering/Types.dhall: -------------------------------------------------------------------------------- 1 | let User = { name : Text, home : Text } 2 | 3 | let mkUser = 4 | λ(_isAdmin : Bool) 5 | → if _isAdmin 6 | 7 | then { name = "admin", home = "/home/admin" } 8 | 9 | else { name = "default", home = "/home/user" } 10 | 11 | in mkUser True : User 12 | -------------------------------------------------------------------------------- /dhall-lsp-server/tests/fixtures/linting/SuperfluousIn.dhall: -------------------------------------------------------------------------------- 1 | let alice = { name = "Alice", age = 20 } 2 | 3 | in let carl = { name = "Carl", age = 22 } in alice 4 | -------------------------------------------------------------------------------- /dhall-lsp-server/tests/fixtures/linting/UnusedBindings.dhall: -------------------------------------------------------------------------------- 1 | let alice = { name = "Alice", age = 20 } 2 | 3 | let bob = { name = "Bob", age = 21 } 4 | 5 | let carl = { name = "Carl", age = 22 } 6 | 7 | in alice 8 | -------------------------------------------------------------------------------- /dhall-nix/Setup.hs: -------------------------------------------------------------------------------- 1 | import Distribution.Simple 2 | main = defaultMain 3 | -------------------------------------------------------------------------------- /dhall-nix/default.nix: -------------------------------------------------------------------------------- 1 | (import ../nix/shared.nix {}).possibly-static.dhall-nix 2 | -------------------------------------------------------------------------------- /dhall-nix/shell.nix: -------------------------------------------------------------------------------- 1 | (import ../nix/shared.nix {}).shell-dhall-nix 2 | -------------------------------------------------------------------------------- /dhall-nixpkgs/Setup.hs: -------------------------------------------------------------------------------- 1 | import Distribution.Simple 2 | main = defaultMain 3 | -------------------------------------------------------------------------------- /dhall-nixpkgs/shell.nix: -------------------------------------------------------------------------------- 1 | (import ../nix/shared.nix {}).shell-dhall-nixpkgs 2 | -------------------------------------------------------------------------------- /dhall-openapi/default.nix: -------------------------------------------------------------------------------- 1 | (import ../nix/shared.nix {}).possibly-static.dhall-openapi 2 | -------------------------------------------------------------------------------- /dhall-openapi/shell.nix: -------------------------------------------------------------------------------- 1 | (import ../nix/shared.nix {}).shell-dhall-openapi 2 | -------------------------------------------------------------------------------- /dhall-openapi/src/Dhall/Kubernetes/Data.hs: -------------------------------------------------------------------------------- 1 | module Dhall.Kubernetes.Data where 2 | 3 | import Dhall.Kubernetes.Types 4 | 5 | import qualified Data.Map.Strict as Data.Map 6 | import qualified Data.Set as Set 7 | 8 | 9 | -- | This just removes the offending keys from the definition 10 | patchCyclicImports :: Definition -> Definition 11 | patchCyclicImports Definition{ properties = oldProps, .. } = Definition{..} 12 | where 13 | properties = fmap (\propsMap -> Data.Map.withoutKeys propsMap toRemove) oldProps 14 | toRemove = 15 | Set.fromList $ 16 | ( ModelName 17 | <$> [ "additionalItems" 18 | , "additionalProperties" 19 | , "allOf" 20 | , "anyOf" 21 | , "definitions" 22 | , "dependencies" 23 | , "items" 24 | , "not" 25 | , "oneOf" 26 | , "properties" 27 | , "patternProperties" 28 | ] 29 | ) 30 | -------------------------------------------------------------------------------- /dhall-toml/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | 1.0.4 2 | 3 | * [Add support for `Prelude.Map.Type`](https://github.com/dhall-lang/dhall-haskell/pull/2549) 4 | * [Fix loading of relative paths](https://github.com/dhall-lang/dhall-haskell/pull/2607) 5 | 6 | 1.0.3 7 | 8 | * [Support `Integer`s](https://github.com/dhall-lang/dhall-haskell/pull/2469) 9 | 10 | 1.0.2 11 | 12 | * [Improve command-line interface](https://github.com/dhall-lang/dhall-haskell/pull/2355) 13 | * [Build against `optparse-applicative-0.17`](https://github.com/dhall-lang/dhall-haskell/pull/2355) 14 | * [Build against `text-2.0`](https://github.com/dhall-lang/dhall-haskell/pull/2356) 15 | 16 | 1.0.1 17 | 18 | * [Fix doctest](https://github.com/dhall-lang/dhall-haskell/pull/2325) 19 | 20 | 1.0.0 21 | 22 | * Initial release 23 | -------------------------------------------------------------------------------- /dhall-toml/README.md: -------------------------------------------------------------------------------- 1 | # `dhall-toml` 2 | 3 | **NOTE:** this package has not been completed see the 4 | [roadmap section](#roadmap) 5 | 6 | For installation or development instructions, see: 7 | 8 | * [`dhall-haskell` - `README`](https://github.com/dhall-lang/dhall-haskell/blob/master/README.md) 9 | 10 | Full documentation is available on Hackage: 11 | 12 | * [`dhall-toml` on Hackage](https://hackage.haskell.org/package/dhall-toml) 13 | 14 | ## Introduction 15 | 16 | This `dhall-toml` package provides a Dhall to TOML compiler. 17 | 18 | ## Example 19 | 20 | ```bash 21 | $ dhall-to-toml <<< "{ foo = 1, bar = True }" 22 | foo = 1 23 | bar = true 24 | ``` 25 | 26 | ## Roadmap 27 | * [x] - minimal `dhall-to-toml` 28 | * [ ] - schema inference for `toml-to-dhall` 29 | * [x] - minimal `toml-to-dhall` 30 | * [ ] - documentation in docs.dhall-lang.org 31 | 32 | -------------------------------------------------------------------------------- /dhall-toml/default.nix: -------------------------------------------------------------------------------- 1 | (import ../nix/shared.nix {}).possibly-static.dhall-toml 2 | -------------------------------------------------------------------------------- /dhall-toml/dhall-to-toml/Main.hs: -------------------------------------------------------------------------------- 1 | module Main where 2 | 3 | import Dhall.DhallToToml (dhallToTomlMain) 4 | 5 | main :: IO () 6 | main = dhallToTomlMain 7 | -------------------------------------------------------------------------------- /dhall-toml/doctest/Main.hs: -------------------------------------------------------------------------------- 1 | module Main (main) where 2 | 3 | import System.FilePath (()) 4 | 5 | import qualified GHC.IO.Encoding 6 | import qualified System.Directory 7 | import qualified System.Environment 8 | import qualified System.IO 9 | import qualified Test.DocTest 10 | 11 | main :: IO () 12 | main = do 13 | GHC.IO.Encoding.setLocaleEncoding System.IO.utf8 14 | args <- System.Environment.getArgs 15 | pwd <- System.Directory.getCurrentDirectory 16 | prefix <- System.Directory.makeAbsolute pwd 17 | let src = prefix "src" 18 | 19 | Test.DocTest.doctest $ 20 | [ "--fast" 21 | ] <> args <> 22 | [ "-i" <> src 23 | , src 24 | ] 25 | -------------------------------------------------------------------------------- /dhall-toml/shell.nix: -------------------------------------------------------------------------------- 1 | (import ../nix/shared.nix {}).shell-dhall-toml 2 | -------------------------------------------------------------------------------- /dhall-toml/tasty/data/adjacent-tables-schema.dhall: -------------------------------------------------------------------------------- 1 | { 2 | a : { 3 | a1 : Natural, 4 | a2 : Bool, 5 | a3 : Text, 6 | }, 7 | b : { 8 | b1 : Natural, 9 | b2 : Bool, 10 | b3 : Text, 11 | }, 12 | } 13 | 14 | -------------------------------------------------------------------------------- /dhall-toml/tasty/data/adjacent-tables.dhall: -------------------------------------------------------------------------------- 1 | { 2 | a = { 3 | a1 = 1, 4 | a2 = True, 5 | a3 = "hello" 6 | }, 7 | b = { 8 | b1 = 2, 9 | b2 = False, 10 | b3 = "world" 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /dhall-toml/tasty/data/adjacent-tables.toml: -------------------------------------------------------------------------------- 1 | [a] 2 | a1 = 1 3 | a2 = true 4 | a3 = "hello" 5 | 6 | [b] 7 | b1 = 2 8 | b2 = false 9 | b3 = "world" 10 | -------------------------------------------------------------------------------- /dhall-toml/tasty/data/empty-schema.dhall: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /dhall-toml/tasty/data/empty.dhall: -------------------------------------------------------------------------------- 1 | {=} 2 | -------------------------------------------------------------------------------- /dhall-toml/tasty/data/empty.toml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhall-lang/dhall-haskell/2d8a3970808e205800ea8a007600ebd63cf24662/dhall-toml/tasty/data/empty.toml -------------------------------------------------------------------------------- /dhall-toml/tasty/data/float-schema.dhall: -------------------------------------------------------------------------------- 1 | { 2 | pi : Double 3 | } 4 | -------------------------------------------------------------------------------- /dhall-toml/tasty/data/float.dhall: -------------------------------------------------------------------------------- 1 | { 2 | pi = 3.141592653589793 3 | } 4 | -------------------------------------------------------------------------------- /dhall-toml/tasty/data/float.toml: -------------------------------------------------------------------------------- 1 | pi = 3.141592653589793 2 | -------------------------------------------------------------------------------- /dhall-toml/tasty/data/inline-list-schema.dhall: -------------------------------------------------------------------------------- 1 | { nats : List Natural 2 | , bools : List Bool 3 | , lists : List (List Natural) 4 | , nested : 5 | { floats : List Double 6 | , ints : List Integer 7 | , moreLists : List (List Natural) 8 | } 9 | , nested1 : 10 | { evenMoreLists : List (List Natural) 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /dhall-toml/tasty/data/inline-list.dhall: -------------------------------------------------------------------------------- 1 | { nats = [1, 2, 3] 2 | , bools = [True, False, False, False, True, False, True] 3 | , lists = [[1, 2], [3, 4], [] : List Natural] 4 | , nested = 5 | { floats = [1.1, 2.2] 6 | , ints = [-5, +2] 7 | , moreLists = [[1, 2], [3, 4], [] : List Natural] 8 | } 9 | , nested1 = 10 | { evenMoreLists = [[1, 2], [3, 4], [] : List Natural] 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /dhall-toml/tasty/data/inline-list.toml: -------------------------------------------------------------------------------- 1 | nats = [1, 2, 3] 2 | bools = [true, false, false, false, true, false, true] 3 | lists = [[1, 2], [3, 4], []] 4 | 5 | [nested] 6 | floats = [1.1, 2.2] 7 | ints = [-5, 2] 8 | moreLists = [[1, 2], [3, 4], []] 9 | 10 | [nested1] 11 | evenMoreLists = [[1, 2], [3, 4], []] 12 | -------------------------------------------------------------------------------- /dhall-toml/tasty/data/map-complex-schema.dhall: -------------------------------------------------------------------------------- 1 | { foo : List { mapKey : Text, mapValue : { baz : Natural } } } 2 | -------------------------------------------------------------------------------- /dhall-toml/tasty/data/map-complex.dhall: -------------------------------------------------------------------------------- 1 | { foo = [ { mapValue = { baz = 1 }, mapKey = "bar" } ] } 2 | -------------------------------------------------------------------------------- /dhall-toml/tasty/data/map-complex.toml: -------------------------------------------------------------------------------- 1 | [foo.bar] 2 | baz = 1 3 | -------------------------------------------------------------------------------- /dhall-toml/tasty/data/map-empty-schema.dhall: -------------------------------------------------------------------------------- 1 | List { mapKey : Text, mapValue : Natural } 2 | -------------------------------------------------------------------------------- /dhall-toml/tasty/data/map-empty.dhall: -------------------------------------------------------------------------------- 1 | [] : List { mapKey : Text, mapValue : Natural } 2 | -------------------------------------------------------------------------------- /dhall-toml/tasty/data/map-empty.toml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhall-lang/dhall-haskell/2d8a3970808e205800ea8a007600ebd63cf24662/dhall-toml/tasty/data/map-empty.toml -------------------------------------------------------------------------------- /dhall-toml/tasty/data/map-simple-schema.dhall: -------------------------------------------------------------------------------- 1 | List { mapKey : Text, mapValue : Natural } 2 | -------------------------------------------------------------------------------- /dhall-toml/tasty/data/map-simple.dhall: -------------------------------------------------------------------------------- 1 | [ { mapKey = "foo", mapValue = 1 } ] 2 | -------------------------------------------------------------------------------- /dhall-toml/tasty/data/map-simple.toml: -------------------------------------------------------------------------------- 1 | foo = 1 2 | -------------------------------------------------------------------------------- /dhall-toml/tasty/data/multiple-fields-schema.dhall: -------------------------------------------------------------------------------- 1 | { 2 | a : Text, 3 | b : Natural, 4 | c : Bool, 5 | } 6 | -------------------------------------------------------------------------------- /dhall-toml/tasty/data/multiple-fields.dhall: -------------------------------------------------------------------------------- 1 | { 2 | a = "hello", 3 | b = 42, 4 | c = True 5 | } 6 | -------------------------------------------------------------------------------- /dhall-toml/tasty/data/multiple-fields.toml: -------------------------------------------------------------------------------- 1 | a = "hello" 2 | b = 42 3 | c = true 4 | -------------------------------------------------------------------------------- /dhall-toml/tasty/data/natural-schema.dhall: -------------------------------------------------------------------------------- 1 | { someKey : Natural } 2 | -------------------------------------------------------------------------------- /dhall-toml/tasty/data/natural.dhall: -------------------------------------------------------------------------------- 1 | { someKey = 42 } 2 | -------------------------------------------------------------------------------- /dhall-toml/tasty/data/natural.toml: -------------------------------------------------------------------------------- 1 | someKey = 42 2 | -------------------------------------------------------------------------------- /dhall-toml/tasty/data/nested-tables-schema.dhall: -------------------------------------------------------------------------------- 1 | { 2 | a1 : { 3 | b1 : Text, 4 | b2 : Text, 5 | b3 : { 6 | c1 : Text, 7 | c2 : Natural, 8 | }, 9 | }, 10 | a2 : Bool, 11 | } 12 | -------------------------------------------------------------------------------- /dhall-toml/tasty/data/nested-tables.dhall: -------------------------------------------------------------------------------- 1 | { 2 | a1 = { 3 | b1 = "hello", 4 | b2 = "world", 5 | b3 = { 6 | c1 = "!", 7 | c2 = 42, 8 | }, 9 | }, 10 | a2 = True 11 | } 12 | -------------------------------------------------------------------------------- /dhall-toml/tasty/data/nested-tables.toml: -------------------------------------------------------------------------------- 1 | a2 = true 2 | 3 | [a1] 4 | b1 = "hello" 5 | b2 = "world" 6 | 7 | [a1.b3] 8 | c1 = "!" 9 | c2 = 42 10 | -------------------------------------------------------------------------------- /dhall-toml/tasty/data/optional-schema.dhall: -------------------------------------------------------------------------------- 1 | { yes : Optional Natural 2 | , no : Optional Natural 3 | } 4 | -------------------------------------------------------------------------------- /dhall-toml/tasty/data/optional.dhall: -------------------------------------------------------------------------------- 1 | { yes = Some 10 2 | , no = None Natural 3 | } 4 | -------------------------------------------------------------------------------- /dhall-toml/tasty/data/optional.toml: -------------------------------------------------------------------------------- 1 | yes = 10 2 | -------------------------------------------------------------------------------- /dhall-toml/tasty/data/record-list-schema.dhall: -------------------------------------------------------------------------------- 1 | { records : List { a : Natural } 2 | , nested : 3 | { records : List { a : Natural } } 4 | } 5 | -------------------------------------------------------------------------------- /dhall-toml/tasty/data/record-list.dhall: -------------------------------------------------------------------------------- 1 | { records = 2 | [ { a = 1 } 3 | , { a = 2 } 4 | , { a = 3 } 5 | ] 6 | , nested = 7 | { records = 8 | [ { a = 1 } 9 | , { a = 2 } 10 | , { a = 3 } 11 | ] 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /dhall-toml/tasty/data/record-list.toml: -------------------------------------------------------------------------------- 1 | [[records]] 2 | a = 1 3 | 4 | [[records]] 5 | a = 2 6 | 7 | [[records]] 8 | a = 3 9 | 10 | [[nested.records]] 11 | a = 1 12 | 13 | [[nested.records]] 14 | a = 2 15 | 16 | [[nested.records]] 17 | a = 3 18 | -------------------------------------------------------------------------------- /dhall-toml/tasty/data/union-empty-schema.dhall: -------------------------------------------------------------------------------- 1 | { value : } 2 | -------------------------------------------------------------------------------- /dhall-toml/tasty/data/union-empty.dhall: -------------------------------------------------------------------------------- 1 | { value = < A | B >.A } 2 | -------------------------------------------------------------------------------- /dhall-toml/tasty/data/union-empty.toml: -------------------------------------------------------------------------------- 1 | value = "A" 2 | -------------------------------------------------------------------------------- /dhall-toml/tasty/data/union-nested.dhall: -------------------------------------------------------------------------------- 1 | let U = 2 | in 3 | { recs = [ U.A {=} ] 4 | , nats = [ U.B 1 ] 5 | } 6 | -------------------------------------------------------------------------------- /dhall-toml/tasty/data/union-nested.toml: -------------------------------------------------------------------------------- 1 | nats = [ 1 ] 2 | 3 | [[recs]] 4 | 5 | -------------------------------------------------------------------------------- /dhall-toml/tasty/data/union-typed-schema.dhall: -------------------------------------------------------------------------------- 1 | { value : < A : Natural | B> } 2 | -------------------------------------------------------------------------------- /dhall-toml/tasty/data/union-typed.dhall: -------------------------------------------------------------------------------- 1 | { value = < A : Natural | B >.A 10 } 2 | -------------------------------------------------------------------------------- /dhall-toml/tasty/data/union-typed.toml: -------------------------------------------------------------------------------- 1 | value = 10 2 | -------------------------------------------------------------------------------- /dhall-toml/toml-to-dhall/Main.hs: -------------------------------------------------------------------------------- 1 | module Main where 2 | 3 | import Dhall.TomlToDhall (tomlToDhallMain) 4 | 5 | main :: IO () 6 | main = tomlToDhallMain 7 | -------------------------------------------------------------------------------- /dhall-try/Setup.hs: -------------------------------------------------------------------------------- 1 | import Distribution.Simple 2 | main = defaultMain 3 | -------------------------------------------------------------------------------- /dhall-try/default.nix: -------------------------------------------------------------------------------- 1 | (import ../nix/shared.nix { compiler = "ghcjs"; }).dhall-try 2 | -------------------------------------------------------------------------------- /dhall-try/dhall-try.cabal: -------------------------------------------------------------------------------- 1 | name: dhall-try 2 | version: 1.0.0 3 | synopsis: Try Dhall in a browser 4 | -- description: 5 | homepage: https://github.com/dhall-lang/dhall-haskell 6 | license: BSD3 7 | license-file: LICENSE 8 | author: Gabriella Gonzalez 9 | maintainer: GenuineGabriella@gmail.com 10 | copyright: 2018 Gabriella Gonzalez 11 | category: Web 12 | build-type: Simple 13 | cabal-version: >=1.10 14 | 15 | executable dhall-try 16 | main-is: Main.hs 17 | build-depends: base >= 4.11.0.0 && < 5 18 | , aeson-pretty 19 | , dhall 20 | , dhall-json 21 | , prettyprinter >= 1.7.0 22 | , text 23 | , ghcjs-base 24 | hs-source-dirs: src 25 | default-language: Haskell2010 26 | ghc-options: -Wall -dedupe 27 | cpp-options: -DGHCJS_BROWSER 28 | -------------------------------------------------------------------------------- /dhall-try/shell.nix: -------------------------------------------------------------------------------- 1 | (import ../nix/shared.nix { compiler = "ghcjs"; }).shell-dhall-try 2 | -------------------------------------------------------------------------------- /dhall-yaml/default.nix: -------------------------------------------------------------------------------- 1 | (import ../nix/shared.nix {}).possibly-static.dhall-yaml 2 | -------------------------------------------------------------------------------- /dhall-yaml/dhall-to-yaml-ng/Main.hs: -------------------------------------------------------------------------------- 1 | module Main where 2 | 3 | import qualified Dhall.DhallToYaml.Main 4 | import qualified Dhall.Yaml 5 | import qualified Paths_dhall_yaml as Meta 6 | 7 | main :: IO () 8 | main = Dhall.DhallToYaml.Main.main Meta.version Dhall.Yaml.dhallToYaml 9 | -------------------------------------------------------------------------------- /dhall-yaml/shell.nix: -------------------------------------------------------------------------------- 1 | (import ../nix/shared.nix {}).shell-dhall-yaml 2 | -------------------------------------------------------------------------------- /dhall-yaml/tasty/data/boolean-quotes.dhall: -------------------------------------------------------------------------------- 1 | { y_quoted = "y" 2 | , yes_quoted = "yes" 3 | , n_quoted = "n" 4 | , no_quoted = "no" 5 | , on_quoted = "on" 6 | , off_quoted = "off" 7 | } 8 | -------------------------------------------------------------------------------- /dhall-yaml/tasty/data/boolean-quotes.yaml: -------------------------------------------------------------------------------- 1 | n_quoted: 'n' 2 | no_quoted: 'no' 3 | off_quoted: 'off' 4 | on_quoted: 'on' 5 | y_quoted: 'y' 6 | yes_quoted: 'yes' 7 | -------------------------------------------------------------------------------- /dhall-yaml/tasty/data/emptyList.dhall: -------------------------------------------------------------------------------- 1 | [] : List Bool 2 | -------------------------------------------------------------------------------- /dhall-yaml/tasty/data/emptyList.yaml: -------------------------------------------------------------------------------- 1 | [] 2 | -------------------------------------------------------------------------------- /dhall-yaml/tasty/data/emptyMap.dhall: -------------------------------------------------------------------------------- 1 | [] : List { mapKey : Text, mapValue : Natural } 2 | -------------------------------------------------------------------------------- /dhall-yaml/tasty/data/emptyMap.yaml: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /dhall-yaml/tasty/data/normal-aeson.dhall: -------------------------------------------------------------------------------- 1 | { string_value = "2000-01-01" 2 | , text = ./yaml.txt as Text 3 | , int_value = 1 4 | , bool_value = True 5 | , bool_string = "true" 6 | , yes = "y" 7 | , hello_world = "hello world" 8 | } 9 | -------------------------------------------------------------------------------- /dhall-yaml/tasty/data/normal-aeson.yaml: -------------------------------------------------------------------------------- 1 | bool_string: 'true' 2 | bool_value: true 3 | hello_world: hello world 4 | int_value: 1 5 | string_value: '2000-01-01' 6 | text: | 7 | Plain text 8 | yes: y 9 | -------------------------------------------------------------------------------- /dhall-yaml/tasty/data/normal.dhall: -------------------------------------------------------------------------------- 1 | { string_value = "2000-01-01" 2 | , text = ./yaml.txt as Text 3 | , int_value = 1 4 | , bool_value = True 5 | , bool_string = "true" 6 | , yes = "y" 7 | , hello_world = "hello world" 8 | } 9 | -------------------------------------------------------------------------------- /dhall-yaml/tasty/data/normal.yaml: -------------------------------------------------------------------------------- 1 | bool_string: 'true' 2 | bool_value: true 3 | hello_world: hello world 4 | int_value: 1 5 | string_value: '2000-01-01' 6 | text: | 7 | Plain text 8 | 'yes': 'y' 9 | -------------------------------------------------------------------------------- /dhall-yaml/tasty/data/preserve-header.dhall: -------------------------------------------------------------------------------- 1 | -- Test header preservation 2 | -- 3 | -- Line comments strip the leading `--` 4 | {- Block comments include the surrounding `{-` and `-}` 5 | -} 6 | 1 7 | -------------------------------------------------------------------------------- /dhall-yaml/tasty/data/preserve-header.yaml: -------------------------------------------------------------------------------- 1 | # Test header preservation 2 | # 3 | # Line comments strip the leading `--` 4 | #{- Block comments include the surrounding `{-` and `-}` 5 | # -} 6 | 1 7 | -------------------------------------------------------------------------------- /dhall-yaml/tasty/data/quoted.dhall: -------------------------------------------------------------------------------- 1 | { string_value = "2000-01-01" 2 | , text = ./yaml.txt as Text 3 | , int_value = 1 4 | , bool_value = True 5 | , bool_string = "true" 6 | , yes = "y" 7 | , hello_world = "hello world" 8 | } 9 | -------------------------------------------------------------------------------- /dhall-yaml/tasty/data/quoted.yaml: -------------------------------------------------------------------------------- 1 | 'bool_string': 'true' 2 | 'bool_value': true 3 | 'hello_world': 'hello world' 4 | 'int_value': 1 5 | 'string_value': '2000-01-01' 6 | 'text': | 7 | Plain text 8 | 'yes': 'y' 9 | -------------------------------------------------------------------------------- /dhall-yaml/tasty/data/single-document-bare.dhall: -------------------------------------------------------------------------------- 1 | "abc" 2 | -------------------------------------------------------------------------------- /dhall-yaml/tasty/data/single-document-bare.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | abc 3 | -------------------------------------------------------------------------------- /dhall-yaml/tasty/data/single-document.dhall: -------------------------------------------------------------------------------- 1 | [ "abc" ] 2 | -------------------------------------------------------------------------------- /dhall-yaml/tasty/data/single-document.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | abc 3 | -------------------------------------------------------------------------------- /dhall-yaml/tasty/data/special.dhall: -------------------------------------------------------------------------------- 1 | { foo = "*" } 2 | -------------------------------------------------------------------------------- /dhall-yaml/tasty/data/special.yaml: -------------------------------------------------------------------------------- 1 | foo: "*" 2 | -------------------------------------------------------------------------------- /dhall-yaml/tasty/data/yaml.txt: -------------------------------------------------------------------------------- 1 | Plain text 2 | -------------------------------------------------------------------------------- /dhall/Setup.hs: -------------------------------------------------------------------------------- 1 | import Distribution.Simple 2 | main = defaultMain 3 | -------------------------------------------------------------------------------- /dhall/benchmark/deep-nested-large-record/LittleEnum.dhall: -------------------------------------------------------------------------------- 1 | < Foo : {} 2 | | Bar : {} 3 | | Baz : {} 4 | > 5 | -------------------------------------------------------------------------------- /dhall/benchmark/deep-nested-large-record/prelude.dhall: -------------------------------------------------------------------------------- 1 | { types = 2 | { Big = ./BigEnum.dhall 3 | , Little = ./LittleEnum.dhall 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /dhall/benchmark/parser/examples/issue108.dhallb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhall-lang/dhall-haskell/2d8a3970808e205800ea8a007600ebd63cf24662/dhall/benchmark/parser/examples/issue108.dhallb -------------------------------------------------------------------------------- /dhall/benchmark/parser/examples/kubernetes.dhallb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhall-lang/dhall-haskell/2d8a3970808e205800ea8a007600ebd63cf24662/dhall/benchmark/parser/examples/kubernetes.dhallb -------------------------------------------------------------------------------- /dhall/benchmark/parser/examples/normalize/ChurchEval.dhall: -------------------------------------------------------------------------------- 1 | 2 | let Nat = ∀(N : Type) → (N → N) → N → N 3 | let n2 = λ(N : Type) → λ(s : N → N) → λ(z : N) → s (s z) 4 | let n5 = λ(N : Type) → λ(s : N → N) → λ(z : N) → s (s (s (s (s z)))) 5 | 6 | let mul = 7 | λ(a : Nat) → λ(b : Nat) → λ(N : Type) → λ(s : N → N) → λ(z : N) → a N (b N s) z 8 | 9 | let add = 10 | λ(a : Nat) → λ(b : Nat) → λ(N : Type) → λ(s : N → N) → λ(z : N) → a N s (b N s z) 11 | 12 | let n10 = mul n2 n5 13 | let n100 = mul n10 n10 14 | let n1k = mul n10 n100 15 | let n10k = mul n100 n100 16 | let n100k = mul n10 n10k 17 | let n1M = mul n10k n100 18 | let n5M = mul n1M n5 19 | let n10M = mul n1M n10 20 | let n20M = mul n10M n2 21 | 22 | in n1M Natural (λ (x:Natural) → x + 1) 0 23 | -------------------------------------------------------------------------------- /dhall/benchmark/parser/examples/normalize/FunCompose.dhall: -------------------------------------------------------------------------------- 1 | 2 | let compose 3 | : ∀(a : Type) → ∀(b : Type) → ∀(c : Type) → (a → b) → (b → c) → a → c 4 | = λ(A : Type) 5 | → λ(B : Type) 6 | → λ(C : Type) 7 | → λ(f : A → B) 8 | → λ(g : B → C) 9 | → λ(x : A) 10 | → g (f x) 11 | 12 | let composeN : ∀ (a : Type) → Natural → (a → a) → a → a 13 | = λ (a : Type) 14 | → λ (n : Natural) 15 | → λ (f : a → a) 16 | → Natural/fold n (a → a) (compose a a a f) (λ (x : a) → x) 17 | 18 | in composeN Natural 100000 (λ (x : Natural) → x + 1) 0 19 | -------------------------------------------------------------------------------- /dhall/default.nix: -------------------------------------------------------------------------------- 1 | (import ../nix/shared.nix {}).possibly-static.dhall 2 | -------------------------------------------------------------------------------- /dhall/dhall/Main.hs: -------------------------------------------------------------------------------- 1 | module Main where 2 | 3 | import qualified Dhall.Main 4 | 5 | main :: IO () 6 | main = Dhall.Main.main 7 | -------------------------------------------------------------------------------- /dhall/examples/True: -------------------------------------------------------------------------------- 1 | True 2 | -------------------------------------------------------------------------------- /dhall/man/gen-manpage.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | pandoc dhall.md -s -t man -o dhall.1 4 | -------------------------------------------------------------------------------- /dhall/shell.nix: -------------------------------------------------------------------------------- 1 | (import ../nix/shared.nix { coverage = true; }).shell-dhall 2 | -------------------------------------------------------------------------------- /dhall/src/Dhall/Pretty.hs: -------------------------------------------------------------------------------- 1 | {-| This module contains logic for pretty-printing expressions, including 2 | support for syntax highlighting 3 | -} 4 | module Dhall.Pretty 5 | ( -- * Pretty 6 | Ann(..) 7 | , annToAnsiStyle 8 | , prettyExpr 9 | 10 | , CharacterSet(..) 11 | , defaultCharacterSet 12 | , detectCharacterSet 13 | , prettyCharacterSet 14 | 15 | , Dhall.Pretty.Internal.layout 16 | , Dhall.Pretty.Internal.layoutOpts 17 | 18 | , escapeEnvironmentVariable 19 | , UnescapedLabel(..) 20 | , escapeLabel 21 | 22 | , temporalToText 23 | ) where 24 | 25 | import Dhall.Pretty.Internal 26 | -------------------------------------------------------------------------------- /dhall/src/Dhall/Pretty/Internal.hs-boot: -------------------------------------------------------------------------------- 1 | module Dhall.Pretty.Internal where 2 | 3 | import Control.DeepSeq (NFData) 4 | import Data.Data (Data) 5 | import Data.Text (Text) 6 | import Dhall.Src (Src) 7 | import Language.Haskell.TH.Syntax (Lift) 8 | import Prettyprinter (Doc, Pretty) 9 | 10 | import Dhall.Syntax.Const 11 | import {-# SOURCE #-} Dhall.Syntax.Expr 12 | import Dhall.Syntax.Var 13 | 14 | data Ann 15 | 16 | data CharacterSet = ASCII | Unicode 17 | 18 | instance Eq CharacterSet 19 | instance Ord CharacterSet 20 | instance Show CharacterSet 21 | instance Data CharacterSet 22 | instance Lift CharacterSet 23 | instance NFData CharacterSet 24 | instance Semigroup CharacterSet 25 | instance Monoid CharacterSet 26 | 27 | prettyVar :: Var -> Doc Ann 28 | 29 | prettyConst :: Const -> Doc Ann 30 | 31 | prettyExpr :: Pretty a => Expr s a -> Doc Ann 32 | 33 | prettyEnvironmentVariable :: Text -> Doc ann 34 | 35 | prettyImportExpression :: Pretty a => Expr Src a -> Doc Ann 36 | -------------------------------------------------------------------------------- /dhall/src/Dhall/Syntax/Chunks.hs-boot: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE StandaloneKindSignatures #-} 2 | 3 | module Dhall.Syntax.Chunks where 4 | 5 | import Data.Kind (Type) 6 | 7 | type Chunks :: Type -> Type -> Type 8 | data Chunks s a 9 | -------------------------------------------------------------------------------- /dhall/src/Dhall/Syntax/Const.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE DeriveGeneric #-} 2 | 3 | module Dhall.Syntax.Const 4 | ( Const(..) 5 | ) where 6 | 7 | import GHC.Generics (Generic) 8 | 9 | {-| Constants for a pure type system 10 | 11 | The axioms are: 12 | 13 | > ⊦ Type : Kind 14 | > ⊦ Kind : Sort 15 | 16 | ... and the valid rule pairs are: 17 | 18 | > ⊦ Type ↝ Type : Type -- Functions from terms to terms (ordinary functions) 19 | > ⊦ Kind ↝ Type : Type -- Functions from types to terms (type-polymorphic functions) 20 | > ⊦ Sort ↝ Type : Type -- Functions from kinds to terms 21 | > ⊦ Kind ↝ Kind : Kind -- Functions from types to types (type-level functions) 22 | > ⊦ Sort ↝ Kind : Sort -- Functions from kinds to types (kind-polymorphic functions) 23 | > ⊦ Sort ↝ Sort : Sort -- Functions from kinds to kinds (kind-level functions) 24 | 25 | Note that Dhall does not support functions from terms to types and therefore 26 | Dhall is not a dependently typed language 27 | -} 28 | data Const = Type | Kind | Sort 29 | deriving (Bounded, Enum, Generic) 30 | -------------------------------------------------------------------------------- /dhall/src/Dhall/Syntax/Expr.hs-boot: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE StandaloneKindSignatures #-} 2 | 3 | module Dhall.Syntax.Expr where 4 | 5 | import Data.Kind (Type) 6 | 7 | type Expr :: Type -> Type -> Type 8 | data Expr s a 9 | -------------------------------------------------------------------------------- /dhall/src/Dhall/Syntax/Instances/Data.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE DeriveDataTypeable #-} 2 | {-# LANGUAGE StandaloneDeriving #-} 3 | 4 | {-# OPTIONS_GHC -Wno-orphans #-} 5 | 6 | module Dhall.Syntax.Instances.Data () where 7 | 8 | import Data.Data (Data) 9 | import Dhall.Syntax.Binding 10 | import Dhall.Syntax.Chunks 11 | import Dhall.Syntax.Const 12 | import Dhall.Syntax.Expr 13 | import Dhall.Syntax.FunctionBinding 14 | import Dhall.Syntax.RecordField 15 | import Dhall.Syntax.Types 16 | import Dhall.Syntax.Var 17 | 18 | deriving instance Data Const 19 | deriving instance Data Var 20 | deriving instance (Data a, Data s) => Data (Binding s a) 21 | deriving instance Data DhallDouble 22 | deriving instance (Data a, Data s) => Data (Chunks s a) 23 | deriving instance Data PreferAnnotation 24 | deriving instance (Data a, Data s) => Data (RecordField s a) 25 | deriving instance (Data a, Data s) => Data (FunctionBinding s a) 26 | deriving instance Data s => Data (FieldSelection s) 27 | deriving instance Data WithComponent 28 | deriving instance (Data a, Data s) => Data (Expr s a) 29 | -------------------------------------------------------------------------------- /dhall/src/Dhall/Syntax/Instances/Foldable.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE DeriveFoldable #-} 2 | {-# LANGUAGE StandaloneDeriving #-} 3 | 4 | {-# OPTIONS_GHC -Wno-orphans #-} 5 | 6 | module Dhall.Syntax.Instances.Foldable () where 7 | 8 | import Dhall.Syntax.Binding 9 | import Dhall.Syntax.Chunks 10 | import Dhall.Syntax.Expr 11 | import Dhall.Syntax.FunctionBinding 12 | import Dhall.Syntax.RecordField 13 | import Dhall.Syntax.Types 14 | 15 | deriving instance Foldable (Binding s) 16 | deriving instance Foldable (Chunks s) 17 | deriving instance Foldable (RecordField s) 18 | deriving instance Foldable (FunctionBinding s) 19 | deriving instance Foldable FieldSelection 20 | deriving instance Foldable (Expr s) 21 | -------------------------------------------------------------------------------- /dhall/src/Dhall/Syntax/Instances/Pretty.hs-boot: -------------------------------------------------------------------------------- 1 | {-# OPTIONS_GHC -Wno-orphans #-} 2 | 3 | module Dhall.Syntax.Instances.Pretty where 4 | 5 | import Dhall.Syntax.Expr (Expr) 6 | import Prettyprinter (Pretty) 7 | 8 | instance Pretty a => Pretty (Expr s a) 9 | -------------------------------------------------------------------------------- /dhall/src/Dhall/Syntax/Instances/Traversable.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE DeriveTraversable #-} 2 | {-# LANGUAGE StandaloneDeriving #-} 3 | 4 | {-# OPTIONS_GHC -Wno-orphans #-} 5 | 6 | module Dhall.Syntax.Instances.Traversable () where 7 | 8 | import Dhall.Syntax.Binding 9 | import Dhall.Syntax.Chunks 10 | import Dhall.Syntax.Expr 11 | import Dhall.Syntax.FunctionBinding 12 | import Dhall.Syntax.Instances.Foldable () 13 | import Dhall.Syntax.Instances.Functor () 14 | import Dhall.Syntax.RecordField 15 | import Dhall.Syntax.Types 16 | 17 | deriving instance Traversable (Binding s) 18 | deriving instance Traversable (Chunks s) 19 | deriving instance Traversable (RecordField s) 20 | deriving instance Traversable (FunctionBinding s) 21 | deriving instance Traversable FieldSelection 22 | deriving instance Traversable (Expr s) 23 | -------------------------------------------------------------------------------- /dhall/src/Dhall/Syntax/Operations.hs-boot: -------------------------------------------------------------------------------- 1 | module Dhall.Syntax.Operations where 2 | 3 | import Dhall.Syntax.Expr (Expr) 4 | 5 | unsafeSubExpressions :: Applicative f => (Expr s a -> f (Expr t b)) -> Expr s a -> f (Expr t b) 6 | -------------------------------------------------------------------------------- /dhall/src/Dhall/Syntax/Types.hs-boot: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE StandaloneKindSignatures #-} 2 | 3 | module Dhall.Syntax.Types where 4 | 5 | import Data.Kind (Type) 6 | 7 | data DhallDouble 8 | 9 | data PreferAnnotation 10 | 11 | type FieldSelection :: Type -> Type 12 | data FieldSelection s 13 | 14 | data WithComponent 15 | -------------------------------------------------------------------------------- /dhall/src/Dhall/URL.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE OverloadedStrings #-} 2 | {-# LANGUAGE RecordWildCards #-} 3 | 4 | module Dhall.URL where 5 | 6 | import Data.Text (Text) 7 | 8 | import Dhall.Syntax (Directory (..), File (..), Scheme (..), URL (..)) 9 | 10 | renderComponent :: Text -> Text 11 | renderComponent component = "/" <> component 12 | 13 | renderQuery :: Text -> Text 14 | renderQuery query = "?" <> query 15 | 16 | renderURL :: URL -> Text 17 | renderURL url = 18 | schemeText 19 | <> authority 20 | <> pathText 21 | <> queryText 22 | where 23 | URL {..} = url 24 | 25 | File {..} = path 26 | 27 | Directory {..} = directory 28 | 29 | schemeText = case scheme of 30 | HTTP -> "http://" 31 | HTTPS -> "https://" 32 | 33 | pathText = 34 | foldMap renderComponent (reverse components) 35 | <> renderComponent file 36 | 37 | queryText = foldMap renderQuery query 38 | -------------------------------------------------------------------------------- /dhall/src/Dhall/Util.hs-boot: -------------------------------------------------------------------------------- 1 | module Dhall.Util where 2 | 3 | import Data.Text (Text) 4 | 5 | snip :: Text -> Text 6 | -------------------------------------------------------------------------------- /dhall/src/Dhall/Version.hs: -------------------------------------------------------------------------------- 1 | {-| Utilities for getting the current version of the Haskell implementation of 2 | Dhall 3 | -} 4 | module Dhall.Version ( dhallVersion 5 | , dhallVersionString 6 | ) where 7 | 8 | import qualified Data.Version as V 9 | import qualified Paths_dhall as P 10 | 11 | -- | The current `V.Version` of the Haskell implementation 12 | dhallVersion :: V.Version 13 | dhallVersion = P.version 14 | 15 | -- | The current version `String` for the Haskell implementation 16 | dhallVersionString :: String 17 | dhallVersionString = V.showVersion dhallVersion 18 | -------------------------------------------------------------------------------- /dhall/tests/diff/appList.txt: -------------------------------------------------------------------------------- 1 | λ(… : … 2 | → …) 3 | → … 4 | … 5 | -------------------------------------------------------------------------------- /dhall/tests/diff/appListA.dhall: -------------------------------------------------------------------------------- 1 | λ(f : List Bool -> Bool) → f ([] : List Bool) 2 | -------------------------------------------------------------------------------- /dhall/tests/diff/appListB.dhall: -------------------------------------------------------------------------------- 1 | λ(f : List Bool -> Bool) → f ([] : List Bool) 2 | -------------------------------------------------------------------------------- /dhall/tests/diff/emptyList.txt: -------------------------------------------------------------------------------- 1 | - [] : … 2 | + True 3 | -------------------------------------------------------------------------------- /dhall/tests/diff/emptyListA.dhall: -------------------------------------------------------------------------------- 1 | [] : List Natural 2 | -------------------------------------------------------------------------------- /dhall/tests/diff/emptyListB.dhall: -------------------------------------------------------------------------------- 1 | True 2 | -------------------------------------------------------------------------------- /dhall/tests/diff/function.txt: -------------------------------------------------------------------------------- 1 | … 2 | → … 3 | → …@- 1 4 | + 0 5 | 6 | → … 7 | -------------------------------------------------------------------------------- /dhall/tests/diff/functionA.dhall: -------------------------------------------------------------------------------- 1 | ∀(a : Type) → ∀(b : Type) → ∀(x : a) → Bool 2 | -------------------------------------------------------------------------------- /dhall/tests/diff/functionB.dhall: -------------------------------------------------------------------------------- 1 | ∀(a : Type) → ∀(b : Type) → ∀(x : b) → Bool 2 | -------------------------------------------------------------------------------- /dhall/tests/diff/insideList.txt: -------------------------------------------------------------------------------- 1 | [ … 2 | , { y = - 4 3 | + 5 4 | , … 5 | } 6 | ] 7 | 8 | -------------------------------------------------------------------------------- /dhall/tests/diff/insideListA.dhall: -------------------------------------------------------------------------------- 1 | [ { x = 1, y = 2 } 2 | , { x = 3, y = 4 } 3 | ] 4 | -------------------------------------------------------------------------------- /dhall/tests/diff/insideListB.dhall: -------------------------------------------------------------------------------- 1 | [ { x = 1, y = 2 } 2 | , { x = 3, y = 5 } 3 | ] 4 | -------------------------------------------------------------------------------- /dhall/tests/diff/nonEmptyList.txt: -------------------------------------------------------------------------------- 1 | - [ … ] 2 | + True 3 | -------------------------------------------------------------------------------- /dhall/tests/diff/nonEmptyListA.dhall: -------------------------------------------------------------------------------- 1 | [1] 2 | -------------------------------------------------------------------------------- /dhall/tests/diff/nonEmptyListB.dhall: -------------------------------------------------------------------------------- 1 | True 2 | -------------------------------------------------------------------------------- /dhall/tests/diff/with.txt: -------------------------------------------------------------------------------- 1 | λ(… : { … 2 | }) 3 | → … with …+ .c.d 4 | = - 2 5 | + 3 6 | -------------------------------------------------------------------------------- /dhall/tests/diff/withA.dhall: -------------------------------------------------------------------------------- 1 | λ(r : { a : Natural }) → r with b = 2 2 | -------------------------------------------------------------------------------- /dhall/tests/diff/withB.dhall: -------------------------------------------------------------------------------- 1 | λ(r : { a : Natural }) → r with b.c.d = 3 2 | -------------------------------------------------------------------------------- /dhall/tests/format/applicationMultilineB.dhall: -------------------------------------------------------------------------------- 1 | { app = 2 | ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 3 | aaaaaaaaaaaaaaaaa 4 | , app2 = 5 | f 6 | a 7 | b 8 | cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc 9 | , app3 = 10 | f 11 | a 12 | b 13 | c 14 | dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd 15 | , some = Some 16 | aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 17 | , someList = Some 18 | [ aaaaaaaaaaaaaaaaaaaaaaaaaa 19 | , bbbbbbbbbbbbbbbbbbbb 20 | , cccccccccccccccccccccccc 21 | , dddddddddddddd 22 | ] 23 | , merge1 = 24 | merge 25 | aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 26 | bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb 27 | , merge3 = 28 | merge 29 | a 30 | b 31 | ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc 32 | , toMap1 = toMap 33 | aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 34 | } 35 | -------------------------------------------------------------------------------- /dhall/tests/format/asciiA.dhall: -------------------------------------------------------------------------------- 1 | λ(a : Type) → ∀(b : a) → a 2 | -------------------------------------------------------------------------------- /dhall/tests/format/asciiB.dhall: -------------------------------------------------------------------------------- 1 | \(a : Type) -> forall (b : a) -> a 2 | -------------------------------------------------------------------------------- /dhall/tests/format/dottedFieldsA.dhall: -------------------------------------------------------------------------------- 1 | { x = { y = { a = { b = 1 }, c = { d = 2 } } } } 2 | -------------------------------------------------------------------------------- /dhall/tests/format/dottedFieldsB.dhall: -------------------------------------------------------------------------------- 1 | { x.y = { a.b = 1, c.d = 2 } } 2 | -------------------------------------------------------------------------------- /dhall/tests/format/dottedFieldsCommentsA.dhall: -------------------------------------------------------------------------------- 1 | { {- A -} 2 | a 3 | -- B 4 | . -- C 5 | b 6 | . c 7 | {- D -} 8 | . d = 9 | -- E 10 | x 11 | , {- F -} 12 | e 13 | {- G -} 14 | . f = 15 | {- H -} 16 | { g = y } 17 | } 18 | -------------------------------------------------------------------------------- /dhall/tests/format/dottedFieldsCommentsB.dhall: -------------------------------------------------------------------------------- 1 | { {- A -} 2 | a 3 | -- B 4 | . -- C 5 | b 6 | . c 7 | {- D -} 8 | . d 9 | = -- E 10 | x 11 | , {- F -} 12 | e 13 | {- G -} 14 | . f 15 | = {- H -} 16 | { g = y } 17 | } 18 | -------------------------------------------------------------------------------- /dhall/tests/format/duplicatesA.dhall: -------------------------------------------------------------------------------- 1 | { {- Comments around duplicate fields are not preserved -} foo.bar = 1 2 | , foo = { baz = {- Comments within values are still preserved-} 2 } 3 | , foo = qux 4 | } 5 | -------------------------------------------------------------------------------- /dhall/tests/format/duplicatesB.dhall: -------------------------------------------------------------------------------- 1 | { foo.bar = 1 2 | , foo.baz 3 | = {- Comments within values are still preserved-} 4 | 2 5 | , foo = qux 6 | } 7 | -------------------------------------------------------------------------------- /dhall/tests/format/emptyRecordA.dhall: -------------------------------------------------------------------------------- 1 | {=} 2 | -------------------------------------------------------------------------------- /dhall/tests/format/emptyRecordB.dhall: -------------------------------------------------------------------------------- 1 | {=} 2 | -------------------------------------------------------------------------------- /dhall/tests/format/envVarsA.dhall: -------------------------------------------------------------------------------- 1 | [ env:x, env:"1", env:" ", env:"\\", env:"." ] 2 | -------------------------------------------------------------------------------- /dhall/tests/format/envVarsB.dhall: -------------------------------------------------------------------------------- 1 | [ env:x, env:"1", env:" ", env:"\\", env:"." ] 2 | -------------------------------------------------------------------------------- /dhall/tests/format/escapeNumericLabelA.dhall: -------------------------------------------------------------------------------- 1 | { `0` = 0 } 2 | -------------------------------------------------------------------------------- /dhall/tests/format/escapeNumericLabelB.dhall: -------------------------------------------------------------------------------- 1 | { `0` = 0 } 2 | -------------------------------------------------------------------------------- /dhall/tests/format/escapeSingleQuotedOpenInterpolationA.dhall: -------------------------------------------------------------------------------- 1 | "\${\n" 2 | -------------------------------------------------------------------------------- /dhall/tests/format/escapeSingleQuotedOpenInterpolationB.dhall: -------------------------------------------------------------------------------- 1 | '' 2 | ''${ 3 | '' 4 | -------------------------------------------------------------------------------- /dhall/tests/format/fieldOrderA.dhall: -------------------------------------------------------------------------------- 1 | { foo = 1, bar = True } 2 | -------------------------------------------------------------------------------- /dhall/tests/format/fieldOrderB.dhall: -------------------------------------------------------------------------------- 1 | { foo = 1, bar = True } 2 | -------------------------------------------------------------------------------- /dhall/tests/format/functionLikeA.dhall: -------------------------------------------------------------------------------- 1 | { example0 = merge a b + merge a b 2 | , example1 = (merge a b : T) + (merge a b : T) 3 | , example2 = toMap a + toMap a 4 | , example3 = (toMap a b : T) + (toMap a b : T) 5 | , example4 = Some a + Some a 6 | } 7 | -------------------------------------------------------------------------------- /dhall/tests/format/functionLikeB.dhall: -------------------------------------------------------------------------------- 1 | { example0 = merge a b + merge a b 2 | , example1 = (merge a b : T) + (merge a b : T) 3 | , example2 = toMap a + toMap a 4 | , example3 = (toMap a b : T) + (toMap a b : T) 5 | , example4 = Some a + Some a 6 | } 7 | -------------------------------------------------------------------------------- /dhall/tests/format/headerA.dhall: -------------------------------------------------------------------------------- 1 | 2 | {- bla -} 3 | 4 | True 5 | -------------------------------------------------------------------------------- /dhall/tests/format/headerB.dhall: -------------------------------------------------------------------------------- 1 | {- bla -} 2 | True 3 | -------------------------------------------------------------------------------- /dhall/tests/format/headerNoNewlineA.dhall: -------------------------------------------------------------------------------- 1 | {- -}0 2 | -------------------------------------------------------------------------------- /dhall/tests/format/headerNoNewlineB.dhall: -------------------------------------------------------------------------------- 1 | {- -} 2 | 0 3 | -------------------------------------------------------------------------------- /dhall/tests/format/ifThenElseA.dhall: -------------------------------------------------------------------------------- 1 | if True then if True then if True then 1 else 2 else if True then 3 else 4 2 | else if True then if True then 5 else 6 else if True then 7 else 8 3 | -------------------------------------------------------------------------------- /dhall/tests/format/ifThenElseB.dhall: -------------------------------------------------------------------------------- 1 | if True 2 | then if True then if True then 1 else 2 else if True then 3 else 4 3 | else if True 4 | then if True then 5 else 6 5 | else if True 6 | then 7 7 | else 8 8 | -------------------------------------------------------------------------------- /dhall/tests/format/importAccessA.dhall: -------------------------------------------------------------------------------- 1 | (./testImport).hello 2 | -------------------------------------------------------------------------------- /dhall/tests/format/importAccessB.dhall: -------------------------------------------------------------------------------- 1 | (./testImport).hello 2 | -------------------------------------------------------------------------------- /dhall/tests/format/importAltPrecedenceA.dhall: -------------------------------------------------------------------------------- 1 | a ? b || c 2 | -------------------------------------------------------------------------------- /dhall/tests/format/importAltPrecedenceB.dhall: -------------------------------------------------------------------------------- 1 | a ? b || c 2 | -------------------------------------------------------------------------------- /dhall/tests/format/importLines2A.dhall: -------------------------------------------------------------------------------- 1 | let _ = ./emptyRecordA.dhall 2 | in let _ = ./emptyRecordA.dhall in 123 3 | -------------------------------------------------------------------------------- /dhall/tests/format/importLines2B.dhall: -------------------------------------------------------------------------------- 1 | let _ = ./emptyRecordA.dhall in let _ = ./emptyRecordA.dhall in 123 2 | -------------------------------------------------------------------------------- /dhall/tests/format/importLinesA.dhall: -------------------------------------------------------------------------------- 1 | let _ = ./emptyRecordA.dhall 2 | let _ = ./emptyRecordA.dhall 3 | let _ = ./emptyRecordA.dhall 4 | let _ = ./emptyRecordA.dhall 5 | let _ = ./emptyRecordA.dhall 6 | let _ = ./emptyRecordA.dhall 7 | in 123 8 | -------------------------------------------------------------------------------- /dhall/tests/format/importLinesB.dhall: -------------------------------------------------------------------------------- 1 | let _ = ./emptyRecordA.dhall 2 | 3 | let _ = ./emptyRecordA.dhall 4 | 5 | let _ = ./emptyRecordA.dhall 6 | 7 | let _ = ./emptyRecordA.dhall 8 | 9 | let _ = ./emptyRecordA.dhall 10 | 11 | let _ = ./emptyRecordA.dhall 12 | 13 | in 123 14 | -------------------------------------------------------------------------------- /dhall/tests/format/importSuffixA.dhall: -------------------------------------------------------------------------------- 1 | let a = env:AAA as Text in a 2 | -------------------------------------------------------------------------------- /dhall/tests/format/importSuffixB.dhall: -------------------------------------------------------------------------------- 1 | let a = env:AAA as Text in a 2 | -------------------------------------------------------------------------------- /dhall/tests/format/innerMultilineA.dhall: -------------------------------------------------------------------------------- 1 | { inner = 2 | '' 3 | 4 | one 5 | 6 | two 7 | 8 | three 9 | 10 | '' 11 | } 12 | -------------------------------------------------------------------------------- /dhall/tests/format/innerMultilineB.dhall: -------------------------------------------------------------------------------- 1 | { inner = 2 | '' 3 | 4 | one 5 | 6 | two 7 | 8 | three 9 | 10 | '' 11 | } 12 | -------------------------------------------------------------------------------- /dhall/tests/format/interpolation0A.dhall: -------------------------------------------------------------------------------- 1 | "foo\n${a} bar" 2 | -------------------------------------------------------------------------------- /dhall/tests/format/interpolation0B.dhall: -------------------------------------------------------------------------------- 1 | '' 2 | foo 3 | ${a} bar'' 4 | -------------------------------------------------------------------------------- /dhall/tests/format/issue1301A.dhall: -------------------------------------------------------------------------------- 1 | let attribute 2 | : Text → Text → { mapKey : Text, mapValue : Text } 3 | = λ(key : Text) → λ(value : Text) → { mapKey = key, mapValue = value } 4 | 5 | in attribute 6 | -------------------------------------------------------------------------------- /dhall/tests/format/issue1301B.dhall: -------------------------------------------------------------------------------- 1 | let attribute 2 | : Text → Text → { mapKey : Text, mapValue : Text } 3 | = λ(key : Text) → λ(value : Text) → { mapKey = key, mapValue = value } 4 | 5 | in attribute 6 | -------------------------------------------------------------------------------- /dhall/tests/format/issue1400-1A.dhall: -------------------------------------------------------------------------------- 1 | { conversation = 2 | [ { author = "robert", content = xs } 3 | , { author = "robert", content = xs } 4 | , { author = 5 | "bob" 6 | , content = 7 | [ text 8 | '' 9 | any line going past the 80 characters boundary (e.g. this one is 82) 10 | '' 11 | ] 12 | } 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /dhall/tests/format/issue1400-1B.dhall: -------------------------------------------------------------------------------- 1 | { conversation = 2 | [ { author = "robert", content = xs } 3 | , { author = "robert", content = xs } 4 | , { author = "bob" 5 | , content = 6 | [ text 7 | '' 8 | any line going past the 80 characters boundary (e.g. this one is 82) 9 | '' 10 | ] 11 | } 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /dhall/tests/format/issue1400-2A.dhall: -------------------------------------------------------------------------------- 1 | let Tagged 2 | : Type → Type 3 | = λ ( a 4 | : Type 5 | ) 6 | → { field : 7 | Text 8 | , nesting : 9 | ./Nesting sha256:6284802edd41d5d725aa1ec7687e614e21ad1be7e14dd10996bfa9625105c335 10 | ? ./Nesting 11 | , contents : a 12 | } 13 | 14 | in Tagged 15 | -------------------------------------------------------------------------------- /dhall/tests/format/issue1400-2B.dhall: -------------------------------------------------------------------------------- 1 | let Tagged 2 | : Type → Type 3 | = λ(a : Type) → 4 | { field : Text 5 | , nesting : 6 | ./Nesting 7 | sha256:6284802edd41d5d725aa1ec7687e614e21ad1be7e14dd10996bfa9625105c335 8 | ? ./Nesting 9 | , contents : a 10 | } 11 | 12 | in Tagged 13 | -------------------------------------------------------------------------------- /dhall/tests/format/issue1413A.dhall: -------------------------------------------------------------------------------- 1 | let foo = 2 | 3 | {- test -} 4 | "hello" 5 | 6 | in foo 7 | -------------------------------------------------------------------------------- /dhall/tests/format/issue1413B.dhall: -------------------------------------------------------------------------------- 1 | let foo = 2 | 3 | {- test -} 4 | "hello" 5 | 6 | in foo 7 | -------------------------------------------------------------------------------- /dhall/tests/format/issue1545-1A.dhall: -------------------------------------------------------------------------------- 1 | "\n\tx" 2 | -------------------------------------------------------------------------------- /dhall/tests/format/issue1545-1B.dhall: -------------------------------------------------------------------------------- 1 | '' 2 | 3 | ${"\t"}x'' 4 | -------------------------------------------------------------------------------- /dhall/tests/format/issue1545-2A.dhall: -------------------------------------------------------------------------------- 1 | "\n x" 2 | -------------------------------------------------------------------------------- /dhall/tests/format/issue1545-2B.dhall: -------------------------------------------------------------------------------- 1 | '' 2 | 3 | ${" "}x'' 4 | -------------------------------------------------------------------------------- /dhall/tests/format/issue1687A.dhall: -------------------------------------------------------------------------------- 1 | let {- foo 2 | 3 | bar -} 4 | x = 5 | 1 6 | 7 | in x 8 | -------------------------------------------------------------------------------- /dhall/tests/format/issue1687B.dhall: -------------------------------------------------------------------------------- 1 | let {- foo 2 | 3 | bar -} 4 | x = 5 | 1 6 | 7 | in x 8 | -------------------------------------------------------------------------------- /dhall/tests/format/issue1805KeywordRecordFieldShouldBeQuotedA.dhall: -------------------------------------------------------------------------------- 1 | { `if` = True } 2 | -------------------------------------------------------------------------------- /dhall/tests/format/issue1805KeywordRecordFieldShouldBeQuotedB.dhall: -------------------------------------------------------------------------------- 1 | { `if` = True } 2 | -------------------------------------------------------------------------------- /dhall/tests/format/issue1805SomeQuotedInLetButNotInRecordA.dhall: -------------------------------------------------------------------------------- 1 | let `Some` = 3 in { `if` = True, Some = 333 } 2 | -------------------------------------------------------------------------------- /dhall/tests/format/issue1805SomeQuotedInLetButNotInRecordB.dhall: -------------------------------------------------------------------------------- 1 | let `Some` = 3 in { `if` = True, Some = 333 } 2 | -------------------------------------------------------------------------------- /dhall/tests/format/issue183A.dhall: -------------------------------------------------------------------------------- 1 | let foo = 1 2 | 3 | in λ(bar : Integer) 4 | → let exposePort = 5 | λ(portSpec : { ext : Integer, int : Integer }) 6 | → Integer/show portSpec.ext ++ ":" ++ Integer/show portSpec.int 7 | 8 | in let exposeSamePort = 9 | λ(port : Integer) → exposePort { ext = port, int = port } 10 | 11 | in { blah = bar } 12 | -------------------------------------------------------------------------------- /dhall/tests/format/issue183B.dhall: -------------------------------------------------------------------------------- 1 | let foo = 1 2 | 3 | in λ(bar : Integer) → 4 | let exposePort = 5 | λ(portSpec : { ext : Integer, int : Integer }) → 6 | Integer/show portSpec.ext ++ ":" ++ Integer/show portSpec.int 7 | 8 | in let exposeSamePort = 9 | λ(port : Integer) → exposePort { ext = port, int = port } 10 | 11 | in { blah = bar } 12 | -------------------------------------------------------------------------------- /dhall/tests/format/issue2047A.dhall: -------------------------------------------------------------------------------- 1 | let x = ({ foo = 1 } ∧ { bar = 2 }) 2 | with bar = 3 3 | with foo = 4 4 | in x 5 | -------------------------------------------------------------------------------- /dhall/tests/format/issue2047B.dhall: -------------------------------------------------------------------------------- 1 | let x = ({ foo = 1 } ∧ { bar = 2 }) with bar = 3 with foo = 4 in x 2 | -------------------------------------------------------------------------------- /dhall/tests/format/issue2078A.dhall: -------------------------------------------------------------------------------- 1 | "'\${x}'\n" 2 | -------------------------------------------------------------------------------- /dhall/tests/format/issue2078B.dhall: -------------------------------------------------------------------------------- 1 | '' 2 | ${"'"}''${x}' 3 | '' 4 | -------------------------------------------------------------------------------- /dhall/tests/format/issue2601A.dhall: -------------------------------------------------------------------------------- 1 | let T = < Some | Type > 2 | 3 | let t 4 | : T 5 | = T.`Some` 6 | 7 | let x 8 | : T 9 | = T.Type 10 | 11 | in True 12 | -------------------------------------------------------------------------------- /dhall/tests/format/issue2601B.dhall: -------------------------------------------------------------------------------- 1 | let T = < Some | Type > 2 | 3 | let t 4 | : T 5 | = T.`Some` 6 | 7 | let x 8 | : T 9 | = T.Type 10 | 11 | in True 12 | -------------------------------------------------------------------------------- /dhall/tests/format/largeExponentA.dhall: -------------------------------------------------------------------------------- 1 | [ 1.0, 1e100, 1e-100 ] 2 | -------------------------------------------------------------------------------- /dhall/tests/format/largeExponentB.dhall: -------------------------------------------------------------------------------- 1 | [ 1.0, 1e100, 1e-100 ] 2 | -------------------------------------------------------------------------------- /dhall/tests/format/letA.dhall: -------------------------------------------------------------------------------- 1 | let x = "Lorem ipsum" let y = "Lorem ipsum" in let z = "Lorem ipsum" in x ++ y ++ z 2 | -------------------------------------------------------------------------------- /dhall/tests/format/letAnnotatedShortA.dhall: -------------------------------------------------------------------------------- 1 | let empty : ∀(a : Type) → List a = λ(a : Type) → [] : List a in empty 2 | -------------------------------------------------------------------------------- /dhall/tests/format/letAnnotatedShortB.dhall: -------------------------------------------------------------------------------- 1 | let empty 2 | : ∀(a : Type) → List a 3 | = λ(a : Type) → [] : List a 4 | 5 | in empty 6 | -------------------------------------------------------------------------------- /dhall/tests/format/letB.dhall: -------------------------------------------------------------------------------- 1 | let x = "Lorem ipsum" 2 | 3 | let y = "Lorem ipsum" 4 | 5 | in let z = "Lorem ipsum" in x ++ y ++ z 6 | -------------------------------------------------------------------------------- /dhall/tests/format/letCommentsA.dhall: -------------------------------------------------------------------------------- 1 | let {- Example documentation for a let binding 2 | that spans more than one line 3 | -} 4 | x {- we can interject things here -} = -- Make sure one-line comments work 5 | 1 6 | 7 | in x 8 | -------------------------------------------------------------------------------- /dhall/tests/format/letCommentsB.dhall: -------------------------------------------------------------------------------- 1 | let {- Example documentation for a let binding 2 | that spans more than one line 3 | -} 4 | x {- we can interject things here -} = 5 | -- Make sure one-line comments work 6 | 1 7 | 8 | in x 9 | -------------------------------------------------------------------------------- /dhall/tests/format/letLineCommentsAfterVariableA.dhall: -------------------------------------------------------------------------------- 1 | let x -- xxxxxxxxxx xxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxx 2 | : Natural 3 | = 0 4 | 5 | let y -- yyyyyyyyyy yyyyyyyyyyyyyyyyy yyyyyyyyyyyyyyyyy 6 | -- yyyyyyyyyyyyyy yyyyyyyyyyyyyyyyyyyyyyy 7 | : Natural 8 | = 1 9 | 10 | in x + y 11 | -------------------------------------------------------------------------------- /dhall/tests/format/letLineCommentsAfterVariableB.dhall: -------------------------------------------------------------------------------- 1 | let x 2 | -- xxxxxxxxxx xxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxx 3 | : Natural 4 | = 0 5 | 6 | let y 7 | -- yyyyyyyyyy yyyyyyyyyyyyyyyyy yyyyyyyyyyyyyyyyy 8 | -- yyyyyyyyyyyyyy yyyyyyyyyyyyyyyyyyyyyyy 9 | : Natural 10 | = 1 11 | 12 | in x + y 13 | -------------------------------------------------------------------------------- /dhall/tests/format/letLongCommentsA.dhall: -------------------------------------------------------------------------------- 1 | let x {- foo -} : {- bar -} Bool {- baz -} = {- bla -} True 2 | 3 | in x 4 | -------------------------------------------------------------------------------- /dhall/tests/format/letLongCommentsB.dhall: -------------------------------------------------------------------------------- 1 | let x 2 | {- foo -} : {- bar -} Bool 3 | = {- bla -} True 4 | 5 | in x 6 | -------------------------------------------------------------------------------- /dhall/tests/format/letNewlineCommentsA.dhall: -------------------------------------------------------------------------------- 1 | let x = 1 2 | in 3 | let {- aaaaaaaaaaaaaaaaaaa 4 | -} y : {- bbbbbbbbbbbbbbbbbbbbb 5 | -} Natural {- cccccccccccccc 6 | -} = {- ddddddddddddddddd -} 2 7 | in x 8 | -------------------------------------------------------------------------------- /dhall/tests/format/letNewlineCommentsB.dhall: -------------------------------------------------------------------------------- 1 | let x = 1 2 | 3 | in let {- aaaaaaaaaaaaaaaaaaa 4 | -} y 5 | : {- bbbbbbbbbbbbbbbbbbbbb 6 | -} Natural 7 | = {- ddddddddddddddddd -} 2 8 | 9 | in x 10 | -------------------------------------------------------------------------------- /dhall/tests/format/letShortCommentsA.dhall: -------------------------------------------------------------------------------- 1 | let x = True 2 | let {- 0 -} y {- 1 -} : {- 2 -} Bool = {- 3-} False 3 | in x 4 | -------------------------------------------------------------------------------- /dhall/tests/format/letShortCommentsB.dhall: -------------------------------------------------------------------------------- 1 | let x = True 2 | 3 | let {- 0 -} y 4 | {- 1 -} : {- 2 -} Bool 5 | = {- 3-} False 6 | 7 | in x 8 | -------------------------------------------------------------------------------- /dhall/tests/format/multilineA.dhall: -------------------------------------------------------------------------------- 1 | "ABC\nDEF" 2 | -------------------------------------------------------------------------------- /dhall/tests/format/multilineArgumentA.dhall: -------------------------------------------------------------------------------- 1 | fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff xxxxxxxxxxxxxxxx "\n" 2 | -------------------------------------------------------------------------------- /dhall/tests/format/multilineArgumentB.dhall: -------------------------------------------------------------------------------- 1 | fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 2 | xxxxxxxxxxxxxxxx 3 | "\n" 4 | -------------------------------------------------------------------------------- /dhall/tests/format/multilineB.dhall: -------------------------------------------------------------------------------- 1 | '' 2 | ABC 3 | DEF'' 4 | -------------------------------------------------------------------------------- /dhall/tests/format/multilineTrailingSingleQuoteA.dhall: -------------------------------------------------------------------------------- 1 | "\n'" 2 | -------------------------------------------------------------------------------- /dhall/tests/format/multilineTrailingSingleQuoteB.dhall: -------------------------------------------------------------------------------- 1 | '' 2 | 3 | ${"'"}'' 4 | -------------------------------------------------------------------------------- /dhall/tests/format/multilineTrailingWhitespaceA.dhall: -------------------------------------------------------------------------------- 1 | { x = " \n\nfoo \n" } 2 | -------------------------------------------------------------------------------- /dhall/tests/format/multilineTrailingWhitespaceB.dhall: -------------------------------------------------------------------------------- 1 | { x = 2 | '' 3 | 4 | 5 | foo 6 | '' 7 | } 8 | -------------------------------------------------------------------------------- /dhall/tests/format/negativeTimeZoneA.dhall: -------------------------------------------------------------------------------- 1 | 04:00:00-04:00 2 | -------------------------------------------------------------------------------- /dhall/tests/format/negativeTimeZoneB.dhall: -------------------------------------------------------------------------------- 1 | 04:00:00-04:00 2 | -------------------------------------------------------------------------------- /dhall/tests/format/nestedAnnotationA.dhall: -------------------------------------------------------------------------------- 1 | ([] : a) : b 2 | -------------------------------------------------------------------------------- /dhall/tests/format/nestedAnnotationB.dhall: -------------------------------------------------------------------------------- 1 | ([] : a) : b 2 | -------------------------------------------------------------------------------- /dhall/tests/format/numericLiteralsA.dhall: -------------------------------------------------------------------------------- 1 | { example0 = 0x42, example1 = +0x42, example2 = 1.2e20, example3 = -0b0111 } 2 | -------------------------------------------------------------------------------- /dhall/tests/format/numericLiteralsB.dhall: -------------------------------------------------------------------------------- 1 | { example0 = 0x42, example1 = +0x42, example2 = 1.2e20, example3 = -0b0111 } 2 | -------------------------------------------------------------------------------- /dhall/tests/format/parentA.dhall: -------------------------------------------------------------------------------- 1 | ../a 2 | -------------------------------------------------------------------------------- /dhall/tests/format/parentB.dhall: -------------------------------------------------------------------------------- 1 | ../a 2 | -------------------------------------------------------------------------------- /dhall/tests/format/parenthesizeUsingA.dhall: -------------------------------------------------------------------------------- 1 | -- https://github.com/dhall-lang/dhall-haskell/issues/2273 2 | let MyPackage = 3 | https://server.test/package.dhall using (./headers.dhall) 4 | sha256:03a6e298ff140d430cea8b387fad886ce9f5bee24622c7d1102115cc08ed9cf8 5 | 6 | in MyPackage 7 | -------------------------------------------------------------------------------- /dhall/tests/format/parenthesizeUsingB.dhall: -------------------------------------------------------------------------------- 1 | -- https://github.com/dhall-lang/dhall-haskell/issues/2273 2 | let MyPackage = 3 | https://server.test/package.dhall using (./headers.dhall) 4 | sha256:03a6e298ff140d430cea8b387fad886ce9f5bee24622c7d1102115cc08ed9cf8 5 | 6 | in MyPackage 7 | -------------------------------------------------------------------------------- /dhall/tests/format/preserveShebangA.dhall: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env -S dhall text --file 2 | "Hello, world!" 3 | -------------------------------------------------------------------------------- /dhall/tests/format/preserveShebangB.dhall: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env -S dhall text --file 2 | "Hello, world!" 3 | -------------------------------------------------------------------------------- /dhall/tests/format/projectionOrderA.dhall: -------------------------------------------------------------------------------- 1 | e.{ foo, bar, baz } 2 | -------------------------------------------------------------------------------- /dhall/tests/format/projectionOrderB.dhall: -------------------------------------------------------------------------------- 1 | e.{ foo, bar, baz } 2 | -------------------------------------------------------------------------------- /dhall/tests/format/punA.dhall: -------------------------------------------------------------------------------- 1 | { x = x, y = 1, z = z } 2 | -------------------------------------------------------------------------------- /dhall/tests/format/punB.dhall: -------------------------------------------------------------------------------- 1 | { x, y = 1, z } 2 | -------------------------------------------------------------------------------- /dhall/tests/format/punCommentsA.dhall: -------------------------------------------------------------------------------- 1 | { {- A -} 2 | x 3 | {- B -} 4 | , y = 5 | {- C -} 6 | y 7 | } 8 | -------------------------------------------------------------------------------- /dhall/tests/format/punCommentsB.dhall: -------------------------------------------------------------------------------- 1 | { {- A -} 2 | x 3 | {- B -} 4 | , y = 5 | {- C -} 6 | y 7 | } 8 | -------------------------------------------------------------------------------- /dhall/tests/format/recordCompletionA.dhall: -------------------------------------------------------------------------------- 1 | { field0 = 2 | T::{ 3 | , a = 1 4 | , b = 1 5 | , c = 1 6 | , d = 1 7 | , e = 1 8 | , f = 1 9 | , g = 1 10 | , h = 1 11 | , i = 1 12 | , j = 1 13 | , k = 1 14 | , l = 1 15 | , m = 1 16 | , n = 1 17 | , o = 1 18 | , p = 1 19 | , q = 1 20 | , r = 1 21 | , s = 1 22 | , t = 1 23 | } 24 | , field1 = T::{ a = 1 } 25 | , field2 = T::{ a = a } 26 | } 27 | -------------------------------------------------------------------------------- /dhall/tests/format/recordCompletionB.dhall: -------------------------------------------------------------------------------- 1 | { field0 = T::{ 2 | , a = 1 3 | , b = 1 4 | , c = 1 5 | , d = 1 6 | , e = 1 7 | , f = 1 8 | , g = 1 9 | , h = 1 10 | , i = 1 11 | , j = 1 12 | , k = 1 13 | , l = 1 14 | , m = 1 15 | , n = 1 16 | , o = 1 17 | , p = 1 18 | , q = 1 19 | , r = 1 20 | , s = 1 21 | , t = 1 22 | } 23 | , field1 = T::{ a = 1 } 24 | , field2 = T::{ a } 25 | } 26 | -------------------------------------------------------------------------------- /dhall/tests/format/recordLitComments0A.dhall: -------------------------------------------------------------------------------- 1 | { {- A -} 2 | x 3 | {- B -} 4 | = {- C -} 5 | T 6 | } 7 | -------------------------------------------------------------------------------- /dhall/tests/format/recordLitComments0B.dhall: -------------------------------------------------------------------------------- 1 | { {- A -} 2 | x 3 | {- B -} 4 | = {- C -} 5 | T 6 | } 7 | -------------------------------------------------------------------------------- /dhall/tests/format/recordLitComments1A.dhall: -------------------------------------------------------------------------------- 1 | { 2 | --| a comment for y 3 | y = 42 4 | } 5 | -------------------------------------------------------------------------------- /dhall/tests/format/recordLitComments1B.dhall: -------------------------------------------------------------------------------- 1 | { --| a comment for y 2 | y = 42 3 | } 4 | -------------------------------------------------------------------------------- /dhall/tests/format/recordLitMultilineBlockCommentsA.dhall: -------------------------------------------------------------------------------- 1 | { {- A 2 | A -} 3 | x 4 | {- B 5 | B -} 6 | = {- C 7 | C -} 8 | y 9 | } 10 | -------------------------------------------------------------------------------- /dhall/tests/format/recordLitMultilineBlockCommentsB.dhall: -------------------------------------------------------------------------------- 1 | { {- A 2 | A -} 3 | x 4 | {- B 5 | B -} 6 | = {- C 7 | C -} 8 | y 9 | } 10 | -------------------------------------------------------------------------------- /dhall/tests/format/recordTypeCommentsA.dhall: -------------------------------------------------------------------------------- 1 | { {- A -} 2 | a 3 | {- B -} 4 | : {- C -} 5 | A 6 | } 7 | -------------------------------------------------------------------------------- /dhall/tests/format/recordTypeCommentsB.dhall: -------------------------------------------------------------------------------- 1 | { {- A -} 2 | a 3 | {- B -} 4 | : {- C -} 5 | A 6 | } 7 | -------------------------------------------------------------------------------- /dhall/tests/format/sha256PrintingA.dhall: -------------------------------------------------------------------------------- 1 | let replicate = 2 | https://raw.githubusercontent.com/dhall-lang/Prelude/c79c2bc3c46f129cc5b6d594ce298a381bcae92c/List/replicate sha256:cc856d59b63f7699881bdb8e4b1036ca4c0013827268040a50c1e1405f646a2c 3 | 4 | in replicate 5 5 | -------------------------------------------------------------------------------- /dhall/tests/format/sha256PrintingB.dhall: -------------------------------------------------------------------------------- 1 | let replicate = 2 | https://raw.githubusercontent.com/dhall-lang/Prelude/c79c2bc3c46f129cc5b6d594ce298a381bcae92c/List/replicate 3 | sha256:cc856d59b63f7699881bdb8e4b1036ca4c0013827268040a50c1e1405f646a2c 4 | 5 | in replicate 5 6 | -------------------------------------------------------------------------------- /dhall/tests/format/significantLeadingSpacesA.dhall: -------------------------------------------------------------------------------- 1 | " x\n\n y\n " 2 | -------------------------------------------------------------------------------- /dhall/tests/format/significantLeadingSpacesB.dhall: -------------------------------------------------------------------------------- 1 | '' 2 | ${" "} x 3 | 4 | ${" "} y 5 | ${" "}'' 6 | -------------------------------------------------------------------------------- /dhall/tests/format/stringWithNullA.dhall: -------------------------------------------------------------------------------- 1 | "\u0000 \$ \\ \n ☺" 2 | -------------------------------------------------------------------------------- /dhall/tests/format/stringWithNullB.dhall: -------------------------------------------------------------------------------- 1 | '' 2 | ${"\u0000"} $ \ 3 | ☺'' 4 | -------------------------------------------------------------------------------- /dhall/tests/format/textLitNewlinesOnlyA.dhall: -------------------------------------------------------------------------------- 1 | "\n\n" 2 | -------------------------------------------------------------------------------- /dhall/tests/format/textLitNewlinesOnlyB.dhall: -------------------------------------------------------------------------------- 1 | "\n\n" 2 | -------------------------------------------------------------------------------- /dhall/tests/format/timePrecisionA.dhall: -------------------------------------------------------------------------------- 1 | -- This test ensures that we don't strip leading zeros from the fractional 2 | -- component of seconds when pretty-printing them 3 | 00:00:00.01 4 | -------------------------------------------------------------------------------- /dhall/tests/format/timePrecisionB.dhall: -------------------------------------------------------------------------------- 1 | -- This test ensures that we don't strip leading zeros from the fractional 2 | -- component of seconds when pretty-printing them 3 | 00:00:00.01 4 | -------------------------------------------------------------------------------- /dhall/tests/format/unicodeA.dhall: -------------------------------------------------------------------------------- 1 | λ(isActive : Bool) 2 | → { barLeftEnd = 3 | Some "┨" 4 | , barRightEnd = 5 | Some "┠" 6 | , separator = 7 | Some "┃" 8 | , alignment = 9 | < ToTheLeft | ToTheRight | Centered >.ToTheLeft 10 | : ./Alignment.dhall 11 | , barWidth = 12 | None Natural 13 | , barSegments = 14 | [ "index", "command", "path", "title" ] 15 | } 16 | : ./Bar.dhall 17 | -------------------------------------------------------------------------------- /dhall/tests/format/unicodeB.dhall: -------------------------------------------------------------------------------- 1 | λ(isActive : Bool) → 2 | { barLeftEnd = Some "┨" 3 | , barRightEnd = Some "┠" 4 | , separator = Some "┃" 5 | , alignment = 6 | < ToTheLeft | ToTheRight | Centered >.ToTheLeft : ./Alignment.dhall 7 | , barWidth = None Natural 8 | , barSegments = [ "index", "command", "path", "title" ] 9 | } 10 | : ./Bar.dhall 11 | -------------------------------------------------------------------------------- /dhall/tests/format/urlsA.dhall: -------------------------------------------------------------------------------- 1 | let unreserved = http://x/y%7ez 2 | 3 | let uppercasehex = http://x/y%3bz 4 | 5 | let reserved = http://x/y:z 6 | 7 | in "done" 8 | -------------------------------------------------------------------------------- /dhall/tests/format/urlsB.dhall: -------------------------------------------------------------------------------- 1 | let unreserved = http://x/y~z 2 | 3 | let uppercasehex = http://x/y%3Bz 4 | 5 | let reserved = http://x/y:z 6 | 7 | in "done" 8 | -------------------------------------------------------------------------------- /dhall/tests/format/usingToMapA.dhall: -------------------------------------------------------------------------------- 1 | https://httpbin.org/headers using (toMap { TOKEN = "AAAA" }) as Text 2 | -------------------------------------------------------------------------------- /dhall/tests/format/usingToMapB.dhall: -------------------------------------------------------------------------------- 1 | https://httpbin.org/headers using (toMap { TOKEN = "AAAA" }) as Text 2 | -------------------------------------------------------------------------------- /dhall/tests/format/withA.dhall: -------------------------------------------------------------------------------- 1 | r with a = Some { b = 1, c = 1, d = 1, e = 1, f = 1, g = 1, h = 1, i = 1, j = 1, k = 1, l = 1 } 2 | with b = T::{ b = 1, c = 1, d = 1, e = 1, f = 1, g = 1, h = 1, i = 1, j = 1, k = 1, l = 1 } 3 | with c = [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ] 4 | with d = 1 5 | with e = 111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 6 | -------------------------------------------------------------------------------- /dhall/tests/format/withB.dhall: -------------------------------------------------------------------------------- 1 | r 2 | with a = Some 3 | { b = 1 4 | , c = 1 5 | , d = 1 6 | , e = 1 7 | , f = 1 8 | , g = 1 9 | , h = 1 10 | , i = 1 11 | , j = 1 12 | , k = 1 13 | , l = 1 14 | } 15 | with b = T::{ 16 | , b = 1 17 | , c = 1 18 | , d = 1 19 | , e = 1 20 | , f = 1 21 | , g = 1 22 | , h = 1 23 | , i = 1 24 | , j = 1 25 | , k = 1 26 | , l = 1 27 | } 28 | with c = 29 | [ 1 30 | , 1 31 | , 1 32 | , 1 33 | , 1 34 | , 1 35 | , 1 36 | , 1 37 | , 1 38 | , 1 39 | , 1 40 | , 1 41 | , 1 42 | , 1 43 | , 1 44 | , 1 45 | , 1 46 | , 1 47 | , 1 48 | , 1 49 | , 1 50 | , 1 51 | , 1 52 | , 1 53 | , 1 54 | , 1 55 | ] 56 | with d = 1 57 | with e = 58 | 111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 59 | -------------------------------------------------------------------------------- /dhall/tests/format/withPrecedenceA.dhall: -------------------------------------------------------------------------------- 1 | let Foo = 2 | Bar 3 | with default = (Bar.default ⫽ { bar = 0 }) 4 | 5 | in Foo 6 | -------------------------------------------------------------------------------- /dhall/tests/format/withPrecedenceB.dhall: -------------------------------------------------------------------------------- 1 | let Foo = Bar with default = Bar.default ⫽ { bar = 0 } in Foo 2 | -------------------------------------------------------------------------------- /dhall/tests/format/withQuestionA.dhall: -------------------------------------------------------------------------------- 1 | λ(x : Optional Natural) → x with ? = 2 2 | -------------------------------------------------------------------------------- /dhall/tests/format/withQuestionB.dhall: -------------------------------------------------------------------------------- 1 | λ(x : Optional Natural) → x with ? = 2 2 | -------------------------------------------------------------------------------- /dhall/tests/freeze/cached/True.dhall: -------------------------------------------------------------------------------- 1 | True 2 | -------------------------------------------------------------------------------- /dhall/tests/freeze/cached/cachedA.dhall: -------------------------------------------------------------------------------- 1 | ./True.dhall sha256:27abdeddfe8503496adeb623466caa47da5f63abd2bc6fa19f6cfcb73ecfed70 2 | ? ./True.dhall 3 | -------------------------------------------------------------------------------- /dhall/tests/freeze/cached/cachedB.dhall: -------------------------------------------------------------------------------- 1 | missing 2 | sha256:27abdeddfe8503496adeb623466caa47da5f63abd2bc6fa19f6cfcb73ecfed70 3 | ? ./True.dhall 4 | -------------------------------------------------------------------------------- /dhall/tests/freeze/cached/idempotentA.dhall: -------------------------------------------------------------------------------- 1 | -- The purpose of this test is to verify that `dhall freeze --cached` is 2 | -- idempotent and doesn't attempt to resolve the `missing` import 3 | missing 4 | sha256:27abdeddfe8503496adeb623466caa47da5f63abd2bc6fa19f6cfcb73ecfed70 5 | ? ./True.dhall 6 | -------------------------------------------------------------------------------- /dhall/tests/freeze/cached/idempotentB.dhall: -------------------------------------------------------------------------------- 1 | missing 2 | sha256:27abdeddfe8503496adeb623466caa47da5f63abd2bc6fa19f6cfcb73ecfed70 3 | ? ./True.dhall 4 | -------------------------------------------------------------------------------- /dhall/tests/freeze/cached/incorrectHashA.dhall: -------------------------------------------------------------------------------- 1 | ./True.dhall sha256:0000000000000000000000000000000000000000000000000000000000000000 2 | -------------------------------------------------------------------------------- /dhall/tests/freeze/cached/incorrectHashB.dhall: -------------------------------------------------------------------------------- 1 | missing 2 | sha256:27abdeddfe8503496adeb623466caa47da5f63abd2bc6fa19f6cfcb73ecfed70 3 | ? ./True.dhall 4 | -------------------------------------------------------------------------------- /dhall/tests/freeze/cached/protectedA.dhall: -------------------------------------------------------------------------------- 1 | ./True.dhall sha256:27abdeddfe8503496adeb623466caa47da5f63abd2bc6fa19f6cfcb73ecfed70 2 | -------------------------------------------------------------------------------- /dhall/tests/freeze/cached/protectedB.dhall: -------------------------------------------------------------------------------- 1 | missing 2 | sha256:27abdeddfe8503496adeb623466caa47da5f63abd2bc6fa19f6cfcb73ecfed70 3 | ? ./True.dhall 4 | -------------------------------------------------------------------------------- /dhall/tests/freeze/cached/unprotectedA.dhall: -------------------------------------------------------------------------------- 1 | ./True.dhall 2 | -------------------------------------------------------------------------------- /dhall/tests/freeze/cached/unprotectedB.dhall: -------------------------------------------------------------------------------- 1 | missing 2 | sha256:27abdeddfe8503496adeb623466caa47da5f63abd2bc6fa19f6cfcb73ecfed70 3 | ? ./True.dhall 4 | -------------------------------------------------------------------------------- /dhall/tests/freeze/secure/True.dhall: -------------------------------------------------------------------------------- 1 | True 2 | -------------------------------------------------------------------------------- /dhall/tests/freeze/secure/cachedA.dhall: -------------------------------------------------------------------------------- 1 | ./True.dhall sha256:27abdeddfe8503496adeb623466caa47da5f63abd2bc6fa19f6cfcb73ecfed70 2 | ? ./True.dhall 3 | -------------------------------------------------------------------------------- /dhall/tests/freeze/secure/cachedB.dhall: -------------------------------------------------------------------------------- 1 | ./True.dhall 2 | sha256:27abdeddfe8503496adeb623466caa47da5f63abd2bc6fa19f6cfcb73ecfed70 3 | -------------------------------------------------------------------------------- /dhall/tests/freeze/secure/incorrectHashA.dhall: -------------------------------------------------------------------------------- 1 | ./True.dhall sha256:0000000000000000000000000000000000000000000000000000000000000000 2 | -------------------------------------------------------------------------------- /dhall/tests/freeze/secure/incorrectHashB.dhall: -------------------------------------------------------------------------------- 1 | ./True.dhall 2 | sha256:27abdeddfe8503496adeb623466caa47da5f63abd2bc6fa19f6cfcb73ecfed70 3 | -------------------------------------------------------------------------------- /dhall/tests/freeze/secure/protectedA.dhall: -------------------------------------------------------------------------------- 1 | ./True.dhall sha256:27abdeddfe8503496adeb623466caa47da5f63abd2bc6fa19f6cfcb73ecfed70 2 | -------------------------------------------------------------------------------- /dhall/tests/freeze/secure/protectedB.dhall: -------------------------------------------------------------------------------- 1 | ./True.dhall 2 | sha256:27abdeddfe8503496adeb623466caa47da5f63abd2bc6fa19f6cfcb73ecfed70 3 | -------------------------------------------------------------------------------- /dhall/tests/freeze/secure/unprotectedA.dhall: -------------------------------------------------------------------------------- 1 | ./True.dhall 2 | -------------------------------------------------------------------------------- /dhall/tests/freeze/secure/unprotectedB.dhall: -------------------------------------------------------------------------------- 1 | ./True.dhall 2 | sha256:27abdeddfe8503496adeb623466caa47da5f63abd2bc6fa19f6cfcb73ecfed70 3 | -------------------------------------------------------------------------------- /dhall/tests/lint/success/PreludeExtensionA.dhall: -------------------------------------------------------------------------------- 1 | https://prelude.dhall-lang.org/List/map 2 | -------------------------------------------------------------------------------- /dhall/tests/lint/success/PreludeExtensionB.dhall: -------------------------------------------------------------------------------- 1 | https://prelude.dhall-lang.org/List/map.dhall 2 | -------------------------------------------------------------------------------- /dhall/tests/lint/success/assertA.dhall: -------------------------------------------------------------------------------- 1 | let simpleAssert = assert : 1 + 1 ≡ 2 2 | 3 | let assertIn1Lam = λ(n : Natural) → assert : Natural/subtract 0 n ≡ n 4 | 5 | let assertIn2Lams = 6 | λ(m : Natural) 7 | → λ(n : Natural) 8 | → assert : Natural/subtract m m ≡ Natural/subtract n n 9 | 10 | let assertInLetInLam = λ(m : Natural) → let n = m + 0 in assert : m ≡ n 11 | 12 | let unusedNonAssert = "Foo" 13 | 14 | in {=} 15 | -------------------------------------------------------------------------------- /dhall/tests/lint/success/assertB.dhall: -------------------------------------------------------------------------------- 1 | let simpleAssert = assert : 1 + 1 ≡ 2 2 | 3 | let assertIn1Lam = λ(n : Natural) → assert : Natural/subtract 0 n ≡ n 4 | 5 | let assertIn2Lams = 6 | λ(m : Natural) → 7 | λ(n : Natural) → 8 | assert : Natural/subtract m m ≡ Natural/subtract n n 9 | 10 | let assertInLetInLam = λ(m : Natural) → let n = m + 0 in assert : m ≡ n 11 | 12 | in {=} 13 | -------------------------------------------------------------------------------- /dhall/tests/lint/success/fixAssertA.dhall: -------------------------------------------------------------------------------- 1 | let example0 = 1 ≡ 1 2 | 3 | let example1 = let x = 1 in x ≡ 1 4 | 5 | in 1 6 | -------------------------------------------------------------------------------- /dhall/tests/lint/success/fixAssertB.dhall: -------------------------------------------------------------------------------- 1 | let example0 = assert : 1 ≡ 1 let example1 = let x = 1 in assert : x ≡ 1 in 1 2 | -------------------------------------------------------------------------------- /dhall/tests/lint/success/issue1586A.dhall: -------------------------------------------------------------------------------- 1 | let {- 1 -} x {- 2 -} : {- 3 -} Natural = {- 4 -} 1 {- 5 -} in x 2 | -------------------------------------------------------------------------------- /dhall/tests/lint/success/issue1586B.dhall: -------------------------------------------------------------------------------- 1 | let {- 1 -} x 2 | {- 2 -} : {- 3 -} Natural 3 | = {- 4 -} 1 4 | 5 | in x 6 | -------------------------------------------------------------------------------- /dhall/tests/lint/success/multiletA.dhall: -------------------------------------------------------------------------------- 1 | -- example0.dhall 2 | let Person 3 | : Type 4 | = ∀(Person : Type) 5 | → ∀(MakePerson : { children : List Person, name : Text } → Person) 6 | → Person 7 | 8 | let example 9 | : Person 10 | = λ(Person : Type) 11 | → λ(MakePerson : { children : List Person, name : Text } → Person) 12 | → MakePerson 13 | { children = 14 | [ MakePerson { children = [] : List Person, name = "Mary" } 15 | , MakePerson { children = [] : List Person, name = "Jane" } 16 | ] 17 | , name = 18 | "John" 19 | } 20 | 21 | let everybody 22 | : Person → List Text 23 | = let concat = http://prelude.dhall-lang.org/List/concat.dhall 24 | 25 | in λ(x : Person) 26 | → x 27 | (List Text) 28 | ( λ(p : { children : List (List Text), name : Text }) 29 | → [ p.name ] # concat Text p.children 30 | ) 31 | 32 | let result : List Text = everybody example 33 | 34 | in result 35 | -------------------------------------------------------------------------------- /dhall/tests/lint/success/multiletB.dhall: -------------------------------------------------------------------------------- 1 | -- example0.dhall 2 | let Person 3 | : Type 4 | = ∀(Person : Type) → 5 | ∀(MakePerson : { children : List Person, name : Text } → Person) → 6 | Person 7 | 8 | let example 9 | : Person 10 | = λ(Person : Type) → 11 | λ(MakePerson : { children : List Person, name : Text } → Person) → 12 | MakePerson 13 | { children = 14 | [ MakePerson { children = [] : List Person, name = "Mary" } 15 | , MakePerson { children = [] : List Person, name = "Jane" } 16 | ] 17 | , name = "John" 18 | } 19 | 20 | let everybody 21 | : Person → List Text 22 | = let concat = http://prelude.dhall-lang.org/List/concat.dhall 23 | 24 | in λ(x : Person) → 25 | x 26 | (List Text) 27 | ( λ(p : { children : List (List Text), name : Text }) → 28 | [ p.name ] # concat Text p.children 29 | ) 30 | 31 | let result 32 | : List Text 33 | = everybody example 34 | 35 | in result 36 | -------------------------------------------------------------------------------- /dhall/tests/lint/success/regression0A.dhall: -------------------------------------------------------------------------------- 1 | let replicate = https://prelude.dhall-lang.org/List/replicate.dhall 2 | 3 | in let Config = { name : Text, age : Natural } 4 | 5 | in let Configs = List Config 6 | 7 | in replicate 10 Text "!" 8 | -------------------------------------------------------------------------------- /dhall/tests/lint/success/regression0B.dhall: -------------------------------------------------------------------------------- 1 | let replicate = https://prelude.dhall-lang.org/List/replicate.dhall 2 | 3 | in replicate 10 Text "!" 4 | -------------------------------------------------------------------------------- /dhall/tests/package/dir/package.dhall: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhall-lang/dhall-haskell/2d8a3970808e205800ea8a007600ebd63cf24662/dhall/tests/package/dir/package.dhall -------------------------------------------------------------------------------- /dhall/tests/package/dir/subdirectory1/test.dhall: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhall-lang/dhall-haskell/2d8a3970808e205800ea8a007600ebd63cf24662/dhall/tests/package/dir/subdirectory1/test.dhall -------------------------------------------------------------------------------- /dhall/tests/package/dir/subdirectory2/wrong-extension.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhall-lang/dhall-haskell/2d8a3970808e205800ea8a007600ebd63cf24662/dhall/tests/package/dir/subdirectory2/wrong-extension.txt -------------------------------------------------------------------------------- /dhall/tests/package/dir/test.dhall: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhall-lang/dhall-haskell/2d8a3970808e205800ea8a007600ebd63cf24662/dhall/tests/package/dir/test.dhall -------------------------------------------------------------------------------- /dhall/tests/package/dir/wrong-extension.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhall-lang/dhall-haskell/2d8a3970808e205800ea8a007600ebd63cf24662/dhall/tests/package/dir/wrong-extension.txt -------------------------------------------------------------------------------- /dhall/tests/package/empty/wrong-extension.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhall-lang/dhall-haskell/2d8a3970808e205800ea8a007600ebd63cf24662/dhall/tests/package/empty/wrong-extension.txt -------------------------------------------------------------------------------- /dhall/tests/package/other/package.dhall: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhall-lang/dhall-haskell/2d8a3970808e205800ea8a007600ebd63cf24662/dhall/tests/package/other/package.dhall -------------------------------------------------------------------------------- /dhall/tests/package/package.dhall: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhall-lang/dhall-haskell/2d8a3970808e205800ea8a007600ebd63cf24662/dhall/tests/package/package.dhall -------------------------------------------------------------------------------- /dhall/tests/package/test.dhall: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhall-lang/dhall-haskell/2d8a3970808e205800ea8a007600ebd63cf24662/dhall/tests/package/test.dhall -------------------------------------------------------------------------------- /dhall/tests/package/test/test.dhall: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhall-lang/dhall-haskell/2d8a3970808e205800ea8a007600ebd63cf24662/dhall/tests/package/test/test.dhall -------------------------------------------------------------------------------- /dhall/tests/recursive/expr0.dhall: -------------------------------------------------------------------------------- 1 | λ(Expr : Type) 2 | → let ExprF = 3 | < LitF : Natural 4 | | AddF : { _1 : Expr, _2 : Expr } 5 | | MulF : { _1 : Expr, _2 : Expr } 6 | > 7 | 8 | in λ(Fix : ExprF → Expr) 9 | → let Lit = λ(x : Natural) → Fix (ExprF.LitF x) 10 | 11 | let Add = 12 | λ(x : Expr) → λ(y : Expr) → Fix (ExprF.AddF { _1 = x, _2 = y }) 13 | 14 | let Mul = 15 | λ(x : Expr) → λ(y : Expr) → Fix (ExprF.MulF { _1 = x, _2 = y }) 16 | 17 | in Add (Mul (Lit 3) (Lit 7)) (Add (Lit 1) (Lit 2)) 18 | -------------------------------------------------------------------------------- /dhall/tests/recursive/expr1.dhall: -------------------------------------------------------------------------------- 1 | λ(a : Type) 2 | → let ExprF = 3 | < LitF : Natural 4 | | AddF : { _1 : a, _2 : a } 5 | | MulF : { _1 : a, _2 : a } 6 | > 7 | 8 | in λ(a : ExprF → a) 9 | → let Lit = λ(x : Natural) → a (ExprF.LitF x) 10 | 11 | let Add = λ(x : a@1) → λ(y : a@1) → a (ExprF.AddF { _1 = x, _2 = y }) 12 | 13 | let Mul = λ(x : a@1) → λ(y : a@1) → a (ExprF.MulF { _1 = x, _2 = y }) 14 | 15 | in Add (Mul (Lit 3) (Lit 7)) (Add (Lit 1) (Lit 2)) 16 | -------------------------------------------------------------------------------- /dhall/tests/regression/issue151a.dhall: -------------------------------------------------------------------------------- 1 | \(A : Type) -> let foo : (\(x : A) -> x x) (\(x : A) -> x x) = 1 in foo 2 | -------------------------------------------------------------------------------- /dhall/tests/regression/issue151b.dhall: -------------------------------------------------------------------------------- 1 | \(A : Type) -> \(omega : ((\(x : A) -> x x) (\(x : A) -> x x))) -> omega 1 2 | -------------------------------------------------------------------------------- /dhall/tests/regression/issue1584.dhall: -------------------------------------------------------------------------------- 1 | [ let ifX = 1 in ifX 2 | , let thenX = 1 in thenX 3 | , let elseX = 1 in elseX 4 | , let letX = 1 in letX 5 | , let inX = 1 in inX 6 | , let usingX = 1 in usingX 7 | {- Fixing this case appears to be difficult for the current parser 8 | implementation 9 | -} 10 | -- , let missingX = 1 in missingX 11 | , let asX = 1 in asX 12 | , let InfinityX = 1 in InfinityX 13 | , let NaNX = 1 in NaNX 14 | , let mergeX = 1 in mergeX 15 | , let SomeX = 1 in SomeX 16 | , let toMapX = 1 in toMapX 17 | , let assertX = 1 in assertX 18 | , let forallX = 1 in forallX 19 | ] 20 | -------------------------------------------------------------------------------- /dhall/tests/regression/issue164.dhall: -------------------------------------------------------------------------------- 1 | '' 2 | Single quotes like ' should be allowed in a single-quoted string'' 3 | -------------------------------------------------------------------------------- /dhall/tests/regression/issue1646.dhall: -------------------------------------------------------------------------------- 1 | let f = \(d : Double) -> \(i : Integer) -> {=} in f 3.1 -1 2 | -------------------------------------------------------------------------------- /dhall/tests/regression/issue1732.dhall: -------------------------------------------------------------------------------- 1 | let x = 0 in { x , a = 0 } 2 | -------------------------------------------------------------------------------- /dhall/tests/regression/issue1884.dhall: -------------------------------------------------------------------------------- 1 | let Make = \(T: Type) -> { Type = { a: T }, default = {=} } 2 | 3 | in 4 | (Make Natural) with default = { a = 2 } 5 | -------------------------------------------------------------------------------- /dhall/tests/regression/issue201.dhall: -------------------------------------------------------------------------------- 1 | let Foo = {} in {=} : Foo 2 | -------------------------------------------------------------------------------- /dhall/tests/regression/issue2088.dhall: -------------------------------------------------------------------------------- 1 | [ { x = 1 }.{ x }, { x = 1 } ] 2 | -------------------------------------------------------------------------------- /dhall/tests/regression/issue216a.dhall: -------------------------------------------------------------------------------- 1 | let GitHubProject : Type = { owner : Text, repo : Text } in 2 | let gitHubProject = \( github : GitHubProject ) -> 3 | let gitHubRoot = "https://github.com/${github.owner}/${github.repo}" 4 | in { bugReports = "${gitHubRoot}/issues" } 5 | in gitHubProject 6 | -------------------------------------------------------------------------------- /dhall/tests/regression/issue216b.dhall: -------------------------------------------------------------------------------- 1 | λ(github : { owner : Text, repo : Text }) → 2 | { bugReports = "https://github.com/${github.owner}/${github.repo}/issues" } -------------------------------------------------------------------------------- /dhall/tests/schemas/multipleA.dhall: -------------------------------------------------------------------------------- 1 | {=} 2 | -------------------------------------------------------------------------------- /dhall/tests/schemas/multipleB.dhall: -------------------------------------------------------------------------------- 1 | let schemas = ./tests/schemas/multipleSchema.dhall in schemas.B::{=} 2 | -------------------------------------------------------------------------------- /dhall/tests/schemas/multipleSchema.dhall: -------------------------------------------------------------------------------- 1 | { A = { Type = {}, default = {=} } 2 | , B = { Type = {}, default = {=} } 3 | } 4 | -------------------------------------------------------------------------------- /dhall/tests/schemas/personA.dhall: -------------------------------------------------------------------------------- 1 | { addr = { city = None Text, country = "Switzerland" } 2 | , alive = True 3 | , name = "Alice" 4 | } 5 | -------------------------------------------------------------------------------- /dhall/tests/schemas/personB.dhall: -------------------------------------------------------------------------------- 1 | let schemas = ./tests/schemas/personSchema.dhall 2 | 3 | in schemas.Person::{ 4 | , addr = schemas.Address::{ country = "Switzerland" } 5 | , name = "Alice" 6 | } 7 | -------------------------------------------------------------------------------- /dhall/tests/schemas/personSchema.dhall: -------------------------------------------------------------------------------- 1 | let Address = 2 | { Type = { country : Text, city : Optional Text } 3 | , default.city = None Text 4 | } 5 | 6 | let Person = 7 | { Type = { name : Text, addr : Address.Type, alive : Bool } 8 | , default.alive = True 9 | } 10 | 11 | in { Person, Address } 12 | -------------------------------------------------------------------------------- /dhall/tests/tags/let.dhall: -------------------------------------------------------------------------------- 1 | let foo = "foo" 2 | 3 | let bar = foo 4 | in bar 5 | -------------------------------------------------------------------------------- /dhall/tests/tags/let.tags: -------------------------------------------------------------------------------- 1 | 2 | ./tests/tags/let.dhall,66 3 | let.dhall1,1 4 | /let.dhall1,1 5 | let foo foo1,5 6 | let bar bar3,22 7 | -------------------------------------------------------------------------------- /dhall/tests/tags/nonunicode.dhall: -------------------------------------------------------------------------------- 1 | -- abc 2 | let foo = "bar" 3 | in foo 4 | -------------------------------------------------------------------------------- /dhall/tests/tags/nonunicode.tags: -------------------------------------------------------------------------------- 1 | 2 | ./tests/tags/nonunicode.dhall,63 3 | nonunicode.dhall1,1 4 | /nonunicode.dhall1,1 5 | let foo foo2,12 6 | -------------------------------------------------------------------------------- /dhall/tests/tags/record.dhall: -------------------------------------------------------------------------------- 1 | {- You can optionally add types 2 | 3 | `x : T` means that `x` has type `T` 4 | -} 5 | 6 | let Config : Type = 7 | {- What happens if you add another field here? -} 8 | { home : Text 9 | , privateKey : Text 10 | , publicKey : Text 11 | , name : { firstName : Text 12 | , secondName : Text 13 | } 14 | } 15 | 16 | let makeUser : Text -> Config = \(user : Text) -> 17 | let home : Text = "/home/${user}" 18 | let privateKey : Text = "${home}/.ssh/id_ed25519" 19 | let publicKey : Text = "${privateKey}.pub" 20 | let config : Config = 21 | { home = home 22 | , privateKey = privateKey 23 | , publicKey = publicKey 24 | , name = { firstName = user 25 | , secondName = "" 26 | } 27 | } 28 | in config 29 | 30 | let configs : List Config = 31 | [ makeUser "bill" 32 | , makeUser "jane" 33 | ] 34 | 35 | in configs 36 | -------------------------------------------------------------------------------- /dhall/tests/tags/record.tags: -------------------------------------------------------------------------------- 1 | 2 | ./tests/tags/record.dhall,335 3 | record.dhall1,1 4 | /record.dhall1,1 5 | let Config Config6,81 6 | { home home8,161 7 | , privateKey privateKey9,181 8 | , publicKey publicKey10,207 9 | , name name11,232 10 | , name : { firstName firstName11,241 11 | , secondName secondName12,275 12 | let makeUser makeUser16,323 13 | let configs configs30,804 14 | -------------------------------------------------------------------------------- /dhall/tests/tags/recordlit.dhall: -------------------------------------------------------------------------------- 1 | {- This is an example Dhall configuration file 2 | 3 | Can you spot the mistake? 4 | 5 | Fix the typo, then move onto the "Definitions" example 6 | -} 7 | 8 | { home = "/home/bill" 9 | , privateKey = "/home/bill/.ssh/id_ed25519" 10 | , publicKey = "/home/blil/.ssh/id_ed25519.pub" 11 | , name = { firstName = "Bill" 12 | , secondName = "Bar" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /dhall/tests/tags/recordlit.tags: -------------------------------------------------------------------------------- 1 | 2 | ./tests/tags/recordlit.dhall,223 3 | recordlit.dhall1,1 4 | /recordlit.dhall1,1 5 | { home home8,143 6 | , privateKey privateKey9,171 7 | , publicKey publicKey10,215 8 | , name name11,263 9 | , name = { firstName firstName11,272 10 | , secondName secondName12,302 11 | -------------------------------------------------------------------------------- /dhall/tests/tags/simple.tags: -------------------------------------------------------------------------------- 1 | 2 | ./tests/tags/simple.dhall,254 3 | simple.dhall1,1 4 | /simple.dhall1,1 5 | let generate generate6,100 6 | let makeUser makeUser17,409 7 | let buildUser buildUser26,680 8 | let Config Config32,880 9 | { home home33,897 10 | , privateKey privateKey34,917 11 | , publicKey publicKey35,943 12 | -------------------------------------------------------------------------------- /dhall/tests/tags/unicode.dhall: -------------------------------------------------------------------------------- 1 | -- αβξ 2 | let foo = "bar" 3 | in foo 4 | -------------------------------------------------------------------------------- /dhall/tests/tags/unicode.tags: -------------------------------------------------------------------------------- 1 | 2 | ./tests/tags/unicode.dhall,57 3 | unicode.dhall1,1 4 | /unicode.dhall1,1 5 | let foo foo2,15 6 | -------------------------------------------------------------------------------- /dhall/tests/tags/union.dhall: -------------------------------------------------------------------------------- 1 | let Element = < Left : Natural | Right : Bool | Middle : < Top : Text | Bottom : Bool> > 2 | 3 | let foo = Element.Left 6 4 | in foo 5 | -------------------------------------------------------------------------------- /dhall/tests/tags/union.tags: -------------------------------------------------------------------------------- 1 | 2 | ./tests/tags/union.dhall,394 3 | union.dhall1,1 4 | /union.dhall1,1 5 | let Element Element1,5 6 | let Element = < Left Left1,17 7 | let Element = < Left : Natural | Right Right1,34 8 | let Element = < Left : Natural | Right : Bool | Middle Middle1,49 9 | let Element = < Left : Natural | Right : Bool | Middle : < Top Top1,60 10 | let Element = < Left : Natural | Right : Bool | Middle : < Top : Text | Bottom Bottom1,73 11 | let foo foo3,95 12 | -------------------------------------------------------------------------------- /dhall/tests/th/Department.dhall: -------------------------------------------------------------------------------- 1 | < Sales | Engineering | Marketing > 2 | -------------------------------------------------------------------------------- /dhall/tests/th/Employee.dhall: -------------------------------------------------------------------------------- 1 | { name : Text, department : ./Department.dhall } 2 | -------------------------------------------------------------------------------- /dhall/tests/th/HigherKindSingle.dhall: -------------------------------------------------------------------------------- 1 | \(a : Type -> Type) -> \(a : Type) -> { foo : a, bar : a@1 a, bam : Text } 2 | -------------------------------------------------------------------------------- /dhall/tests/th/HigherKindUnion.dhall: -------------------------------------------------------------------------------- 1 | \(a : Type) -> \(b : Type) -> < Foo : a | Bar : b > 2 | -------------------------------------------------------------------------------- /dhall/tests/th/Time.dhall: -------------------------------------------------------------------------------- 1 | { txTime : Time, txDate : Date, txTimeZone : TimeZone } 2 | -------------------------------------------------------------------------------- /dhall/tests/th/example.dhall: -------------------------------------------------------------------------------- 1 | < A : { x : Bool, y : List Text } | B : Optional (List Natural) | C > 2 | -------------------------------------------------------------------------------- /dhall/tests/th/issue2066.dhall: -------------------------------------------------------------------------------- 1 | let Bar = { baz : Integer } 2 | 3 | let Foo = { foo : Integer, bar : Bar } 4 | 5 | let Qux = < Foo : Foo | Bar : Bar > 6 | 7 | in { Foo, Bar, Qux } 8 | -------------------------------------------------------------------------------- /dhall/tests/to-directory-tree/fixpoint-allow-path-separators.dhall: -------------------------------------------------------------------------------- 1 | let User = (./fixpoint-helper.dhall).User 2 | 3 | let Group = (./fixpoint-helper.dhall).Group 4 | 5 | let Mode = (./fixpoint-helper.dhall).Mode 6 | 7 | let Make = (./fixpoint-helper.dhall).Make 8 | 9 | in \(r : Type) -> 10 | \(make : Make r) -> 11 | [ make.file 12 | { name = "non-existent-1/file" 13 | , content = "" 14 | , user = None User 15 | , group = None Group 16 | , mode = None Mode 17 | } 18 | , make.directory 19 | { name = "non-existent-2/directory" 20 | , content = [] : List r 21 | , user = None User 22 | , group = None Group 23 | , mode = None Mode 24 | } 25 | ] 26 | -------------------------------------------------------------------------------- /dhall/tests/to-directory-tree/fixpoint-empty.dhall: -------------------------------------------------------------------------------- 1 | let Make = (./fixpoint-helper.dhall).Make 2 | 3 | in \(r : Type) -> \(make : Make r) -> [] : List r 4 | -------------------------------------------------------------------------------- /dhall/tests/to-directory-tree/fixpoint-helper.dhall: -------------------------------------------------------------------------------- 1 | let User = < UserId : Natural | UserName : Text > 2 | 3 | let Group = < GroupId : Natural | GroupName : Text > 4 | 5 | let Access = 6 | { execute : Optional Bool, read : Optional Bool, write : Optional Bool } 7 | 8 | let Mode = 9 | { user : Optional Access 10 | , group : Optional Access 11 | , other : Optional Access 12 | } 13 | 14 | let Entry = 15 | \(content : Type) -> 16 | { name : Text 17 | , content : content 18 | , user : Optional User 19 | , group : Optional Group 20 | , mode : Optional Mode 21 | } 22 | 23 | let Make = 24 | \(r : Type) -> 25 | { directory : Entry (List r) -> r 26 | , binary-file : Entry Bytes -> r 27 | , file : Entry Text -> r 28 | } 29 | 30 | in { User, Group, Access, Mode, Entry, Make } 31 | -------------------------------------------------------------------------------- /dhall/tests/to-directory-tree/fixpoint-permissions.dhall: -------------------------------------------------------------------------------- 1 | let User = (./fixpoint-helper.dhall).User 2 | 3 | let Group = (./fixpoint-helper.dhall).Group 4 | 5 | let Make = (./fixpoint-helper.dhall).Make 6 | 7 | let no-access = { execute = Some False, read = Some False, write = Some False } 8 | 9 | let full-access = { execute = Some True, read = Some True, write = Some True } 10 | 11 | in \(r : Type) -> 12 | \(make : Make r) -> 13 | [ make.file 14 | { name = "file" 15 | , content = "" 16 | , user = None User 17 | , group = None Group 18 | , mode = Some 19 | { user = Some full-access 20 | , group = Some no-access 21 | , other = Some no-access 22 | } 23 | } 24 | ] 25 | -------------------------------------------------------------------------------- /dhall/tests/to-directory-tree/fixpoint-simple.dhall: -------------------------------------------------------------------------------- 1 | let User = (./fixpoint-helper.dhall).User 2 | 3 | let Group = (./fixpoint-helper.dhall).Group 4 | 5 | let Mode = (./fixpoint-helper.dhall).Mode 6 | 7 | let Make = (./fixpoint-helper.dhall).Make 8 | 9 | in \(r : Type) -> 10 | \(make : Make r) -> 11 | [ make.file 12 | { name = "file" 13 | , content = "" 14 | , user = None User 15 | , group = None Group 16 | , mode = None Mode 17 | } 18 | , make.directory 19 | { name = "directory" 20 | , content = [] : List r 21 | , user = None User 22 | , group = None Group 23 | , mode = None Mode 24 | } 25 | ] 26 | -------------------------------------------------------------------------------- /dhall/tests/to-directory-tree/fixpoint-usergroup.dhall: -------------------------------------------------------------------------------- 1 | let User = (./fixpoint-helper.dhall).User 2 | 3 | let Group = (./fixpoint-helper.dhall).Group 4 | 5 | let Mode = (./fixpoint-helper.dhall).Mode 6 | 7 | let Make = (./fixpoint-helper.dhall).Make 8 | 9 | in \(r : Type) -> 10 | \(make : Make r) -> 11 | [ make.file 12 | { name = "ids" 13 | , content = "" 14 | , user = Some (User.UserId 0) 15 | , group = Some (Group.GroupId 0) 16 | , mode = None Mode 17 | } 18 | , make.file 19 | { name = "names" 20 | , content = "" 21 | , user = Some (User.UserName "user") 22 | , group = Some (Group.GroupName "group") 23 | , mode = None Mode 24 | } 25 | ] 26 | -------------------------------------------------------------------------------- /dhall/tests/to-directory-tree/type.dhall: -------------------------------------------------------------------------------- 1 | let User = < UserId : Natural | UserName : Text > 2 | 3 | let Group = < GroupId : Natural | GroupName : Text > 4 | 5 | let Access = 6 | { execute : Optional Bool, read : Optional Bool, write : Optional Bool } 7 | 8 | let Mode = 9 | { user : Optional Access 10 | , group : Optional Access 11 | , other : Optional Access 12 | } 13 | 14 | let Entry = 15 | \(content : Type) -> 16 | { name : Text 17 | , content : content 18 | , user : Optional User 19 | , group : Optional Group 20 | , mode : Optional Mode 21 | } 22 | 23 | in forall (result : Type) -> 24 | let DirectoryEntry = Entry (List result) 25 | 26 | let BinaryFileEntry = Entry Bytes 27 | 28 | let TextFileEntry = Entry Text 29 | 30 | let Make = 31 | { directory : DirectoryEntry -> result 32 | , binary-file : BinaryFileEntry -> result 33 | , file : TextFileEntry -> result 34 | } 35 | 36 | in forall (make : Make) -> List result 37 | -------------------------------------------------------------------------------- /dhall/tests/tutorial/Union.dhall: -------------------------------------------------------------------------------- 1 | < Left : Natural | Right : Bool> 2 | -------------------------------------------------------------------------------- /dhall/tests/tutorial/process.dhall: -------------------------------------------------------------------------------- 1 | λ(union : < Left : Natural | Right : Bool >) 2 | → let handlers = 3 | { Left = Natural/even -- Natural/even is a built-in function 4 | , Right = λ(b : Bool) → b 5 | } 6 | in merge handlers union : Bool 7 | -------------------------------------------------------------------------------- /dhall/tests/tutorial/substitution1.dhall: -------------------------------------------------------------------------------- 1 | Result.Failure +1 2 | -------------------------------------------------------------------------------- /dhall/tests/tutorial/substitution2.dhall: -------------------------------------------------------------------------------- 1 | ./substitution1.dhall 2 | -------------------------------------------------------------------------------- /dhall/tests/tutorial/substitution3.dhall: -------------------------------------------------------------------------------- 1 | Foo 2 | -------------------------------------------------------------------------------- /dhall/tests/tutorial/unions0A.dhall: -------------------------------------------------------------------------------- 1 | ./process.dhall ((./Union.dhall).Left 3) 2 | -------------------------------------------------------------------------------- /dhall/tests/tutorial/unions0B.dhall: -------------------------------------------------------------------------------- 1 | False 2 | -------------------------------------------------------------------------------- /dhall/tests/tutorial/unions1A.dhall: -------------------------------------------------------------------------------- 1 | ./process.dhall ((./Union.dhall).Right True) 2 | -------------------------------------------------------------------------------- /dhall/tests/tutorial/unions1B.dhall: -------------------------------------------------------------------------------- 1 | True 2 | -------------------------------------------------------------------------------- /dhall/tests/tutorial/unions3A.dhall: -------------------------------------------------------------------------------- 1 | let MyType = < Empty | Person : { name : Text, age : Natural } > 2 | 3 | in [ MyType.Empty -- Note the absence of any argument to `Empty` 4 | , MyType.Person { name = "John", age = 23 } 5 | , MyType.Person { name = "Amy" , age = 25 } 6 | ] 7 | -------------------------------------------------------------------------------- /dhall/tests/tutorial/unions3B.dhall: -------------------------------------------------------------------------------- 1 | [ < Empty | Person : { age : Natural, name : Text } >.Empty 2 | , < Empty | Person : { age : Natural, name : Text } >.Person 3 | { age = 23, name = "John" } 4 | , < Empty | Person : { age : Natural, name : Text } >.Person 5 | { age = 25, name = "Amy" } 6 | ] 7 | -------------------------------------------------------------------------------- /dhall/tests/tutorial/unions4A.dhall: -------------------------------------------------------------------------------- 1 | < Empty : {} | Person : { name : Text, age : Natural } > 2 | -------------------------------------------------------------------------------- /dhall/tests/tutorial/unions4B.dhall: -------------------------------------------------------------------------------- 1 | < Empty : {} | Person : { name : Text, age : Natural } > 2 | -------------------------------------------------------------------------------- /nix/dhall-docs-generator.nix: -------------------------------------------------------------------------------- 1 | { stdenv, dhall-docs, unzip, fetchurl, tree, src, name }: 2 | 3 | stdenv.mkDerivation rec { 4 | inherit src name; 5 | 6 | buildInputs = [ dhall-docs unzip tree ]; 7 | 8 | installPhase = '' 9 | mkdir -p $out/nix-support 10 | export XDG_DATA_HOME=$out/ 11 | dhall-docs --input ./ --output-link ./dhall-docs > $out/dhall-docs.log 12 | htmlDir=$(readlink -f ./dhall-docs) 13 | tree $XDG_DATA_HOME/dhall-docs > $out/dhall-docs.log 14 | echo "report html $htmlDir" >> $out/nix-support/hydra-build-products 15 | echo "report log $out/dhall-docs.log" >> $out/nix-support/hydra-build-products 16 | ''; 17 | } 18 | 19 | -------------------------------------------------------------------------------- /nix/packages/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhall-lang/dhall-haskell/2d8a3970808e205800ea8a007600ebd63cf24662/nix/packages/.gitkeep -------------------------------------------------------------------------------- /nix/packages/co-log-core.nix: -------------------------------------------------------------------------------- 1 | { mkDerivation, base, doctest, Glob, lib }: 2 | mkDerivation { 3 | pname = "co-log-core"; 4 | version = "0.3.2.1"; 5 | sha256 = "7e12a8e02a02c0e2c13e8def101ee8243c6c033392cd3031b63fe5db5168ff87"; 6 | libraryHaskellDepends = [ base ]; 7 | testHaskellDepends = [ base doctest Glob ]; 8 | homepage = "https://github.com/co-log/co-log-core"; 9 | description = "Composable Contravariant Comonadic Logging Library"; 10 | license = lib.licenses.mpl20; 11 | } 12 | -------------------------------------------------------------------------------- /nix/packages/hashable.nix: -------------------------------------------------------------------------------- 1 | { mkDerivation, base, bytestring, containers, deepseq, ghc-prim 2 | , HUnit, integer-gmp, lib, QuickCheck, random, test-framework 3 | , test-framework-hunit, test-framework-quickcheck2, text, unix 4 | }: 5 | mkDerivation { 6 | pname = "hashable"; 7 | version = "1.3.4.1"; 8 | sha256 = "2ca5fdf03a54718d02f02c9c9ab619ccf10fa8bcf3b0ff15b27edc26019a3196"; 9 | libraryHaskellDepends = [ 10 | base bytestring containers deepseq ghc-prim integer-gmp text 11 | ]; 12 | testHaskellDepends = [ 13 | base bytestring ghc-prim HUnit QuickCheck random test-framework 14 | test-framework-hunit test-framework-quickcheck2 text unix 15 | ]; 16 | homepage = "http://github.com/haskell-unordered-containers/hashable"; 17 | description = "A class for types that can be converted to a hash value"; 18 | license = lib.licenses.bsd3; 19 | } 20 | -------------------------------------------------------------------------------- /nix/packages/lucid.nix: -------------------------------------------------------------------------------- 1 | { mkDerivation, base, bifunctors, blaze-builder, bytestring 2 | , containers, criterion, deepseq, hashable, hspec, HUnit, lib 3 | , mmorph, mtl, parsec, text, transformers, unordered-containers 4 | }: 5 | mkDerivation { 6 | pname = "lucid"; 7 | version = "2.11.0"; 8 | sha256 = "549715bd4ca7b3034e689df6d73e459a8b4efbff0c74b8f961fc0edbf7082ed4"; 9 | libraryHaskellDepends = [ 10 | base blaze-builder bytestring containers hashable mmorph mtl text 11 | transformers unordered-containers 12 | ]; 13 | testHaskellDepends = [ 14 | base bifunctors hspec HUnit mtl parsec text 15 | ]; 16 | benchmarkHaskellDepends = [ 17 | base blaze-builder bytestring criterion deepseq text transformers 18 | ]; 19 | homepage = "https://github.com/chrisdone/lucid"; 20 | description = "Clear to write, read and edit DSL for HTML"; 21 | license = lib.licenses.bsd3; 22 | } 23 | -------------------------------------------------------------------------------- /nix/packages/relude.nix: -------------------------------------------------------------------------------- 1 | { mkDerivation, base, bytestring, containers, criterion, deepseq 2 | , doctest, ghc-prim, Glob, hashable, hedgehog, lib, mtl, stm, text 3 | , transformers, unordered-containers 4 | }: 5 | mkDerivation { 6 | pname = "relude"; 7 | version = "1.0.0.1"; 8 | sha256 = "4fdcfe29205ebe8a2b976339207cffeb5bede18f8d7b3332245ac5ed5e508933"; 9 | libraryHaskellDepends = [ 10 | base bytestring containers deepseq ghc-prim hashable mtl stm text 11 | transformers unordered-containers 12 | ]; 13 | testHaskellDepends = [ 14 | base bytestring containers doctest Glob hedgehog text 15 | ]; 16 | benchmarkHaskellDepends = [ base criterion unordered-containers ]; 17 | homepage = "https://github.com/kowainik/relude"; 18 | description = "Safe, performant, user-friendly and lightweight Haskell Standard Library"; 19 | license = lib.licenses.mit; 20 | } 21 | -------------------------------------------------------------------------------- /nix/packages/semialign.nix: -------------------------------------------------------------------------------- 1 | { mkDerivation, base, containers, hashable, indexed-traversable 2 | , indexed-traversable-instances, lib, semigroupoids, tagged, these 3 | , transformers, unordered-containers, vector 4 | }: 5 | mkDerivation { 6 | pname = "semialign"; 7 | version = "1.2.0.1"; 8 | sha256 = "d900697041ae4b0cca3243273a2b3e80bcf74d937405d6a5ff34dc33ee952132"; 9 | revision = "3"; 10 | editedCabalFile = "0dbcdnksik508i12arh3s6bis6779lx5f1df0jkc0bp797inhd7f"; 11 | libraryHaskellDepends = [ 12 | base containers hashable indexed-traversable 13 | indexed-traversable-instances semigroupoids tagged these 14 | transformers unordered-containers vector 15 | ]; 16 | homepage = "https://github.com/haskellari/these"; 17 | description = "Align and Zip type-classes from the common Semialign ancestor"; 18 | license = lib.licenses.bsd3; 19 | } 20 | -------------------------------------------------------------------------------- /nix/packages/tasty-bench.nix: -------------------------------------------------------------------------------- 1 | { mkDerivation, base, containers, deepseq, ghc-prim, lib, tasty }: 2 | mkDerivation { 3 | pname = "tasty-bench"; 4 | version = "0.4"; 5 | sha256 = "829c80478dcd6450f3ddab0232603850bff6bc7277b2eecf126b2fd9c26d7be2"; 6 | libraryHaskellDepends = [ base containers deepseq ghc-prim tasty ]; 7 | benchmarkHaskellDepends = [ base ]; 8 | homepage = "https://github.com/Bodigrim/tasty-bench"; 9 | description = "Featherlight benchmark framework"; 10 | license = lib.licenses.mit; 11 | } 12 | -------------------------------------------------------------------------------- /nix/packages/text-rope.nix: -------------------------------------------------------------------------------- 1 | { mkDerivation, base, deepseq, lib, random, tasty, tasty-bench 2 | , tasty-quickcheck, text, vector 3 | }: 4 | mkDerivation { 5 | pname = "text-rope"; 6 | version = "0.2"; 7 | sha256 = "b14422855e9cc375a31c22758454013ac629671331de6ccb77b496509bcae78b"; 8 | enableSeparateDataOutput = true; 9 | libraryHaskellDepends = [ base deepseq text vector ]; 10 | testHaskellDepends = [ base tasty tasty-quickcheck text ]; 11 | benchmarkHaskellDepends = [ base random tasty-bench text ]; 12 | homepage = "https://github.com/Bodigrim/text-rope"; 13 | description = "Text lines and ropes"; 14 | license = lib.licenses.bsd3; 15 | } 16 | -------------------------------------------------------------------------------- /nix/pinnedNixpkgs.nix: -------------------------------------------------------------------------------- 1 | { nixpkgs = builtins.fetchTarball { 2 | url = "https://github.com/NixOS/nixpkgs/archive/391f93a83c3a486475d60eb4a569bb6afbf306ad.tar.gz"; 3 | 4 | sha256 = "0s5f7j2akh3g0013880jfbigdaac1z76r9dv46yw6k254ba2r6nq"; 5 | }; 6 | } 7 | -------------------------------------------------------------------------------- /nix/test-dhall.nix: -------------------------------------------------------------------------------- 1 | (import ./shared.nix {}).test-dhall 2 | -------------------------------------------------------------------------------- /stack.ghc-9.8.yaml: -------------------------------------------------------------------------------- 1 | resolver: lts-23.6 2 | packages: 3 | - dhall 4 | - dhall-bash 5 | - dhall-csv 6 | - dhall-docs 7 | - dhall-json 8 | - dhall-lsp-server 9 | # - dhall-nix 10 | - dhall-openapi 11 | - dhall-toml 12 | - dhall-yaml 13 | extra-deps: 14 | - microlens-0.4.14.0@sha256:1061edc3fa96fa868692891d6e0a0e198a2983a3d154a7a0ce4a708c1c3f652f,4722 15 | - special-values-0.1.0.0@sha256:ea855ec644acac84d3a4c9aadae9ba70a11d1d48d00940805dbb81cc95672bbd,1416 16 | nix: 17 | packages: 18 | - ncurses 19 | - zlib 20 | flags: 21 | # https://github.com/RyanGlScott/mintty/issues/4 22 | mintty: 23 | Win32-2-13-1: false 24 | -------------------------------------------------------------------------------- /stack.yaml: -------------------------------------------------------------------------------- 1 | stack.ghc-9.6.yaml --------------------------------------------------------------------------------