hydra-kernel 0.17.7 → 0.18.0
raw patch · 618 files changed
+100863/−97062 lines, 618 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
This diff is very large; some files are shown as “too large to diff”. Download the raw patch for the complete diff.
Files
- CHANGELOG.md +80/−0
- hydra-kernel.cabal +313/−304
- src/main/haskell/Hydra/Adapt.hs +0/−823
- src/main/haskell/Hydra/Analysis.hs +0/−335
- src/main/haskell/Hydra/Annotations.hs +0/−253
- src/main/haskell/Hydra/Arity.hs +0/−81
- src/main/haskell/Hydra/Ast.hs +0/−250
- src/main/haskell/Hydra/Checking.hs +0/−724
- src/main/haskell/Hydra/Classes.hs +0/−88
- src/main/haskell/Hydra/Codegen.hs +0/−597
- src/main/haskell/Hydra/Coders.hs +0/−250
- src/main/haskell/Hydra/Constants.hs +0/−118
- src/main/haskell/Hydra/Core.hs +0/−743
- src/main/haskell/Hydra/Core/Adapt.hs +825/−0
- src/main/haskell/Hydra/Core/Analysis.hs +337/−0
- src/main/haskell/Hydra/Core/Annotations.hs +255/−0
- src/main/haskell/Hydra/Core/Arity.hs +83/−0
- src/main/haskell/Hydra/Core/Ast.hs +250/−0
- src/main/haskell/Hydra/Core/Checking.hs +726/−0
- src/main/haskell/Hydra/Core/Classes.hs +90/−0
- src/main/haskell/Hydra/Core/Codegen.hs +722/−0
- src/main/haskell/Hydra/Core/Coders.hs +250/−0
- src/main/haskell/Hydra/Core/Constants.hs +120/−0
- src/main/haskell/Hydra/Core/Decode/Ast.hs +249/−0
- src/main/haskell/Hydra/Core/Decode/Coders.hs +117/−0
- src/main/haskell/Hydra/Core/Decode/Diff.hs +160/−0
- src/main/haskell/Hydra/Core/Decode/Docs.hs +46/−0
- src/main/haskell/Hydra/Core/Decode/Error/Checking.hs +238/−0
- src/main/haskell/Hydra/Core/Decode/Error/File.hs +59/−0
- src/main/haskell/Hydra/Core/Decode/Error/Model.hs +737/−0
- src/main/haskell/Hydra/Core/Decode/Error/Packaging.hs +244/−0
- src/main/haskell/Hydra/Core/Decode/Error/System.hs +57/−0
- src/main/haskell/Hydra/Core/Decode/Errors.hs +310/−0
- src/main/haskell/Hydra/Core/Decode/File.hs +88/−0
- src/main/haskell/Hydra/Core/Decode/Json/Model.hs +68/−0
- src/main/haskell/Hydra/Core/Decode/Markdown.hs +233/−0
- src/main/haskell/Hydra/Core/Decode/Model.hs +628/−0
- src/main/haskell/Hydra/Core/Decode/Packaging.hs +352/−0
- src/main/haskell/Hydra/Core/Decode/Parsing.hs +78/−0
- src/main/haskell/Hydra/Core/Decode/Paths.hs +487/−0
- src/main/haskell/Hydra/Core/Decode/Query.hs +294/−0
- src/main/haskell/Hydra/Core/Decode/Regex.hs +201/−0
- src/main/haskell/Hydra/Core/Decode/Relational.hs +104/−0
- src/main/haskell/Hydra/Core/Decode/System.hs +85/−0
- src/main/haskell/Hydra/Core/Decode/Tabular.hs +71/−0
- src/main/haskell/Hydra/Core/Decode/Testing.hs +30/−0
- src/main/haskell/Hydra/Core/Decode/Time.hs +42/−0
- src/main/haskell/Hydra/Core/Decode/Topology.hs +68/−0
- src/main/haskell/Hydra/Core/Decode/Typed.hs +55/−0
- src/main/haskell/Hydra/Core/Decode/Typing.hs +170/−0
- src/main/haskell/Hydra/Core/Decode/Util.hs +120/−0
- src/main/haskell/Hydra/Core/Decode/Validation.hs +56/−0
- src/main/haskell/Hydra/Core/Decode/Variants.hs +123/−0
- src/main/haskell/Hydra/Core/Decode/Yaml/Model.hs +99/−0
- src/main/haskell/Hydra/Core/Decoding.hs +2267/−0
- src/main/haskell/Hydra/Core/Dependencies.hs +360/−0
- src/main/haskell/Hydra/Core/Diff.hs +194/−0
- src/main/haskell/Hydra/Core/Differentiation.hs +451/−0
- src/main/haskell/Hydra/Core/Docs.hs +25/−0
- src/main/haskell/Hydra/Core/Dsl/Analysis.hs +314/−0
- src/main/haskell/Hydra/Core/Dsl/Annotations.hs +331/−0
- src/main/haskell/Hydra/Core/Dsl/Arity.hs +106/−0
- src/main/haskell/Hydra/Core/Dsl/Ast.hs +1027/−0
- src/main/haskell/Hydra/Core/Dsl/Checking.hs +516/−0
- src/main/haskell/Hydra/Core/Dsl/Coders.hs +2117/−0
- src/main/haskell/Hydra/Core/Dsl/Constants.hs +152/−0
- src/main/haskell/Hydra/Core/Dsl/Dependencies.hs +210/−0
- src/main/haskell/Hydra/Core/Dsl/Diff.hs +857/−0
- src/main/haskell/Hydra/Core/Dsl/Docs.hs +38/−0
- src/main/haskell/Hydra/Core/Dsl/Environment.hs +200/−0
- src/main/haskell/Hydra/Core/Dsl/Error/Checking.hs +960/−0
- src/main/haskell/Hydra/Core/Dsl/Error/File.hs +65/−0
- src/main/haskell/Hydra/Core/Dsl/Error/Model.hs +3843/−0
- src/main/haskell/Hydra/Core/Dsl/Error/Packaging.hs +1269/−0
- src/main/haskell/Hydra/Core/Dsl/Error/System.hs +65/−0
- src/main/haskell/Hydra/Core/Dsl/Errors.hs +857/−0
- src/main/haskell/Hydra/Core/Dsl/Extract/Json.hs +172/−0
- src/main/haskell/Hydra/Core/Dsl/File.hs +382/−0
- src/main/haskell/Hydra/Core/Dsl/Formatting.hs +226/−0
- src/main/haskell/Hydra/Core/Dsl/Graph.hs +921/−0
- src/main/haskell/Hydra/Core/Dsl/Json/Bootstrap.hs +38/−0
- src/main/haskell/Hydra/Core/Dsl/Json/Decode.hs +164/−0
- src/main/haskell/Hydra/Core/Dsl/Json/Decoding.hs +124/−0
- src/main/haskell/Hydra/Core/Dsl/Json/Encode.hs +130/−0
- src/main/haskell/Hydra/Core/Dsl/Json/Model.hs +73/−0
- src/main/haskell/Hydra/Core/Dsl/Json/Parser.hs +150/−0
- src/main/haskell/Hydra/Core/Dsl/Json/Writer.hs +112/−0
- src/main/haskell/Hydra/Core/Dsl/Json/Yaml/Decode.hs +96/−0
- src/main/haskell/Hydra/Core/Dsl/Json/Yaml/Encode.hs +96/−0
- src/main/haskell/Hydra/Core/Dsl/Lexical.hs +306/−0
- src/main/haskell/Hydra/Core/Dsl/Lib/Chars.hs +126/−0
- src/main/haskell/Hydra/Core/Dsl/Lib/Defaults.hs +28/−0
- src/main/haskell/Hydra/Core/Dsl/Lib/Effects.hs +154/−0
- src/main/haskell/Hydra/Core/Dsl/Lib/Eithers.hs +218/−0
- src/main/haskell/Hydra/Core/Dsl/Lib/Equality.hs +88/−0
- src/main/haskell/Hydra/Core/Dsl/Lib/Files.hs +180/−0
- src/main/haskell/Hydra/Core/Dsl/Lib/Functions.hs +108/−0
- src/main/haskell/Hydra/Core/Dsl/Lib/Lists.hs +431/−0
- src/main/haskell/Hydra/Core/Dsl/Lib/Literals.hs +457/−0
- src/main/haskell/Hydra/Core/Dsl/Lib/Logic.hs +106/−0
- src/main/haskell/Hydra/Core/Dsl/Lib/Maps.hs +267/−0
- src/main/haskell/Hydra/Core/Dsl/Lib/Math.hs +397/−0
- src/main/haskell/Hydra/Core/Dsl/Lib/Optionals.hs +202/−0
- src/main/haskell/Hydra/Core/Dsl/Lib/Ordering.hs +133/−0
- src/main/haskell/Hydra/Core/Dsl/Lib/Pairs.hs +104/−0
- src/main/haskell/Hydra/Core/Dsl/Lib/Regex.hs +128/−0
- src/main/haskell/Hydra/Core/Dsl/Lib/Sets.hs +189/−0
- src/main/haskell/Hydra/Core/Dsl/Lib/Strings.hs +155/−0
- src/main/haskell/Hydra/Core/Dsl/Lib/System.hs +123/−0
- src/main/haskell/Hydra/Core/Dsl/Lib/Text.hs +85/−0
- src/main/haskell/Hydra/Core/Dsl/Markdown.hs +827/−0
- src/main/haskell/Hydra/Core/Dsl/Model.hs +2557/−0
- src/main/haskell/Hydra/Core/Dsl/Names.hs +252/−0
- src/main/haskell/Hydra/Core/Dsl/Packaging.hs +2011/−0
- src/main/haskell/Hydra/Core/Dsl/Parsing.hs +237/−0
- src/main/haskell/Hydra/Core/Dsl/Paths.hs +1773/−0
- src/main/haskell/Hydra/Core/Dsl/Predicates.hs +220/−0
- src/main/haskell/Hydra/Core/Dsl/Print/Docs.hs +134/−0
- src/main/haskell/Hydra/Core/Dsl/Query.hs +952/−0
- src/main/haskell/Hydra/Core/Dsl/Reduction.hs +191/−0
- src/main/haskell/Hydra/Core/Dsl/Refs.hs +145/−0
- src/main/haskell/Hydra/Core/Dsl/Regex.hs +438/−0
- src/main/haskell/Hydra/Core/Dsl/Relational.hs +518/−0
- src/main/haskell/Hydra/Core/Dsl/Resolution.hs +285/−0
- src/main/haskell/Hydra/Core/Dsl/Rewriting.hs +293/−0
- src/main/haskell/Hydra/Core/Dsl/Scoping.hs +137/−0
- src/main/haskell/Hydra/Core/Dsl/Serialization.hs +521/−0
- src/main/haskell/Hydra/Core/Dsl/Sorting.hs +172/−0
- src/main/haskell/Hydra/Core/Dsl/Strip.hs +157/−0
- src/main/haskell/Hydra/Core/Dsl/System.hs +357/−0
- src/main/haskell/Hydra/Core/Dsl/Tabular.hs +290/−0
- src/main/haskell/Hydra/Core/Dsl/Test/Transform.hs +177/−0
- src/main/haskell/Hydra/Core/Dsl/Test/Utils.hs +102/−0
- src/main/haskell/Hydra/Core/Dsl/Testing.hs +637/−0
- src/main/haskell/Hydra/Core/Dsl/Time.hs +85/−0
- src/main/haskell/Hydra/Core/Dsl/Topology.hs +455/−0
- src/main/haskell/Hydra/Core/Dsl/Typing.hs +1451/−0
- src/main/haskell/Hydra/Core/Dsl/Util.hs +274/−0
- src/main/haskell/Hydra/Core/Dsl/Validation.hs +286/−0
- src/main/haskell/Hydra/Core/Dsl/Variables.hs +200/−0
- src/main/haskell/Hydra/Core/Dsl/Variants.hs +432/−0
- src/main/haskell/Hydra/Core/Dsl/Yaml/Model.hs +105/−0
- src/main/haskell/Hydra/Core/Dsls.hs +924/−0
- src/main/haskell/Hydra/Core/Encode/Ast.hs +247/−0
- src/main/haskell/Hydra/Core/Encode/Coders.hs +110/−0
- src/main/haskell/Hydra/Core/Encode/Diff.hs +167/−0
- src/main/haskell/Hydra/Core/Encode/Docs.hs +27/−0
- src/main/haskell/Hydra/Core/Encode/Error/Checking.hs +244/−0
- src/main/haskell/Hydra/Core/Encode/Error/File.hs +42/−0
- src/main/haskell/Hydra/Core/Encode/Error/Model.hs +873/−0
- src/main/haskell/Hydra/Core/Encode/Error/Packaging.hs +272/−0
- src/main/haskell/Hydra/Core/Encode/Error/System.hs +42/−0
- src/main/haskell/Hydra/Core/Encode/Errors.hs +321/−0
- src/main/haskell/Hydra/Core/Encode/File.hs +90/−0
- src/main/haskell/Hydra/Core/Encode/Json/Model.hs +49/−0
- src/main/haskell/Hydra/Core/Encode/Markdown.hs +209/−0
- src/main/haskell/Hydra/Core/Encode/Model.hs +759/−0
- src/main/haskell/Hydra/Core/Encode/Packaging.hs +362/−0
- src/main/haskell/Hydra/Core/Encode/Parsing.hs +54/−0
- src/main/haskell/Hydra/Core/Encode/Paths.hs +604/−0
- src/main/haskell/Hydra/Core/Encode/Query.hs +296/−0
- src/main/haskell/Hydra/Core/Encode/Regex.hs +167/−0
- src/main/haskell/Hydra/Core/Encode/Relational.hs +102/−0
- src/main/haskell/Hydra/Core/Encode/System.hs +65/−0
- src/main/haskell/Hydra/Core/Encode/Tabular.hs +68/−0
- src/main/haskell/Hydra/Core/Encode/Testing.hs +19/−0
- src/main/haskell/Hydra/Core/Encode/Time.hs +25/−0
- src/main/haskell/Hydra/Core/Encode/Topology.hs +49/−0
- src/main/haskell/Hydra/Core/Encode/Typed.hs +52/−0
- src/main/haskell/Hydra/Core/Encode/Typing.hs +180/−0
- src/main/haskell/Hydra/Core/Encode/Util.hs +107/−0
- src/main/haskell/Hydra/Core/Encode/Validation.hs +47/−0
- src/main/haskell/Hydra/Core/Encode/Variants.hs +252/−0
- src/main/haskell/Hydra/Core/Encode/Yaml/Model.hs +69/−0
- src/main/haskell/Hydra/Core/Encoding.hs +813/−0
- src/main/haskell/Hydra/Core/Environment.hs +193/−0
- src/main/haskell/Hydra/Core/Error/Checking.hs +251/−0
- src/main/haskell/Hydra/Core/Error/File.hs +37/−0
- src/main/haskell/Hydra/Core/Error/Model.hs +923/−0
- src/main/haskell/Hydra/Core/Error/Packaging.hs +287/−0
- src/main/haskell/Hydra/Core/Error/System.hs +37/−0
- src/main/haskell/Hydra/Core/Errors.hs +312/−0
- src/main/haskell/Hydra/Core/Extract/Json.hs +110/−0
- src/main/haskell/Hydra/Core/Extract/Model.hs +643/−0
- src/main/haskell/Hydra/Core/Extract/Util.hs +52/−0
- src/main/haskell/Hydra/Core/File.hs +89/−0
- src/main/haskell/Hydra/Core/Formatting.hs +241/−0
- src/main/haskell/Hydra/Core/Graph.hs +103/−0
- src/main/haskell/Hydra/Core/Hoisting.hs +525/−0
- src/main/haskell/Hydra/Core/Inference.hs +1179/−0
- src/main/haskell/Hydra/Core/Json/Bootstrap.hs +3300/−0
- src/main/haskell/Hydra/Core/Json/Decode.hs +373/−0
- src/main/haskell/Hydra/Core/Json/Decoding.hs +83/−0
- src/main/haskell/Hydra/Core/Json/Encode.hs +344/−0
- src/main/haskell/Hydra/Core/Json/Model.hs +40/−0
- src/main/haskell/Hydra/Core/Json/Parser.hs +156/−0
- src/main/haskell/Hydra/Core/Json/Writer.hs +113/−0
- src/main/haskell/Hydra/Core/Json/Yaml/Decode.hs +85/−0
- src/main/haskell/Hydra/Core/Json/Yaml/Encode.hs +62/−0
- src/main/haskell/Hydra/Core/Languages.hs +80/−0
- src/main/haskell/Hydra/Core/Lexical.hs +311/−0
- src/main/haskell/Hydra/Core/Lib/Chars.hs +270/−0
- src/main/haskell/Hydra/Core/Lib/Defaults.hs +1472/−0
- src/main/haskell/Hydra/Core/Lib/Effects.hs +403/−0
- src/main/haskell/Hydra/Core/Lib/Eithers.hs +1181/−0
- src/main/haskell/Hydra/Core/Lib/Equality.hs +127/−0
- src/main/haskell/Hydra/Core/Lib/Files.hs +452/−0
- src/main/haskell/Hydra/Core/Lib/Functions.hs +279/−0
- src/main/haskell/Hydra/Core/Lib/Hashing.hs +94/−0
- src/main/haskell/Hydra/Core/Lib/Lists.hs +1790/−0
- src/main/haskell/Hydra/Core/Lib/Literals.hs +1530/−0
- src/main/haskell/Hydra/Core/Lib/Logic.hs +207/−0
- src/main/haskell/Hydra/Core/Lib/Maps.hs +1227/−0
- src/main/haskell/Hydra/Core/Lib/Math.hs +1374/−0
- src/main/haskell/Hydra/Core/Lib/Optionals.hs +903/−0
- src/main/haskell/Hydra/Core/Lib/Ordering.hs +339/−0
- src/main/haskell/Hydra/Core/Lib/Pairs.hs +227/−0
- src/main/haskell/Hydra/Core/Lib/Regex.hs +251/−0
- src/main/haskell/Hydra/Core/Lib/Sets.hs +702/−0
- src/main/haskell/Hydra/Core/Lib/Strings.hs +364/−0
- src/main/haskell/Hydra/Core/Lib/System.hs +266/−0
- src/main/haskell/Hydra/Core/Lib/Text.hs +96/−0
- src/main/haskell/Hydra/Core/Literals.hs +69/−0
- src/main/haskell/Hydra/Core/Markdown.hs +218/−0
- src/main/haskell/Hydra/Core/Model.hs +743/−0
- src/main/haskell/Hydra/Core/Names.hs +227/−0
- src/main/haskell/Hydra/Core/Overlay/Haskell/AsTerm.hs +52/−0
- src/main/haskell/Hydra/Core/Overlay/Haskell/AsType.hs +25/−0
- src/main/haskell/Hydra/Core/Overlay/Haskell/Bootstrap.hs +76/−0
- src/main/haskell/Hydra/Core/Overlay/Haskell/Dsl/Annotations.hs +85/−0
- src/main/haskell/Hydra/Core/Overlay/Haskell/Dsl/Base.hs +28/−0
- src/main/haskell/Hydra/Core/Overlay/Haskell/Dsl/Common.hs +15/−0
- src/main/haskell/Hydra/Core/Overlay/Haskell/Dsl/Deep/Core.hs +172/−0
- src/main/haskell/Hydra/Core/Overlay/Haskell/Dsl/Deep/Lib/Math.hs +131/−0
- src/main/haskell/Hydra/Core/Overlay/Haskell/Dsl/LiteralTypes.hs +86/−0
- src/main/haskell/Hydra/Core/Overlay/Haskell/Dsl/Literals.hs +95/−0
- src/main/haskell/Hydra/Core/Overlay/Haskell/Dsl/Meta/Core.hs +61/−0
- src/main/haskell/Hydra/Core/Overlay/Haskell/Dsl/Meta/Graph.hs +39/−0
- src/main/haskell/Hydra/Core/Overlay/Haskell/Dsl/Meta/Literals.hs +80/−0
- src/main/haskell/Hydra/Core/Overlay/Haskell/Dsl/Meta/Tabular.hs +14/−0
- src/main/haskell/Hydra/Core/Overlay/Haskell/Dsl/Meta/Terms.hs +529/−0
- src/main/haskell/Hydra/Core/Overlay/Haskell/Dsl/Meta/Testing.hs +626/−0
- src/main/haskell/Hydra/Core/Overlay/Haskell/Dsl/Meta/Types.hs +299/−0
- src/main/haskell/Hydra/Core/Overlay/Haskell/Dsl/Meta/Variants.hs +68/−0
- src/main/haskell/Hydra/Core/Overlay/Haskell/Dsl/Phantoms.hs +564/−0
- src/main/haskell/Hydra/Core/Overlay/Haskell/Dsl/Prims.hs +382/−0
- src/main/haskell/Hydra/Core/Overlay/Haskell/Dsl/Terms.hs +403/−0
- src/main/haskell/Hydra/Core/Overlay/Haskell/Dsl/Tests.hs +29/−0
- src/main/haskell/Hydra/Core/Overlay/Haskell/Dsl/Types.hs +271/−0
- src/main/haskell/Hydra/Core/Overlay/Haskell/Lib/Chars.hs +39/−0
- src/main/haskell/Hydra/Core/Overlay/Haskell/Lib/Effects.hs +49/−0
- src/main/haskell/Hydra/Core/Overlay/Haskell/Lib/Eithers.hs +78/−0
- src/main/haskell/Hydra/Core/Overlay/Haskell/Lib/Equality.hs +12/−0
- src/main/haskell/Hydra/Core/Overlay/Haskell/Lib/Files.hs +138/−0
- src/main/haskell/Hydra/Core/Overlay/Haskell/Lib/Functions.hs +26/−0
- src/main/haskell/Hydra/Core/Overlay/Haskell/Lib/Hashing.hs +16/−0
- src/main/haskell/Hydra/Core/Overlay/Haskell/Lib/Lists.hs +194/−0
- src/main/haskell/Hydra/Core/Overlay/Haskell/Lib/Literals.hs +308/−0
- src/main/haskell/Hydra/Core/Overlay/Haskell/Lib/Logic.hs +24/−0
- src/main/haskell/Hydra/Core/Overlay/Haskell/Lib/Maps.hs +98/−0
- src/main/haskell/Hydra/Core/Overlay/Haskell/Lib/Math.hs +507/−0
- src/main/haskell/Hydra/Core/Overlay/Haskell/Lib/Optionals.hs +69/−0
- src/main/haskell/Hydra/Core/Overlay/Haskell/Lib/Ordering.hs +37/−0
- src/main/haskell/Hydra/Core/Overlay/Haskell/Lib/Pairs.hs +22/−0
- src/main/haskell/Hydra/Core/Overlay/Haskell/Lib/Regex.hs +75/−0
- src/main/haskell/Hydra/Core/Overlay/Haskell/Lib/Sets.hs +69/−0
- src/main/haskell/Hydra/Core/Overlay/Haskell/Lib/Strings.hs +55/−0
- src/main/haskell/Hydra/Core/Overlay/Haskell/Lib/System.hs +116/−0
- src/main/haskell/Hydra/Core/Overlay/Haskell/Lib/Text.hs +20/−0
- src/main/haskell/Hydra/Core/Overlay/Haskell/Libraries.hs +703/−0
- src/main/haskell/Hydra/Core/Packaging.hs +384/−0
- src/main/haskell/Hydra/Core/Parse/Docs.hs +73/−0
- src/main/haskell/Hydra/Core/Parse/Regex.hs +149/−0
- src/main/haskell/Hydra/Core/Parsers.hs +202/−0
- src/main/haskell/Hydra/Core/Parsing.hs +61/−0
- src/main/haskell/Hydra/Core/Paths.hs +572/−0
- src/main/haskell/Hydra/Core/Predicates.hs +223/−0
- src/main/haskell/Hydra/Core/Print/Docs.hs +91/−0
- src/main/haskell/Hydra/Core/Print/Emacs/Regex.hs +173/−0
- src/main/haskell/Hydra/Core/Print/Error/Model.hs +453/−0
- src/main/haskell/Hydra/Core/Print/Error/Packaging.hs +194/−0
- src/main/haskell/Hydra/Core/Print/Errors.hs +218/−0
- src/main/haskell/Hydra/Core/Print/Graph.hs +53/−0
- src/main/haskell/Hydra/Core/Print/Markdown.hs +155/−0
- src/main/haskell/Hydra/Core/Print/Model.hs +539/−0
- src/main/haskell/Hydra/Core/Print/Paths.hs +139/−0
- src/main/haskell/Hydra/Core/Print/Pcre/Regex.hs +160/−0
- src/main/haskell/Hydra/Core/Print/Posix/Regex.hs +178/−0
- src/main/haskell/Hydra/Core/Print/Regex.hs +156/−0
- src/main/haskell/Hydra/Core/Print/Typing.hs +76/−0
- src/main/haskell/Hydra/Core/Print/Util.hs +58/−0
- src/main/haskell/Hydra/Core/Print/Variants.hs +89/−0
- src/main/haskell/Hydra/Core/Query.hs +284/−0
- src/main/haskell/Hydra/Core/Reduction.hs +626/−0
- src/main/haskell/Hydra/Core/Reflect.hs +266/−0
- src/main/haskell/Hydra/Core/Refs.hs +83/−0
- src/main/haskell/Hydra/Core/Regex.hs +163/−0
- src/main/haskell/Hydra/Core/Relational.hs +113/−0
- src/main/haskell/Hydra/Core/Resolution.hs +269/−0
- src/main/haskell/Hydra/Core/Rewriting.hs +1075/−0
- src/main/haskell/Hydra/Core/Scoping.hs +212/−0
- src/main/haskell/Hydra/Core/Serialization.hs +669/−0
- src/main/haskell/Hydra/Core/Sorting.hs +255/−0
- src/main/haskell/Hydra/Core/Strip.hs +193/−0
- src/main/haskell/Hydra/Core/Substitution.hs +253/−0
- src/main/haskell/Hydra/Core/Subterms.hs +357/−0
- src/main/haskell/Hydra/Core/System.hs +71/−0
- src/main/haskell/Hydra/Core/Tabular.hs +68/−0
- src/main/haskell/Hydra/Core/Templates.hs +123/−0
- src/main/haskell/Hydra/Core/Test/Transform.hs +147/−0
- src/main/haskell/Hydra/Core/Test/Utils.hs +79/−0
- src/main/haskell/Hydra/Core/Testing.hs +107/−0
- src/main/haskell/Hydra/Core/Time.hs +26/−0
- src/main/haskell/Hydra/Core/Topology.hs +67/−0
- src/main/haskell/Hydra/Core/Typed.hs +56/−0
- src/main/haskell/Hydra/Core/Typing.hs +207/−0
- src/main/haskell/Hydra/Core/Unification.hs +218/−0
- src/main/haskell/Hydra/Core/Util.hs +92/−0
- src/main/haskell/Hydra/Core/Validate/Model.hs +648/−0
- src/main/haskell/Hydra/Core/Validate/Packaging.hs +448/−0
- src/main/haskell/Hydra/Core/Validate/Paths.hs +76/−0
- src/main/haskell/Hydra/Core/Validation.hs +50/−0
- src/main/haskell/Hydra/Core/Variables.hs +322/−0
- src/main/haskell/Hydra/Core/Variants.hs +163/−0
- src/main/haskell/Hydra/Core/Yaml/Model.hs +63/−0
- src/main/haskell/Hydra/Decode/Ast.hs +0/−249
- src/main/haskell/Hydra/Decode/Coders.hs +0/−117
- src/main/haskell/Hydra/Decode/Core.hs +0/−628
- src/main/haskell/Hydra/Decode/Docs.hs +0/−46
- src/main/haskell/Hydra/Decode/Error/Checking.hs +0/−238
- src/main/haskell/Hydra/Decode/Error/Core.hs +0/−737
- src/main/haskell/Hydra/Decode/Error/File.hs +0/−59
- src/main/haskell/Hydra/Decode/Error/Packaging.hs +0/−244
- src/main/haskell/Hydra/Decode/Error/System.hs +0/−55
- src/main/haskell/Hydra/Decode/Errors.hs +0/−310
- src/main/haskell/Hydra/Decode/File.hs +0/−88
- src/main/haskell/Hydra/Decode/Json/Model.hs +0/−68
- src/main/haskell/Hydra/Decode/Packaging.hs +0/−350
- src/main/haskell/Hydra/Decode/Parsing.hs +0/−78
- src/main/haskell/Hydra/Decode/Paths.hs +0/−477
- src/main/haskell/Hydra/Decode/Query.hs +0/−290
- src/main/haskell/Hydra/Decode/Regex.hs +0/−201
- src/main/haskell/Hydra/Decode/Relational.hs +0/−104
- src/main/haskell/Hydra/Decode/System.hs +0/−85
- src/main/haskell/Hydra/Decode/Tabular.hs +0/−71
- src/main/haskell/Hydra/Decode/Testing.hs +0/−30
- src/main/haskell/Hydra/Decode/Time.hs +0/−42
- src/main/haskell/Hydra/Decode/Topology.hs +0/−68
- src/main/haskell/Hydra/Decode/Typed.hs +0/−55
- src/main/haskell/Hydra/Decode/Typing.hs +0/−170
- src/main/haskell/Hydra/Decode/Util.hs +0/−116
- src/main/haskell/Hydra/Decode/Validation.hs +0/−56
- src/main/haskell/Hydra/Decode/Variants.hs +0/−121
- src/main/haskell/Hydra/Decode/Yaml/Model.hs +0/−97
- src/main/haskell/Hydra/Decoding.hs +0/−2258
- src/main/haskell/Hydra/Dependencies.hs +0/−358
- src/main/haskell/Hydra/Differentiation.hs +0/−449
- src/main/haskell/Hydra/Docs.hs +0/−25
- src/main/haskell/Hydra/Dsl/Analysis.hs +0/−310
- src/main/haskell/Hydra/Dsl/Annotations.hs +0/−327
- src/main/haskell/Hydra/Dsl/Arity.hs +0/−102
- src/main/haskell/Hydra/Dsl/Ast.hs +0/−1027
- src/main/haskell/Hydra/Dsl/Checking.hs +0/−512
- src/main/haskell/Hydra/Dsl/Coders.hs +0/−2117
- src/main/haskell/Hydra/Dsl/Constants.hs +0/−147
- src/main/haskell/Hydra/Dsl/Core.hs +0/−2557
- src/main/haskell/Hydra/Dsl/Dependencies.hs +0/−206
- src/main/haskell/Hydra/Dsl/Docs.hs +0/−38
- src/main/haskell/Hydra/Dsl/Environment.hs +0/−196
- src/main/haskell/Hydra/Dsl/Error/Checking.hs +0/−957
- src/main/haskell/Hydra/Dsl/Error/Core.hs +0/−3830
- src/main/haskell/Hydra/Dsl/Error/File.hs +0/−65
- src/main/haskell/Hydra/Dsl/Error/Packaging.hs +0/−1268
- src/main/haskell/Hydra/Dsl/Error/System.hs +0/−65
- src/main/haskell/Hydra/Dsl/Errors.hs +0/−856
- src/main/haskell/Hydra/Dsl/Extract/Json.hs +0/−168
- src/main/haskell/Hydra/Dsl/File.hs +0/−382
- src/main/haskell/Hydra/Dsl/Formatting.hs +0/−222
- src/main/haskell/Hydra/Dsl/Graph.hs +0/−921
- src/main/haskell/Hydra/Dsl/Json/Bootstrap.hs +0/−38
- src/main/haskell/Hydra/Dsl/Json/Decode.hs +0/−160
- src/main/haskell/Hydra/Dsl/Json/Decoding.hs +0/−120
- src/main/haskell/Hydra/Dsl/Json/Encode.hs +0/−126
- src/main/haskell/Hydra/Dsl/Json/Model.hs +0/−73
- src/main/haskell/Hydra/Dsl/Json/Parser.hs +0/−146
- src/main/haskell/Hydra/Dsl/Json/Writer.hs +0/−108
- src/main/haskell/Hydra/Dsl/Json/Yaml/Decode.hs +0/−92
- src/main/haskell/Hydra/Dsl/Json/Yaml/Encode.hs +0/−92
- src/main/haskell/Hydra/Dsl/Lexical.hs +0/−302
- src/main/haskell/Hydra/Dsl/Lib/Chars.hs +0/−122
- src/main/haskell/Hydra/Dsl/Lib/Defaults.hs +0/−28
- src/main/haskell/Hydra/Dsl/Lib/Effects.hs +0/−150
- src/main/haskell/Hydra/Dsl/Lib/Eithers.hs +0/−214
- src/main/haskell/Hydra/Dsl/Lib/Equality.hs +0/−84
- src/main/haskell/Hydra/Dsl/Lib/Files.hs +0/−176
- src/main/haskell/Hydra/Dsl/Lib/Functions.hs +0/−104
- src/main/haskell/Hydra/Dsl/Lib/Lists.hs +0/−427
- src/main/haskell/Hydra/Dsl/Lib/Literals.hs +0/−453
- src/main/haskell/Hydra/Dsl/Lib/Logic.hs +0/−102
- src/main/haskell/Hydra/Dsl/Lib/Maps.hs +0/−263
- src/main/haskell/Hydra/Dsl/Lib/Math.hs too large to diff
- src/main/haskell/Hydra/Dsl/Lib/Optionals.hs too large to diff
- src/main/haskell/Hydra/Dsl/Lib/Ordering.hs too large to diff
- src/main/haskell/Hydra/Dsl/Lib/Pairs.hs too large to diff
- src/main/haskell/Hydra/Dsl/Lib/Regex.hs too large to diff
- src/main/haskell/Hydra/Dsl/Lib/Sets.hs too large to diff
- src/main/haskell/Hydra/Dsl/Lib/Strings.hs too large to diff
- src/main/haskell/Hydra/Dsl/Lib/System.hs too large to diff
- src/main/haskell/Hydra/Dsl/Lib/Text.hs too large to diff
- src/main/haskell/Hydra/Dsl/Names.hs too large to diff
- src/main/haskell/Hydra/Dsl/Packaging.hs too large to diff
- src/main/haskell/Hydra/Dsl/Parsing.hs too large to diff
- src/main/haskell/Hydra/Dsl/Paths.hs too large to diff
- src/main/haskell/Hydra/Dsl/Predicates.hs too large to diff
- src/main/haskell/Hydra/Dsl/Print/Docs.hs too large to diff
- src/main/haskell/Hydra/Dsl/Query.hs too large to diff
- src/main/haskell/Hydra/Dsl/Reduction.hs too large to diff
- src/main/haskell/Hydra/Dsl/Refs.hs too large to diff
- src/main/haskell/Hydra/Dsl/Regex.hs too large to diff
- src/main/haskell/Hydra/Dsl/Relational.hs too large to diff
- src/main/haskell/Hydra/Dsl/Resolution.hs too large to diff
- src/main/haskell/Hydra/Dsl/Rewriting.hs too large to diff
- src/main/haskell/Hydra/Dsl/Scoping.hs too large to diff
- src/main/haskell/Hydra/Dsl/Serialization.hs too large to diff
- src/main/haskell/Hydra/Dsl/Sorting.hs too large to diff
- src/main/haskell/Hydra/Dsl/Strip.hs too large to diff
- src/main/haskell/Hydra/Dsl/System.hs too large to diff
- src/main/haskell/Hydra/Dsl/Tabular.hs too large to diff
- src/main/haskell/Hydra/Dsl/Test/Transform.hs too large to diff
- src/main/haskell/Hydra/Dsl/Test/Utils.hs too large to diff
- src/main/haskell/Hydra/Dsl/Testing.hs too large to diff
- src/main/haskell/Hydra/Dsl/Time.hs too large to diff
- src/main/haskell/Hydra/Dsl/Topology.hs too large to diff
- src/main/haskell/Hydra/Dsl/Typing.hs too large to diff
- src/main/haskell/Hydra/Dsl/Util.hs too large to diff
- src/main/haskell/Hydra/Dsl/Validation.hs too large to diff
- src/main/haskell/Hydra/Dsl/Variables.hs too large to diff
- src/main/haskell/Hydra/Dsl/Variants.hs too large to diff
- src/main/haskell/Hydra/Dsl/Yaml/Model.hs too large to diff
- src/main/haskell/Hydra/Dsls.hs too large to diff
- src/main/haskell/Hydra/Encode/Ast.hs too large to diff
- src/main/haskell/Hydra/Encode/Coders.hs too large to diff
- src/main/haskell/Hydra/Encode/Core.hs too large to diff
- src/main/haskell/Hydra/Encode/Docs.hs too large to diff
- src/main/haskell/Hydra/Encode/Error/Checking.hs too large to diff
- src/main/haskell/Hydra/Encode/Error/Core.hs too large to diff
- src/main/haskell/Hydra/Encode/Error/File.hs too large to diff
- src/main/haskell/Hydra/Encode/Error/Packaging.hs too large to diff
- src/main/haskell/Hydra/Encode/Error/System.hs too large to diff
- src/main/haskell/Hydra/Encode/Errors.hs too large to diff
- src/main/haskell/Hydra/Encode/File.hs too large to diff
- src/main/haskell/Hydra/Encode/Json/Model.hs too large to diff
- src/main/haskell/Hydra/Encode/Packaging.hs too large to diff
- src/main/haskell/Hydra/Encode/Parsing.hs too large to diff
- src/main/haskell/Hydra/Encode/Paths.hs too large to diff
- src/main/haskell/Hydra/Encode/Query.hs too large to diff
- src/main/haskell/Hydra/Encode/Regex.hs too large to diff
- src/main/haskell/Hydra/Encode/Relational.hs too large to diff
- src/main/haskell/Hydra/Encode/System.hs too large to diff
- src/main/haskell/Hydra/Encode/Tabular.hs too large to diff
- src/main/haskell/Hydra/Encode/Testing.hs too large to diff
- src/main/haskell/Hydra/Encode/Time.hs too large to diff
- src/main/haskell/Hydra/Encode/Topology.hs too large to diff
- src/main/haskell/Hydra/Encode/Typed.hs too large to diff
- src/main/haskell/Hydra/Encode/Typing.hs too large to diff
- src/main/haskell/Hydra/Encode/Util.hs too large to diff
- src/main/haskell/Hydra/Encode/Validation.hs too large to diff
- src/main/haskell/Hydra/Encode/Variants.hs too large to diff
- src/main/haskell/Hydra/Encode/Yaml/Model.hs too large to diff
- src/main/haskell/Hydra/Encoding.hs too large to diff
- src/main/haskell/Hydra/Environment.hs too large to diff
- src/main/haskell/Hydra/Error/Checking.hs too large to diff
- src/main/haskell/Hydra/Error/Core.hs too large to diff
- src/main/haskell/Hydra/Error/File.hs too large to diff
- src/main/haskell/Hydra/Error/Packaging.hs too large to diff
- src/main/haskell/Hydra/Error/System.hs too large to diff
- src/main/haskell/Hydra/Errors.hs too large to diff
- src/main/haskell/Hydra/Extract/Core.hs too large to diff
- src/main/haskell/Hydra/Extract/Json.hs too large to diff
- src/main/haskell/Hydra/Extract/Util.hs too large to diff
- src/main/haskell/Hydra/File.hs too large to diff
- src/main/haskell/Hydra/Formatting.hs too large to diff
- src/main/haskell/Hydra/Graph.hs too large to diff
- src/main/haskell/Hydra/Hoisting.hs too large to diff
- src/main/haskell/Hydra/Inference.hs too large to diff
- src/main/haskell/Hydra/Json/Bootstrap.hs too large to diff
- src/main/haskell/Hydra/Json/Decode.hs too large to diff
- src/main/haskell/Hydra/Json/Decoding.hs too large to diff
- src/main/haskell/Hydra/Json/Encode.hs too large to diff
- src/main/haskell/Hydra/Json/Model.hs too large to diff
- src/main/haskell/Hydra/Json/Parser.hs too large to diff
- src/main/haskell/Hydra/Json/Writer.hs too large to diff
- src/main/haskell/Hydra/Json/Yaml/Decode.hs too large to diff
- src/main/haskell/Hydra/Json/Yaml/Encode.hs too large to diff
- src/main/haskell/Hydra/Kernel.hs too large to diff
- src/main/haskell/Hydra/Languages.hs too large to diff
- src/main/haskell/Hydra/Lexical.hs too large to diff
- src/main/haskell/Hydra/Lib/Chars.hs too large to diff
- src/main/haskell/Hydra/Lib/Defaults.hs too large to diff
- src/main/haskell/Hydra/Lib/Effects.hs too large to diff
- src/main/haskell/Hydra/Lib/Eithers.hs too large to diff
- src/main/haskell/Hydra/Lib/Equality.hs too large to diff
- src/main/haskell/Hydra/Lib/Files.hs too large to diff
- src/main/haskell/Hydra/Lib/Functions.hs too large to diff
- src/main/haskell/Hydra/Lib/Hashing.hs too large to diff
- src/main/haskell/Hydra/Lib/Lists.hs too large to diff
- src/main/haskell/Hydra/Lib/Literals.hs too large to diff
- src/main/haskell/Hydra/Lib/Logic.hs too large to diff
- src/main/haskell/Hydra/Lib/Maps.hs too large to diff
- src/main/haskell/Hydra/Lib/Math.hs too large to diff
- src/main/haskell/Hydra/Lib/Optionals.hs too large to diff
- src/main/haskell/Hydra/Lib/Ordering.hs too large to diff
- src/main/haskell/Hydra/Lib/Pairs.hs too large to diff
- src/main/haskell/Hydra/Lib/Regex.hs too large to diff
- src/main/haskell/Hydra/Lib/Sets.hs too large to diff
- src/main/haskell/Hydra/Lib/Strings.hs too large to diff
- src/main/haskell/Hydra/Lib/System.hs too large to diff
- src/main/haskell/Hydra/Lib/Text.hs too large to diff
- src/main/haskell/Hydra/Literals.hs too large to diff
- src/main/haskell/Hydra/Names.hs too large to diff
- src/main/haskell/Hydra/Overlay/Haskell/AsTerm.hs too large to diff
- src/main/haskell/Hydra/Overlay/Haskell/AsType.hs too large to diff
- src/main/haskell/Hydra/Overlay/Haskell/Bootstrap.hs too large to diff
- src/main/haskell/Hydra/Overlay/Haskell/Dsl/Annotations.hs too large to diff
- src/main/haskell/Hydra/Overlay/Haskell/Dsl/Deep/Lib/Math.hs too large to diff
- src/main/haskell/Hydra/Overlay/Haskell/Dsl/LiteralTypes.hs too large to diff
- src/main/haskell/Hydra/Overlay/Haskell/Dsl/Literals.hs too large to diff
- src/main/haskell/Hydra/Overlay/Haskell/Dsl/Prims.hs too large to diff
- src/main/haskell/Hydra/Overlay/Haskell/Dsl/Terms.hs too large to diff
- src/main/haskell/Hydra/Overlay/Haskell/Dsl/Tests.hs too large to diff
- src/main/haskell/Hydra/Overlay/Haskell/Dsl/Typed/Base.hs too large to diff
- src/main/haskell/Hydra/Overlay/Haskell/Dsl/Typed/Common.hs too large to diff
- src/main/haskell/Hydra/Overlay/Haskell/Dsl/Typed/Core.hs too large to diff
- src/main/haskell/Hydra/Overlay/Haskell/Dsl/Typed/DeepCore.hs too large to diff
- src/main/haskell/Hydra/Overlay/Haskell/Dsl/Typed/Graph.hs too large to diff
- src/main/haskell/Hydra/Overlay/Haskell/Dsl/Typed/Literals.hs too large to diff
- src/main/haskell/Hydra/Overlay/Haskell/Dsl/Typed/Phantoms.hs too large to diff
- src/main/haskell/Hydra/Overlay/Haskell/Dsl/Typed/Tabular.hs too large to diff
- src/main/haskell/Hydra/Overlay/Haskell/Dsl/Typed/Terms.hs too large to diff
- src/main/haskell/Hydra/Overlay/Haskell/Dsl/Typed/Testing.hs too large to diff
- src/main/haskell/Hydra/Overlay/Haskell/Dsl/Typed/Types.hs too large to diff
- src/main/haskell/Hydra/Overlay/Haskell/Dsl/Typed/Variants.hs too large to diff
- src/main/haskell/Hydra/Overlay/Haskell/Dsl/Types.hs too large to diff
- src/main/haskell/Hydra/Overlay/Haskell/Lib/Chars.hs too large to diff
- src/main/haskell/Hydra/Overlay/Haskell/Lib/Effects.hs too large to diff
- src/main/haskell/Hydra/Overlay/Haskell/Lib/Eithers.hs too large to diff
- src/main/haskell/Hydra/Overlay/Haskell/Lib/Equality.hs too large to diff
- src/main/haskell/Hydra/Overlay/Haskell/Lib/Files.hs too large to diff
- src/main/haskell/Hydra/Overlay/Haskell/Lib/Functions.hs too large to diff
- src/main/haskell/Hydra/Overlay/Haskell/Lib/Hashing.hs too large to diff
- src/main/haskell/Hydra/Overlay/Haskell/Lib/Lists.hs too large to diff
- src/main/haskell/Hydra/Overlay/Haskell/Lib/Literals.hs too large to diff
- src/main/haskell/Hydra/Overlay/Haskell/Lib/Logic.hs too large to diff
- src/main/haskell/Hydra/Overlay/Haskell/Lib/Maps.hs too large to diff
- src/main/haskell/Hydra/Overlay/Haskell/Lib/Math.hs too large to diff
- src/main/haskell/Hydra/Overlay/Haskell/Lib/Optionals.hs too large to diff
- src/main/haskell/Hydra/Overlay/Haskell/Lib/Ordering.hs too large to diff
- src/main/haskell/Hydra/Overlay/Haskell/Lib/Pairs.hs too large to diff
- src/main/haskell/Hydra/Overlay/Haskell/Lib/Regex.hs too large to diff
- src/main/haskell/Hydra/Overlay/Haskell/Lib/Sets.hs too large to diff
- src/main/haskell/Hydra/Overlay/Haskell/Lib/Strings.hs too large to diff
- src/main/haskell/Hydra/Overlay/Haskell/Lib/System.hs too large to diff
- src/main/haskell/Hydra/Overlay/Haskell/Lib/Text.hs too large to diff
- src/main/haskell/Hydra/Overlay/Haskell/Libraries.hs too large to diff
- src/main/haskell/Hydra/Packaging.hs too large to diff
- src/main/haskell/Hydra/Parse/Docs.hs too large to diff
- src/main/haskell/Hydra/Parse/Regex.hs too large to diff
- src/main/haskell/Hydra/Parsers.hs too large to diff
- src/main/haskell/Hydra/Parsing.hs too large to diff
- src/main/haskell/Hydra/Paths.hs too large to diff
- src/main/haskell/Hydra/Predicates.hs too large to diff
- src/main/haskell/Hydra/Print/Core.hs too large to diff
- src/main/haskell/Hydra/Print/Docs.hs too large to diff
- src/main/haskell/Hydra/Print/Emacs/Regex.hs too large to diff
- src/main/haskell/Hydra/Print/Error/Core.hs too large to diff
- src/main/haskell/Hydra/Print/Error/Packaging.hs too large to diff
- src/main/haskell/Hydra/Print/Errors.hs too large to diff
- src/main/haskell/Hydra/Print/Graph.hs too large to diff
- src/main/haskell/Hydra/Print/Paths.hs too large to diff
- src/main/haskell/Hydra/Print/Pcre/Regex.hs too large to diff
- src/main/haskell/Hydra/Print/Posix/Regex.hs too large to diff
- src/main/haskell/Hydra/Print/Regex.hs too large to diff
- src/main/haskell/Hydra/Print/Typing.hs too large to diff
- src/main/haskell/Hydra/Print/Util.hs too large to diff
- src/main/haskell/Hydra/Print/Variants.hs too large to diff
- src/main/haskell/Hydra/Query.hs too large to diff
- src/main/haskell/Hydra/Reduction.hs too large to diff
- src/main/haskell/Hydra/Reflect.hs too large to diff
- src/main/haskell/Hydra/Refs.hs too large to diff
- src/main/haskell/Hydra/Regex.hs too large to diff
- src/main/haskell/Hydra/Relational.hs too large to diff
- src/main/haskell/Hydra/Resolution.hs too large to diff
- src/main/haskell/Hydra/Rewriting.hs too large to diff
- src/main/haskell/Hydra/Scoping.hs too large to diff
- src/main/haskell/Hydra/Serialization.hs too large to diff
- src/main/haskell/Hydra/Sorting.hs too large to diff
- src/main/haskell/Hydra/Strip.hs too large to diff
- src/main/haskell/Hydra/Substitution.hs too large to diff
- src/main/haskell/Hydra/Subterms.hs too large to diff
- src/main/haskell/Hydra/System.hs too large to diff
- src/main/haskell/Hydra/Tabular.hs too large to diff
- src/main/haskell/Hydra/Templates.hs too large to diff
- src/main/haskell/Hydra/Test/Transform.hs too large to diff
- src/main/haskell/Hydra/Test/Utils.hs too large to diff
- src/main/haskell/Hydra/Testing.hs too large to diff
- src/main/haskell/Hydra/Time.hs too large to diff
- src/main/haskell/Hydra/Topology.hs too large to diff
- src/main/haskell/Hydra/Typed.hs too large to diff
- src/main/haskell/Hydra/Typing.hs too large to diff
- src/main/haskell/Hydra/Unification.hs too large to diff
- src/main/haskell/Hydra/Util.hs too large to diff
- src/main/haskell/Hydra/Validate/Core.hs too large to diff
- src/main/haskell/Hydra/Validate/Packaging.hs too large to diff
- src/main/haskell/Hydra/Validate/Paths.hs too large to diff
- src/main/haskell/Hydra/Validation.hs too large to diff
- src/main/haskell/Hydra/Variables.hs too large to diff
- src/main/haskell/Hydra/Variants.hs too large to diff
- src/main/haskell/Hydra/Yaml/Model.hs too large to diff
@@ -15,6 +15,86 @@ --- +## [0.18.0] - 2026-09-29++Module-naming systematization release: every kernel and package module moves onto a uniform+`hydra.core.*` / `hydra.<pkg>.*` grammar, completing the package ⊃ module ⊃ definition containment+tower. The rename touches every module, definition, and cross-host reference in the codebase; this+release exists primarily to ship it as its own coordinated batch. Also lands the translingual regex+primitive pipeline and several silent-correctness fixes in the coder layer.++### Highlights++- **Module-name grammar systematization** ([#729](https://github.com/CategoricalData/hydra/issues/729)):+ every `hydra.*` module renamed onto a uniform package-derived prefix — kernel modules move to+ `hydra.core.*`, package modules to `hydra.<pkg>.*` — closing the long-standing inconsistency where+ a package name had no structural relationship to the module names it contained. The rename spans+ every host (Haskell, Java, Python, Scala, TypeScript, all four Lisp dialects) and required fixing+ stale namespace references, overlay-directory paths, and `hostOverrides` shims across every driver+ and bootstrap script that had hardcoded the old grammar. Further consolidation (a structurally+ enforced package↔prefix law) is tracked for 0.18.1. The kernel package itself is still published as+ `hydra-kernel` (its modules are under `hydra.core.*`); the `hydra-core` package rename #729 called for+ is under review because that name is taken on PyPI and npm+ ([#770](https://github.com/CategoricalData/hydra/issues/770)).+- **Translingual regex primitives** ([#603](https://github.com/CategoricalData/hydra/issues/603)):+ `hydra.lib.regex` primitives (`find`, `findAll`, `matches`, `replace`, `replaceAll`, `split`) now run+ every pattern through the shared `hydra.regex` parse/print pipeline instead of handing raw pattern+ strings to each host's native engine, so a pattern means the same thing on every host. Includes a+ host-independent conformance suite and a leftmost-longest alternation fix in the PCRE/POSIX printers.+- **Silent-corruption fixes across the coder layer**+ ([#744](https://github.com/CategoricalData/hydra/issues/744),+ [#765](https://github.com/CategoricalData/hydra/issues/765),+ [#649](https://github.com/CategoricalData/hydra/issues/649)): fixed data-corrupting bugs in the+ JSON-Schema/Avro/GraphQL/GraphSON/Protobuf coders (extended integer widths, map-key handling), the+ kernel's encode/decode generators (reversed type-parameter order on 2+-param polymorphic types), and+ the Python coder (silently dropping a module's types when types and terms share a file path).+- **Self-hosted specification docs** ([#723](https://github.com/CategoricalData/hydra/issues/723)):+ the module-reference pages under `docs/specification/` are now generated directly from the kernel+ (`bin/regenerate-spec.sh`) via a new metadata-only doc coder, rather than hand-maintained.++### New features++- **[#603](https://github.com/CategoricalData/hydra/issues/603)** host-independent regex conformance+ suite covering the minimal-core grammar (literals, classes, quantifiers, alternation, anchors,+ grouping) across all 9 hosts.+- **[#723](https://github.com/CategoricalData/hydra/issues/723)** `hydra.markdown` type module and+ `generateModuleDoc`, the metadata-only doc coder backing the self-generated spec pages.+- **[#382](https://github.com/CategoricalData/hydra/issues/382)** the Rust coder is split out of+ `hydra-ext` into its own first-class `hydra-rust` package.++### Bug fixes++- **[#744](https://github.com/CategoricalData/hydra/issues/744)** silent data corruption in+ JSON-Schema/Avro/GraphQL/GraphSON/Protobuf coders for extended integer widths and map-key handling.+- **[#765](https://github.com/CategoricalData/hydra/issues/765)** kernel encode/decode generators+ emitted reversed type-parameter order for 2+-param polymorphic types.+- **[#649](https://github.com/CategoricalData/hydra/issues/649)** Python coder silently dropped a+ module's types when types and terms targeted the same output file path.+- **[#572](https://github.com/CategoricalData/hydra/issues/572)** TypeScript kernel-JSON test+ bridge's compact-form decode heuristic mishandled nullary union arms.+- **[#761](https://github.com/CategoricalData/hydra/issues/761)** cold-seed generation ignored+ `hostOverrides.java=local`, silently pulling the published Java host jar instead.+- **[#736](https://github.com/CategoricalData/hydra/issues/736)** Java build now pins JDK 11 via a+ Gradle toolchain block, instead of depending on ambient `JAVA_HOME`.++### Improvements++- **[#327](https://github.com/CategoricalData/hydra/issues/327)** new `hydra.diff` schema-diff type+ module; `Term.Inject` comparison is now by variant name.+- **[#573](https://github.com/CategoricalData/hydra/issues/573)** per-registry publish sets (Hackage,+ Maven, PyPI, npm) are now derived from the package registry itself instead of 13 hand-maintained+ lists — closes a recurring class of silent release-time drift.+- **[#735](https://github.com/CategoricalData/hydra/issues/735)** cross-host decimal-scale test+ filtering now driven by a translingual `scaleDistinct` capability tag instead of hand-copied+ per-host skip lists.++### Documentation++- **[#655](https://github.com/CategoricalData/hydra/issues/655)** documented the overlay-emission+ "implementation wins" decision for bare primitive references (`docs/overlays.md`).++---+ ## [0.17.7] - 2026-09-14 Correctness-hardening point release on the 0.17.x line, consolidating the 0.17.6 breaking batch. It
@@ -5,7 +5,7 @@ -- see: https://github.com/sol/hpack name: hydra-kernel-version: 0.17.7+version: 0.18.0 synopsis: The Hydra kernel: core types, terms, inference, and DSL runtime description: Hydra is an implementation of the LambdaGraph data model, which takes advantage of an isomorphism between labeled hypergraphs and typed lambda calculus: in Hydra, "graphs are programs, and programs are graphs". This package is the Hydra kernel: the core type and term model, type inference, the term rewriting and reduction engine, the primitive library, and the DSL runtime — the code that must be present in every Hydra implementation. The convenient entry point is the Hydra.Kernel module, which re-exports the kernel's collision-free surface. category: Data@@ -27,311 +27,320 @@ library exposed-modules:- Hydra.Adapt- Hydra.Analysis- Hydra.Annotations- Hydra.Arity- Hydra.Ast- Hydra.Checking- Hydra.Classes- Hydra.Codegen- Hydra.Coders- Hydra.Constants- Hydra.Core- Hydra.Decode.Ast- Hydra.Decode.Coders- Hydra.Decode.Core- Hydra.Decode.Docs- Hydra.Decode.Error.Checking- Hydra.Decode.Error.Core- Hydra.Decode.Error.File- Hydra.Decode.Error.Packaging- Hydra.Decode.Error.System- Hydra.Decode.Errors- Hydra.Decode.File- Hydra.Decode.Json.Model- Hydra.Decode.Packaging- Hydra.Decode.Parsing- Hydra.Decode.Paths- Hydra.Decode.Query- Hydra.Decode.Regex- Hydra.Decode.Relational- Hydra.Decode.System- Hydra.Decode.Tabular- Hydra.Decode.Testing- Hydra.Decode.Time- Hydra.Decode.Topology- Hydra.Decode.Typed- Hydra.Decode.Typing- Hydra.Decode.Util- Hydra.Decode.Validation- Hydra.Decode.Variants- Hydra.Decode.Yaml.Model- Hydra.Decoding- Hydra.Dependencies- Hydra.Differentiation- Hydra.Docs- Hydra.Dsl.Analysis- Hydra.Dsl.Annotations- Hydra.Dsl.Arity- Hydra.Dsl.Ast- Hydra.Dsl.Checking- Hydra.Dsl.Coders- Hydra.Dsl.Constants- Hydra.Dsl.Core- Hydra.Dsl.Dependencies- Hydra.Dsl.Docs- Hydra.Dsl.Environment- Hydra.Dsl.Error.Checking- Hydra.Dsl.Error.Core- Hydra.Dsl.Error.File- Hydra.Dsl.Error.Packaging- Hydra.Dsl.Error.System- Hydra.Dsl.Errors- Hydra.Dsl.Extract.Json- Hydra.Dsl.File- Hydra.Dsl.Formatting- Hydra.Dsl.Graph- Hydra.Dsl.Json.Bootstrap- Hydra.Dsl.Json.Decode- Hydra.Dsl.Json.Decoding- Hydra.Dsl.Json.Encode- Hydra.Dsl.Json.Model- Hydra.Dsl.Json.Parser- Hydra.Dsl.Json.Writer- Hydra.Dsl.Json.Yaml.Decode- Hydra.Dsl.Json.Yaml.Encode- Hydra.Dsl.Lexical- Hydra.Dsl.Lib.Chars- Hydra.Dsl.Lib.Defaults- Hydra.Dsl.Lib.Effects- Hydra.Dsl.Lib.Eithers- Hydra.Dsl.Lib.Equality- Hydra.Dsl.Lib.Files- Hydra.Dsl.Lib.Functions- Hydra.Dsl.Lib.Lists- Hydra.Dsl.Lib.Literals- Hydra.Dsl.Lib.Logic- Hydra.Dsl.Lib.Maps- Hydra.Dsl.Lib.Math- Hydra.Dsl.Lib.Optionals- Hydra.Dsl.Lib.Ordering- Hydra.Dsl.Lib.Pairs- Hydra.Dsl.Lib.Regex- Hydra.Dsl.Lib.Sets- Hydra.Dsl.Lib.Strings- Hydra.Dsl.Lib.System- Hydra.Dsl.Lib.Text- Hydra.Dsl.Names- Hydra.Dsl.Packaging- Hydra.Dsl.Parsing- Hydra.Dsl.Paths- Hydra.Dsl.Predicates- Hydra.Dsl.Print.Docs- Hydra.Dsl.Query- Hydra.Dsl.Reduction- Hydra.Dsl.Refs- Hydra.Dsl.Regex- Hydra.Dsl.Relational- Hydra.Dsl.Resolution- Hydra.Dsl.Rewriting- Hydra.Dsl.Scoping- Hydra.Dsl.Serialization- Hydra.Dsl.Sorting- Hydra.Dsl.Strip- Hydra.Dsl.System- Hydra.Dsl.Tabular- Hydra.Dsl.Test.Transform- Hydra.Dsl.Test.Utils- Hydra.Dsl.Testing- Hydra.Dsl.Time- Hydra.Dsl.Topology- Hydra.Dsl.Typing- Hydra.Dsl.Util- Hydra.Dsl.Validation- Hydra.Dsl.Variables- Hydra.Dsl.Variants- Hydra.Dsl.Yaml.Model- Hydra.Dsls- Hydra.Encode.Ast- Hydra.Encode.Coders- Hydra.Encode.Core- Hydra.Encode.Docs- Hydra.Encode.Error.Checking- Hydra.Encode.Error.Core- Hydra.Encode.Error.File- Hydra.Encode.Error.Packaging- Hydra.Encode.Error.System- Hydra.Encode.Errors- Hydra.Encode.File- Hydra.Encode.Json.Model- Hydra.Encode.Packaging- Hydra.Encode.Parsing- Hydra.Encode.Paths- Hydra.Encode.Query- Hydra.Encode.Regex- Hydra.Encode.Relational- Hydra.Encode.System- Hydra.Encode.Tabular- Hydra.Encode.Testing- Hydra.Encode.Time- Hydra.Encode.Topology- Hydra.Encode.Typed- Hydra.Encode.Typing- Hydra.Encode.Util- Hydra.Encode.Validation- Hydra.Encode.Variants- Hydra.Encode.Yaml.Model- Hydra.Encoding- Hydra.Environment- Hydra.Error.Checking- Hydra.Error.Core- Hydra.Error.File- Hydra.Error.Packaging- Hydra.Error.System- Hydra.Errors- Hydra.Extract.Core- Hydra.Extract.Json- Hydra.Extract.Util- Hydra.File- Hydra.Formatting- Hydra.Graph- Hydra.Hoisting- Hydra.Inference- Hydra.Json.Bootstrap- Hydra.Json.Decode- Hydra.Json.Decoding- Hydra.Json.Encode- Hydra.Json.Model- Hydra.Json.Parser- Hydra.Json.Writer- Hydra.Json.Yaml.Decode- Hydra.Json.Yaml.Encode+ Hydra.Core.Adapt+ Hydra.Core.Analysis+ Hydra.Core.Annotations+ Hydra.Core.Arity+ Hydra.Core.Ast+ Hydra.Core.Checking+ Hydra.Core.Classes+ Hydra.Core.Codegen+ Hydra.Core.Coders+ Hydra.Core.Constants+ Hydra.Core.Decode.Ast+ Hydra.Core.Decode.Coders+ Hydra.Core.Decode.Diff+ Hydra.Core.Decode.Docs+ Hydra.Core.Decode.Error.Checking+ Hydra.Core.Decode.Error.File+ Hydra.Core.Decode.Error.Model+ Hydra.Core.Decode.Error.Packaging+ Hydra.Core.Decode.Error.System+ Hydra.Core.Decode.Errors+ Hydra.Core.Decode.File+ Hydra.Core.Decode.Json.Model+ Hydra.Core.Decode.Markdown+ Hydra.Core.Decode.Model+ Hydra.Core.Decode.Packaging+ Hydra.Core.Decode.Parsing+ Hydra.Core.Decode.Paths+ Hydra.Core.Decode.Query+ Hydra.Core.Decode.Regex+ Hydra.Core.Decode.Relational+ Hydra.Core.Decode.System+ Hydra.Core.Decode.Tabular+ Hydra.Core.Decode.Testing+ Hydra.Core.Decode.Time+ Hydra.Core.Decode.Topology+ Hydra.Core.Decode.Typed+ Hydra.Core.Decode.Typing+ Hydra.Core.Decode.Util+ Hydra.Core.Decode.Validation+ Hydra.Core.Decode.Variants+ Hydra.Core.Decode.Yaml.Model+ Hydra.Core.Decoding+ Hydra.Core.Dependencies+ Hydra.Core.Diff+ Hydra.Core.Differentiation+ Hydra.Core.Docs+ Hydra.Core.Dsl.Analysis+ Hydra.Core.Dsl.Annotations+ Hydra.Core.Dsl.Arity+ Hydra.Core.Dsl.Ast+ Hydra.Core.Dsl.Checking+ Hydra.Core.Dsl.Coders+ Hydra.Core.Dsl.Constants+ Hydra.Core.Dsl.Dependencies+ Hydra.Core.Dsl.Diff+ Hydra.Core.Dsl.Docs+ Hydra.Core.Dsl.Environment+ Hydra.Core.Dsl.Error.Checking+ Hydra.Core.Dsl.Error.File+ Hydra.Core.Dsl.Error.Model+ Hydra.Core.Dsl.Error.Packaging+ Hydra.Core.Dsl.Error.System+ Hydra.Core.Dsl.Errors+ Hydra.Core.Dsl.Extract.Json+ Hydra.Core.Dsl.File+ Hydra.Core.Dsl.Formatting+ Hydra.Core.Dsl.Graph+ Hydra.Core.Dsl.Json.Bootstrap+ Hydra.Core.Dsl.Json.Decode+ Hydra.Core.Dsl.Json.Decoding+ Hydra.Core.Dsl.Json.Encode+ Hydra.Core.Dsl.Json.Model+ Hydra.Core.Dsl.Json.Parser+ Hydra.Core.Dsl.Json.Writer+ Hydra.Core.Dsl.Json.Yaml.Decode+ Hydra.Core.Dsl.Json.Yaml.Encode+ Hydra.Core.Dsl.Lexical+ Hydra.Core.Dsl.Lib.Chars+ Hydra.Core.Dsl.Lib.Defaults+ Hydra.Core.Dsl.Lib.Effects+ Hydra.Core.Dsl.Lib.Eithers+ Hydra.Core.Dsl.Lib.Equality+ Hydra.Core.Dsl.Lib.Files+ Hydra.Core.Dsl.Lib.Functions+ Hydra.Core.Dsl.Lib.Lists+ Hydra.Core.Dsl.Lib.Literals+ Hydra.Core.Dsl.Lib.Logic+ Hydra.Core.Dsl.Lib.Maps+ Hydra.Core.Dsl.Lib.Math+ Hydra.Core.Dsl.Lib.Optionals+ Hydra.Core.Dsl.Lib.Ordering+ Hydra.Core.Dsl.Lib.Pairs+ Hydra.Core.Dsl.Lib.Regex+ Hydra.Core.Dsl.Lib.Sets+ Hydra.Core.Dsl.Lib.Strings+ Hydra.Core.Dsl.Lib.System+ Hydra.Core.Dsl.Lib.Text+ Hydra.Core.Dsl.Markdown+ Hydra.Core.Dsl.Model+ Hydra.Core.Dsl.Names+ Hydra.Core.Dsl.Packaging+ Hydra.Core.Dsl.Parsing+ Hydra.Core.Dsl.Paths+ Hydra.Core.Dsl.Predicates+ Hydra.Core.Dsl.Print.Docs+ Hydra.Core.Dsl.Query+ Hydra.Core.Dsl.Reduction+ Hydra.Core.Dsl.Refs+ Hydra.Core.Dsl.Regex+ Hydra.Core.Dsl.Relational+ Hydra.Core.Dsl.Resolution+ Hydra.Core.Dsl.Rewriting+ Hydra.Core.Dsl.Scoping+ Hydra.Core.Dsl.Serialization+ Hydra.Core.Dsl.Sorting+ Hydra.Core.Dsl.Strip+ Hydra.Core.Dsl.System+ Hydra.Core.Dsl.Tabular+ Hydra.Core.Dsl.Test.Transform+ Hydra.Core.Dsl.Test.Utils+ Hydra.Core.Dsl.Testing+ Hydra.Core.Dsl.Time+ Hydra.Core.Dsl.Topology+ Hydra.Core.Dsl.Typing+ Hydra.Core.Dsl.Util+ Hydra.Core.Dsl.Validation+ Hydra.Core.Dsl.Variables+ Hydra.Core.Dsl.Variants+ Hydra.Core.Dsl.Yaml.Model+ Hydra.Core.Dsls+ Hydra.Core.Encode.Ast+ Hydra.Core.Encode.Coders+ Hydra.Core.Encode.Diff+ Hydra.Core.Encode.Docs+ Hydra.Core.Encode.Error.Checking+ Hydra.Core.Encode.Error.File+ Hydra.Core.Encode.Error.Model+ Hydra.Core.Encode.Error.Packaging+ Hydra.Core.Encode.Error.System+ Hydra.Core.Encode.Errors+ Hydra.Core.Encode.File+ Hydra.Core.Encode.Json.Model+ Hydra.Core.Encode.Markdown+ Hydra.Core.Encode.Model+ Hydra.Core.Encode.Packaging+ Hydra.Core.Encode.Parsing+ Hydra.Core.Encode.Paths+ Hydra.Core.Encode.Query+ Hydra.Core.Encode.Regex+ Hydra.Core.Encode.Relational+ Hydra.Core.Encode.System+ Hydra.Core.Encode.Tabular+ Hydra.Core.Encode.Testing+ Hydra.Core.Encode.Time+ Hydra.Core.Encode.Topology+ Hydra.Core.Encode.Typed+ Hydra.Core.Encode.Typing+ Hydra.Core.Encode.Util+ Hydra.Core.Encode.Validation+ Hydra.Core.Encode.Variants+ Hydra.Core.Encode.Yaml.Model+ Hydra.Core.Encoding+ Hydra.Core.Environment+ Hydra.Core.Error.Checking+ Hydra.Core.Error.File+ Hydra.Core.Error.Model+ Hydra.Core.Error.Packaging+ Hydra.Core.Error.System+ Hydra.Core.Errors+ Hydra.Core.Extract.Json+ Hydra.Core.Extract.Model+ Hydra.Core.Extract.Util+ Hydra.Core.File+ Hydra.Core.Formatting+ Hydra.Core.Graph+ Hydra.Core.Hoisting+ Hydra.Core.Inference+ Hydra.Core.Json.Bootstrap+ Hydra.Core.Json.Decode+ Hydra.Core.Json.Decoding+ Hydra.Core.Json.Encode+ Hydra.Core.Json.Model+ Hydra.Core.Json.Parser+ Hydra.Core.Json.Writer+ Hydra.Core.Json.Yaml.Decode+ Hydra.Core.Json.Yaml.Encode+ Hydra.Core.Languages+ Hydra.Core.Lexical+ Hydra.Core.Lib.Chars+ Hydra.Core.Lib.Defaults+ Hydra.Core.Lib.Effects+ Hydra.Core.Lib.Eithers+ Hydra.Core.Lib.Equality+ Hydra.Core.Lib.Files+ Hydra.Core.Lib.Functions+ Hydra.Core.Lib.Hashing+ Hydra.Core.Lib.Lists+ Hydra.Core.Lib.Literals+ Hydra.Core.Lib.Logic+ Hydra.Core.Lib.Maps+ Hydra.Core.Lib.Math+ Hydra.Core.Lib.Optionals+ Hydra.Core.Lib.Ordering+ Hydra.Core.Lib.Pairs+ Hydra.Core.Lib.Regex+ Hydra.Core.Lib.Sets+ Hydra.Core.Lib.Strings+ Hydra.Core.Lib.System+ Hydra.Core.Lib.Text+ Hydra.Core.Literals+ Hydra.Core.Markdown+ Hydra.Core.Model+ Hydra.Core.Names+ Hydra.Core.Overlay.Haskell.AsTerm+ Hydra.Core.Overlay.Haskell.AsType+ Hydra.Core.Overlay.Haskell.Bootstrap+ Hydra.Core.Overlay.Haskell.Dsl.Annotations+ Hydra.Core.Overlay.Haskell.Dsl.Base+ Hydra.Core.Overlay.Haskell.Dsl.Common+ Hydra.Core.Overlay.Haskell.Dsl.Deep.Core+ Hydra.Core.Overlay.Haskell.Dsl.Deep.Lib.Math+ Hydra.Core.Overlay.Haskell.Dsl.Literals+ Hydra.Core.Overlay.Haskell.Dsl.LiteralTypes+ Hydra.Core.Overlay.Haskell.Dsl.Meta.Core+ Hydra.Core.Overlay.Haskell.Dsl.Meta.Graph+ Hydra.Core.Overlay.Haskell.Dsl.Meta.Literals+ Hydra.Core.Overlay.Haskell.Dsl.Meta.Tabular+ Hydra.Core.Overlay.Haskell.Dsl.Meta.Terms+ Hydra.Core.Overlay.Haskell.Dsl.Meta.Testing+ Hydra.Core.Overlay.Haskell.Dsl.Meta.Types+ Hydra.Core.Overlay.Haskell.Dsl.Meta.Variants+ Hydra.Core.Overlay.Haskell.Dsl.Phantoms+ Hydra.Core.Overlay.Haskell.Dsl.Prims+ Hydra.Core.Overlay.Haskell.Dsl.Terms+ Hydra.Core.Overlay.Haskell.Dsl.Tests+ Hydra.Core.Overlay.Haskell.Dsl.Types+ Hydra.Core.Overlay.Haskell.Lib.Chars+ Hydra.Core.Overlay.Haskell.Lib.Effects+ Hydra.Core.Overlay.Haskell.Lib.Eithers+ Hydra.Core.Overlay.Haskell.Lib.Equality+ Hydra.Core.Overlay.Haskell.Lib.Files+ Hydra.Core.Overlay.Haskell.Lib.Functions+ Hydra.Core.Overlay.Haskell.Lib.Hashing+ Hydra.Core.Overlay.Haskell.Lib.Lists+ Hydra.Core.Overlay.Haskell.Lib.Literals+ Hydra.Core.Overlay.Haskell.Lib.Logic+ Hydra.Core.Overlay.Haskell.Lib.Maps+ Hydra.Core.Overlay.Haskell.Lib.Math+ Hydra.Core.Overlay.Haskell.Lib.Optionals+ Hydra.Core.Overlay.Haskell.Lib.Ordering+ Hydra.Core.Overlay.Haskell.Lib.Pairs+ Hydra.Core.Overlay.Haskell.Lib.Regex+ Hydra.Core.Overlay.Haskell.Lib.Sets+ Hydra.Core.Overlay.Haskell.Lib.Strings+ Hydra.Core.Overlay.Haskell.Lib.System+ Hydra.Core.Overlay.Haskell.Lib.Text+ Hydra.Core.Overlay.Haskell.Libraries+ Hydra.Core.Packaging+ Hydra.Core.Parse.Docs+ Hydra.Core.Parse.Regex+ Hydra.Core.Parsers+ Hydra.Core.Parsing+ Hydra.Core.Paths+ Hydra.Core.Predicates+ Hydra.Core.Print.Docs+ Hydra.Core.Print.Emacs.Regex+ Hydra.Core.Print.Error.Model+ Hydra.Core.Print.Error.Packaging+ Hydra.Core.Print.Errors+ Hydra.Core.Print.Graph+ Hydra.Core.Print.Markdown+ Hydra.Core.Print.Model+ Hydra.Core.Print.Paths+ Hydra.Core.Print.Pcre.Regex+ Hydra.Core.Print.Posix.Regex+ Hydra.Core.Print.Regex+ Hydra.Core.Print.Typing+ Hydra.Core.Print.Util+ Hydra.Core.Print.Variants+ Hydra.Core.Query+ Hydra.Core.Reduction+ Hydra.Core.Reflect+ Hydra.Core.Refs+ Hydra.Core.Regex+ Hydra.Core.Relational+ Hydra.Core.Resolution+ Hydra.Core.Rewriting+ Hydra.Core.Scoping+ Hydra.Core.Serialization+ Hydra.Core.Sorting+ Hydra.Core.Strip+ Hydra.Core.Substitution+ Hydra.Core.Subterms+ Hydra.Core.System+ Hydra.Core.Tabular+ Hydra.Core.Templates+ Hydra.Core.Test.Transform+ Hydra.Core.Test.Utils+ Hydra.Core.Testing+ Hydra.Core.Time+ Hydra.Core.Topology+ Hydra.Core.Typed+ Hydra.Core.Typing+ Hydra.Core.Unification+ Hydra.Core.Util+ Hydra.Core.Validate.Model+ Hydra.Core.Validate.Packaging+ Hydra.Core.Validate.Paths+ Hydra.Core.Validation+ Hydra.Core.Variables+ Hydra.Core.Variants+ Hydra.Core.Yaml.Model Hydra.Kernel- Hydra.Languages- Hydra.Lexical- Hydra.Lib.Chars- Hydra.Lib.Defaults- Hydra.Lib.Effects- Hydra.Lib.Eithers- Hydra.Lib.Equality- Hydra.Lib.Files- Hydra.Lib.Functions- Hydra.Lib.Hashing- Hydra.Lib.Lists- Hydra.Lib.Literals- Hydra.Lib.Logic- Hydra.Lib.Maps- Hydra.Lib.Math- Hydra.Lib.Optionals- Hydra.Lib.Ordering- Hydra.Lib.Pairs- Hydra.Lib.Regex- Hydra.Lib.Sets- Hydra.Lib.Strings- Hydra.Lib.System- Hydra.Lib.Text- Hydra.Literals- Hydra.Names- Hydra.Overlay.Haskell.AsTerm- Hydra.Overlay.Haskell.AsType- Hydra.Overlay.Haskell.Bootstrap- Hydra.Overlay.Haskell.Dsl.Annotations- Hydra.Overlay.Haskell.Dsl.Deep.Lib.Math- Hydra.Overlay.Haskell.Dsl.Literals- Hydra.Overlay.Haskell.Dsl.LiteralTypes- Hydra.Overlay.Haskell.Dsl.Prims- Hydra.Overlay.Haskell.Dsl.Terms- Hydra.Overlay.Haskell.Dsl.Tests- Hydra.Overlay.Haskell.Dsl.Typed.Base- Hydra.Overlay.Haskell.Dsl.Typed.Common- Hydra.Overlay.Haskell.Dsl.Typed.Core- Hydra.Overlay.Haskell.Dsl.Typed.DeepCore- Hydra.Overlay.Haskell.Dsl.Typed.Graph- Hydra.Overlay.Haskell.Dsl.Typed.Literals- Hydra.Overlay.Haskell.Dsl.Typed.Phantoms- Hydra.Overlay.Haskell.Dsl.Typed.Tabular- Hydra.Overlay.Haskell.Dsl.Typed.Terms- Hydra.Overlay.Haskell.Dsl.Typed.Testing- Hydra.Overlay.Haskell.Dsl.Typed.Types- Hydra.Overlay.Haskell.Dsl.Typed.Variants- Hydra.Overlay.Haskell.Dsl.Types- Hydra.Overlay.Haskell.Lib.Chars- Hydra.Overlay.Haskell.Lib.Effects- Hydra.Overlay.Haskell.Lib.Eithers- Hydra.Overlay.Haskell.Lib.Equality- Hydra.Overlay.Haskell.Lib.Files- Hydra.Overlay.Haskell.Lib.Functions- Hydra.Overlay.Haskell.Lib.Hashing- Hydra.Overlay.Haskell.Lib.Lists- Hydra.Overlay.Haskell.Lib.Literals- Hydra.Overlay.Haskell.Lib.Logic- Hydra.Overlay.Haskell.Lib.Maps- Hydra.Overlay.Haskell.Lib.Math- Hydra.Overlay.Haskell.Lib.Optionals- Hydra.Overlay.Haskell.Lib.Ordering- Hydra.Overlay.Haskell.Lib.Pairs- Hydra.Overlay.Haskell.Lib.Regex- Hydra.Overlay.Haskell.Lib.Sets- Hydra.Overlay.Haskell.Lib.Strings- Hydra.Overlay.Haskell.Lib.System- Hydra.Overlay.Haskell.Lib.Text- Hydra.Overlay.Haskell.Libraries- Hydra.Packaging- Hydra.Parse.Docs- Hydra.Parse.Regex- Hydra.Parsers- Hydra.Parsing- Hydra.Paths- Hydra.Predicates- Hydra.Print.Core- Hydra.Print.Docs- Hydra.Print.Emacs.Regex- Hydra.Print.Error.Core- Hydra.Print.Error.Packaging- Hydra.Print.Errors- Hydra.Print.Graph- Hydra.Print.Paths- Hydra.Print.Pcre.Regex- Hydra.Print.Posix.Regex- Hydra.Print.Regex- Hydra.Print.Typing- Hydra.Print.Util- Hydra.Print.Variants- Hydra.Query- Hydra.Reduction- Hydra.Reflect- Hydra.Refs- Hydra.Regex- Hydra.Relational- Hydra.Resolution- Hydra.Rewriting- Hydra.Scoping- Hydra.Serialization Hydra.Settings- Hydra.Sorting- Hydra.Strip- Hydra.Substitution- Hydra.Subterms- Hydra.System- Hydra.Tabular- Hydra.Templates- Hydra.Test.Transform- Hydra.Test.Utils- Hydra.Testing- Hydra.Time- Hydra.Topology- Hydra.Typed- Hydra.Typing- Hydra.Unification- Hydra.Util- Hydra.Validate.Core- Hydra.Validate.Packaging- Hydra.Validate.Paths- Hydra.Validation- Hydra.Variables- Hydra.Variants- Hydra.Yaml.Model other-modules: Paths_hydra_kernel hs-source-dirs:
@@ -1,823 +0,0 @@--- Note: this is an automatically generated file. Do not edit.---- | Simple, one-way adapters for types and terms--module Hydra.Adapt where--import qualified Hydra.Annotations as Annotations-import qualified Hydra.Ast as Ast-import qualified Hydra.Coders as Coders-import qualified Hydra.Core as Core-import qualified Hydra.Dependencies as Dependencies-import qualified Hydra.Docs as Docs-import qualified Hydra.Environment as Environment-import qualified Hydra.Error.Checking as Checking-import qualified Hydra.Error.Core as ErrorCore-import qualified Hydra.Error.File as ErrorFile-import qualified Hydra.Error.Packaging as ErrorPackaging-import qualified Hydra.Error.System as ErrorSystem-import qualified Hydra.Errors as Errors-import qualified Hydra.File as File-import qualified Hydra.Graph as Graph-import qualified Hydra.Hoisting as Hoisting-import qualified Hydra.Inference as Inference-import qualified Hydra.Json.Model as Model-import qualified Hydra.Lexical as Lexical-import qualified Hydra.Overlay.Haskell.Lib.Eithers as Eithers-import qualified Hydra.Overlay.Haskell.Lib.Equality as Equality-import qualified Hydra.Overlay.Haskell.Lib.Functions as Functions-import qualified Hydra.Overlay.Haskell.Lib.Lists as Lists-import qualified Hydra.Overlay.Haskell.Lib.Literals as LibLiterals-import qualified Hydra.Overlay.Haskell.Lib.Logic as Logic-import qualified Hydra.Overlay.Haskell.Lib.Maps as Maps-import qualified Hydra.Overlay.Haskell.Lib.Optionals as Optionals-import qualified Hydra.Overlay.Haskell.Lib.Pairs as Pairs-import qualified Hydra.Overlay.Haskell.Lib.Sets as Sets-import qualified Hydra.Overlay.Haskell.Lib.Strings as Strings-import qualified Hydra.Literals as Literals-import qualified Hydra.Names as Names-import qualified Hydra.Packaging as Packaging-import qualified Hydra.Parsing as Parsing-import qualified Hydra.Paths as Paths-import qualified Hydra.Print.Core as PrintCore-import qualified Hydra.Print.Errors as PrintErrors-import qualified Hydra.Print.Graph as PrintGraph-import qualified Hydra.Query as Query-import qualified Hydra.Reduction as Reduction-import qualified Hydra.Reflect as Reflect-import qualified Hydra.Regex as Regex-import qualified Hydra.Relational as Relational-import qualified Hydra.Resolution as Resolution-import qualified Hydra.Rewriting as Rewriting-import qualified Hydra.Scoping as Scoping-import qualified Hydra.Strip as Strip-import qualified Hydra.System as System-import qualified Hydra.Tabular as Tabular-import qualified Hydra.Testing as Testing-import qualified Hydra.Time as Time-import qualified Hydra.Topology as Topology-import qualified Hydra.Typed as Typed-import qualified Hydra.Typing as Typing-import qualified Hydra.Util as Util-import qualified Hydra.Validation as Validation-import qualified Hydra.Variables as Variables-import qualified Hydra.Variants as Variants-import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)-import qualified Data.Scientific as Sci-import Data.Void-import qualified Data.Map as M-import qualified Data.Set as S---- | Adapt a graph and its schema to the given language constraints. The doExpand flag controls eta expansion of partial applications. Adaptation is type-preserving: binding-level TypeSchemes are adapted (not stripped). Note: case statement hoisting is done separately, prior to adaptation. The els0 parameter provides the original ordered bindings. Returns both the adapted graph and the ordered adapted bindings.-adaptDataGraph :: Coders.LanguageConstraints -> Bool -> [Core.Binding] -> t0 -> Graph.Graph -> Either Errors.Error (Graph.Graph, [Core.Binding])-adaptDataGraph constraints doExpand els0 cx graph0 =-- let transformTerm =- \g -> \term ->- let tx = g- t1 = Variables.unshadowVariables (pushTypeAppsInward term)- t2 = Variables.unshadowVariables (Logic.ifElse doExpand (pushTypeAppsInward (Reduction.etaExpandTerm tx t1)) t1)- in (Dependencies.liftLambdaAboveLet t2)- transformBinding =- \g -> \el -> Core.Binding {- Core.bindingName = (Core.bindingName el),- Core.bindingTerm = (transformTerm g (Core.bindingTerm el)),- Core.bindingTypeScheme = (Core.bindingTypeScheme el)}- litmap = adaptLiteralTypesMap constraints- prims0 = Graph.graphPrimitives graph0- schemaTypes0 = Graph.graphSchemaTypes graph0- schemaBindings = Environment.typesToDefinitions (Maps.map (\ts -> Scoping.typeSchemeToFType ts) schemaTypes0)- in (Eithers.bind (Logic.ifElse (Maps.isEmpty schemaTypes0) (Right Maps.empty) (Eithers.bind (Eithers.bimap (\e -> Errors.ErrorDecoding e) (\x -> x) (Environment.graphAsTypes graph0 schemaBindings)) (\tmap0 -> Eithers.bind (adaptGraphSchema constraints litmap tmap0) (\tmap1 -> Right (Maps.map (\t -> Resolution.typeToTypeScheme t) tmap1))))) (\schemaResult ->- let adaptedSchemaTypes = schemaResult- adaptBinding =- \el ->- let transformed = transformBinding graph0 el- wrapped =- Core.TermLet (Core.Let {- Core.letBindings = (Lists.singleton transformed),- Core.letBody = Core.TermUnit})- in (Eithers.bind (adaptTerm constraints litmap cx graph0 wrapped) (\adapted -> Rewriting.rewriteTermM (adaptLambdaDomains constraints litmap) adapted))- in (Eithers.bind (Eithers.mapList adaptBinding els0) (\adaptedTerms ->- let els1Raw = Lists.concat (Lists.map Environment.termAsBindings adaptedTerms)- processBinding =- \el -> Eithers.bind (Rewriting.rewriteTermM (adaptNestedTypes constraints litmap) (Core.bindingTerm el)) (\newTerm -> Eithers.bind (Optionals.match (Core.bindingTypeScheme el) (Right Nothing) (\ts -> Eithers.bind (adaptTypeScheme constraints litmap ts) (\ts1 -> Right (Just ts1)))) (\adaptedType -> Right (Core.Binding {- Core.bindingName = (Core.bindingName el),- Core.bindingTerm = newTerm,- Core.bindingTypeScheme = adaptedType})))- in (Eithers.bind (Eithers.mapList processBinding els1Raw) (\els1 -> Eithers.bind (Eithers.mapList (\kv -> Eithers.bind (adaptPrimitive constraints litmap (Pairs.second kv)) (\prim1 -> Right (Pairs.first kv, prim1))) (Maps.toList prims0)) (\primPairs ->- let prims1 = Maps.fromList primPairs- adaptedGraphRaw = Lexical.buildGraph els1 Maps.empty prims1- adaptedGraph =- Graph.Graph {- Graph.graphBoundTerms = (Graph.graphBoundTerms adaptedGraphRaw),- Graph.graphBoundTypes = (Graph.graphBoundTypes adaptedGraphRaw),- Graph.graphClassConstraints = (Graph.graphClassConstraints adaptedGraphRaw),- Graph.graphLambdaVariables = (Graph.graphLambdaVariables adaptedGraphRaw),- Graph.graphMetadata = (Graph.graphMetadata adaptedGraphRaw),- Graph.graphPrimitives = (Graph.graphPrimitives adaptedGraphRaw),- Graph.graphSchemaTypes = adaptedSchemaTypes,- Graph.graphTypeVariables = (Graph.graphTypeVariables adaptedGraphRaw)}- in (Right (adaptedGraph, els1)))))))))---- | Attempt to adapt a floating-point type using the given language constraints-adaptFloatType :: Coders.LanguageConstraints -> Core.FloatType -> Maybe Core.FloatType-adaptFloatType constraints ft =-- let supported = Sets.member ft (Coders.languageConstraintsFloatTypes constraints)- alt = adaptFloatType constraints- forUnsupported =- \ft2 -> case ft2 of- Core.FloatTypeFloat32 -> alt Core.FloatTypeFloat64- Core.FloatTypeFloat64 -> alt Core.FloatTypeFloat32- in (Logic.ifElse supported (Just ft) (forUnsupported ft))---- | Adapt a schema graph to the given language constraints-adaptGraphSchema :: Ord t0 => (Coders.LanguageConstraints -> M.Map Core.LiteralType Core.LiteralType -> M.Map t0 Core.Type -> Either Errors.Error (M.Map t0 Core.Type))-adaptGraphSchema constraints litmap types0 =-- let mapPair =- \pair ->- let name = Pairs.first pair- typ = Pairs.second pair- in (Eithers.bind (adaptType constraints litmap typ) (\typ1 -> Right (name, typ1)))- in (Eithers.bind (Eithers.mapList mapPair (Maps.toList types0)) (\pairs -> Right (Maps.fromList pairs)))---- | Attempt to adapt an integer type using the given language constraints-adaptIntegerType :: Coders.LanguageConstraints -> Core.IntegerType -> Maybe Core.IntegerType-adaptIntegerType constraints it =-- let supported = Sets.member it (Coders.languageConstraintsIntegerTypes constraints)- alt = adaptIntegerType constraints- forUnsupported =- \it2 -> case it2 of- Core.IntegerTypeBigint -> Nothing- Core.IntegerTypeInt8 -> alt Core.IntegerTypeUint16- Core.IntegerTypeInt16 -> alt Core.IntegerTypeUint32- Core.IntegerTypeInt32 -> alt Core.IntegerTypeUint64- Core.IntegerTypeInt64 -> alt Core.IntegerTypeBigint- Core.IntegerTypeUint8 -> alt Core.IntegerTypeInt16- Core.IntegerTypeUint16 -> alt Core.IntegerTypeInt32- Core.IntegerTypeUint32 -> alt Core.IntegerTypeInt64- Core.IntegerTypeUint64 -> alt Core.IntegerTypeBigint- in (Logic.ifElse supported (Just it) (forUnsupported it))---- | Rewrite callback for adapting lambda domain types in a term-adaptLambdaDomains :: Coders.LanguageConstraints -> M.Map Core.LiteralType Core.LiteralType -> (t0 -> Either Errors.Error Core.Term) -> t0 -> Either Errors.Error Core.Term-adaptLambdaDomains constraints litmap recurse term =- Eithers.bind (recurse term) (\rewritten -> case rewritten of- Core.TermLambda v0 -> Eithers.bind (Optionals.match (Core.lambdaDomain v0) (Right Nothing) (\dom -> Eithers.bind (adaptType constraints litmap dom) (\dom1 -> Right (Just dom1)))) (\adaptedDomain -> Right (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.lambdaParameter v0),- Core.lambdaDomain = adaptedDomain,- Core.lambdaBody = (Core.lambdaBody v0)})))- _ -> Right rewritten)---- | Convert a literal to a different type-adaptLiteral :: Core.LiteralType -> Core.Literal -> Core.Literal-adaptLiteral lt l =- case l of- Core.LiteralBinary v0 -> case lt of- Core.LiteralTypeString -> Core.LiteralString (LibLiterals.binaryToBase64 v0)- Core.LiteralBoolean v0 -> case lt of- Core.LiteralTypeInteger v1 -> Core.LiteralInteger (Literals.bigintToIntegerValue v1 (Logic.ifElse v0 1 0))- Core.LiteralDecimal v0 -> case lt of- Core.LiteralTypeFloat _ -> Core.LiteralFloat (Core.FloatValueFloat64 (LibLiterals.decimalToFloat64 v0))- Core.LiteralTypeString -> Core.LiteralString (LibLiterals.printDecimal v0)- Core.LiteralFloat v0 -> case lt of- Core.LiteralTypeFloat v1 -> Core.LiteralFloat (case v1 of- Core.FloatTypeFloat32 -> Core.FloatValueFloat32 (case v0 of- Core.FloatValueFloat32 v3 -> v3- Core.FloatValueFloat64 v3 -> LibLiterals.float64ToFloat32 v3)- Core.FloatTypeFloat64 -> Core.FloatValueFloat64 (case v0 of- Core.FloatValueFloat32 v3 -> LibLiterals.float32ToFloat64 v3- Core.FloatValueFloat64 v3 -> v3))- Core.LiteralInteger v0 -> case lt of- Core.LiteralTypeInteger v1 -> Core.LiteralInteger (Literals.bigintToIntegerValue v1 (Literals.integerValueToBigint v0))---- | Attempt to adapt a literal type using the given language constraints-adaptLiteralType :: Coders.LanguageConstraints -> Core.LiteralType -> Maybe Core.LiteralType-adaptLiteralType constraints lt =-- let forUnsupported =- \lt2 -> case lt2 of- Core.LiteralTypeBinary -> Just Core.LiteralTypeString- Core.LiteralTypeBoolean -> Optionals.map (\x -> Core.LiteralTypeInteger x) (adaptIntegerType constraints Core.IntegerTypeInt8)- Core.LiteralTypeDecimal -> Just (Core.LiteralTypeFloat Core.FloatTypeFloat64)- Core.LiteralTypeFloat v0 -> Optionals.map (\x -> Core.LiteralTypeFloat x) (adaptFloatType constraints v0)- Core.LiteralTypeInteger v0 -> Optionals.map (\x -> Core.LiteralTypeInteger x) (adaptIntegerType constraints v0)- _ -> Nothing- in (Logic.ifElse (literalTypeSupported constraints lt) Nothing (forUnsupported lt))---- | Derive a map of adapted literal types for the given language constraints-adaptLiteralTypesMap :: Coders.LanguageConstraints -> M.Map Core.LiteralType Core.LiteralType-adaptLiteralTypesMap constraints =-- let tryType = \lt -> Optionals.match (adaptLiteralType constraints lt) Nothing (\lt2 -> Just (lt, lt2))- in (Maps.fromList (Optionals.givens (Lists.map tryType Reflect.literalTypes)))---- | Adapt a literal value using the given language constraints-adaptLiteralValue :: Ord t0 => (M.Map t0 Core.LiteralType -> t0 -> Core.Literal -> Core.Literal)-adaptLiteralValue litmap lt l =- Optionals.match (Maps.lookup lt litmap) (Core.LiteralString (PrintCore.literal l)) (\lt2 -> adaptLiteral lt2 l)---- | Rewrite callback for adapting nested let binding TypeSchemes in a term-adaptNestedTypes :: Coders.LanguageConstraints -> M.Map Core.LiteralType Core.LiteralType -> (t0 -> Either Errors.Error Core.Term) -> t0 -> Either Errors.Error Core.Term-adaptNestedTypes constraints litmap recurse term =- Eithers.bind (recurse term) (\rewritten -> case rewritten of- Core.TermLet v0 ->- let adaptB =- \b -> Eithers.bind (Optionals.match (Core.bindingTypeScheme b) (Right Nothing) (\ts -> Eithers.bind (adaptTypeScheme constraints litmap ts) (\ts1 -> Right (Just ts1)))) (\adaptedBType -> Right (Core.Binding {- Core.bindingName = (Core.bindingName b),- Core.bindingTerm = (Core.bindingTerm b),- Core.bindingTypeScheme = adaptedBType}))- in (Eithers.bind (Eithers.mapList adaptB (Core.letBindings v0)) (\adaptedBindings -> Right (Core.TermLet (Core.Let {- Core.letBindings = adaptedBindings,- Core.letBody = (Core.letBody v0)}))))- _ -> Right rewritten)---- | Adapt a primitive to the given language constraints, prior to inference-adaptPrimitive :: Coders.LanguageConstraints -> M.Map Core.LiteralType Core.LiteralType -> Graph.Primitive -> Either Errors.Error Graph.Primitive-adaptPrimitive constraints litmap prim0 =-- let def0 = Graph.primitiveDefinition prim0- in (Eithers.bind (adaptTermSignature constraints litmap (Packaging.primitiveDefinitionSignature def0)) (\sig1 ->- let def1 =- Packaging.PrimitiveDefinition {- Packaging.primitiveDefinitionName = (Packaging.primitiveDefinitionName def0),- Packaging.primitiveDefinitionMetadata = (Packaging.primitiveDefinitionMetadata def0),- Packaging.primitiveDefinitionSignature = sig1,- Packaging.primitiveDefinitionIsPure = (Packaging.primitiveDefinitionIsPure def0),- Packaging.primitiveDefinitionIsTotal = (Packaging.primitiveDefinitionIsTotal def0),- Packaging.primitiveDefinitionDefaultImplementation = (Packaging.primitiveDefinitionDefaultImplementation def0)}- in (Right (Graph.Primitive {- Graph.primitiveDefinition = def1,- Graph.primitiveImplementation = (Graph.primitiveImplementation prim0)}))))---- | Adapt a term using the given language constraints-adaptTerm :: Coders.LanguageConstraints -> M.Map Core.LiteralType Core.LiteralType -> t0 -> Graph.Graph -> Core.Term -> Either Errors.Error Core.Term-adaptTerm constraints litmap cx graph term0 =-- let rewrite =- \recurse -> \term02 ->- let forSupported =- \term -> case term of- Core.TermLiteral v0 ->- let lt = Reflect.literalType v0- in (Right (Just (Logic.ifElse (literalTypeSupported constraints lt) term (Core.TermLiteral (adaptLiteralValue litmap lt v0)))))- _ -> Right (Just term)- forUnsupported =- \term ->- let tryAlts =- \alts -> Optionals.match (Lists.uncons alts) (Right Nothing) (\uc -> Eithers.bind (tryTerm (Pairs.first uc)) (\mterm -> Optionals.match mterm (tryAlts (Pairs.second uc)) (\t -> Right (Just t))))- in (Eithers.bind (termAlternatives cx graph term) (\alts0 -> tryAlts alts0))- tryTerm =- \term ->- let supportedVariant = Sets.member (Reflect.termVariant term) (Coders.languageConstraintsTermVariants constraints)- in (Logic.ifElse supportedVariant (forSupported term) (forUnsupported term))- in (Eithers.bind (recurse term02) (\term1 -> case term1 of- Core.TermAnnotated _ -> Right term1- Core.TermTypeApplication v0 -> Eithers.bind (adaptType constraints litmap (Core.typeApplicationTermType v0)) (\atyp -> Right (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.typeApplicationTermBody v0),- Core.typeApplicationTermType = atyp})))- Core.TermTypeLambda _ -> Right term1- _ -> Eithers.bind (tryTerm term1) (\mterm -> Optionals.match mterm (Left (Errors.ErrorOther (Errors.OtherError (Strings.concat2 "no alternatives for term: " (PrintCore.term term1))))) (\term2 -> Right term2))))- in (Rewriting.rewriteTermM rewrite term0)---- | Adapt a term using the constraints of a given language-adaptTermForLanguage :: Coders.Language -> t0 -> Graph.Graph -> Core.Term -> Either Errors.Error Core.Term-adaptTermForLanguage lang cx g term =-- let constraints = Coders.languageConstraints lang- litmap = adaptLiteralTypesMap constraints- in (adaptTerm constraints litmap cx g term)---- | Adapt the types within a term signature to the given language constraints, in place. Parameter names, descriptions, and per-parameter isLazy flags, as well as type parameters, are preserved; only the parameter and result types are adapted. Unlike routing through TypeScheme (the type-only view), this retains the full TermSignature metadata, including primitive laziness flags.-adaptTermSignature :: Coders.LanguageConstraints -> M.Map Core.LiteralType Core.LiteralType -> Typing.TermSignature -> Either Errors.Error Typing.TermSignature-adaptTermSignature constraints litmap sig0 =-- let result0 = Typing.termSignatureResult sig0- in (Eithers.bind (adaptType constraints litmap (Typing.resultType result0)) (\resultType1 -> Eithers.bind (Eithers.mapList (\p -> Eithers.map (\ty1 -> Typing.Parameter {- Typing.parameterName = (Typing.parameterName p),- Typing.parameterDescription = (Typing.parameterDescription p),- Typing.parameterType = ty1,- Typing.parameterIsLazy = (Typing.parameterIsLazy p)}) (adaptType constraints litmap (Typing.parameterType p))) (Typing.termSignatureParameters sig0)) (\params1 -> Right (Typing.TermSignature {- Typing.termSignatureTypeParameters = (Typing.termSignatureTypeParameters sig0),- Typing.termSignatureParameters = params1,- Typing.termSignatureResult = Typing.Result {- Typing.resultDescription = (Typing.resultDescription result0),- Typing.resultType = resultType1}}))))---- | Adapt a type using the given language constraints-adaptType :: Coders.LanguageConstraints -> M.Map Core.LiteralType Core.LiteralType -> Core.Type -> Either Errors.Error Core.Type-adaptType constraints litmap type0 =-- let forSupported =- \typ -> case typ of- Core.TypeLiteral v0 -> Logic.ifElse (literalTypeSupported constraints v0) (Just typ) (Optionals.match (Maps.lookup v0 litmap) (Just (Core.TypeLiteral Core.LiteralTypeString)) (\lt2 -> Just (Core.TypeLiteral lt2)))- _ -> Just typ- forUnsupported =- \typ ->- let tryAlts =- \alts -> Optionals.bind (Lists.uncons alts) (\uc -> Optionals.match (tryType (Pairs.first uc)) (tryAlts (Pairs.second uc)) (\t -> Just t))- alts0 = typeAlternatives typ- in (tryAlts alts0)- tryType =- \typ ->- let supportedVariant = Sets.member (Reflect.typeVariant typ) (Coders.languageConstraintsTypeVariants constraints)- in (Logic.ifElse supportedVariant (forSupported typ) (forUnsupported typ))- rewrite =- \recurse -> \typ -> Eithers.bind (recurse typ) (\type1 -> Optionals.match (tryType type1) (Left (Errors.ErrorOther (Errors.OtherError (Strings.concat2 "no alternatives for type: " (PrintCore.type_ typ))))) (\type2 -> Right type2))- in (Rewriting.rewriteTypeM rewrite type0)---- | Adapt a type using the constraints of a given language-adaptTypeForLanguage :: Coders.Language -> Core.Type -> Either Errors.Error Core.Type-adaptTypeForLanguage lang typ =-- let constraints = Coders.languageConstraints lang- litmap = adaptLiteralTypesMap constraints- in (adaptType constraints litmap typ)---- | Adapt a type scheme to the given language constraints, prior to inference-adaptTypeScheme :: Coders.LanguageConstraints -> M.Map Core.LiteralType Core.LiteralType -> Core.TypeScheme -> Either Errors.Error Core.TypeScheme-adaptTypeScheme constraints litmap ts0 =-- let vars0 = Core.typeSchemeVariables ts0- t0 = Core.typeSchemeBody ts0- in (Eithers.bind (adaptType constraints litmap t0) (\t1 -> Right (Core.TypeScheme {- Core.typeSchemeVariables = vars0,- Core.typeSchemeBody = t1,- Core.typeSchemeConstraints = (Core.typeSchemeConstraints ts0)})))---- | Compose two coders into a single coder-composeCoders :: Coders.Coder t0 t1 t2 -> Coders.Coder t1 t3 t2 -> Coders.Coder t0 t3 t2-composeCoders c1 c2 =- Coders.Coder {- Coders.coderEncode = (\a -> Eithers.bind (Coders.coderEncode c1 a) (\b1 -> Coders.coderEncode c2 b1)),- Coders.coderDecode = (\c -> Eithers.bind (Coders.coderDecode c2 c) (\b2 -> Coders.coderDecode c1 b2))}---- | Given a data graph along with language constraints, original ordered bindings, and a designated list of namespaces, adapt the graph to the language constraints, then return the processed graph along with term definitions grouped by namespace (in the order of the input namespaces). Inference is performed before adaptation if bindings lack type annotations. Hoisting must preserve type schemes; if any binding loses its type scheme after hoisting, the pipeline fails. Adaptation preserves type application/lambda wrappers and adapts embedded types. Post-adaptation inference is performed to ensure binding TypeSchemes are fully consistent. The doExpand flag controls eta expansion. The doHoistCaseStatements flag controls case statement hoisting (needed for Python). The doHoistPolymorphicLetBindings flag controls polymorphic let binding hoisting (needed for Java). The originalBindings parameter provides the original ordered bindings (from module elements).-dataGraphToDefinitions :: Coders.LanguageConstraints -> Bool -> Bool -> Bool -> Bool -> [Core.Binding] -> Graph.Graph -> [Packaging.ModuleName] -> Typing.InferenceContext -> Either Errors.Error (Graph.Graph, [[Packaging.TermDefinition]])-dataGraphToDefinitions constraints doInfer doExpand doHoistCaseStatements doHoistPolymorphicLetBindings originalBindings graph0 namespaces cx =-- let namespacesSet = Sets.fromList namespaces- isParentBinding =- \b -> Optionals.match (Names.moduleNameOf (Core.bindingName b)) False (\ns -> Sets.member ns namespacesSet)- hoistCases =- \bindings ->- let stripped =- Lists.map (\b -> Core.Binding {- Core.bindingName = (Core.bindingName b),- Core.bindingTerm = (Strip.stripTypeLambdas (Core.bindingTerm b)),- Core.bindingTypeScheme = (Core.bindingTypeScheme b)}) bindings- term0 =- Core.TermLet (Core.Let {- Core.letBindings = stripped,- Core.letBody = Core.TermUnit})- unshadowed0 = Environment.termAsBindings (Variables.unshadowVariables term0)- hoisted = Hoisting.hoistCaseStatementsInGraph unshadowed0- term1 =- Core.TermLet (Core.Let {- Core.letBindings = hoisted,- Core.letBody = Core.TermUnit})- in (Environment.termAsBindings (Variables.unshadowVariables term1))- hoistPoly =- \bindings ->- let letBefore =- Core.Let {- Core.letBindings = bindings,- Core.letBody = Core.TermUnit}- letAfter = Hoisting.hoistPolymorphicLetBindings isParentBinding letBefore- in (Core.letBindings letAfter)- qualifyUntyped =- \b ->- let nm = Core.unName (Core.bindingName b)- in (Optionals.match (Names.moduleNameOf (Core.bindingName b)) (Strings.concat2 "(no module) " nm) (\ns -> Strings.concat [- Packaging.unModuleName ns,- " :: ",- nm]))- checkBindingsTyped =- \debugLabel -> \bindings ->- let untypedBindings =- Lists.map qualifyUntyped (Lists.filter (\b -> Logic.not (Optionals.isGiven (Core.bindingTypeScheme b))) bindings)- in (Logic.ifElse (Lists.isEmpty untypedBindings) (Right bindings) (Left (Errors.ErrorOther (Errors.OtherError (Strings.concat [- "Found ",- (LibLiterals.printInt32 (Lists.length untypedBindings)),- " untyped binding(s) (",- debugLabel,- "); each must carry a type scheme at this stage. ",- "This usually means stale dist/json field shapes after a kernel record rename ",- "(regenerate the affected package's JSON). Offending bindings (module :: name): ",- (Strings.join ", " untypedBindings)])))))- normalizeBindings =- \bindings -> Lists.map (\b -> Core.Binding {- Core.bindingName = (Core.bindingName b),- Core.bindingTerm = (pushTypeAppsInward (Core.bindingTerm b)),- Core.bindingTypeScheme = (Core.bindingTypeScheme b)}) bindings- rebuildGraph =- \bindings ->- let g = Lexical.buildGraph bindings Maps.empty (Graph.graphPrimitives graph0)- in Graph.Graph {- Graph.graphBoundTerms = (Graph.graphBoundTerms g),- Graph.graphBoundTypes = (Graph.graphBoundTypes g),- Graph.graphClassConstraints = (Graph.graphClassConstraints g),- Graph.graphLambdaVariables = (Graph.graphLambdaVariables g),- Graph.graphMetadata = (Graph.graphMetadata g),- Graph.graphPrimitives = (Graph.graphPrimitives g),- Graph.graphSchemaTypes = (Graph.graphSchemaTypes graph0),- Graph.graphTypeVariables = (Graph.graphTypeVariables g)}- bins0 = originalBindings- bins1 = Logic.ifElse doHoistCaseStatements (hoistCases bins0) bins0- in (Eithers.bind (Logic.ifElse doInfer (Eithers.map (\result -> Pairs.second (Pairs.first result)) (Inference.inferGraphTypes cx bins1 (rebuildGraph bins1))) (checkBindingsTyped "after case hoisting" bins1)) (\bins2 -> Eithers.bind (Logic.ifElse doHoistPolymorphicLetBindings (checkBindingsTyped "after let hoisting" (hoistPoly bins2)) (Right bins2)) (\bins3 -> Eithers.bind (adaptDataGraph constraints doExpand bins3 cx (rebuildGraph bins3)) (\adaptResult ->- let adapted = Pairs.first adaptResult- adaptedBindings = Pairs.second adaptResult- in (Eithers.bind (checkBindingsTyped "after adaptation" adaptedBindings) (\bins4 ->- let bins5Raw = normalizeBindings bins4- peelOne =- \t -> case t of- Core.TermTypeLambda v0 -> Core.typeLambdaBody v0- Core.TermTypeApplication v0 -> Core.typeApplicationTermBody v0- _ -> t- extractAnn =- \t -> case t of- Core.TermAnnotated v0 -> Just (Core.annotatedTermAnnotation v0)- _ -> Nothing- findAnn =- \t ->- let t1 = peelOne t- t2 = peelOne t1- t3 = peelOne t2- in (Optionals.match (extractAnn t) (Optionals.match (extractAnn t1) (Optionals.match (extractAnn t2) (extractAnn t3) (\a -> Just a)) (\a -> Just a)) (\a -> Just a))- originalAnnotations =- Maps.fromList (Optionals.givens (Lists.map (\b -> Optionals.match (findAnn (Core.bindingTerm b)) Nothing (\ann -> Just (Core.bindingName b, ann))) originalBindings))- reattachAnnotation =- \b -> Optionals.match (Maps.lookup (Core.bindingName b) originalAnnotations) b (\ann -> Core.Binding {- Core.bindingName = (Core.bindingName b),- Core.bindingTerm = case (Core.bindingTerm b) of- Core.TermAnnotated v0 -> Core.TermAnnotated (Core.AnnotatedTerm {- Core.annotatedTermBody = (Core.annotatedTermBody v0),- Core.annotatedTermAnnotation = (Annotations.wrapAnnotationMap (Maps.union (Annotations.getAnnotationMap (Core.annotatedTermAnnotation v0)) (Annotations.getAnnotationMap ann)))})- _ -> Core.TermAnnotated (Core.AnnotatedTerm {- Core.annotatedTermBody = (Core.bindingTerm b),- Core.annotatedTermAnnotation = ann}),- Core.bindingTypeScheme = (Core.bindingTypeScheme b)})- bins5 = Lists.map reattachAnnotation bins5Raw- toDef =- \el -> Optionals.map (\ts -> Packaging.TermDefinition {- Packaging.termDefinitionName = (Core.bindingName el),- Packaging.termDefinitionMetadata = Nothing,- Packaging.termDefinitionSignature = (Just (Scoping.typeSchemeToTermSignature ts)),- Packaging.termDefinitionBody = (Core.bindingTerm el)}) (Core.bindingTypeScheme el)- selectedElements =- Lists.filter (\el -> Optionals.match (Names.moduleNameOf (Core.bindingName el)) False (\ns -> Sets.member ns namespacesSet)) bins5- elementsByNamespace =- Lists.foldl (\acc -> \el -> Optionals.match (Names.moduleNameOf (Core.bindingName el)) acc (\ns ->- let existing = Optionals.match (Maps.lookup ns acc) [] Functions.identity- in (Maps.insert ns (Lists.concat2 existing [- el]) acc))) Maps.empty selectedElements- defsGrouped =- Lists.map (\ns ->- let elsForNs = Optionals.match (Maps.lookup ns elementsByNamespace) [] Functions.identity- in (Optionals.givens (Lists.map toDef elsForNs))) namespaces- g = Lexical.buildGraph bins5 Maps.empty (Graph.graphPrimitives adapted)- in (Right (- Graph.Graph {- Graph.graphBoundTerms = (Graph.graphBoundTerms g),- Graph.graphBoundTypes = (Graph.graphBoundTypes g),- Graph.graphClassConstraints = (Graph.graphClassConstraints g),- Graph.graphLambdaVariables = (Graph.graphLambdaVariables g),- Graph.graphMetadata = (Graph.graphMetadata g),- Graph.graphPrimitives = (Graph.graphPrimitives g),- Graph.graphSchemaTypes = (Graph.graphSchemaTypes adapted),- Graph.graphTypeVariables = (Graph.graphTypeVariables g)},- defsGrouped))))))))---- | Check if a literal type is supported by the given language constraints-literalTypeSupported :: Coders.LanguageConstraints -> Core.LiteralType -> Bool-literalTypeSupported constraints lt =-- let forType =- \lt2 -> case lt2 of- Core.LiteralTypeFloat v0 -> Sets.member v0 (Coders.languageConstraintsFloatTypes constraints)- Core.LiteralTypeInteger v0 -> Sets.member v0 (Coders.languageConstraintsIntegerTypes constraints)- _ -> True- in (Logic.ifElse (Sets.member (Reflect.literalTypeVariant lt) (Coders.languageConstraintsLiteralVariants constraints)) (forType lt) False)---- | Prepare a float type, substituting unsupported types-prepareFloatType :: Ord t0 => (Core.FloatType -> (Core.FloatType, ((Core.FloatValue -> Core.FloatValue), (S.Set t0))))-prepareFloatType ft =- case ft of- Core.FloatTypeFloat32 -> (- Core.FloatTypeFloat32,- (- (\v -> case v of- Core.FloatValueFloat32 v1 -> Core.FloatValueFloat32 v1- _ -> v),- Sets.empty))- Core.FloatTypeFloat64 -> (- Core.FloatTypeFloat64,- (- (\v -> case v of- Core.FloatValueFloat64 v1 -> Core.FloatValueFloat64 v1- _ -> v),- Sets.empty))---- | Prepare an integer type, substituting unsupported types-prepareIntegerType :: Core.IntegerType -> (Core.IntegerType, ((Core.IntegerValue -> Core.IntegerValue), (S.Set String)))-prepareIntegerType it =- case it of- Core.IntegerTypeBigint -> (- Core.IntegerTypeInt64,- (- (\v -> case v of- Core.IntegerValueBigint v1 -> Core.IntegerValueInt64 (LibLiterals.bigintToInt64 v1)- _ -> v),- (Sets.fromList [- "replace arbitrary-precision integers with 64-bit integers"])))- Core.IntegerTypeUint8 -> (- Core.IntegerTypeInt8,- (- (\v -> case v of- Core.IntegerValueUint8 v1 -> Core.IntegerValueInt8 (LibLiterals.bigintToInt8 (LibLiterals.uint8ToBigint v1))- _ -> v),- (Sets.fromList [- "replace unsigned 8-bit integers with signed 8-bit integers"])))- Core.IntegerTypeUint32 -> (- Core.IntegerTypeInt32,- (- (\v -> case v of- Core.IntegerValueUint32 v1 -> Core.IntegerValueInt32 (LibLiterals.bigintToInt32 (LibLiterals.uint32ToBigint v1))- _ -> v),- (Sets.fromList [- "replace unsigned 32-bit integers with signed 32-bit integers"])))- Core.IntegerTypeUint64 -> (- Core.IntegerTypeInt64,- (- (\v -> case v of- Core.IntegerValueUint64 v1 -> Core.IntegerValueInt64 (LibLiterals.bigintToInt64 (LibLiterals.uint64ToBigint v1))- _ -> v),- (Sets.fromList [- "replace unsigned 64-bit integers with signed 64-bit integers"])))- _ -> prepareSame it---- | Prepare a literal type, substituting unsupported types-prepareLiteralType :: Core.LiteralType -> (Core.LiteralType, ((Core.Literal -> Core.Literal), (S.Set String)))-prepareLiteralType at =- case at of- Core.LiteralTypeBinary -> (- Core.LiteralTypeString,- (- (\v -> case v of- Core.LiteralBinary v1 -> Core.LiteralString (LibLiterals.binaryToBase64 v1)- _ -> v),- (Sets.fromList [- "replace binary strings with character strings"])))- Core.LiteralTypeDecimal -> (- Core.LiteralTypeFloat Core.FloatTypeFloat64,- (- (\v -> case v of- Core.LiteralDecimal v1 -> Core.LiteralFloat (Core.FloatValueFloat64 (LibLiterals.decimalToFloat64 v1))- _ -> v),- (Sets.fromList [- "replace arbitrary-precision decimal numbers with 64-bit floating-point numbers (doubles)"])))- Core.LiteralTypeFloat v0 ->- let result = prepareFloatType v0- rtyp = Pairs.first result- rep = Pairs.first (Pairs.second result)- msgs = Pairs.second (Pairs.second result)- in (- Core.LiteralTypeFloat rtyp,- (- (\v -> case v of- Core.LiteralFloat v1 -> Core.LiteralFloat (rep v1)- _ -> v),- msgs))- Core.LiteralTypeInteger v0 ->- let result = prepareIntegerType v0- rtyp = Pairs.first result- rep = Pairs.first (Pairs.second result)- msgs = Pairs.second (Pairs.second result)- in (- Core.LiteralTypeInteger rtyp,- (- (\v -> case v of- Core.LiteralInteger v1 -> Core.LiteralInteger (rep v1)- _ -> v),- msgs))- _ -> prepareSame at---- | Return a value unchanged with identity transform and no messages-prepareSame :: Ord t2 => (t0 -> (t0, ((t1 -> t1), (S.Set t2))))-prepareSame x = (x, ((\y -> y), Sets.empty))---- | Prepare a type, substituting unsupported literal types-prepareType :: t0 -> Core.Type -> (Core.Type, ((Core.Term -> Core.Term), (S.Set String)))-prepareType cx typ =- case (Strip.deannotateType typ) of- Core.TypeLiteral v0 ->- let result = prepareLiteralType v0- rtyp = Pairs.first result- rep = Pairs.first (Pairs.second result)- msgs = Pairs.second (Pairs.second result)- in (- Core.TypeLiteral rtyp,- (- (\v -> case v of- Core.TermLiteral v1 -> Core.TermLiteral (rep v1)- _ -> v),- msgs))- _ -> prepareSame typ---- | Normalize a term by pushing TermTypeApplication inward past TermApplication and TermLambda. This corrects structures produced by poly-let hoisting and eta expansion, where type applications from inference end up wrapping term applications or lambda abstractions instead of being directly on the polymorphic variable.-pushTypeAppsInward :: Core.Term -> Core.Term-pushTypeAppsInward term =-- let push =- \body -> \typ -> case body of- Core.TermAnnotated v0 -> Core.TermAnnotated (Core.AnnotatedTerm {- Core.annotatedTermBody = (push (Core.annotatedTermBody v0) typ),- Core.annotatedTermAnnotation = (Core.annotatedTermAnnotation v0)})- Core.TermApplication v0 -> go (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.applicationFunction v0),- Core.typeApplicationTermType = typ})),- Core.applicationArgument = (Core.applicationArgument v0)}))- Core.TermLambda v0 -> go (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.lambdaParameter v0),- Core.lambdaDomain = (Core.lambdaDomain v0),- Core.lambdaBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.lambdaBody v0),- Core.typeApplicationTermType = typ}))}))- Core.TermLet v0 -> go (Core.TermLet (Core.Let {- Core.letBindings = (Core.letBindings v0),- Core.letBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.letBody v0),- Core.typeApplicationTermType = typ}))}))- _ -> Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = body,- Core.typeApplicationTermType = typ})- go =- \t ->- let forField =- \fld -> Core.Field {- Core.fieldName = (Core.fieldName fld),- Core.fieldTerm = (go (Core.fieldTerm fld))}- forCaseAlternative =- \alt -> Core.CaseAlternative {- Core.caseAlternativeName = (Core.caseAlternativeName alt),- Core.caseAlternativeHandler = (go (Core.caseAlternativeHandler alt))}- forLet =- \lt ->- let mapBinding =- \b -> Core.Binding {- Core.bindingName = (Core.bindingName b),- Core.bindingTerm = (go (Core.bindingTerm b)),- Core.bindingTypeScheme = (Core.bindingTypeScheme b)}- in Core.Let {- Core.letBindings = (Lists.map mapBinding (Core.letBindings lt)),- Core.letBody = (go (Core.letBody lt))}- forMap =- \m ->- let forPair = \p -> (go (Pairs.first p), (go (Pairs.second p)))- in (Maps.fromList (Lists.map forPair (Maps.toList m)))- in case t of- Core.TermAnnotated v0 -> Core.TermAnnotated (Core.AnnotatedTerm {- Core.annotatedTermBody = (go (Core.annotatedTermBody v0)),- Core.annotatedTermAnnotation = (Core.annotatedTermAnnotation v0)})- Core.TermApplication v0 -> Core.TermApplication (Core.Application {- Core.applicationFunction = (go (Core.applicationFunction v0)),- Core.applicationArgument = (go (Core.applicationArgument v0))})- Core.TermCases v0 -> Core.TermCases (Core.CaseStatement {- Core.caseStatementTypeName = (Core.caseStatementTypeName v0),- Core.caseStatementDefault = (Optionals.map go (Core.caseStatementDefault v0)),- Core.caseStatementCases = (Lists.map forCaseAlternative (Core.caseStatementCases v0))})- Core.TermEither v0 -> Core.TermEither (Eithers.either (\l -> Left (go l)) (\r -> Right (go r)) v0)- Core.TermLambda v0 -> Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.lambdaParameter v0),- Core.lambdaDomain = (Core.lambdaDomain v0),- Core.lambdaBody = (go (Core.lambdaBody v0))})- Core.TermLet v0 -> Core.TermLet (forLet v0)- Core.TermList v0 -> Core.TermList (Lists.map go v0)- Core.TermLiteral v0 -> Core.TermLiteral v0- Core.TermMap v0 -> Core.TermMap (forMap v0)- Core.TermOptional v0 -> Core.TermOptional (Optionals.map go v0)- Core.TermPair v0 -> Core.TermPair (go (Pairs.first v0), (go (Pairs.second v0)))- Core.TermProject v0 -> Core.TermProject v0- Core.TermRecord v0 -> Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.recordTypeName v0),- Core.recordFields = (Lists.map forField (Core.recordFields v0))})- Core.TermSet v0 -> Core.TermSet (Sets.fromList (Lists.map go (Sets.toList v0)))- Core.TermTypeApplication v0 ->- let body1 = go (Core.typeApplicationTermBody v0)- in (push body1 (Core.typeApplicationTermType v0))- Core.TermTypeLambda v0 -> Core.TermTypeLambda (Core.TypeLambda {- Core.typeLambdaParameter = (Core.typeLambdaParameter v0),- Core.typeLambdaBody = (go (Core.typeLambdaBody v0))})- Core.TermInject v0 -> Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.injectionTypeName v0),- Core.injectionField = (forField (Core.injectionField v0))})- Core.TermUnit -> Core.TermUnit- Core.TermUnwrap v0 -> Core.TermUnwrap v0- Core.TermVariable v0 -> Core.TermVariable v0- Core.TermWrap v0 -> Core.TermWrap (Core.WrappedTerm {- Core.wrappedTermTypeName = (Core.wrappedTermTypeName v0),- Core.wrappedTermBody = (go (Core.wrappedTermBody v0))})- in (go term)---- | Given a schema graph along with language constraints and a designated list of element names, adapt the graph to the language constraints, then return a corresponding type definition for each element name.-schemaGraphToDefinitions :: Coders.LanguageConstraints -> Graph.Graph -> [[Core.Name]] -> t0 -> Either Errors.Error (M.Map Core.Name Core.Type, [[Packaging.TypeDefinition]])-schemaGraphToDefinitions constraints graph nameLists cx =-- let litmap = adaptLiteralTypesMap constraints- in (Eithers.bind (Eithers.bimap (\e -> Errors.ErrorDecoding e) (\x -> x) (Environment.graphAsTypes graph (Lexical.graphToBindings graph))) (\tmap0 -> Eithers.bind (adaptGraphSchema constraints litmap tmap0) (\tmap1 ->- let toDef =- \pair -> Packaging.TypeDefinition {- Packaging.typeDefinitionName = (Pairs.first pair),- Packaging.typeDefinitionMetadata = Nothing,- Packaging.typeDefinitionBody = Core.TypeScheme {- Core.typeSchemeVariables = [],- Core.typeSchemeBody = (Pairs.second pair),- Core.typeSchemeConstraints = Maps.empty}}- in (Right (- tmap1,- (Lists.map (\names -> Lists.map toDef (Optionals.mapOptional (\n -> Optionals.map (\t -> (n, t)) (Maps.lookup n tmap1)) names)) nameLists))))))---- | Given a target language and a source type, produce an adapter which rewrites the type and its terms according to the language's constraints. The encode direction adapts terms; the decode direction is identity.-simpleLanguageAdapter :: Coders.Language -> t0 -> Graph.Graph -> Core.Type -> Either Errors.Error (Coders.Adapter Core.Type Core.Type Core.Term Core.Term Errors.Error)-simpleLanguageAdapter lang cx g typ =-- let constraints = Coders.languageConstraints lang- litmap = adaptLiteralTypesMap constraints- in (Eithers.bind (adaptType constraints litmap typ) (\adaptedType -> Right (Coders.Adapter {- Coders.adapterIsLossy = False,- Coders.adapterSource = typ,- Coders.adapterTarget = adaptedType,- Coders.adapterCoder = Coders.Coder {- Coders.coderEncode = (\term -> adaptTerm constraints litmap cx g term),- Coders.coderDecode = (\term -> Right term)}})))---- | Find a list of alternatives for a given term, if any-termAlternatives :: t0 -> Graph.Graph -> Core.Term -> Either Errors.Error [Core.Term]-termAlternatives cx graph term =- case term of- Core.TermAnnotated v0 ->- let term2 = Core.annotatedTermBody v0- in (Right [- term2])- Core.TermOptional v0 -> Right [- Core.TermList (Optionals.match v0 [] (\term2 -> [- term2]))]- Core.TermTypeLambda v0 ->- let term2 = Core.typeLambdaBody v0- in (Right [- term2])- Core.TermTypeApplication v0 ->- let term2 = Core.typeApplicationTermBody v0- in (Right [- term2])- Core.TermInject v0 ->- let tname = Core.injectionTypeName v0- field = Core.injectionField v0- fname = Core.fieldName field- fterm = Core.fieldTerm field- forFieldType =- \ft ->- let ftname = Core.fieldTypeName ft- in Core.Field {- Core.fieldName = fname,- Core.fieldTerm = (Core.TermOptional (Logic.ifElse (Equality.equal ftname fname) (Just fterm) Nothing))}- in (Eithers.bind (Resolution.requireUnionType cx graph tname) (\rt -> Right [- Core.TermRecord (Core.Record {- Core.recordTypeName = tname,- Core.recordFields = (Lists.map forFieldType rt)})]))- Core.TermUnit -> Right [- Core.TermLiteral (Core.LiteralBoolean True)]- Core.TermWrap v0 ->- let term2 = Core.wrappedTermBody v0- in (Right [- term2])- _ -> Right []---- | Find a list of alternatives for a given type, if any-typeAlternatives :: Core.Type -> [Core.Type]-typeAlternatives type_ =- case type_ of- Core.TypeAnnotated v0 ->- let type2 = Core.annotatedTypeBody v0- in [- type2]- Core.TypeEffect v0 -> [- v0]- Core.TypeOptional v0 -> [- Core.TypeList v0]- Core.TypeUnion v0 ->- let toOptField =- \f -> Core.FieldType {- Core.fieldTypeName = (Core.fieldTypeName f),- Core.fieldTypeType = (Core.TypeOptional (Core.fieldTypeType f))}- optFields = Lists.map toOptField v0- in [- Core.TypeRecord optFields]- Core.TypeUnit -> [- Core.TypeLiteral Core.LiteralTypeBoolean]- Core.TypeVoid -> [- Core.TypeUnit]- _ -> []
@@ -1,335 +0,0 @@--- Note: this is an automatically generated file. Do not edit.---- | Module dependency module name analysis--module Hydra.Analysis where--import qualified Hydra.Annotations as Annotations-import qualified Hydra.Arity as Arity-import qualified Hydra.Ast as Ast-import qualified Hydra.Checking as Checking-import qualified Hydra.Coders as Coders-import qualified Hydra.Constants as Constants-import qualified Hydra.Core as Core-import qualified Hydra.Decode.Core as DecodeCore-import qualified Hydra.Dependencies as Dependencies-import qualified Hydra.Docs as Docs-import qualified Hydra.Encode.Core as EncodeCore-import qualified Hydra.Error.Checking as ErrorChecking-import qualified Hydra.Error.Core as ErrorCore-import qualified Hydra.Error.File as ErrorFile-import qualified Hydra.Error.Packaging as ErrorPackaging-import qualified Hydra.Error.System as ErrorSystem-import qualified Hydra.Errors as Errors-import qualified Hydra.File as File-import qualified Hydra.Graph as Graph-import qualified Hydra.Json.Model as Model-import qualified Hydra.Lexical as Lexical-import qualified Hydra.Overlay.Haskell.Lib.Eithers as Eithers-import qualified Hydra.Overlay.Haskell.Lib.Equality as Equality-import qualified Hydra.Overlay.Haskell.Lib.Lists as Lists-import qualified Hydra.Overlay.Haskell.Lib.Logic as Logic-import qualified Hydra.Overlay.Haskell.Lib.Maps as Maps-import qualified Hydra.Overlay.Haskell.Lib.Optionals as Optionals-import qualified Hydra.Overlay.Haskell.Lib.Pairs as Pairs-import qualified Hydra.Overlay.Haskell.Lib.Sets as Sets-import qualified Hydra.Names as Names-import qualified Hydra.Packaging as Packaging-import qualified Hydra.Parsing as Parsing-import qualified Hydra.Paths as Paths-import qualified Hydra.Predicates as Predicates-import qualified Hydra.Query as Query-import qualified Hydra.Regex as Regex-import qualified Hydra.Relational as Relational-import qualified Hydra.Rewriting as Rewriting-import qualified Hydra.Scoping as Scoping-import qualified Hydra.Strip as Strip-import qualified Hydra.System as System-import qualified Hydra.Tabular as Tabular-import qualified Hydra.Testing as Testing-import qualified Hydra.Time as Time-import qualified Hydra.Topology as Topology-import qualified Hydra.Typed as Typed-import qualified Hydra.Typing as Typing-import qualified Hydra.Util as Util-import qualified Hydra.Validation as Validation-import qualified Hydra.Variables as Variables-import qualified Hydra.Variants as Variants-import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)-import qualified Data.Scientific as Sci-import Data.Void-import qualified Data.Set as S---- | Add names to existing module names mapping-addNamesToModuleNames :: (Packaging.ModuleName -> t0) -> S.Set Core.Name -> Util.ModuleNames t0 -> Util.ModuleNames t0-addNamesToModuleNames encodeModuleName names ns0 =-- let nss = Sets.fromList (Optionals.givens (Lists.map Names.moduleNameOf (Sets.toList names)))- toPair = \ns -> (ns, (encodeModuleName ns))- in Util.ModuleNames {- Util.moduleNamesFocus = (Util.moduleNamesFocus ns0),- Util.moduleNamesMapping = (Maps.union (Util.moduleNamesMapping ns0) (Maps.fromList (Lists.map toPair (Sets.toList nss))))}---- | Analyze a function term, collecting lambdas, type lambdas, lets, and type applications-analyzeFunctionTerm :: Typing.InferenceContext -> (t0 -> Graph.Graph) -> (Graph.Graph -> t0 -> t0) -> t0 -> Core.Term -> Either t1 (Typing.FunctionStructure t0)-analyzeFunctionTerm cx getTC setTC env term =- analyzeFunctionTermWith cx (\g -> \b -> Logic.ifElse (Predicates.isComplexBinding g b) (Just (Core.TermLiteral (Core.LiteralBoolean True))) Nothing) getTC setTC env term---- | Analyze a function term with configurable binding metadata-analyzeFunctionTermWith :: Typing.InferenceContext -> (Graph.Graph -> Core.Binding -> Maybe Core.Term) -> (t0 -> Graph.Graph) -> (Graph.Graph -> t0 -> t0) -> t0 -> Core.Term -> Either t1 (Typing.FunctionStructure t0)-analyzeFunctionTermWith cx forBinding getTC setTC env term =- analyzeFunctionTermWithGather cx forBinding getTC setTC True env [] [] [] [] [] term---- | Final step of the function-term walk: type-apply the body and assemble the FunctionStructure-analyzeFunctionTermWithFinish :: Typing.InferenceContext -> (t0 -> Graph.Graph) -> t0 -> [Core.Name] -> [Core.Name] -> [Core.Binding] -> [Core.Type] -> [Core.Type] -> Core.Term -> Either t1 (Typing.FunctionStructure t0)-analyzeFunctionTermWithFinish cx getTC fEnv tparams args bindings doms tapps body =-- let bodyWithTapps =- Lists.foldl (\trm -> \typ -> Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = trm,- Core.typeApplicationTermType = typ})) body tapps- mcod = Eithers.either (\_ -> Nothing) (\c -> Just c) (Checking.typeOfTerm cx (getTC fEnv) bodyWithTapps)- in (Right (Typing.FunctionStructure {- Typing.functionStructureTypeParams = (Lists.reverse tparams),- Typing.functionStructureParams = (Lists.reverse args),- Typing.functionStructureBindings = bindings,- Typing.functionStructureBody = bodyWithTapps,- Typing.functionStructureDomains = (Lists.reverse doms),- Typing.functionStructureCodomain = mcod,- Typing.functionStructureEnvironment = fEnv}))---- | Recursive step of the function-term walk: peel lambdas / type-lambdas / type-applications, accumulating params and bindings, then call analyzeFunctionTermWithFinish-analyzeFunctionTermWithGather :: Typing.InferenceContext -> (Graph.Graph -> Core.Binding -> Maybe Core.Term) -> (t0 -> Graph.Graph) -> (Graph.Graph -> t0 -> t0) -> Bool -> t0 -> [Core.Name] -> [Core.Name] -> [Core.Binding] -> [Core.Type] -> [Core.Type] -> Core.Term -> Either t1 (Typing.FunctionStructure t0)-analyzeFunctionTermWithGather cx forBinding getTC setTC argMode gEnv tparams args bindings doms tapps t =- case (Strip.deannotateTerm t) of- Core.TermLambda v0 -> Logic.ifElse argMode (- let v = Core.lambdaParameter v0- dom = Optionals.match (Core.lambdaDomain v0) (Core.TypeVariable (Core.Name "_")) (\x_ -> x_)- body = Core.lambdaBody v0- newEnv = setTC (Scoping.extendGraphForLambda (getTC gEnv) v0) gEnv- in (analyzeFunctionTermWithGather cx forBinding getTC setTC argMode newEnv tparams (Lists.cons v args) bindings (Lists.cons dom doms) tapps body)) (analyzeFunctionTermWithFinish cx getTC gEnv tparams args bindings doms tapps t)- Core.TermLet v0 ->- let newBindings = Core.letBindings v0- body = Core.letBody v0- newEnv = setTC (Scoping.extendGraphForLet forBinding (getTC gEnv) v0) gEnv- in (analyzeFunctionTermWithGather cx forBinding getTC setTC False newEnv tparams args (Lists.concat2 bindings newBindings) doms tapps body)- Core.TermTypeApplication v0 ->- let taBody = Core.typeApplicationTermBody v0- typ = Core.typeApplicationTermType v0- in (analyzeFunctionTermWithGather cx forBinding getTC setTC argMode gEnv tparams args bindings doms (Lists.cons typ tapps) taBody)- Core.TermTypeLambda v0 ->- let tvar = Core.typeLambdaParameter v0- tlBody = Core.typeLambdaBody v0- newEnv = setTC (Scoping.extendGraphForTypeLambda (getTC gEnv) v0) gEnv- in (analyzeFunctionTermWithGather cx forBinding getTC setTC argMode newEnv (Lists.cons tvar tparams) args bindings doms tapps tlBody)- _ -> analyzeFunctionTermWithFinish cx getTC gEnv tparams args bindings doms tapps t---- | Get dependency module names from definitions-definitionDependencyModuleNames :: [Packaging.Definition] -> S.Set Packaging.ModuleName-definitionDependencyModuleNames defs =-- let defNames =- \def -> case def of- Packaging.DefinitionType v0 -> Dependencies.typeDependencyNames True (Core.typeSchemeBody (Packaging.typeDefinitionBody v0))- Packaging.DefinitionTerm v0 -> Dependencies.termDependencyNames True True True (Packaging.termDefinitionBody v0)- Packaging.DefinitionPrimitive v0 -> Dependencies.typeDependencyNames True (Core.typeSchemeBody (Scoping.termSignatureToTypeScheme (Packaging.primitiveDefinitionSignature v0)))- allNames = Sets.unions (Lists.map defNames defs)- in (Sets.fromList (Optionals.givens (Lists.map Names.moduleNameOf (Sets.toList allNames))))---- | Find dependency module names in all of a set of terms (Either version)-dependencyModuleNames :: t0 -> Graph.Graph -> Bool -> Bool -> Bool -> Bool -> [Core.Binding] -> Either Errors.Error (S.Set Packaging.ModuleName)-dependencyModuleNames cx graph binds withPrims withNoms withSchema els =-- let depNames =- \el ->- let term = Core.bindingTerm el- deannotatedTerm = Strip.deannotateTerm term- dataNames = Dependencies.termDependencyNames binds withPrims withNoms term- schemaNames =- Logic.ifElse withSchema (Optionals.match (Core.bindingTypeScheme el) Sets.empty (\ts -> Dependencies.typeDependencyNames True (Core.typeSchemeBody ts))) Sets.empty- in (Logic.ifElse (Predicates.isEncodedType deannotatedTerm) (Eithers.map (\typ -> Sets.unions [- dataNames,- schemaNames,- (Dependencies.typeDependencyNames True typ)]) (Eithers.bimap (\_e -> Errors.ErrorDecoding _e) (\_a -> _a) (DecodeCore.type_ graph term))) (Logic.ifElse (Predicates.isEncodedTerm deannotatedTerm) (Eithers.map (\decodedTerm -> Sets.unions [- dataNames,- schemaNames,- (Dependencies.termDependencyNames binds withPrims withNoms decodedTerm)]) (Eithers.bimap (\_e -> Errors.ErrorDecoding _e) (\_a -> _a) (DecodeCore.term graph term))) (Right (Sets.unions [- dataNames,- schemaNames]))))- in (Eithers.map (\namesList -> Sets.fromList (Optionals.givens (Lists.map Names.moduleNameOf (Sets.toList (Sets.unions namesList))))) (Eithers.mapList depNames els))---- | Gather applications from a term, returning (args, baseTerm)-gatherApplications :: Core.Term -> ([Core.Term], Core.Term)-gatherApplications term =-- let go =- \args -> \t -> case (Strip.deannotateTerm t) of- Core.TermApplication v0 ->- let lhs = Core.applicationFunction v0- rhs = Core.applicationArgument v0- in (go (Lists.cons rhs args) lhs)- _ -> (args, t)- in (go [] term)---- | Gather term arguments, stripping type-level constructs-gatherArgs :: Core.Term -> [Core.Term] -> (Core.Term, [Core.Term])-gatherArgs term args =- case (Strip.deannotateTerm term) of- Core.TermApplication v0 ->- let lhs = Core.applicationFunction v0- rhs = Core.applicationArgument v0- in (gatherArgs lhs (Lists.cons rhs args))- Core.TermTypeLambda v0 ->- let body = Core.typeLambdaBody v0- in (gatherArgs body args)- Core.TermTypeApplication v0 ->- let body = Core.typeApplicationTermBody v0- in (gatherArgs body args)- _ -> (term, args)---- | Gather term and type arguments from a term-gatherArgsWithTypeApps :: Core.Term -> [Core.Term] -> [Core.Type] -> (Core.Term, ([Core.Term], [Core.Type]))-gatherArgsWithTypeApps term args tyArgs =- case (Strip.deannotateTerm term) of- Core.TermApplication v0 ->- let lhs = Core.applicationFunction v0- rhs = Core.applicationArgument v0- in (gatherArgsWithTypeApps lhs (Lists.cons rhs args) tyArgs)- Core.TermTypeLambda v0 ->- let body = Core.typeLambdaBody v0- in (gatherArgsWithTypeApps body args tyArgs)- Core.TermTypeApplication v0 ->- let body = Core.typeApplicationTermBody v0- typ = Core.typeApplicationTermType v0- in (gatherArgsWithTypeApps body args (Lists.cons typ tyArgs))- _ -> (term, (args, tyArgs))---- | Check if a term body is self-tail-recursive with respect to a function name-isSelfTailRecursive :: Core.Name -> Core.Term -> Bool-isSelfTailRecursive funcName body =-- let callsSelf = Logic.not (Variables.isFreeVariableInTerm funcName body)- in (Logic.ifElse callsSelf (isTailRecursiveInTailPosition funcName body) False)---- | Check if a term can be encoded as a simple assignment-isSimpleAssignment :: Core.Term -> Bool-isSimpleAssignment term =- case term of- Core.TermAnnotated v0 -> isSimpleAssignment (Core.annotatedTermBody v0)- Core.TermLambda _ -> False- Core.TermLet _ -> False- Core.TermTypeLambda _ -> False- Core.TermTypeApplication v0 -> isSimpleAssignment (Core.typeApplicationTermBody v0)- _ ->- let baseTerm = Pairs.first (gatherArgs term [])- in case baseTerm of- Core.TermCases _ -> False- _ -> True---- | Check that all self-references are in tail position-isTailRecursiveInTailPosition :: Core.Name -> Core.Term -> Bool-isTailRecursiveInTailPosition funcName term =-- let stripped = Strip.deannotateAndDetypeTerm term- in case stripped of- Core.TermApplication _ ->- let gathered = gatherApplications stripped- gatherArgs = Pairs.first gathered- gatherFun = Pairs.second gathered- strippedFun = Strip.deannotateAndDetypeTerm gatherFun- in case strippedFun of- Core.TermVariable v1 -> Logic.ifElse (Equality.equal v1 funcName) (- let argsNoFunc = Lists.foldl (\ok -> \arg -> Logic.and ok (Variables.isFreeVariableInTerm funcName arg)) True gatherArgs- argsNoLambda =- Lists.foldl (\ok -> \arg -> Logic.and ok (Logic.not (Rewriting.foldOverTerm Coders.TraversalOrderPre (\found -> \t -> Logic.or found (case t of- Core.TermLambda v2 ->- let ignore = Core.lambdaBody v2- in True- _ -> False)) False arg))) True gatherArgs- in (Logic.and argsNoFunc argsNoLambda)) (Variables.isFreeVariableInTerm funcName term)- Core.TermCases v1 ->- let cases_ = Core.caseStatementCases v1- dflt = Core.caseStatementDefault v1- branchesOk =- Lists.foldl (\ok -> \field -> Logic.and ok (isTailRecursiveInTailPosition funcName (Core.caseAlternativeHandler field))) True cases_- dfltOk = Optionals.match dflt True (\d -> isTailRecursiveInTailPosition funcName d)- argsOk = Lists.foldl (\ok -> \arg -> Logic.and ok (Variables.isFreeVariableInTerm funcName arg)) True gatherArgs- in (Logic.and (Logic.and branchesOk dfltOk) argsOk)- _ -> Variables.isFreeVariableInTerm funcName term- Core.TermLambda v0 -> isTailRecursiveInTailPosition funcName (Core.lambdaBody v0)- Core.TermLet v0 ->- let bindingsOk =- Lists.foldl (\ok -> \b -> Logic.and ok (Variables.isFreeVariableInTerm funcName (Core.bindingTerm b))) True (Core.letBindings v0)- in (Logic.and bindingsOk (isTailRecursiveInTailPosition funcName (Core.letBody v0)))- _ -> Variables.isFreeVariableInTerm funcName term---- | Check whether a module contains any binary literal values-moduleContainsBinaryLiterals :: Packaging.Module -> Bool-moduleContainsBinaryLiterals mod =-- let checkTerm =- \found -> \term -> Logic.or found (case term of- Core.TermLiteral v0 -> case v0 of- Core.LiteralBinary _ -> True- _ -> False- _ -> False)- termContainsBinary = \term -> Rewriting.foldOverTerm Coders.TraversalOrderPre checkTerm False term- defTerms =- Optionals.givens (Lists.map (\d -> case d of- Packaging.DefinitionTerm v0 -> Just (Packaging.termDefinitionBody v0)- _ -> Nothing) (Packaging.moduleDefinitions mod))- in (Lists.foldl (\acc -> \t -> Logic.or acc (termContainsBinary t)) False defTerms)---- | Check whether a module contains any decimal literal values-moduleContainsDecimalLiterals :: Packaging.Module -> Bool-moduleContainsDecimalLiterals mod =-- let checkTerm =- \found -> \term -> Logic.or found (case term of- Core.TermLiteral v0 -> case v0 of- Core.LiteralDecimal _ -> True- _ -> False- _ -> False)- termContainsDecimal = \term -> Rewriting.foldOverTerm Coders.TraversalOrderPre checkTerm False term- defTerms =- Optionals.givens (Lists.map (\d -> case d of- Packaging.DefinitionTerm v0 -> Just (Packaging.termDefinitionBody v0)- _ -> Nothing) (Packaging.moduleDefinitions mod))- in (Lists.foldl (\acc -> \t -> Logic.or acc (termContainsDecimal t)) False defTerms)---- | Find dependency module names in all elements of a module, excluding the module's own module name (Either version)-moduleDependencyModuleNames :: t0 -> Graph.Graph -> Bool -> Bool -> Bool -> Bool -> Packaging.Module -> Either Errors.Error (S.Set Packaging.ModuleName)-moduleDependencyModuleNames cx graph binds withPrims withNoms withSchema mod =-- let allBindings =- Optionals.givens (Lists.map (\d -> case d of- Packaging.DefinitionType v0 -> Just ((\name -> \typ ->- let schemaTerm = Core.TermVariable (Core.Name "hydra.core.Type")- dataTerm =- Annotations.normalizeTermAnnotations (Core.TermAnnotated (Core.AnnotatedTerm {- Core.annotatedTermBody = (EncodeCore.type_ typ),- Core.annotatedTermAnnotation = (Annotations.wrapAnnotationMap (Maps.fromList [- (Constants.keyType, schemaTerm)]))}))- in Core.Binding {- Core.bindingName = name,- Core.bindingTerm = dataTerm,- Core.bindingTypeScheme = (Just (Core.TypeScheme {- Core.typeSchemeVariables = [],- Core.typeSchemeBody = (Core.TypeVariable (Core.Name "hydra.core.Type")),- Core.typeSchemeConstraints = Maps.empty}))}) (Packaging.typeDefinitionName v0) (Core.typeSchemeBody (Packaging.typeDefinitionBody v0)))- Packaging.DefinitionTerm v0 -> Just (Core.Binding {- Core.bindingName = (Packaging.termDefinitionName v0),- Core.bindingTerm = (Packaging.termDefinitionBody v0),- Core.bindingTypeScheme = (Optionals.map Scoping.termSignatureToTypeScheme (Packaging.termDefinitionSignature v0))})- _ -> Nothing) (Packaging.moduleDefinitions mod))- in (Eithers.map (\deps -> Sets.delete (Packaging.moduleName mod) deps) (dependencyModuleNames cx graph binds withPrims withNoms withSchema allBindings))---- | Create module names mapping for definitions-moduleNamesForDefinitions :: (Packaging.ModuleName -> t0) -> Packaging.ModuleName -> [Packaging.Definition] -> Util.ModuleNames t0-moduleNamesForDefinitions encodeModuleName focusNs defs =-- let nss = Sets.delete focusNs (definitionDependencyModuleNames defs)- toPair = \ns -> (ns, (encodeModuleName ns))- in Util.ModuleNames {- Util.moduleNamesFocus = (toPair focusNs),- Util.moduleNamesMapping = (Maps.fromList (Lists.map toPair (Sets.toList nss)))}
@@ -1,253 +0,0 @@--- Note: this is an automatically generated file. Do not edit.---- | Utilities for reading and writing type and term annotations--module Hydra.Annotations where--import qualified Hydra.Ast as Ast-import qualified Hydra.Coders as Coders-import qualified Hydra.Constants as Constants-import qualified Hydra.Core as Core-import qualified Hydra.Decode.Core as DecodeCore-import qualified Hydra.Docs as Docs-import qualified Hydra.Encode.Core as EncodeCore-import qualified Hydra.Error.Checking as Checking-import qualified Hydra.Error.Core as ErrorCore-import qualified Hydra.Error.File as ErrorFile-import qualified Hydra.Error.Packaging as ErrorPackaging-import qualified Hydra.Error.System as ErrorSystem-import qualified Hydra.Errors as Errors-import qualified Hydra.Extract.Core as ExtractCore-import qualified Hydra.File as File-import qualified Hydra.Graph as Graph-import qualified Hydra.Json.Model as Model-import qualified Hydra.Lexical as Lexical-import qualified Hydra.Overlay.Haskell.Lib.Eithers as Eithers-import qualified Hydra.Overlay.Haskell.Lib.Equality as Equality-import qualified Hydra.Overlay.Haskell.Lib.Lists as Lists-import qualified Hydra.Overlay.Haskell.Lib.Logic as Logic-import qualified Hydra.Overlay.Haskell.Lib.Maps as Maps-import qualified Hydra.Overlay.Haskell.Lib.Optionals as Optionals-import qualified Hydra.Overlay.Haskell.Lib.Pairs as Pairs-import qualified Hydra.Overlay.Haskell.Lib.Sets as Sets-import qualified Hydra.Packaging as Packaging-import qualified Hydra.Parsing as Parsing-import qualified Hydra.Paths as Paths-import qualified Hydra.Print.Core as PrintCore-import qualified Hydra.Print.Errors as PrintErrors-import qualified Hydra.Query as Query-import qualified Hydra.Regex as Regex-import qualified Hydra.Relational as Relational-import qualified Hydra.Strip as Strip-import qualified Hydra.System as System-import qualified Hydra.Tabular as Tabular-import qualified Hydra.Testing as Testing-import qualified Hydra.Time as Time-import qualified Hydra.Topology as Topology-import qualified Hydra.Typed as Typed-import qualified Hydra.Typing as Typing-import qualified Hydra.Util as Util-import qualified Hydra.Validation as Validation-import qualified Hydra.Variants as Variants-import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)-import qualified Data.Scientific as Sci-import Data.Void-import qualified Data.Map as M-import qualified Data.Set as S---- | Aggregate annotations from nested structures-aggregateAnnotations :: Ord t2 => ((t0 -> Maybe t1) -> (t1 -> t0) -> (t1 -> M.Map t2 t3) -> t0 -> M.Map t2 t3)-aggregateAnnotations getValue getX getAnns t =-- let toPairs =- \rest -> \t2 -> Optionals.match (getValue t2) rest (\yy -> toPairs (Lists.cons (Maps.toList (getAnns yy)) rest) (getX yy))- in (Maps.fromList (Lists.concat (toPairs [] t)))---- | Extract comments/description from a Binding-commentsFromBinding :: t0 -> Graph.Graph -> Core.Binding -> Either Errors.Error (Maybe String)-commentsFromBinding cx g b = getTermDescription cx g (Core.bindingTerm b)---- | Extract comments/description from a FieldType-commentsFromFieldType :: t0 -> Graph.Graph -> Core.FieldType -> Either Errors.Error (Maybe String)-commentsFromFieldType cx g ft = getTypeDescription cx g (Core.fieldTypeType ft)---- | Project a Map<Name, Term> out of an annotation Term. For a TermMap with TermVariable-shaped keys (or, transitionally, TermWrap-encoded Name keys), returns those (Name, value) entries; for any other shape, returns the empty map.-getAnnotationMap :: Core.Term -> M.Map Core.Name Core.Term-getAnnotationMap t =-- let extractName =- \k -> case k of- Core.TermVariable v0 -> Just v0- Core.TermWrap v0 -> case (Core.wrappedTermBody v0) of- Core.TermLiteral v1 -> case v1 of- Core.LiteralString v2 -> Just (Core.Name v2)- _ -> Nothing- _ -> Nothing- _ -> Nothing- fromEntry =- \p ->- let k = Pairs.first p- v = Pairs.second p- in (Optionals.map (\n -> (n, v)) (extractName k))- in case t of- Core.TermMap v0 -> Maps.fromList (Optionals.givens (Lists.map fromEntry (Maps.toList v0)))- _ -> Maps.empty---- | Get description from annotations map (Either version)-getDescription :: t0 -> Graph.Graph -> M.Map Core.Name Core.Term -> Either Errors.Error (Maybe String)-getDescription cx graph anns =- Optionals.match (Maps.lookup (Core.Name "description") anns) (Right Nothing) (\term -> Eithers.map Optionals.given (ExtractCore.string graph term))---- | Get a term annotation-getTermAnnotation :: Core.Name -> Core.Term -> Maybe Core.Term-getTermAnnotation key term = Maps.lookup key (termAnnotationInternal term)---- | Get term description (Either version)-getTermDescription :: t0 -> Graph.Graph -> Core.Term -> Either Errors.Error (Maybe String)-getTermDescription cx graph term =-- let peel =- \t -> case t of- Core.TermTypeLambda v0 -> peel (Core.typeLambdaBody v0)- Core.TermTypeApplication v0 -> peel (Core.typeApplicationTermBody v0)- _ -> t- in (getDescription cx graph (termAnnotationInternal (peel term)))---- | Get type from annotations-getType :: Graph.Graph -> M.Map Core.Name Core.Term -> Either Errors.DecodingError (Maybe Core.Type)-getType graph anns =- Optionals.match (Maps.lookup Constants.keyType anns) (Right Nothing) (\dat -> Eithers.map Optionals.given (DecodeCore.type_ graph dat))---- | Get a type annotation-getTypeAnnotation :: Core.Name -> Core.Type -> Maybe Core.Term-getTypeAnnotation key typ = Maps.lookup key (typeAnnotationInternal typ)---- | Get type classes from term. Each Set Name contains bare class identifiers (#275).-getTypeClasses :: t0 -> Graph.Graph -> Core.Term -> Either Errors.Error (M.Map Core.Name (S.Set Core.Name))-getTypeClasses cx graph term =-- let decodeName = \term2 -> Eithers.bimap (\de -> Errors.ErrorDecoding de) (\x -> x) (DecodeCore.name graph term2)- in (Optionals.match (getTermAnnotation Constants.keyClasses term) (Right Maps.empty) (\term2 -> ExtractCore.map decodeName (ExtractCore.setOf decodeName graph) graph term2))---- | Get type description (Either version)-getTypeDescription :: t0 -> Graph.Graph -> Core.Type -> Either Errors.Error (Maybe String)-getTypeDescription cx graph typ = getDescription cx graph (typeAnnotationInternal typ)---- | Check if annotations contain description-hasDescription :: M.Map Core.Name t0 -> Bool-hasDescription anns = Optionals.isGiven (Maps.lookup Constants.keyDescription anns)---- | Check if type has description-hasTypeDescription :: Core.Type -> Bool-hasTypeDescription typ = hasDescription (typeAnnotationInternal typ)---- | For a typed term, decide whether a coder should encode it as a native type expression, or as a Hydra type expression.-isNativeType :: Core.Binding -> Bool-isNativeType el =-- let isFlaggedAsFirstClassType =- Optionals.withDefault False (Optionals.map (\_ -> True) (getTermAnnotation Constants.keyFirstClassType (Core.bindingTerm el)))- in (Optionals.match (Core.bindingTypeScheme el) False (\ts -> Logic.and (Equality.equal ts (Core.TypeScheme {- Core.typeSchemeVariables = [],- Core.typeSchemeBody = (Core.TypeVariable (Core.Name "hydra.core.Type")),- Core.typeSchemeConstraints = Maps.empty})) (Logic.not isFlaggedAsFirstClassType)))---- | Normalize term annotations-normalizeTermAnnotations :: Core.Term -> Core.Term-normalizeTermAnnotations term =-- let anns = termAnnotationInternal term- stripped = Strip.deannotateTerm term- in (Logic.ifElse (Maps.isEmpty anns) stripped (Core.TermAnnotated (Core.AnnotatedTerm {- Core.annotatedTermBody = stripped,- Core.annotatedTermAnnotation = (wrapAnnotationMap anns)})))---- | Normalize type annotations-normalizeTypeAnnotations :: Core.Type -> Core.Type-normalizeTypeAnnotations typ =-- let anns = typeAnnotationInternal typ- stripped = Strip.deannotateType typ- in (Logic.ifElse (Maps.isEmpty anns) stripped (Core.TypeAnnotated (Core.AnnotatedType {- Core.annotatedTypeBody = stripped,- Core.annotatedTypeAnnotation = (wrapAnnotationMap anns)})))---- | Set annotation in map-setAnnotation :: Ord t0 => (t0 -> Maybe t1 -> M.Map t0 t1 -> M.Map t0 t1)-setAnnotation key val m = Maps.alter (\_ -> val) key m---- | Set description in annotations-setDescription :: Maybe String -> M.Map Core.Name Core.Term -> M.Map Core.Name Core.Term-setDescription d =- setAnnotation Constants.keyDescription (Optionals.map (\arg_ -> (\x -> Core.TermLiteral x) ((\x -> Core.LiteralString x) arg_)) d)---- | Set term annotation-setTermAnnotation :: Core.Name -> Maybe Core.Term -> Core.Term -> Core.Term-setTermAnnotation key val term =-- let term_ = Strip.deannotateTerm term- anns = setAnnotation key val (termAnnotationInternal term)- in (Logic.ifElse (Maps.isEmpty anns) term_ (Core.TermAnnotated (Core.AnnotatedTerm {- Core.annotatedTermBody = term_,- Core.annotatedTermAnnotation = (wrapAnnotationMap anns)})))---- | Set term description-setTermDescription :: Maybe String -> Core.Term -> Core.Term-setTermDescription d =- setTermAnnotation Constants.keyDescription (Optionals.map (\s -> Core.TermLiteral (Core.LiteralString s)) d)---- | Set type in annotations-setType :: Maybe Core.Type -> M.Map Core.Name Core.Term -> M.Map Core.Name Core.Term-setType mt = setAnnotation Constants.keyType (Optionals.map EncodeCore.type_ mt)---- | Set type annotation-setTypeAnnotation :: Core.Name -> Maybe Core.Term -> Core.Type -> Core.Type-setTypeAnnotation key val typ =-- let typ_ = Strip.deannotateType typ- anns = setAnnotation key val (typeAnnotationInternal typ)- in (Logic.ifElse (Maps.isEmpty anns) typ_ (Core.TypeAnnotated (Core.AnnotatedType {- Core.annotatedTypeBody = typ_,- Core.annotatedTypeAnnotation = (wrapAnnotationMap anns)})))---- | Set type classes on term. The Set Name carries bare class identifiers (#275).-setTypeClasses :: M.Map Core.Name (S.Set Core.Name) -> Core.Term -> Core.Term-setTypeClasses m term =-- let encodePair =- \nameClasses ->- let name = Pairs.first nameClasses- classes = Pairs.second nameClasses- in (EncodeCore.name name, (Core.TermSet (Sets.fromList (Lists.map EncodeCore.name (Sets.toList classes)))))- encoded = Logic.ifElse (Maps.isEmpty m) Nothing (Just (Core.TermMap (Maps.fromList (Lists.map encodePair (Maps.toList m)))))- in (setTermAnnotation Constants.keyClasses encoded term)---- | Set type description-setTypeDescription :: Maybe String -> Core.Type -> Core.Type-setTypeDescription d =- setTypeAnnotation Constants.keyDescription (Optionals.map (\arg_ -> (\x -> Core.TermLiteral x) ((\x -> Core.LiteralString x) arg_)) d)---- | Get internal term annotations-termAnnotationInternal :: Core.Term -> M.Map Core.Name Core.Term-termAnnotationInternal term =-- let getAnn =- \t -> case t of- Core.TermAnnotated v0 -> Just v0- _ -> Nothing- in (aggregateAnnotations getAnn (\at -> Core.annotatedTermBody at) (\at -> getAnnotationMap (Core.annotatedTermAnnotation at)) term)---- | Get internal type annotations-typeAnnotationInternal :: Core.Type -> M.Map Core.Name Core.Term-typeAnnotationInternal typ =-- let getAnn =- \t -> case t of- Core.TypeAnnotated v0 -> Just v0- _ -> Nothing- in (aggregateAnnotations getAnn (\at -> Core.annotatedTypeBody at) (\at -> getAnnotationMap (Core.annotatedTypeAnnotation at)) typ)---- | Wrap a Map<Name, Term> as a TermMap annotation. Each Name key becomes a TermVariable.-wrapAnnotationMap :: M.Map Core.Name Core.Term -> Core.Term-wrapAnnotationMap m =- Core.TermMap (Maps.fromList (Lists.map (\p -> (Core.TermVariable (Pairs.first p), (Pairs.second p))) (Maps.toList m)))
@@ -1,81 +0,0 @@--- Note: this is an automatically generated file. Do not edit.---- | Functions dealing with arguments and arity.--module Hydra.Arity where--import qualified Hydra.Ast as Ast-import qualified Hydra.Coders as Coders-import qualified Hydra.Core as Core-import qualified Hydra.Docs as Docs-import qualified Hydra.Error.Checking as Checking-import qualified Hydra.Error.Core as ErrorCore-import qualified Hydra.Error.File as ErrorFile-import qualified Hydra.Error.Packaging as ErrorPackaging-import qualified Hydra.Error.System as ErrorSystem-import qualified Hydra.Errors as Errors-import qualified Hydra.File as File-import qualified Hydra.Graph as Graph-import qualified Hydra.Json.Model as Model-import qualified Hydra.Overlay.Haskell.Lib.Lists as Lists-import qualified Hydra.Overlay.Haskell.Lib.Math as Math-import qualified Hydra.Packaging as Packaging-import qualified Hydra.Parsing as Parsing-import qualified Hydra.Paths as Paths-import qualified Hydra.Query as Query-import qualified Hydra.Regex as Regex-import qualified Hydra.Relational as Relational-import qualified Hydra.System as System-import qualified Hydra.Tabular as Tabular-import qualified Hydra.Testing as Testing-import qualified Hydra.Time as Time-import qualified Hydra.Topology as Topology-import qualified Hydra.Typed as Typed-import qualified Hydra.Typing as Typing-import qualified Hydra.Util as Util-import qualified Hydra.Validation as Validation-import qualified Hydra.Variants as Variants-import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)-import qualified Data.Scientific as Sci-import Data.Void---- | Find the arity (expected number of arguments) of a primitive constant or function-primitiveArity :: Graph.Primitive -> Int-primitiveArity prim =- Lists.length (Typing.termSignatureParameters (Packaging.primitiveDefinitionSignature (Graph.primitiveDefinition prim)))---- | Find the arity (expected number of arguments) of a term-termArity :: Core.Term -> Int-termArity x =- case x of- Core.TermApplication v0 -> (\arg_2 -> (\xapp -> Math.sub xapp 1) (termArity arg_2)) (Core.applicationFunction v0)- Core.TermCases _ -> 1- Core.TermLambda v0 -> (\i -> Math.add 1 i) (termArity (Core.lambdaBody v0))- Core.TermProject _ -> 1- Core.TermUnwrap _ -> 1- _ -> 0---- | Find the arity (expected number of arguments) of a type-typeArity :: Core.Type -> Int-typeArity x =- case x of- Core.TypeAnnotated v0 -> typeArity (Core.annotatedTypeBody v0)- Core.TypeApplication v0 -> typeArity (Core.applicationTypeFunction v0)- Core.TypeForall v0 -> typeArity (Core.forallTypeBody v0)- Core.TypeFunction v0 -> Math.add 1 (typeArity (Core.functionTypeCodomain v0))- _ -> 0---- | Find the arity (expected number of arguments) of a type scheme-typeSchemeArity :: Core.TypeScheme -> Int-typeSchemeArity arg_ = typeArity (Core.typeSchemeBody arg_)---- | Uncurry a type expression into a list of types, turning a function type a -> b into cons a (uncurryType b)-uncurryType :: Core.Type -> [Core.Type]-uncurryType t =- case t of- Core.TypeAnnotated v0 -> uncurryType (Core.annotatedTypeBody v0)- Core.TypeApplication v0 -> uncurryType (Core.applicationTypeFunction v0)- Core.TypeForall v0 -> uncurryType (Core.forallTypeBody v0)- Core.TypeFunction v0 -> Lists.cons (Core.functionTypeDomain v0) (uncurryType (Core.functionTypeCodomain v0))- _ -> [- t]
@@ -1,250 +0,0 @@--- Note: this is an automatically generated file. Do not edit.---- | A model which provides a common syntax tree for Hydra serializers--module Hydra.Ast where--import qualified Hydra.Core as Core-import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)-import qualified Data.Scientific as Sci-import Data.Void---- | Operator associativity-data Associativity =- AssociativityNone |- AssociativityLeft |- AssociativityRight |- AssociativityBoth- deriving (Eq, Ord, Read, Show)--_Associativity = Core.Name "hydra.ast.Associativity"--_Associativity_none = Core.Name "none"--_Associativity_left = Core.Name "left"--_Associativity_right = Core.Name "right"--_Associativity_both = Core.Name "both"---- | Formatting option for code blocks-data BlockStyle =- BlockStyle {- -- | An optional indentation string- blockStyleIndent :: (Maybe String),- -- | Whether to place a newline before the content- blockStyleNewlineBeforeContent :: Bool,- -- | Whether to place a newline after the content- blockStyleNewlineAfterContent :: Bool}- deriving (Eq, Ord, Read, Show)--_BlockStyle = Core.Name "hydra.ast.BlockStyle"--_BlockStyle_indent = Core.Name "indent"--_BlockStyle_newlineBeforeContent = Core.Name "newlineBeforeContent"--_BlockStyle_newlineAfterContent = Core.Name "newlineAfterContent"---- | An expression enclosed by brackets-data BracketExpr =- BracketExpr {- -- | The bracket pair enclosing the expression- bracketExprBrackets :: Brackets,- -- | The expression within the brackets- bracketExprEnclosed :: Expr,- -- | The formatting style for the bracketed block- bracketExprStyle :: BlockStyle}- deriving (Eq, Ord, Read, Show)--_BracketExpr = Core.Name "hydra.ast.BracketExpr"--_BracketExpr_brackets = Core.Name "brackets"--_BracketExpr_enclosed = Core.Name "enclosed"--_BracketExpr_style = Core.Name "style"---- | Matching open and close bracket symbols-data Brackets =- Brackets {- -- | The opening bracket symbol- bracketsOpen :: Symbol,- -- | The closing bracket symbol- bracketsClose :: Symbol}- deriving (Eq, Ord, Read, Show)--_Brackets = Core.Name "hydra.ast.Brackets"--_Brackets_open = Core.Name "open"--_Brackets_close = Core.Name "close"---- | An abstract expression-data Expr =- -- | A constant symbol- ExprConst Symbol |- -- | An indented expression- ExprIndent IndentedExpression |- -- | An operator expression- ExprOp OpExpr |- -- | A bracketed expression- ExprBrackets BracketExpr |- -- | A sequence of expressions joined by a separator, treated as structural layout (not subject to parenthesization)- ExprSeq SeqExpr- deriving (Eq, Ord, Read, Show)--_Expr = Core.Name "hydra.ast.Expr"--_Expr_const = Core.Name "const"--_Expr_indent = Core.Name "indent"--_Expr_op = Core.Name "op"--_Expr_brackets = Core.Name "brackets"--_Expr_seq = Core.Name "seq"---- | Any of several indentation styles-data IndentStyle =- -- | Indent all lines with the given string- IndentStyleAllLines String |- -- | Indent only lines after the first with the given string- IndentStyleSubsequentLines String- deriving (Eq, Ord, Read, Show)--_IndentStyle = Core.Name "hydra.ast.IndentStyle"--_IndentStyle_allLines = Core.Name "allLines"--_IndentStyle_subsequentLines = Core.Name "subsequentLines"---- | An expression indented in a certain style-data IndentedExpression =- IndentedExpression {- -- | The indentation style- indentedExpressionStyle :: IndentStyle,- -- | The expression to be indented- indentedExpressionExpr :: Expr}- deriving (Eq, Ord, Read, Show)--_IndentedExpression = Core.Name "hydra.ast.IndentedExpression"--_IndentedExpression_style = Core.Name "style"--_IndentedExpression_expr = Core.Name "expr"---- | An operator symbol-data Op =- Op {- -- | The operator symbol- opSymbol :: Symbol,- -- | The padding around the operator- opPadding :: Padding,- -- | The precedence of the operator- opPrecedence :: Precedence,- -- | The associativity of the operator- opAssociativity :: Associativity}- deriving (Eq, Ord, Read, Show)--_Op = Core.Name "hydra.ast.Op"--_Op_symbol = Core.Name "symbol"--_Op_padding = Core.Name "padding"--_Op_precedence = Core.Name "precedence"--_Op_associativity = Core.Name "associativity"---- | An operator expression-data OpExpr =- OpExpr {- -- | The operator- opExprOp :: Op,- -- | The left-hand side operand- opExprLhs :: Expr,- -- | The right-hand side operand- opExprRhs :: Expr}- deriving (Eq, Ord, Read, Show)--_OpExpr = Core.Name "hydra.ast.OpExpr"--_OpExpr_op = Core.Name "op"--_OpExpr_lhs = Core.Name "lhs"--_OpExpr_rhs = Core.Name "rhs"---- | Left and right padding for an operator-data Padding =- Padding {- -- | Padding to the left of the operator- paddingLeft :: Ws,- -- | Padding to the right of the operator- paddingRight :: Ws}- deriving (Eq, Ord, Read, Show)--_Padding = Core.Name "hydra.ast.Padding"--_Padding_left = Core.Name "left"--_Padding_right = Core.Name "right"---- | Operator precedence-newtype Precedence =- Precedence {- unPrecedence :: Int}- deriving (Eq, Ord, Read, Show)--_Precedence = Core.Name "hydra.ast.Precedence"---- | A sequence of expressions joined by a separator operator. Unlike OpExpr, parenthesize ignores SeqExpr boundaries.-data SeqExpr =- SeqExpr {- -- | The separator operator- seqExprOp :: Op,- -- | The expressions to join- seqExprElements :: [Expr]}- deriving (Eq, Ord, Read, Show)--_SeqExpr = Core.Name "hydra.ast.SeqExpr"--_SeqExpr_op = Core.Name "op"--_SeqExpr_elements = Core.Name "elements"---- | Any symbol-newtype Symbol =- Symbol {- unSymbol :: String}- deriving (Eq, Ord, Read, Show)--_Symbol = Core.Name "hydra.ast.Symbol"---- | One of several classes of whitespace-data Ws =- -- | No whitespace- WsNone |- -- | A single space- WsSpace |- -- | A line break- WsBreak |- -- | A line break followed by indentation- WsBreakAndIndent String |- -- | Two line breaks- WsDoubleBreak- deriving (Eq, Ord, Read, Show)--_Ws = Core.Name "hydra.ast.Ws"--_Ws_none = Core.Name "none"--_Ws_space = Core.Name "space"--_Ws_break = Core.Name "break"--_Ws_breakAndIndent = Core.Name "breakAndIndent"--_Ws_doubleBreak = Core.Name "doubleBreak"
@@ -1,724 +0,0 @@--- Note: this is an automatically generated file. Do not edit.---- | Type checking and type reconstruction (type-of) for the results of Hydra unification and inference--module Hydra.Checking where--import qualified Hydra.Ast as Ast-import qualified Hydra.Coders as Coders-import qualified Hydra.Constants as Constants-import qualified Hydra.Core as Core-import qualified Hydra.Dependencies as Dependencies-import qualified Hydra.Docs as Docs-import qualified Hydra.Error.Checking as Checking-import qualified Hydra.Error.Core as ErrorCore-import qualified Hydra.Error.File as ErrorFile-import qualified Hydra.Error.Packaging as ErrorPackaging-import qualified Hydra.Error.System as ErrorSystem-import qualified Hydra.Errors as Errors-import qualified Hydra.Extract.Core as ExtractCore-import qualified Hydra.File as File-import qualified Hydra.Formatting as Formatting-import qualified Hydra.Graph as Graph-import qualified Hydra.Json.Model as Model-import qualified Hydra.Lexical as Lexical-import qualified Hydra.Overlay.Haskell.Lib.Eithers as Eithers-import qualified Hydra.Overlay.Haskell.Lib.Equality as Equality-import qualified Hydra.Overlay.Haskell.Lib.Lists as Lists-import qualified Hydra.Overlay.Haskell.Lib.Literals as Literals-import qualified Hydra.Overlay.Haskell.Lib.Logic as Logic-import qualified Hydra.Overlay.Haskell.Lib.Maps as Maps-import qualified Hydra.Overlay.Haskell.Lib.Optionals as Optionals-import qualified Hydra.Overlay.Haskell.Lib.Pairs as Pairs-import qualified Hydra.Overlay.Haskell.Lib.Sets as Sets-import qualified Hydra.Overlay.Haskell.Lib.Strings as Strings-import qualified Hydra.Names as Names-import qualified Hydra.Packaging as Packaging-import qualified Hydra.Parsing as Parsing-import qualified Hydra.Paths as Paths-import qualified Hydra.Print.Core as PrintCore-import qualified Hydra.Print.Errors as PrintErrors-import qualified Hydra.Print.Variants as PrintVariants-import qualified Hydra.Query as Query-import qualified Hydra.Reflect as Reflect-import qualified Hydra.Regex as Regex-import qualified Hydra.Relational as Relational-import qualified Hydra.Resolution as Resolution-import qualified Hydra.Rewriting as Rewriting-import qualified Hydra.Scoping as Scoping-import qualified Hydra.Strip as Strip-import qualified Hydra.Substitution as Substitution-import qualified Hydra.System as System-import qualified Hydra.Tabular as Tabular-import qualified Hydra.Testing as Testing-import qualified Hydra.Time as Time-import qualified Hydra.Topology as Topology-import qualified Hydra.Typed as Typed-import qualified Hydra.Typing as Typing-import qualified Hydra.Util as Util-import qualified Hydra.Validation as Validation-import qualified Hydra.Variables as Variables-import qualified Hydra.Variants as Variants-import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)-import qualified Data.Scientific as Sci-import Data.Void-import qualified Data.Map as M-import qualified Data.Set as S---- | True if every element of the list is equal to every other element (vacuously true for the empty list)-allEqual :: Eq t0 => ([t0] -> Bool)-allEqual els =- Optionals.match (Lists.uncons els) True (\uc ->- let h = Pairs.first uc- t = Pairs.second uc- in (Lists.foldl (\b -> \x -> Logic.and b (Equality.equal x h)) True t))---- | Apply type arguments to a type, substituting forall-bound variables. Paper: inference.tex, 'Checking the witness' (consuming the pending-type-argument stack).-applyTypeArgumentsToType :: Typing.InferenceContext -> Graph.Graph -> [Core.Type] -> Core.Type -> Either Errors.Error Core.Type-applyTypeArgumentsToType cx tx typeArgs t =- Optionals.match (Lists.uncons typeArgs) (Right t) (\uc ->- let ah = Pairs.first uc- at = Pairs.second uc- in case t of- Core.TypeForall v0 ->- let v = Core.forallTypeParameter v0- tbody = Core.forallTypeBody v0- in (applyTypeArgumentsToType cx tx at (Substitution.substInType (Typing.TypeSubst (Maps.singleton v ah)) tbody))- Core.TypeVariable v0 -> Eithers.either (\_ -> Left (Errors.ErrorExtraction (Errors.ExtractionErrorUnexpectedShape (Errors.UnexpectedShapeError {- Errors.unexpectedShapeErrorExpected = "forall type",- Errors.unexpectedShapeErrorActual = (Strings.concat [- PrintCore.type_ t,- ". Trying to apply ",- (Literals.printInt32 (Lists.length typeArgs)),- " type args: ",- (Formatting.showList PrintCore.type_ typeArgs)])})))) (\schemaRes ->- let schemaType = Pairs.first schemaRes- schemaBody = Strip.deannotateType (Core.typeSchemeBody schemaType)- in case schemaBody of- Core.TypeForall _ -> applyTypeArgumentsToType cx tx typeArgs schemaBody- _ -> Right t) (Resolution.requireSchemaType cx (Graph.graphSchemaTypes tx) v0)- _ -> Left (Errors.ErrorExtraction (Errors.ExtractionErrorUnexpectedShape (Errors.UnexpectedShapeError {- Errors.unexpectedShapeErrorExpected = "forall type",- Errors.unexpectedShapeErrorActual = (Strings.concat [- PrintCore.type_ t,- ". Trying to apply ",- (Literals.printInt32 (Lists.length typeArgs)),- " type args: ",- (Formatting.showList PrintCore.type_ typeArgs),- ". Context has vars: {",- (Strings.join ", " (Lists.map Core.unName (Maps.keys (Graph.graphBoundTypes tx)))),- "}"])}))))---- | Check that a term has no unbound type variables (Either version). Paper: inference.tex, 'Checking the witness' (always-on finalization invariant).-checkForUnboundTypeVariables :: t0 -> Graph.Graph -> Core.Term -> Either Errors.Error ()-checkForUnboundTypeVariables cx tx term0 =-- let svars = Sets.fromList (Maps.keys (Graph.graphSchemaTypes tx))- checkRecursive =- \vars -> \trace -> \lbinding -> \term ->- let recurse = checkRecursive vars trace lbinding- dflt = Eithers.bind (Eithers.mapList recurse (Rewriting.subterms term)) (\_ -> Right ())- check =- \typ ->- let freevars = Variables.freeVariablesInType typ- badvars = Sets.difference (Sets.difference freevars vars) svars- in (Logic.ifElse (Sets.isEmpty badvars) (Right ()) (Left (Errors.ErrorChecking (Checking.CheckingErrorUnboundTypeVariables (Checking.UnboundTypeVariablesError {- Checking.unboundTypeVariablesErrorVariables = badvars,- Checking.unboundTypeVariablesErrorType = typ})))))- checkOptional = \m -> Eithers.bind (Eithers.mapOptional check m) (\_ -> Right ())- in case term of- Core.TermLambda v0 -> Eithers.bind (checkOptional (Core.lambdaDomain v0)) (\_ -> recurse (Core.lambdaBody v0))- Core.TermLet v0 ->- let forBinding =- \b ->- let bterm = Core.bindingTerm b- newVars =- Optionals.match (Core.bindingTypeScheme b) vars (\ts -> Sets.union vars (Sets.fromList (Core.typeSchemeVariables ts)))- newTrace = Lists.cons (Core.unName (Core.bindingName b)) trace- in (checkRecursive newVars newTrace (Just b) bterm)- in (Eithers.bind (Eithers.mapList forBinding (Core.letBindings v0)) (\_ -> recurse (Core.letBody v0)))- Core.TermTypeApplication v0 -> Eithers.bind (check (Core.typeApplicationTermType v0)) (\_ -> recurse (Core.typeApplicationTermBody v0))- Core.TermTypeLambda v0 -> Eithers.bind (check (Core.TypeVariable (Core.typeLambdaParameter v0))) (\_ -> recurse (Core.typeLambdaBody v0))- _ -> dflt- in (checkRecursive Sets.empty [- "top level"] Nothing term0)---- | Ensure all types in a list are equal and return the common type-checkSameType :: t0 -> Graph.Graph -> String -> [Core.Type] -> Either Errors.Error Core.Type-checkSameType cx tx desc types =-- let unequalErr =- Left (Errors.ErrorChecking (Checking.CheckingErrorUnequalTypes (Checking.UnequalTypesError {- Checking.unequalTypesErrorTypes = types,- Checking.unequalTypesErrorDescription = desc})))- in (Logic.ifElse (typesAllEffectivelyEqual tx types) (Optionals.match (Lists.head types) unequalErr (\t -> Right t)) unequalErr)---- | Sanity-check a type substitution arising from unification. Specifically, check that schema types have not been inappropriately unified with type variables inferred from terms. Paper: inference.tex, 'Checking the witness' (always-on invariant: a substitution may not bind a type name as if it were an inference variable).-checkTypeSubst :: t0 -> Graph.Graph -> Typing.TypeSubst -> Either Errors.Error Typing.TypeSubst-checkTypeSubst cx tx subst =-- let s = Typing.unTypeSubst subst- vars = Sets.fromList (Maps.keys s)- suspectVars = Sets.intersection vars (Sets.fromList (Maps.keys (Graph.graphSchemaTypes tx)))- isNominal =- \ts -> case (Strip.deannotateType (Core.typeSchemeBody ts)) of- Core.TypeRecord _ -> True- Core.TypeUnion _ -> True- Core.TypeWrap _ -> True- _ -> False- badVars =- Sets.fromList (Lists.filter (\v -> Optionals.match (Lexical.dereferenceSchemaType v (Graph.graphSchemaTypes tx)) False isNominal) (Sets.toList suspectVars))- badPairs = Lists.filter (\p -> Sets.member (Pairs.first p) badVars) (Maps.toList s)- printPair =- \p -> Strings.concat2 (Strings.concat2 (Core.unName (Pairs.first p)) " --> ") (PrintCore.type_ (Pairs.second p))- in (Logic.ifElse (Sets.isEmpty badVars) (Right subst) (Left (Errors.ErrorChecking (Checking.CheckingErrorIncorrectUnification (Checking.IncorrectUnificationError {- Checking.incorrectUnificationErrorSubstitution = subst})))))---- | Check if a type contains any type variable from the current scope-containsInScopeTypeVars :: Graph.Graph -> Core.Type -> Bool-containsInScopeTypeVars tx t =-- let vars = Graph.graphTypeVariables tx- freeVars = Variables.freeVariablesInTypeSimple t- in (Logic.not (Sets.isEmpty (Sets.intersection vars freeVars)))---- | Normalize free type variables in a type to canonical names based on order of first occurrence. This allows comparing types that differ only in the naming of free type variables. Paper: inference.tex, 'Checking the witness' (effective equality).-normalizeTypeFreeVars :: Core.Type -> Core.Type-normalizeTypeFreeVars typ =-- let collectVars =- \acc -> \t -> case t of- Core.TypeVariable v0 -> Logic.ifElse (Maps.member v0 acc) acc (Maps.insert v0 (Core.Name (Strings.concat2 "_tv" (Literals.printInt32 (Maps.size acc)))) acc)- _ -> acc- subst = Rewriting.foldOverType Coders.TraversalOrderPre collectVars Maps.empty typ- in (Variables.substituteTypeVariables subst typ)---- | Get the bound types from a graph as a type environment-toFContext :: Graph.Graph -> M.Map Core.Name Core.Type-toFContext cx = Maps.map Scoping.typeSchemeToFType (Graph.graphBoundTypes cx)---- | Check whether two lists of types are effectively equal, disregarding type aliases-typeListsEffectivelyEqual :: Graph.Graph -> [Core.Type] -> [Core.Type] -> Bool-typeListsEffectivelyEqual tx tlist1 tlist2 =- Logic.ifElse (Equality.equal (Lists.length tlist1) (Lists.length tlist2)) (Lists.foldl Logic.and True (Lists.zipWith (typesEffectivelyEqual tx) tlist1 tlist2)) False---- | Given a type context, reconstruct the type of a System F term. Paper: inference.tex, 'Checking the witness' -- the executable form of the System F typing judgment in the soundness theorem.-typeOf :: Typing.InferenceContext -> Graph.Graph -> [Core.Type] -> Core.Term -> Either Errors.Error (Core.Type, Typing.InferenceContext)-typeOf cx tx typeArgs term =-- let cx1 = cx- in case term of- Core.TermAnnotated v0 -> typeOfAnnotatedTerm cx1 tx typeArgs v0- Core.TermApplication v0 -> typeOfApplication cx1 tx typeArgs v0- Core.TermCases v0 -> typeOfCaseStatement cx1 tx typeArgs v0- Core.TermEither v0 -> typeOfEither cx1 tx typeArgs v0- Core.TermLambda v0 -> typeOfLambda cx1 tx typeArgs v0- Core.TermLet v0 -> typeOfLet cx1 tx typeArgs v0- Core.TermList v0 -> typeOfList cx1 tx typeArgs v0- Core.TermLiteral v0 -> typeOfLiteral cx1 tx typeArgs v0- Core.TermMap v0 -> typeOfMap cx1 tx typeArgs v0- Core.TermOptional v0 -> typeOfMaybe cx1 tx typeArgs v0- Core.TermPair v0 -> typeOfPair cx1 tx typeArgs v0- Core.TermProject v0 -> typeOfProjection cx1 tx typeArgs v0- Core.TermRecord v0 -> typeOfRecord cx1 tx typeArgs v0- Core.TermSet v0 -> typeOfSet cx1 tx typeArgs v0- Core.TermTypeApplication v0 -> typeOfTypeApplication cx1 tx typeArgs v0- Core.TermTypeLambda v0 -> typeOfTypeLambda cx1 tx typeArgs v0- Core.TermInject v0 -> typeOfInjection cx1 tx typeArgs v0- Core.TermUnit -> typeOfUnit cx1 tx typeArgs- Core.TermUnwrap v0 -> typeOfUnwrap cx1 tx typeArgs v0- Core.TermVariable v0 -> typeOfVariable cx1 tx typeArgs v0- Core.TermWrap v0 -> typeOfWrappedTerm cx1 tx typeArgs v0- _ -> Left (Errors.ErrorChecking (Checking.CheckingErrorUnsupportedTermVariant (Checking.UnsupportedTermVariantError {- Checking.unsupportedTermVariantErrorTermVariant = (Reflect.termVariant term)})))---- | Reconstruct the type of an annotated term (Either/InferenceContext version). Paper: inference.tex, rule Ann (checking side).-typeOfAnnotatedTerm :: Typing.InferenceContext -> Graph.Graph -> [Core.Type] -> Core.AnnotatedTerm -> Either Errors.Error (Core.Type, Typing.InferenceContext)-typeOfAnnotatedTerm cx tx typeArgs at = typeOf cx tx typeArgs (Core.annotatedTermBody at)---- | Reconstruct the type of an application term (Either/InferenceContext version). Paper: inference.tex, rule App (checking side).-typeOfApplication :: Typing.InferenceContext -> Graph.Graph -> [Core.Type] -> Core.Application -> Either Errors.Error (Core.Type, Typing.InferenceContext)-typeOfApplication cx tx typeArgs app =-- let fun = Core.applicationFunction app- arg = Core.applicationArgument app- tryType =- \cx0 -> \tfun -> \targ -> case tfun of- Core.TypeForall v0 -> tryType cx0 (Core.forallTypeBody v0) targ- Core.TypeFunction v0 ->- let dom = Core.functionTypeDomain v0- cod = Core.functionTypeCodomain v0- in (Logic.ifElse (typesEffectivelyEqual tx dom targ) (Right (cod, cx0)) (Left (Errors.ErrorChecking (Checking.CheckingErrorTypeMismatch (Checking.TypeMismatchError {- Checking.typeMismatchErrorExpectedType = dom,- Checking.typeMismatchErrorActualType = targ})))))- Core.TypeVariable _ ->- let nameResult = Names.freshName cx0- freshN = Pairs.first nameResult- cx1 = Pairs.second nameResult- in (Right (Core.TypeVariable freshN, cx1))- _ -> Left (Errors.ErrorChecking (Checking.CheckingErrorNotAFunctionType (Checking.NotAFunctionTypeError {- Checking.notAFunctionTypeErrorType = tfun})))- in (Eithers.bind (typeOf cx tx [] fun) (\result1 ->- let tfun = Pairs.first result1- cx2 = Pairs.second result1- in (Eithers.bind (typeOf cx2 tx [] arg) (\result2 ->- let targ = Pairs.first result2- cx3 = Pairs.second result2- in (Eithers.bind (tryType cx3 tfun targ) (\result3 ->- let t = Pairs.first result3- cx4 = Pairs.second result3- in (Eithers.bind (applyTypeArgumentsToType cx4 tx typeArgs t) (\applied -> Right (applied, cx4)))))))))---- | Reconstruct the type of a case statement (Either/InferenceContext version). Paper: inference.tex, rules Case and Case_d (checking side).-typeOfCaseStatement :: Typing.InferenceContext -> Graph.Graph -> [Core.Type] -> Core.CaseStatement -> Either Errors.Error (Core.Type, Typing.InferenceContext)-typeOfCaseStatement cx tx typeArgs cs =-- let tname = Core.caseStatementTypeName cs- dflt = Core.caseStatementDefault cs- match = Core.caseStatementCases cs- cterms = Lists.map Core.caseAlternativeHandler match- in (Eithers.bind (Eithers.mapOptional (\e -> typeOf cx tx [] e) dflt) (\dfltResult ->- let tdflt = Optionals.map Pairs.first dfltResult- cx2 = Optionals.match dfltResult cx Pairs.second- foldResult =- Lists.foldl (\acc -> \term -> Eithers.bind acc (\accR ->- let types = Pairs.first accR- cxA = Pairs.second accR- in (Eithers.bind (typeOf cxA tx [] term) (\tResult ->- let t = Pairs.first tResult- cxB = Pairs.second tResult- in (Right (Lists.concat2 types (Lists.singleton t), cxB)))))) (Right ([], cx2)) cterms- in (Eithers.bind foldResult (\foldR ->- let tcterms = Pairs.first foldR- cx3 = Pairs.second foldR- fcodsResult =- Lists.foldl (\acc -> \t -> Eithers.bind acc (\accR ->- let cods = Pairs.first accR- in (Eithers.bind (ExtractCore.functionType t) (\ft -> Right (Lists.concat2 cods (Lists.singleton (Core.functionTypeCodomain ft)), cx3))))) (Right ([], cx3)) tcterms- in (Eithers.bind fcodsResult (\fcodsR ->- let fcods = Pairs.first fcodsR- cods = Optionals.givens (Lists.cons tdflt (Lists.map Optionals.given fcods))- in (Eithers.bind (checkSameType cx3 tx "case branches" cods) (\cod -> Right (- Core.TypeFunction (Core.FunctionType {- Core.functionTypeDomain = (Resolution.nominalApplication tname typeArgs),- Core.functionTypeCodomain = cod}),- cx3)))))))))---- | Reconstruct the type of an either value (Either/InferenceContext version). Paper: inference.tex, rules Eith_L and Eith_R (checking side).-typeOfEither :: Typing.InferenceContext -> Graph.Graph -> [Core.Type] -> Either Core.Term Core.Term -> Either Errors.Error (Core.Type, Typing.InferenceContext)-typeOfEither cx tx typeArgs et =-- let n = Lists.length typeArgs- arityErr =- Left (Errors.ErrorChecking (Checking.CheckingErrorTypeArityMismatch (Checking.TypeArityMismatchError {- Checking.typeArityMismatchErrorType = (Core.TypeEither (Core.EitherType {- Core.eitherTypeLeft = Core.TypeUnit,- Core.eitherTypeRight = Core.TypeUnit})),- Checking.typeArityMismatchErrorExpectedArity = 2,- Checking.typeArityMismatchErrorActualArity = n,- Checking.typeArityMismatchErrorTypeArguments = typeArgs})))- in (Optionals.match (Lists.uncons typeArgs) arityErr (\uc0 ->- let ta0 = Pairs.first uc0- in (Optionals.match (Lists.uncons (Pairs.second uc0)) arityErr (\uc1 ->- let ta1 = Pairs.first uc1- in (Logic.ifElse (Equality.equal n 2) (Eithers.either (\leftTerm -> Eithers.bind (typeOf cx tx [] leftTerm) (\result ->- let leftType = Pairs.first result- cx2 = Pairs.second result- in (Right (- Core.TypeEither (Core.EitherType {- Core.eitherTypeLeft = leftType,- Core.eitherTypeRight = ta1}),- cx2)))) (\rightTerm -> Eithers.bind (typeOf cx tx [] rightTerm) (\result ->- let rightType = Pairs.first result- cx2 = Pairs.second result- in (Right (- Core.TypeEither (Core.EitherType {- Core.eitherTypeLeft = ta0,- Core.eitherTypeRight = rightType}),- cx2)))) et) arityErr)))))---- | Reconstruct the type of a union injection (Either/InferenceContext version). Paper: inference.tex, rule Inj (checking side).-typeOfInjection :: Typing.InferenceContext -> Graph.Graph -> [Core.Type] -> Core.Injection -> Either Errors.Error (Core.Type, Typing.InferenceContext)-typeOfInjection cx tx typeArgs injection =-- let tname = Core.injectionTypeName injection- field = Core.injectionField injection- fname = Core.fieldName field- fterm = Core.fieldTerm field- in (Eithers.bind (Resolution.requireSchemaType cx (Graph.graphSchemaTypes tx) tname) (\schemaResult ->- let schemaType = Pairs.first schemaResult- cx2 = Pairs.second schemaResult- svars = Core.typeSchemeVariables schemaType- sbody = Core.typeSchemeBody schemaType- in (Eithers.bind (ExtractCore.unionType tname sbody) (\sfields -> Eithers.bind (Resolution.findFieldType cx2 fname sfields) (\ftyp -> Right (Resolution.nominalApplication tname typeArgs, cx2))))))---- | Reconstruct the type of a lambda function (Either/InferenceContext version). Paper: inference.tex, rule Abs (checking side).-typeOfLambda :: Typing.InferenceContext -> Graph.Graph -> [Core.Type] -> Core.Lambda -> Either Errors.Error (Core.Type, Typing.InferenceContext)-typeOfLambda cx tx typeArgs l =-- let v = Core.lambdaParameter l- mdom = Core.lambdaDomain l- body = Core.lambdaBody l- in (Eithers.bind (Optionals.match mdom (Left (Errors.ErrorChecking (Checking.CheckingErrorUntypedLambda (Checking.UntypedLambdaError {- })))) (\dom ->- let types2 = Maps.insert v (Scoping.fTypeToTypeScheme dom) (Graph.graphBoundTypes tx)- in (Eithers.bind (typeOf cx (Graph.Graph {- Graph.graphBoundTerms = (Graph.graphBoundTerms tx),- Graph.graphBoundTypes = types2,- Graph.graphClassConstraints = (Graph.graphClassConstraints tx),- Graph.graphLambdaVariables = (Graph.graphLambdaVariables tx),- Graph.graphMetadata = (Graph.graphMetadata tx),- Graph.graphPrimitives = (Graph.graphPrimitives tx),- Graph.graphSchemaTypes = (Graph.graphSchemaTypes tx),- Graph.graphTypeVariables = (Graph.graphTypeVariables tx)}) [] body) (\codResult ->- let cod = Pairs.first codResult- cx2 = Pairs.second codResult- in (Right (- Core.TypeFunction (Core.FunctionType {- Core.functionTypeDomain = dom,- Core.functionTypeCodomain = cod}),- cx2)))))) (\tbodyResult ->- let tbody = Pairs.first tbodyResult- cx3 = Pairs.second tbodyResult- in (Eithers.bind (applyTypeArgumentsToType cx3 tx typeArgs tbody) (\applied -> Right (applied, cx3)))))---- | Reconstruct the type of a let binding (Either/InferenceContext version). Paper: inference.tex, rule Let (checking side).-typeOfLet :: Typing.InferenceContext -> Graph.Graph -> [Core.Type] -> Core.Let -> Either Errors.Error (Core.Type, Typing.InferenceContext)-typeOfLet cx tx typeArgs letTerm =-- let bs = Core.letBindings letTerm- body = Core.letBody letTerm- bnames = Lists.map Core.bindingName bs- bindingType =- \b -> Optionals.match (Core.bindingTypeScheme b) (Left (Errors.ErrorChecking (Checking.CheckingErrorUntypedLetBinding (Checking.UntypedLetBindingError {- Checking.untypedLetBindingErrorBinding = b})))) (\ts -> Right (Scoping.typeSchemeToFType ts))- btypesResult =- Lists.foldl (\acc -> \b -> Eithers.bind acc (\accR ->- let types = Pairs.first accR- in (Eithers.bind (bindingType b) (\btype -> Right (Lists.concat2 types (Lists.singleton btype), ()))))) (Right ([], ())) bs- in (Eithers.bind btypesResult (\btypesR ->- let btypes = Pairs.first btypesR- tx2 =- Graph.Graph {- Graph.graphBoundTerms = (Graph.graphBoundTerms tx),- Graph.graphBoundTypes = (Maps.union (Maps.fromList (Lists.zip bnames (Lists.map Scoping.fTypeToTypeScheme btypes))) (Graph.graphBoundTypes tx)),- Graph.graphClassConstraints = (Graph.graphClassConstraints tx),- Graph.graphLambdaVariables = (Graph.graphLambdaVariables tx),- Graph.graphMetadata = (Graph.graphMetadata tx),- Graph.graphPrimitives = (Graph.graphPrimitives tx),- Graph.graphSchemaTypes = (Graph.graphSchemaTypes tx),- Graph.graphTypeVariables = (Graph.graphTypeVariables tx)}- in (Eithers.bind (typeOf cx tx2 [] body) (\tResult ->- let t = Pairs.first tResult- cx2 = Pairs.second tResult- in (Eithers.bind (applyTypeArgumentsToType cx2 tx typeArgs t) (\applied -> Right (applied, cx2)))))))---- | Reconstruct the type of a list (Either/InferenceContext version). Paper: inference.tex, rules Lst_0 and Lst_+ (checking side).-typeOfList :: Typing.InferenceContext -> Graph.Graph -> [Core.Type] -> [Core.Term] -> Either Errors.Error (Core.Type, Typing.InferenceContext)-typeOfList cx tx typeArgs els =-- let listArityErr =- Left (Errors.ErrorChecking (Checking.CheckingErrorTypeArityMismatch (Checking.TypeArityMismatchError {- Checking.typeArityMismatchErrorType = (Core.TypeList Core.TypeUnit),- Checking.typeArityMismatchErrorExpectedArity = 1,- Checking.typeArityMismatchErrorActualArity = (Lists.length typeArgs),- Checking.typeArityMismatchErrorTypeArguments = typeArgs})))- in (Logic.ifElse (Lists.isEmpty els) (Logic.ifElse (Equality.equal (Lists.length typeArgs) 1) (Optionals.match (Lists.head typeArgs) listArityErr (\ta0 -> Right (Core.TypeList ta0, cx))) listArityErr) (- let foldResult =- Lists.foldl (\acc -> \term -> Eithers.bind acc (\accR ->- let types = Pairs.first accR- cxA = Pairs.second accR- in (Eithers.bind (typeOf cxA tx [] term) (\tResult ->- let t = Pairs.first tResult- cxB = Pairs.second tResult- in (Right (Lists.concat2 types (Lists.singleton t), cxB)))))) (Right ([], cx)) els- in (Eithers.bind foldResult (\foldR ->- let eltypes = Pairs.first foldR- cx2 = Pairs.second foldR- in (Eithers.bind (checkSameType cx2 tx "list elements" eltypes) (\unifiedType -> Right (Core.TypeList unifiedType, cx2)))))))---- | Reconstruct the type of a literal (Either/InferenceContext version). Paper: inference.tex, rule Lit (checking side).-typeOfLiteral :: Typing.InferenceContext -> Graph.Graph -> [Core.Type] -> Core.Literal -> Either Errors.Error (Core.Type, Typing.InferenceContext)-typeOfLiteral cx tx typeArgs lit =-- let t = Core.TypeLiteral (Reflect.literalType lit)- in (Eithers.bind (applyTypeArgumentsToType cx tx typeArgs t) (\applied -> Right (applied, cx)))---- | Reconstruct the type of a map (Either/InferenceContext version). Paper: inference.tex, rules Map_0 and Map_+ (checking side).-typeOfMap :: Typing.InferenceContext -> Graph.Graph -> [Core.Type] -> M.Map Core.Term Core.Term -> Either Errors.Error (Core.Type, Typing.InferenceContext)-typeOfMap cx tx typeArgs m =-- let mapArityErr =- Left (Errors.ErrorChecking (Checking.CheckingErrorTypeArityMismatch (Checking.TypeArityMismatchError {- Checking.typeArityMismatchErrorType = (Core.TypeMap (Core.MapType {- Core.mapTypeKeys = Core.TypeUnit,- Core.mapTypeValues = Core.TypeUnit})),- Checking.typeArityMismatchErrorExpectedArity = 2,- Checking.typeArityMismatchErrorActualArity = (Lists.length typeArgs),- Checking.typeArityMismatchErrorTypeArguments = typeArgs})))- in (Logic.ifElse (Maps.isEmpty m) (Logic.ifElse (Equality.equal (Lists.length typeArgs) 2) (Optionals.match (Lists.uncons typeArgs) mapArityErr (\uc0 ->- let ta0 = Pairs.first uc0- in (Optionals.match (Lists.uncons (Pairs.second uc0)) mapArityErr (\uc1 ->- let ta1 = Pairs.first uc1- in (Right (- Core.TypeMap (Core.MapType {- Core.mapTypeKeys = ta0,- Core.mapTypeValues = ta1}),- cx)))))) mapArityErr) (- let pairs = Maps.toList m- keyFoldResult =- Lists.foldl (\acc -> \p -> Eithers.bind acc (\accR ->- let types = Pairs.first accR- cxA = Pairs.second accR- in (Eithers.bind (typeOf cxA tx [] (Pairs.first p)) (\tResult ->- let t = Pairs.first tResult- cxB = Pairs.second tResult- in (Right (Lists.concat2 types (Lists.singleton t), cxB)))))) (Right ([], cx)) pairs- in (Eithers.bind keyFoldResult (\keyFoldR ->- let keyTypes = Pairs.first keyFoldR- cx2 = Pairs.second keyFoldR- in (Eithers.bind (checkSameType cx2 tx "map keys" keyTypes) (\kt ->- let valFoldResult =- Lists.foldl (\acc -> \p -> Eithers.bind acc (\accR ->- let types = Pairs.first accR- cxA = Pairs.second accR- in (Eithers.bind (typeOf cxA tx [] (Pairs.second p)) (\tResult ->- let t = Pairs.first tResult- cxB = Pairs.second tResult- in (Right (Lists.concat2 types (Lists.singleton t), cxB)))))) (Right ([], cx2)) pairs- in (Eithers.bind valFoldResult (\valFoldR ->- let valTypes = Pairs.first valFoldR- cx3 = Pairs.second valFoldR- in (Eithers.bind (checkSameType cx3 tx "map values" valTypes) (\vt -> Eithers.bind (applyTypeArgumentsToType cx3 tx typeArgs (Core.TypeMap (Core.MapType {- Core.mapTypeKeys = kt,- Core.mapTypeValues = vt}))) (\applied -> Right (applied, cx3))))))))))))---- | Reconstruct the type of an optional value (Either/InferenceContext version). Paper: inference.tex, rules Opt_0 and Opt_1 (checking side).-typeOfMaybe :: Typing.InferenceContext -> Graph.Graph -> [Core.Type] -> Maybe Core.Term -> Either Errors.Error (Core.Type, Typing.InferenceContext)-typeOfMaybe cx tx typeArgs mt =-- let forNothing =-- let n = Lists.length typeArgs- maybeArityErr =- Left (Errors.ErrorChecking (Checking.CheckingErrorTypeArityMismatch (Checking.TypeArityMismatchError {- Checking.typeArityMismatchErrorType = (Core.TypeOptional Core.TypeUnit),- Checking.typeArityMismatchErrorExpectedArity = 1,- Checking.typeArityMismatchErrorActualArity = n,- Checking.typeArityMismatchErrorTypeArguments = typeArgs})))- in (Logic.ifElse (Equality.equal n 1) (Optionals.match (Lists.head typeArgs) maybeArityErr (\ta0 -> Right (Core.TypeOptional ta0, cx))) maybeArityErr)- forJust =- \term -> Eithers.bind (typeOf cx tx [] term) (\tResult ->- let termType = Pairs.first tResult- cx2 = Pairs.second tResult- t = Core.TypeOptional termType- in (Eithers.bind (applyTypeArgumentsToType cx2 tx typeArgs t) (\applied -> Right (applied, cx2))))- in (Optionals.match mt forNothing forJust)---- | Reconstruct the type of a pair (Either/InferenceContext version). Paper: inference.tex, rule Pair (checking side).-typeOfPair :: Typing.InferenceContext -> Graph.Graph -> [Core.Type] -> (Core.Term, Core.Term) -> Either Errors.Error (Core.Type, Typing.InferenceContext)-typeOfPair cx tx typeArgs p =-- let n = Lists.length typeArgs- in (Logic.ifElse (Equality.equal n 2) (- let pairFst = Pairs.first p- pairSnd = Pairs.second p- in (Eithers.bind (typeOf cx tx [] pairFst) (\result1 ->- let firstType = Pairs.first result1- cx2 = Pairs.second result1- in (Eithers.bind (typeOf cx2 tx [] pairSnd) (\result2 ->- let secondType = Pairs.first result2- cx3 = Pairs.second result2- in (Right (- Core.TypePair (Core.PairType {- Core.pairTypeFirst = firstType,- Core.pairTypeSecond = secondType}),- cx3))))))) (Left (Errors.ErrorChecking (Checking.CheckingErrorTypeArityMismatch (Checking.TypeArityMismatchError {- Checking.typeArityMismatchErrorType = (Core.TypePair (Core.PairType {- Core.pairTypeFirst = Core.TypeUnit,- Core.pairTypeSecond = Core.TypeUnit})),- Checking.typeArityMismatchErrorExpectedArity = 2,- Checking.typeArityMismatchErrorActualArity = n,- Checking.typeArityMismatchErrorTypeArguments = typeArgs})))))---- | Reconstruct the type of a primitive function (Either/InferenceContext version). Paper: inference.tex, rule Prim (checking side).-typeOfPrimitive :: Typing.InferenceContext -> Graph.Graph -> [Core.Type] -> Core.Name -> Either Errors.Error (Core.Type, Typing.InferenceContext)-typeOfPrimitive cx tx typeArgs name =-- let rawTs =- Optionals.map (\_p -> Scoping.termSignatureToTypeScheme (Packaging.primitiveDefinitionSignature (Graph.primitiveDefinition _p))) (Maps.lookup name (Graph.graphPrimitives tx))- in (Optionals.match rawTs (Left (Errors.ErrorUndefinedTermVariable (ErrorCore.UndefinedTermVariableError {- ErrorCore.undefinedTermVariableErrorLocation = (Paths.SubtermPath []),- ErrorCore.undefinedTermVariableErrorName = name}))) (\tsRaw ->- let instResult = Resolution.instantiateTypeScheme cx tsRaw- ts = Pairs.first instResult- cx2 = Pairs.second instResult- t = Scoping.typeSchemeToFType ts- in (Eithers.bind (applyTypeArgumentsToType cx2 tx typeArgs t) (\applied -> Right (applied, cx2)))))---- | Reconstruct the type of a record projection (Either/InferenceContext version). Paper: inference.tex, rule Proj (checking side).-typeOfProjection :: Typing.InferenceContext -> Graph.Graph -> [Core.Type] -> Core.Projection -> Either Errors.Error (Core.Type, Typing.InferenceContext)-typeOfProjection cx tx typeArgs p =-- let tname = Core.projectionTypeName p- fname = Core.projectionFieldName p- in (Eithers.bind (Resolution.requireSchemaType cx (Graph.graphSchemaTypes tx) tname) (\schemaResult ->- let schemaType = Pairs.first schemaResult- cx2 = Pairs.second schemaResult- svars = Core.typeSchemeVariables schemaType- sbody = Core.typeSchemeBody schemaType- in (Eithers.bind (ExtractCore.recordType tname sbody) (\sfields -> Eithers.bind (Resolution.findFieldType cx2 fname sfields) (\ftyp ->- let subst = Typing.TypeSubst (Maps.fromList (Lists.zip svars typeArgs))- sftyp = Substitution.substInType subst ftyp- in (Right (- Core.TypeFunction (Core.FunctionType {- Core.functionTypeDomain = (Resolution.nominalApplication tname typeArgs),- Core.functionTypeCodomain = sftyp}),- cx2)))))))---- | Reconstruct the type of a record (Either/InferenceContext version). Paper: inference.tex, rule Rec (checking side).-typeOfRecord :: Typing.InferenceContext -> Graph.Graph -> [Core.Type] -> Core.Record -> Either Errors.Error (Core.Type, Typing.InferenceContext)-typeOfRecord cx tx typeArgs record =-- let tname = Core.recordTypeName record- fields = Core.recordFields record- foldResult =- Lists.foldl (\acc -> \term -> Eithers.bind acc (\accR ->- let types = Pairs.first accR- cxA = Pairs.second accR- in (Eithers.bind (typeOf cxA tx [] term) (\tResult ->- let t = Pairs.first tResult- cxB = Pairs.second tResult- in (Right (Lists.concat2 types (Lists.singleton t), cxB)))))) (Right ([], cx)) (Lists.map Core.fieldTerm fields)- in (Eithers.bind foldResult (\foldR ->- let cx2 = Pairs.second foldR- in (Right (Resolution.nominalApplication tname typeArgs, cx2))))---- | Reconstruct the type of a set (Either/InferenceContext version). Paper: inference.tex, rules Set_0 and Set_+ (checking side).-typeOfSet :: Typing.InferenceContext -> Graph.Graph -> [Core.Type] -> S.Set Core.Term -> Either Errors.Error (Core.Type, Typing.InferenceContext)-typeOfSet cx tx typeArgs els =-- let setArityErr =- Left (Errors.ErrorChecking (Checking.CheckingErrorTypeArityMismatch (Checking.TypeArityMismatchError {- Checking.typeArityMismatchErrorType = (Core.TypeSet Core.TypeUnit),- Checking.typeArityMismatchErrorExpectedArity = 1,- Checking.typeArityMismatchErrorActualArity = (Lists.length typeArgs),- Checking.typeArityMismatchErrorTypeArguments = typeArgs})))- in (Logic.ifElse (Sets.isEmpty els) (Logic.ifElse (Equality.equal (Lists.length typeArgs) 1) (Optionals.match (Lists.head typeArgs) setArityErr (\ta0 -> Right (Core.TypeSet ta0, cx))) setArityErr) (- let foldResult =- Lists.foldl (\acc -> \term -> Eithers.bind acc (\accR ->- let types = Pairs.first accR- cxA = Pairs.second accR- in (Eithers.bind (typeOf cxA tx [] term) (\tResult ->- let t = Pairs.first tResult- cxB = Pairs.second tResult- in (Right (Lists.concat2 types (Lists.singleton t), cxB)))))) (Right ([], cx)) (Sets.toList els)- in (Eithers.bind foldResult (\foldR ->- let eltypes = Pairs.first foldR- cx2 = Pairs.second foldR- in (Eithers.bind (checkSameType cx2 tx "set elements" eltypes) (\unifiedType -> Right (Core.TypeSet unifiedType, cx2)))))))---- | Check the type of a term-typeOfTerm :: Typing.InferenceContext -> Graph.Graph -> Core.Term -> Either Errors.Error Core.Type-typeOfTerm cx g term = Eithers.map Pairs.first (typeOf cx g [] term)---- | Reconstruct the type of a type application term (Either/InferenceContext version). Paper: inference.tex, 'Checking the witness' (pushes onto the pending-type-argument stack).-typeOfTypeApplication :: Typing.InferenceContext -> Graph.Graph -> [Core.Type] -> Core.TypeApplicationTerm -> Either Errors.Error (Core.Type, Typing.InferenceContext)-typeOfTypeApplication cx tx typeArgs tyapp =-- let body = Core.typeApplicationTermBody tyapp- t = Core.typeApplicationTermType tyapp- in (typeOf cx tx (Lists.cons t typeArgs) body)---- | Reconstruct the type of a type lambda (type abstraction) term (Either/InferenceContext version). Paper: inference.tex, type abstraction terms in the elaborated Term grammar.-typeOfTypeLambda :: Typing.InferenceContext -> Graph.Graph -> [Core.Type] -> Core.TypeLambda -> Either Errors.Error (Core.Type, Typing.InferenceContext)-typeOfTypeLambda cx tx typeArgs tl =-- let v = Core.typeLambdaParameter tl- body = Core.typeLambdaBody tl- vars = Graph.graphTypeVariables tx- tx2 =- Graph.Graph {- Graph.graphBoundTerms = (Graph.graphBoundTerms tx),- Graph.graphBoundTypes = (Graph.graphBoundTypes tx),- Graph.graphClassConstraints = (Graph.graphClassConstraints tx),- Graph.graphLambdaVariables = (Graph.graphLambdaVariables tx),- Graph.graphMetadata = (Graph.graphMetadata tx),- Graph.graphPrimitives = (Graph.graphPrimitives tx),- Graph.graphSchemaTypes = (Graph.graphSchemaTypes tx),- Graph.graphTypeVariables = (Sets.insert v vars)}- in (Eithers.bind (typeOf cx tx2 [] body) (\result1 ->- let t1 = Pairs.first result1- cx2 = Pairs.second result1- in (Eithers.bind (applyTypeArgumentsToType cx2 tx typeArgs (Core.TypeForall (Core.ForallType {- Core.forallTypeParameter = v,- Core.forallTypeBody = t1}))) (\applied -> Right (applied, cx2)))))---- | Reconstruct the type of the unit term (Either/InferenceContext version). Paper: inference.tex, rule Unit (checking side).-typeOfUnit :: Typing.InferenceContext -> Graph.Graph -> [Core.Type] -> Either Errors.Error (Core.Type, Typing.InferenceContext)-typeOfUnit cx tx typeArgs =- Eithers.bind (applyTypeArgumentsToType cx tx typeArgs Core.TypeUnit) (\applied -> Right (applied, cx))---- | Reconstruct the type of an unwrap operation (Either/InferenceContext version). Paper: inference.tex, rule Unwr (checking side).-typeOfUnwrap :: Typing.InferenceContext -> Graph.Graph -> [Core.Type] -> Core.Name -> Either Errors.Error (Core.Type, Typing.InferenceContext)-typeOfUnwrap cx tx typeArgs tname =- Eithers.bind (Resolution.requireSchemaType cx (Graph.graphSchemaTypes tx) tname) (\schemaResult ->- let schemaType = Pairs.first schemaResult- cx2 = Pairs.second schemaResult- svars = Core.typeSchemeVariables schemaType- sbody = Core.typeSchemeBody schemaType- in (Eithers.bind (ExtractCore.wrappedType tname sbody) (\wrapped ->- let subst = Typing.TypeSubst (Maps.fromList (Lists.zip svars typeArgs))- swrapped = Substitution.substInType subst wrapped- in (Right (- Core.TypeFunction (Core.FunctionType {- Core.functionTypeDomain = (Resolution.nominalApplication tname typeArgs),- Core.functionTypeCodomain = swrapped}),- cx2)))))---- | Reconstruct the type of a variable (Either/InferenceContext version). Paper: inference.tex, rules Var and Prim (checking side); note the primitives-first lookup order, the reverse of inference.-typeOfVariable :: Typing.InferenceContext -> Graph.Graph -> [Core.Type] -> Core.Name -> Either Errors.Error (Core.Type, Typing.InferenceContext)-typeOfVariable cx tx typeArgs name =-- let forScheme =- \ts ->- let tResult =- Logic.ifElse (Lists.isEmpty typeArgs) (Resolution.instantiateType cx (Scoping.typeSchemeToFType ts)) (Scoping.typeSchemeToFType ts, cx)- t = Pairs.first tResult- cx2 = Pairs.second tResult- in (Eithers.bind (applyTypeArgumentsToType cx2 tx typeArgs t) (\applied -> Right (applied, cx2)))- primScheme =- Optionals.map (\_p -> Scoping.termSignatureToTypeScheme (Packaging.primitiveDefinitionSignature (Graph.primitiveDefinition _p))) (Maps.lookup name (Graph.graphPrimitives tx))- in (Optionals.match primScheme (Optionals.match (Maps.lookup name (Graph.graphBoundTypes tx)) (Left (Errors.ErrorUntypedTermVariable (ErrorCore.UntypedTermVariableError {- ErrorCore.untypedTermVariableErrorLocation = (Paths.SubtermPath []),- ErrorCore.untypedTermVariableErrorName = name}))) forScheme) forScheme)---- | Reconstruct the type of a wrapped term (Either/InferenceContext version). Paper: inference.tex, rule Wrp (checking side).-typeOfWrappedTerm :: Typing.InferenceContext -> Graph.Graph -> [Core.Type] -> Core.WrappedTerm -> Either Errors.Error (Core.Type, Typing.InferenceContext)-typeOfWrappedTerm cx tx typeArgs wt =-- let tname = Core.wrappedTermTypeName wt- body = Core.wrappedTermBody wt- in (Eithers.bind (typeOf cx tx [] body) (\result ->- let cx2 = Pairs.second result- in (Right (Resolution.nominalApplication tname typeArgs, cx2))))---- | Check whether a list of types are effectively equal, disregarding type aliases and free type variable naming. Also treats free type variables (not in schema) as wildcards, since inference has already verified consistency.-typesAllEffectivelyEqual :: Graph.Graph -> [Core.Type] -> Bool-typesAllEffectivelyEqual tx tlist =-- let types = Graph.graphSchemaTypes tx- containsFreeVar =- \t ->- let allVars = Variables.freeVariablesInTypeSimple t- schemaNames = Sets.fromList (Maps.keys types)- in (Logic.not (Sets.isEmpty (Sets.difference allVars schemaNames)))- anyContainsFreeVar = Lists.foldl (\acc -> \t -> Logic.or acc (containsFreeVar t)) False tlist- in (Logic.ifElse anyContainsFreeVar True (Logic.ifElse (allEqual (Lists.map (\t -> normalizeTypeFreeVars t) tlist)) True (allEqual (Lists.map (\t -> normalizeTypeFreeVars (Strip.deannotateTypeRecursive (Dependencies.replaceTypedefs types t))) tlist))))---- | Check whether two types are effectively equal, disregarding type aliases, forall quantifiers, and treating in-scope type variables as wildcards. Paper: inference.tex, 'Checking the witness' (effective equality, the type-level analogue of the referential-transparency equality of terms).-typesEffectivelyEqual :: Graph.Graph -> Core.Type -> Core.Type -> Bool-typesEffectivelyEqual tx t1 t2 =- Logic.or (containsInScopeTypeVars tx t1) (Logic.or (containsInScopeTypeVars tx t2) (typesAllEffectivelyEqual tx [- Resolution.fullyStripAndNormalizeType t1,- (Resolution.fullyStripAndNormalizeType t2)]))
@@ -1,88 +0,0 @@--- Note: this is an automatically generated file. Do not edit.---- | Registry of Hydra's built-in type classes.--module Hydra.Classes where--import qualified Hydra.Ast as Ast-import qualified Hydra.Coders as Coders-import qualified Hydra.Core as Core-import qualified Hydra.Docs as Docs-import qualified Hydra.Error.Checking as Checking-import qualified Hydra.Error.Core as ErrorCore-import qualified Hydra.Error.File as ErrorFile-import qualified Hydra.Error.Packaging as ErrorPackaging-import qualified Hydra.Error.System as ErrorSystem-import qualified Hydra.Errors as Errors-import qualified Hydra.File as File-import qualified Hydra.Graph as Graph-import qualified Hydra.Json.Model as Model-import qualified Hydra.Overlay.Haskell.Lib.Equality as Equality-import qualified Hydra.Overlay.Haskell.Lib.Logic as Logic-import qualified Hydra.Packaging as Packaging-import qualified Hydra.Parsing as Parsing-import qualified Hydra.Paths as Paths-import qualified Hydra.Query as Query-import qualified Hydra.Regex as Regex-import qualified Hydra.Relational as Relational-import qualified Hydra.Strip as Strip-import qualified Hydra.System as System-import qualified Hydra.Tabular as Tabular-import qualified Hydra.Testing as Testing-import qualified Hydra.Time as Time-import qualified Hydra.Topology as Topology-import qualified Hydra.Typed as Typed-import qualified Hydra.Typing as Typing-import qualified Hydra.Util as Util-import qualified Hydra.Validation as Validation-import qualified Hydra.Variants as Variants-import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)-import qualified Data.Scientific as Sci-import Data.Void---- | Check whether a type is an instance of a constraint class, by the class's short name.-classIsSatisfiedByType :: Core.Name -> Core.Type -> Bool-classIsSatisfiedByType className typ =-- let isIntegerLiteral =- case (Strip.deannotateType typ) of- Core.TypeLiteral v0 -> case v0 of- Core.LiteralTypeInteger _ -> True- _ -> False- _ -> False- isFloatLiteral =- case (Strip.deannotateType typ) of- Core.TypeLiteral v0 -> case v0 of- Core.LiteralTypeFloat _ -> True- _ -> False- _ -> False- in (Logic.ifElse (Equality.equal className (Core.Name "equality")) True (Logic.ifElse (Equality.equal className (Core.Name "ordering")) True (Logic.ifElse (Equality.equal className (Core.Name "numeric")) (Logic.or isIntegerLiteral isFloatLiteral) (Logic.ifElse (Equality.equal className (Core.Name "integral")) isIntegerLiteral (Logic.ifElse (Equality.equal className (Core.Name "fractional")) isFloatLiteral False)))))---- | The equality type class: instances support structural equality.-equality :: Typing.TypeClass-equality = Typing.TypeClass {- Typing.typeClassDescription = "Equality: instances support structural equality."}---- | The fractional type class: instances support total floating-point division.-fractional :: Typing.TypeClass-fractional =- Typing.TypeClass {- Typing.typeClassDescription = "Fractional: instances support total floating-point division."}---- | The integral type class: instances support integer division, modulus, remainder, and parity.-integral :: Typing.TypeClass-integral =- Typing.TypeClass {- Typing.typeClassDescription = "Integral: instances support integer division, modulus, remainder, and parity."}---- | The numeric type class: instances support arithmetic (addition, subtraction, multiplication, negation).-numeric :: Typing.TypeClass-numeric =- Typing.TypeClass {- Typing.typeClassDescription = "Numeric: instances support arithmetic (addition, subtraction, multiplication, negation)."}---- | The ordering type class: instances support total ordering (and equality).-ordering :: Typing.TypeClass-ordering =- Typing.TypeClass {- Typing.typeClassDescription = "Ordering: instances support total ordering (and equality)."}
@@ -1,597 +0,0 @@--- Note: this is an automatically generated file. Do not edit.---- | Pure code generation pipeline for bootstrapping Hydra across languages.--module Hydra.Codegen where--import qualified Hydra.Adapt as Adapt-import qualified Hydra.Annotations as Annotations-import qualified Hydra.Ast as Ast-import qualified Hydra.Coders as Coders-import qualified Hydra.Constants as Constants-import qualified Hydra.Core as Core-import qualified Hydra.Decode.Core as DecodeCore-import qualified Hydra.Decode.Packaging as DecodePackaging-import qualified Hydra.Decoding as Decoding-import qualified Hydra.Docs as Docs-import qualified Hydra.Encode.Core as EncodeCore-import qualified Hydra.Encode.Packaging as EncodePackaging-import qualified Hydra.Encoding as Encoding-import qualified Hydra.Environment as Environment-import qualified Hydra.Error.Checking as Checking-import qualified Hydra.Error.Core as ErrorCore-import qualified Hydra.Error.File as ErrorFile-import qualified Hydra.Error.Packaging as ErrorPackaging-import qualified Hydra.Error.System as ErrorSystem-import qualified Hydra.Errors as Errors-import qualified Hydra.File as File-import qualified Hydra.Formatting as Formatting-import qualified Hydra.Graph as Graph-import qualified Hydra.Inference as Inference-import qualified Hydra.Json.Decode as Decode-import qualified Hydra.Json.Encode as Encode-import qualified Hydra.Json.Model as Model-import qualified Hydra.Json.Writer as Writer-import qualified Hydra.Lexical as Lexical-import qualified Hydra.Overlay.Haskell.Lib.Eithers as Eithers-import qualified Hydra.Overlay.Haskell.Lib.Equality as Equality-import qualified Hydra.Overlay.Haskell.Lib.Lists as Lists-import qualified Hydra.Overlay.Haskell.Lib.Logic as Logic-import qualified Hydra.Overlay.Haskell.Lib.Maps as Maps-import qualified Hydra.Overlay.Haskell.Lib.Math as Math-import qualified Hydra.Overlay.Haskell.Lib.Optionals as Optionals-import qualified Hydra.Overlay.Haskell.Lib.Ordering as Ordering-import qualified Hydra.Overlay.Haskell.Lib.Pairs as Pairs-import qualified Hydra.Overlay.Haskell.Lib.Sets as Sets-import qualified Hydra.Overlay.Haskell.Lib.Strings as Strings-import qualified Hydra.Names as Names-import qualified Hydra.Packaging as Packaging-import qualified Hydra.Parsing as Parsing-import qualified Hydra.Paths as Paths-import qualified Hydra.Print.Core as PrintCore-import qualified Hydra.Print.Errors as PrintErrors-import qualified Hydra.Query as Query-import qualified Hydra.Regex as Regex-import qualified Hydra.Relational as Relational-import qualified Hydra.Scoping as Scoping-import qualified Hydra.Strip as Strip-import qualified Hydra.System as System-import qualified Hydra.Tabular as Tabular-import qualified Hydra.Testing as Testing-import qualified Hydra.Time as Time-import qualified Hydra.Topology as Topology-import qualified Hydra.Typed as Typed-import qualified Hydra.Typing as Typing-import qualified Hydra.Util as Util-import qualified Hydra.Validation as Validation-import qualified Hydra.Variants as Variants-import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)-import qualified Data.Scientific as Sci-import Data.Void-import qualified Data.Map as M-import qualified Data.Set as S---- | Build a schema map (Name -> Type) from a graph's schema types-buildSchemaMap :: Graph.Graph -> M.Map Core.Name Core.Type-buildSchemaMap g = Maps.map (\ts -> Strip.deannotateType (Core.typeSchemeBody ts)) (Graph.graphSchemaTypes g)---- | Decode a single module from a JSON value-decodeModuleFromJson :: Graph.Graph -> [Packaging.Module] -> Model.Value -> Either Errors.Error Packaging.Module-decodeModuleFromJson bsGraph universeModules jsonVal =-- let graph = modulesToGraph bsGraph universeModules universeModules- schemaMap = buildSchemaMap graph- modType = Core.TypeVariable (Core.Name "hydra.packaging.Module")- in (Eithers.either (\err -> Left (Errors.ErrorOther (Errors.OtherError err))) (\term -> Eithers.either (\decErr -> Left (Errors.ErrorDecoding decErr)) (\mod -> Right mod) (DecodePackaging.module_ graph term)) (Decode.fromJson schemaMap False (Core.Name "hydra.packaging.Module") modType jsonVal))---- | Escape unescaped control characters inside JSON string literals-escapeControlCharsInJson :: [Int] -> [Int]-escapeControlCharsInJson input =-- let hexDigit = \n -> Logic.ifElse (Ordering.lt n 10) (Math.add 48 n) (Math.add 97 (Math.sub n 10))- escapeToUnicode =- \b -> [- 92,- 117,- 48,- 48,- (hexDigit (Optionals.withDefault 0 (Math.div b 16))),- (hexDigit (Optionals.withDefault 0 (Math.mod b 16)))]- go =- \inStr -> \esc -> \bytes -> Optionals.match (Lists.uncons bytes) [] (\uc ->- let b = Pairs.first uc- bs = Pairs.second uc- in (Logic.ifElse esc (Lists.cons b (go inStr False bs)) (Logic.ifElse (Logic.and (Equality.equal b 92) inStr) (Lists.cons b (go inStr True bs)) (Logic.ifElse (Equality.equal b 34) (Lists.cons b (go (Logic.not inStr) False bs)) (Logic.ifElse (Logic.and inStr (Ordering.lt b 32)) (Lists.concat2 (escapeToUnicode b) (go inStr False bs)) (Lists.cons b (go inStr False bs)))))))- in (go False False input)---- | Format a primitive for the lexicon-formatPrimitive :: Graph.Primitive -> String-formatPrimitive prim =-- let name = Core.unName (Packaging.primitiveDefinitionName (Graph.primitiveDefinition prim))- typ = Scoping.termSignatureToTypeScheme (Packaging.primitiveDefinitionSignature (Graph.primitiveDefinition prim))- typeStr = PrintCore.typeScheme typ- in (Strings.concat2 (Strings.concat2 (Strings.concat2 " " name) " : ") typeStr)---- | Format a term binding for the lexicon-formatTermBinding :: Core.Binding -> String-formatTermBinding binding =-- let name = Core.unName (Core.bindingName binding)- typeStr = Optionals.match (Core.bindingTypeScheme binding) "?" (\scheme -> PrintCore.typeScheme scheme)- in (Strings.concat2 (Strings.concat2 (Strings.concat2 " " name) " : ") typeStr)---- | Format a type binding for the lexicon-formatTypeBinding :: Graph.Graph -> Core.Binding -> Either Errors.Error String-formatTypeBinding graph binding =- Eithers.bind (Eithers.bimap (\_e -> Errors.ErrorDecoding _e) (\_a -> _a) (DecodeCore.type_ graph (Core.bindingTerm binding))) (\typ -> Right (Strings.concat2 (Strings.concat2 (Strings.concat2 " " (Core.unName (Core.bindingName binding))) " = ") (PrintCore.type_ typ)))---- | Generate encoder or decoder modules for a list of type modules-generateCoderModules :: (t0 -> Graph.Graph -> t1 -> Either t2 (Maybe t3)) -> Graph.Graph -> [Packaging.Module] -> [t1] -> t0 -> Either t2 [t3]-generateCoderModules codec bsGraph universeModules typeModules cx =-- let universe = Maps.fromList (Lists.map (\m -> (Packaging.moduleName m, m)) (Lists.concat2 universeModules universeModules))- closureModules = moduleDepsTransitive universe universeModules- schemaElements =- Lists.concat (Lists.map (\m -> Optionals.givens (Lists.map (\d -> case d of- Packaging.DefinitionType v0 -> Just ((\name -> \typ ->- let schemaTerm = Core.TermVariable (Core.Name "hydra.core.Type")- dataTerm =- Annotations.normalizeTermAnnotations (Core.TermAnnotated (Core.AnnotatedTerm {- Core.annotatedTermBody = (EncodeCore.type_ typ),- Core.annotatedTermAnnotation = (Annotations.wrapAnnotationMap (Maps.fromList [- (Constants.keyType, schemaTerm)]))}))- in Core.Binding {- Core.bindingName = name,- Core.bindingTerm = dataTerm,- Core.bindingTypeScheme = (Just (Core.TypeScheme {- Core.typeSchemeVariables = [],- Core.typeSchemeBody = (Core.TypeVariable (Core.Name "hydra.core.Type")),- Core.typeSchemeConstraints = Maps.empty}))}) (Packaging.typeDefinitionName v0) (Core.typeSchemeBody (Packaging.typeDefinitionBody v0)))- _ -> Nothing) (Packaging.moduleDefinitions m))) closureModules)- dataElements =- Lists.concat (Lists.map (\m -> Optionals.givens (Lists.map (\d -> case d of- Packaging.DefinitionTerm v0 -> Just (Core.Binding {- Core.bindingName = (Packaging.termDefinitionName v0),- Core.bindingTerm = (Packaging.termDefinitionBody v0),- Core.bindingTypeScheme = (Optionals.map Scoping.termSignatureToTypeScheme (Packaging.termDefinitionSignature v0))})- _ -> Nothing) (Packaging.moduleDefinitions m))) closureModules)- schemaGraph = Lexical.elementsToGraph bsGraph Maps.empty schemaElements- schemaTypes = Eithers.either (\_ -> Maps.empty) (\_r -> _r) (Environment.schemaGraphToTypingEnvironment schemaGraph)- allElements = Lists.concat2 schemaElements dataElements- graph = Lexical.elementsToGraph bsGraph schemaTypes allElements- in (Eithers.map (\results -> Optionals.givens results) (Eithers.mapList (\m -> codec cx graph m) typeModules))---- | Generate the lexicon content from a graph-generateLexicon :: Graph.Graph -> Either Errors.Error String-generateLexicon graph =-- let bindings = Lexical.graphToBindings graph- primitives = Maps.elems (Graph.graphPrimitives graph)- partitioned = Lists.partition (\b -> Annotations.isNativeType b) bindings- typeBindings = Pairs.first partitioned- termBindings = Pairs.second partitioned- sortedPrimitives = Lists.sortBy (\p -> Packaging.primitiveDefinitionName (Graph.primitiveDefinition p)) primitives- sortedTypes = Lists.sortBy (\b -> Core.bindingName b) typeBindings- sortedTerms = Lists.sortBy (\b -> Core.bindingName b) termBindings- in (Eithers.bind (Eithers.mapList (\b -> formatTypeBinding graph b) sortedTypes) (\typeLines ->- let termLines = Lists.map (\b -> formatTermBinding b) sortedTerms- primitiveLines = Lists.map (\p -> formatPrimitive p) sortedPrimitives- in (Right (Strings.concat2 (Strings.concat2 (Strings.concat2 (Strings.concat2 (Strings.concat2 "Primitives:\n" (Formatting.unlines primitiveLines)) "\nTypes:\n") (Formatting.unlines typeLines)) "\nTerms:\n") (Formatting.unlines termLines)))))---- | Pure core of code generation: given a coder, language, infer flag, bootstrap graph, universe, and modules to generate, produce a list of (filePath, content) pairs. Emission flags doExpand/doHoistCaseStatements/doHoistPolymorphicLetBindings are derived from the absence of the matching LanguageFeature in lang.supportedFeatures: a target that lacks partialApplication needs eta expansion (doExpand=true), and so on.-generateSourceFiles :: Ord t0 => ((Packaging.Module -> [Packaging.Definition] -> Typing.InferenceContext -> Graph.Graph -> Either Errors.Error (M.Map t0 t1)) -> Coders.Language -> Bool -> Graph.Graph -> [Packaging.Module] -> [Packaging.Module] -> Typing.InferenceContext -> Either Errors.Error [(t0, t1)])-generateSourceFiles printDefinitions lang doInfer bsGraph universeModules modsToGenerate cx =-- let namespaceMap = Maps.fromList (Lists.map (\m -> (Packaging.moduleName m, m)) (Lists.concat2 universeModules modsToGenerate))- constraints = Coders.languageConstraints lang- features = Coders.languageSupportedFeatures lang- doExpand = Logic.not (Sets.member Coders.LanguageFeaturePartialApplication features)- doHoistCaseStatements = Logic.not (Sets.member Coders.LanguageFeatureNestedCaseStatements features)- doHoistPolymorphicLetBindings = Logic.not (Sets.member Coders.LanguageFeatureNestedPolymorphicLetBindings features)- typeModulesToGenerate =- Lists.filter (\mod -> Logic.not (Lists.isEmpty (Optionals.givens (Lists.map (\d -> case d of- Packaging.DefinitionType v0 -> Just ((\name -> \typ ->- let schemaTerm = Core.TermVariable (Core.Name "hydra.core.Type")- dataTerm =- Annotations.normalizeTermAnnotations (Core.TermAnnotated (Core.AnnotatedTerm {- Core.annotatedTermBody = (EncodeCore.type_ typ),- Core.annotatedTermAnnotation = (Annotations.wrapAnnotationMap (Maps.fromList [- (Constants.keyType, schemaTerm)]))}))- in Core.Binding {- Core.bindingName = name,- Core.bindingTerm = dataTerm,- Core.bindingTypeScheme = (Just (Core.TypeScheme {- Core.typeSchemeVariables = [],- Core.typeSchemeBody = (Core.TypeVariable (Core.Name "hydra.core.Type")),- Core.typeSchemeConstraints = Maps.empty}))}) (Packaging.typeDefinitionName v0) (Core.typeSchemeBody (Packaging.typeDefinitionBody v0)))- _ -> Nothing) (Packaging.moduleDefinitions mod))))) modsToGenerate- termModulesToGenerate =- Lists.filter (\mod -> Logic.not (Lists.isEmpty (Optionals.givens (Lists.map (\d -> case d of- Packaging.DefinitionTerm v0 -> Just (Core.Binding {- Core.bindingName = (Packaging.termDefinitionName v0),- Core.bindingTerm = (Packaging.termDefinitionBody v0),- Core.bindingTypeScheme = (Optionals.map Scoping.termSignatureToTypeScheme (Packaging.termDefinitionSignature v0))})- _ -> Nothing) (Packaging.moduleDefinitions mod))))) modsToGenerate- closureMods = moduleDepsTransitive namespaceMap (Lists.concat2 universeModules modsToGenerate)- schemaElements =- Lists.concat (Lists.map (\m -> Optionals.givens (Lists.map (\d -> case d of- Packaging.DefinitionType v0 -> Just ((\name -> \typ ->- let schemaTerm = Core.TermVariable (Core.Name "hydra.core.Type")- dataTerm =- Annotations.normalizeTermAnnotations (Core.TermAnnotated (Core.AnnotatedTerm {- Core.annotatedTermBody = (EncodeCore.type_ typ),- Core.annotatedTermAnnotation = (Annotations.wrapAnnotationMap (Maps.fromList [- (Constants.keyType, schemaTerm)]))}))- in Core.Binding {- Core.bindingName = name,- Core.bindingTerm = dataTerm,- Core.bindingTypeScheme = (Just (Core.TypeScheme {- Core.typeSchemeVariables = [],- Core.typeSchemeBody = (Core.TypeVariable (Core.Name "hydra.core.Type")),- Core.typeSchemeConstraints = Maps.empty}))}) (Packaging.typeDefinitionName v0) (Core.typeSchemeBody (Packaging.typeDefinitionBody v0)))- _ -> Nothing) (Packaging.moduleDefinitions m))) closureMods)- dataElements =- Lists.concat (Lists.map (\m -> Optionals.givens (Lists.map (\d -> case d of- Packaging.DefinitionTerm v0 -> Just (Core.Binding {- Core.bindingName = (Packaging.termDefinitionName v0),- Core.bindingTerm = (Packaging.termDefinitionBody v0),- Core.bindingTypeScheme = (Optionals.map Scoping.termSignatureToTypeScheme (Packaging.termDefinitionSignature v0))})- _ -> Nothing) (Packaging.moduleDefinitions m))) closureMods)- schemaGraph = Lexical.elementsToGraph bsGraph Maps.empty schemaElements- schemaTypes2 = Eithers.either (\_ -> Maps.empty) (\_r -> _r) (Environment.schemaGraphToTypingEnvironment schemaGraph)- dataGraph = Lexical.elementsToGraph bsGraph schemaTypes2 dataElements- in (Eithers.bind (Logic.ifElse (Lists.isEmpty typeModulesToGenerate) (Right []) (- let nameLists =- Lists.map (\m -> Optionals.givens (Lists.map (\d -> case d of- Packaging.DefinitionType v0 -> Just (Packaging.typeDefinitionName v0)- _ -> Nothing) (Packaging.moduleDefinitions m))) typeModulesToGenerate- in (Eithers.bind (Adapt.schemaGraphToDefinitions constraints schemaGraph nameLists cx) (\schemaResult ->- let defLists = Pairs.second schemaResult- schemaGraphWithTypes =- Graph.Graph {- Graph.graphBoundTerms = (Graph.graphBoundTerms schemaGraph),- Graph.graphBoundTypes = (Graph.graphBoundTypes schemaGraph),- Graph.graphClassConstraints = (Graph.graphClassConstraints schemaGraph),- Graph.graphLambdaVariables = (Graph.graphLambdaVariables schemaGraph),- Graph.graphMetadata = (Graph.graphMetadata schemaGraph),- Graph.graphPrimitives = (Graph.graphPrimitives schemaGraph),- Graph.graphSchemaTypes = schemaTypes2,- Graph.graphTypeVariables = (Graph.graphTypeVariables schemaGraph)}- in (Eithers.map (\xs -> Lists.concat xs) (Eithers.mapList (\p ->- let mod = Pairs.first p- defs = Pairs.second p- in (Eithers.map (\m -> Maps.toList m) (printDefinitions mod (Lists.map (\d -> Packaging.DefinitionType d) defs) cx schemaGraphWithTypes))) (Lists.zip typeModulesToGenerate defLists))))))) (\schemaFiles -> Eithers.bind (Logic.ifElse (Lists.isEmpty termModulesToGenerate) (Right []) (- let namespaces = Lists.map (\m -> Packaging.moduleName m) termModulesToGenerate- in (Eithers.bind (Adapt.dataGraphToDefinitions constraints doInfer doExpand doHoistCaseStatements doHoistPolymorphicLetBindings dataElements dataGraph namespaces cx) (\dataResult ->- let g1 = Pairs.first dataResult- defLists = Pairs.second dataResult- defName =- \d -> case d of- Packaging.DefinitionTerm v0 -> Packaging.termDefinitionName v0- Packaging.DefinitionType v0 -> Packaging.typeDefinitionName v0- Packaging.DefinitionPrimitive v0 -> Packaging.primitiveDefinitionName v0- refreshModule =- \els -> \m -> Packaging.Module {- Packaging.moduleName = (Packaging.moduleName m),- Packaging.moduleMetadata = (Packaging.moduleMetadata m),- Packaging.moduleDependencies = (Packaging.moduleDependencies m),- Packaging.moduleDefinitions = (Optionals.givens (Lists.map (\d -> case d of- Packaging.DefinitionType v0 -> Just (Packaging.DefinitionType v0)- Packaging.DefinitionTerm v0 -> Optionals.map (\b -> Packaging.DefinitionTerm (Packaging.TermDefinition {- Packaging.termDefinitionName = (Core.bindingName b),- Packaging.termDefinitionMetadata = Nothing,- Packaging.termDefinitionSignature = (Optionals.map Scoping.typeSchemeToTermSignature (Core.bindingTypeScheme b)),- Packaging.termDefinitionBody = (Core.bindingTerm b)})) (Lists.find (\b -> Equality.equal (Core.bindingName b) (Packaging.termDefinitionName v0)) els)- Packaging.DefinitionPrimitive v0 -> Just (Packaging.DefinitionPrimitive v0)) (Packaging.moduleDefinitions m)))}- allBindings = Lexical.graphToBindings g1- refreshedMods = Lists.map (\m -> refreshModule allBindings m) termModulesToGenerate- dedupDefs =- \defs -> Lists.sortBy (\d -> Packaging.termDefinitionName d) (Maps.elems (Maps.fromList (Lists.map (\d -> (Packaging.termDefinitionName d, d)) defs)))- dedupedDefLists = Lists.map dedupDefs defLists- in (Eithers.map (\xs -> Lists.concat xs) (Eithers.mapList (\p ->- let mod = Pairs.first p- defs = Pairs.second p- in (Eithers.map (\m -> Maps.toList m) (printDefinitions mod (Lists.map (\d -> Packaging.DefinitionTerm d) defs) cx g1))) (Lists.zip refreshedMods dedupedDefLists))))))) (\termFiles -> Right (Lists.concat2 schemaFiles termFiles))))---- | Perform type inference and generate the lexicon for a set of modules-inferAndGenerateLexicon :: Typing.InferenceContext -> Graph.Graph -> [Packaging.Module] -> Either Errors.Error String-inferAndGenerateLexicon cx bsGraph kernelModules =-- let g0 = modulesToGraph bsGraph kernelModules kernelModules- dataElements =- Lists.concat (Lists.map (\m -> Optionals.givens (Lists.map (\d -> case d of- Packaging.DefinitionTerm v0 -> Just (Core.Binding {- Core.bindingName = (Packaging.termDefinitionName v0),- Core.bindingTerm = (Packaging.termDefinitionBody v0),- Core.bindingTypeScheme = (Optionals.map Scoping.termSignatureToTypeScheme (Packaging.termDefinitionSignature v0))})- _ -> Nothing) (Packaging.moduleDefinitions m))) kernelModules)- in (Eithers.bind (Inference.inferGraphTypes cx dataElements g0) (\inferResultWithCx ->- let g1 = Pairs.first (Pairs.first inferResultWithCx)- schemaElements =- Lists.concat (Lists.map (\m -> Optionals.givens (Lists.map (\d -> case d of- Packaging.DefinitionType v0 -> Just ((\name -> \typ ->- let schemaTerm = Core.TermVariable (Core.Name "hydra.core.Type")- dataTerm =- Annotations.normalizeTermAnnotations (Core.TermAnnotated (Core.AnnotatedTerm {- Core.annotatedTermBody = (EncodeCore.type_ typ),- Core.annotatedTermAnnotation = (Annotations.wrapAnnotationMap (Maps.fromList [- (Constants.keyType, schemaTerm)]))}))- in Core.Binding {- Core.bindingName = name,- Core.bindingTerm = dataTerm,- Core.bindingTypeScheme = (Just (Core.TypeScheme {- Core.typeSchemeVariables = [],- Core.typeSchemeBody = (Core.TypeVariable (Core.Name "hydra.core.Type")),- Core.typeSchemeConstraints = Maps.empty}))}) (Packaging.typeDefinitionName v0) (Core.typeSchemeBody (Packaging.typeDefinitionBody v0)))- _ -> Nothing) (Packaging.moduleDefinitions m))) kernelModules)- typeBoundTerms = Maps.fromList (Lists.map (\b -> (Core.bindingName b, (Core.bindingTerm b))) schemaElements)- typeBoundTypes =- Maps.fromList (Optionals.givens (Lists.map (\b -> Optionals.map (\ts -> (Core.bindingName b, ts)) (Core.bindingTypeScheme b)) schemaElements))- g2 =- Graph.Graph {- Graph.graphBoundTerms = (Maps.union typeBoundTerms (Graph.graphBoundTerms g1)),- Graph.graphBoundTypes = (Graph.graphBoundTypes g1),- Graph.graphClassConstraints = (Graph.graphClassConstraints g1),- Graph.graphLambdaVariables = (Graph.graphLambdaVariables g1),- Graph.graphMetadata = (Graph.graphMetadata g1),- Graph.graphPrimitives = (Graph.graphPrimitives g1),- Graph.graphSchemaTypes = (Graph.graphSchemaTypes g1),- Graph.graphTypeVariables = (Graph.graphTypeVariables g1)}- g3 =- Graph.Graph {- Graph.graphBoundTerms = (Graph.graphBoundTerms g2),- Graph.graphBoundTypes = (Maps.union typeBoundTypes (Graph.graphBoundTypes g2)),- Graph.graphClassConstraints = (Graph.graphClassConstraints g2),- Graph.graphLambdaVariables = (Graph.graphLambdaVariables g2),- Graph.graphMetadata = (Graph.graphMetadata g2),- Graph.graphPrimitives = (Graph.graphPrimitives g2),- Graph.graphSchemaTypes = (Graph.graphSchemaTypes g2),- Graph.graphTypeVariables = (Graph.graphTypeVariables g2)}- in (generateLexicon g3)))---- | Perform type inference on modules and reconstruct with inferred types-inferModules :: Typing.InferenceContext -> Graph.Graph -> [Packaging.Module] -> [Packaging.Module] -> Either Errors.Error [Packaging.Module]-inferModules cx bsGraph universeMods targetMods =-- let g0 = modulesToGraph bsGraph universeMods universeMods- dataElements =- Lists.concat (Lists.map (\m -> Optionals.givens (Lists.map (\d -> case d of- Packaging.DefinitionTerm v0 -> Just (Core.Binding {- Core.bindingName = (Packaging.termDefinitionName v0),- Core.bindingTerm = (Packaging.termDefinitionBody v0),- Core.bindingTypeScheme = (Optionals.map Scoping.termSignatureToTypeScheme (Packaging.termDefinitionSignature v0))})- _ -> Nothing) (Packaging.moduleDefinitions m))) universeMods)- in (Eithers.bind (Inference.inferGraphTypes cx dataElements g0) (\inferResultWithCx ->- let inferResult = Pairs.first inferResultWithCx- inferredElements = Pairs.second inferResult- in (Right (Lists.map (refreshModule inferredElements) targetMods))))---- | Infer types for target modules in the context of a typed universe-inferModulesGiven :: Typing.InferenceContext -> Graph.Graph -> [Packaging.Module] -> [Packaging.Module] -> Either Errors.Error [Packaging.Module]-inferModulesGiven cx bsGraph universeMods targetMods =-- let g0 = modulesToGraph bsGraph universeMods universeMods- nsMap = Maps.fromList (Lists.map (\m -> (Packaging.moduleName m, m)) universeMods)- closureMods = moduleDepsTransitive nsMap targetMods- targetNamespaces = Sets.fromList (Lists.map Packaging.moduleName targetMods)- termBindings =- Lists.concat (Lists.map (\m ->- let isTarget = Sets.member (Packaging.moduleName m) targetNamespaces- bs =- Optionals.givens (Lists.map (\d -> case d of- Packaging.DefinitionTerm v0 -> Just (Core.Binding {- Core.bindingName = (Packaging.termDefinitionName v0),- Core.bindingTerm = (Packaging.termDefinitionBody v0),- Core.bindingTypeScheme = (Optionals.map Scoping.termSignatureToTypeScheme (Packaging.termDefinitionSignature v0))})- _ -> Nothing) (Packaging.moduleDefinitions m))- in (Logic.ifElse isTarget bs (Lists.filter (\b -> Optionals.isNone (Core.bindingTypeScheme b)) bs))) closureMods)- primitiveBindings =- Lists.concat (Lists.map (\m ->- let isTarget = Sets.member (Packaging.moduleName m) targetNamespaces- bs =- Optionals.givens (Lists.map (\d -> case d of- Packaging.DefinitionPrimitive v0 -> Optionals.map (\impl -> Core.Binding {- Core.bindingName = (Packaging.primitiveDefinitionName v0),- Core.bindingTerm = impl,- Core.bindingTypeScheme = (Just (Scoping.termSignatureToTypeScheme (Packaging.primitiveDefinitionSignature v0)))}) (Packaging.primitiveDefinitionDefaultImplementation v0)- _ -> Nothing) (Packaging.moduleDefinitions m))- in (Logic.ifElse isTarget bs [])) closureMods)- bindingsToInfer = Lists.concat2 termBindings primitiveBindings- untouchedTypedBindings =- Lists.concat (Lists.map (\m ->- let isTarget = Sets.member (Packaging.moduleName m) targetNamespaces- bs =- Optionals.givens (Lists.map (\d -> case d of- Packaging.DefinitionTerm v0 -> Just (Core.Binding {- Core.bindingName = (Packaging.termDefinitionName v0),- Core.bindingTerm = (Packaging.termDefinitionBody v0),- Core.bindingTypeScheme = (Optionals.map Scoping.termSignatureToTypeScheme (Packaging.termDefinitionSignature v0))})- _ -> Nothing) (Packaging.moduleDefinitions m))- in (Logic.ifElse isTarget [] (Lists.filter (\b -> Optionals.isGiven (Core.bindingTypeScheme b)) bs))) closureMods)- in (Eithers.bind (Inference.inferGraphTypes cx bindingsToInfer g0) (\inferResultWithCx ->- let inferResult = Pairs.first inferResultWithCx- newlyInferredBindings = Pairs.second inferResult- allInferredBindings = Lists.concat2 newlyInferredBindings untouchedTypedBindings- in (Right (Lists.map (refreshModule allInferredBindings) targetMods))))---- | Lower Definition.primitive arms to Definition.term arms with term-encoded PrimitiveDefinition-lowerPrimitiveDefinitions :: Packaging.Module -> Packaging.Module-lowerPrimitiveDefinitions m =-- let pkgNs = Packaging.ModuleName "hydra.packaging"- coreNs = Packaging.ModuleName "hydra.core"- primDefSig =- Scoping.typeSchemeToTermSignature (Core.TypeScheme {- Core.typeSchemeVariables = [],- Core.typeSchemeBody = (Core.TypeVariable (Core.Name "hydra.packaging.PrimitiveDefinition")),- Core.typeSchemeConstraints = Maps.empty})- origDefs = Packaging.moduleDefinitions m- hasPrim =- Lists.foldl (\acc -> \d -> Logic.or acc (case d of- Packaging.DefinitionPrimitive _ -> True- _ -> False)) False origDefs- in (Logic.ifElse (Logic.not hasPrim) m (- let newDefs =- Lists.map (\d -> case d of- Packaging.DefinitionPrimitive v0 -> Packaging.DefinitionTerm (Packaging.TermDefinition {- Packaging.termDefinitionName = (Packaging.primitiveDefinitionName v0),- Packaging.termDefinitionMetadata = Nothing,- Packaging.termDefinitionSignature = (Just primDefSig),- Packaging.termDefinitionBody = (EncodePackaging.primitiveDefinition v0)})- _ -> d) origDefs- currentDeps = Packaging.moduleDependencies m- filteredDeps =- Lists.filter (\dep -> Logic.and (Logic.not (Equality.equal (Packaging.moduleDependencyModule dep) pkgNs)) (Logic.not (Equality.equal (Packaging.moduleDependencyModule dep) coreNs))) currentDeps- newDeps =- Lists.concat2 filteredDeps [- Packaging.ModuleDependency {- Packaging.moduleDependencyModule = pkgNs,- Packaging.moduleDependencyPackage = Nothing},- Packaging.ModuleDependency {- Packaging.moduleDependencyModule = coreNs,- Packaging.moduleDependencyPackage = Nothing}]- in Packaging.Module {- Packaging.moduleName = (Packaging.moduleName m),- Packaging.moduleMetadata = (Packaging.moduleMetadata m),- Packaging.moduleDependencies = newDeps,- Packaging.moduleDefinitions = newDefs}))---- | Compute transitive closure of dependencies for a set of modules-moduleDepsTransitive :: M.Map Packaging.ModuleName Packaging.Module -> [Packaging.Module] -> [Packaging.Module]-moduleDepsTransitive nsMap modules =-- let closure =- Sets.union (transitiveDeps (\m -> Lists.map (\dep -> Packaging.moduleDependencyModule dep) (Packaging.moduleDependencies m)) nsMap modules) (Sets.fromList (Lists.map (\m -> Packaging.moduleName m) modules))- in (Optionals.givens (Lists.map (\n -> Maps.lookup n nsMap) (Sets.toList closure)))---- | Convert a module name to a file path (e.g., hydra.core -> hydra/core)-moduleNameToPath :: Packaging.ModuleName -> String-moduleNameToPath ns = Strings.join "/" (Strings.splitOn "." (Packaging.unModuleName ns))---- | Convert a Module to a JSON string-moduleToJson :: M.Map Core.Name Core.Type -> Packaging.Module -> Either Errors.Error String-moduleToJson schemaMap m =-- let term = EncodePackaging.module_ m- modType = Core.TypeVariable (Core.Name "hydra.packaging.Module")- in (Eithers.map (\json -> Writer.printJson json) (Eithers.bimap (\_e -> Errors.ErrorOther (Errors.OtherError _e)) (\_a -> _a) (Encode.toJson schemaMap False (Core.Name "hydra.packaging.Module") modType term)))---- | Convert a generated Module into a Source module-moduleToSourceModule :: Packaging.Module -> Packaging.Module-moduleToSourceModule m =-- let sourceNs =- Packaging.ModuleName (Strings.concat2 "hydra.sources." (Strings.join "." (Lists.drop 1 (Strings.splitOn "." (Packaging.unModuleName (Packaging.moduleName m))))))- modTypeNs = Packaging.ModuleName "hydra.packaging"- moduleDef =- Packaging.DefinitionTerm (Packaging.TermDefinition {- Packaging.termDefinitionName = (Core.Name (Strings.concat2 (Packaging.unModuleName sourceNs) ".module_")),- Packaging.termDefinitionMetadata = Nothing,- Packaging.termDefinitionSignature = (Just (Scoping.typeSchemeToTermSignature (Core.TypeScheme {- Core.typeSchemeVariables = [],- Core.typeSchemeBody = (Core.TypeVariable (Core.Name "hydra.packaging.Module")),- Core.typeSchemeConstraints = Maps.empty}))),- Packaging.termDefinitionBody = (EncodePackaging.module_ m)})- in Packaging.Module {- Packaging.moduleName = sourceNs,- Packaging.moduleMetadata = (Just (Packaging.EntityMetadata {- Packaging.entityMetadataDescription = (Just (Strings.concat2 "Source module for " (Packaging.unModuleName (Packaging.moduleName m)))),- Packaging.entityMetadataComments = [],- Packaging.entityMetadataSeeAlso = [],- Packaging.entityMetadataLifecycle = Nothing,- Packaging.entityMetadataProvisions = []})),- Packaging.moduleDependencies = [- Packaging.ModuleDependency {- Packaging.moduleDependencyModule = modTypeNs,- Packaging.moduleDependencyPackage = Nothing}],- Packaging.moduleDefinitions = [- moduleDef]}---- | Build a graph from universe modules and working modules, using an explicit bootstrap graph-modulesToGraph :: Graph.Graph -> [Packaging.Module] -> [Packaging.Module] -> Graph.Graph-modulesToGraph bsGraph universeModules modules =-- let universe = Maps.fromList (Lists.map (\m -> (Packaging.moduleName m, m)) (Lists.concat2 universeModules modules))- closureModules = moduleDepsTransitive universe (Lists.concat2 universeModules modules)- schemaElements =- Lists.concat (Lists.map (\m -> Optionals.givens (Lists.map (\d -> case d of- Packaging.DefinitionType v0 -> Just ((\name -> \typ ->- let schemaTerm = Core.TermVariable (Core.Name "hydra.core.Type")- dataTerm =- Annotations.normalizeTermAnnotations (Core.TermAnnotated (Core.AnnotatedTerm {- Core.annotatedTermBody = (EncodeCore.type_ typ),- Core.annotatedTermAnnotation = (Annotations.wrapAnnotationMap (Maps.fromList [- (Constants.keyType, schemaTerm)]))}))- in Core.Binding {- Core.bindingName = name,- Core.bindingTerm = dataTerm,- Core.bindingTypeScheme = (Just (Core.TypeScheme {- Core.typeSchemeVariables = [],- Core.typeSchemeBody = (Core.TypeVariable (Core.Name "hydra.core.Type")),- Core.typeSchemeConstraints = Maps.empty}))}) (Packaging.typeDefinitionName v0) (Core.typeSchemeBody (Packaging.typeDefinitionBody v0)))- _ -> Nothing) (Packaging.moduleDefinitions m))) closureModules)- dataElements =- Lists.concat (Lists.map (\m -> Optionals.givens (Lists.map (\d -> case d of- Packaging.DefinitionTerm v0 -> Just (Core.Binding {- Core.bindingName = (Packaging.termDefinitionName v0),- Core.bindingTerm = (Packaging.termDefinitionBody v0),- Core.bindingTypeScheme = (Optionals.map Scoping.termSignatureToTypeScheme (Packaging.termDefinitionSignature v0))})- _ -> Nothing) (Packaging.moduleDefinitions m))) closureModules)- schemaGraph = Lexical.elementsToGraph bsGraph Maps.empty schemaElements- schemaTypes = Eithers.either (\_ -> Maps.empty) (\_r -> _r) (Environment.schemaGraphToTypingEnvironment schemaGraph)- baseGraph = Lexical.elementsToGraph bsGraph schemaTypes dataElements- universeDataElements =- Lists.concat (Lists.map (\m -> Optionals.givens (Lists.map (\d -> case d of- Packaging.DefinitionTerm v0 -> Just (Core.Binding {- Core.bindingName = (Packaging.termDefinitionName v0),- Core.bindingTerm = (Packaging.termDefinitionBody v0),- Core.bindingTypeScheme = (Optionals.map Scoping.termSignatureToTypeScheme (Packaging.termDefinitionSignature v0))})- _ -> Nothing) (Packaging.moduleDefinitions m))) universeModules)- universeBoundTypes =- Maps.fromList (Optionals.givens (Lists.map (\b -> Optionals.map (\ts -> (Core.bindingName b, ts)) (Core.bindingTypeScheme b)) universeDataElements))- in Graph.Graph {- Graph.graphBoundTerms = (Graph.graphBoundTerms baseGraph),- Graph.graphBoundTypes = universeBoundTypes,- Graph.graphClassConstraints = (Graph.graphClassConstraints baseGraph),- Graph.graphLambdaVariables = (Graph.graphLambdaVariables baseGraph),- Graph.graphMetadata = (Graph.graphMetadata baseGraph),- Graph.graphPrimitives = (Graph.graphPrimitives baseGraph),- Graph.graphSchemaTypes = (Graph.graphSchemaTypes baseGraph),- Graph.graphTypeVariables = (Graph.graphTypeVariables baseGraph)}---- | Rebuild a module's term definitions using freshly inferred bindings-refreshModule :: [Core.Binding] -> Packaging.Module -> Packaging.Module-refreshModule inferredElements m =- Logic.ifElse (Logic.not (Logic.not (Lists.isEmpty (Optionals.givens (Lists.map (\d -> case d of- Packaging.DefinitionTerm v0 -> Just (Core.Binding {- Core.bindingName = (Packaging.termDefinitionName v0),- Core.bindingTerm = (Packaging.termDefinitionBody v0),- Core.bindingTypeScheme = (Optionals.map Scoping.termSignatureToTypeScheme (Packaging.termDefinitionSignature v0))})- _ -> Nothing) (Packaging.moduleDefinitions m)))))) m (Packaging.Module {- Packaging.moduleName = (Packaging.moduleName m),- Packaging.moduleMetadata = (Packaging.moduleMetadata m),- Packaging.moduleDependencies = (Packaging.moduleDependencies m),- Packaging.moduleDefinitions = (Optionals.givens (Lists.map (\d -> case d of- Packaging.DefinitionType v0 -> Just (Packaging.DefinitionType v0)- Packaging.DefinitionTerm v0 -> Optionals.map (\b -> Packaging.DefinitionTerm (Packaging.TermDefinition {- Packaging.termDefinitionName = (Core.bindingName b),- Packaging.termDefinitionMetadata = Nothing,- Packaging.termDefinitionSignature = (Optionals.map Scoping.typeSchemeToTermSignature (Core.bindingTypeScheme b)),- Packaging.termDefinitionBody = (Core.bindingTerm b)})) (Lists.find (\b -> Equality.equal (Core.bindingName b) (Packaging.termDefinitionName v0)) inferredElements)- Packaging.DefinitionPrimitive v0 -> Just (Packaging.DefinitionPrimitive v0)) (Packaging.moduleDefinitions m)))})---- | Compute transitive closure of module dependencies-transitiveDeps :: (Packaging.Module -> [Packaging.ModuleName]) -> M.Map Packaging.ModuleName Packaging.Module -> [Packaging.Module] -> S.Set Packaging.ModuleName-transitiveDeps getDeps nsMap startMods =-- let initialDeps =- Sets.fromList (Lists.concat (Lists.map (\m -> Lists.filter (\dep -> Logic.not (Equality.equal dep (Packaging.moduleName m))) (getDeps m)) startMods))- go =- \pending -> \visited -> Logic.ifElse (Sets.isEmpty pending) visited (- let newVisited = Sets.union visited pending- nextDeps =- Sets.fromList (Lists.concat (Lists.map (\nsv -> Optionals.match (Maps.lookup nsv nsMap) [] (\depMod -> getDeps depMod)) (Sets.toList pending)))- newPending = Sets.difference nextDeps newVisited- in (go newPending newVisited))- in (go initialDeps Sets.empty)
@@ -1,250 +0,0 @@--- Note: this is an automatically generated file. Do not edit.---- | Abstractions for paired transformations between languages--module Hydra.Coders where--import qualified Hydra.Core as Core-import qualified Hydra.Errors as Errors-import qualified Hydra.File as File-import qualified Hydra.Graph as Graph-import qualified Hydra.Util as Util-import qualified Hydra.Variants as Variants-import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)-import qualified Data.Scientific as Sci-import Data.Void-import qualified Data.Map as M-import qualified Data.Set as S---- | A two-level bidirectional encoder which adapts types to types and terms to terms-data Adapter t1 t2 v1 v2 e =- Adapter {- -- | Whether information may be lost in the course of this adaptation- adapterIsLossy :: Bool,- -- | The source type- adapterSource :: t1,- -- | The target type- adapterTarget :: t2,- -- | The coder for transforming instances of the source type to instances of the target type- adapterCoder :: (Coder v1 v2 e)}--_Adapter = Core.Name "hydra.coders.Adapter"--_Adapter_isLossy = Core.Name "isLossy"--_Adapter_source = Core.Name "source"--_Adapter_target = Core.Name "target"--_Adapter_coder = Core.Name "coder"---- | An evaluation context together with a source language and a target language-data AdapterContext =- AdapterContext {- -- | The underlying graph of elements and primitives- adapterContextGraph :: Graph.Graph,- -- | The language being encoded or decoded- adapterContextLanguage :: Language,- -- | A map of type names to adapters for those types- adapterContextAdapters :: (M.Map Core.Name (Adapter Core.Type Core.Type Core.Term Core.Term Errors.Error))}--_AdapterContext = Core.Name "hydra.coders.AdapterContext"--_AdapterContext_graph = Core.Name "graph"--_AdapterContext_language = Core.Name "language"--_AdapterContext_adapters = Core.Name "adapters"---- | A two-level encoder and decoder, operating both at a type level and an instance (data) level-data Bicoder t1 t2 v1 v2 e =- Bicoder {- -- | A function from source types to adapters- bicoderEncode :: (t1 -> Adapter t1 t2 v1 v2 e),- -- | A function from target types to adapters- bicoderDecode :: (t2 -> Adapter t2 t1 v2 v1 e)}--_Bicoder = Core.Name "hydra.coders.Bicoder"--_Bicoder_encode = Core.Name "encode"--_Bicoder_decode = Core.Name "decode"---- | Per-target case conventions for name forms that vary across emission targets-data CaseConventions =- CaseConventions {- -- | Convention for compile-time constant names- caseConventionsConstant :: Util.CaseConvention,- -- | Convention for each directory level in the emitted source tree- caseConventionsDirectory :: Util.CaseConvention,- -- | Convention for enum-variant value names- caseConventionsEnumValue :: Util.CaseConvention,- -- | Convention for record field names- caseConventionsField :: Util.CaseConvention,- -- | Convention for the source-file basename- caseConventionsFile :: Util.CaseConvention,- -- | Convention for a single segment of a module name- caseConventionsModule :: Util.CaseConvention,- -- | Convention for top-level term definitions (functions, module-level values)- caseConventionsTerm :: Util.CaseConvention,- -- | Convention for locally-bound term names (lambda parameters, let-bindings)- caseConventionsTermVariable :: Util.CaseConvention,- -- | Convention for type names- caseConventionsType :: Util.CaseConvention,- -- | Convention for type-level variable names- caseConventionsTypeVariable :: Util.CaseConvention}- deriving (Eq, Ord, Read, Show)--_CaseConventions = Core.Name "hydra.coders.CaseConventions"--_CaseConventions_constant = Core.Name "constant"--_CaseConventions_directory = Core.Name "directory"--_CaseConventions_enumValue = Core.Name "enumValue"--_CaseConventions_field = Core.Name "field"--_CaseConventions_file = Core.Name "file"--_CaseConventions_module = Core.Name "module"--_CaseConventions_term = Core.Name "term"--_CaseConventions_termVariable = Core.Name "termVariable"--_CaseConventions_type = Core.Name "type"--_CaseConventions_typeVariable = Core.Name "typeVariable"---- | An encoder and decoder; a pair of partial functions between two types-data Coder v1 v2 e =- Coder {- -- | A function which encodes a domain value to a codomain value, with the possibility of failure- coderEncode :: (v1 -> Either e v2),- -- | A function which decodes a codomain value to a domain value, with the possibility of failure- coderDecode :: (v2 -> Either e v1)}--_Coder = Core.Name "hydra.coders.Coder"--_Coder_encode = Core.Name "encode"--_Coder_decode = Core.Name "decode"---- | Indicates either the 'out' or the 'in' direction of a coder-data CoderDirection =- CoderDirectionEncode |- CoderDirectionDecode- deriving (Eq, Ord, Read, Show)--_CoderDirection = Core.Name "hydra.coders.CoderDirection"--_CoderDirection_encode = Core.Name "encode"--_CoderDirection_decode = Core.Name "decode"---- | A named language together with its grammar constraints, capability profile, naming conventions, and conventional file extension-data Language =- Language {- -- | The unique name of the language- languageName :: LanguageName,- -- | Constraints which characterize the language's type and term grammars- languageConstraints :: LanguageConstraints,- -- | Target-language or target-runtime capabilities the emitter may assume are available- languageSupportedFeatures :: (S.Set LanguageFeature),- -- | Per-target case conventions for the various kinds of identifiers emitted by the coder- languageCaseConventions :: CaseConventions,- -- | Conventional file extension for emitted source files, without the leading dot (e.g. "scala", "py")- languageDefaultFileExtension :: File.FileExtension}--_Language = Core.Name "hydra.coders.Language"--_Language_name = Core.Name "name"--_Language_constraints = Core.Name "constraints"--_Language_supportedFeatures = Core.Name "supportedFeatures"--_Language_caseConventions = Core.Name "caseConventions"--_Language_defaultFileExtension = Core.Name "defaultFileExtension"---- | A set of constraints on valid type and term expressions, characterizing a language-data LanguageConstraints =- LanguageConstraints {- -- | All supported literal variants- languageConstraintsLiteralVariants :: (S.Set Variants.LiteralVariant),- -- | All supported float types- languageConstraintsFloatTypes :: (S.Set Core.FloatType),- -- | All supported integer types- languageConstraintsIntegerTypes :: (S.Set Core.IntegerType),- -- | All supported term variants- languageConstraintsTermVariants :: (S.Set Variants.TermVariant),- -- | All supported type variants- languageConstraintsTypeVariants :: (S.Set Variants.TypeVariant),- -- | A logical set of types, as a predicate which tests a type for inclusion- languageConstraintsTypes :: (Core.Type -> Bool)}--_LanguageConstraints = Core.Name "hydra.coders.LanguageConstraints"--_LanguageConstraints_literalVariants = Core.Name "literalVariants"--_LanguageConstraints_floatTypes = Core.Name "floatTypes"--_LanguageConstraints_integerTypes = Core.Name "integerTypes"--_LanguageConstraints_termVariants = Core.Name "termVariants"--_LanguageConstraints_typeVariants = Core.Name "typeVariants"--_LanguageConstraints_types = Core.Name "types"---- | A target-language or target-runtime capability the coder may rely on. Absence from a Language's supportedFeatures set means the emitter must work around the missing capability.-data LanguageFeature =- -- | The target runtime can invoke an n-ary function with fewer than n arguments without error. When absent, the emitter eta-expands partially-applied terms.- LanguageFeaturePartialApplication |- -- | The target runtime can handle deeply nested case statements without stack issues. When absent, the emitter hoists cases out into top-level helpers.- LanguageFeatureNestedCaseStatements |- -- | The target language permits polymorphic let-bindings in expression position. When absent, the emitter hoists polymorphic lets to top level.- LanguageFeatureNestedPolymorphicLetBindings- deriving (Eq, Ord, Read, Show)--_LanguageFeature = Core.Name "hydra.coders.LanguageFeature"--_LanguageFeature_partialApplication = Core.Name "partialApplication"--_LanguageFeature_nestedCaseStatements = Core.Name "nestedCaseStatements"--_LanguageFeature_nestedPolymorphicLetBindings = Core.Name "nestedPolymorphicLetBindings"---- | The unique name of a language-newtype LanguageName =- LanguageName {- unLanguageName :: String}- deriving (Eq, Ord, Read, Show)--_LanguageName = Core.Name "hydra.coders.LanguageName"---- | A bidirectional encoder which maps between the same type and term languages on either side-type SymmetricAdapter t v e = (Adapter t t v v e)--_SymmetricAdapter = Core.Name "hydra.coders.SymmetricAdapter"---- | Specifies either a pre-order or post-order traversal-data TraversalOrder =- -- | Pre-order traversal- TraversalOrderPre |- -- | Post-order traversal- TraversalOrderPost- deriving (Eq, Ord, Read, Show)--_TraversalOrder = Core.Name "hydra.coders.TraversalOrder"--_TraversalOrder_pre = Core.Name "pre"--_TraversalOrder_post = Core.Name "post"---- | A function which maps a Hydra type to a symmetric adapter between types and terms-type TypeAdapter = (AdapterContext -> Core.Type -> Either String (SymmetricAdapter Core.Type Core.Term String))--_TypeAdapter = Core.Name "hydra.coders.TypeAdapter"
@@ -1,118 +0,0 @@--- Note: this is an automatically generated file. Do not edit.---- | A module for tier-0 constants.--module Hydra.Constants where--import qualified Hydra.Ast as Ast-import qualified Hydra.Coders as Coders-import qualified Hydra.Core as Core-import qualified Hydra.Docs as Docs-import qualified Hydra.Error.Checking as Checking-import qualified Hydra.Error.Core as ErrorCore-import qualified Hydra.Error.File as ErrorFile-import qualified Hydra.Error.Packaging as ErrorPackaging-import qualified Hydra.Error.System as ErrorSystem-import qualified Hydra.Errors as Errors-import qualified Hydra.File as File-import qualified Hydra.Graph as Graph-import qualified Hydra.Json.Model as Model-import qualified Hydra.Packaging as Packaging-import qualified Hydra.Parsing as Parsing-import qualified Hydra.Paths as Paths-import qualified Hydra.Query as Query-import qualified Hydra.Regex as Regex-import qualified Hydra.Relational as Relational-import qualified Hydra.System as System-import qualified Hydra.Tabular as Tabular-import qualified Hydra.Testing as Testing-import qualified Hydra.Time as Time-import qualified Hydra.Topology as Topology-import qualified Hydra.Typed as Typed-import qualified Hydra.Typing as Typing-import qualified Hydra.Util as Util-import qualified Hydra.Validation as Validation-import qualified Hydra.Variants as Variants-import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)-import qualified Data.Scientific as Sci-import Data.Void---- | The conventional field name used when normalizing a wrapped (newtype) value to a single-field record-fieldNameValue :: String-fieldNameValue = "value"---- | The name used for ignored variables-ignoredVariable :: String-ignoredVariable = "_"---- | Annotation key for type classes-keyClasses :: Core.Name-keyClasses = Core.Name "classes"---- | Annotation key for debug identifiers-keyDebugId :: Core.Name-keyDebugId = Core.Name "debugId"---- | Annotation key for deprecated markers-keyDeprecated :: Core.Name-keyDeprecated = Core.Name "deprecated"---- | Annotation key for descriptions-keyDescription :: Core.Name-keyDescription = Core.Name "description"---- | Annotation key for exclusions-keyExclude :: Core.Name-keyExclude = Core.Name "exclude"---- | A flag which tells the language coders to encode a given encoded type as a term rather than a native type-keyFirstClassType :: Core.Name-keyFirstClassType = Core.Name "firstClassType"---- | A counter for generating fresh type variable names-keyFreshTypeVariableCount :: Core.Name-keyFreshTypeVariableCount = Core.Name "freshTypeVariableCount"---- | Annotation key for maximum length constraints-keyMaxLength :: Core.Name-keyMaxLength = Core.Name "maxLength"---- | Annotation key for minimum length constraints-keyMinLength :: Core.Name-keyMinLength = Core.Name "minLength"---- | Annotation key for preserving field names during code generation-keyPreserveFieldName :: Core.Name-keyPreserveFieldName = Core.Name "preserveFieldName"---- | Annotation key for type information-keyType :: Core.Name-keyType = Core.Name "type"---- | The maximum value of a 32-bit integer-maxInt32 :: Int-maxInt32 = 2147483647---- | A maximum depth for nested computations. Currently, this is set very high because deep recursion is common in type inference over the Hydra kernel.-maxTraceDepth :: Int-maxTraceDepth = 5000---- | Regex matching a camelCase identifier: starts with a lowercase letter, then any letters or digits.-regexCamelCase :: String-regexCamelCase = "^[a-z][a-zA-Z0-9]*$"---- | Regex matching a Hydra namespace: dot-separated camelCase segments, each starting with a lowercase letter.-regexNamespace :: String-regexNamespace = "^[a-z][a-zA-Z0-9]*(\\.[a-z][a-zA-Z0-9]*)*$"---- | Regex matching a Hydra package name: hyphen-separated lowercase segments, each starting with a letter.-regexPackageName :: String-regexPackageName = "^[a-z][a-z0-9]*(-[a-z][a-z0-9]*)*$"---- | Regex matching a PascalCase identifier: starts with an uppercase letter, then any letters or digits.-regexPascalCase :: String-regexPascalCase = "^[A-Z][a-zA-Z0-9]*$"---- | A standard warning message for auto-generated files-warningAutoGeneratedFile :: String-warningAutoGeneratedFile = "Note: this is an automatically generated file. Do not edit."
@@ -1,743 +0,0 @@--- Note: this is an automatically generated file. Do not edit.---- | Hydra's core data model, consisting of the fundamental hydra.core.Term type and all of its dependencies.--module Hydra.Core where--import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)-import qualified Data.Scientific as Sci-import Data.Void-import qualified Data.ByteString as B-import qualified Data.Int as I-import qualified Data.Map as M-import qualified Data.Set as S---- | A term together with an annotation-data AnnotatedTerm =- AnnotatedTerm {- -- | The term being annotated- annotatedTermBody :: Term,- -- | The annotation as a single term. By convention this is a map term (Name -> Term) so that multiple independent annotations can coexist, but applications are free to use any term shape.- annotatedTermAnnotation :: Term}- deriving (Eq, Ord, Read, Show)--_AnnotatedTerm = Name "hydra.core.AnnotatedTerm"--_AnnotatedTerm_body = Name "body"--_AnnotatedTerm_annotation = Name "annotation"---- | A type together with an annotation-data AnnotatedType =- AnnotatedType {- -- | The type being annotated- annotatedTypeBody :: Type,- -- | The annotation as a single term. By convention this is a map term (Name -> Term) so that multiple independent annotations can coexist, but applications are free to use any term shape.- annotatedTypeAnnotation :: Term}- deriving (Eq, Ord, Read, Show)--_AnnotatedType = Name "hydra.core.AnnotatedType"--_AnnotatedType_body = Name "body"--_AnnotatedType_annotation = Name "annotation"---- | A term which applies a function to an argument-data Application =- Application {- -- | The left-hand side of the application- applicationFunction :: Term,- -- | The right-hand side of the application- applicationArgument :: Term}- deriving (Eq, Ord, Read, Show)--_Application = Name "hydra.core.Application"--_Application_function = Name "function"--_Application_argument = Name "argument"---- | The type-level analog of an application term-data ApplicationType =- ApplicationType {- -- | The left-hand side of the application- applicationTypeFunction :: Type,- -- | The right-hand side of the application- applicationTypeArgument :: Type}- deriving (Eq, Ord, Read, Show)--_ApplicationType = Name "hydra.core.ApplicationType"--_ApplicationType_function = Name "function"--_ApplicationType_argument = Name "argument"---- | A field with an optional type scheme, used to bind variables to terms in a 'let' expression-data Binding =- Binding {- -- | The name of the bound variable- bindingName :: Name,- -- | The term to which the variable is bound- bindingTerm :: Term,- -- | The optional type scheme of the bound term- bindingTypeScheme :: (Maybe TypeScheme)}- deriving (Eq, Ord, Read, Show)--_Binding = Name "hydra.core.Binding"--_Binding_name = Name "name"--_Binding_term = Name "term"--_Binding_typeScheme = Name "typeScheme"---- | A single alternative of a case statement (union elimination): the variant being matched, together with the term that handles it.-data CaseAlternative =- CaseAlternative {- -- | The name of the union variant matched by this alternative- caseAlternativeName :: Name,- -- | The handler applied to the matched variant's payload- caseAlternativeHandler :: Term}- deriving (Eq, Ord, Read, Show)--_CaseAlternative = Name "hydra.core.CaseAlternative"--_CaseAlternative_name = Name "name"--_CaseAlternative_handler = Name "handler"---- | A union elimination; a case statement-data CaseStatement =- CaseStatement {- -- | The name of the union type- caseStatementTypeName :: Name,- -- | An optional default case, used if none of the explicit cases match- caseStatementDefault :: (Maybe Term),- -- | A list of case alternatives, one per union variant being handled- caseStatementCases :: [CaseAlternative]}- deriving (Eq, Ord, Read, Show)--_CaseStatement = Name "hydra.core.CaseStatement"--_CaseStatement_typeName = Name "typeName"--_CaseStatement_default = Name "default"--_CaseStatement_cases = Name "cases"---- | A type which provides a choice between a 'left' type and a 'right' type-data EitherType =- EitherType {- -- | The 'left' alternative- eitherTypeLeft :: Type,- -- | The 'right' alternative- eitherTypeRight :: Type}- deriving (Eq, Ord, Read, Show)--_EitherType = Name "hydra.core.EitherType"--_EitherType_left = Name "left"--_EitherType_right = Name "right"---- | A name/term pair-data Field =- Field {- -- | The name of the field- fieldName :: Name,- -- | The value of the field- fieldTerm :: Term}- deriving (Eq, Ord, Read, Show)--_Field = Name "hydra.core.Field"--_Field_name = Name "name"--_Field_term = Name "term"---- | A name/type pair-data FieldType =- FieldType {- -- | The name of the field- fieldTypeName :: Name,- -- | The type of the field- fieldTypeType :: Type}- deriving (Eq, Ord, Read, Show)--_FieldType = Name "hydra.core.FieldType"--_FieldType_name = Name "name"--_FieldType_type = Name "type"---- | A floating-point type-data FloatType =- -- | A 32-bit floating-point type- FloatTypeFloat32 |- -- | A 64-bit floating-point type- FloatTypeFloat64- deriving (Eq, Ord, Read, Show)--_FloatType = Name "hydra.core.FloatType"--_FloatType_float32 = Name "float32"--_FloatType_float64 = Name "float64"---- | A floating-point literal value-data FloatValue =- -- | A 32-bit floating-point value- FloatValueFloat32 Float |- -- | A 64-bit floating-point value- FloatValueFloat64 Double- deriving (Eq, Ord, Read, Show)--_FloatValue = Name "hydra.core.FloatValue"--_FloatValue_float32 = Name "float32"--_FloatValue_float64 = Name "float64"---- | A universally quantified type; the System F equivalent of a type scheme, and the type-level equivalent of a lambda term.-data ForallType =- ForallType {- -- | The variable which is bound by the lambda- forallTypeParameter :: Name,- -- | The body of the lambda- forallTypeBody :: Type}- deriving (Eq, Ord, Read, Show)--_ForallType = Name "hydra.core.ForallType"--_ForallType_parameter = Name "parameter"--_ForallType_body = Name "body"---- | A function type, also known as an arrow type-data FunctionType =- FunctionType {- -- | The domain (input) type of the function- functionTypeDomain :: Type,- -- | The codomain (output) type of the function- functionTypeCodomain :: Type}- deriving (Eq, Ord, Read, Show)--_FunctionType = Name "hydra.core.FunctionType"--_FunctionType_domain = Name "domain"--_FunctionType_codomain = Name "codomain"---- | An instance of a union type; i.e. a string-indexed generalization of inl() or inr()-data Injection =- Injection {- -- | The name of the union type- injectionTypeName :: Name,- -- | The field being injected, including its name and value- injectionField :: Field}- deriving (Eq, Ord, Read, Show)--_Injection = Name "hydra.core.Injection"--_Injection_typeName = Name "typeName"--_Injection_field = Name "field"---- | An integer type-data IntegerType =- -- | An arbitrary-precision integer type- IntegerTypeBigint |- -- | An 8-bit signed integer type- IntegerTypeInt8 |- -- | A 16-bit signed integer type- IntegerTypeInt16 |- -- | A 32-bit signed integer type- IntegerTypeInt32 |- -- | A 64-bit signed integer type- IntegerTypeInt64 |- -- | An 8-bit unsigned integer type- IntegerTypeUint8 |- -- | A 16-bit unsigned integer type- IntegerTypeUint16 |- -- | A 32-bit unsigned integer type- IntegerTypeUint32 |- -- | A 64-bit unsigned integer type- IntegerTypeUint64- deriving (Eq, Ord, Read, Show)--_IntegerType = Name "hydra.core.IntegerType"--_IntegerType_bigint = Name "bigint"--_IntegerType_int8 = Name "int8"--_IntegerType_int16 = Name "int16"--_IntegerType_int32 = Name "int32"--_IntegerType_int64 = Name "int64"--_IntegerType_uint8 = Name "uint8"--_IntegerType_uint16 = Name "uint16"--_IntegerType_uint32 = Name "uint32"--_IntegerType_uint64 = Name "uint64"---- | An integer literal value-data IntegerValue =- -- | An arbitrary-precision integer value- IntegerValueBigint Integer |- -- | An 8-bit signed integer value- IntegerValueInt8 I.Int8 |- -- | A 16-bit signed integer value (short value)- IntegerValueInt16 I.Int16 |- -- | A 32-bit signed integer value (int value)- IntegerValueInt32 Int |- -- | A 64-bit signed integer value (long value)- IntegerValueInt64 I.Int64 |- -- | An 8-bit unsigned integer value (byte)- IntegerValueUint8 I.Int16 |- -- | A 16-bit unsigned integer value- IntegerValueUint16 Int |- -- | A 32-bit unsigned integer value (unsigned int)- IntegerValueUint32 I.Int64 |- -- | A 64-bit unsigned integer value (unsigned long)- IntegerValueUint64 Integer- deriving (Eq, Ord, Read, Show)--_IntegerValue = Name "hydra.core.IntegerValue"--_IntegerValue_bigint = Name "bigint"--_IntegerValue_int8 = Name "int8"--_IntegerValue_int16 = Name "int16"--_IntegerValue_int32 = Name "int32"--_IntegerValue_int64 = Name "int64"--_IntegerValue_uint8 = Name "uint8"--_IntegerValue_uint16 = Name "uint16"--_IntegerValue_uint32 = Name "uint32"--_IntegerValue_uint64 = Name "uint64"---- | A function abstraction (lambda)-data Lambda =- Lambda {- -- | The parameter of the lambda- lambdaParameter :: Name,- -- | An optional domain type for the lambda- lambdaDomain :: (Maybe Type),- -- | The body of the lambda- lambdaBody :: Term}- deriving (Eq, Ord, Read, Show)--_Lambda = Name "hydra.core.Lambda"--_Lambda_parameter = Name "parameter"--_Lambda_domain = Name "domain"--_Lambda_body = Name "body"---- | A set of (possibly recursive) 'let' bindings together with a body in which they are bound-data Let =- Let {- -- | The list of variable bindings- letBindings :: [Binding],- -- | The body term in which the variables are bound- letBody :: Term}- deriving (Eq, Ord, Read, Show)--_Let = Name "hydra.core.Let"--_Let_bindings = Name "bindings"--_Let_body = Name "body"---- | A term constant; an instance of a literal type-data Literal =- -- | A binary literal- LiteralBinary B.ByteString |- -- | A boolean literal- LiteralBoolean Bool |- -- | An arbitrary-precision decimal literal- LiteralDecimal Sci.Scientific |- -- | A floating-point literal- LiteralFloat FloatValue |- -- | An integer literal- LiteralInteger IntegerValue |- -- | A string literal- LiteralString String- deriving (Eq, Ord, Read, Show)--_Literal = Name "hydra.core.Literal"--_Literal_binary = Name "binary"--_Literal_boolean = Name "boolean"--_Literal_decimal = Name "decimal"--_Literal_float = Name "float"--_Literal_integer = Name "integer"--_Literal_string = Name "string"---- | Any of a fixed set of literal types, also called atomic types, base types, primitive types, or type constants-data LiteralType =- -- | The type of a binary (byte string) value- LiteralTypeBinary |- -- | The type of a boolean (true/false) value- LiteralTypeBoolean |- -- | The type of an arbitrary-precision decimal value- LiteralTypeDecimal |- -- | The type of a floating-point value- LiteralTypeFloat FloatType |- -- | The type of an integer value- LiteralTypeInteger IntegerType |- -- | The type of a string value- LiteralTypeString- deriving (Eq, Ord, Read, Show)--_LiteralType = Name "hydra.core.LiteralType"--_LiteralType_binary = Name "binary"--_LiteralType_boolean = Name "boolean"--_LiteralType_decimal = Name "decimal"--_LiteralType_float = Name "float"--_LiteralType_integer = Name "integer"--_LiteralType_string = Name "string"---- | A map type-data MapType =- MapType {- -- | The type of keys in the map- mapTypeKeys :: Type,- -- | The type of values in the map- mapTypeValues :: Type}- deriving (Eq, Ord, Read, Show)--_MapType = Name "hydra.core.MapType"--_MapType_keys = Name "keys"--_MapType_values = Name "values"---- | A unique identifier in some context; a string-valued key-newtype Name =- Name {- unName :: String}- deriving (Eq, Ord, Read, Show)--_Name = Name "hydra.core.Name"---- | A type which pairs a 'first' type and a 'second' type-data PairType =- PairType {- -- | The first component of the pair- pairTypeFirst :: Type,- -- | The second component of the pair- pairTypeSecond :: Type}- deriving (Eq, Ord, Read, Show)--_PairType = Name "hydra.core.PairType"--_PairType_first = Name "first"--_PairType_second = Name "second"---- | A record elimination; a projection-data Projection =- Projection {- -- | The name of the record type- projectionTypeName :: Name,- -- | The name of the projected field- projectionFieldName :: Name}- deriving (Eq, Ord, Read, Show)--_Projection = Name "hydra.core.Projection"--_Projection_typeName = Name "typeName"--_Projection_fieldName = Name "fieldName"---- | A record, or labeled tuple; a map of field names to terms-data Record =- Record {- -- | The name of the record type- recordTypeName :: Name,- -- | The fields of the record, as a list of name/term pairs- recordFields :: [Field]}- deriving (Eq, Ord, Read, Show)--_Record = Name "hydra.core.Record"--_Record_typeName = Name "typeName"--_Record_fields = Name "fields"---- | A data term-data Term =- -- | A term annotated with metadata- TermAnnotated AnnotatedTerm |- -- | A function application- TermApplication Application |- -- | A union elimination; a case statement- TermCases CaseStatement |- -- | An either value- TermEither (Either Term Term) |- -- | An injection; an instance of a union type- TermInject Injection |- -- | A function abstraction (lambda)- TermLambda Lambda |- -- | A 'let' term, which binds variables to terms- TermLet Let |- -- | A list- TermList [Term] |- -- | A literal value- TermLiteral Literal |- -- | A map of keys to values- TermMap (M.Map Term Term) |- -- | An optional value- TermOptional (Maybe Term) |- -- | A pair (2-tuple)- TermPair (Term, Term) |- -- | A record elimination; a projection- TermProject Projection |- -- | A record term- TermRecord Record |- -- | A set of values- TermSet (S.Set Term) |- -- | A System F type application term- TermTypeApplication TypeApplicationTerm |- -- | A System F type abstraction term- TermTypeLambda TypeLambda |- -- | A unit value; a term with no value- TermUnit |- -- | An unwrap elimination; the inverse of a wrap. Given the name of a wrapper type, unwraps an instance of that type to its underlying body value.- TermUnwrap Name |- -- | A variable reference- TermVariable Name |- -- | A wrapped term; an instance of a wrapper type (newtype)- TermWrap WrappedTerm- deriving (Eq, Ord, Read, Show)--_Term = Name "hydra.core.Term"--_Term_annotated = Name "annotated"--_Term_application = Name "application"--_Term_cases = Name "cases"--_Term_either = Name "either"--_Term_inject = Name "inject"--_Term_lambda = Name "lambda"--_Term_let = Name "let"--_Term_list = Name "list"--_Term_literal = Name "literal"--_Term_map = Name "map"--_Term_optional = Name "optional"--_Term_pair = Name "pair"--_Term_project = Name "project"--_Term_record = Name "record"--_Term_set = Name "set"--_Term_typeApplication = Name "typeApplication"--_Term_typeLambda = Name "typeLambda"--_Term_unit = Name "unit"--_Term_unwrap = Name "unwrap"--_Term_variable = Name "variable"--_Term_wrap = Name "wrap"---- | A data type-data Type =- -- | An annotated type- TypeAnnotated AnnotatedType |- -- | A type application- TypeApplication ApplicationType |- -- | An effectful computation which, when interpreted by a host application, may perform host interactions and produce a value of the given type- TypeEffect Type |- -- | An either (sum) type- TypeEither EitherType |- -- | A universally quantified (polymorphic) type- TypeForall ForallType |- -- | A function type- TypeFunction FunctionType |- -- | A list type- TypeList Type |- -- | A literal type- TypeLiteral LiteralType |- -- | A map type- TypeMap MapType |- -- | An optional type- TypeOptional Type |- -- | A pair (2-tuple) type- TypePair PairType |- -- | A record type- TypeRecord [FieldType] |- -- | A set type- TypeSet Type |- -- | A union type with field names- TypeUnion [FieldType] |- -- | The unit type — the nullary conjunction; one inhabitant. Dual to `void`.- TypeUnit |- -- | A type variable- TypeVariable Name |- -- | The void (uninhabited, or bottom) type — the nullary disjunction; zero inhabitants. Dual to `unit`.- TypeVoid |- -- | A wrapped type (newtype). There is no corresponding `unwrap` variant at the type level: wrap is the introduction form, and a wrapper type's underlying body type is given by the `wrap` variant's argument.- TypeWrap Type- deriving (Eq, Ord, Read, Show)--_Type = Name "hydra.core.Type"--_Type_annotated = Name "annotated"--_Type_application = Name "application"--_Type_effect = Name "effect"--_Type_either = Name "either"--_Type_forall = Name "forall"--_Type_function = Name "function"--_Type_list = Name "list"--_Type_literal = Name "literal"--_Type_map = Name "map"--_Type_optional = Name "optional"--_Type_pair = Name "pair"--_Type_record = Name "record"--_Type_set = Name "set"--_Type_union = Name "union"--_Type_unit = Name "unit"--_Type_variable = Name "variable"--_Type_void = Name "void"--_Type_wrap = Name "wrap"---- | A term applied to a type; a type application.-data TypeApplicationTerm =- TypeApplicationTerm {- -- | The term being applied to a type- typeApplicationTermBody :: Term,- -- | The type argument- typeApplicationTermType :: Type}- deriving (Eq, Ord, Read, Show)--_TypeApplicationTerm = Name "hydra.core.TypeApplicationTerm"--_TypeApplicationTerm_body = Name "body"--_TypeApplicationTerm_type = Name "type"---- | A type class constraint on a type variable. Currently has only one variant, but designed to be forward-compatible with multi-parameter type classes and constraints on type expressions.-data TypeClassConstraint =- -- | A simple type class constraint, naming a single type class- TypeClassConstraintSimple Name- deriving (Eq, Ord, Read, Show)--_TypeClassConstraint = Name "hydra.core.TypeClassConstraint"--_TypeClassConstraint_simple = Name "simple"---- | A System F type abstraction term-data TypeLambda =- TypeLambda {- -- | The type variable introduced by the abstraction- typeLambdaParameter :: Name,- -- | The body of the abstraction- typeLambdaBody :: Term}- deriving (Eq, Ord, Read, Show)--_TypeLambda = Name "hydra.core.TypeLambda"--_TypeLambda_parameter = Name "parameter"--_TypeLambda_body = Name "body"---- | A type expression together with free type variables occurring in the expression-data TypeScheme =- TypeScheme {- -- | The free type variables- typeSchemeVariables :: [Name],- -- | The type expression- typeSchemeBody :: Type,- -- | Constraints on type variables, including typeclass constraints. The map keys are type variable names; an empty map means no constraints.- typeSchemeConstraints :: (M.Map Name TypeVariableConstraints)}- deriving (Eq, Ord, Read, Show)--_TypeScheme = Name "hydra.core.TypeScheme"--_TypeScheme_variables = Name "variables"--_TypeScheme_body = Name "body"--_TypeScheme_constraints = Name "constraints"---- | Constraints associated with a type variable, including typeclass constraints-data TypeVariableConstraints =- TypeVariableConstraints {- -- | The typeclass constraints on this type variable- typeVariableConstraintsClasses :: (S.Set TypeClassConstraint)}- deriving (Eq, Ord, Read, Show)--_TypeVariableConstraints = Name "hydra.core.TypeVariableConstraints"--_TypeVariableConstraints_classes = Name "classes"---- | A term wrapped in a type name-data WrappedTerm =- WrappedTerm {- -- | The name of the wrapper type- wrappedTermTypeName :: Name,- -- | The wrapped term- wrappedTermBody :: Term}- deriving (Eq, Ord, Read, Show)--_WrappedTerm = Name "hydra.core.WrappedTerm"--_WrappedTerm_typeName = Name "typeName"--_WrappedTerm_body = Name "body"
@@ -0,0 +1,825 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Simple, one-way adapters for types and terms++module Hydra.Core.Adapt where++import qualified Hydra.Core.Annotations as Annotations+import qualified Hydra.Core.Ast as Ast+import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Dependencies as Dependencies+import qualified Hydra.Core.Diff as Diff+import qualified Hydra.Core.Docs as Docs+import qualified Hydra.Core.Environment as Environment+import qualified Hydra.Core.Error.Checking as Checking+import qualified Hydra.Core.Error.File as ErrorFile+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Error.Packaging as ErrorPackaging+import qualified Hydra.Core.Error.System as ErrorSystem+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Hoisting as Hoisting+import qualified Hydra.Core.Inference as Inference+import qualified Hydra.Core.Json.Model as JsonModel+import qualified Hydra.Core.Lexical as Lexical+import qualified Hydra.Core.Overlay.Haskell.Lib.Eithers as Eithers+import qualified Hydra.Core.Overlay.Haskell.Lib.Equality as Equality+import qualified Hydra.Core.Overlay.Haskell.Lib.Functions as Functions+import qualified Hydra.Core.Overlay.Haskell.Lib.Lists as Lists+import qualified Hydra.Core.Overlay.Haskell.Lib.Literals as LibLiterals+import qualified Hydra.Core.Overlay.Haskell.Lib.Logic as Logic+import qualified Hydra.Core.Overlay.Haskell.Lib.Maps as Maps+import qualified Hydra.Core.Overlay.Haskell.Lib.Optionals as Optionals+import qualified Hydra.Core.Overlay.Haskell.Lib.Pairs as Pairs+import qualified Hydra.Core.Overlay.Haskell.Lib.Sets as Sets+import qualified Hydra.Core.Overlay.Haskell.Lib.Strings as Strings+import qualified Hydra.Core.Literals as Literals+import qualified Hydra.Core.Markdown as Markdown+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Names as Names+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Parsing as Parsing+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Print.Errors as PrintErrors+import qualified Hydra.Core.Print.Graph as PrintGraph+import qualified Hydra.Core.Print.Model as PrintModel+import qualified Hydra.Core.Query as Query+import qualified Hydra.Core.Reduction as Reduction+import qualified Hydra.Core.Reflect as Reflect+import qualified Hydra.Core.Regex as Regex+import qualified Hydra.Core.Relational as Relational+import qualified Hydra.Core.Resolution as Resolution+import qualified Hydra.Core.Rewriting as Rewriting+import qualified Hydra.Core.Scoping as Scoping+import qualified Hydra.Core.Strip as Strip+import qualified Hydra.Core.System as System+import qualified Hydra.Core.Tabular as Tabular+import qualified Hydra.Core.Testing as Testing+import qualified Hydra.Core.Time as Time+import qualified Hydra.Core.Topology as Topology+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Validation as Validation+import qualified Hydra.Core.Variables as Variables+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void+import qualified Data.Map as M+import qualified Data.Set as S++-- | Adapt a graph and its schema to the given language constraints. The doExpand flag controls eta expansion of partial applications. Adaptation is type-preserving: binding-level TypeSchemes are adapted (not stripped). Note: case statement hoisting is done separately, prior to adaptation. The els0 parameter provides the original ordered bindings. Returns both the adapted graph and the ordered adapted bindings.+adaptDataGraph :: Coders.LanguageConstraints -> Bool -> [Model.Binding] -> t0 -> Graph.Graph -> Either Errors.Error (Graph.Graph, [Model.Binding])+adaptDataGraph constraints doExpand els0 cx graph0 =++ let transformTerm =+ \g -> \term ->+ let tx = g+ t1 = Variables.unshadowVariables (pushTypeAppsInward term)+ t2 = Variables.unshadowVariables (Logic.ifElse doExpand (pushTypeAppsInward (Reduction.etaExpandTerm tx t1)) t1)+ in (Dependencies.liftLambdaAboveLet t2)+ transformBinding =+ \g -> \el -> Model.Binding {+ Model.bindingName = (Model.bindingName el),+ Model.bindingTerm = (transformTerm g (Model.bindingTerm el)),+ Model.bindingTypeScheme = (Model.bindingTypeScheme el)}+ litmap = adaptLiteralTypesMap constraints+ prims0 = Graph.graphPrimitives graph0+ schemaTypes0 = Graph.graphSchemaTypes graph0+ schemaBindings = Environment.typesToDefinitions (Maps.map (\ts -> Scoping.typeSchemeToFType ts) schemaTypes0)+ in (Eithers.bind (Logic.ifElse (Maps.isEmpty schemaTypes0) (Right Maps.empty) (Eithers.bind (Eithers.bimap (\e -> Errors.ErrorDecoding e) (\x -> x) (Environment.graphAsTypes graph0 schemaBindings)) (\tmap0 -> Eithers.bind (adaptGraphSchema constraints litmap tmap0) (\tmap1 -> Right (Maps.map (\t -> Resolution.typeToTypeScheme t) tmap1))))) (\schemaResult ->+ let adaptedSchemaTypes = schemaResult+ adaptBinding =+ \el ->+ let transformed = transformBinding graph0 el+ wrapped =+ Model.TermLet (Model.Let {+ Model.letBindings = (Lists.singleton transformed),+ Model.letBody = Model.TermUnit})+ in (Eithers.bind (adaptTerm constraints litmap cx graph0 wrapped) (\adapted -> Rewriting.rewriteTermM (adaptLambdaDomains constraints litmap) adapted))+ in (Eithers.bind (Eithers.mapList adaptBinding els0) (\adaptedTerms ->+ let els1Raw = Lists.concat (Lists.map Environment.termAsBindings adaptedTerms)+ processBinding =+ \el -> Eithers.bind (Rewriting.rewriteTermM (adaptNestedTypes constraints litmap) (Model.bindingTerm el)) (\newTerm -> Eithers.bind (Optionals.match (Model.bindingTypeScheme el) (Right Nothing) (\ts -> Eithers.bind (adaptTypeScheme constraints litmap ts) (\ts1 -> Right (Just ts1)))) (\adaptedType -> Right (Model.Binding {+ Model.bindingName = (Model.bindingName el),+ Model.bindingTerm = newTerm,+ Model.bindingTypeScheme = adaptedType})))+ in (Eithers.bind (Eithers.mapList processBinding els1Raw) (\els1 -> Eithers.bind (Eithers.mapList (\kv -> Eithers.bind (adaptPrimitive constraints litmap (Pairs.second kv)) (\prim1 -> Right (Pairs.first kv, prim1))) (Maps.toList prims0)) (\primPairs ->+ let prims1 = Maps.fromList primPairs+ adaptedGraphRaw = Lexical.buildGraph els1 Maps.empty prims1+ adaptedGraph =+ Graph.Graph {+ Graph.graphBoundTerms = (Graph.graphBoundTerms adaptedGraphRaw),+ Graph.graphBoundTypes = (Graph.graphBoundTypes adaptedGraphRaw),+ Graph.graphClassConstraints = (Graph.graphClassConstraints adaptedGraphRaw),+ Graph.graphLambdaVariables = (Graph.graphLambdaVariables adaptedGraphRaw),+ Graph.graphMetadata = (Graph.graphMetadata adaptedGraphRaw),+ Graph.graphPrimitives = (Graph.graphPrimitives adaptedGraphRaw),+ Graph.graphSchemaTypes = adaptedSchemaTypes,+ Graph.graphTypeVariables = (Graph.graphTypeVariables adaptedGraphRaw)}+ in (Right (adaptedGraph, els1)))))))))++-- | Attempt to adapt a floating-point type using the given language constraints+adaptFloatType :: Coders.LanguageConstraints -> Model.FloatType -> Maybe Model.FloatType+adaptFloatType constraints ft =++ let supported = Sets.member ft (Coders.languageConstraintsFloatTypes constraints)+ alt = adaptFloatType constraints+ forUnsupported =+ \ft2 -> case ft2 of+ Model.FloatTypeFloat32 -> alt Model.FloatTypeFloat64+ Model.FloatTypeFloat64 -> alt Model.FloatTypeFloat32+ in (Logic.ifElse supported (Just ft) (forUnsupported ft))++-- | Adapt a schema graph to the given language constraints+adaptGraphSchema :: Ord t0 => (Coders.LanguageConstraints -> M.Map Model.LiteralType Model.LiteralType -> M.Map t0 Model.Type -> Either Errors.Error (M.Map t0 Model.Type))+adaptGraphSchema constraints litmap types0 =++ let mapPair =+ \pair ->+ let name = Pairs.first pair+ typ = Pairs.second pair+ in (Eithers.bind (adaptType constraints litmap typ) (\typ1 -> Right (name, typ1)))+ in (Eithers.bind (Eithers.mapList mapPair (Maps.toList types0)) (\pairs -> Right (Maps.fromList pairs)))++-- | Attempt to adapt an integer type using the given language constraints+adaptIntegerType :: Coders.LanguageConstraints -> Model.IntegerType -> Maybe Model.IntegerType+adaptIntegerType constraints it =++ let supported = Sets.member it (Coders.languageConstraintsIntegerTypes constraints)+ alt = adaptIntegerType constraints+ forUnsupported =+ \it2 -> case it2 of+ Model.IntegerTypeBigint -> Nothing+ Model.IntegerTypeInt8 -> alt Model.IntegerTypeUint16+ Model.IntegerTypeInt16 -> alt Model.IntegerTypeUint32+ Model.IntegerTypeInt32 -> alt Model.IntegerTypeUint64+ Model.IntegerTypeInt64 -> alt Model.IntegerTypeBigint+ Model.IntegerTypeUint8 -> alt Model.IntegerTypeInt16+ Model.IntegerTypeUint16 -> alt Model.IntegerTypeInt32+ Model.IntegerTypeUint32 -> alt Model.IntegerTypeInt64+ Model.IntegerTypeUint64 -> alt Model.IntegerTypeBigint+ in (Logic.ifElse supported (Just it) (forUnsupported it))++-- | Rewrite callback for adapting lambda domain types in a term+adaptLambdaDomains :: Coders.LanguageConstraints -> M.Map Model.LiteralType Model.LiteralType -> (t0 -> Either Errors.Error Model.Term) -> t0 -> Either Errors.Error Model.Term+adaptLambdaDomains constraints litmap recurse term =+ Eithers.bind (recurse term) (\rewritten -> case rewritten of+ Model.TermLambda v0 -> Eithers.bind (Optionals.match (Model.lambdaDomain v0) (Right Nothing) (\dom -> Eithers.bind (adaptType constraints litmap dom) (\dom1 -> Right (Just dom1)))) (\adaptedDomain -> Right (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.lambdaParameter v0),+ Model.lambdaDomain = adaptedDomain,+ Model.lambdaBody = (Model.lambdaBody v0)})))+ _ -> Right rewritten)++-- | Convert a literal to a different type+adaptLiteral :: Model.LiteralType -> Model.Literal -> Model.Literal+adaptLiteral lt l =+ case l of+ Model.LiteralBinary v0 -> case lt of+ Model.LiteralTypeString -> Model.LiteralString (LibLiterals.binaryToBase64 v0)+ Model.LiteralBoolean v0 -> case lt of+ Model.LiteralTypeInteger v1 -> Model.LiteralInteger (Literals.bigintToIntegerValue v1 (Logic.ifElse v0 1 0))+ Model.LiteralDecimal v0 -> case lt of+ Model.LiteralTypeFloat _ -> Model.LiteralFloat (Model.FloatValueFloat64 (LibLiterals.decimalToFloat64 v0))+ Model.LiteralTypeString -> Model.LiteralString (LibLiterals.printDecimal v0)+ Model.LiteralFloat v0 -> case lt of+ Model.LiteralTypeFloat v1 -> Model.LiteralFloat (case v1 of+ Model.FloatTypeFloat32 -> Model.FloatValueFloat32 (case v0 of+ Model.FloatValueFloat32 v3 -> v3+ Model.FloatValueFloat64 v3 -> LibLiterals.float64ToFloat32 v3)+ Model.FloatTypeFloat64 -> Model.FloatValueFloat64 (case v0 of+ Model.FloatValueFloat32 v3 -> LibLiterals.float32ToFloat64 v3+ Model.FloatValueFloat64 v3 -> v3))+ Model.LiteralInteger v0 -> case lt of+ Model.LiteralTypeInteger v1 -> Model.LiteralInteger (Literals.bigintToIntegerValue v1 (Literals.integerValueToBigint v0))++-- | Attempt to adapt a literal type using the given language constraints+adaptLiteralType :: Coders.LanguageConstraints -> Model.LiteralType -> Maybe Model.LiteralType+adaptLiteralType constraints lt =++ let forUnsupported =+ \lt2 -> case lt2 of+ Model.LiteralTypeBinary -> Just Model.LiteralTypeString+ Model.LiteralTypeBoolean -> Optionals.map (\x -> Model.LiteralTypeInteger x) (adaptIntegerType constraints Model.IntegerTypeInt8)+ Model.LiteralTypeDecimal -> Just (Model.LiteralTypeFloat Model.FloatTypeFloat64)+ Model.LiteralTypeFloat v0 -> Optionals.map (\x -> Model.LiteralTypeFloat x) (adaptFloatType constraints v0)+ Model.LiteralTypeInteger v0 -> Optionals.map (\x -> Model.LiteralTypeInteger x) (adaptIntegerType constraints v0)+ _ -> Nothing+ in (Logic.ifElse (literalTypeSupported constraints lt) Nothing (forUnsupported lt))++-- | Derive a map of adapted literal types for the given language constraints+adaptLiteralTypesMap :: Coders.LanguageConstraints -> M.Map Model.LiteralType Model.LiteralType+adaptLiteralTypesMap constraints =++ let tryType = \lt -> Optionals.match (adaptLiteralType constraints lt) Nothing (\lt2 -> Just (lt, lt2))+ in (Maps.fromList (Optionals.givens (Lists.map tryType Reflect.literalTypes)))++-- | Adapt a literal value using the given language constraints+adaptLiteralValue :: Ord t0 => (M.Map t0 Model.LiteralType -> t0 -> Model.Literal -> Model.Literal)+adaptLiteralValue litmap lt l =+ Optionals.match (Maps.lookup lt litmap) (Model.LiteralString (PrintModel.literal l)) (\lt2 -> adaptLiteral lt2 l)++-- | Rewrite callback for adapting nested let binding TypeSchemes in a term+adaptNestedTypes :: Coders.LanguageConstraints -> M.Map Model.LiteralType Model.LiteralType -> (t0 -> Either Errors.Error Model.Term) -> t0 -> Either Errors.Error Model.Term+adaptNestedTypes constraints litmap recurse term =+ Eithers.bind (recurse term) (\rewritten -> case rewritten of+ Model.TermLet v0 ->+ let adaptB =+ \b -> Eithers.bind (Optionals.match (Model.bindingTypeScheme b) (Right Nothing) (\ts -> Eithers.bind (adaptTypeScheme constraints litmap ts) (\ts1 -> Right (Just ts1)))) (\adaptedBType -> Right (Model.Binding {+ Model.bindingName = (Model.bindingName b),+ Model.bindingTerm = (Model.bindingTerm b),+ Model.bindingTypeScheme = adaptedBType}))+ in (Eithers.bind (Eithers.mapList adaptB (Model.letBindings v0)) (\adaptedBindings -> Right (Model.TermLet (Model.Let {+ Model.letBindings = adaptedBindings,+ Model.letBody = (Model.letBody v0)}))))+ _ -> Right rewritten)++-- | Adapt a primitive to the given language constraints, prior to inference+adaptPrimitive :: Coders.LanguageConstraints -> M.Map Model.LiteralType Model.LiteralType -> Graph.Primitive -> Either Errors.Error Graph.Primitive+adaptPrimitive constraints litmap prim0 =++ let def0 = Graph.primitiveDefinition prim0+ in (Eithers.bind (adaptTermSignature constraints litmap (Packaging.primitiveDefinitionSignature def0)) (\sig1 ->+ let def1 =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Packaging.primitiveDefinitionName def0),+ Packaging.primitiveDefinitionMetadata = (Packaging.primitiveDefinitionMetadata def0),+ Packaging.primitiveDefinitionSignature = sig1,+ Packaging.primitiveDefinitionIsPure = (Packaging.primitiveDefinitionIsPure def0),+ Packaging.primitiveDefinitionIsTotal = (Packaging.primitiveDefinitionIsTotal def0),+ Packaging.primitiveDefinitionDefaultImplementation = (Packaging.primitiveDefinitionDefaultImplementation def0)}+ in (Right (Graph.Primitive {+ Graph.primitiveDefinition = def1,+ Graph.primitiveImplementation = (Graph.primitiveImplementation prim0)}))))++-- | Adapt a term using the given language constraints+adaptTerm :: Coders.LanguageConstraints -> M.Map Model.LiteralType Model.LiteralType -> t0 -> Graph.Graph -> Model.Term -> Either Errors.Error Model.Term+adaptTerm constraints litmap cx graph term0 =++ let rewrite =+ \recurse -> \term02 ->+ let forSupported =+ \term -> case term of+ Model.TermLiteral v0 ->+ let lt = Reflect.literalType v0+ in (Right (Just (Logic.ifElse (literalTypeSupported constraints lt) term (Model.TermLiteral (adaptLiteralValue litmap lt v0)))))+ _ -> Right (Just term)+ forUnsupported =+ \term ->+ let tryAlts =+ \alts -> Optionals.match (Lists.uncons alts) (Right Nothing) (\uc -> Eithers.bind (tryTerm (Pairs.first uc)) (\mterm -> Optionals.match mterm (tryAlts (Pairs.second uc)) (\t -> Right (Just t))))+ in (Eithers.bind (termAlternatives cx graph term) (\alts0 -> tryAlts alts0))+ tryTerm =+ \term ->+ let supportedVariant = Sets.member (Reflect.termVariant term) (Coders.languageConstraintsTermVariants constraints)+ in (Logic.ifElse supportedVariant (forSupported term) (forUnsupported term))+ in (Eithers.bind (recurse term02) (\term1 -> case term1 of+ Model.TermAnnotated _ -> Right term1+ Model.TermTypeApplication v0 -> Eithers.bind (adaptType constraints litmap (Model.typeApplicationTermType v0)) (\atyp -> Right (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.typeApplicationTermBody v0),+ Model.typeApplicationTermType = atyp})))+ Model.TermTypeLambda _ -> Right term1+ _ -> Eithers.bind (tryTerm term1) (\mterm -> Optionals.match mterm (Left (Errors.ErrorOther (Errors.OtherError (Strings.concat2 "no alternatives for term: " (PrintModel.term term1))))) (\term2 -> Right term2))))+ in (Rewriting.rewriteTermM rewrite term0)++-- | Adapt a term using the constraints of a given language+adaptTermForLanguage :: Coders.Language -> t0 -> Graph.Graph -> Model.Term -> Either Errors.Error Model.Term+adaptTermForLanguage lang cx g term =++ let constraints = Coders.languageConstraints lang+ litmap = adaptLiteralTypesMap constraints+ in (adaptTerm constraints litmap cx g term)++-- | Adapt the types within a term signature to the given language constraints, in place. Parameter names, descriptions, and per-parameter isLazy flags, as well as type parameters, are preserved; only the parameter and result types are adapted. Unlike routing through TypeScheme (the type-only view), this retains the full TermSignature metadata, including primitive laziness flags.+adaptTermSignature :: Coders.LanguageConstraints -> M.Map Model.LiteralType Model.LiteralType -> Typing.TermSignature -> Either Errors.Error Typing.TermSignature+adaptTermSignature constraints litmap sig0 =++ let result0 = Typing.termSignatureResult sig0+ in (Eithers.bind (adaptType constraints litmap (Typing.resultType result0)) (\resultType1 -> Eithers.bind (Eithers.mapList (\p -> Eithers.map (\ty1 -> Typing.Parameter {+ Typing.parameterName = (Typing.parameterName p),+ Typing.parameterDescription = (Typing.parameterDescription p),+ Typing.parameterType = ty1,+ Typing.parameterIsLazy = (Typing.parameterIsLazy p)}) (adaptType constraints litmap (Typing.parameterType p))) (Typing.termSignatureParameters sig0)) (\params1 -> Right (Typing.TermSignature {+ Typing.termSignatureTypeParameters = (Typing.termSignatureTypeParameters sig0),+ Typing.termSignatureParameters = params1,+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = (Typing.resultDescription result0),+ Typing.resultType = resultType1}}))))++-- | Adapt a type using the given language constraints+adaptType :: Coders.LanguageConstraints -> M.Map Model.LiteralType Model.LiteralType -> Model.Type -> Either Errors.Error Model.Type+adaptType constraints litmap type0 =++ let forSupported =+ \typ -> case typ of+ Model.TypeLiteral v0 -> Logic.ifElse (literalTypeSupported constraints v0) (Just typ) (Optionals.match (Maps.lookup v0 litmap) (Just (Model.TypeLiteral Model.LiteralTypeString)) (\lt2 -> Just (Model.TypeLiteral lt2)))+ _ -> Just typ+ forUnsupported =+ \typ ->+ let tryAlts =+ \alts -> Optionals.bind (Lists.uncons alts) (\uc -> Optionals.match (tryType (Pairs.first uc)) (tryAlts (Pairs.second uc)) (\t -> Just t))+ alts0 = typeAlternatives typ+ in (tryAlts alts0)+ tryType =+ \typ ->+ let supportedVariant = Sets.member (Reflect.typeVariant typ) (Coders.languageConstraintsTypeVariants constraints)+ in (Logic.ifElse supportedVariant (forSupported typ) (forUnsupported typ))+ rewrite =+ \recurse -> \typ -> Eithers.bind (recurse typ) (\type1 -> Optionals.match (tryType type1) (Left (Errors.ErrorOther (Errors.OtherError (Strings.concat2 "no alternatives for type: " (PrintModel.type_ typ))))) (\type2 -> Right type2))+ in (Rewriting.rewriteTypeM rewrite type0)++-- | Adapt a type using the constraints of a given language+adaptTypeForLanguage :: Coders.Language -> Model.Type -> Either Errors.Error Model.Type+adaptTypeForLanguage lang typ =++ let constraints = Coders.languageConstraints lang+ litmap = adaptLiteralTypesMap constraints+ in (adaptType constraints litmap typ)++-- | Adapt a type scheme to the given language constraints, prior to inference+adaptTypeScheme :: Coders.LanguageConstraints -> M.Map Model.LiteralType Model.LiteralType -> Model.TypeScheme -> Either Errors.Error Model.TypeScheme+adaptTypeScheme constraints litmap ts0 =++ let vars0 = Model.typeSchemeVariables ts0+ t0 = Model.typeSchemeBody ts0+ in (Eithers.bind (adaptType constraints litmap t0) (\t1 -> Right (Model.TypeScheme {+ Model.typeSchemeVariables = vars0,+ Model.typeSchemeBody = t1,+ Model.typeSchemeConstraints = (Model.typeSchemeConstraints ts0)})))++-- | Compose two coders into a single coder+composeCoders :: Coders.Coder t0 t1 t2 -> Coders.Coder t1 t3 t2 -> Coders.Coder t0 t3 t2+composeCoders c1 c2 =+ Coders.Coder {+ Coders.coderEncode = (\a -> Eithers.bind (Coders.coderEncode c1 a) (\b1 -> Coders.coderEncode c2 b1)),+ Coders.coderDecode = (\c -> Eithers.bind (Coders.coderDecode c2 c) (\b2 -> Coders.coderDecode c1 b2))}++-- | Given a data graph along with language constraints, original ordered bindings, and a designated list of namespaces, adapt the graph to the language constraints, then return the processed graph along with term definitions grouped by namespace (in the order of the input namespaces). Inference is performed before adaptation if bindings lack type annotations. Hoisting must preserve type schemes; if any binding loses its type scheme after hoisting, the pipeline fails. Adaptation preserves type application/lambda wrappers and adapts embedded types. Post-adaptation inference is performed to ensure binding TypeSchemes are fully consistent. The doExpand flag controls eta expansion. The doHoistCaseStatements flag controls case statement hoisting (needed for Python). The doHoistPolymorphicLetBindings flag controls polymorphic let binding hoisting (needed for Java). The originalBindings parameter provides the original ordered bindings (from module elements).+dataGraphToDefinitions :: Coders.LanguageConstraints -> Bool -> Bool -> Bool -> Bool -> [Model.Binding] -> Graph.Graph -> [Packaging.ModuleName] -> Typing.InferenceContext -> Either Errors.Error (Graph.Graph, [[Packaging.TermDefinition]])+dataGraphToDefinitions constraints doInfer doExpand doHoistCaseStatements doHoistPolymorphicLetBindings originalBindings graph0 namespaces cx =++ let namespacesSet = Sets.fromList namespaces+ isParentBinding =+ \b -> Optionals.match (Names.moduleNameOf (Model.bindingName b)) False (\ns -> Sets.member ns namespacesSet)+ hoistCases =+ \bindings ->+ let stripped =+ Lists.map (\b -> Model.Binding {+ Model.bindingName = (Model.bindingName b),+ Model.bindingTerm = (Strip.stripTypeLambdas (Model.bindingTerm b)),+ Model.bindingTypeScheme = (Model.bindingTypeScheme b)}) bindings+ term0 =+ Model.TermLet (Model.Let {+ Model.letBindings = stripped,+ Model.letBody = Model.TermUnit})+ unshadowed0 = Environment.termAsBindings (Variables.unshadowVariables term0)+ hoisted = Hoisting.hoistCaseStatementsInGraph unshadowed0+ term1 =+ Model.TermLet (Model.Let {+ Model.letBindings = hoisted,+ Model.letBody = Model.TermUnit})+ in (Environment.termAsBindings (Variables.unshadowVariables term1))+ hoistPoly =+ \bindings ->+ let letBefore =+ Model.Let {+ Model.letBindings = bindings,+ Model.letBody = Model.TermUnit}+ letAfter = Hoisting.hoistPolymorphicLetBindings isParentBinding letBefore+ in (Model.letBindings letAfter)+ qualifyUntyped =+ \b ->+ let nm = Model.unName (Model.bindingName b)+ in (Optionals.match (Names.moduleNameOf (Model.bindingName b)) (Strings.concat2 "(no module) " nm) (\ns -> Strings.concat [+ Packaging.unModuleName ns,+ " :: ",+ nm]))+ checkBindingsTyped =+ \debugLabel -> \bindings ->+ let untypedBindings =+ Lists.map qualifyUntyped (Lists.filter (\b -> Logic.not (Optionals.isGiven (Model.bindingTypeScheme b))) bindings)+ in (Logic.ifElse (Lists.isEmpty untypedBindings) (Right bindings) (Left (Errors.ErrorOther (Errors.OtherError (Strings.concat [+ "Found ",+ (LibLiterals.printInt32 (Lists.length untypedBindings)),+ " untyped binding(s) (",+ debugLabel,+ "); each must carry a type scheme at this stage. ",+ "This usually means stale dist/json field shapes after a kernel record rename ",+ "(regenerate the affected package's JSON). Offending bindings (module :: name): ",+ (Strings.join ", " untypedBindings)])))))+ normalizeBindings =+ \bindings -> Lists.map (\b -> Model.Binding {+ Model.bindingName = (Model.bindingName b),+ Model.bindingTerm = (pushTypeAppsInward (Model.bindingTerm b)),+ Model.bindingTypeScheme = (Model.bindingTypeScheme b)}) bindings+ rebuildGraph =+ \bindings ->+ let g = Lexical.buildGraph bindings Maps.empty (Graph.graphPrimitives graph0)+ in Graph.Graph {+ Graph.graphBoundTerms = (Graph.graphBoundTerms g),+ Graph.graphBoundTypes = (Graph.graphBoundTypes g),+ Graph.graphClassConstraints = (Graph.graphClassConstraints g),+ Graph.graphLambdaVariables = (Graph.graphLambdaVariables g),+ Graph.graphMetadata = (Graph.graphMetadata g),+ Graph.graphPrimitives = (Graph.graphPrimitives g),+ Graph.graphSchemaTypes = (Graph.graphSchemaTypes graph0),+ Graph.graphTypeVariables = (Graph.graphTypeVariables g)}+ bins0 = originalBindings+ bins1 = Logic.ifElse doHoistCaseStatements (hoistCases bins0) bins0+ in (Eithers.bind (Logic.ifElse doInfer (Eithers.map (\result -> Pairs.second (Pairs.first result)) (Inference.inferGraphTypes cx bins1 (rebuildGraph bins1))) (checkBindingsTyped "after case hoisting" bins1)) (\bins2 -> Eithers.bind (Logic.ifElse doHoistPolymorphicLetBindings (checkBindingsTyped "after let hoisting" (hoistPoly bins2)) (Right bins2)) (\bins3 -> Eithers.bind (adaptDataGraph constraints doExpand bins3 cx (rebuildGraph bins3)) (\adaptResult ->+ let adapted = Pairs.first adaptResult+ adaptedBindings = Pairs.second adaptResult+ in (Eithers.bind (checkBindingsTyped "after adaptation" adaptedBindings) (\bins4 ->+ let bins5Raw = normalizeBindings bins4+ peelOne =+ \t -> case t of+ Model.TermTypeLambda v0 -> Model.typeLambdaBody v0+ Model.TermTypeApplication v0 -> Model.typeApplicationTermBody v0+ _ -> t+ extractAnn =+ \t -> case t of+ Model.TermAnnotated v0 -> Just (Model.annotatedTermAnnotation v0)+ _ -> Nothing+ findAnn =+ \t ->+ let t1 = peelOne t+ t2 = peelOne t1+ t3 = peelOne t2+ in (Optionals.match (extractAnn t) (Optionals.match (extractAnn t1) (Optionals.match (extractAnn t2) (extractAnn t3) (\a -> Just a)) (\a -> Just a)) (\a -> Just a))+ originalAnnotations =+ Maps.fromList (Optionals.givens (Lists.map (\b -> Optionals.match (findAnn (Model.bindingTerm b)) Nothing (\ann -> Just (Model.bindingName b, ann))) originalBindings))+ reattachAnnotation =+ \b -> Optionals.match (Maps.lookup (Model.bindingName b) originalAnnotations) b (\ann -> Model.Binding {+ Model.bindingName = (Model.bindingName b),+ Model.bindingTerm = case (Model.bindingTerm b) of+ Model.TermAnnotated v0 -> Model.TermAnnotated (Model.AnnotatedTerm {+ Model.annotatedTermBody = (Model.annotatedTermBody v0),+ Model.annotatedTermAnnotation = (Annotations.wrapAnnotationMap (Maps.union (Annotations.getAnnotationMap (Model.annotatedTermAnnotation v0)) (Annotations.getAnnotationMap ann)))})+ _ -> Model.TermAnnotated (Model.AnnotatedTerm {+ Model.annotatedTermBody = (Model.bindingTerm b),+ Model.annotatedTermAnnotation = ann}),+ Model.bindingTypeScheme = (Model.bindingTypeScheme b)})+ bins5 = Lists.map reattachAnnotation bins5Raw+ toDef =+ \el -> Optionals.map (\ts -> Packaging.TermDefinition {+ Packaging.termDefinitionName = (Model.bindingName el),+ Packaging.termDefinitionMetadata = Nothing,+ Packaging.termDefinitionSignature = (Just (Scoping.typeSchemeToTermSignature ts)),+ Packaging.termDefinitionBody = (Model.bindingTerm el)}) (Model.bindingTypeScheme el)+ selectedElements =+ Lists.filter (\el -> Optionals.match (Names.moduleNameOf (Model.bindingName el)) False (\ns -> Sets.member ns namespacesSet)) bins5+ elementsByNamespace =+ Lists.foldl (\acc -> \el -> Optionals.match (Names.moduleNameOf (Model.bindingName el)) acc (\ns ->+ let existing = Optionals.match (Maps.lookup ns acc) [] Functions.identity+ in (Maps.insert ns (Lists.concat2 existing [+ el]) acc))) Maps.empty selectedElements+ defsGrouped =+ Lists.map (\ns ->+ let elsForNs = Optionals.match (Maps.lookup ns elementsByNamespace) [] Functions.identity+ in (Optionals.givens (Lists.map toDef elsForNs))) namespaces+ g = Lexical.buildGraph bins5 Maps.empty (Graph.graphPrimitives adapted)+ in (Right (+ Graph.Graph {+ Graph.graphBoundTerms = (Graph.graphBoundTerms g),+ Graph.graphBoundTypes = (Graph.graphBoundTypes g),+ Graph.graphClassConstraints = (Graph.graphClassConstraints g),+ Graph.graphLambdaVariables = (Graph.graphLambdaVariables g),+ Graph.graphMetadata = (Graph.graphMetadata g),+ Graph.graphPrimitives = (Graph.graphPrimitives g),+ Graph.graphSchemaTypes = (Graph.graphSchemaTypes adapted),+ Graph.graphTypeVariables = (Graph.graphTypeVariables g)},+ defsGrouped))))))))++-- | Check if a literal type is supported by the given language constraints+literalTypeSupported :: Coders.LanguageConstraints -> Model.LiteralType -> Bool+literalTypeSupported constraints lt =++ let forType =+ \lt2 -> case lt2 of+ Model.LiteralTypeFloat v0 -> Sets.member v0 (Coders.languageConstraintsFloatTypes constraints)+ Model.LiteralTypeInteger v0 -> Sets.member v0 (Coders.languageConstraintsIntegerTypes constraints)+ _ -> True+ in (Logic.ifElse (Sets.member (Reflect.literalTypeVariant lt) (Coders.languageConstraintsLiteralVariants constraints)) (forType lt) False)++-- | Prepare a float type, substituting unsupported types+prepareFloatType :: Ord t0 => (Model.FloatType -> (Model.FloatType, ((Model.FloatValue -> Model.FloatValue), (S.Set t0))))+prepareFloatType ft =+ case ft of+ Model.FloatTypeFloat32 -> (+ Model.FloatTypeFloat32,+ (+ (\v -> case v of+ Model.FloatValueFloat32 v1 -> Model.FloatValueFloat32 v1+ _ -> v),+ Sets.empty))+ Model.FloatTypeFloat64 -> (+ Model.FloatTypeFloat64,+ (+ (\v -> case v of+ Model.FloatValueFloat64 v1 -> Model.FloatValueFloat64 v1+ _ -> v),+ Sets.empty))++-- | Prepare an integer type, substituting unsupported types+prepareIntegerType :: Model.IntegerType -> (Model.IntegerType, ((Model.IntegerValue -> Model.IntegerValue), (S.Set String)))+prepareIntegerType it =+ case it of+ Model.IntegerTypeBigint -> (+ Model.IntegerTypeInt64,+ (+ (\v -> case v of+ Model.IntegerValueBigint v1 -> Model.IntegerValueInt64 (LibLiterals.bigintToInt64 v1)+ _ -> v),+ (Sets.fromList [+ "replace arbitrary-precision integers with 64-bit integers"])))+ Model.IntegerTypeUint8 -> (+ Model.IntegerTypeInt8,+ (+ (\v -> case v of+ Model.IntegerValueUint8 v1 -> Model.IntegerValueInt8 (LibLiterals.bigintToInt8 (LibLiterals.uint8ToBigint v1))+ _ -> v),+ (Sets.fromList [+ "replace unsigned 8-bit integers with signed 8-bit integers"])))+ Model.IntegerTypeUint32 -> (+ Model.IntegerTypeInt32,+ (+ (\v -> case v of+ Model.IntegerValueUint32 v1 -> Model.IntegerValueInt32 (LibLiterals.bigintToInt32 (LibLiterals.uint32ToBigint v1))+ _ -> v),+ (Sets.fromList [+ "replace unsigned 32-bit integers with signed 32-bit integers"])))+ Model.IntegerTypeUint64 -> (+ Model.IntegerTypeInt64,+ (+ (\v -> case v of+ Model.IntegerValueUint64 v1 -> Model.IntegerValueInt64 (LibLiterals.bigintToInt64 (LibLiterals.uint64ToBigint v1))+ _ -> v),+ (Sets.fromList [+ "replace unsigned 64-bit integers with signed 64-bit integers"])))+ _ -> prepareSame it++-- | Prepare a literal type, substituting unsupported types+prepareLiteralType :: Model.LiteralType -> (Model.LiteralType, ((Model.Literal -> Model.Literal), (S.Set String)))+prepareLiteralType at =+ case at of+ Model.LiteralTypeBinary -> (+ Model.LiteralTypeString,+ (+ (\v -> case v of+ Model.LiteralBinary v1 -> Model.LiteralString (LibLiterals.binaryToBase64 v1)+ _ -> v),+ (Sets.fromList [+ "replace binary strings with character strings"])))+ Model.LiteralTypeDecimal -> (+ Model.LiteralTypeFloat Model.FloatTypeFloat64,+ (+ (\v -> case v of+ Model.LiteralDecimal v1 -> Model.LiteralFloat (Model.FloatValueFloat64 (LibLiterals.decimalToFloat64 v1))+ _ -> v),+ (Sets.fromList [+ "replace arbitrary-precision decimal numbers with 64-bit floating-point numbers (doubles)"])))+ Model.LiteralTypeFloat v0 ->+ let result = prepareFloatType v0+ rtyp = Pairs.first result+ rep = Pairs.first (Pairs.second result)+ msgs = Pairs.second (Pairs.second result)+ in (+ Model.LiteralTypeFloat rtyp,+ (+ (\v -> case v of+ Model.LiteralFloat v1 -> Model.LiteralFloat (rep v1)+ _ -> v),+ msgs))+ Model.LiteralTypeInteger v0 ->+ let result = prepareIntegerType v0+ rtyp = Pairs.first result+ rep = Pairs.first (Pairs.second result)+ msgs = Pairs.second (Pairs.second result)+ in (+ Model.LiteralTypeInteger rtyp,+ (+ (\v -> case v of+ Model.LiteralInteger v1 -> Model.LiteralInteger (rep v1)+ _ -> v),+ msgs))+ _ -> prepareSame at++-- | Return a value unchanged with identity transform and no messages+prepareSame :: Ord t2 => (t0 -> (t0, ((t1 -> t1), (S.Set t2))))+prepareSame x = (x, ((\y -> y), Sets.empty))++-- | Prepare a type, substituting unsupported literal types+prepareType :: t0 -> Model.Type -> (Model.Type, ((Model.Term -> Model.Term), (S.Set String)))+prepareType cx typ =+ case (Strip.deannotateType typ) of+ Model.TypeLiteral v0 ->+ let result = prepareLiteralType v0+ rtyp = Pairs.first result+ rep = Pairs.first (Pairs.second result)+ msgs = Pairs.second (Pairs.second result)+ in (+ Model.TypeLiteral rtyp,+ (+ (\v -> case v of+ Model.TermLiteral v1 -> Model.TermLiteral (rep v1)+ _ -> v),+ msgs))+ _ -> prepareSame typ++-- | Normalize a term by pushing TermTypeApplication inward past TermApplication and TermLambda. This corrects structures produced by poly-let hoisting and eta expansion, where type applications from inference end up wrapping term applications or lambda abstractions instead of being directly on the polymorphic variable.+pushTypeAppsInward :: Model.Term -> Model.Term+pushTypeAppsInward term =++ let push =+ \body -> \typ -> case body of+ Model.TermAnnotated v0 -> Model.TermAnnotated (Model.AnnotatedTerm {+ Model.annotatedTermBody = (push (Model.annotatedTermBody v0) typ),+ Model.annotatedTermAnnotation = (Model.annotatedTermAnnotation v0)})+ Model.TermApplication v0 -> go (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.applicationFunction v0),+ Model.typeApplicationTermType = typ})),+ Model.applicationArgument = (Model.applicationArgument v0)}))+ Model.TermLambda v0 -> go (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.lambdaParameter v0),+ Model.lambdaDomain = (Model.lambdaDomain v0),+ Model.lambdaBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.lambdaBody v0),+ Model.typeApplicationTermType = typ}))}))+ Model.TermLet v0 -> go (Model.TermLet (Model.Let {+ Model.letBindings = (Model.letBindings v0),+ Model.letBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.letBody v0),+ Model.typeApplicationTermType = typ}))}))+ _ -> Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = body,+ Model.typeApplicationTermType = typ})+ go =+ \t ->+ let forField =+ \fld -> Model.Field {+ Model.fieldName = (Model.fieldName fld),+ Model.fieldTerm = (go (Model.fieldTerm fld))}+ forCaseAlternative =+ \alt -> Model.CaseAlternative {+ Model.caseAlternativeName = (Model.caseAlternativeName alt),+ Model.caseAlternativeHandler = (go (Model.caseAlternativeHandler alt))}+ forLet =+ \lt ->+ let mapBinding =+ \b -> Model.Binding {+ Model.bindingName = (Model.bindingName b),+ Model.bindingTerm = (go (Model.bindingTerm b)),+ Model.bindingTypeScheme = (Model.bindingTypeScheme b)}+ in Model.Let {+ Model.letBindings = (Lists.map mapBinding (Model.letBindings lt)),+ Model.letBody = (go (Model.letBody lt))}+ forMap =+ \m ->+ let forPair = \p -> (go (Pairs.first p), (go (Pairs.second p)))+ in (Maps.fromList (Lists.map forPair (Maps.toList m)))+ in case t of+ Model.TermAnnotated v0 -> Model.TermAnnotated (Model.AnnotatedTerm {+ Model.annotatedTermBody = (go (Model.annotatedTermBody v0)),+ Model.annotatedTermAnnotation = (Model.annotatedTermAnnotation v0)})+ Model.TermApplication v0 -> Model.TermApplication (Model.Application {+ Model.applicationFunction = (go (Model.applicationFunction v0)),+ Model.applicationArgument = (go (Model.applicationArgument v0))})+ Model.TermCases v0 -> Model.TermCases (Model.CaseStatement {+ Model.caseStatementTypeName = (Model.caseStatementTypeName v0),+ Model.caseStatementDefault = (Optionals.map go (Model.caseStatementDefault v0)),+ Model.caseStatementCases = (Lists.map forCaseAlternative (Model.caseStatementCases v0))})+ Model.TermEither v0 -> Model.TermEither (Eithers.either (\l -> Left (go l)) (\r -> Right (go r)) v0)+ Model.TermLambda v0 -> Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.lambdaParameter v0),+ Model.lambdaDomain = (Model.lambdaDomain v0),+ Model.lambdaBody = (go (Model.lambdaBody v0))})+ Model.TermLet v0 -> Model.TermLet (forLet v0)+ Model.TermList v0 -> Model.TermList (Lists.map go v0)+ Model.TermLiteral v0 -> Model.TermLiteral v0+ Model.TermMap v0 -> Model.TermMap (forMap v0)+ Model.TermOptional v0 -> Model.TermOptional (Optionals.map go v0)+ Model.TermPair v0 -> Model.TermPair (go (Pairs.first v0), (go (Pairs.second v0)))+ Model.TermProject v0 -> Model.TermProject v0+ Model.TermRecord v0 -> Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.recordTypeName v0),+ Model.recordFields = (Lists.map forField (Model.recordFields v0))})+ Model.TermSet v0 -> Model.TermSet (Sets.fromList (Lists.map go (Sets.toList v0)))+ Model.TermTypeApplication v0 ->+ let body1 = go (Model.typeApplicationTermBody v0)+ in (push body1 (Model.typeApplicationTermType v0))+ Model.TermTypeLambda v0 -> Model.TermTypeLambda (Model.TypeLambda {+ Model.typeLambdaParameter = (Model.typeLambdaParameter v0),+ Model.typeLambdaBody = (go (Model.typeLambdaBody v0))})+ Model.TermInject v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.injectionTypeName v0),+ Model.injectionField = (forField (Model.injectionField v0))})+ Model.TermUnit -> Model.TermUnit+ Model.TermUnwrap v0 -> Model.TermUnwrap v0+ Model.TermVariable v0 -> Model.TermVariable v0+ Model.TermWrap v0 -> Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.wrappedTermTypeName v0),+ Model.wrappedTermBody = (go (Model.wrappedTermBody v0))})+ in (go term)++-- | Given a schema graph along with language constraints and a designated list of element names, adapt the graph to the language constraints, then return a corresponding type definition for each element name.+schemaGraphToDefinitions :: Coders.LanguageConstraints -> Graph.Graph -> [[Model.Name]] -> t0 -> Either Errors.Error (M.Map Model.Name Model.Type, [[Packaging.TypeDefinition]])+schemaGraphToDefinitions constraints graph nameLists cx =++ let litmap = adaptLiteralTypesMap constraints+ in (Eithers.bind (Eithers.bimap (\e -> Errors.ErrorDecoding e) (\x -> x) (Environment.graphAsTypes graph (Lexical.graphToBindings graph))) (\tmap0 -> Eithers.bind (adaptGraphSchema constraints litmap tmap0) (\tmap1 ->+ let toDef =+ \pair -> Packaging.TypeDefinition {+ Packaging.typeDefinitionName = (Pairs.first pair),+ Packaging.typeDefinitionMetadata = Nothing,+ Packaging.typeDefinitionBody = Model.TypeScheme {+ Model.typeSchemeVariables = [],+ Model.typeSchemeBody = (Pairs.second pair),+ Model.typeSchemeConstraints = Maps.empty}}+ in (Right (+ tmap1,+ (Lists.map (\names -> Lists.map toDef (Optionals.mapOptional (\n -> Optionals.map (\t -> (n, t)) (Maps.lookup n tmap1)) names)) nameLists))))))++-- | Given a target language and a source type, produce an adapter which rewrites the type and its terms according to the language's constraints. The encode direction adapts terms; the decode direction is identity.+simpleLanguageAdapter :: Coders.Language -> t0 -> Graph.Graph -> Model.Type -> Either Errors.Error (Coders.Adapter Model.Type Model.Type Model.Term Model.Term Errors.Error)+simpleLanguageAdapter lang cx g typ =++ let constraints = Coders.languageConstraints lang+ litmap = adaptLiteralTypesMap constraints+ in (Eithers.bind (adaptType constraints litmap typ) (\adaptedType -> Right (Coders.Adapter {+ Coders.adapterIsLossy = False,+ Coders.adapterSource = typ,+ Coders.adapterTarget = adaptedType,+ Coders.adapterCoder = Coders.Coder {+ Coders.coderEncode = (\term -> adaptTerm constraints litmap cx g term),+ Coders.coderDecode = (\term -> Right term)}})))++-- | Find a list of alternatives for a given term, if any+termAlternatives :: t0 -> Graph.Graph -> Model.Term -> Either Errors.Error [Model.Term]+termAlternatives cx graph term =+ case term of+ Model.TermAnnotated v0 ->+ let term2 = Model.annotatedTermBody v0+ in (Right [+ term2])+ Model.TermOptional v0 -> Right [+ Model.TermList (Optionals.match v0 [] (\term2 -> [+ term2]))]+ Model.TermTypeLambda v0 ->+ let term2 = Model.typeLambdaBody v0+ in (Right [+ term2])+ Model.TermTypeApplication v0 ->+ let term2 = Model.typeApplicationTermBody v0+ in (Right [+ term2])+ Model.TermInject v0 ->+ let tname = Model.injectionTypeName v0+ field = Model.injectionField v0+ fname = Model.fieldName field+ fterm = Model.fieldTerm field+ forFieldType =+ \ft ->+ let ftname = Model.fieldTypeName ft+ in Model.Field {+ Model.fieldName = fname,+ Model.fieldTerm = (Model.TermOptional (Logic.ifElse (Equality.equal ftname fname) (Just fterm) Nothing))}+ in (Eithers.bind (Resolution.requireUnionType cx graph tname) (\rt -> Right [+ Model.TermRecord (Model.Record {+ Model.recordTypeName = tname,+ Model.recordFields = (Lists.map forFieldType rt)})]))+ Model.TermUnit -> Right [+ Model.TermLiteral (Model.LiteralBoolean True)]+ Model.TermWrap v0 ->+ let term2 = Model.wrappedTermBody v0+ in (Right [+ term2])+ _ -> Right []++-- | Find a list of alternatives for a given type, if any+typeAlternatives :: Model.Type -> [Model.Type]+typeAlternatives type_ =+ case type_ of+ Model.TypeAnnotated v0 ->+ let type2 = Model.annotatedTypeBody v0+ in [+ type2]+ Model.TypeEffect v0 -> [+ v0]+ Model.TypeOptional v0 -> [+ Model.TypeList v0]+ Model.TypeUnion v0 ->+ let toOptField =+ \f -> Model.FieldType {+ Model.fieldTypeName = (Model.fieldTypeName f),+ Model.fieldTypeType = (Model.TypeOptional (Model.fieldTypeType f))}+ optFields = Lists.map toOptField v0+ in [+ Model.TypeRecord optFields]+ Model.TypeUnit -> [+ Model.TypeLiteral Model.LiteralTypeBoolean]+ Model.TypeVoid -> [+ Model.TypeUnit]+ _ -> []
@@ -0,0 +1,337 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Module dependency module name analysis++module Hydra.Core.Analysis where++import qualified Hydra.Core.Annotations as Annotations+import qualified Hydra.Core.Arity as Arity+import qualified Hydra.Core.Ast as Ast+import qualified Hydra.Core.Checking as Checking+import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Constants as Constants+import qualified Hydra.Core.Decode.Model as DecodeModel+import qualified Hydra.Core.Dependencies as Dependencies+import qualified Hydra.Core.Diff as Diff+import qualified Hydra.Core.Docs as Docs+import qualified Hydra.Core.Encode.Model as EncodeModel+import qualified Hydra.Core.Error.Checking as ErrorChecking+import qualified Hydra.Core.Error.File as ErrorFile+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Error.Packaging as ErrorPackaging+import qualified Hydra.Core.Error.System as ErrorSystem+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Json.Model as JsonModel+import qualified Hydra.Core.Lexical as Lexical+import qualified Hydra.Core.Overlay.Haskell.Lib.Eithers as Eithers+import qualified Hydra.Core.Overlay.Haskell.Lib.Equality as Equality+import qualified Hydra.Core.Overlay.Haskell.Lib.Lists as Lists+import qualified Hydra.Core.Overlay.Haskell.Lib.Logic as Logic+import qualified Hydra.Core.Overlay.Haskell.Lib.Maps as Maps+import qualified Hydra.Core.Overlay.Haskell.Lib.Optionals as Optionals+import qualified Hydra.Core.Overlay.Haskell.Lib.Pairs as Pairs+import qualified Hydra.Core.Overlay.Haskell.Lib.Sets as Sets+import qualified Hydra.Core.Markdown as Markdown+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Names as Names+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Parsing as Parsing+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Predicates as Predicates+import qualified Hydra.Core.Query as Query+import qualified Hydra.Core.Regex as Regex+import qualified Hydra.Core.Relational as Relational+import qualified Hydra.Core.Rewriting as Rewriting+import qualified Hydra.Core.Scoping as Scoping+import qualified Hydra.Core.Strip as Strip+import qualified Hydra.Core.System as System+import qualified Hydra.Core.Tabular as Tabular+import qualified Hydra.Core.Testing as Testing+import qualified Hydra.Core.Time as Time+import qualified Hydra.Core.Topology as Topology+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Validation as Validation+import qualified Hydra.Core.Variables as Variables+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void+import qualified Data.Set as S++-- | Add names to existing module names mapping+addNamesToModuleNames :: (Packaging.ModuleName -> t0) -> S.Set Model.Name -> Util.ModuleNames t0 -> Util.ModuleNames t0+addNamesToModuleNames encodeModuleName names ns0 =++ let nss = Sets.fromList (Optionals.givens (Lists.map Names.moduleNameOf (Sets.toList names)))+ toPair = \ns -> (ns, (encodeModuleName ns))+ in Util.ModuleNames {+ Util.moduleNamesFocus = (Util.moduleNamesFocus ns0),+ Util.moduleNamesMapping = (Maps.union (Util.moduleNamesMapping ns0) (Maps.fromList (Lists.map toPair (Sets.toList nss))))}++-- | Analyze a function term, collecting lambdas, type lambdas, lets, and type applications+analyzeFunctionTerm :: Typing.InferenceContext -> (t0 -> Graph.Graph) -> (Graph.Graph -> t0 -> t0) -> t0 -> Model.Term -> Either t1 (Typing.FunctionStructure t0)+analyzeFunctionTerm cx getTC setTC env term =+ analyzeFunctionTermWith cx (\g -> \b -> Logic.ifElse (Predicates.isComplexBinding g b) (Just (Model.TermLiteral (Model.LiteralBoolean True))) Nothing) getTC setTC env term++-- | Analyze a function term with configurable binding metadata+analyzeFunctionTermWith :: Typing.InferenceContext -> (Graph.Graph -> Model.Binding -> Maybe Model.Term) -> (t0 -> Graph.Graph) -> (Graph.Graph -> t0 -> t0) -> t0 -> Model.Term -> Either t1 (Typing.FunctionStructure t0)+analyzeFunctionTermWith cx forBinding getTC setTC env term =+ analyzeFunctionTermWithGather cx forBinding getTC setTC True env [] [] [] [] [] term++-- | Final step of the function-term walk: type-apply the body and assemble the FunctionStructure+analyzeFunctionTermWithFinish :: Typing.InferenceContext -> (t0 -> Graph.Graph) -> t0 -> [Model.Name] -> [Model.Name] -> [Model.Binding] -> [Model.Type] -> [Model.Type] -> Model.Term -> Either t1 (Typing.FunctionStructure t0)+analyzeFunctionTermWithFinish cx getTC fEnv tparams args bindings doms tapps body =++ let bodyWithTapps =+ Lists.foldl (\trm -> \typ -> Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = trm,+ Model.typeApplicationTermType = typ})) body tapps+ mcod = Eithers.either (\_ -> Nothing) (\c -> Just c) (Checking.typeOfTerm cx (getTC fEnv) bodyWithTapps)+ in (Right (Typing.FunctionStructure {+ Typing.functionStructureTypeParams = (Lists.reverse tparams),+ Typing.functionStructureParams = (Lists.reverse args),+ Typing.functionStructureBindings = bindings,+ Typing.functionStructureBody = bodyWithTapps,+ Typing.functionStructureDomains = (Lists.reverse doms),+ Typing.functionStructureCodomain = mcod,+ Typing.functionStructureEnvironment = fEnv}))++-- | Recursive step of the function-term walk: peel lambdas / type-lambdas / type-applications, accumulating params and bindings, then call analyzeFunctionTermWithFinish+analyzeFunctionTermWithGather :: Typing.InferenceContext -> (Graph.Graph -> Model.Binding -> Maybe Model.Term) -> (t0 -> Graph.Graph) -> (Graph.Graph -> t0 -> t0) -> Bool -> t0 -> [Model.Name] -> [Model.Name] -> [Model.Binding] -> [Model.Type] -> [Model.Type] -> Model.Term -> Either t1 (Typing.FunctionStructure t0)+analyzeFunctionTermWithGather cx forBinding getTC setTC argMode gEnv tparams args bindings doms tapps t =+ case (Strip.deannotateTerm t) of+ Model.TermLambda v0 -> Logic.ifElse argMode (+ let v = Model.lambdaParameter v0+ dom = Optionals.match (Model.lambdaDomain v0) (Model.TypeVariable (Model.Name "_")) (\x_ -> x_)+ body = Model.lambdaBody v0+ newEnv = setTC (Scoping.extendGraphForLambda (getTC gEnv) v0) gEnv+ in (analyzeFunctionTermWithGather cx forBinding getTC setTC argMode newEnv tparams (Lists.cons v args) bindings (Lists.cons dom doms) tapps body)) (analyzeFunctionTermWithFinish cx getTC gEnv tparams args bindings doms tapps t)+ Model.TermLet v0 ->+ let newBindings = Model.letBindings v0+ body = Model.letBody v0+ newEnv = setTC (Scoping.extendGraphForLet forBinding (getTC gEnv) v0) gEnv+ in (analyzeFunctionTermWithGather cx forBinding getTC setTC False newEnv tparams args (Lists.concat2 bindings newBindings) doms tapps body)+ Model.TermTypeApplication v0 ->+ let taBody = Model.typeApplicationTermBody v0+ typ = Model.typeApplicationTermType v0+ in (analyzeFunctionTermWithGather cx forBinding getTC setTC argMode gEnv tparams args bindings doms (Lists.cons typ tapps) taBody)+ Model.TermTypeLambda v0 ->+ let tvar = Model.typeLambdaParameter v0+ tlBody = Model.typeLambdaBody v0+ newEnv = setTC (Scoping.extendGraphForTypeLambda (getTC gEnv) v0) gEnv+ in (analyzeFunctionTermWithGather cx forBinding getTC setTC argMode newEnv (Lists.cons tvar tparams) args bindings doms tapps tlBody)+ _ -> analyzeFunctionTermWithFinish cx getTC gEnv tparams args bindings doms tapps t++-- | Get dependency module names from definitions+definitionDependencyModuleNames :: [Packaging.Definition] -> S.Set Packaging.ModuleName+definitionDependencyModuleNames defs =++ let defNames =+ \def -> case def of+ Packaging.DefinitionType v0 -> Dependencies.typeDependencyNames True (Model.typeSchemeBody (Packaging.typeDefinitionBody v0))+ Packaging.DefinitionTerm v0 -> Dependencies.termDependencyNames True True True (Packaging.termDefinitionBody v0)+ Packaging.DefinitionPrimitive v0 -> Dependencies.typeDependencyNames True (Model.typeSchemeBody (Scoping.termSignatureToTypeScheme (Packaging.primitiveDefinitionSignature v0)))+ allNames = Sets.unions (Lists.map defNames defs)+ in (Sets.fromList (Optionals.givens (Lists.map Names.moduleNameOf (Sets.toList allNames))))++-- | Find dependency module names in all of a set of terms (Either version)+dependencyModuleNames :: t0 -> Graph.Graph -> Bool -> Bool -> Bool -> Bool -> [Model.Binding] -> Either Errors.Error (S.Set Packaging.ModuleName)+dependencyModuleNames cx graph binds withPrims withNoms withSchema els =++ let depNames =+ \el ->+ let term = Model.bindingTerm el+ deannotatedTerm = Strip.deannotateTerm term+ dataNames = Dependencies.termDependencyNames binds withPrims withNoms term+ schemaNames =+ Logic.ifElse withSchema (Optionals.match (Model.bindingTypeScheme el) Sets.empty (\ts -> Dependencies.typeDependencyNames True (Model.typeSchemeBody ts))) Sets.empty+ in (Logic.ifElse (Predicates.isEncodedType deannotatedTerm) (Eithers.map (\typ -> Sets.unions [+ dataNames,+ schemaNames,+ (Dependencies.typeDependencyNames True typ)]) (Eithers.bimap (\_e -> Errors.ErrorDecoding _e) (\_a -> _a) (DecodeModel.type_ graph term))) (Logic.ifElse (Predicates.isEncodedTerm deannotatedTerm) (Eithers.map (\decodedTerm -> Sets.unions [+ dataNames,+ schemaNames,+ (Dependencies.termDependencyNames binds withPrims withNoms decodedTerm)]) (Eithers.bimap (\_e -> Errors.ErrorDecoding _e) (\_a -> _a) (DecodeModel.term graph term))) (Right (Sets.unions [+ dataNames,+ schemaNames]))))+ in (Eithers.map (\namesList -> Sets.fromList (Optionals.givens (Lists.map Names.moduleNameOf (Sets.toList (Sets.unions namesList))))) (Eithers.mapList depNames els))++-- | Gather applications from a term, returning (args, baseTerm)+gatherApplications :: Model.Term -> ([Model.Term], Model.Term)+gatherApplications term =++ let go =+ \args -> \t -> case (Strip.deannotateTerm t) of+ Model.TermApplication v0 ->+ let lhs = Model.applicationFunction v0+ rhs = Model.applicationArgument v0+ in (go (Lists.cons rhs args) lhs)+ _ -> (args, t)+ in (go [] term)++-- | Gather term arguments, stripping type-level constructs+gatherArgs :: Model.Term -> [Model.Term] -> (Model.Term, [Model.Term])+gatherArgs term args =+ case (Strip.deannotateTerm term) of+ Model.TermApplication v0 ->+ let lhs = Model.applicationFunction v0+ rhs = Model.applicationArgument v0+ in (gatherArgs lhs (Lists.cons rhs args))+ Model.TermTypeLambda v0 ->+ let body = Model.typeLambdaBody v0+ in (gatherArgs body args)+ Model.TermTypeApplication v0 ->+ let body = Model.typeApplicationTermBody v0+ in (gatherArgs body args)+ _ -> (term, args)++-- | Gather term and type arguments from a term+gatherArgsWithTypeApps :: Model.Term -> [Model.Term] -> [Model.Type] -> (Model.Term, ([Model.Term], [Model.Type]))+gatherArgsWithTypeApps term args tyArgs =+ case (Strip.deannotateTerm term) of+ Model.TermApplication v0 ->+ let lhs = Model.applicationFunction v0+ rhs = Model.applicationArgument v0+ in (gatherArgsWithTypeApps lhs (Lists.cons rhs args) tyArgs)+ Model.TermTypeLambda v0 ->+ let body = Model.typeLambdaBody v0+ in (gatherArgsWithTypeApps body args tyArgs)+ Model.TermTypeApplication v0 ->+ let body = Model.typeApplicationTermBody v0+ typ = Model.typeApplicationTermType v0+ in (gatherArgsWithTypeApps body args (Lists.cons typ tyArgs))+ _ -> (term, (args, tyArgs))++-- | Check if a term body is self-tail-recursive with respect to a function name+isSelfTailRecursive :: Model.Name -> Model.Term -> Bool+isSelfTailRecursive funcName body =++ let callsSelf = Logic.not (Variables.isFreeVariableInTerm funcName body)+ in (Logic.ifElse callsSelf (isTailRecursiveInTailPosition funcName body) False)++-- | Check if a term can be encoded as a simple assignment+isSimpleAssignment :: Model.Term -> Bool+isSimpleAssignment term =+ case term of+ Model.TermAnnotated v0 -> isSimpleAssignment (Model.annotatedTermBody v0)+ Model.TermLambda _ -> False+ Model.TermLet _ -> False+ Model.TermTypeLambda _ -> False+ Model.TermTypeApplication v0 -> isSimpleAssignment (Model.typeApplicationTermBody v0)+ _ ->+ let baseTerm = Pairs.first (gatherArgs term [])+ in case baseTerm of+ Model.TermCases _ -> False+ _ -> True++-- | Check that all self-references are in tail position+isTailRecursiveInTailPosition :: Model.Name -> Model.Term -> Bool+isTailRecursiveInTailPosition funcName term =++ let stripped = Strip.deannotateAndDetypeTerm term+ in case stripped of+ Model.TermApplication _ ->+ let gathered = gatherApplications stripped+ gatherArgs = Pairs.first gathered+ gatherFun = Pairs.second gathered+ strippedFun = Strip.deannotateAndDetypeTerm gatherFun+ in case strippedFun of+ Model.TermVariable v1 -> Logic.ifElse (Equality.equal v1 funcName) (+ let argsNoFunc = Lists.foldl (\ok -> \arg -> Logic.and ok (Variables.isFreeVariableInTerm funcName arg)) True gatherArgs+ argsNoLambda =+ Lists.foldl (\ok -> \arg -> Logic.and ok (Logic.not (Rewriting.foldOverTerm Coders.TraversalOrderPre (\found -> \t -> Logic.or found (case t of+ Model.TermLambda v2 ->+ let ignore = Model.lambdaBody v2+ in True+ _ -> False)) False arg))) True gatherArgs+ in (Logic.and argsNoFunc argsNoLambda)) (Variables.isFreeVariableInTerm funcName term)+ Model.TermCases v1 ->+ let cases_ = Model.caseStatementCases v1+ dflt = Model.caseStatementDefault v1+ branchesOk =+ Lists.foldl (\ok -> \field -> Logic.and ok (isTailRecursiveInTailPosition funcName (Model.caseAlternativeHandler field))) True cases_+ dfltOk = Optionals.match dflt True (\d -> isTailRecursiveInTailPosition funcName d)+ argsOk = Lists.foldl (\ok -> \arg -> Logic.and ok (Variables.isFreeVariableInTerm funcName arg)) True gatherArgs+ in (Logic.and (Logic.and branchesOk dfltOk) argsOk)+ _ -> Variables.isFreeVariableInTerm funcName term+ Model.TermLambda v0 -> isTailRecursiveInTailPosition funcName (Model.lambdaBody v0)+ Model.TermLet v0 ->+ let bindingsOk =+ Lists.foldl (\ok -> \b -> Logic.and ok (Variables.isFreeVariableInTerm funcName (Model.bindingTerm b))) True (Model.letBindings v0)+ in (Logic.and bindingsOk (isTailRecursiveInTailPosition funcName (Model.letBody v0)))+ _ -> Variables.isFreeVariableInTerm funcName term++-- | Check whether a module contains any binary literal values+moduleContainsBinaryLiterals :: Packaging.Module -> Bool+moduleContainsBinaryLiterals mod =++ let checkTerm =+ \found -> \term -> Logic.or found (case term of+ Model.TermLiteral v0 -> case v0 of+ Model.LiteralBinary _ -> True+ _ -> False+ _ -> False)+ termContainsBinary = \term -> Rewriting.foldOverTerm Coders.TraversalOrderPre checkTerm False term+ defTerms =+ Optionals.givens (Lists.map (\d -> case d of+ Packaging.DefinitionTerm v0 -> Just (Packaging.termDefinitionBody v0)+ _ -> Nothing) (Packaging.moduleDefinitions mod))+ in (Lists.foldl (\acc -> \t -> Logic.or acc (termContainsBinary t)) False defTerms)++-- | Check whether a module contains any decimal literal values+moduleContainsDecimalLiterals :: Packaging.Module -> Bool+moduleContainsDecimalLiterals mod =++ let checkTerm =+ \found -> \term -> Logic.or found (case term of+ Model.TermLiteral v0 -> case v0 of+ Model.LiteralDecimal _ -> True+ _ -> False+ _ -> False)+ termContainsDecimal = \term -> Rewriting.foldOverTerm Coders.TraversalOrderPre checkTerm False term+ defTerms =+ Optionals.givens (Lists.map (\d -> case d of+ Packaging.DefinitionTerm v0 -> Just (Packaging.termDefinitionBody v0)+ _ -> Nothing) (Packaging.moduleDefinitions mod))+ in (Lists.foldl (\acc -> \t -> Logic.or acc (termContainsDecimal t)) False defTerms)++-- | Find dependency module names in all elements of a module, excluding the module's own module name (Either version)+moduleDependencyModuleNames :: t0 -> Graph.Graph -> Bool -> Bool -> Bool -> Bool -> Packaging.Module -> Either Errors.Error (S.Set Packaging.ModuleName)+moduleDependencyModuleNames cx graph binds withPrims withNoms withSchema mod =++ let allBindings =+ Optionals.givens (Lists.map (\d -> case d of+ Packaging.DefinitionType v0 -> Just ((\name -> \typ ->+ let schemaTerm = Model.TermVariable (Model.Name "hydra.core.model.Type")+ dataTerm =+ Annotations.normalizeTermAnnotations (Model.TermAnnotated (Model.AnnotatedTerm {+ Model.annotatedTermBody = (EncodeModel.type_ typ),+ Model.annotatedTermAnnotation = (Annotations.wrapAnnotationMap (Maps.fromList [+ (Constants.keyType, schemaTerm)]))}))+ in Model.Binding {+ Model.bindingName = name,+ Model.bindingTerm = dataTerm,+ Model.bindingTypeScheme = (Just (Model.TypeScheme {+ Model.typeSchemeVariables = [],+ Model.typeSchemeBody = (Model.TypeVariable (Model.Name "hydra.core.model.Type")),+ Model.typeSchemeConstraints = Maps.empty}))}) (Packaging.typeDefinitionName v0) (Model.typeSchemeBody (Packaging.typeDefinitionBody v0)))+ Packaging.DefinitionTerm v0 -> Just (Model.Binding {+ Model.bindingName = (Packaging.termDefinitionName v0),+ Model.bindingTerm = (Packaging.termDefinitionBody v0),+ Model.bindingTypeScheme = (Optionals.map Scoping.termSignatureToTypeScheme (Packaging.termDefinitionSignature v0))})+ _ -> Nothing) (Packaging.moduleDefinitions mod))+ in (Eithers.map (\deps -> Sets.delete (Packaging.moduleName mod) deps) (dependencyModuleNames cx graph binds withPrims withNoms withSchema allBindings))++-- | Create module names mapping for definitions+moduleNamesForDefinitions :: (Packaging.ModuleName -> t0) -> Packaging.ModuleName -> [Packaging.Definition] -> Util.ModuleNames t0+moduleNamesForDefinitions encodeModuleName focusNs defs =++ let nss = Sets.delete focusNs (definitionDependencyModuleNames defs)+ toPair = \ns -> (ns, (encodeModuleName ns))+ in Util.ModuleNames {+ Util.moduleNamesFocus = (toPair focusNs),+ Util.moduleNamesMapping = (Maps.fromList (Lists.map toPair (Sets.toList nss)))}
@@ -0,0 +1,255 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Utilities for reading and writing type and term annotations++module Hydra.Core.Annotations where++import qualified Hydra.Core.Ast as Ast+import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Constants as Constants+import qualified Hydra.Core.Decode.Model as DecodeModel+import qualified Hydra.Core.Diff as Diff+import qualified Hydra.Core.Docs as Docs+import qualified Hydra.Core.Encode.Model as EncodeModel+import qualified Hydra.Core.Error.Checking as Checking+import qualified Hydra.Core.Error.File as ErrorFile+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Error.Packaging as ErrorPackaging+import qualified Hydra.Core.Error.System as ErrorSystem+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.Extract.Model as ExtractModel+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Json.Model as JsonModel+import qualified Hydra.Core.Lexical as Lexical+import qualified Hydra.Core.Overlay.Haskell.Lib.Eithers as Eithers+import qualified Hydra.Core.Overlay.Haskell.Lib.Equality as Equality+import qualified Hydra.Core.Overlay.Haskell.Lib.Lists as Lists+import qualified Hydra.Core.Overlay.Haskell.Lib.Logic as Logic+import qualified Hydra.Core.Overlay.Haskell.Lib.Maps as Maps+import qualified Hydra.Core.Overlay.Haskell.Lib.Optionals as Optionals+import qualified Hydra.Core.Overlay.Haskell.Lib.Pairs as Pairs+import qualified Hydra.Core.Overlay.Haskell.Lib.Sets as Sets+import qualified Hydra.Core.Markdown as Markdown+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Parsing as Parsing+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Print.Errors as PrintErrors+import qualified Hydra.Core.Print.Model as PrintModel+import qualified Hydra.Core.Query as Query+import qualified Hydra.Core.Regex as Regex+import qualified Hydra.Core.Relational as Relational+import qualified Hydra.Core.Strip as Strip+import qualified Hydra.Core.System as System+import qualified Hydra.Core.Tabular as Tabular+import qualified Hydra.Core.Testing as Testing+import qualified Hydra.Core.Time as Time+import qualified Hydra.Core.Topology as Topology+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Validation as Validation+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void+import qualified Data.Map as M+import qualified Data.Set as S++-- | Aggregate annotations from nested structures+aggregateAnnotations :: Ord t2 => ((t0 -> Maybe t1) -> (t1 -> t0) -> (t1 -> M.Map t2 t3) -> t0 -> M.Map t2 t3)+aggregateAnnotations getValue getX getAnns t =++ let toPairs =+ \rest -> \t2 -> Optionals.match (getValue t2) rest (\yy -> toPairs (Lists.cons (Maps.toList (getAnns yy)) rest) (getX yy))+ in (Maps.fromList (Lists.concat (toPairs [] t)))++-- | Extract comments/description from a Binding+commentsFromBinding :: t0 -> Graph.Graph -> Model.Binding -> Either Errors.Error (Maybe String)+commentsFromBinding cx g b = getTermDescription cx g (Model.bindingTerm b)++-- | Extract comments/description from a FieldType+commentsFromFieldType :: t0 -> Graph.Graph -> Model.FieldType -> Either Errors.Error (Maybe String)+commentsFromFieldType cx g ft = getTypeDescription cx g (Model.fieldTypeType ft)++-- | Project a Map<Name, Term> out of an annotation Term. For a TermMap with TermVariable-shaped keys (or, transitionally, TermWrap-encoded Name keys), returns those (Name, value) entries; for any other shape, returns the empty map.+getAnnotationMap :: Model.Term -> M.Map Model.Name Model.Term+getAnnotationMap t =++ let extractName =+ \k -> case k of+ Model.TermVariable v0 -> Just v0+ Model.TermWrap v0 -> case (Model.wrappedTermBody v0) of+ Model.TermLiteral v1 -> case v1 of+ Model.LiteralString v2 -> Just (Model.Name v2)+ _ -> Nothing+ _ -> Nothing+ _ -> Nothing+ fromEntry =+ \p ->+ let k = Pairs.first p+ v = Pairs.second p+ in (Optionals.map (\n -> (n, v)) (extractName k))+ in case t of+ Model.TermMap v0 -> Maps.fromList (Optionals.givens (Lists.map fromEntry (Maps.toList v0)))+ _ -> Maps.empty++-- | Get description from annotations map (Either version)+getDescription :: t0 -> Graph.Graph -> M.Map Model.Name Model.Term -> Either Errors.Error (Maybe String)+getDescription cx graph anns =+ Optionals.match (Maps.lookup (Model.Name "description") anns) (Right Nothing) (\term -> Eithers.map Optionals.given (ExtractModel.string graph term))++-- | Get a term annotation+getTermAnnotation :: Model.Name -> Model.Term -> Maybe Model.Term+getTermAnnotation key term = Maps.lookup key (termAnnotationInternal term)++-- | Get term description (Either version)+getTermDescription :: t0 -> Graph.Graph -> Model.Term -> Either Errors.Error (Maybe String)+getTermDescription cx graph term =++ let peel =+ \t -> case t of+ Model.TermTypeLambda v0 -> peel (Model.typeLambdaBody v0)+ Model.TermTypeApplication v0 -> peel (Model.typeApplicationTermBody v0)+ _ -> t+ in (getDescription cx graph (termAnnotationInternal (peel term)))++-- | Get type from annotations+getType :: Graph.Graph -> M.Map Model.Name Model.Term -> Either Errors.DecodingError (Maybe Model.Type)+getType graph anns =+ Optionals.match (Maps.lookup Constants.keyType anns) (Right Nothing) (\dat -> Eithers.map Optionals.given (DecodeModel.type_ graph dat))++-- | Get a type annotation+getTypeAnnotation :: Model.Name -> Model.Type -> Maybe Model.Term+getTypeAnnotation key typ = Maps.lookup key (typeAnnotationInternal typ)++-- | Get type classes from term. Each Set Name contains bare class identifiers (#275).+getTypeClasses :: t0 -> Graph.Graph -> Model.Term -> Either Errors.Error (M.Map Model.Name (S.Set Model.Name))+getTypeClasses cx graph term =++ let decodeName = \term2 -> Eithers.bimap (\de -> Errors.ErrorDecoding de) (\x -> x) (DecodeModel.name graph term2)+ in (Optionals.match (getTermAnnotation Constants.keyClasses term) (Right Maps.empty) (\term2 -> ExtractModel.map decodeName (ExtractModel.setOf decodeName graph) graph term2))++-- | Get type description (Either version)+getTypeDescription :: t0 -> Graph.Graph -> Model.Type -> Either Errors.Error (Maybe String)+getTypeDescription cx graph typ = getDescription cx graph (typeAnnotationInternal typ)++-- | Check if annotations contain description+hasDescription :: M.Map Model.Name t0 -> Bool+hasDescription anns = Optionals.isGiven (Maps.lookup Constants.keyDescription anns)++-- | Check if type has description+hasTypeDescription :: Model.Type -> Bool+hasTypeDescription typ = hasDescription (typeAnnotationInternal typ)++-- | For a typed term, decide whether a coder should encode it as a native type expression, or as a Hydra type expression.+isNativeType :: Model.Binding -> Bool+isNativeType el =++ let isFlaggedAsFirstClassType =+ Optionals.withDefault False (Optionals.map (\_ -> True) (getTermAnnotation Constants.keyFirstClassType (Model.bindingTerm el)))+ in (Optionals.match (Model.bindingTypeScheme el) False (\ts -> Logic.and (Equality.equal ts (Model.TypeScheme {+ Model.typeSchemeVariables = [],+ Model.typeSchemeBody = (Model.TypeVariable (Model.Name "hydra.core.model.Type")),+ Model.typeSchemeConstraints = Maps.empty})) (Logic.not isFlaggedAsFirstClassType)))++-- | Normalize term annotations+normalizeTermAnnotations :: Model.Term -> Model.Term+normalizeTermAnnotations term =++ let anns = termAnnotationInternal term+ stripped = Strip.deannotateTerm term+ in (Logic.ifElse (Maps.isEmpty anns) stripped (Model.TermAnnotated (Model.AnnotatedTerm {+ Model.annotatedTermBody = stripped,+ Model.annotatedTermAnnotation = (wrapAnnotationMap anns)})))++-- | Normalize type annotations+normalizeTypeAnnotations :: Model.Type -> Model.Type+normalizeTypeAnnotations typ =++ let anns = typeAnnotationInternal typ+ stripped = Strip.deannotateType typ+ in (Logic.ifElse (Maps.isEmpty anns) stripped (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = stripped,+ Model.annotatedTypeAnnotation = (wrapAnnotationMap anns)})))++-- | Set annotation in map+setAnnotation :: Ord t0 => (t0 -> Maybe t1 -> M.Map t0 t1 -> M.Map t0 t1)+setAnnotation key val m = Maps.alter (\_ -> val) key m++-- | Set description in annotations+setDescription :: Maybe String -> M.Map Model.Name Model.Term -> M.Map Model.Name Model.Term+setDescription d =+ setAnnotation Constants.keyDescription (Optionals.map (\arg_ -> (\x -> Model.TermLiteral x) ((\x -> Model.LiteralString x) arg_)) d)++-- | Set term annotation+setTermAnnotation :: Model.Name -> Maybe Model.Term -> Model.Term -> Model.Term+setTermAnnotation key val term =++ let term_ = Strip.deannotateTerm term+ anns = setAnnotation key val (termAnnotationInternal term)+ in (Logic.ifElse (Maps.isEmpty anns) term_ (Model.TermAnnotated (Model.AnnotatedTerm {+ Model.annotatedTermBody = term_,+ Model.annotatedTermAnnotation = (wrapAnnotationMap anns)})))++-- | Set term description+setTermDescription :: Maybe String -> Model.Term -> Model.Term+setTermDescription d =+ setTermAnnotation Constants.keyDescription (Optionals.map (\s -> Model.TermLiteral (Model.LiteralString s)) d)++-- | Set type in annotations+setType :: Maybe Model.Type -> M.Map Model.Name Model.Term -> M.Map Model.Name Model.Term+setType mt = setAnnotation Constants.keyType (Optionals.map EncodeModel.type_ mt)++-- | Set type annotation+setTypeAnnotation :: Model.Name -> Maybe Model.Term -> Model.Type -> Model.Type+setTypeAnnotation key val typ =++ let typ_ = Strip.deannotateType typ+ anns = setAnnotation key val (typeAnnotationInternal typ)+ in (Logic.ifElse (Maps.isEmpty anns) typ_ (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = typ_,+ Model.annotatedTypeAnnotation = (wrapAnnotationMap anns)})))++-- | Set type classes on term. The Set Name carries bare class identifiers (#275).+setTypeClasses :: M.Map Model.Name (S.Set Model.Name) -> Model.Term -> Model.Term+setTypeClasses m term =++ let encodePair =+ \nameClasses ->+ let name = Pairs.first nameClasses+ classes = Pairs.second nameClasses+ in (EncodeModel.name name, (Model.TermSet (Sets.fromList (Lists.map EncodeModel.name (Sets.toList classes)))))+ encoded = Logic.ifElse (Maps.isEmpty m) Nothing (Just (Model.TermMap (Maps.fromList (Lists.map encodePair (Maps.toList m)))))+ in (setTermAnnotation Constants.keyClasses encoded term)++-- | Set type description+setTypeDescription :: Maybe String -> Model.Type -> Model.Type+setTypeDescription d =+ setTypeAnnotation Constants.keyDescription (Optionals.map (\arg_ -> (\x -> Model.TermLiteral x) ((\x -> Model.LiteralString x) arg_)) d)++-- | Get internal term annotations+termAnnotationInternal :: Model.Term -> M.Map Model.Name Model.Term+termAnnotationInternal term =++ let getAnn =+ \t -> case t of+ Model.TermAnnotated v0 -> Just v0+ _ -> Nothing+ in (aggregateAnnotations getAnn (\at -> Model.annotatedTermBody at) (\at -> getAnnotationMap (Model.annotatedTermAnnotation at)) term)++-- | Get internal type annotations+typeAnnotationInternal :: Model.Type -> M.Map Model.Name Model.Term+typeAnnotationInternal typ =++ let getAnn =+ \t -> case t of+ Model.TypeAnnotated v0 -> Just v0+ _ -> Nothing+ in (aggregateAnnotations getAnn (\at -> Model.annotatedTypeBody at) (\at -> getAnnotationMap (Model.annotatedTypeAnnotation at)) typ)++-- | Wrap a Map<Name, Term> as a TermMap annotation. Each Name key becomes a TermVariable.+wrapAnnotationMap :: M.Map Model.Name Model.Term -> Model.Term+wrapAnnotationMap m =+ Model.TermMap (Maps.fromList (Lists.map (\p -> (Model.TermVariable (Pairs.first p), (Pairs.second p))) (Maps.toList m)))
@@ -0,0 +1,83 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Functions dealing with arguments and arity.++module Hydra.Core.Arity where++import qualified Hydra.Core.Ast as Ast+import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Diff as Diff+import qualified Hydra.Core.Docs as Docs+import qualified Hydra.Core.Error.Checking as Checking+import qualified Hydra.Core.Error.File as ErrorFile+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Error.Packaging as ErrorPackaging+import qualified Hydra.Core.Error.System as ErrorSystem+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Json.Model as JsonModel+import qualified Hydra.Core.Overlay.Haskell.Lib.Lists as Lists+import qualified Hydra.Core.Overlay.Haskell.Lib.Math as Math+import qualified Hydra.Core.Markdown as Markdown+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Parsing as Parsing+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Query as Query+import qualified Hydra.Core.Regex as Regex+import qualified Hydra.Core.Relational as Relational+import qualified Hydra.Core.System as System+import qualified Hydra.Core.Tabular as Tabular+import qualified Hydra.Core.Testing as Testing+import qualified Hydra.Core.Time as Time+import qualified Hydra.Core.Topology as Topology+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Validation as Validation+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | Find the arity (expected number of arguments) of a primitive constant or function+primitiveArity :: Graph.Primitive -> Int+primitiveArity prim =+ Lists.length (Typing.termSignatureParameters (Packaging.primitiveDefinitionSignature (Graph.primitiveDefinition prim)))++-- | Find the arity (expected number of arguments) of a term+termArity :: Model.Term -> Int+termArity x =+ case x of+ Model.TermApplication v0 -> (\arg_2 -> (\xapp -> Math.sub xapp 1) (termArity arg_2)) (Model.applicationFunction v0)+ Model.TermCases _ -> 1+ Model.TermLambda v0 -> (\i -> Math.add 1 i) (termArity (Model.lambdaBody v0))+ Model.TermProject _ -> 1+ Model.TermUnwrap _ -> 1+ _ -> 0++-- | Find the arity (expected number of arguments) of a type+typeArity :: Model.Type -> Int+typeArity x =+ case x of+ Model.TypeAnnotated v0 -> typeArity (Model.annotatedTypeBody v0)+ Model.TypeApplication v0 -> typeArity (Model.applicationTypeFunction v0)+ Model.TypeForall v0 -> typeArity (Model.forallTypeBody v0)+ Model.TypeFunction v0 -> Math.add 1 (typeArity (Model.functionTypeCodomain v0))+ _ -> 0++-- | Find the arity (expected number of arguments) of a type scheme+typeSchemeArity :: Model.TypeScheme -> Int+typeSchemeArity arg_ = typeArity (Model.typeSchemeBody arg_)++-- | Uncurry a type expression into a list of types, turning a function type a -> b into cons a (uncurryType b)+uncurryType :: Model.Type -> [Model.Type]+uncurryType t =+ case t of+ Model.TypeAnnotated v0 -> uncurryType (Model.annotatedTypeBody v0)+ Model.TypeApplication v0 -> uncurryType (Model.applicationTypeFunction v0)+ Model.TypeForall v0 -> uncurryType (Model.forallTypeBody v0)+ Model.TypeFunction v0 -> Lists.cons (Model.functionTypeDomain v0) (uncurryType (Model.functionTypeCodomain v0))+ _ -> [+ t]
@@ -0,0 +1,250 @@+-- Note: this is an automatically generated file. Do not edit.++-- | A model which provides a common syntax tree for Hydra serializers++module Hydra.Core.Ast where++import qualified Hydra.Core.Model as Model+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | Operator associativity+data Associativity =+ AssociativityNone |+ AssociativityLeft |+ AssociativityRight |+ AssociativityBoth+ deriving (Eq, Ord, Read, Show)++_Associativity = Model.Name "hydra.core.ast.Associativity"++_Associativity_none = Model.Name "none"++_Associativity_left = Model.Name "left"++_Associativity_right = Model.Name "right"++_Associativity_both = Model.Name "both"++-- | Formatting option for code blocks+data BlockStyle =+ BlockStyle {+ -- | An optional indentation string+ blockStyleIndent :: (Maybe String),+ -- | Whether to place a newline before the content+ blockStyleNewlineBeforeContent :: Bool,+ -- | Whether to place a newline after the content+ blockStyleNewlineAfterContent :: Bool}+ deriving (Eq, Ord, Read, Show)++_BlockStyle = Model.Name "hydra.core.ast.BlockStyle"++_BlockStyle_indent = Model.Name "indent"++_BlockStyle_newlineBeforeContent = Model.Name "newlineBeforeContent"++_BlockStyle_newlineAfterContent = Model.Name "newlineAfterContent"++-- | An expression enclosed by brackets+data BracketExpr =+ BracketExpr {+ -- | The bracket pair enclosing the expression+ bracketExprBrackets :: Brackets,+ -- | The expression within the brackets+ bracketExprEnclosed :: Expr,+ -- | The formatting style for the bracketed block+ bracketExprStyle :: BlockStyle}+ deriving (Eq, Ord, Read, Show)++_BracketExpr = Model.Name "hydra.core.ast.BracketExpr"++_BracketExpr_brackets = Model.Name "brackets"++_BracketExpr_enclosed = Model.Name "enclosed"++_BracketExpr_style = Model.Name "style"++-- | Matching open and close bracket symbols+data Brackets =+ Brackets {+ -- | The opening bracket symbol+ bracketsOpen :: Symbol,+ -- | The closing bracket symbol+ bracketsClose :: Symbol}+ deriving (Eq, Ord, Read, Show)++_Brackets = Model.Name "hydra.core.ast.Brackets"++_Brackets_open = Model.Name "open"++_Brackets_close = Model.Name "close"++-- | An abstract expression+data Expr =+ -- | A constant symbol+ ExprConst Symbol |+ -- | An indented expression+ ExprIndent IndentedExpression |+ -- | An operator expression+ ExprOp OpExpr |+ -- | A bracketed expression+ ExprBrackets BracketExpr |+ -- | A sequence of expressions joined by a separator, treated as structural layout (not subject to parenthesization)+ ExprSeq SeqExpr+ deriving (Eq, Ord, Read, Show)++_Expr = Model.Name "hydra.core.ast.Expr"++_Expr_const = Model.Name "const"++_Expr_indent = Model.Name "indent"++_Expr_op = Model.Name "op"++_Expr_brackets = Model.Name "brackets"++_Expr_seq = Model.Name "seq"++-- | Any of several indentation styles+data IndentStyle =+ -- | Indent all lines with the given string+ IndentStyleAllLines String |+ -- | Indent only lines after the first with the given string+ IndentStyleSubsequentLines String+ deriving (Eq, Ord, Read, Show)++_IndentStyle = Model.Name "hydra.core.ast.IndentStyle"++_IndentStyle_allLines = Model.Name "allLines"++_IndentStyle_subsequentLines = Model.Name "subsequentLines"++-- | An expression indented in a certain style+data IndentedExpression =+ IndentedExpression {+ -- | The indentation style+ indentedExpressionStyle :: IndentStyle,+ -- | The expression to be indented+ indentedExpressionExpr :: Expr}+ deriving (Eq, Ord, Read, Show)++_IndentedExpression = Model.Name "hydra.core.ast.IndentedExpression"++_IndentedExpression_style = Model.Name "style"++_IndentedExpression_expr = Model.Name "expr"++-- | An operator symbol+data Op =+ Op {+ -- | The operator symbol+ opSymbol :: Symbol,+ -- | The padding around the operator+ opPadding :: Padding,+ -- | The precedence of the operator+ opPrecedence :: Precedence,+ -- | The associativity of the operator+ opAssociativity :: Associativity}+ deriving (Eq, Ord, Read, Show)++_Op = Model.Name "hydra.core.ast.Op"++_Op_symbol = Model.Name "symbol"++_Op_padding = Model.Name "padding"++_Op_precedence = Model.Name "precedence"++_Op_associativity = Model.Name "associativity"++-- | An operator expression+data OpExpr =+ OpExpr {+ -- | The operator+ opExprOp :: Op,+ -- | The left-hand side operand+ opExprLhs :: Expr,+ -- | The right-hand side operand+ opExprRhs :: Expr}+ deriving (Eq, Ord, Read, Show)++_OpExpr = Model.Name "hydra.core.ast.OpExpr"++_OpExpr_op = Model.Name "op"++_OpExpr_lhs = Model.Name "lhs"++_OpExpr_rhs = Model.Name "rhs"++-- | Left and right padding for an operator+data Padding =+ Padding {+ -- | Padding to the left of the operator+ paddingLeft :: Ws,+ -- | Padding to the right of the operator+ paddingRight :: Ws}+ deriving (Eq, Ord, Read, Show)++_Padding = Model.Name "hydra.core.ast.Padding"++_Padding_left = Model.Name "left"++_Padding_right = Model.Name "right"++-- | Operator precedence+newtype Precedence =+ Precedence {+ unPrecedence :: Int}+ deriving (Eq, Ord, Read, Show)++_Precedence = Model.Name "hydra.core.ast.Precedence"++-- | A sequence of expressions joined by a separator operator. Unlike OpExpr, parenthesize ignores SeqExpr boundaries.+data SeqExpr =+ SeqExpr {+ -- | The separator operator+ seqExprOp :: Op,+ -- | The expressions to join+ seqExprElements :: [Expr]}+ deriving (Eq, Ord, Read, Show)++_SeqExpr = Model.Name "hydra.core.ast.SeqExpr"++_SeqExpr_op = Model.Name "op"++_SeqExpr_elements = Model.Name "elements"++-- | Any symbol+newtype Symbol =+ Symbol {+ unSymbol :: String}+ deriving (Eq, Ord, Read, Show)++_Symbol = Model.Name "hydra.core.ast.Symbol"++-- | One of several classes of whitespace+data Ws =+ -- | No whitespace+ WsNone |+ -- | A single space+ WsSpace |+ -- | A line break+ WsBreak |+ -- | A line break followed by indentation+ WsBreakAndIndent String |+ -- | Two line breaks+ WsDoubleBreak+ deriving (Eq, Ord, Read, Show)++_Ws = Model.Name "hydra.core.ast.Ws"++_Ws_none = Model.Name "none"++_Ws_space = Model.Name "space"++_Ws_break = Model.Name "break"++_Ws_breakAndIndent = Model.Name "breakAndIndent"++_Ws_doubleBreak = Model.Name "doubleBreak"
@@ -0,0 +1,726 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Type checking and type reconstruction (type-of) for the results of Hydra unification and inference++module Hydra.Core.Checking where++import qualified Hydra.Core.Ast as Ast+import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Constants as Constants+import qualified Hydra.Core.Dependencies as Dependencies+import qualified Hydra.Core.Diff as Diff+import qualified Hydra.Core.Docs as Docs+import qualified Hydra.Core.Error.Checking as Checking+import qualified Hydra.Core.Error.File as ErrorFile+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Error.Packaging as ErrorPackaging+import qualified Hydra.Core.Error.System as ErrorSystem+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.Extract.Model as ExtractModel+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Formatting as Formatting+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Json.Model as JsonModel+import qualified Hydra.Core.Lexical as Lexical+import qualified Hydra.Core.Overlay.Haskell.Lib.Eithers as Eithers+import qualified Hydra.Core.Overlay.Haskell.Lib.Equality as Equality+import qualified Hydra.Core.Overlay.Haskell.Lib.Lists as Lists+import qualified Hydra.Core.Overlay.Haskell.Lib.Literals as Literals+import qualified Hydra.Core.Overlay.Haskell.Lib.Logic as Logic+import qualified Hydra.Core.Overlay.Haskell.Lib.Maps as Maps+import qualified Hydra.Core.Overlay.Haskell.Lib.Optionals as Optionals+import qualified Hydra.Core.Overlay.Haskell.Lib.Pairs as Pairs+import qualified Hydra.Core.Overlay.Haskell.Lib.Sets as Sets+import qualified Hydra.Core.Overlay.Haskell.Lib.Strings as Strings+import qualified Hydra.Core.Markdown as Markdown+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Names as Names+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Parsing as Parsing+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Print.Errors as PrintErrors+import qualified Hydra.Core.Print.Model as PrintModel+import qualified Hydra.Core.Print.Variants as PrintVariants+import qualified Hydra.Core.Query as Query+import qualified Hydra.Core.Reflect as Reflect+import qualified Hydra.Core.Regex as Regex+import qualified Hydra.Core.Relational as Relational+import qualified Hydra.Core.Resolution as Resolution+import qualified Hydra.Core.Rewriting as Rewriting+import qualified Hydra.Core.Scoping as Scoping+import qualified Hydra.Core.Strip as Strip+import qualified Hydra.Core.Substitution as Substitution+import qualified Hydra.Core.System as System+import qualified Hydra.Core.Tabular as Tabular+import qualified Hydra.Core.Testing as Testing+import qualified Hydra.Core.Time as Time+import qualified Hydra.Core.Topology as Topology+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Validation as Validation+import qualified Hydra.Core.Variables as Variables+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void+import qualified Data.Map as M+import qualified Data.Set as S++-- | True if every element of the list is equal to every other element (vacuously true for the empty list)+allEqual :: Eq t0 => ([t0] -> Bool)+allEqual els =+ Optionals.match (Lists.uncons els) True (\uc ->+ let h = Pairs.first uc+ t = Pairs.second uc+ in (Lists.foldl (\b -> \x -> Logic.and b (Equality.equal x h)) True t))++-- | Apply type arguments to a type, substituting forall-bound variables. Paper: inference.tex, 'Checking the witness' (consuming the pending-type-argument stack).+applyTypeArgumentsToType :: Typing.InferenceContext -> Graph.Graph -> [Model.Type] -> Model.Type -> Either Errors.Error Model.Type+applyTypeArgumentsToType cx tx typeArgs t =+ Optionals.match (Lists.uncons typeArgs) (Right t) (\uc ->+ let ah = Pairs.first uc+ at = Pairs.second uc+ in case t of+ Model.TypeForall v0 ->+ let v = Model.forallTypeParameter v0+ tbody = Model.forallTypeBody v0+ in (applyTypeArgumentsToType cx tx at (Substitution.substInType (Typing.TypeSubst (Maps.singleton v ah)) tbody))+ Model.TypeVariable v0 -> Eithers.either (\_ -> Left (Errors.ErrorExtraction (Errors.ExtractionErrorUnexpectedShape (Errors.UnexpectedShapeError {+ Errors.unexpectedShapeErrorExpected = "forall type",+ Errors.unexpectedShapeErrorActual = (Strings.concat [+ PrintModel.type_ t,+ ". Trying to apply ",+ (Literals.printInt32 (Lists.length typeArgs)),+ " type args: ",+ (Formatting.showList PrintModel.type_ typeArgs)])})))) (\schemaRes ->+ let schemaType = Pairs.first schemaRes+ schemaBody = Strip.deannotateType (Model.typeSchemeBody schemaType)+ in case schemaBody of+ Model.TypeForall _ -> applyTypeArgumentsToType cx tx typeArgs schemaBody+ _ -> Right t) (Resolution.requireSchemaType cx (Graph.graphSchemaTypes tx) v0)+ _ -> Left (Errors.ErrorExtraction (Errors.ExtractionErrorUnexpectedShape (Errors.UnexpectedShapeError {+ Errors.unexpectedShapeErrorExpected = "forall type",+ Errors.unexpectedShapeErrorActual = (Strings.concat [+ PrintModel.type_ t,+ ". Trying to apply ",+ (Literals.printInt32 (Lists.length typeArgs)),+ " type args: ",+ (Formatting.showList PrintModel.type_ typeArgs),+ ". Context has vars: {",+ (Strings.join ", " (Lists.map Model.unName (Maps.keys (Graph.graphBoundTypes tx)))),+ "}"])}))))++-- | Check that a term has no unbound type variables (Either version). Paper: inference.tex, 'Checking the witness' (always-on finalization invariant).+checkForUnboundTypeVariables :: t0 -> Graph.Graph -> Model.Term -> Either Errors.Error ()+checkForUnboundTypeVariables cx tx term0 =++ let svars = Sets.fromList (Maps.keys (Graph.graphSchemaTypes tx))+ checkRecursive =+ \vars -> \trace -> \lbinding -> \term ->+ let recurse = checkRecursive vars trace lbinding+ dflt = Eithers.bind (Eithers.mapList recurse (Rewriting.subterms term)) (\_ -> Right ())+ check =+ \typ ->+ let freevars = Variables.freeVariablesInType typ+ badvars = Sets.difference (Sets.difference freevars vars) svars+ in (Logic.ifElse (Sets.isEmpty badvars) (Right ()) (Left (Errors.ErrorChecking (Checking.CheckingErrorUnboundTypeVariables (Checking.UnboundTypeVariablesError {+ Checking.unboundTypeVariablesErrorVariables = badvars,+ Checking.unboundTypeVariablesErrorType = typ})))))+ checkOptional = \m -> Eithers.bind (Eithers.mapOptional check m) (\_ -> Right ())+ in case term of+ Model.TermLambda v0 -> Eithers.bind (checkOptional (Model.lambdaDomain v0)) (\_ -> recurse (Model.lambdaBody v0))+ Model.TermLet v0 ->+ let forBinding =+ \b ->+ let bterm = Model.bindingTerm b+ newVars =+ Optionals.match (Model.bindingTypeScheme b) vars (\ts -> Sets.union vars (Sets.fromList (Model.typeSchemeVariables ts)))+ newTrace = Lists.cons (Model.unName (Model.bindingName b)) trace+ in (checkRecursive newVars newTrace (Just b) bterm)+ in (Eithers.bind (Eithers.mapList forBinding (Model.letBindings v0)) (\_ -> recurse (Model.letBody v0)))+ Model.TermTypeApplication v0 -> Eithers.bind (check (Model.typeApplicationTermType v0)) (\_ -> recurse (Model.typeApplicationTermBody v0))+ Model.TermTypeLambda v0 -> Eithers.bind (check (Model.TypeVariable (Model.typeLambdaParameter v0))) (\_ -> recurse (Model.typeLambdaBody v0))+ _ -> dflt+ in (checkRecursive Sets.empty [+ "top level"] Nothing term0)++-- | Ensure all types in a list are equal and return the common type+checkSameType :: t0 -> Graph.Graph -> String -> [Model.Type] -> Either Errors.Error Model.Type+checkSameType cx tx desc types =++ let unequalErr =+ Left (Errors.ErrorChecking (Checking.CheckingErrorUnequalTypes (Checking.UnequalTypesError {+ Checking.unequalTypesErrorTypes = types,+ Checking.unequalTypesErrorDescription = desc})))+ in (Logic.ifElse (typesAllEffectivelyEqual tx types) (Optionals.match (Lists.head types) unequalErr (\t -> Right t)) unequalErr)++-- | Sanity-check a type substitution arising from unification. Specifically, check that schema types have not been inappropriately unified with type variables inferred from terms. Paper: inference.tex, 'Checking the witness' (always-on invariant: a substitution may not bind a type name as if it were an inference variable).+checkTypeSubst :: t0 -> Graph.Graph -> Typing.TypeSubst -> Either Errors.Error Typing.TypeSubst+checkTypeSubst cx tx subst =++ let s = Typing.unTypeSubst subst+ vars = Sets.fromList (Maps.keys s)+ suspectVars = Sets.intersection vars (Sets.fromList (Maps.keys (Graph.graphSchemaTypes tx)))+ isNominal =+ \ts -> case (Strip.deannotateType (Model.typeSchemeBody ts)) of+ Model.TypeRecord _ -> True+ Model.TypeUnion _ -> True+ Model.TypeWrap _ -> True+ _ -> False+ badVars =+ Sets.fromList (Lists.filter (\v -> Optionals.match (Lexical.dereferenceSchemaType v (Graph.graphSchemaTypes tx)) False isNominal) (Sets.toList suspectVars))+ badPairs = Lists.filter (\p -> Sets.member (Pairs.first p) badVars) (Maps.toList s)+ printPair =+ \p -> Strings.concat2 (Strings.concat2 (Model.unName (Pairs.first p)) " --> ") (PrintModel.type_ (Pairs.second p))+ in (Logic.ifElse (Sets.isEmpty badVars) (Right subst) (Left (Errors.ErrorChecking (Checking.CheckingErrorIncorrectUnification (Checking.IncorrectUnificationError {+ Checking.incorrectUnificationErrorSubstitution = subst})))))++-- | Check if a type contains any type variable from the current scope+containsInScopeTypeVars :: Graph.Graph -> Model.Type -> Bool+containsInScopeTypeVars tx t =++ let vars = Graph.graphTypeVariables tx+ freeVars = Variables.freeVariablesInTypeSimple t+ in (Logic.not (Sets.isEmpty (Sets.intersection vars freeVars)))++-- | Normalize free type variables in a type to canonical names based on order of first occurrence. This allows comparing types that differ only in the naming of free type variables. Paper: inference.tex, 'Checking the witness' (effective equality).+normalizeTypeFreeVars :: Model.Type -> Model.Type+normalizeTypeFreeVars typ =++ let collectVars =+ \acc -> \t -> case t of+ Model.TypeVariable v0 -> Logic.ifElse (Maps.member v0 acc) acc (Maps.insert v0 (Model.Name (Strings.concat2 "_tv" (Literals.printInt32 (Maps.size acc)))) acc)+ _ -> acc+ subst = Rewriting.foldOverType Coders.TraversalOrderPre collectVars Maps.empty typ+ in (Variables.substituteTypeVariables subst typ)++-- | Get the bound types from a graph as a type environment+toFContext :: Graph.Graph -> M.Map Model.Name Model.Type+toFContext cx = Maps.map Scoping.typeSchemeToFType (Graph.graphBoundTypes cx)++-- | Check whether two lists of types are effectively equal, disregarding type aliases+typeListsEffectivelyEqual :: Graph.Graph -> [Model.Type] -> [Model.Type] -> Bool+typeListsEffectivelyEqual tx tlist1 tlist2 =+ Logic.ifElse (Equality.equal (Lists.length tlist1) (Lists.length tlist2)) (Lists.foldl Logic.and True (Lists.zipWith (typesEffectivelyEqual tx) tlist1 tlist2)) False++-- | Given a type context, reconstruct the type of a System F term. Paper: inference.tex, 'Checking the witness' -- the executable form of the System F typing judgment in the soundness theorem.+typeOf :: Typing.InferenceContext -> Graph.Graph -> [Model.Type] -> Model.Term -> Either Errors.Error (Model.Type, Typing.InferenceContext)+typeOf cx tx typeArgs term =++ let cx1 = cx+ in case term of+ Model.TermAnnotated v0 -> typeOfAnnotatedTerm cx1 tx typeArgs v0+ Model.TermApplication v0 -> typeOfApplication cx1 tx typeArgs v0+ Model.TermCases v0 -> typeOfCaseStatement cx1 tx typeArgs v0+ Model.TermEither v0 -> typeOfEither cx1 tx typeArgs v0+ Model.TermLambda v0 -> typeOfLambda cx1 tx typeArgs v0+ Model.TermLet v0 -> typeOfLet cx1 tx typeArgs v0+ Model.TermList v0 -> typeOfList cx1 tx typeArgs v0+ Model.TermLiteral v0 -> typeOfLiteral cx1 tx typeArgs v0+ Model.TermMap v0 -> typeOfMap cx1 tx typeArgs v0+ Model.TermOptional v0 -> typeOfMaybe cx1 tx typeArgs v0+ Model.TermPair v0 -> typeOfPair cx1 tx typeArgs v0+ Model.TermProject v0 -> typeOfProjection cx1 tx typeArgs v0+ Model.TermRecord v0 -> typeOfRecord cx1 tx typeArgs v0+ Model.TermSet v0 -> typeOfSet cx1 tx typeArgs v0+ Model.TermTypeApplication v0 -> typeOfTypeApplication cx1 tx typeArgs v0+ Model.TermTypeLambda v0 -> typeOfTypeLambda cx1 tx typeArgs v0+ Model.TermInject v0 -> typeOfInjection cx1 tx typeArgs v0+ Model.TermUnit -> typeOfUnit cx1 tx typeArgs+ Model.TermUnwrap v0 -> typeOfUnwrap cx1 tx typeArgs v0+ Model.TermVariable v0 -> typeOfVariable cx1 tx typeArgs v0+ Model.TermWrap v0 -> typeOfWrappedTerm cx1 tx typeArgs v0+ _ -> Left (Errors.ErrorChecking (Checking.CheckingErrorUnsupportedTermVariant (Checking.UnsupportedTermVariantError {+ Checking.unsupportedTermVariantErrorTermVariant = (Reflect.termVariant term)})))++-- | Reconstruct the type of an annotated term (Either/InferenceContext version). Paper: inference.tex, rule Ann (checking side).+typeOfAnnotatedTerm :: Typing.InferenceContext -> Graph.Graph -> [Model.Type] -> Model.AnnotatedTerm -> Either Errors.Error (Model.Type, Typing.InferenceContext)+typeOfAnnotatedTerm cx tx typeArgs at = typeOf cx tx typeArgs (Model.annotatedTermBody at)++-- | Reconstruct the type of an application term (Either/InferenceContext version). Paper: inference.tex, rule App (checking side).+typeOfApplication :: Typing.InferenceContext -> Graph.Graph -> [Model.Type] -> Model.Application -> Either Errors.Error (Model.Type, Typing.InferenceContext)+typeOfApplication cx tx typeArgs app =++ let fun = Model.applicationFunction app+ arg = Model.applicationArgument app+ tryType =+ \cx0 -> \tfun -> \targ -> case tfun of+ Model.TypeForall v0 -> tryType cx0 (Model.forallTypeBody v0) targ+ Model.TypeFunction v0 ->+ let dom = Model.functionTypeDomain v0+ cod = Model.functionTypeCodomain v0+ in (Logic.ifElse (typesEffectivelyEqual tx dom targ) (Right (cod, cx0)) (Left (Errors.ErrorChecking (Checking.CheckingErrorTypeMismatch (Checking.TypeMismatchError {+ Checking.typeMismatchErrorExpectedType = dom,+ Checking.typeMismatchErrorActualType = targ})))))+ Model.TypeVariable _ ->+ let nameResult = Names.freshName cx0+ freshN = Pairs.first nameResult+ cx1 = Pairs.second nameResult+ in (Right (Model.TypeVariable freshN, cx1))+ _ -> Left (Errors.ErrorChecking (Checking.CheckingErrorNotAFunctionType (Checking.NotAFunctionTypeError {+ Checking.notAFunctionTypeErrorType = tfun})))+ in (Eithers.bind (typeOf cx tx [] fun) (\result1 ->+ let tfun = Pairs.first result1+ cx2 = Pairs.second result1+ in (Eithers.bind (typeOf cx2 tx [] arg) (\result2 ->+ let targ = Pairs.first result2+ cx3 = Pairs.second result2+ in (Eithers.bind (tryType cx3 tfun targ) (\result3 ->+ let t = Pairs.first result3+ cx4 = Pairs.second result3+ in (Eithers.bind (applyTypeArgumentsToType cx4 tx typeArgs t) (\applied -> Right (applied, cx4)))))))))++-- | Reconstruct the type of a case statement (Either/InferenceContext version). Paper: inference.tex, rules Case and Case_d (checking side).+typeOfCaseStatement :: Typing.InferenceContext -> Graph.Graph -> [Model.Type] -> Model.CaseStatement -> Either Errors.Error (Model.Type, Typing.InferenceContext)+typeOfCaseStatement cx tx typeArgs cs =++ let tname = Model.caseStatementTypeName cs+ dflt = Model.caseStatementDefault cs+ match = Model.caseStatementCases cs+ cterms = Lists.map Model.caseAlternativeHandler match+ in (Eithers.bind (Eithers.mapOptional (\e -> typeOf cx tx [] e) dflt) (\dfltResult ->+ let tdflt = Optionals.map Pairs.first dfltResult+ cx2 = Optionals.match dfltResult cx Pairs.second+ foldResult =+ Lists.foldl (\acc -> \term -> Eithers.bind acc (\accR ->+ let types = Pairs.first accR+ cxA = Pairs.second accR+ in (Eithers.bind (typeOf cxA tx [] term) (\tResult ->+ let t = Pairs.first tResult+ cxB = Pairs.second tResult+ in (Right (Lists.concat2 types (Lists.singleton t), cxB)))))) (Right ([], cx2)) cterms+ in (Eithers.bind foldResult (\foldR ->+ let tcterms = Pairs.first foldR+ cx3 = Pairs.second foldR+ fcodsResult =+ Lists.foldl (\acc -> \t -> Eithers.bind acc (\accR ->+ let cods = Pairs.first accR+ in (Eithers.bind (ExtractModel.functionType t) (\ft -> Right (Lists.concat2 cods (Lists.singleton (Model.functionTypeCodomain ft)), cx3))))) (Right ([], cx3)) tcterms+ in (Eithers.bind fcodsResult (\fcodsR ->+ let fcods = Pairs.first fcodsR+ cods = Optionals.givens (Lists.cons tdflt (Lists.map Optionals.given fcods))+ in (Eithers.bind (checkSameType cx3 tx "case branches" cods) (\cod -> Right (+ Model.TypeFunction (Model.FunctionType {+ Model.functionTypeDomain = (Resolution.nominalApplication tname typeArgs),+ Model.functionTypeCodomain = cod}),+ cx3)))))))))++-- | Reconstruct the type of an either value (Either/InferenceContext version). Paper: inference.tex, rules Eith_L and Eith_R (checking side).+typeOfEither :: Typing.InferenceContext -> Graph.Graph -> [Model.Type] -> Either Model.Term Model.Term -> Either Errors.Error (Model.Type, Typing.InferenceContext)+typeOfEither cx tx typeArgs et =++ let n = Lists.length typeArgs+ arityErr =+ Left (Errors.ErrorChecking (Checking.CheckingErrorTypeArityMismatch (Checking.TypeArityMismatchError {+ Checking.typeArityMismatchErrorType = (Model.TypeEither (Model.EitherType {+ Model.eitherTypeLeft = Model.TypeUnit,+ Model.eitherTypeRight = Model.TypeUnit})),+ Checking.typeArityMismatchErrorExpectedArity = 2,+ Checking.typeArityMismatchErrorActualArity = n,+ Checking.typeArityMismatchErrorTypeArguments = typeArgs})))+ in (Optionals.match (Lists.uncons typeArgs) arityErr (\uc0 ->+ let ta0 = Pairs.first uc0+ in (Optionals.match (Lists.uncons (Pairs.second uc0)) arityErr (\uc1 ->+ let ta1 = Pairs.first uc1+ in (Logic.ifElse (Equality.equal n 2) (Eithers.either (\leftTerm -> Eithers.bind (typeOf cx tx [] leftTerm) (\result ->+ let leftType = Pairs.first result+ cx2 = Pairs.second result+ in (Right (+ Model.TypeEither (Model.EitherType {+ Model.eitherTypeLeft = leftType,+ Model.eitherTypeRight = ta1}),+ cx2)))) (\rightTerm -> Eithers.bind (typeOf cx tx [] rightTerm) (\result ->+ let rightType = Pairs.first result+ cx2 = Pairs.second result+ in (Right (+ Model.TypeEither (Model.EitherType {+ Model.eitherTypeLeft = ta0,+ Model.eitherTypeRight = rightType}),+ cx2)))) et) arityErr)))))++-- | Reconstruct the type of a union injection (Either/InferenceContext version). Paper: inference.tex, rule Inj (checking side).+typeOfInjection :: Typing.InferenceContext -> Graph.Graph -> [Model.Type] -> Model.Injection -> Either Errors.Error (Model.Type, Typing.InferenceContext)+typeOfInjection cx tx typeArgs injection =++ let tname = Model.injectionTypeName injection+ field = Model.injectionField injection+ fname = Model.fieldName field+ fterm = Model.fieldTerm field+ in (Eithers.bind (Resolution.requireSchemaType cx (Graph.graphSchemaTypes tx) tname) (\schemaResult ->+ let schemaType = Pairs.first schemaResult+ cx2 = Pairs.second schemaResult+ svars = Model.typeSchemeVariables schemaType+ sbody = Model.typeSchemeBody schemaType+ in (Eithers.bind (ExtractModel.unionType tname sbody) (\sfields -> Eithers.bind (Resolution.findFieldType cx2 fname sfields) (\ftyp -> Right (Resolution.nominalApplication tname typeArgs, cx2))))))++-- | Reconstruct the type of a lambda function (Either/InferenceContext version). Paper: inference.tex, rule Abs (checking side).+typeOfLambda :: Typing.InferenceContext -> Graph.Graph -> [Model.Type] -> Model.Lambda -> Either Errors.Error (Model.Type, Typing.InferenceContext)+typeOfLambda cx tx typeArgs l =++ let v = Model.lambdaParameter l+ mdom = Model.lambdaDomain l+ body = Model.lambdaBody l+ in (Eithers.bind (Optionals.match mdom (Left (Errors.ErrorChecking (Checking.CheckingErrorUntypedLambda (Checking.UntypedLambdaError {+ })))) (\dom ->+ let types2 = Maps.insert v (Scoping.fTypeToTypeScheme dom) (Graph.graphBoundTypes tx)+ in (Eithers.bind (typeOf cx (Graph.Graph {+ Graph.graphBoundTerms = (Graph.graphBoundTerms tx),+ Graph.graphBoundTypes = types2,+ Graph.graphClassConstraints = (Graph.graphClassConstraints tx),+ Graph.graphLambdaVariables = (Graph.graphLambdaVariables tx),+ Graph.graphMetadata = (Graph.graphMetadata tx),+ Graph.graphPrimitives = (Graph.graphPrimitives tx),+ Graph.graphSchemaTypes = (Graph.graphSchemaTypes tx),+ Graph.graphTypeVariables = (Graph.graphTypeVariables tx)}) [] body) (\codResult ->+ let cod = Pairs.first codResult+ cx2 = Pairs.second codResult+ in (Right (+ Model.TypeFunction (Model.FunctionType {+ Model.functionTypeDomain = dom,+ Model.functionTypeCodomain = cod}),+ cx2)))))) (\tbodyResult ->+ let tbody = Pairs.first tbodyResult+ cx3 = Pairs.second tbodyResult+ in (Eithers.bind (applyTypeArgumentsToType cx3 tx typeArgs tbody) (\applied -> Right (applied, cx3)))))++-- | Reconstruct the type of a let binding (Either/InferenceContext version). Paper: inference.tex, rule Let (checking side).+typeOfLet :: Typing.InferenceContext -> Graph.Graph -> [Model.Type] -> Model.Let -> Either Errors.Error (Model.Type, Typing.InferenceContext)+typeOfLet cx tx typeArgs letTerm =++ let bs = Model.letBindings letTerm+ body = Model.letBody letTerm+ bnames = Lists.map Model.bindingName bs+ bindingType =+ \b -> Optionals.match (Model.bindingTypeScheme b) (Left (Errors.ErrorChecking (Checking.CheckingErrorUntypedLetBinding (Checking.UntypedLetBindingError {+ Checking.untypedLetBindingErrorBinding = b})))) (\ts -> Right (Scoping.typeSchemeToFType ts))+ btypesResult =+ Lists.foldl (\acc -> \b -> Eithers.bind acc (\accR ->+ let types = Pairs.first accR+ in (Eithers.bind (bindingType b) (\btype -> Right (Lists.concat2 types (Lists.singleton btype), ()))))) (Right ([], ())) bs+ in (Eithers.bind btypesResult (\btypesR ->+ let btypes = Pairs.first btypesR+ tx2 =+ Graph.Graph {+ Graph.graphBoundTerms = (Graph.graphBoundTerms tx),+ Graph.graphBoundTypes = (Maps.union (Maps.fromList (Lists.zip bnames (Lists.map Scoping.fTypeToTypeScheme btypes))) (Graph.graphBoundTypes tx)),+ Graph.graphClassConstraints = (Graph.graphClassConstraints tx),+ Graph.graphLambdaVariables = (Graph.graphLambdaVariables tx),+ Graph.graphMetadata = (Graph.graphMetadata tx),+ Graph.graphPrimitives = (Graph.graphPrimitives tx),+ Graph.graphSchemaTypes = (Graph.graphSchemaTypes tx),+ Graph.graphTypeVariables = (Graph.graphTypeVariables tx)}+ in (Eithers.bind (typeOf cx tx2 [] body) (\tResult ->+ let t = Pairs.first tResult+ cx2 = Pairs.second tResult+ in (Eithers.bind (applyTypeArgumentsToType cx2 tx typeArgs t) (\applied -> Right (applied, cx2)))))))++-- | Reconstruct the type of a list (Either/InferenceContext version). Paper: inference.tex, rules Lst_0 and Lst_+ (checking side).+typeOfList :: Typing.InferenceContext -> Graph.Graph -> [Model.Type] -> [Model.Term] -> Either Errors.Error (Model.Type, Typing.InferenceContext)+typeOfList cx tx typeArgs els =++ let listArityErr =+ Left (Errors.ErrorChecking (Checking.CheckingErrorTypeArityMismatch (Checking.TypeArityMismatchError {+ Checking.typeArityMismatchErrorType = (Model.TypeList Model.TypeUnit),+ Checking.typeArityMismatchErrorExpectedArity = 1,+ Checking.typeArityMismatchErrorActualArity = (Lists.length typeArgs),+ Checking.typeArityMismatchErrorTypeArguments = typeArgs})))+ in (Logic.ifElse (Lists.isEmpty els) (Logic.ifElse (Equality.equal (Lists.length typeArgs) 1) (Optionals.match (Lists.head typeArgs) listArityErr (\ta0 -> Right (Model.TypeList ta0, cx))) listArityErr) (+ let foldResult =+ Lists.foldl (\acc -> \term -> Eithers.bind acc (\accR ->+ let types = Pairs.first accR+ cxA = Pairs.second accR+ in (Eithers.bind (typeOf cxA tx [] term) (\tResult ->+ let t = Pairs.first tResult+ cxB = Pairs.second tResult+ in (Right (Lists.concat2 types (Lists.singleton t), cxB)))))) (Right ([], cx)) els+ in (Eithers.bind foldResult (\foldR ->+ let eltypes = Pairs.first foldR+ cx2 = Pairs.second foldR+ in (Eithers.bind (checkSameType cx2 tx "list elements" eltypes) (\unifiedType -> Right (Model.TypeList unifiedType, cx2)))))))++-- | Reconstruct the type of a literal (Either/InferenceContext version). Paper: inference.tex, rule Lit (checking side).+typeOfLiteral :: Typing.InferenceContext -> Graph.Graph -> [Model.Type] -> Model.Literal -> Either Errors.Error (Model.Type, Typing.InferenceContext)+typeOfLiteral cx tx typeArgs lit =++ let t = Model.TypeLiteral (Reflect.literalType lit)+ in (Eithers.bind (applyTypeArgumentsToType cx tx typeArgs t) (\applied -> Right (applied, cx)))++-- | Reconstruct the type of a map (Either/InferenceContext version). Paper: inference.tex, rules Map_0 and Map_+ (checking side).+typeOfMap :: Typing.InferenceContext -> Graph.Graph -> [Model.Type] -> M.Map Model.Term Model.Term -> Either Errors.Error (Model.Type, Typing.InferenceContext)+typeOfMap cx tx typeArgs m =++ let mapArityErr =+ Left (Errors.ErrorChecking (Checking.CheckingErrorTypeArityMismatch (Checking.TypeArityMismatchError {+ Checking.typeArityMismatchErrorType = (Model.TypeMap (Model.MapType {+ Model.mapTypeKeys = Model.TypeUnit,+ Model.mapTypeValues = Model.TypeUnit})),+ Checking.typeArityMismatchErrorExpectedArity = 2,+ Checking.typeArityMismatchErrorActualArity = (Lists.length typeArgs),+ Checking.typeArityMismatchErrorTypeArguments = typeArgs})))+ in (Logic.ifElse (Maps.isEmpty m) (Logic.ifElse (Equality.equal (Lists.length typeArgs) 2) (Optionals.match (Lists.uncons typeArgs) mapArityErr (\uc0 ->+ let ta0 = Pairs.first uc0+ in (Optionals.match (Lists.uncons (Pairs.second uc0)) mapArityErr (\uc1 ->+ let ta1 = Pairs.first uc1+ in (Right (+ Model.TypeMap (Model.MapType {+ Model.mapTypeKeys = ta0,+ Model.mapTypeValues = ta1}),+ cx)))))) mapArityErr) (+ let pairs = Maps.toList m+ keyFoldResult =+ Lists.foldl (\acc -> \p -> Eithers.bind acc (\accR ->+ let types = Pairs.first accR+ cxA = Pairs.second accR+ in (Eithers.bind (typeOf cxA tx [] (Pairs.first p)) (\tResult ->+ let t = Pairs.first tResult+ cxB = Pairs.second tResult+ in (Right (Lists.concat2 types (Lists.singleton t), cxB)))))) (Right ([], cx)) pairs+ in (Eithers.bind keyFoldResult (\keyFoldR ->+ let keyTypes = Pairs.first keyFoldR+ cx2 = Pairs.second keyFoldR+ in (Eithers.bind (checkSameType cx2 tx "map keys" keyTypes) (\kt ->+ let valFoldResult =+ Lists.foldl (\acc -> \p -> Eithers.bind acc (\accR ->+ let types = Pairs.first accR+ cxA = Pairs.second accR+ in (Eithers.bind (typeOf cxA tx [] (Pairs.second p)) (\tResult ->+ let t = Pairs.first tResult+ cxB = Pairs.second tResult+ in (Right (Lists.concat2 types (Lists.singleton t), cxB)))))) (Right ([], cx2)) pairs+ in (Eithers.bind valFoldResult (\valFoldR ->+ let valTypes = Pairs.first valFoldR+ cx3 = Pairs.second valFoldR+ in (Eithers.bind (checkSameType cx3 tx "map values" valTypes) (\vt -> Eithers.bind (applyTypeArgumentsToType cx3 tx typeArgs (Model.TypeMap (Model.MapType {+ Model.mapTypeKeys = kt,+ Model.mapTypeValues = vt}))) (\applied -> Right (applied, cx3))))))))))))++-- | Reconstruct the type of an optional value (Either/InferenceContext version). Paper: inference.tex, rules Opt_0 and Opt_1 (checking side).+typeOfMaybe :: Typing.InferenceContext -> Graph.Graph -> [Model.Type] -> Maybe Model.Term -> Either Errors.Error (Model.Type, Typing.InferenceContext)+typeOfMaybe cx tx typeArgs mt =++ let forNothing =++ let n = Lists.length typeArgs+ maybeArityErr =+ Left (Errors.ErrorChecking (Checking.CheckingErrorTypeArityMismatch (Checking.TypeArityMismatchError {+ Checking.typeArityMismatchErrorType = (Model.TypeOptional Model.TypeUnit),+ Checking.typeArityMismatchErrorExpectedArity = 1,+ Checking.typeArityMismatchErrorActualArity = n,+ Checking.typeArityMismatchErrorTypeArguments = typeArgs})))+ in (Logic.ifElse (Equality.equal n 1) (Optionals.match (Lists.head typeArgs) maybeArityErr (\ta0 -> Right (Model.TypeOptional ta0, cx))) maybeArityErr)+ forJust =+ \term -> Eithers.bind (typeOf cx tx [] term) (\tResult ->+ let termType = Pairs.first tResult+ cx2 = Pairs.second tResult+ t = Model.TypeOptional termType+ in (Eithers.bind (applyTypeArgumentsToType cx2 tx typeArgs t) (\applied -> Right (applied, cx2))))+ in (Optionals.match mt forNothing forJust)++-- | Reconstruct the type of a pair (Either/InferenceContext version). Paper: inference.tex, rule Pair (checking side).+typeOfPair :: Typing.InferenceContext -> Graph.Graph -> [Model.Type] -> (Model.Term, Model.Term) -> Either Errors.Error (Model.Type, Typing.InferenceContext)+typeOfPair cx tx typeArgs p =++ let n = Lists.length typeArgs+ in (Logic.ifElse (Equality.equal n 2) (+ let pairFst = Pairs.first p+ pairSnd = Pairs.second p+ in (Eithers.bind (typeOf cx tx [] pairFst) (\result1 ->+ let firstType = Pairs.first result1+ cx2 = Pairs.second result1+ in (Eithers.bind (typeOf cx2 tx [] pairSnd) (\result2 ->+ let secondType = Pairs.first result2+ cx3 = Pairs.second result2+ in (Right (+ Model.TypePair (Model.PairType {+ Model.pairTypeFirst = firstType,+ Model.pairTypeSecond = secondType}),+ cx3))))))) (Left (Errors.ErrorChecking (Checking.CheckingErrorTypeArityMismatch (Checking.TypeArityMismatchError {+ Checking.typeArityMismatchErrorType = (Model.TypePair (Model.PairType {+ Model.pairTypeFirst = Model.TypeUnit,+ Model.pairTypeSecond = Model.TypeUnit})),+ Checking.typeArityMismatchErrorExpectedArity = 2,+ Checking.typeArityMismatchErrorActualArity = n,+ Checking.typeArityMismatchErrorTypeArguments = typeArgs})))))++-- | Reconstruct the type of a primitive function (Either/InferenceContext version). Paper: inference.tex, rule Prim (checking side).+typeOfPrimitive :: Typing.InferenceContext -> Graph.Graph -> [Model.Type] -> Model.Name -> Either Errors.Error (Model.Type, Typing.InferenceContext)+typeOfPrimitive cx tx typeArgs name =++ let rawTs =+ Optionals.map (\_p -> Scoping.termSignatureToTypeScheme (Packaging.primitiveDefinitionSignature (Graph.primitiveDefinition _p))) (Maps.lookup name (Graph.graphPrimitives tx))+ in (Optionals.match rawTs (Left (Errors.ErrorUndefinedTermVariable (ErrorModel.UndefinedTermVariableError {+ ErrorModel.undefinedTermVariableErrorLocation = (Paths.SubtermPath []),+ ErrorModel.undefinedTermVariableErrorName = name}))) (\tsRaw ->+ let instResult = Resolution.instantiateTypeScheme cx tsRaw+ ts = Pairs.first instResult+ cx2 = Pairs.second instResult+ t = Scoping.typeSchemeToFType ts+ in (Eithers.bind (applyTypeArgumentsToType cx2 tx typeArgs t) (\applied -> Right (applied, cx2)))))++-- | Reconstruct the type of a record projection (Either/InferenceContext version). Paper: inference.tex, rule Proj (checking side).+typeOfProjection :: Typing.InferenceContext -> Graph.Graph -> [Model.Type] -> Model.Projection -> Either Errors.Error (Model.Type, Typing.InferenceContext)+typeOfProjection cx tx typeArgs p =++ let tname = Model.projectionTypeName p+ fname = Model.projectionFieldName p+ in (Eithers.bind (Resolution.requireSchemaType cx (Graph.graphSchemaTypes tx) tname) (\schemaResult ->+ let schemaType = Pairs.first schemaResult+ cx2 = Pairs.second schemaResult+ svars = Model.typeSchemeVariables schemaType+ sbody = Model.typeSchemeBody schemaType+ in (Eithers.bind (ExtractModel.recordType tname sbody) (\sfields -> Eithers.bind (Resolution.findFieldType cx2 fname sfields) (\ftyp ->+ let subst = Typing.TypeSubst (Maps.fromList (Lists.zip svars typeArgs))+ sftyp = Substitution.substInType subst ftyp+ in (Right (+ Model.TypeFunction (Model.FunctionType {+ Model.functionTypeDomain = (Resolution.nominalApplication tname typeArgs),+ Model.functionTypeCodomain = sftyp}),+ cx2)))))))++-- | Reconstruct the type of a record (Either/InferenceContext version). Paper: inference.tex, rule Rec (checking side).+typeOfRecord :: Typing.InferenceContext -> Graph.Graph -> [Model.Type] -> Model.Record -> Either Errors.Error (Model.Type, Typing.InferenceContext)+typeOfRecord cx tx typeArgs record =++ let tname = Model.recordTypeName record+ fields = Model.recordFields record+ foldResult =+ Lists.foldl (\acc -> \term -> Eithers.bind acc (\accR ->+ let types = Pairs.first accR+ cxA = Pairs.second accR+ in (Eithers.bind (typeOf cxA tx [] term) (\tResult ->+ let t = Pairs.first tResult+ cxB = Pairs.second tResult+ in (Right (Lists.concat2 types (Lists.singleton t), cxB)))))) (Right ([], cx)) (Lists.map Model.fieldTerm fields)+ in (Eithers.bind foldResult (\foldR ->+ let cx2 = Pairs.second foldR+ in (Right (Resolution.nominalApplication tname typeArgs, cx2))))++-- | Reconstruct the type of a set (Either/InferenceContext version). Paper: inference.tex, rules Set_0 and Set_+ (checking side).+typeOfSet :: Typing.InferenceContext -> Graph.Graph -> [Model.Type] -> S.Set Model.Term -> Either Errors.Error (Model.Type, Typing.InferenceContext)+typeOfSet cx tx typeArgs els =++ let setArityErr =+ Left (Errors.ErrorChecking (Checking.CheckingErrorTypeArityMismatch (Checking.TypeArityMismatchError {+ Checking.typeArityMismatchErrorType = (Model.TypeSet Model.TypeUnit),+ Checking.typeArityMismatchErrorExpectedArity = 1,+ Checking.typeArityMismatchErrorActualArity = (Lists.length typeArgs),+ Checking.typeArityMismatchErrorTypeArguments = typeArgs})))+ in (Logic.ifElse (Sets.isEmpty els) (Logic.ifElse (Equality.equal (Lists.length typeArgs) 1) (Optionals.match (Lists.head typeArgs) setArityErr (\ta0 -> Right (Model.TypeSet ta0, cx))) setArityErr) (+ let foldResult =+ Lists.foldl (\acc -> \term -> Eithers.bind acc (\accR ->+ let types = Pairs.first accR+ cxA = Pairs.second accR+ in (Eithers.bind (typeOf cxA tx [] term) (\tResult ->+ let t = Pairs.first tResult+ cxB = Pairs.second tResult+ in (Right (Lists.concat2 types (Lists.singleton t), cxB)))))) (Right ([], cx)) (Sets.toList els)+ in (Eithers.bind foldResult (\foldR ->+ let eltypes = Pairs.first foldR+ cx2 = Pairs.second foldR+ in (Eithers.bind (checkSameType cx2 tx "set elements" eltypes) (\unifiedType -> Right (Model.TypeSet unifiedType, cx2)))))))++-- | Check the type of a term+typeOfTerm :: Typing.InferenceContext -> Graph.Graph -> Model.Term -> Either Errors.Error Model.Type+typeOfTerm cx g term = Eithers.map Pairs.first (typeOf cx g [] term)++-- | Reconstruct the type of a type application term (Either/InferenceContext version). Paper: inference.tex, 'Checking the witness' (pushes onto the pending-type-argument stack).+typeOfTypeApplication :: Typing.InferenceContext -> Graph.Graph -> [Model.Type] -> Model.TypeApplicationTerm -> Either Errors.Error (Model.Type, Typing.InferenceContext)+typeOfTypeApplication cx tx typeArgs tyapp =++ let body = Model.typeApplicationTermBody tyapp+ t = Model.typeApplicationTermType tyapp+ in (typeOf cx tx (Lists.cons t typeArgs) body)++-- | Reconstruct the type of a type lambda (type abstraction) term (Either/InferenceContext version). Paper: inference.tex, type abstraction terms in the elaborated Term grammar.+typeOfTypeLambda :: Typing.InferenceContext -> Graph.Graph -> [Model.Type] -> Model.TypeLambda -> Either Errors.Error (Model.Type, Typing.InferenceContext)+typeOfTypeLambda cx tx typeArgs tl =++ let v = Model.typeLambdaParameter tl+ body = Model.typeLambdaBody tl+ vars = Graph.graphTypeVariables tx+ tx2 =+ Graph.Graph {+ Graph.graphBoundTerms = (Graph.graphBoundTerms tx),+ Graph.graphBoundTypes = (Graph.graphBoundTypes tx),+ Graph.graphClassConstraints = (Graph.graphClassConstraints tx),+ Graph.graphLambdaVariables = (Graph.graphLambdaVariables tx),+ Graph.graphMetadata = (Graph.graphMetadata tx),+ Graph.graphPrimitives = (Graph.graphPrimitives tx),+ Graph.graphSchemaTypes = (Graph.graphSchemaTypes tx),+ Graph.graphTypeVariables = (Sets.insert v vars)}+ in (Eithers.bind (typeOf cx tx2 [] body) (\result1 ->+ let t1 = Pairs.first result1+ cx2 = Pairs.second result1+ in (Eithers.bind (applyTypeArgumentsToType cx2 tx typeArgs (Model.TypeForall (Model.ForallType {+ Model.forallTypeParameter = v,+ Model.forallTypeBody = t1}))) (\applied -> Right (applied, cx2)))))++-- | Reconstruct the type of the unit term (Either/InferenceContext version). Paper: inference.tex, rule Unit (checking side).+typeOfUnit :: Typing.InferenceContext -> Graph.Graph -> [Model.Type] -> Either Errors.Error (Model.Type, Typing.InferenceContext)+typeOfUnit cx tx typeArgs =+ Eithers.bind (applyTypeArgumentsToType cx tx typeArgs Model.TypeUnit) (\applied -> Right (applied, cx))++-- | Reconstruct the type of an unwrap operation (Either/InferenceContext version). Paper: inference.tex, rule Unwr (checking side).+typeOfUnwrap :: Typing.InferenceContext -> Graph.Graph -> [Model.Type] -> Model.Name -> Either Errors.Error (Model.Type, Typing.InferenceContext)+typeOfUnwrap cx tx typeArgs tname =+ Eithers.bind (Resolution.requireSchemaType cx (Graph.graphSchemaTypes tx) tname) (\schemaResult ->+ let schemaType = Pairs.first schemaResult+ cx2 = Pairs.second schemaResult+ svars = Model.typeSchemeVariables schemaType+ sbody = Model.typeSchemeBody schemaType+ in (Eithers.bind (ExtractModel.wrappedType tname sbody) (\wrapped ->+ let subst = Typing.TypeSubst (Maps.fromList (Lists.zip svars typeArgs))+ swrapped = Substitution.substInType subst wrapped+ in (Right (+ Model.TypeFunction (Model.FunctionType {+ Model.functionTypeDomain = (Resolution.nominalApplication tname typeArgs),+ Model.functionTypeCodomain = swrapped}),+ cx2)))))++-- | Reconstruct the type of a variable (Either/InferenceContext version). Paper: inference.tex, rules Var and Prim (checking side); note the primitives-first lookup order, the reverse of inference.+typeOfVariable :: Typing.InferenceContext -> Graph.Graph -> [Model.Type] -> Model.Name -> Either Errors.Error (Model.Type, Typing.InferenceContext)+typeOfVariable cx tx typeArgs name =++ let forScheme =+ \ts ->+ let tResult =+ Logic.ifElse (Lists.isEmpty typeArgs) (Resolution.instantiateType cx (Scoping.typeSchemeToFType ts)) (Scoping.typeSchemeToFType ts, cx)+ t = Pairs.first tResult+ cx2 = Pairs.second tResult+ in (Eithers.bind (applyTypeArgumentsToType cx2 tx typeArgs t) (\applied -> Right (applied, cx2)))+ primScheme =+ Optionals.map (\_p -> Scoping.termSignatureToTypeScheme (Packaging.primitiveDefinitionSignature (Graph.primitiveDefinition _p))) (Maps.lookup name (Graph.graphPrimitives tx))+ in (Optionals.match primScheme (Optionals.match (Maps.lookup name (Graph.graphBoundTypes tx)) (Left (Errors.ErrorUntypedTermVariable (ErrorModel.UntypedTermVariableError {+ ErrorModel.untypedTermVariableErrorLocation = (Paths.SubtermPath []),+ ErrorModel.untypedTermVariableErrorName = name}))) forScheme) forScheme)++-- | Reconstruct the type of a wrapped term (Either/InferenceContext version). Paper: inference.tex, rule Wrp (checking side).+typeOfWrappedTerm :: Typing.InferenceContext -> Graph.Graph -> [Model.Type] -> Model.WrappedTerm -> Either Errors.Error (Model.Type, Typing.InferenceContext)+typeOfWrappedTerm cx tx typeArgs wt =++ let tname = Model.wrappedTermTypeName wt+ body = Model.wrappedTermBody wt+ in (Eithers.bind (typeOf cx tx [] body) (\result ->+ let cx2 = Pairs.second result+ in (Right (Resolution.nominalApplication tname typeArgs, cx2))))++-- | Check whether a list of types are effectively equal, disregarding type aliases and free type variable naming. Also treats free type variables (not in schema) as wildcards, since inference has already verified consistency.+typesAllEffectivelyEqual :: Graph.Graph -> [Model.Type] -> Bool+typesAllEffectivelyEqual tx tlist =++ let types = Graph.graphSchemaTypes tx+ containsFreeVar =+ \t ->+ let allVars = Variables.freeVariablesInTypeSimple t+ schemaNames = Sets.fromList (Maps.keys types)+ in (Logic.not (Sets.isEmpty (Sets.difference allVars schemaNames)))+ anyContainsFreeVar = Lists.foldl (\acc -> \t -> Logic.or acc (containsFreeVar t)) False tlist+ in (Logic.ifElse anyContainsFreeVar True (Logic.ifElse (allEqual (Lists.map (\t -> normalizeTypeFreeVars t) tlist)) True (allEqual (Lists.map (\t -> normalizeTypeFreeVars (Strip.deannotateTypeRecursive (Dependencies.replaceTypedefs types t))) tlist))))++-- | Check whether two types are effectively equal, disregarding type aliases, forall quantifiers, and treating in-scope type variables as wildcards. Paper: inference.tex, 'Checking the witness' (effective equality, the type-level analogue of the referential-transparency equality of terms).+typesEffectivelyEqual :: Graph.Graph -> Model.Type -> Model.Type -> Bool+typesEffectivelyEqual tx t1 t2 =+ Logic.or (containsInScopeTypeVars tx t1) (Logic.or (containsInScopeTypeVars tx t2) (typesAllEffectivelyEqual tx [+ Resolution.fullyStripAndNormalizeType t1,+ (Resolution.fullyStripAndNormalizeType t2)]))
@@ -0,0 +1,90 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Registry of Hydra's built-in type classes.++module Hydra.Core.Classes where++import qualified Hydra.Core.Ast as Ast+import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Diff as Diff+import qualified Hydra.Core.Docs as Docs+import qualified Hydra.Core.Error.Checking as Checking+import qualified Hydra.Core.Error.File as ErrorFile+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Error.Packaging as ErrorPackaging+import qualified Hydra.Core.Error.System as ErrorSystem+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Json.Model as JsonModel+import qualified Hydra.Core.Overlay.Haskell.Lib.Equality as Equality+import qualified Hydra.Core.Overlay.Haskell.Lib.Logic as Logic+import qualified Hydra.Core.Markdown as Markdown+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Parsing as Parsing+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Query as Query+import qualified Hydra.Core.Regex as Regex+import qualified Hydra.Core.Relational as Relational+import qualified Hydra.Core.Strip as Strip+import qualified Hydra.Core.System as System+import qualified Hydra.Core.Tabular as Tabular+import qualified Hydra.Core.Testing as Testing+import qualified Hydra.Core.Time as Time+import qualified Hydra.Core.Topology as Topology+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Validation as Validation+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | Check whether a type is an instance of a constraint class, by the class's short name.+classIsSatisfiedByType :: Model.Name -> Model.Type -> Bool+classIsSatisfiedByType className typ =++ let isIntegerLiteral =+ case (Strip.deannotateType typ) of+ Model.TypeLiteral v0 -> case v0 of+ Model.LiteralTypeInteger _ -> True+ _ -> False+ _ -> False+ isFloatLiteral =+ case (Strip.deannotateType typ) of+ Model.TypeLiteral v0 -> case v0 of+ Model.LiteralTypeFloat _ -> True+ _ -> False+ _ -> False+ in (Logic.ifElse (Equality.equal className (Model.Name "equality")) True (Logic.ifElse (Equality.equal className (Model.Name "ordering")) True (Logic.ifElse (Equality.equal className (Model.Name "numeric")) (Logic.or isIntegerLiteral isFloatLiteral) (Logic.ifElse (Equality.equal className (Model.Name "integral")) isIntegerLiteral (Logic.ifElse (Equality.equal className (Model.Name "fractional")) isFloatLiteral False)))))++-- | The equality type class: instances support structural equality.+equality :: Typing.TypeClass+equality = Typing.TypeClass {+ Typing.typeClassDescription = "Equality: instances support structural equality."}++-- | The fractional type class: instances support total floating-point division.+fractional :: Typing.TypeClass+fractional =+ Typing.TypeClass {+ Typing.typeClassDescription = "Fractional: instances support total floating-point division."}++-- | The integral type class: instances support integer division, modulus, remainder, and parity.+integral :: Typing.TypeClass+integral =+ Typing.TypeClass {+ Typing.typeClassDescription = "Integral: instances support integer division, modulus, remainder, and parity."}++-- | The numeric type class: instances support arithmetic (addition, subtraction, multiplication, negation).+numeric :: Typing.TypeClass+numeric =+ Typing.TypeClass {+ Typing.typeClassDescription = "Numeric: instances support arithmetic (addition, subtraction, multiplication, negation)."}++-- | The ordering type class: instances support total ordering (and equality).+ordering :: Typing.TypeClass+ordering =+ Typing.TypeClass {+ Typing.typeClassDescription = "Ordering: instances support total ordering (and equality)."}
@@ -0,0 +1,722 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Pure code generation pipeline for bootstrapping Hydra across languages.++module Hydra.Core.Codegen where++import qualified Hydra.Core.Adapt as Adapt+import qualified Hydra.Core.Annotations as Annotations+import qualified Hydra.Core.Ast as Ast+import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Constants as Constants+import qualified Hydra.Core.Decode.Model as DecodeModel+import qualified Hydra.Core.Decode.Packaging as DecodePackaging+import qualified Hydra.Core.Decoding as Decoding+import qualified Hydra.Core.Diff as Diff+import qualified Hydra.Core.Docs as Docs+import qualified Hydra.Core.Encode.Model as EncodeModel+import qualified Hydra.Core.Encode.Packaging as EncodePackaging+import qualified Hydra.Core.Encoding as Encoding+import qualified Hydra.Core.Environment as Environment+import qualified Hydra.Core.Error.Checking as Checking+import qualified Hydra.Core.Error.File as ErrorFile+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Error.Packaging as ErrorPackaging+import qualified Hydra.Core.Error.System as ErrorSystem+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Formatting as Formatting+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Inference as Inference+import qualified Hydra.Core.Json.Decode as Decode+import qualified Hydra.Core.Json.Encode as Encode+import qualified Hydra.Core.Json.Model as JsonModel+import qualified Hydra.Core.Json.Writer as Writer+import qualified Hydra.Core.Lexical as Lexical+import qualified Hydra.Core.Overlay.Haskell.Lib.Eithers as Eithers+import qualified Hydra.Core.Overlay.Haskell.Lib.Equality as Equality+import qualified Hydra.Core.Overlay.Haskell.Lib.Lists as Lists+import qualified Hydra.Core.Overlay.Haskell.Lib.Logic as Logic+import qualified Hydra.Core.Overlay.Haskell.Lib.Maps as Maps+import qualified Hydra.Core.Overlay.Haskell.Lib.Math as Math+import qualified Hydra.Core.Overlay.Haskell.Lib.Optionals as Optionals+import qualified Hydra.Core.Overlay.Haskell.Lib.Ordering as Ordering+import qualified Hydra.Core.Overlay.Haskell.Lib.Pairs as Pairs+import qualified Hydra.Core.Overlay.Haskell.Lib.Sets as Sets+import qualified Hydra.Core.Overlay.Haskell.Lib.Strings as Strings+import qualified Hydra.Core.Markdown as Markdown+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Names as Names+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Parsing as Parsing+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Print.Errors as PrintErrors+import qualified Hydra.Core.Print.Markdown as PrintMarkdown+import qualified Hydra.Core.Print.Model as PrintModel+import qualified Hydra.Core.Query as Query+import qualified Hydra.Core.Regex as Regex+import qualified Hydra.Core.Relational as Relational+import qualified Hydra.Core.Scoping as Scoping+import qualified Hydra.Core.Strip as Strip+import qualified Hydra.Core.System as System+import qualified Hydra.Core.Tabular as Tabular+import qualified Hydra.Core.Testing as Testing+import qualified Hydra.Core.Time as Time+import qualified Hydra.Core.Topology as Topology+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Validation as Validation+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void+import qualified Data.Map as M+import qualified Data.Set as S++-- | Build a schema map (Name -> Type) from a graph's schema types+buildSchemaMap :: Graph.Graph -> M.Map Model.Name Model.Type+buildSchemaMap g = Maps.map (\ts -> Strip.deannotateType (Model.typeSchemeBody ts)) (Graph.graphSchemaTypes g)++-- | Decode a single module from a JSON value+decodeModuleFromJson :: Graph.Graph -> [Packaging.Module] -> JsonModel.Value -> Either Errors.Error Packaging.Module+decodeModuleFromJson bsGraph universeModules jsonVal =++ let graph = modulesToGraph bsGraph universeModules universeModules+ schemaMap = buildSchemaMap graph+ modType = Model.TypeVariable (Model.Name "hydra.core.packaging.Module")+ in (Eithers.either (\err -> Left (Errors.ErrorOther (Errors.OtherError err))) (\term -> Eithers.either (\decErr -> Left (Errors.ErrorDecoding decErr)) (\mod -> Right mod) (DecodePackaging.module_ graph term)) (Decode.fromJson schemaMap False (Model.Name "hydra.core.packaging.Module") modType jsonVal))++-- | Escape unescaped control characters inside JSON string literals+escapeControlCharsInJson :: [Int] -> [Int]+escapeControlCharsInJson input =++ let hexDigit = \n -> Logic.ifElse (Ordering.lt n 10) (Math.add 48 n) (Math.add 97 (Math.sub n 10))+ escapeToUnicode =+ \b -> [+ 92,+ 117,+ 48,+ 48,+ (hexDigit (Optionals.withDefault 0 (Math.div b 16))),+ (hexDigit (Optionals.withDefault 0 (Math.mod b 16)))]+ go =+ \inStr -> \esc -> \bytes -> Optionals.match (Lists.uncons bytes) [] (\uc ->+ let b = Pairs.first uc+ bs = Pairs.second uc+ in (Logic.ifElse esc (Lists.cons b (go inStr False bs)) (Logic.ifElse (Logic.and (Equality.equal b 92) inStr) (Lists.cons b (go inStr True bs)) (Logic.ifElse (Equality.equal b 34) (Lists.cons b (go (Logic.not inStr) False bs)) (Logic.ifElse (Logic.and inStr (Ordering.lt b 32)) (Lists.concat2 (escapeToUnicode b) (go inStr False bs)) (Lists.cons b (go inStr False bs)))))))+ in (go False False input)++-- | Format a primitive for the lexicon+formatPrimitive :: Graph.Primitive -> String+formatPrimitive prim =++ let name = Model.unName (Packaging.primitiveDefinitionName (Graph.primitiveDefinition prim))+ typ = Scoping.termSignatureToTypeScheme (Packaging.primitiveDefinitionSignature (Graph.primitiveDefinition prim))+ typeStr = PrintModel.typeScheme typ+ in (Strings.concat2 (Strings.concat2 (Strings.concat2 " " name) " : ") typeStr)++-- | Format a term binding for the lexicon+formatTermBinding :: Model.Binding -> String+formatTermBinding binding =++ let name = Model.unName (Model.bindingName binding)+ typeStr = Optionals.match (Model.bindingTypeScheme binding) "?" (\scheme -> PrintModel.typeScheme scheme)+ in (Strings.concat2 (Strings.concat2 (Strings.concat2 " " name) " : ") typeStr)++-- | Format a type binding for the lexicon+formatTypeBinding :: Graph.Graph -> Model.Binding -> Either Errors.Error String+formatTypeBinding graph binding =+ Eithers.bind (Eithers.bimap (\_e -> Errors.ErrorDecoding _e) (\_a -> _a) (DecodeModel.type_ graph (Model.bindingTerm binding))) (\typ -> Right (Strings.concat2 (Strings.concat2 (Strings.concat2 " " (Model.unName (Model.bindingName binding))) " = ") (PrintModel.type_ typ)))++-- | Generate encoder or decoder modules for a list of type modules+generateCoderModules :: (t0 -> Graph.Graph -> t1 -> Either t2 (Maybe t3)) -> Graph.Graph -> [Packaging.Module] -> [t1] -> t0 -> Either t2 [t3]+generateCoderModules codec bsGraph universeModules typeModules cx =++ let universe = Maps.fromList (Lists.map (\m -> (Packaging.moduleName m, m)) (Lists.concat2 universeModules universeModules))+ closureModules = moduleDepsTransitive universe universeModules+ schemaElements =+ Lists.concat (Lists.map (\m -> Optionals.givens (Lists.map (\d -> case d of+ Packaging.DefinitionType v0 -> Just ((\name -> \typ ->+ let schemaTerm = Model.TermVariable (Model.Name "hydra.core.model.Type")+ dataTerm =+ Annotations.normalizeTermAnnotations (Model.TermAnnotated (Model.AnnotatedTerm {+ Model.annotatedTermBody = (EncodeModel.type_ typ),+ Model.annotatedTermAnnotation = (Annotations.wrapAnnotationMap (Maps.fromList [+ (Constants.keyType, schemaTerm)]))}))+ in Model.Binding {+ Model.bindingName = name,+ Model.bindingTerm = dataTerm,+ Model.bindingTypeScheme = (Just (Model.TypeScheme {+ Model.typeSchemeVariables = [],+ Model.typeSchemeBody = (Model.TypeVariable (Model.Name "hydra.core.model.Type")),+ Model.typeSchemeConstraints = Maps.empty}))}) (Packaging.typeDefinitionName v0) (Model.typeSchemeBody (Packaging.typeDefinitionBody v0)))+ _ -> Nothing) (Packaging.moduleDefinitions m))) closureModules)+ dataElements =+ Lists.concat (Lists.map (\m -> Optionals.givens (Lists.map (\d -> case d of+ Packaging.DefinitionTerm v0 -> Just (Model.Binding {+ Model.bindingName = (Packaging.termDefinitionName v0),+ Model.bindingTerm = (Packaging.termDefinitionBody v0),+ Model.bindingTypeScheme = (Optionals.map Scoping.termSignatureToTypeScheme (Packaging.termDefinitionSignature v0))})+ _ -> Nothing) (Packaging.moduleDefinitions m))) closureModules)+ schemaGraph = Lexical.elementsToGraph bsGraph Maps.empty schemaElements+ schemaTypes = Eithers.either (\_ -> Maps.empty) (\_r -> _r) (Environment.schemaGraphToTypingEnvironment schemaGraph)+ allElements = Lists.concat2 schemaElements dataElements+ graph = Lexical.elementsToGraph bsGraph schemaTypes allElements+ in (Eithers.map (\results -> Optionals.givens results) (Eithers.mapList (\m -> codec cx graph m) typeModules))++-- | Generate the lexicon content from a graph+generateLexicon :: Graph.Graph -> Either Errors.Error String+generateLexicon graph =++ let bindings = Lexical.graphToBindings graph+ primitives = Maps.elems (Graph.graphPrimitives graph)+ partitioned = Lists.partition (\b -> Annotations.isNativeType b) bindings+ typeBindings = Pairs.first partitioned+ termBindings = Pairs.second partitioned+ sortedPrimitives = Lists.sortBy (\p -> Packaging.primitiveDefinitionName (Graph.primitiveDefinition p)) primitives+ sortedTypes = Lists.sortBy (\b -> Model.bindingName b) typeBindings+ sortedTerms = Lists.sortBy (\b -> Model.bindingName b) termBindings+ in (Eithers.bind (Eithers.mapList (\b -> formatTypeBinding graph b) sortedTypes) (\typeLines ->+ let termLines = Lists.map (\b -> formatTermBinding b) sortedTerms+ primitiveLines = Lists.map (\p -> formatPrimitive p) sortedPrimitives+ in (Right (Strings.concat2 (Strings.concat2 (Strings.concat2 (Strings.concat2 (Strings.concat2 "Primitives:\n" (Formatting.unlines primitiveLines)) "\nTypes:\n") (Formatting.unlines typeLines)) "\nTerms:\n") (Formatting.unlines termLines)))))++-- | Generate a hydra.core.markdown Document describing a module's definitions+generateModuleDoc :: Packaging.Module -> Markdown.Document+generateModuleDoc mod =++ let sections =+ Lists.map (\d -> case d of+ Packaging.DefinitionPrimitive v0 ->+ let name = Model.unName (Packaging.primitiveDefinitionName v0)+ mdoc = Optionals.bind (Packaging.primitiveDefinitionMetadata v0) (\em -> Packaging.entityMetadataDescription em)+ sig = PrintModel.typeScheme (Scoping.termSignatureToTypeScheme (Packaging.primitiveDefinitionSignature v0))+ provisions =+ Optionals.withDefault [] (Optionals.map (\em -> Packaging.entityMetadataProvisions em) (Packaging.primitiveDefinitionMetadata v0))+ in Markdown.Section {+ Markdown.sectionHeading = Markdown.Heading {+ Markdown.headingLevel = 2,+ Markdown.headingContent = [+ Markdown.InlineText name],+ Markdown.headingAnchor = Nothing},+ Markdown.sectionContent = (Lists.concat2 [+ Markdown.BlockParagraph (Markdown.Paragraph {+ Markdown.paragraphContent = [+ Markdown.InlineText (Optionals.withDefault "*(undocumented)*" mdoc)],+ Markdown.paragraphAnchor = Nothing}),+ (Markdown.BlockParagraph (Markdown.Paragraph {+ Markdown.paragraphContent = [+ Markdown.InlineCode sig],+ Markdown.paragraphAnchor = Nothing}))] (Lists.map (\p -> Markdown.BlockParagraph (+ let pname = Packaging.provisionName p+ pkind = Packaging.provisionKind p+ pstatement = Packaging.provisionStatement p+ kindStr =+ case pkind of+ Packaging.ProvisionKindRequirement -> "requirement"+ Packaging.ProvisionKindRecommendation -> "recommendation"+ upperDashed = Names.nameToUpperDashed pname+ in Markdown.Paragraph {+ Markdown.paragraphContent = [+ Markdown.InlineStrong [+ Markdown.InlineText (Strings.concat2 (Strings.concat2 (Strings.concat2 (Strings.concat2 "[" upperDashed) "] (") kindStr) ") ")],+ (Markdown.InlineText pstatement)],+ Markdown.paragraphAnchor = (Just upperDashed)})) provisions)),+ Markdown.sectionAnchor = Nothing}+ Packaging.DefinitionTerm v0 ->+ let name = Model.unName (Packaging.termDefinitionName v0)+ mdoc = Optionals.bind (Packaging.termDefinitionMetadata v0) (\em -> Packaging.entityMetadataDescription em)+ sig =+ Optionals.match (Optionals.map Scoping.termSignatureToTypeScheme (Packaging.termDefinitionSignature v0)) "?" (\ts -> PrintModel.typeScheme ts)+ provisions =+ Optionals.withDefault [] (Optionals.map (\em -> Packaging.entityMetadataProvisions em) (Packaging.termDefinitionMetadata v0))+ in Markdown.Section {+ Markdown.sectionHeading = Markdown.Heading {+ Markdown.headingLevel = 2,+ Markdown.headingContent = [+ Markdown.InlineText name],+ Markdown.headingAnchor = Nothing},+ Markdown.sectionContent = (Lists.concat2 [+ Markdown.BlockParagraph (Markdown.Paragraph {+ Markdown.paragraphContent = [+ Markdown.InlineText (Optionals.withDefault "*(undocumented)*" mdoc)],+ Markdown.paragraphAnchor = Nothing}),+ (Markdown.BlockParagraph (Markdown.Paragraph {+ Markdown.paragraphContent = [+ Markdown.InlineCode sig],+ Markdown.paragraphAnchor = Nothing}))] (Lists.map (\p -> Markdown.BlockParagraph (+ let pname = Packaging.provisionName p+ pkind = Packaging.provisionKind p+ pstatement = Packaging.provisionStatement p+ kindStr =+ case pkind of+ Packaging.ProvisionKindRequirement -> "requirement"+ Packaging.ProvisionKindRecommendation -> "recommendation"+ upperDashed = Names.nameToUpperDashed pname+ in Markdown.Paragraph {+ Markdown.paragraphContent = [+ Markdown.InlineStrong [+ Markdown.InlineText (Strings.concat2 (Strings.concat2 (Strings.concat2 (Strings.concat2 "[" upperDashed) "] (") kindStr) ") ")],+ (Markdown.InlineText pstatement)],+ Markdown.paragraphAnchor = (Just upperDashed)})) provisions)),+ Markdown.sectionAnchor = Nothing}+ Packaging.DefinitionType v0 ->+ let name = Model.unName (Packaging.typeDefinitionName v0)+ mdoc = Optionals.bind (Packaging.typeDefinitionMetadata v0) (\em -> Packaging.entityMetadataDescription em)+ sig = PrintModel.typeScheme (Packaging.typeDefinitionBody v0)+ provisions =+ Optionals.withDefault [] (Optionals.map (\em -> Packaging.entityMetadataProvisions em) (Packaging.typeDefinitionMetadata v0))+ in Markdown.Section {+ Markdown.sectionHeading = Markdown.Heading {+ Markdown.headingLevel = 2,+ Markdown.headingContent = [+ Markdown.InlineText name],+ Markdown.headingAnchor = Nothing},+ Markdown.sectionContent = (Lists.concat2 [+ Markdown.BlockParagraph (Markdown.Paragraph {+ Markdown.paragraphContent = [+ Markdown.InlineText (Optionals.withDefault "*(undocumented)*" mdoc)],+ Markdown.paragraphAnchor = Nothing}),+ (Markdown.BlockParagraph (Markdown.Paragraph {+ Markdown.paragraphContent = [+ Markdown.InlineCode sig],+ Markdown.paragraphAnchor = Nothing}))] (Lists.map (\p -> Markdown.BlockParagraph (+ let pname = Packaging.provisionName p+ pkind = Packaging.provisionKind p+ pstatement = Packaging.provisionStatement p+ kindStr =+ case pkind of+ Packaging.ProvisionKindRequirement -> "requirement"+ Packaging.ProvisionKindRecommendation -> "recommendation"+ upperDashed = Names.nameToUpperDashed pname+ in Markdown.Paragraph {+ Markdown.paragraphContent = [+ Markdown.InlineStrong [+ Markdown.InlineText (Strings.concat2 (Strings.concat2 (Strings.concat2 (Strings.concat2 "[" upperDashed) "] (") kindStr) ") ")],+ (Markdown.InlineText pstatement)],+ Markdown.paragraphAnchor = (Just upperDashed)})) provisions)),+ Markdown.sectionAnchor = Nothing}) (Packaging.moduleDefinitions mod)+ in Markdown.Document {+ Markdown.documentTitle = (Packaging.unModuleName (Packaging.moduleName mod)),+ Markdown.documentContent = (Lists.cons (Markdown.BlockRaw "<!-- Note: this is an automatically generated file. Do not edit. -->") (Lists.map (\s -> Markdown.BlockSection s) sections))}++-- | Pure core of code generation: given a coder, language, infer flag, bootstrap graph, universe, and modules to generate, produce a list of (filePath, content) pairs. Emission flags doExpand/doHoistCaseStatements/doHoistPolymorphicLetBindings are derived from the absence of the matching LanguageFeature in lang.supportedFeatures: a target that lacks partialApplication needs eta expansion (doExpand=true), and so on.+generateSourceFiles :: Ord t0 => ((Packaging.Module -> [Packaging.Definition] -> Typing.InferenceContext -> Graph.Graph -> Either Errors.Error (M.Map t0 String)) -> Coders.Language -> Bool -> Graph.Graph -> [Packaging.Module] -> [Packaging.Module] -> Typing.InferenceContext -> Either Errors.Error [(t0, String)])+generateSourceFiles printDefinitions lang doInfer bsGraph universeModules modsToGenerate cx =++ let namespaceMap = Maps.fromList (Lists.map (\m -> (Packaging.moduleName m, m)) (Lists.concat2 universeModules modsToGenerate))+ constraints = Coders.languageConstraints lang+ features = Coders.languageSupportedFeatures lang+ doExpand = Logic.not (Sets.member Coders.LanguageFeaturePartialApplication features)+ doHoistCaseStatements = Logic.not (Sets.member Coders.LanguageFeatureNestedCaseStatements features)+ doHoistPolymorphicLetBindings = Logic.not (Sets.member Coders.LanguageFeatureNestedPolymorphicLetBindings features)+ typeModulesToGenerate =+ Lists.filter (\mod -> Logic.not (Lists.isEmpty (Optionals.givens (Lists.map (\d -> case d of+ Packaging.DefinitionType v0 -> Just ((\name -> \typ ->+ let schemaTerm = Model.TermVariable (Model.Name "hydra.core.model.Type")+ dataTerm =+ Annotations.normalizeTermAnnotations (Model.TermAnnotated (Model.AnnotatedTerm {+ Model.annotatedTermBody = (EncodeModel.type_ typ),+ Model.annotatedTermAnnotation = (Annotations.wrapAnnotationMap (Maps.fromList [+ (Constants.keyType, schemaTerm)]))}))+ in Model.Binding {+ Model.bindingName = name,+ Model.bindingTerm = dataTerm,+ Model.bindingTypeScheme = (Just (Model.TypeScheme {+ Model.typeSchemeVariables = [],+ Model.typeSchemeBody = (Model.TypeVariable (Model.Name "hydra.core.model.Type")),+ Model.typeSchemeConstraints = Maps.empty}))}) (Packaging.typeDefinitionName v0) (Model.typeSchemeBody (Packaging.typeDefinitionBody v0)))+ _ -> Nothing) (Packaging.moduleDefinitions mod))))) modsToGenerate+ termModulesToGenerate =+ Lists.filter (\mod -> Logic.not (Lists.isEmpty (Optionals.givens (Lists.map (\d -> case d of+ Packaging.DefinitionTerm v0 -> Just (Model.Binding {+ Model.bindingName = (Packaging.termDefinitionName v0),+ Model.bindingTerm = (Packaging.termDefinitionBody v0),+ Model.bindingTypeScheme = (Optionals.map Scoping.termSignatureToTypeScheme (Packaging.termDefinitionSignature v0))})+ _ -> Nothing) (Packaging.moduleDefinitions mod))))) modsToGenerate+ closureMods = moduleDepsTransitive namespaceMap (Lists.concat2 universeModules modsToGenerate)+ schemaElements =+ Lists.concat (Lists.map (\m -> Optionals.givens (Lists.map (\d -> case d of+ Packaging.DefinitionType v0 -> Just ((\name -> \typ ->+ let schemaTerm = Model.TermVariable (Model.Name "hydra.core.model.Type")+ dataTerm =+ Annotations.normalizeTermAnnotations (Model.TermAnnotated (Model.AnnotatedTerm {+ Model.annotatedTermBody = (EncodeModel.type_ typ),+ Model.annotatedTermAnnotation = (Annotations.wrapAnnotationMap (Maps.fromList [+ (Constants.keyType, schemaTerm)]))}))+ in Model.Binding {+ Model.bindingName = name,+ Model.bindingTerm = dataTerm,+ Model.bindingTypeScheme = (Just (Model.TypeScheme {+ Model.typeSchemeVariables = [],+ Model.typeSchemeBody = (Model.TypeVariable (Model.Name "hydra.core.model.Type")),+ Model.typeSchemeConstraints = Maps.empty}))}) (Packaging.typeDefinitionName v0) (Model.typeSchemeBody (Packaging.typeDefinitionBody v0)))+ _ -> Nothing) (Packaging.moduleDefinitions m))) closureMods)+ dataElements =+ Lists.concat (Lists.map (\m -> Optionals.givens (Lists.map (\d -> case d of+ Packaging.DefinitionTerm v0 -> Just (Model.Binding {+ Model.bindingName = (Packaging.termDefinitionName v0),+ Model.bindingTerm = (Packaging.termDefinitionBody v0),+ Model.bindingTypeScheme = (Optionals.map Scoping.termSignatureToTypeScheme (Packaging.termDefinitionSignature v0))})+ _ -> Nothing) (Packaging.moduleDefinitions m))) closureMods)+ schemaGraph = Lexical.elementsToGraph bsGraph Maps.empty schemaElements+ schemaTypes2 = Eithers.either (\_ -> Maps.empty) (\_r -> _r) (Environment.schemaGraphToTypingEnvironment schemaGraph)+ dataGraph = Lexical.elementsToGraph bsGraph schemaTypes2 dataElements+ in (Eithers.bind (Logic.ifElse (Lists.isEmpty typeModulesToGenerate) (Right []) (+ let nameLists =+ Lists.map (\m -> Optionals.givens (Lists.map (\d -> case d of+ Packaging.DefinitionType v0 -> Just (Packaging.typeDefinitionName v0)+ _ -> Nothing) (Packaging.moduleDefinitions m))) typeModulesToGenerate+ in (Eithers.bind (Adapt.schemaGraphToDefinitions constraints schemaGraph nameLists cx) (\schemaResult ->+ let defLists = Pairs.second schemaResult+ schemaGraphWithTypes =+ Graph.Graph {+ Graph.graphBoundTerms = (Graph.graphBoundTerms schemaGraph),+ Graph.graphBoundTypes = (Graph.graphBoundTypes schemaGraph),+ Graph.graphClassConstraints = (Graph.graphClassConstraints schemaGraph),+ Graph.graphLambdaVariables = (Graph.graphLambdaVariables schemaGraph),+ Graph.graphMetadata = (Graph.graphMetadata schemaGraph),+ Graph.graphPrimitives = (Graph.graphPrimitives schemaGraph),+ Graph.graphSchemaTypes = schemaTypes2,+ Graph.graphTypeVariables = (Graph.graphTypeVariables schemaGraph)}+ in (Eithers.map (\xs -> Lists.concat xs) (Eithers.mapList (\p ->+ let mod = Pairs.first p+ defs = Pairs.second p+ in (Eithers.map (\m -> Maps.toList m) (printDefinitions mod (Lists.map (\d -> Packaging.DefinitionType d) defs) cx schemaGraphWithTypes))) (Lists.zip typeModulesToGenerate defLists))))))) (\schemaFiles -> Eithers.bind (Logic.ifElse (Lists.isEmpty termModulesToGenerate) (Right []) (+ let namespaces = Lists.map (\m -> Packaging.moduleName m) termModulesToGenerate+ in (Eithers.bind (Adapt.dataGraphToDefinitions constraints doInfer doExpand doHoistCaseStatements doHoistPolymorphicLetBindings dataElements dataGraph namespaces cx) (\dataResult ->+ let g1 = Pairs.first dataResult+ defLists = Pairs.second dataResult+ defName =+ \d -> case d of+ Packaging.DefinitionTerm v0 -> Packaging.termDefinitionName v0+ Packaging.DefinitionType v0 -> Packaging.typeDefinitionName v0+ Packaging.DefinitionPrimitive v0 -> Packaging.primitiveDefinitionName v0+ refreshModule =+ \els -> \m -> Packaging.Module {+ Packaging.moduleName = (Packaging.moduleName m),+ Packaging.moduleMetadata = (Packaging.moduleMetadata m),+ Packaging.moduleDependencies = (Packaging.moduleDependencies m),+ Packaging.moduleDefinitions = (Optionals.givens (Lists.map (\d -> case d of+ Packaging.DefinitionType v0 -> Just (Packaging.DefinitionType v0)+ Packaging.DefinitionTerm v0 -> Optionals.map (\b -> Packaging.DefinitionTerm (Packaging.TermDefinition {+ Packaging.termDefinitionName = (Model.bindingName b),+ Packaging.termDefinitionMetadata = Nothing,+ Packaging.termDefinitionSignature = (Optionals.map Scoping.typeSchemeToTermSignature (Model.bindingTypeScheme b)),+ Packaging.termDefinitionBody = (Model.bindingTerm b)})) (Lists.find (\b -> Equality.equal (Model.bindingName b) (Packaging.termDefinitionName v0)) els)+ Packaging.DefinitionPrimitive v0 -> Just (Packaging.DefinitionPrimitive v0)) (Packaging.moduleDefinitions m)))}+ allBindings = Lexical.graphToBindings g1+ refreshedMods = Lists.map (\m -> refreshModule allBindings m) termModulesToGenerate+ dedupDefs =+ \defs -> Lists.sortBy (\d -> Packaging.termDefinitionName d) (Maps.elems (Maps.fromList (Lists.map (\d -> (Packaging.termDefinitionName d, d)) defs)))+ dedupedDefLists = Lists.map dedupDefs defLists+ in (Eithers.map (\xs -> Lists.concat xs) (Eithers.mapList (\p ->+ let mod = Pairs.first p+ defs = Pairs.second p+ in (Eithers.map (\m -> Maps.toList m) (printDefinitions mod (Lists.map (\d -> Packaging.DefinitionTerm d) defs) cx g1))) (Lists.zip refreshedMods dedupedDefLists))))))) (\termFiles ->+ let mergeFileEntry =+ \acc -> \p -> Maps.alter (\mv -> Just (Optionals.match mv (Pairs.second p) (\existing -> Strings.concat2 existing (Strings.concat2 "\n" (Pairs.second p))))) (Pairs.first p) acc+ in (Right (Maps.toList (Lists.foldl mergeFileEntry Maps.empty (Lists.concat2 schemaFiles termFiles)))))))++-- | Perform type inference and generate the lexicon for a set of modules+inferAndGenerateLexicon :: Typing.InferenceContext -> Graph.Graph -> [Packaging.Module] -> Either Errors.Error String+inferAndGenerateLexicon cx bsGraph kernelModules =++ let g0 = modulesToGraph bsGraph kernelModules kernelModules+ dataElements =+ Lists.concat (Lists.map (\m -> Optionals.givens (Lists.map (\d -> case d of+ Packaging.DefinitionTerm v0 -> Just (Model.Binding {+ Model.bindingName = (Packaging.termDefinitionName v0),+ Model.bindingTerm = (Packaging.termDefinitionBody v0),+ Model.bindingTypeScheme = (Optionals.map Scoping.termSignatureToTypeScheme (Packaging.termDefinitionSignature v0))})+ _ -> Nothing) (Packaging.moduleDefinitions m))) kernelModules)+ in (Eithers.bind (Inference.inferGraphTypes cx dataElements g0) (\inferResultWithCx ->+ let g1 = Pairs.first (Pairs.first inferResultWithCx)+ schemaElements =+ Lists.concat (Lists.map (\m -> Optionals.givens (Lists.map (\d -> case d of+ Packaging.DefinitionType v0 -> Just ((\name -> \typ ->+ let schemaTerm = Model.TermVariable (Model.Name "hydra.core.model.Type")+ dataTerm =+ Annotations.normalizeTermAnnotations (Model.TermAnnotated (Model.AnnotatedTerm {+ Model.annotatedTermBody = (EncodeModel.type_ typ),+ Model.annotatedTermAnnotation = (Annotations.wrapAnnotationMap (Maps.fromList [+ (Constants.keyType, schemaTerm)]))}))+ in Model.Binding {+ Model.bindingName = name,+ Model.bindingTerm = dataTerm,+ Model.bindingTypeScheme = (Just (Model.TypeScheme {+ Model.typeSchemeVariables = [],+ Model.typeSchemeBody = (Model.TypeVariable (Model.Name "hydra.core.model.Type")),+ Model.typeSchemeConstraints = Maps.empty}))}) (Packaging.typeDefinitionName v0) (Model.typeSchemeBody (Packaging.typeDefinitionBody v0)))+ _ -> Nothing) (Packaging.moduleDefinitions m))) kernelModules)+ typeBoundTerms = Maps.fromList (Lists.map (\b -> (Model.bindingName b, (Model.bindingTerm b))) schemaElements)+ typeBoundTypes =+ Maps.fromList (Optionals.givens (Lists.map (\b -> Optionals.map (\ts -> (Model.bindingName b, ts)) (Model.bindingTypeScheme b)) schemaElements))+ g2 =+ Graph.Graph {+ Graph.graphBoundTerms = (Maps.union typeBoundTerms (Graph.graphBoundTerms g1)),+ Graph.graphBoundTypes = (Graph.graphBoundTypes g1),+ Graph.graphClassConstraints = (Graph.graphClassConstraints g1),+ Graph.graphLambdaVariables = (Graph.graphLambdaVariables g1),+ Graph.graphMetadata = (Graph.graphMetadata g1),+ Graph.graphPrimitives = (Graph.graphPrimitives g1),+ Graph.graphSchemaTypes = (Graph.graphSchemaTypes g1),+ Graph.graphTypeVariables = (Graph.graphTypeVariables g1)}+ g3 =+ Graph.Graph {+ Graph.graphBoundTerms = (Graph.graphBoundTerms g2),+ Graph.graphBoundTypes = (Maps.union typeBoundTypes (Graph.graphBoundTypes g2)),+ Graph.graphClassConstraints = (Graph.graphClassConstraints g2),+ Graph.graphLambdaVariables = (Graph.graphLambdaVariables g2),+ Graph.graphMetadata = (Graph.graphMetadata g2),+ Graph.graphPrimitives = (Graph.graphPrimitives g2),+ Graph.graphSchemaTypes = (Graph.graphSchemaTypes g2),+ Graph.graphTypeVariables = (Graph.graphTypeVariables g2)}+ in (generateLexicon g3)))++-- | Perform type inference on modules and reconstruct with inferred types+inferModules :: Typing.InferenceContext -> Graph.Graph -> [Packaging.Module] -> [Packaging.Module] -> Either Errors.Error [Packaging.Module]+inferModules cx bsGraph universeMods targetMods =++ let g0 = modulesToGraph bsGraph universeMods universeMods+ dataElements =+ Lists.concat (Lists.map (\m -> Optionals.givens (Lists.map (\d -> case d of+ Packaging.DefinitionTerm v0 -> Just (Model.Binding {+ Model.bindingName = (Packaging.termDefinitionName v0),+ Model.bindingTerm = (Packaging.termDefinitionBody v0),+ Model.bindingTypeScheme = (Optionals.map Scoping.termSignatureToTypeScheme (Packaging.termDefinitionSignature v0))})+ _ -> Nothing) (Packaging.moduleDefinitions m))) universeMods)+ in (Eithers.bind (Inference.inferGraphTypes cx dataElements g0) (\inferResultWithCx ->+ let inferResult = Pairs.first inferResultWithCx+ inferredElements = Pairs.second inferResult+ in (Right (Lists.map (refreshModule inferredElements) targetMods))))++-- | Infer types for target modules in the context of a typed universe+inferModulesGiven :: Typing.InferenceContext -> Graph.Graph -> [Packaging.Module] -> [Packaging.Module] -> Either Errors.Error [Packaging.Module]+inferModulesGiven cx bsGraph universeMods targetMods =++ let g0 = modulesToGraph bsGraph universeMods universeMods+ nsMap = Maps.fromList (Lists.map (\m -> (Packaging.moduleName m, m)) universeMods)+ closureMods = moduleDepsTransitive nsMap targetMods+ targetNamespaces = Sets.fromList (Lists.map Packaging.moduleName targetMods)+ termBindings =+ Lists.concat (Lists.map (\m ->+ let isTarget = Sets.member (Packaging.moduleName m) targetNamespaces+ bs =+ Optionals.givens (Lists.map (\d -> case d of+ Packaging.DefinitionTerm v0 -> Just (Model.Binding {+ Model.bindingName = (Packaging.termDefinitionName v0),+ Model.bindingTerm = (Packaging.termDefinitionBody v0),+ Model.bindingTypeScheme = (Optionals.map Scoping.termSignatureToTypeScheme (Packaging.termDefinitionSignature v0))})+ _ -> Nothing) (Packaging.moduleDefinitions m))+ in (Logic.ifElse isTarget bs (Lists.filter (\b -> Optionals.isNone (Model.bindingTypeScheme b)) bs))) closureMods)+ primitiveBindings =+ Lists.concat (Lists.map (\m ->+ let isTarget = Sets.member (Packaging.moduleName m) targetNamespaces+ bs =+ Optionals.givens (Lists.map (\d -> case d of+ Packaging.DefinitionPrimitive v0 -> Optionals.map (\impl -> Model.Binding {+ Model.bindingName = (Packaging.primitiveDefinitionName v0),+ Model.bindingTerm = impl,+ Model.bindingTypeScheme = (Just (Scoping.termSignatureToTypeScheme (Packaging.primitiveDefinitionSignature v0)))}) (Packaging.primitiveDefinitionDefaultImplementation v0)+ _ -> Nothing) (Packaging.moduleDefinitions m))+ in (Logic.ifElse isTarget bs [])) closureMods)+ bindingsToInfer = Lists.concat2 termBindings primitiveBindings+ untouchedTypedBindings =+ Lists.concat (Lists.map (\m ->+ let isTarget = Sets.member (Packaging.moduleName m) targetNamespaces+ bs =+ Optionals.givens (Lists.map (\d -> case d of+ Packaging.DefinitionTerm v0 -> Just (Model.Binding {+ Model.bindingName = (Packaging.termDefinitionName v0),+ Model.bindingTerm = (Packaging.termDefinitionBody v0),+ Model.bindingTypeScheme = (Optionals.map Scoping.termSignatureToTypeScheme (Packaging.termDefinitionSignature v0))})+ _ -> Nothing) (Packaging.moduleDefinitions m))+ in (Logic.ifElse isTarget [] (Lists.filter (\b -> Optionals.isGiven (Model.bindingTypeScheme b)) bs))) closureMods)+ in (Eithers.bind (Inference.inferGraphTypes cx bindingsToInfer g0) (\inferResultWithCx ->+ let inferResult = Pairs.first inferResultWithCx+ newlyInferredBindings = Pairs.second inferResult+ allInferredBindings = Lists.concat2 newlyInferredBindings untouchedTypedBindings+ in (Right (Lists.map (refreshModule allInferredBindings) targetMods))))++-- | Lower Definition.primitive arms to Definition.term arms with term-encoded PrimitiveDefinition+lowerPrimitiveDefinitions :: Packaging.Module -> Packaging.Module+lowerPrimitiveDefinitions m =++ let pkgNs = Packaging.ModuleName "hydra.core.packaging"+ coreNs = Packaging.ModuleName "hydra.core.model"+ primDefSig =+ Scoping.typeSchemeToTermSignature (Model.TypeScheme {+ Model.typeSchemeVariables = [],+ Model.typeSchemeBody = (Model.TypeVariable (Model.Name "hydra.core.packaging.PrimitiveDefinition")),+ Model.typeSchemeConstraints = Maps.empty})+ origDefs = Packaging.moduleDefinitions m+ hasPrim =+ Lists.foldl (\acc -> \d -> Logic.or acc (case d of+ Packaging.DefinitionPrimitive _ -> True+ _ -> False)) False origDefs+ in (Logic.ifElse (Logic.not hasPrim) m (+ let newDefs =+ Lists.map (\d -> case d of+ Packaging.DefinitionPrimitive v0 -> Packaging.DefinitionTerm (Packaging.TermDefinition {+ Packaging.termDefinitionName = (Packaging.primitiveDefinitionName v0),+ Packaging.termDefinitionMetadata = Nothing,+ Packaging.termDefinitionSignature = (Just primDefSig),+ Packaging.termDefinitionBody = (EncodePackaging.primitiveDefinition v0)})+ _ -> d) origDefs+ currentDeps = Packaging.moduleDependencies m+ filteredDeps =+ Lists.filter (\dep -> Logic.and (Logic.not (Equality.equal (Packaging.moduleDependencyModule dep) pkgNs)) (Logic.not (Equality.equal (Packaging.moduleDependencyModule dep) coreNs))) currentDeps+ newDeps =+ Lists.concat2 filteredDeps [+ Packaging.ModuleDependency {+ Packaging.moduleDependencyModule = pkgNs,+ Packaging.moduleDependencyPackage = Nothing},+ Packaging.ModuleDependency {+ Packaging.moduleDependencyModule = coreNs,+ Packaging.moduleDependencyPackage = Nothing}]+ in Packaging.Module {+ Packaging.moduleName = (Packaging.moduleName m),+ Packaging.moduleMetadata = (Packaging.moduleMetadata m),+ Packaging.moduleDependencies = newDeps,+ Packaging.moduleDefinitions = newDefs}))++-- | Compute transitive closure of dependencies for a set of modules+moduleDepsTransitive :: M.Map Packaging.ModuleName Packaging.Module -> [Packaging.Module] -> [Packaging.Module]+moduleDepsTransitive nsMap modules =++ let closure =+ Sets.union (transitiveDeps (\m -> Lists.map (\dep -> Packaging.moduleDependencyModule dep) (Packaging.moduleDependencies m)) nsMap modules) (Sets.fromList (Lists.map (\m -> Packaging.moduleName m) modules))+ in (Optionals.givens (Lists.map (\n -> Maps.lookup n nsMap) (Sets.toList closure)))++-- | Convert a module name to a file path (e.g., hydra.core.model -> hydra/core)+moduleNameToPath :: Packaging.ModuleName -> String+moduleNameToPath ns = Strings.join "/" (Strings.splitOn "." (Packaging.unModuleName ns))++-- | Convert a Module to a JSON string+moduleToJson :: M.Map Model.Name Model.Type -> Packaging.Module -> Either Errors.Error String+moduleToJson schemaMap m =++ let term = EncodePackaging.module_ m+ modType = Model.TypeVariable (Model.Name "hydra.core.packaging.Module")+ in (Eithers.map (\json -> Writer.printJson json) (Eithers.bimap (\_e -> Errors.ErrorOther (Errors.OtherError _e)) (\_a -> _a) (Encode.toJson schemaMap False (Model.Name "hydra.core.packaging.Module") modType term)))++-- | Convert a generated Module into a Source module+moduleToSourceModule :: Packaging.Module -> Packaging.Module+moduleToSourceModule m =++ let sourceNs =+ Packaging.ModuleName (Strings.concat2 "hydra.sources." (Strings.join "." (Lists.drop 1 (Strings.splitOn "." (Packaging.unModuleName (Packaging.moduleName m))))))+ modTypeNs = Packaging.ModuleName "hydra.core.packaging"+ moduleDef =+ Packaging.DefinitionTerm (Packaging.TermDefinition {+ Packaging.termDefinitionName = (Model.Name (Strings.concat2 (Packaging.unModuleName sourceNs) ".module_")),+ Packaging.termDefinitionMetadata = Nothing,+ Packaging.termDefinitionSignature = (Just (Scoping.typeSchemeToTermSignature (Model.TypeScheme {+ Model.typeSchemeVariables = [],+ Model.typeSchemeBody = (Model.TypeVariable (Model.Name "hydra.core.packaging.Module")),+ Model.typeSchemeConstraints = Maps.empty}))),+ Packaging.termDefinitionBody = (EncodePackaging.module_ m)})+ in Packaging.Module {+ Packaging.moduleName = sourceNs,+ Packaging.moduleMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just (Strings.concat2 "Source module for " (Packaging.unModuleName (Packaging.moduleName m)))),+ Packaging.entityMetadataComments = [],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.moduleDependencies = [+ Packaging.ModuleDependency {+ Packaging.moduleDependencyModule = modTypeNs,+ Packaging.moduleDependencyPackage = Nothing}],+ Packaging.moduleDefinitions = [+ moduleDef]}++-- | Build a graph from universe modules and working modules, using an explicit bootstrap graph+modulesToGraph :: Graph.Graph -> [Packaging.Module] -> [Packaging.Module] -> Graph.Graph+modulesToGraph bsGraph universeModules modules =++ let universe = Maps.fromList (Lists.map (\m -> (Packaging.moduleName m, m)) (Lists.concat2 universeModules modules))+ closureModules = moduleDepsTransitive universe (Lists.concat2 universeModules modules)+ schemaElements =+ Lists.concat (Lists.map (\m -> Optionals.givens (Lists.map (\d -> case d of+ Packaging.DefinitionType v0 -> Just ((\name -> \typ ->+ let schemaTerm = Model.TermVariable (Model.Name "hydra.core.model.Type")+ dataTerm =+ Annotations.normalizeTermAnnotations (Model.TermAnnotated (Model.AnnotatedTerm {+ Model.annotatedTermBody = (EncodeModel.type_ typ),+ Model.annotatedTermAnnotation = (Annotations.wrapAnnotationMap (Maps.fromList [+ (Constants.keyType, schemaTerm)]))}))+ in Model.Binding {+ Model.bindingName = name,+ Model.bindingTerm = dataTerm,+ Model.bindingTypeScheme = (Just (Model.TypeScheme {+ Model.typeSchemeVariables = [],+ Model.typeSchemeBody = (Model.TypeVariable (Model.Name "hydra.core.model.Type")),+ Model.typeSchemeConstraints = Maps.empty}))}) (Packaging.typeDefinitionName v0) (Model.typeSchemeBody (Packaging.typeDefinitionBody v0)))+ _ -> Nothing) (Packaging.moduleDefinitions m))) closureModules)+ dataElements =+ Lists.concat (Lists.map (\m -> Optionals.givens (Lists.map (\d -> case d of+ Packaging.DefinitionTerm v0 -> Just (Model.Binding {+ Model.bindingName = (Packaging.termDefinitionName v0),+ Model.bindingTerm = (Packaging.termDefinitionBody v0),+ Model.bindingTypeScheme = (Optionals.map Scoping.termSignatureToTypeScheme (Packaging.termDefinitionSignature v0))})+ _ -> Nothing) (Packaging.moduleDefinitions m))) closureModules)+ schemaGraph = Lexical.elementsToGraph bsGraph Maps.empty schemaElements+ schemaTypes = Eithers.either (\_ -> Maps.empty) (\_r -> _r) (Environment.schemaGraphToTypingEnvironment schemaGraph)+ baseGraph = Lexical.elementsToGraph bsGraph schemaTypes dataElements+ universeDataElements =+ Lists.concat (Lists.map (\m -> Optionals.givens (Lists.map (\d -> case d of+ Packaging.DefinitionTerm v0 -> Just (Model.Binding {+ Model.bindingName = (Packaging.termDefinitionName v0),+ Model.bindingTerm = (Packaging.termDefinitionBody v0),+ Model.bindingTypeScheme = (Optionals.map Scoping.termSignatureToTypeScheme (Packaging.termDefinitionSignature v0))})+ _ -> Nothing) (Packaging.moduleDefinitions m))) universeModules)+ universeBoundTypes =+ Maps.fromList (Optionals.givens (Lists.map (\b -> Optionals.map (\ts -> (Model.bindingName b, ts)) (Model.bindingTypeScheme b)) universeDataElements))+ in Graph.Graph {+ Graph.graphBoundTerms = (Graph.graphBoundTerms baseGraph),+ Graph.graphBoundTypes = universeBoundTypes,+ Graph.graphClassConstraints = (Graph.graphClassConstraints baseGraph),+ Graph.graphLambdaVariables = (Graph.graphLambdaVariables baseGraph),+ Graph.graphMetadata = (Graph.graphMetadata baseGraph),+ Graph.graphPrimitives = (Graph.graphPrimitives baseGraph),+ Graph.graphSchemaTypes = (Graph.graphSchemaTypes baseGraph),+ Graph.graphTypeVariables = (Graph.graphTypeVariables baseGraph)}++-- | Rebuild a module's term definitions using freshly inferred bindings+refreshModule :: [Model.Binding] -> Packaging.Module -> Packaging.Module+refreshModule inferredElements m =+ Logic.ifElse (Logic.not (Logic.not (Lists.isEmpty (Optionals.givens (Lists.map (\d -> case d of+ Packaging.DefinitionTerm v0 -> Just (Model.Binding {+ Model.bindingName = (Packaging.termDefinitionName v0),+ Model.bindingTerm = (Packaging.termDefinitionBody v0),+ Model.bindingTypeScheme = (Optionals.map Scoping.termSignatureToTypeScheme (Packaging.termDefinitionSignature v0))})+ _ -> Nothing) (Packaging.moduleDefinitions m)))))) m (Packaging.Module {+ Packaging.moduleName = (Packaging.moduleName m),+ Packaging.moduleMetadata = (Packaging.moduleMetadata m),+ Packaging.moduleDependencies = (Packaging.moduleDependencies m),+ Packaging.moduleDefinitions = (Optionals.givens (Lists.map (\d -> case d of+ Packaging.DefinitionType v0 -> Just (Packaging.DefinitionType v0)+ Packaging.DefinitionTerm v0 -> Optionals.map (\b -> Packaging.DefinitionTerm (Packaging.TermDefinition {+ Packaging.termDefinitionName = (Model.bindingName b),+ Packaging.termDefinitionMetadata = Nothing,+ Packaging.termDefinitionSignature = (Optionals.map Scoping.typeSchemeToTermSignature (Model.bindingTypeScheme b)),+ Packaging.termDefinitionBody = (Model.bindingTerm b)})) (Lists.find (\b -> Equality.equal (Model.bindingName b) (Packaging.termDefinitionName v0)) inferredElements)+ Packaging.DefinitionPrimitive v0 -> Just (Packaging.DefinitionPrimitive v0)) (Packaging.moduleDefinitions m)))})++-- | Compute transitive closure of module dependencies+transitiveDeps :: (Packaging.Module -> [Packaging.ModuleName]) -> M.Map Packaging.ModuleName Packaging.Module -> [Packaging.Module] -> S.Set Packaging.ModuleName+transitiveDeps getDeps nsMap startMods =++ let initialDeps =+ Sets.fromList (Lists.concat (Lists.map (\m -> Lists.filter (\dep -> Logic.not (Equality.equal dep (Packaging.moduleName m))) (getDeps m)) startMods))+ go =+ \pending -> \visited -> Logic.ifElse (Sets.isEmpty pending) visited (+ let newVisited = Sets.union visited pending+ nextDeps =+ Sets.fromList (Lists.concat (Lists.map (\nsv -> Optionals.match (Maps.lookup nsv nsMap) [] (\depMod -> getDeps depMod)) (Sets.toList pending)))+ newPending = Sets.difference nextDeps newVisited+ in (go newPending newVisited))+ in (go initialDeps Sets.empty)
@@ -0,0 +1,250 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Abstractions for paired transformations between languages++module Hydra.Core.Coders where++import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void+import qualified Data.Map as M+import qualified Data.Set as S++-- | A two-level bidirectional encoder which adapts types to types and terms to terms+data Adapter t1 t2 v1 v2 e =+ Adapter {+ -- | Whether information may be lost in the course of this adaptation+ adapterIsLossy :: Bool,+ -- | The source type+ adapterSource :: t1,+ -- | The target type+ adapterTarget :: t2,+ -- | The coder for transforming instances of the source type to instances of the target type+ adapterCoder :: (Coder v1 v2 e)}++_Adapter = Model.Name "hydra.core.coders.Adapter"++_Adapter_isLossy = Model.Name "isLossy"++_Adapter_source = Model.Name "source"++_Adapter_target = Model.Name "target"++_Adapter_coder = Model.Name "coder"++-- | An evaluation context together with a source language and a target language+data AdapterContext =+ AdapterContext {+ -- | The underlying graph of elements and primitives+ adapterContextGraph :: Graph.Graph,+ -- | The language being encoded or decoded+ adapterContextLanguage :: Language,+ -- | A map of type names to adapters for those types+ adapterContextAdapters :: (M.Map Model.Name (Adapter Model.Type Model.Type Model.Term Model.Term Errors.Error))}++_AdapterContext = Model.Name "hydra.core.coders.AdapterContext"++_AdapterContext_graph = Model.Name "graph"++_AdapterContext_language = Model.Name "language"++_AdapterContext_adapters = Model.Name "adapters"++-- | A two-level encoder and decoder, operating both at a type level and an instance (data) level+data Bicoder t1 t2 v1 v2 e =+ Bicoder {+ -- | A function from source types to adapters+ bicoderEncode :: (t1 -> Adapter t1 t2 v1 v2 e),+ -- | A function from target types to adapters+ bicoderDecode :: (t2 -> Adapter t2 t1 v2 v1 e)}++_Bicoder = Model.Name "hydra.core.coders.Bicoder"++_Bicoder_encode = Model.Name "encode"++_Bicoder_decode = Model.Name "decode"++-- | Per-target case conventions for name forms that vary across emission targets+data CaseConventions =+ CaseConventions {+ -- | Convention for compile-time constant names+ caseConventionsConstant :: Util.CaseConvention,+ -- | Convention for each directory level in the emitted source tree+ caseConventionsDirectory :: Util.CaseConvention,+ -- | Convention for enum-variant value names+ caseConventionsEnumValue :: Util.CaseConvention,+ -- | Convention for record field names+ caseConventionsField :: Util.CaseConvention,+ -- | Convention for the source-file basename+ caseConventionsFile :: Util.CaseConvention,+ -- | Convention for a single segment of a module name+ caseConventionsModule :: Util.CaseConvention,+ -- | Convention for top-level term definitions (functions, module-level values)+ caseConventionsTerm :: Util.CaseConvention,+ -- | Convention for locally-bound term names (lambda parameters, let-bindings)+ caseConventionsTermVariable :: Util.CaseConvention,+ -- | Convention for type names+ caseConventionsType :: Util.CaseConvention,+ -- | Convention for type-level variable names+ caseConventionsTypeVariable :: Util.CaseConvention}+ deriving (Eq, Ord, Read, Show)++_CaseConventions = Model.Name "hydra.core.coders.CaseConventions"++_CaseConventions_constant = Model.Name "constant"++_CaseConventions_directory = Model.Name "directory"++_CaseConventions_enumValue = Model.Name "enumValue"++_CaseConventions_field = Model.Name "field"++_CaseConventions_file = Model.Name "file"++_CaseConventions_module = Model.Name "module"++_CaseConventions_term = Model.Name "term"++_CaseConventions_termVariable = Model.Name "termVariable"++_CaseConventions_type = Model.Name "type"++_CaseConventions_typeVariable = Model.Name "typeVariable"++-- | An encoder and decoder; a pair of partial functions between two types+data Coder v1 v2 e =+ Coder {+ -- | A function which encodes a domain value to a codomain value, with the possibility of failure+ coderEncode :: (v1 -> Either e v2),+ -- | A function which decodes a codomain value to a domain value, with the possibility of failure+ coderDecode :: (v2 -> Either e v1)}++_Coder = Model.Name "hydra.core.coders.Coder"++_Coder_encode = Model.Name "encode"++_Coder_decode = Model.Name "decode"++-- | Indicates either the 'out' or the 'in' direction of a coder+data CoderDirection =+ CoderDirectionEncode |+ CoderDirectionDecode+ deriving (Eq, Ord, Read, Show)++_CoderDirection = Model.Name "hydra.core.coders.CoderDirection"++_CoderDirection_encode = Model.Name "encode"++_CoderDirection_decode = Model.Name "decode"++-- | A named language together with its grammar constraints, capability profile, naming conventions, and conventional file extension+data Language =+ Language {+ -- | The unique name of the language+ languageName :: LanguageName,+ -- | Constraints which characterize the language's type and term grammars+ languageConstraints :: LanguageConstraints,+ -- | Target-language or target-runtime capabilities the emitter may assume are available+ languageSupportedFeatures :: (S.Set LanguageFeature),+ -- | Per-target case conventions for the various kinds of identifiers emitted by the coder+ languageCaseConventions :: CaseConventions,+ -- | Conventional file extension for emitted source files, without the leading dot (e.g. "scala", "py")+ languageDefaultFileExtension :: File.FileExtension}++_Language = Model.Name "hydra.core.coders.Language"++_Language_name = Model.Name "name"++_Language_constraints = Model.Name "constraints"++_Language_supportedFeatures = Model.Name "supportedFeatures"++_Language_caseConventions = Model.Name "caseConventions"++_Language_defaultFileExtension = Model.Name "defaultFileExtension"++-- | A set of constraints on valid type and term expressions, characterizing a language+data LanguageConstraints =+ LanguageConstraints {+ -- | All supported literal variants+ languageConstraintsLiteralVariants :: (S.Set Variants.LiteralVariant),+ -- | All supported float types+ languageConstraintsFloatTypes :: (S.Set Model.FloatType),+ -- | All supported integer types+ languageConstraintsIntegerTypes :: (S.Set Model.IntegerType),+ -- | All supported term variants+ languageConstraintsTermVariants :: (S.Set Variants.TermVariant),+ -- | All supported type variants+ languageConstraintsTypeVariants :: (S.Set Variants.TypeVariant),+ -- | A logical set of types, as a predicate which tests a type for inclusion+ languageConstraintsTypes :: (Model.Type -> Bool)}++_LanguageConstraints = Model.Name "hydra.core.coders.LanguageConstraints"++_LanguageConstraints_literalVariants = Model.Name "literalVariants"++_LanguageConstraints_floatTypes = Model.Name "floatTypes"++_LanguageConstraints_integerTypes = Model.Name "integerTypes"++_LanguageConstraints_termVariants = Model.Name "termVariants"++_LanguageConstraints_typeVariants = Model.Name "typeVariants"++_LanguageConstraints_types = Model.Name "types"++-- | A target-language or target-runtime capability the coder may rely on. Absence from a Language's supportedFeatures set means the emitter must work around the missing capability.+data LanguageFeature =+ -- | The target runtime can invoke an n-ary function with fewer than n arguments without error. When absent, the emitter eta-expands partially-applied terms.+ LanguageFeaturePartialApplication |+ -- | The target runtime can handle deeply nested case statements without stack issues. When absent, the emitter hoists cases out into top-level helpers.+ LanguageFeatureNestedCaseStatements |+ -- | The target language permits polymorphic let-bindings in expression position. When absent, the emitter hoists polymorphic lets to top level.+ LanguageFeatureNestedPolymorphicLetBindings+ deriving (Eq, Ord, Read, Show)++_LanguageFeature = Model.Name "hydra.core.coders.LanguageFeature"++_LanguageFeature_partialApplication = Model.Name "partialApplication"++_LanguageFeature_nestedCaseStatements = Model.Name "nestedCaseStatements"++_LanguageFeature_nestedPolymorphicLetBindings = Model.Name "nestedPolymorphicLetBindings"++-- | The unique name of a language+newtype LanguageName =+ LanguageName {+ unLanguageName :: String}+ deriving (Eq, Ord, Read, Show)++_LanguageName = Model.Name "hydra.core.coders.LanguageName"++-- | A bidirectional encoder which maps between the same type and term languages on either side+type SymmetricAdapter t v e = (Adapter t t v v e)++_SymmetricAdapter = Model.Name "hydra.core.coders.SymmetricAdapter"++-- | Specifies either a pre-order or post-order traversal+data TraversalOrder =+ -- | Pre-order traversal+ TraversalOrderPre |+ -- | Post-order traversal+ TraversalOrderPost+ deriving (Eq, Ord, Read, Show)++_TraversalOrder = Model.Name "hydra.core.coders.TraversalOrder"++_TraversalOrder_pre = Model.Name "pre"++_TraversalOrder_post = Model.Name "post"++-- | A function which maps a Hydra type to a symmetric adapter between types and terms+type TypeAdapter = (AdapterContext -> Model.Type -> Either String (SymmetricAdapter Model.Type Model.Term String))++_TypeAdapter = Model.Name "hydra.core.coders.TypeAdapter"
@@ -0,0 +1,120 @@+-- Note: this is an automatically generated file. Do not edit.++-- | A module for tier-0 constants.++module Hydra.Core.Constants where++import qualified Hydra.Core.Ast as Ast+import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Diff as Diff+import qualified Hydra.Core.Docs as Docs+import qualified Hydra.Core.Error.Checking as Checking+import qualified Hydra.Core.Error.File as ErrorFile+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Error.Packaging as ErrorPackaging+import qualified Hydra.Core.Error.System as ErrorSystem+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Json.Model as JsonModel+import qualified Hydra.Core.Markdown as Markdown+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Parsing as Parsing+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Query as Query+import qualified Hydra.Core.Regex as Regex+import qualified Hydra.Core.Relational as Relational+import qualified Hydra.Core.System as System+import qualified Hydra.Core.Tabular as Tabular+import qualified Hydra.Core.Testing as Testing+import qualified Hydra.Core.Time as Time+import qualified Hydra.Core.Topology as Topology+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Validation as Validation+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | The conventional field name used when normalizing a wrapped (newtype) value to a single-field record+fieldNameValue :: String+fieldNameValue = "value"++-- | The name used for ignored variables+ignoredVariable :: String+ignoredVariable = "_"++-- | Annotation key for type classes+keyClasses :: Model.Name+keyClasses = Model.Name "classes"++-- | Annotation key for debug identifiers+keyDebugId :: Model.Name+keyDebugId = Model.Name "debugId"++-- | Annotation key for deprecated markers+keyDeprecated :: Model.Name+keyDeprecated = Model.Name "deprecated"++-- | Annotation key for descriptions+keyDescription :: Model.Name+keyDescription = Model.Name "description"++-- | Annotation key for exclusions+keyExclude :: Model.Name+keyExclude = Model.Name "exclude"++-- | A flag which tells the language coders to encode a given encoded type as a term rather than a native type+keyFirstClassType :: Model.Name+keyFirstClassType = Model.Name "firstClassType"++-- | A counter for generating fresh type variable names+keyFreshTypeVariableCount :: Model.Name+keyFreshTypeVariableCount = Model.Name "freshTypeVariableCount"++-- | Annotation key for maximum length constraints+keyMaxLength :: Model.Name+keyMaxLength = Model.Name "maxLength"++-- | Annotation key for minimum length constraints+keyMinLength :: Model.Name+keyMinLength = Model.Name "minLength"++-- | Annotation key for preserving field names during code generation+keyPreserveFieldName :: Model.Name+keyPreserveFieldName = Model.Name "preserveFieldName"++-- | Annotation key for type information+keyType :: Model.Name+keyType = Model.Name "type"++-- | The maximum value of a 32-bit integer+maxInt32 :: Int+maxInt32 = 2147483647++-- | A maximum depth for nested computations. Currently, this is set very high because deep recursion is common in type inference over the Hydra kernel.+maxTraceDepth :: Int+maxTraceDepth = 5000++-- | Regex matching a camelCase identifier: starts with a lowercase letter, then any letters or digits.+regexCamelCase :: String+regexCamelCase = "^[a-z][a-zA-Z0-9]*$"++-- | Regex matching a Hydra namespace: dot-separated camelCase segments, each starting with a lowercase letter.+regexNamespace :: String+regexNamespace = "^[a-z][a-zA-Z0-9]*(\\.[a-z][a-zA-Z0-9]*)*$"++-- | Regex matching a Hydra package name: hyphen-separated lowercase segments, each starting with a letter.+regexPackageName :: String+regexPackageName = "^[a-z][a-z0-9]*(-[a-z][a-z0-9]*)*$"++-- | Regex matching a PascalCase identifier: starts with an uppercase letter, then any letters or digits.+regexPascalCase :: String+regexPascalCase = "^[A-Z][a-zA-Z0-9]*$"++-- | A standard warning message for auto-generated files+warningAutoGeneratedFile :: String+warningAutoGeneratedFile = "Note: this is an automatically generated file. Do not edit."
@@ -0,0 +1,249 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Term decoders for hydra.core.ast++module Hydra.Core.Decode.Ast where++import qualified Hydra.Core.Ast as Ast+import qualified Hydra.Core.Decode.Model as DecodeModel+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.Extract.Model as ExtractModel+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Lexical as Lexical+import qualified Hydra.Core.Overlay.Haskell.Lib.Eithers as Eithers+import qualified Hydra.Core.Overlay.Haskell.Lib.Maps as Maps+import qualified Hydra.Core.Overlay.Haskell.Lib.Optionals as Optionals+import qualified Hydra.Core.Overlay.Haskell.Lib.Strings as Strings+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Rewriting as Rewriting+import qualified Hydra.Core.Util as Util+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | Decoder for hydra.core.ast.Associativity+associativity :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Ast.Associativity+associativity cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermInject v0 ->+ let field = Model.injectionField v0+ fname = Model.fieldName field+ fterm = Model.fieldTerm field+ variantMap =+ Maps.fromList [+ (Model.Name "none", (\input -> Eithers.map (\t -> Ast.AssociativityNone) (ExtractModel.decodeUnit cx input))),+ (Model.Name "left", (\input -> Eithers.map (\t -> Ast.AssociativityLeft) (ExtractModel.decodeUnit cx input))),+ (Model.Name "right", (\input -> Eithers.map (\t -> Ast.AssociativityRight) (ExtractModel.decodeUnit cx input))),+ (Model.Name "both", (\input -> Eithers.map (\t -> Ast.AssociativityBoth) (ExtractModel.decodeUnit cx input)))]+ in (Optionals.match (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [+ "no such field ",+ (Model.unName fname),+ " in union"]))) (\f -> f fterm))+ _ -> Left (Errors.DecodingError "expected union")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.ast.BlockStyle+blockStyle :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Ast.BlockStyle+blockStyle cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "indent" (ExtractModel.decodeMaybe (\cx2 -> \raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of+ Model.TermLiteral v1 -> case v1 of+ Model.LiteralString v2 -> Right v2+ _ -> Left (Errors.DecodingError "expected string literal")+ _ -> Left (Errors.DecodingError "expected literal")) (ExtractModel.stripWithDecodingError cx2 raw2))) fieldMap cx) (\field_indent -> Eithers.bind (ExtractModel.requireField "newlineBeforeContent" (\cx2 -> \raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of+ Model.TermLiteral v1 -> case v1 of+ Model.LiteralBoolean v2 -> Right v2+ _ -> Left (Errors.DecodingError "expected boolean literal")+ _ -> Left (Errors.DecodingError "expected literal")) (ExtractModel.stripWithDecodingError cx2 raw2)) fieldMap cx) (\field_newlineBeforeContent -> Eithers.bind (ExtractModel.requireField "newlineAfterContent" (\cx2 -> \raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of+ Model.TermLiteral v1 -> case v1 of+ Model.LiteralBoolean v2 -> Right v2+ _ -> Left (Errors.DecodingError "expected boolean literal")+ _ -> Left (Errors.DecodingError "expected literal")) (ExtractModel.stripWithDecodingError cx2 raw2)) fieldMap cx) (\field_newlineAfterContent -> Right (Ast.BlockStyle {+ Ast.blockStyleIndent = field_indent,+ Ast.blockStyleNewlineBeforeContent = field_newlineBeforeContent,+ Ast.blockStyleNewlineAfterContent = field_newlineAfterContent})))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.ast.BlockStyle")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.ast.BracketExpr+bracketExpr :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Ast.BracketExpr+bracketExpr cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "brackets" brackets fieldMap cx) (\field_brackets -> Eithers.bind (ExtractModel.requireField "enclosed" expr fieldMap cx) (\field_enclosed -> Eithers.bind (ExtractModel.requireField "style" blockStyle fieldMap cx) (\field_style -> Right (Ast.BracketExpr {+ Ast.bracketExprBrackets = field_brackets,+ Ast.bracketExprEnclosed = field_enclosed,+ Ast.bracketExprStyle = field_style})))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.ast.BracketExpr")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.ast.Brackets+brackets :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Ast.Brackets+brackets cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "open" symbol fieldMap cx) (\field_open -> Eithers.bind (ExtractModel.requireField "close" symbol fieldMap cx) (\field_close -> Right (Ast.Brackets {+ Ast.bracketsOpen = field_open,+ Ast.bracketsClose = field_close}))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.ast.Brackets")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.ast.Expr+expr :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Ast.Expr+expr cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermInject v0 ->+ let field = Model.injectionField v0+ fname = Model.fieldName field+ fterm = Model.fieldTerm field+ variantMap =+ Maps.fromList [+ (Model.Name "const", (\input -> Eithers.map (\t -> Ast.ExprConst t) (symbol cx input))),+ (Model.Name "indent", (\input -> Eithers.map (\t -> Ast.ExprIndent t) (indentedExpression cx input))),+ (Model.Name "op", (\input -> Eithers.map (\t -> Ast.ExprOp t) (opExpr cx input))),+ (Model.Name "brackets", (\input -> Eithers.map (\t -> Ast.ExprBrackets t) (bracketExpr cx input))),+ (Model.Name "seq", (\input -> Eithers.map (\t -> Ast.ExprSeq t) (seqExpr cx input)))]+ in (Optionals.match (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [+ "no such field ",+ (Model.unName fname),+ " in union"]))) (\f -> f fterm))+ _ -> Left (Errors.DecodingError "expected union")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.ast.IndentStyle+indentStyle :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Ast.IndentStyle+indentStyle cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermInject v0 ->+ let field = Model.injectionField v0+ fname = Model.fieldName field+ fterm = Model.fieldTerm field+ variantMap =+ Maps.fromList [+ (+ Model.Name "allLines",+ (\input -> Eithers.map (\t -> Ast.IndentStyleAllLines t) (Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of+ Model.TermLiteral v1 -> case v1 of+ Model.LiteralString v2 -> Right v2+ _ -> Left (Errors.DecodingError "expected string literal")+ _ -> Left (Errors.DecodingError "expected literal")) (ExtractModel.stripWithDecodingError cx input)))),+ (+ Model.Name "subsequentLines",+ (\input -> Eithers.map (\t -> Ast.IndentStyleSubsequentLines t) (Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of+ Model.TermLiteral v1 -> case v1 of+ Model.LiteralString v2 -> Right v2+ _ -> Left (Errors.DecodingError "expected string literal")+ _ -> Left (Errors.DecodingError "expected literal")) (ExtractModel.stripWithDecodingError cx input))))]+ in (Optionals.match (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [+ "no such field ",+ (Model.unName fname),+ " in union"]))) (\f -> f fterm))+ _ -> Left (Errors.DecodingError "expected union")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.ast.IndentedExpression+indentedExpression :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Ast.IndentedExpression+indentedExpression cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "style" indentStyle fieldMap cx) (\field_style -> Eithers.bind (ExtractModel.requireField "expr" expr fieldMap cx) (\field_expr -> Right (Ast.IndentedExpression {+ Ast.indentedExpressionStyle = field_style,+ Ast.indentedExpressionExpr = field_expr}))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.ast.IndentedExpression")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.ast.Op+op :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Ast.Op+op cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "symbol" symbol fieldMap cx) (\field_symbol -> Eithers.bind (ExtractModel.requireField "padding" padding fieldMap cx) (\field_padding -> Eithers.bind (ExtractModel.requireField "precedence" precedence fieldMap cx) (\field_precedence -> Eithers.bind (ExtractModel.requireField "associativity" associativity fieldMap cx) (\field_associativity -> Right (Ast.Op {+ Ast.opSymbol = field_symbol,+ Ast.opPadding = field_padding,+ Ast.opPrecedence = field_precedence,+ Ast.opAssociativity = field_associativity}))))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.ast.Op")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.ast.OpExpr+opExpr :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Ast.OpExpr+opExpr cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "op" op fieldMap cx) (\field_op -> Eithers.bind (ExtractModel.requireField "lhs" expr fieldMap cx) (\field_lhs -> Eithers.bind (ExtractModel.requireField "rhs" expr fieldMap cx) (\field_rhs -> Right (Ast.OpExpr {+ Ast.opExprOp = field_op,+ Ast.opExprLhs = field_lhs,+ Ast.opExprRhs = field_rhs})))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.ast.OpExpr")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.ast.Padding+padding :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Ast.Padding+padding cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "left" ws fieldMap cx) (\field_left -> Eithers.bind (ExtractModel.requireField "right" ws fieldMap cx) (\field_right -> Right (Ast.Padding {+ Ast.paddingLeft = field_left,+ Ast.paddingRight = field_right}))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.ast.Padding")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.ast.Precedence+precedence :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Ast.Precedence+precedence cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermWrap v0 -> Eithers.map (\b -> Ast.Precedence b) ((\raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of+ Model.TermLiteral v1 -> case v1 of+ Model.LiteralInteger v2 -> case v2 of+ Model.IntegerValueInt32 v3 -> Right v3+ _ -> Left (Errors.DecodingError "expected int32 value")+ _ -> Left (Errors.DecodingError "expected int32 literal")+ _ -> Left (Errors.DecodingError "expected literal")) (ExtractModel.stripWithDecodingError cx raw2)) (Model.wrappedTermBody v0))+ _ -> Left (Errors.DecodingError "expected wrapped type")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.ast.SeqExpr+seqExpr :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Ast.SeqExpr+seqExpr cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "op" op fieldMap cx) (\field_op -> Eithers.bind (ExtractModel.requireField "elements" (ExtractModel.decodeList expr) fieldMap cx) (\field_elements -> Right (Ast.SeqExpr {+ Ast.seqExprOp = field_op,+ Ast.seqExprElements = field_elements}))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.ast.SeqExpr")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.ast.Symbol+symbol :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Ast.Symbol+symbol cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermWrap v0 -> Eithers.map (\b -> Ast.Symbol b) ((\raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of+ Model.TermLiteral v1 -> case v1 of+ Model.LiteralString v2 -> Right v2+ _ -> Left (Errors.DecodingError "expected string literal")+ _ -> Left (Errors.DecodingError "expected literal")) (ExtractModel.stripWithDecodingError cx raw2)) (Model.wrappedTermBody v0))+ _ -> Left (Errors.DecodingError "expected wrapped type")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.ast.Ws+ws :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Ast.Ws+ws cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermInject v0 ->+ let field = Model.injectionField v0+ fname = Model.fieldName field+ fterm = Model.fieldTerm field+ variantMap =+ Maps.fromList [+ (Model.Name "none", (\input -> Eithers.map (\t -> Ast.WsNone) (ExtractModel.decodeUnit cx input))),+ (Model.Name "space", (\input -> Eithers.map (\t -> Ast.WsSpace) (ExtractModel.decodeUnit cx input))),+ (Model.Name "break", (\input -> Eithers.map (\t -> Ast.WsBreak) (ExtractModel.decodeUnit cx input))),+ (+ Model.Name "breakAndIndent",+ (\input -> Eithers.map (\t -> Ast.WsBreakAndIndent t) (Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of+ Model.TermLiteral v1 -> case v1 of+ Model.LiteralString v2 -> Right v2+ _ -> Left (Errors.DecodingError "expected string literal")+ _ -> Left (Errors.DecodingError "expected literal")) (ExtractModel.stripWithDecodingError cx input)))),+ (Model.Name "doubleBreak", (\input -> Eithers.map (\t -> Ast.WsDoubleBreak) (ExtractModel.decodeUnit cx input)))]+ in (Optionals.match (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [+ "no such field ",+ (Model.unName fname),+ " in union"]))) (\f -> f fterm))+ _ -> Left (Errors.DecodingError "expected union")) (ExtractModel.stripWithDecodingError cx raw)
@@ -0,0 +1,117 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Term decoders for hydra.core.coders++module Hydra.Core.Decode.Coders where++import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Decode.Errors as DecodeErrors+import qualified Hydra.Core.Decode.File as File+import qualified Hydra.Core.Decode.Model as DecodeModel+import qualified Hydra.Core.Decode.Util as DecodeUtil+import qualified Hydra.Core.Decode.Variants as Variants+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.Extract.Model as ExtractModel+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Lexical as Lexical+import qualified Hydra.Core.Overlay.Haskell.Lib.Eithers as Eithers+import qualified Hydra.Core.Overlay.Haskell.Lib.Maps as Maps+import qualified Hydra.Core.Overlay.Haskell.Lib.Optionals as Optionals+import qualified Hydra.Core.Overlay.Haskell.Lib.Strings as Strings+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Rewriting as Rewriting+import qualified Hydra.Core.Util as Util+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | Decoder for hydra.core.coders.CaseConventions+caseConventions :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Coders.CaseConventions+caseConventions cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "constant" DecodeUtil.caseConvention fieldMap cx) (\field_constant -> Eithers.bind (ExtractModel.requireField "directory" DecodeUtil.caseConvention fieldMap cx) (\field_directory -> Eithers.bind (ExtractModel.requireField "enumValue" DecodeUtil.caseConvention fieldMap cx) (\field_enumValue -> Eithers.bind (ExtractModel.requireField "field" DecodeUtil.caseConvention fieldMap cx) (\field_field -> Eithers.bind (ExtractModel.requireField "file" DecodeUtil.caseConvention fieldMap cx) (\field_file -> Eithers.bind (ExtractModel.requireField "module" DecodeUtil.caseConvention fieldMap cx) (\field_module -> Eithers.bind (ExtractModel.requireField "term" DecodeUtil.caseConvention fieldMap cx) (\field_term -> Eithers.bind (ExtractModel.requireField "termVariable" DecodeUtil.caseConvention fieldMap cx) (\field_termVariable -> Eithers.bind (ExtractModel.requireField "type" DecodeUtil.caseConvention fieldMap cx) (\field_type -> Eithers.bind (ExtractModel.requireField "typeVariable" DecodeUtil.caseConvention fieldMap cx) (\field_typeVariable -> Right (Coders.CaseConventions {+ Coders.caseConventionsConstant = field_constant,+ Coders.caseConventionsDirectory = field_directory,+ Coders.caseConventionsEnumValue = field_enumValue,+ Coders.caseConventionsField = field_field,+ Coders.caseConventionsFile = field_file,+ Coders.caseConventionsModule = field_module,+ Coders.caseConventionsTerm = field_term,+ Coders.caseConventionsTermVariable = field_termVariable,+ Coders.caseConventionsType = field_type,+ Coders.caseConventionsTypeVariable = field_typeVariable}))))))))))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.coders.CaseConventions")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.coders.CoderDirection+coderDirection :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Coders.CoderDirection+coderDirection cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermInject v0 ->+ let field = Model.injectionField v0+ fname = Model.fieldName field+ fterm = Model.fieldTerm field+ variantMap =+ Maps.fromList [+ (Model.Name "encode", (\input -> Eithers.map (\t -> Coders.CoderDirectionEncode) (ExtractModel.decodeUnit cx input))),+ (Model.Name "decode", (\input -> Eithers.map (\t -> Coders.CoderDirectionDecode) (ExtractModel.decodeUnit cx input)))]+ in (Optionals.match (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [+ "no such field ",+ (Model.unName fname),+ " in union"]))) (\f -> f fterm))+ _ -> Left (Errors.DecodingError "expected union")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.coders.LanguageFeature+languageFeature :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Coders.LanguageFeature+languageFeature cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermInject v0 ->+ let field = Model.injectionField v0+ fname = Model.fieldName field+ fterm = Model.fieldTerm field+ variantMap =+ Maps.fromList [+ (+ Model.Name "partialApplication",+ (\input -> Eithers.map (\t -> Coders.LanguageFeaturePartialApplication) (ExtractModel.decodeUnit cx input))),+ (+ Model.Name "nestedCaseStatements",+ (\input -> Eithers.map (\t -> Coders.LanguageFeatureNestedCaseStatements) (ExtractModel.decodeUnit cx input))),+ (+ Model.Name "nestedPolymorphicLetBindings",+ (\input -> Eithers.map (\t -> Coders.LanguageFeatureNestedPolymorphicLetBindings) (ExtractModel.decodeUnit cx input)))]+ in (Optionals.match (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [+ "no such field ",+ (Model.unName fname),+ " in union"]))) (\f -> f fterm))+ _ -> Left (Errors.DecodingError "expected union")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.coders.LanguageName+languageName :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Coders.LanguageName+languageName cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermWrap v0 -> Eithers.map (\b -> Coders.LanguageName b) ((\raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of+ Model.TermLiteral v1 -> case v1 of+ Model.LiteralString v2 -> Right v2+ _ -> Left (Errors.DecodingError "expected string literal")+ _ -> Left (Errors.DecodingError "expected literal")) (ExtractModel.stripWithDecodingError cx raw2)) (Model.wrappedTermBody v0))+ _ -> Left (Errors.DecodingError "expected wrapped type")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.coders.TraversalOrder+traversalOrder :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Coders.TraversalOrder+traversalOrder cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermInject v0 ->+ let field = Model.injectionField v0+ fname = Model.fieldName field+ fterm = Model.fieldTerm field+ variantMap =+ Maps.fromList [+ (Model.Name "pre", (\input -> Eithers.map (\t -> Coders.TraversalOrderPre) (ExtractModel.decodeUnit cx input))),+ (Model.Name "post", (\input -> Eithers.map (\t -> Coders.TraversalOrderPost) (ExtractModel.decodeUnit cx input)))]+ in (Optionals.match (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [+ "no such field ",+ (Model.unName fname),+ " in union"]))) (\f -> f fterm))+ _ -> Left (Errors.DecodingError "expected union")) (ExtractModel.stripWithDecodingError cx raw)
@@ -0,0 +1,160 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Term decoders for hydra.core.diff++module Hydra.Core.Decode.Diff where++import qualified Hydra.Core.Decode.Model as DecodeModel+import qualified Hydra.Core.Diff as Diff+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.Extract.Model as ExtractModel+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Lexical as Lexical+import qualified Hydra.Core.Overlay.Haskell.Lib.Eithers as Eithers+import qualified Hydra.Core.Overlay.Haskell.Lib.Maps as Maps+import qualified Hydra.Core.Overlay.Haskell.Lib.Optionals as Optionals+import qualified Hydra.Core.Overlay.Haskell.Lib.Strings as Strings+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Rewriting as Rewriting+import qualified Hydra.Core.Util as Util+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | Decoder for hydra.core.diff.Edit+edit :: (Graph.Graph -> Model.Term -> Either Errors.DecodingError a) -> (Graph.Graph -> Model.Term -> Either Errors.DecodingError s) -> Graph.Graph -> Model.Term -> Either Errors.DecodingError (Diff.Edit a s)+edit a s cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermInject v0 ->+ let field = Model.injectionField v0+ fname = Model.fieldName field+ fterm = Model.fieldTerm field+ variantMap =+ Maps.fromList [+ (Model.Name "retain", (\input -> Eithers.map (\t -> Diff.EditRetain) (ExtractModel.decodeUnit cx input))),+ (Model.Name "set", (\input -> Eithers.map (\t -> Diff.EditSet t) (a cx input))),+ (Model.Name "delete", (\input -> Eithers.map (\t -> Diff.EditDelete) (ExtractModel.decodeUnit cx input))),+ (+ Model.Name "descend",+ (\input -> Eithers.map (\t -> Diff.EditDescend t) (ExtractModel.decodeList (stepEdit a s) cx input)))]+ in (Optionals.match (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [+ "no such field ",+ (Model.unName fname),+ " in union"]))) (\f -> f fterm))+ _ -> Left (Errors.DecodingError "expected union")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.diff.Hole+hole :: (Graph.Graph -> Model.Term -> Either Errors.DecodingError t) -> (Graph.Graph -> Model.Term -> Either Errors.DecodingError s) -> Graph.Graph -> Model.Term -> Either Errors.DecodingError (Diff.Hole t s)+hole t s cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "path" (ExtractModel.decodeList s) fieldMap cx) (\field_path -> Eithers.bind (ExtractModel.requireField "type" t fieldMap cx) (\field_type -> Right (Diff.Hole {+ Diff.holePath = field_path,+ Diff.holeType = field_type}))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.diff.Hole")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.diff.HoleFiller+holeFiller :: (Graph.Graph -> Model.Term -> Either Errors.DecodingError v) -> (Graph.Graph -> Model.Term -> Either Errors.DecodingError s) -> Graph.Graph -> Model.Term -> Either Errors.DecodingError (Diff.HoleFiller v s)+holeFiller v s cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "path" (ExtractModel.decodeList s) fieldMap cx) (\field_path -> Eithers.bind (ExtractModel.requireField "value" v fieldMap cx) (\field_value -> Right (Diff.HoleFiller {+ Diff.holeFillerPath = field_path,+ Diff.holeFillerValue = field_value}))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.diff.HoleFiller")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.diff.InvalidFillError+invalidFillError :: (Graph.Graph -> Model.Term -> Either Errors.DecodingError t) -> (Graph.Graph -> Model.Term -> Either Errors.DecodingError v) -> (Graph.Graph -> Model.Term -> Either Errors.DecodingError s) -> Graph.Graph -> Model.Term -> Either Errors.DecodingError (Diff.InvalidFillError t v s)+invalidFillError t v s cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermInject v0 ->+ let field = Model.injectionField v0+ fname = Model.fieldName field+ fterm = Model.fieldTerm field+ variantMap =+ Maps.fromList [+ (Model.Name "illTyped", (\input -> Eithers.map (\t2 -> Diff.InvalidFillErrorIllTyped t2) (hole t s cx input))),+ (Model.Name "missingFill", (\input -> Eithers.map (\t2 -> Diff.InvalidFillErrorMissingFill t2) (hole t s cx input))),+ (+ Model.Name "extraFill",+ (\input -> Eithers.map (\t2 -> Diff.InvalidFillErrorExtraFill t2) (Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of+ Model.TermLiteral v1 -> case v1 of+ Model.LiteralInteger v2 -> case v2 of+ Model.IntegerValueInt32 v3 -> Right v3+ _ -> Left (Errors.DecodingError "expected int32 value")+ _ -> Left (Errors.DecodingError "expected int32 literal")+ _ -> Left (Errors.DecodingError "expected literal")) (ExtractModel.stripWithDecodingError cx input))))]+ in (Optionals.match (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [+ "no such field ",+ (Model.unName fname),+ " in union"]))) (\f -> f fterm))+ _ -> Left (Errors.DecodingError "expected union")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.diff.MigrationError+migrationError :: (Graph.Graph -> Model.Term -> Either Errors.DecodingError t) -> (Graph.Graph -> Model.Term -> Either Errors.DecodingError v) -> (Graph.Graph -> Model.Term -> Either Errors.DecodingError s) -> Graph.Graph -> Model.Term -> Either Errors.DecodingError (Diff.MigrationError t v s)+migrationError t v s cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermInject v0 ->+ let field = Model.injectionField v0+ fname = Model.fieldName field+ fterm = Model.fieldTerm field+ variantMap =+ Maps.fromList [+ (Model.Name "notAnInstance", (\input -> Eithers.map (\t2 -> Diff.MigrationErrorNotAnInstance t2) (v cx input))),+ (Model.Name "outOfRange", (\input -> Eithers.map (\t2 -> Diff.MigrationErrorOutOfRange t2) (v cx input))),+ (Model.Name "rejectedVariant", (\input -> Eithers.map (\t2 -> Diff.MigrationErrorRejectedVariant t2) (v cx input))),+ (+ Model.Name "illTypedResult",+ (\input -> Eithers.map (\t2 -> Diff.MigrationErrorIllTypedResult t2) (mistyped t v cx input))),+ (Model.Name "unfilledHole", (\input -> Eithers.map (\t2 -> Diff.MigrationErrorUnfilledHole t2) (hole t s cx input)))]+ in (Optionals.match (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [+ "no such field ",+ (Model.unName fname),+ " in union"]))) (\f -> f fterm))+ _ -> Left (Errors.DecodingError "expected union")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.diff.MigrationPlan+migrationPlan :: Ord n => ((Graph.Graph -> Model.Term -> Either Errors.DecodingError n) -> (Graph.Graph -> Model.Term -> Either Errors.DecodingError t) -> (Graph.Graph -> Model.Term -> Either Errors.DecodingError s) -> Graph.Graph -> Model.Term -> Either Errors.DecodingError (Diff.MigrationPlan n t s))+migrationPlan n t s cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "edits" (ExtractModel.decodeMap n (edit t s)) fieldMap cx) (\field_edits -> Eithers.bind (ExtractModel.requireField "holes" (ExtractModel.decodeList (schemaHole n t s)) fieldMap cx) (\field_holes -> Right (Diff.MigrationPlan {+ Diff.migrationPlanEdits = field_edits,+ Diff.migrationPlanHoles = field_holes}))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.diff.MigrationPlan")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.diff.Mistyped+mistyped :: (Graph.Graph -> Model.Term -> Either Errors.DecodingError t) -> (Graph.Graph -> Model.Term -> Either Errors.DecodingError v) -> Graph.Graph -> Model.Term -> Either Errors.DecodingError (Diff.Mistyped t v)+mistyped t v cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "value" v fieldMap cx) (\field_value -> Eithers.bind (ExtractModel.requireField "type" t fieldMap cx) (\field_type -> Right (Diff.Mistyped {+ Diff.mistypedValue = field_value,+ Diff.mistypedType = field_type}))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.diff.Mistyped")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.diff.SchemaHole+schemaHole :: (Graph.Graph -> Model.Term -> Either Errors.DecodingError n) -> (Graph.Graph -> Model.Term -> Either Errors.DecodingError t) -> (Graph.Graph -> Model.Term -> Either Errors.DecodingError s) -> Graph.Graph -> Model.Term -> Either Errors.DecodingError (Diff.SchemaHole n t s)+schemaHole n t s cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "typeName" n fieldMap cx) (\field_typeName -> Eithers.bind (ExtractModel.requireField "hole" (hole t s) fieldMap cx) (\field_hole -> Right (Diff.SchemaHole {+ Diff.schemaHoleTypeName = field_typeName,+ Diff.schemaHoleHole = field_hole}))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.diff.SchemaHole")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.diff.StepEdit+stepEdit :: (Graph.Graph -> Model.Term -> Either Errors.DecodingError a) -> (Graph.Graph -> Model.Term -> Either Errors.DecodingError s) -> Graph.Graph -> Model.Term -> Either Errors.DecodingError (Diff.StepEdit a s)+stepEdit a s cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "step" s fieldMap cx) (\field_step -> Eithers.bind (ExtractModel.requireField "edit" (edit a s) fieldMap cx) (\field_edit -> Right (Diff.StepEdit {+ Diff.stepEditStep = field_step,+ Diff.stepEditEdit = field_edit}))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.diff.StepEdit")) (ExtractModel.stripWithDecodingError cx raw)
@@ -0,0 +1,46 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Term decoders for hydra.core.docs++module Hydra.Core.Decode.Docs where++import qualified Hydra.Core.Decode.Packaging as Packaging+import qualified Hydra.Core.Docs as Docs+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.Extract.Model as ExtractModel+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Lexical as Lexical+import qualified Hydra.Core.Overlay.Haskell.Lib.Eithers as Eithers+import qualified Hydra.Core.Overlay.Haskell.Lib.Maps as Maps+import qualified Hydra.Core.Overlay.Haskell.Lib.Optionals as Optionals+import qualified Hydra.Core.Overlay.Haskell.Lib.Strings as Strings+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Rewriting as Rewriting+import qualified Hydra.Core.Util as Util+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | Decoder for hydra.core.docs.DocSegment+docSegment :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Docs.DocSegment+docSegment cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermInject v0 ->+ let field = Model.injectionField v0+ fname = Model.fieldName field+ fterm = Model.fieldTerm field+ variantMap =+ Maps.fromList [+ (Model.Name "ref", (\input -> Eithers.map (\t -> Docs.DocSegmentRef t) (Packaging.entityReference cx input))),+ (+ Model.Name "text",+ (\input -> Eithers.map (\t -> Docs.DocSegmentText t) (Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of+ Model.TermLiteral v1 -> case v1 of+ Model.LiteralString v2 -> Right v2+ _ -> Left (Errors.DecodingError "expected string literal")+ _ -> Left (Errors.DecodingError "expected literal")) (ExtractModel.stripWithDecodingError cx input))))]+ in (Optionals.match (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [+ "no such field ",+ (Model.unName fname),+ " in union"]))) (\f -> f fterm))+ _ -> Left (Errors.DecodingError "expected union")) (ExtractModel.stripWithDecodingError cx raw)
@@ -0,0 +1,238 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Term decoders for hydra.core.error.checking++module Hydra.Core.Decode.Error.Checking where++import qualified Hydra.Core.Decode.Model as DecodeModel+import qualified Hydra.Core.Decode.Paths as Paths+import qualified Hydra.Core.Decode.Typing as Typing+import qualified Hydra.Core.Decode.Variants as Variants+import qualified Hydra.Core.Error.Checking as Checking+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.Extract.Model as ExtractModel+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Lexical as Lexical+import qualified Hydra.Core.Overlay.Haskell.Lib.Eithers as Eithers+import qualified Hydra.Core.Overlay.Haskell.Lib.Maps as Maps+import qualified Hydra.Core.Overlay.Haskell.Lib.Optionals as Optionals+import qualified Hydra.Core.Overlay.Haskell.Lib.Strings as Strings+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Rewriting as Rewriting+import qualified Hydra.Core.Util as Util+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | Decoder for hydra.core.error.checking.CheckingError+checkingError :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Checking.CheckingError+checkingError cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermInject v0 ->+ let field = Model.injectionField v0+ fname = Model.fieldName field+ fterm = Model.fieldTerm field+ variantMap =+ Maps.fromList [+ (+ Model.Name "incorrectUnification",+ (\input -> Eithers.map (\t -> Checking.CheckingErrorIncorrectUnification t) (incorrectUnificationError cx input))),+ (+ Model.Name "notAForallType",+ (\input -> Eithers.map (\t -> Checking.CheckingErrorNotAForallType t) (notAForallTypeError cx input))),+ (+ Model.Name "notAFunctionType",+ (\input -> Eithers.map (\t -> Checking.CheckingErrorNotAFunctionType t) (notAFunctionTypeError cx input))),+ (Model.Name "other", (\input -> Eithers.map (\t -> Checking.CheckingErrorOther t) (otherCheckingError cx input))),+ (+ Model.Name "typeArityMismatch",+ (\input -> Eithers.map (\t -> Checking.CheckingErrorTypeArityMismatch t) (typeArityMismatchError cx input))),+ (+ Model.Name "typeMismatch",+ (\input -> Eithers.map (\t -> Checking.CheckingErrorTypeMismatch t) (typeMismatchError cx input))),+ (+ Model.Name "unboundTypeVariables",+ (\input -> Eithers.map (\t -> Checking.CheckingErrorUnboundTypeVariables t) (unboundTypeVariablesError cx input))),+ (+ Model.Name "undefinedTermVariable",+ (\input -> Eithers.map (\t -> Checking.CheckingErrorUndefinedTermVariable t) (undefinedTermVariableCheckingError cx input))),+ (+ Model.Name "unequalTypes",+ (\input -> Eithers.map (\t -> Checking.CheckingErrorUnequalTypes t) (unequalTypesError cx input))),+ (+ Model.Name "unsupportedTermVariant",+ (\input -> Eithers.map (\t -> Checking.CheckingErrorUnsupportedTermVariant t) (unsupportedTermVariantError cx input))),+ (+ Model.Name "untypedLambda",+ (\input -> Eithers.map (\t -> Checking.CheckingErrorUntypedLambda t) (untypedLambdaError cx input))),+ (+ Model.Name "untypedLetBinding",+ (\input -> Eithers.map (\t -> Checking.CheckingErrorUntypedLetBinding t) (untypedLetBindingError cx input))),+ (+ Model.Name "untypedTermVariable",+ (\input -> Eithers.map (\t -> Checking.CheckingErrorUntypedTermVariable t) (untypedTermVariableCheckingError cx input)))]+ in (Optionals.match (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [+ "no such field ",+ (Model.unName fname),+ " in union"]))) (\f -> f fterm))+ _ -> Left (Errors.DecodingError "expected union")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.error.checking.IncorrectUnificationError+incorrectUnificationError :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Checking.IncorrectUnificationError+incorrectUnificationError cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "substitution" Typing.typeSubst fieldMap cx) (\field_substitution -> Right (Checking.IncorrectUnificationError {+ Checking.incorrectUnificationErrorSubstitution = field_substitution})))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.error.checking.IncorrectUnificationError")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.error.checking.NotAForallTypeError+notAForallTypeError :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Checking.NotAForallTypeError+notAForallTypeError cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "type" DecodeModel.type_ fieldMap cx) (\field_type -> Eithers.bind (ExtractModel.requireField "typeArguments" (ExtractModel.decodeList DecodeModel.type_) fieldMap cx) (\field_typeArguments -> Right (Checking.NotAForallTypeError {+ Checking.notAForallTypeErrorType = field_type,+ Checking.notAForallTypeErrorTypeArguments = field_typeArguments}))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.error.checking.NotAForallTypeError")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.error.checking.NotAFunctionTypeError+notAFunctionTypeError :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Checking.NotAFunctionTypeError+notAFunctionTypeError cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "type" DecodeModel.type_ fieldMap cx) (\field_type -> Right (Checking.NotAFunctionTypeError {+ Checking.notAFunctionTypeErrorType = field_type})))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.error.checking.NotAFunctionTypeError")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.error.checking.OtherCheckingError+otherCheckingError :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Checking.OtherCheckingError+otherCheckingError cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "path" Paths.subtermPath fieldMap cx) (\field_path -> Eithers.bind (ExtractModel.requireField "message" (\cx2 -> \raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of+ Model.TermLiteral v1 -> case v1 of+ Model.LiteralString v2 -> Right v2+ _ -> Left (Errors.DecodingError "expected string literal")+ _ -> Left (Errors.DecodingError "expected literal")) (ExtractModel.stripWithDecodingError cx2 raw2)) fieldMap cx) (\field_message -> Right (Checking.OtherCheckingError {+ Checking.otherCheckingErrorPath = field_path,+ Checking.otherCheckingErrorMessage = field_message}))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.error.checking.OtherCheckingError")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.error.checking.TypeArityMismatchError+typeArityMismatchError :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Checking.TypeArityMismatchError+typeArityMismatchError cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "type" DecodeModel.type_ fieldMap cx) (\field_type -> Eithers.bind (ExtractModel.requireField "expectedArity" (\cx2 -> \raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of+ Model.TermLiteral v1 -> case v1 of+ Model.LiteralInteger v2 -> case v2 of+ Model.IntegerValueInt32 v3 -> Right v3+ _ -> Left (Errors.DecodingError "expected int32 value")+ _ -> Left (Errors.DecodingError "expected int32 literal")+ _ -> Left (Errors.DecodingError "expected literal")) (ExtractModel.stripWithDecodingError cx2 raw2)) fieldMap cx) (\field_expectedArity -> Eithers.bind (ExtractModel.requireField "actualArity" (\cx2 -> \raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of+ Model.TermLiteral v1 -> case v1 of+ Model.LiteralInteger v2 -> case v2 of+ Model.IntegerValueInt32 v3 -> Right v3+ _ -> Left (Errors.DecodingError "expected int32 value")+ _ -> Left (Errors.DecodingError "expected int32 literal")+ _ -> Left (Errors.DecodingError "expected literal")) (ExtractModel.stripWithDecodingError cx2 raw2)) fieldMap cx) (\field_actualArity -> Eithers.bind (ExtractModel.requireField "typeArguments" (ExtractModel.decodeList DecodeModel.type_) fieldMap cx) (\field_typeArguments -> Right (Checking.TypeArityMismatchError {+ Checking.typeArityMismatchErrorType = field_type,+ Checking.typeArityMismatchErrorExpectedArity = field_expectedArity,+ Checking.typeArityMismatchErrorActualArity = field_actualArity,+ Checking.typeArityMismatchErrorTypeArguments = field_typeArguments}))))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.error.checking.TypeArityMismatchError")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.error.checking.TypeMismatchError+typeMismatchError :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Checking.TypeMismatchError+typeMismatchError cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "expectedType" DecodeModel.type_ fieldMap cx) (\field_expectedType -> Eithers.bind (ExtractModel.requireField "actualType" DecodeModel.type_ fieldMap cx) (\field_actualType -> Right (Checking.TypeMismatchError {+ Checking.typeMismatchErrorExpectedType = field_expectedType,+ Checking.typeMismatchErrorActualType = field_actualType}))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.error.checking.TypeMismatchError")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.error.checking.UnboundTypeVariablesError+unboundTypeVariablesError :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Checking.UnboundTypeVariablesError+unboundTypeVariablesError cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "variables" (ExtractModel.decodeSet DecodeModel.name) fieldMap cx) (\field_variables -> Eithers.bind (ExtractModel.requireField "type" DecodeModel.type_ fieldMap cx) (\field_type -> Right (Checking.UnboundTypeVariablesError {+ Checking.unboundTypeVariablesErrorVariables = field_variables,+ Checking.unboundTypeVariablesErrorType = field_type}))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.error.checking.UnboundTypeVariablesError")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.error.checking.UndefinedTermVariableCheckingError+undefinedTermVariableCheckingError :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Checking.UndefinedTermVariableCheckingError+undefinedTermVariableCheckingError cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "path" Paths.subtermPath fieldMap cx) (\field_path -> Eithers.bind (ExtractModel.requireField "name" DecodeModel.name fieldMap cx) (\field_name -> Right (Checking.UndefinedTermVariableCheckingError {+ Checking.undefinedTermVariableCheckingErrorPath = field_path,+ Checking.undefinedTermVariableCheckingErrorName = field_name}))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.error.checking.UndefinedTermVariableCheckingError")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.error.checking.UnequalTypesError+unequalTypesError :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Checking.UnequalTypesError+unequalTypesError cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "types" (ExtractModel.decodeList DecodeModel.type_) fieldMap cx) (\field_types -> Eithers.bind (ExtractModel.requireField "description" (\cx2 -> \raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of+ Model.TermLiteral v1 -> case v1 of+ Model.LiteralString v2 -> Right v2+ _ -> Left (Errors.DecodingError "expected string literal")+ _ -> Left (Errors.DecodingError "expected literal")) (ExtractModel.stripWithDecodingError cx2 raw2)) fieldMap cx) (\field_description -> Right (Checking.UnequalTypesError {+ Checking.unequalTypesErrorTypes = field_types,+ Checking.unequalTypesErrorDescription = field_description}))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.error.checking.UnequalTypesError")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.error.checking.UnsupportedTermVariantError+unsupportedTermVariantError :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Checking.UnsupportedTermVariantError+unsupportedTermVariantError cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "termVariant" Variants.termVariant fieldMap cx) (\field_termVariant -> Right (Checking.UnsupportedTermVariantError {+ Checking.unsupportedTermVariantErrorTermVariant = field_termVariant})))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.error.checking.UnsupportedTermVariantError")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.error.checking.UntypedLambdaError+untypedLambdaError :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Checking.UntypedLambdaError+untypedLambdaError cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Right (Checking.UntypedLambdaError {+ }))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.error.checking.UntypedLambdaError")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.error.checking.UntypedLetBindingError+untypedLetBindingError :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Checking.UntypedLetBindingError+untypedLetBindingError cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "binding" DecodeModel.binding fieldMap cx) (\field_binding -> Right (Checking.UntypedLetBindingError {+ Checking.untypedLetBindingErrorBinding = field_binding})))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.error.checking.UntypedLetBindingError")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.error.checking.UntypedTermVariableCheckingError+untypedTermVariableCheckingError :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Checking.UntypedTermVariableCheckingError+untypedTermVariableCheckingError cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "path" Paths.subtermPath fieldMap cx) (\field_path -> Eithers.bind (ExtractModel.requireField "name" DecodeModel.name fieldMap cx) (\field_name -> Right (Checking.UntypedTermVariableCheckingError {+ Checking.untypedTermVariableCheckingErrorPath = field_path,+ Checking.untypedTermVariableCheckingErrorName = field_name}))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.error.checking.UntypedTermVariableCheckingError")) (ExtractModel.stripWithDecodingError cx raw)
@@ -0,0 +1,59 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Term decoders for hydra.core.error.file++module Hydra.Core.Decode.Error.File where++import qualified Hydra.Core.Decode.File as DecodeFile+import qualified Hydra.Core.Error.File as ErrorFile+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.Extract.Model as ExtractModel+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Lexical as Lexical+import qualified Hydra.Core.Overlay.Haskell.Lib.Eithers as Eithers+import qualified Hydra.Core.Overlay.Haskell.Lib.Maps as Maps+import qualified Hydra.Core.Overlay.Haskell.Lib.Optionals as Optionals+import qualified Hydra.Core.Overlay.Haskell.Lib.Strings as Strings+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Rewriting as Rewriting+import qualified Hydra.Core.Util as Util+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | Decoder for hydra.core.error.file.FileError+fileError :: Graph.Graph -> Model.Term -> Either Errors.DecodingError ErrorFile.FileError+fileError cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermInject v0 ->+ let field = Model.injectionField v0+ fname = Model.fieldName field+ fterm = Model.fieldTerm field+ variantMap =+ Maps.fromList [+ (+ Model.Name "alreadyExists",+ (\input -> Eithers.map (\t -> ErrorFile.FileErrorAlreadyExists t) (DecodeFile.filePath cx input))),+ (+ Model.Name "invalidPath",+ (\input -> Eithers.map (\t -> ErrorFile.FileErrorInvalidPath t) (Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of+ Model.TermLiteral v1 -> case v1 of+ Model.LiteralString v2 -> Right v2+ _ -> Left (Errors.DecodingError "expected string literal")+ _ -> Left (Errors.DecodingError "expected literal")) (ExtractModel.stripWithDecodingError cx input)))),+ (Model.Name "notFound", (\input -> Eithers.map (\t -> ErrorFile.FileErrorNotFound t) (DecodeFile.filePath cx input))),+ (+ Model.Name "other",+ (\input -> Eithers.map (\t -> ErrorFile.FileErrorOther t) (Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of+ Model.TermLiteral v1 -> case v1 of+ Model.LiteralString v2 -> Right v2+ _ -> Left (Errors.DecodingError "expected string literal")+ _ -> Left (Errors.DecodingError "expected literal")) (ExtractModel.stripWithDecodingError cx input)))),+ (+ Model.Name "permissionDenied",+ (\input -> Eithers.map (\t -> ErrorFile.FileErrorPermissionDenied t) (DecodeFile.filePath cx input)))]+ in (Optionals.match (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [+ "no such field ",+ (Model.unName fname),+ " in union"]))) (\f -> f fterm))+ _ -> Left (Errors.DecodingError "expected union")) (ExtractModel.stripWithDecodingError cx raw)
@@ -0,0 +1,737 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Term decoders for hydra.core.error.model++module Hydra.Core.Decode.Error.Model where++import qualified Hydra.Core.Decode.Model as DecodeModel+import qualified Hydra.Core.Decode.Paths as Paths+import qualified Hydra.Core.Decode.Variants as Variants+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.Extract.Model as ExtractModel+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Lexical as Lexical+import qualified Hydra.Core.Overlay.Haskell.Lib.Eithers as Eithers+import qualified Hydra.Core.Overlay.Haskell.Lib.Maps as Maps+import qualified Hydra.Core.Overlay.Haskell.Lib.Optionals as Optionals+import qualified Hydra.Core.Overlay.Haskell.Lib.Strings as Strings+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Rewriting as Rewriting+import qualified Hydra.Core.Util as Util+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | Decoder for hydra.core.error.model.ConstantConditionError+constantConditionError :: Graph.Graph -> Model.Term -> Either Errors.DecodingError ErrorModel.ConstantConditionError+constantConditionError cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "location" Paths.subtermPath fieldMap cx) (\field_location -> Eithers.bind (ExtractModel.requireField "value" (\cx2 -> \raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of+ Model.TermLiteral v1 -> case v1 of+ Model.LiteralBoolean v2 -> Right v2+ _ -> Left (Errors.DecodingError "expected boolean literal")+ _ -> Left (Errors.DecodingError "expected literal")) (ExtractModel.stripWithDecodingError cx2 raw2)) fieldMap cx) (\field_value -> Right (ErrorModel.ConstantConditionError {+ ErrorModel.constantConditionErrorLocation = field_location,+ ErrorModel.constantConditionErrorValue = field_value}))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.error.model.ConstantConditionError")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.error.model.DuplicateBindingError+duplicateBindingError :: Graph.Graph -> Model.Term -> Either Errors.DecodingError ErrorModel.DuplicateBindingError+duplicateBindingError cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "location" Paths.subtermPath fieldMap cx) (\field_location -> Eithers.bind (ExtractModel.requireField "name" DecodeModel.name fieldMap cx) (\field_name -> Right (ErrorModel.DuplicateBindingError {+ ErrorModel.duplicateBindingErrorLocation = field_location,+ ErrorModel.duplicateBindingErrorName = field_name}))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.error.model.DuplicateBindingError")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.error.model.DuplicateFieldError+duplicateFieldError :: Graph.Graph -> Model.Term -> Either Errors.DecodingError ErrorModel.DuplicateFieldError+duplicateFieldError cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "location" Paths.subtermPath fieldMap cx) (\field_location -> Eithers.bind (ExtractModel.requireField "name" DecodeModel.name fieldMap cx) (\field_name -> Right (ErrorModel.DuplicateFieldError {+ ErrorModel.duplicateFieldErrorLocation = field_location,+ ErrorModel.duplicateFieldErrorName = field_name}))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.error.model.DuplicateFieldError")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.error.model.DuplicateRecordTypeFieldNamesError+duplicateRecordTypeFieldNamesError :: Graph.Graph -> Model.Term -> Either Errors.DecodingError ErrorModel.DuplicateRecordTypeFieldNamesError+duplicateRecordTypeFieldNamesError cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "location" Paths.subtermPath fieldMap cx) (\field_location -> Eithers.bind (ExtractModel.requireField "name" DecodeModel.name fieldMap cx) (\field_name -> Right (ErrorModel.DuplicateRecordTypeFieldNamesError {+ ErrorModel.duplicateRecordTypeFieldNamesErrorLocation = field_location,+ ErrorModel.duplicateRecordTypeFieldNamesErrorName = field_name}))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.error.model.DuplicateRecordTypeFieldNamesError")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.error.model.DuplicateUnionTypeFieldNamesError+duplicateUnionTypeFieldNamesError :: Graph.Graph -> Model.Term -> Either Errors.DecodingError ErrorModel.DuplicateUnionTypeFieldNamesError+duplicateUnionTypeFieldNamesError cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "location" Paths.subtermPath fieldMap cx) (\field_location -> Eithers.bind (ExtractModel.requireField "name" DecodeModel.name fieldMap cx) (\field_name -> Right (ErrorModel.DuplicateUnionTypeFieldNamesError {+ ErrorModel.duplicateUnionTypeFieldNamesErrorLocation = field_location,+ ErrorModel.duplicateUnionTypeFieldNamesErrorName = field_name}))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.error.model.DuplicateUnionTypeFieldNamesError")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.error.model.EmptyCaseStatementError+emptyCaseStatementError :: Graph.Graph -> Model.Term -> Either Errors.DecodingError ErrorModel.EmptyCaseStatementError+emptyCaseStatementError cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "location" Paths.subtermPath fieldMap cx) (\field_location -> Eithers.bind (ExtractModel.requireField "typeName" DecodeModel.name fieldMap cx) (\field_typeName -> Right (ErrorModel.EmptyCaseStatementError {+ ErrorModel.emptyCaseStatementErrorLocation = field_location,+ ErrorModel.emptyCaseStatementErrorTypeName = field_typeName}))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.error.model.EmptyCaseStatementError")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.error.model.EmptyLetBindingsError+emptyLetBindingsError :: Graph.Graph -> Model.Term -> Either Errors.DecodingError ErrorModel.EmptyLetBindingsError+emptyLetBindingsError cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "location" Paths.subtermPath fieldMap cx) (\field_location -> Right (ErrorModel.EmptyLetBindingsError {+ ErrorModel.emptyLetBindingsErrorLocation = field_location})))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.error.model.EmptyLetBindingsError")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.error.model.EmptyRecordTypeError+emptyRecordTypeError :: Graph.Graph -> Model.Term -> Either Errors.DecodingError ErrorModel.EmptyRecordTypeError+emptyRecordTypeError cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "location" Paths.subtermPath fieldMap cx) (\field_location -> Right (ErrorModel.EmptyRecordTypeError {+ ErrorModel.emptyRecordTypeErrorLocation = field_location})))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.error.model.EmptyRecordTypeError")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.error.model.EmptyTermAnnotationError+emptyTermAnnotationError :: Graph.Graph -> Model.Term -> Either Errors.DecodingError ErrorModel.EmptyTermAnnotationError+emptyTermAnnotationError cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "location" Paths.subtermPath fieldMap cx) (\field_location -> Right (ErrorModel.EmptyTermAnnotationError {+ ErrorModel.emptyTermAnnotationErrorLocation = field_location})))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.error.model.EmptyTermAnnotationError")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.error.model.EmptyTypeAnnotationError+emptyTypeAnnotationError :: Graph.Graph -> Model.Term -> Either Errors.DecodingError ErrorModel.EmptyTypeAnnotationError+emptyTypeAnnotationError cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "location" Paths.subtermPath fieldMap cx) (\field_location -> Right (ErrorModel.EmptyTypeAnnotationError {+ ErrorModel.emptyTypeAnnotationErrorLocation = field_location})))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.error.model.EmptyTypeAnnotationError")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.error.model.EmptyTypeNameInTermError+emptyTypeNameInTermError :: Graph.Graph -> Model.Term -> Either Errors.DecodingError ErrorModel.EmptyTypeNameInTermError+emptyTypeNameInTermError cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "location" Paths.subtermPath fieldMap cx) (\field_location -> Right (ErrorModel.EmptyTypeNameInTermError {+ ErrorModel.emptyTypeNameInTermErrorLocation = field_location})))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.error.model.EmptyTypeNameInTermError")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.error.model.EmptyUnionTypeError+emptyUnionTypeError :: Graph.Graph -> Model.Term -> Either Errors.DecodingError ErrorModel.EmptyUnionTypeError+emptyUnionTypeError cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "location" Paths.subtermPath fieldMap cx) (\field_location -> Right (ErrorModel.EmptyUnionTypeError {+ ErrorModel.emptyUnionTypeErrorLocation = field_location})))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.error.model.EmptyUnionTypeError")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.error.model.ExtraRecordFieldsError+extraRecordFieldsError :: Graph.Graph -> Model.Term -> Either Errors.DecodingError ErrorModel.ExtraRecordFieldsError+extraRecordFieldsError cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "location" Paths.subtermPath fieldMap cx) (\field_location -> Eithers.bind (ExtractModel.requireField "typeName" DecodeModel.name fieldMap cx) (\field_typeName -> Eithers.bind (ExtractModel.requireField "fieldNames" (ExtractModel.decodeList DecodeModel.name) fieldMap cx) (\field_fieldNames -> Right (ErrorModel.ExtraRecordFieldsError {+ ErrorModel.extraRecordFieldsErrorLocation = field_location,+ ErrorModel.extraRecordFieldsErrorTypeName = field_typeName,+ ErrorModel.extraRecordFieldsErrorFieldNames = field_fieldNames})))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.error.model.ExtraRecordFieldsError")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.error.model.InvalidForallParameterNameError+invalidForallParameterNameError :: Graph.Graph -> Model.Term -> Either Errors.DecodingError ErrorModel.InvalidForallParameterNameError+invalidForallParameterNameError cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "location" Paths.subtermPath fieldMap cx) (\field_location -> Eithers.bind (ExtractModel.requireField "name" DecodeModel.name fieldMap cx) (\field_name -> Right (ErrorModel.InvalidForallParameterNameError {+ ErrorModel.invalidForallParameterNameErrorLocation = field_location,+ ErrorModel.invalidForallParameterNameErrorName = field_name}))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.error.model.InvalidForallParameterNameError")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.error.model.InvalidLambdaParameterNameError+invalidLambdaParameterNameError :: Graph.Graph -> Model.Term -> Either Errors.DecodingError ErrorModel.InvalidLambdaParameterNameError+invalidLambdaParameterNameError cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "location" Paths.subtermPath fieldMap cx) (\field_location -> Eithers.bind (ExtractModel.requireField "name" DecodeModel.name fieldMap cx) (\field_name -> Right (ErrorModel.InvalidLambdaParameterNameError {+ ErrorModel.invalidLambdaParameterNameErrorLocation = field_location,+ ErrorModel.invalidLambdaParameterNameErrorName = field_name}))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.error.model.InvalidLambdaParameterNameError")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.error.model.InvalidLetBindingNameError+invalidLetBindingNameError :: Graph.Graph -> Model.Term -> Either Errors.DecodingError ErrorModel.InvalidLetBindingNameError+invalidLetBindingNameError cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "location" Paths.subtermPath fieldMap cx) (\field_location -> Eithers.bind (ExtractModel.requireField "name" DecodeModel.name fieldMap cx) (\field_name -> Right (ErrorModel.InvalidLetBindingNameError {+ ErrorModel.invalidLetBindingNameErrorLocation = field_location,+ ErrorModel.invalidLetBindingNameErrorName = field_name}))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.error.model.InvalidLetBindingNameError")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.error.model.InvalidLiteralError+invalidLiteralError :: Graph.Graph -> Model.Term -> Either Errors.DecodingError ErrorModel.InvalidLiteralError+invalidLiteralError cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermInject v0 ->+ let field = Model.injectionField v0+ fname = Model.fieldName field+ fterm = Model.fieldTerm field+ variantMap =+ Maps.fromList [+ (+ Model.Name "typeMismatch",+ (\input -> Eithers.map (\t -> ErrorModel.InvalidLiteralErrorTypeMismatch t) (literalTypeMismatchError cx input)))]+ in (Optionals.match (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [+ "no such field ",+ (Model.unName fname),+ " in union"]))) (\f -> f fterm))+ _ -> Left (Errors.DecodingError "expected union")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.error.model.InvalidTermError+invalidTermError :: Graph.Graph -> Model.Term -> Either Errors.DecodingError ErrorModel.InvalidTermError+invalidTermError cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermInject v0 ->+ let field = Model.injectionField v0+ fname = Model.fieldName field+ fterm = Model.fieldTerm field+ variantMap =+ Maps.fromList [+ (+ Model.Name "constantCondition",+ (\input -> Eithers.map (\t -> ErrorModel.InvalidTermErrorConstantCondition t) (constantConditionError cx input))),+ (+ Model.Name "duplicateBinding",+ (\input -> Eithers.map (\t -> ErrorModel.InvalidTermErrorDuplicateBinding t) (duplicateBindingError cx input))),+ (+ Model.Name "duplicateField",+ (\input -> Eithers.map (\t -> ErrorModel.InvalidTermErrorDuplicateField t) (duplicateFieldError cx input))),+ (+ Model.Name "emptyCaseStatement",+ (\input -> Eithers.map (\t -> ErrorModel.InvalidTermErrorEmptyCaseStatement t) (emptyCaseStatementError cx input))),+ (+ Model.Name "emptyLetBindings",+ (\input -> Eithers.map (\t -> ErrorModel.InvalidTermErrorEmptyLetBindings t) (emptyLetBindingsError cx input))),+ (+ Model.Name "emptyTermAnnotation",+ (\input -> Eithers.map (\t -> ErrorModel.InvalidTermErrorEmptyTermAnnotation t) (emptyTermAnnotationError cx input))),+ (+ Model.Name "emptyTypeNameInTerm",+ (\input -> Eithers.map (\t -> ErrorModel.InvalidTermErrorEmptyTypeNameInTerm t) (emptyTypeNameInTermError cx input))),+ (+ Model.Name "extraRecordFields",+ (\input -> Eithers.map (\t -> ErrorModel.InvalidTermErrorExtraRecordFields t) (extraRecordFieldsError cx input))),+ (+ Model.Name "invalidLambdaParameterName",+ (\input -> Eithers.map (\t -> ErrorModel.InvalidTermErrorInvalidLambdaParameterName t) (invalidLambdaParameterNameError cx input))),+ (+ Model.Name "invalidLetBindingName",+ (\input -> Eithers.map (\t -> ErrorModel.InvalidTermErrorInvalidLetBindingName t) (invalidLetBindingNameError cx input))),+ (+ Model.Name "invalidTypeLambdaParameterName",+ (\input -> Eithers.map (\t -> ErrorModel.InvalidTermErrorInvalidTypeLambdaParameterName t) (invalidTypeLambdaParameterNameError cx input))),+ (+ Model.Name "missingCaseBranches",+ (\input -> Eithers.map (\t -> ErrorModel.InvalidTermErrorMissingCaseBranches t) (missingCaseBranchesError cx input))),+ (+ Model.Name "missingRecordFields",+ (\input -> Eithers.map (\t -> ErrorModel.InvalidTermErrorMissingRecordFields t) (missingRecordFieldsError cx input))),+ (+ Model.Name "nestedTermAnnotation",+ (\input -> Eithers.map (\t -> ErrorModel.InvalidTermErrorNestedTermAnnotation t) (nestedTermAnnotationError cx input))),+ (+ Model.Name "nominalTypeKindMismatch",+ (\input -> Eithers.map (\t -> ErrorModel.InvalidTermErrorNominalTypeKindMismatch t) (nominalTypeKindMismatchError cx input))),+ (+ Model.Name "redundantWrapUnwrap",+ (\input -> Eithers.map (\t -> ErrorModel.InvalidTermErrorRedundantWrapUnwrap t) (redundantWrapUnwrapError cx input))),+ (+ Model.Name "selfApplication",+ (\input -> Eithers.map (\t -> ErrorModel.InvalidTermErrorSelfApplication t) (selfApplicationError cx input))),+ (+ Model.Name "termVariableShadowing",+ (\input -> Eithers.map (\t -> ErrorModel.InvalidTermErrorTermVariableShadowing t) (termVariableShadowingError cx input))),+ (+ Model.Name "typeVariableShadowingInTypeLambda",+ (\input -> Eithers.map (\t -> ErrorModel.InvalidTermErrorTypeVariableShadowingInTypeLambda t) (typeVariableShadowingInTypeLambdaError cx input))),+ (+ Model.Name "undeclaredVariant",+ (\input -> Eithers.map (\t -> ErrorModel.InvalidTermErrorUndeclaredVariant t) (undeclaredVariantError cx input))),+ (+ Model.Name "undefinedTermVariable",+ (\input -> Eithers.map (\t -> ErrorModel.InvalidTermErrorUndefinedTermVariable t) (undefinedTermVariableError cx input))),+ (+ Model.Name "undefinedTypeVariableInBindingType",+ (\input -> Eithers.map (\t -> ErrorModel.InvalidTermErrorUndefinedTypeVariableInBindingType t) (undefinedTypeVariableInBindingTypeError cx input))),+ (+ Model.Name "undefinedTypeVariableInLambdaDomain",+ (\input -> Eithers.map (\t -> ErrorModel.InvalidTermErrorUndefinedTypeVariableInLambdaDomain t) (undefinedTypeVariableInLambdaDomainError cx input))),+ (+ Model.Name "undefinedTypeVariableInTypeApplication",+ (\input -> Eithers.map (\t -> ErrorModel.InvalidTermErrorUndefinedTypeVariableInTypeApplication t) (undefinedTypeVariableInTypeApplicationError cx input))),+ (+ Model.Name "unknownCaseAlternative",+ (\input -> Eithers.map (\t -> ErrorModel.InvalidTermErrorUnknownCaseAlternative t) (unknownCaseAlternativeError cx input))),+ (+ Model.Name "unknownPrimitiveName",+ (\input -> Eithers.map (\t -> ErrorModel.InvalidTermErrorUnknownPrimitiveName t) (unknownPrimitiveNameError cx input))),+ (+ Model.Name "unknownProjectedField",+ (\input -> Eithers.map (\t -> ErrorModel.InvalidTermErrorUnknownProjectedField t) (unknownProjectedFieldError cx input))),+ (+ Model.Name "unnecessaryIdentityApplication",+ (\input -> Eithers.map (\t -> ErrorModel.InvalidTermErrorUnnecessaryIdentityApplication t) (unnecessaryIdentityApplicationError cx input))),+ (+ Model.Name "unresolvedNominalType",+ (\input -> Eithers.map (\t -> ErrorModel.InvalidTermErrorUnresolvedNominalType t) (unresolvedNominalTypeError cx input))),+ (+ Model.Name "untypedTermVariable",+ (\input -> Eithers.map (\t -> ErrorModel.InvalidTermErrorUntypedTermVariable t) (untypedTermVariableError cx input)))]+ in (Optionals.match (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [+ "no such field ",+ (Model.unName fname),+ " in union"]))) (\f -> f fterm))+ _ -> Left (Errors.DecodingError "expected union")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.error.model.InvalidTypeError+invalidTypeError :: Graph.Graph -> Model.Term -> Either Errors.DecodingError ErrorModel.InvalidTypeError+invalidTypeError cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermInject v0 ->+ let field = Model.injectionField v0+ fname = Model.fieldName field+ fterm = Model.fieldTerm field+ variantMap =+ Maps.fromList [+ (+ Model.Name "duplicateRecordTypeFieldNames",+ (\input -> Eithers.map (\t -> ErrorModel.InvalidTypeErrorDuplicateRecordTypeFieldNames t) (duplicateRecordTypeFieldNamesError cx input))),+ (+ Model.Name "duplicateUnionTypeFieldNames",+ (\input -> Eithers.map (\t -> ErrorModel.InvalidTypeErrorDuplicateUnionTypeFieldNames t) (duplicateUnionTypeFieldNamesError cx input))),+ (+ Model.Name "emptyRecordType",+ (\input -> Eithers.map (\t -> ErrorModel.InvalidTypeErrorEmptyRecordType t) (emptyRecordTypeError cx input))),+ (+ Model.Name "emptyTypeAnnotation",+ (\input -> Eithers.map (\t -> ErrorModel.InvalidTypeErrorEmptyTypeAnnotation t) (emptyTypeAnnotationError cx input))),+ (+ Model.Name "emptyUnionType",+ (\input -> Eithers.map (\t -> ErrorModel.InvalidTypeErrorEmptyUnionType t) (emptyUnionTypeError cx input))),+ (+ Model.Name "invalidForallParameterName",+ (\input -> Eithers.map (\t -> ErrorModel.InvalidTypeErrorInvalidForallParameterName t) (invalidForallParameterNameError cx input))),+ (+ Model.Name "invalidTypeSchemeVariableName",+ (\input -> Eithers.map (\t -> ErrorModel.InvalidTypeErrorInvalidTypeSchemeVariableName t) (invalidTypeSchemeVariableNameError cx input))),+ (+ Model.Name "nestedTypeAnnotation",+ (\input -> Eithers.map (\t -> ErrorModel.InvalidTypeErrorNestedTypeAnnotation t) (nestedTypeAnnotationError cx input))),+ (+ Model.Name "nonComparableMapKeyType",+ (\input -> Eithers.map (\t -> ErrorModel.InvalidTypeErrorNonComparableMapKeyType t) (nonComparableMapKeyTypeError cx input))),+ (+ Model.Name "nonComparableSetElementType",+ (\input -> Eithers.map (\t -> ErrorModel.InvalidTypeErrorNonComparableSetElementType t) (nonComparableSetElementTypeError cx input))),+ (+ Model.Name "singleVariantUnion",+ (\input -> Eithers.map (\t -> ErrorModel.InvalidTypeErrorSingleVariantUnion t) (singleVariantUnionError cx input))),+ (+ Model.Name "typeVariableShadowingInForall",+ (\input -> Eithers.map (\t -> ErrorModel.InvalidTypeErrorTypeVariableShadowingInForall t) (typeVariableShadowingInForallError cx input))),+ (+ Model.Name "undefinedTypeVariable",+ (\input -> Eithers.map (\t -> ErrorModel.InvalidTypeErrorUndefinedTypeVariable t) (undefinedTypeVariableError cx input))),+ (+ Model.Name "voidInNonBottomPosition",+ (\input -> Eithers.map (\t -> ErrorModel.InvalidTypeErrorVoidInNonBottomPosition t) (voidInNonBottomPositionError cx input)))]+ in (Optionals.match (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [+ "no such field ",+ (Model.unName fname),+ " in union"]))) (\f -> f fterm))+ _ -> Left (Errors.DecodingError "expected union")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.error.model.InvalidTypeLambdaParameterNameError+invalidTypeLambdaParameterNameError :: Graph.Graph -> Model.Term -> Either Errors.DecodingError ErrorModel.InvalidTypeLambdaParameterNameError+invalidTypeLambdaParameterNameError cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "location" Paths.subtermPath fieldMap cx) (\field_location -> Eithers.bind (ExtractModel.requireField "name" DecodeModel.name fieldMap cx) (\field_name -> Right (ErrorModel.InvalidTypeLambdaParameterNameError {+ ErrorModel.invalidTypeLambdaParameterNameErrorLocation = field_location,+ ErrorModel.invalidTypeLambdaParameterNameErrorName = field_name}))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.error.model.InvalidTypeLambdaParameterNameError")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.error.model.InvalidTypeSchemeVariableNameError+invalidTypeSchemeVariableNameError :: Graph.Graph -> Model.Term -> Either Errors.DecodingError ErrorModel.InvalidTypeSchemeVariableNameError+invalidTypeSchemeVariableNameError cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "location" Paths.subtermPath fieldMap cx) (\field_location -> Eithers.bind (ExtractModel.requireField "name" DecodeModel.name fieldMap cx) (\field_name -> Right (ErrorModel.InvalidTypeSchemeVariableNameError {+ ErrorModel.invalidTypeSchemeVariableNameErrorLocation = field_location,+ ErrorModel.invalidTypeSchemeVariableNameErrorName = field_name}))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.error.model.InvalidTypeSchemeVariableNameError")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.error.model.LiteralTypeMismatchError+literalTypeMismatchError :: Graph.Graph -> Model.Term -> Either Errors.DecodingError ErrorModel.LiteralTypeMismatchError+literalTypeMismatchError cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "expectedType" DecodeModel.literalType fieldMap cx) (\field_expectedType -> Eithers.bind (ExtractModel.requireField "actualType" DecodeModel.literalType fieldMap cx) (\field_actualType -> Right (ErrorModel.LiteralTypeMismatchError {+ ErrorModel.literalTypeMismatchErrorExpectedType = field_expectedType,+ ErrorModel.literalTypeMismatchErrorActualType = field_actualType}))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.error.model.LiteralTypeMismatchError")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.error.model.MissingCaseBranchesError+missingCaseBranchesError :: Graph.Graph -> Model.Term -> Either Errors.DecodingError ErrorModel.MissingCaseBranchesError+missingCaseBranchesError cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "location" Paths.subtermPath fieldMap cx) (\field_location -> Eithers.bind (ExtractModel.requireField "typeName" DecodeModel.name fieldMap cx) (\field_typeName -> Eithers.bind (ExtractModel.requireField "variantNames" (ExtractModel.decodeList DecodeModel.name) fieldMap cx) (\field_variantNames -> Right (ErrorModel.MissingCaseBranchesError {+ ErrorModel.missingCaseBranchesErrorLocation = field_location,+ ErrorModel.missingCaseBranchesErrorTypeName = field_typeName,+ ErrorModel.missingCaseBranchesErrorVariantNames = field_variantNames})))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.error.model.MissingCaseBranchesError")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.error.model.MissingRecordFieldsError+missingRecordFieldsError :: Graph.Graph -> Model.Term -> Either Errors.DecodingError ErrorModel.MissingRecordFieldsError+missingRecordFieldsError cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "location" Paths.subtermPath fieldMap cx) (\field_location -> Eithers.bind (ExtractModel.requireField "typeName" DecodeModel.name fieldMap cx) (\field_typeName -> Eithers.bind (ExtractModel.requireField "fieldNames" (ExtractModel.decodeList DecodeModel.name) fieldMap cx) (\field_fieldNames -> Right (ErrorModel.MissingRecordFieldsError {+ ErrorModel.missingRecordFieldsErrorLocation = field_location,+ ErrorModel.missingRecordFieldsErrorTypeName = field_typeName,+ ErrorModel.missingRecordFieldsErrorFieldNames = field_fieldNames})))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.error.model.MissingRecordFieldsError")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.error.model.NestedTermAnnotationError+nestedTermAnnotationError :: Graph.Graph -> Model.Term -> Either Errors.DecodingError ErrorModel.NestedTermAnnotationError+nestedTermAnnotationError cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "location" Paths.subtermPath fieldMap cx) (\field_location -> Right (ErrorModel.NestedTermAnnotationError {+ ErrorModel.nestedTermAnnotationErrorLocation = field_location})))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.error.model.NestedTermAnnotationError")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.error.model.NestedTypeAnnotationError+nestedTypeAnnotationError :: Graph.Graph -> Model.Term -> Either Errors.DecodingError ErrorModel.NestedTypeAnnotationError+nestedTypeAnnotationError cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "location" Paths.subtermPath fieldMap cx) (\field_location -> Right (ErrorModel.NestedTypeAnnotationError {+ ErrorModel.nestedTypeAnnotationErrorLocation = field_location})))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.error.model.NestedTypeAnnotationError")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.error.model.NominalTypeKindMismatchError+nominalTypeKindMismatchError :: Graph.Graph -> Model.Term -> Either Errors.DecodingError ErrorModel.NominalTypeKindMismatchError+nominalTypeKindMismatchError cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "location" Paths.subtermPath fieldMap cx) (\field_location -> Eithers.bind (ExtractModel.requireField "typeName" DecodeModel.name fieldMap cx) (\field_typeName -> Eithers.bind (ExtractModel.requireField "expectedVariant" Variants.typeVariant fieldMap cx) (\field_expectedVariant -> Eithers.bind (ExtractModel.requireField "actualVariant" Variants.typeVariant fieldMap cx) (\field_actualVariant -> Right (ErrorModel.NominalTypeKindMismatchError {+ ErrorModel.nominalTypeKindMismatchErrorLocation = field_location,+ ErrorModel.nominalTypeKindMismatchErrorTypeName = field_typeName,+ ErrorModel.nominalTypeKindMismatchErrorExpectedVariant = field_expectedVariant,+ ErrorModel.nominalTypeKindMismatchErrorActualVariant = field_actualVariant}))))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.error.model.NominalTypeKindMismatchError")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.error.model.NonComparableMapKeyTypeError+nonComparableMapKeyTypeError :: Graph.Graph -> Model.Term -> Either Errors.DecodingError ErrorModel.NonComparableMapKeyTypeError+nonComparableMapKeyTypeError cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "location" Paths.subtermPath fieldMap cx) (\field_location -> Eithers.bind (ExtractModel.requireField "keyType" DecodeModel.type_ fieldMap cx) (\field_keyType -> Right (ErrorModel.NonComparableMapKeyTypeError {+ ErrorModel.nonComparableMapKeyTypeErrorLocation = field_location,+ ErrorModel.nonComparableMapKeyTypeErrorKeyType = field_keyType}))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.error.model.NonComparableMapKeyTypeError")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.error.model.NonComparableSetElementTypeError+nonComparableSetElementTypeError :: Graph.Graph -> Model.Term -> Either Errors.DecodingError ErrorModel.NonComparableSetElementTypeError+nonComparableSetElementTypeError cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "location" Paths.subtermPath fieldMap cx) (\field_location -> Eithers.bind (ExtractModel.requireField "elementType" DecodeModel.type_ fieldMap cx) (\field_elementType -> Right (ErrorModel.NonComparableSetElementTypeError {+ ErrorModel.nonComparableSetElementTypeErrorLocation = field_location,+ ErrorModel.nonComparableSetElementTypeErrorElementType = field_elementType}))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.error.model.NonComparableSetElementTypeError")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.error.model.RedundantWrapUnwrapError+redundantWrapUnwrapError :: Graph.Graph -> Model.Term -> Either Errors.DecodingError ErrorModel.RedundantWrapUnwrapError+redundantWrapUnwrapError cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "location" Paths.subtermPath fieldMap cx) (\field_location -> Eithers.bind (ExtractModel.requireField "typeName" DecodeModel.name fieldMap cx) (\field_typeName -> Right (ErrorModel.RedundantWrapUnwrapError {+ ErrorModel.redundantWrapUnwrapErrorLocation = field_location,+ ErrorModel.redundantWrapUnwrapErrorTypeName = field_typeName}))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.error.model.RedundantWrapUnwrapError")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.error.model.SelfApplicationError+selfApplicationError :: Graph.Graph -> Model.Term -> Either Errors.DecodingError ErrorModel.SelfApplicationError+selfApplicationError cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "location" Paths.subtermPath fieldMap cx) (\field_location -> Eithers.bind (ExtractModel.requireField "name" DecodeModel.name fieldMap cx) (\field_name -> Right (ErrorModel.SelfApplicationError {+ ErrorModel.selfApplicationErrorLocation = field_location,+ ErrorModel.selfApplicationErrorName = field_name}))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.error.model.SelfApplicationError")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.error.model.SingleVariantUnionError+singleVariantUnionError :: Graph.Graph -> Model.Term -> Either Errors.DecodingError ErrorModel.SingleVariantUnionError+singleVariantUnionError cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "location" Paths.subtermPath fieldMap cx) (\field_location -> Eithers.bind (ExtractModel.requireField "fieldName" DecodeModel.name fieldMap cx) (\field_fieldName -> Right (ErrorModel.SingleVariantUnionError {+ ErrorModel.singleVariantUnionErrorLocation = field_location,+ ErrorModel.singleVariantUnionErrorFieldName = field_fieldName}))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.error.model.SingleVariantUnionError")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.error.model.TermVariableShadowingError+termVariableShadowingError :: Graph.Graph -> Model.Term -> Either Errors.DecodingError ErrorModel.TermVariableShadowingError+termVariableShadowingError cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "location" Paths.subtermPath fieldMap cx) (\field_location -> Eithers.bind (ExtractModel.requireField "name" DecodeModel.name fieldMap cx) (\field_name -> Right (ErrorModel.TermVariableShadowingError {+ ErrorModel.termVariableShadowingErrorLocation = field_location,+ ErrorModel.termVariableShadowingErrorName = field_name}))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.error.model.TermVariableShadowingError")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.error.model.TypeVariableShadowingInForallError+typeVariableShadowingInForallError :: Graph.Graph -> Model.Term -> Either Errors.DecodingError ErrorModel.TypeVariableShadowingInForallError+typeVariableShadowingInForallError cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "location" Paths.subtermPath fieldMap cx) (\field_location -> Eithers.bind (ExtractModel.requireField "name" DecodeModel.name fieldMap cx) (\field_name -> Right (ErrorModel.TypeVariableShadowingInForallError {+ ErrorModel.typeVariableShadowingInForallErrorLocation = field_location,+ ErrorModel.typeVariableShadowingInForallErrorName = field_name}))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.error.model.TypeVariableShadowingInForallError")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.error.model.TypeVariableShadowingInTypeLambdaError+typeVariableShadowingInTypeLambdaError :: Graph.Graph -> Model.Term -> Either Errors.DecodingError ErrorModel.TypeVariableShadowingInTypeLambdaError+typeVariableShadowingInTypeLambdaError cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "location" Paths.subtermPath fieldMap cx) (\field_location -> Eithers.bind (ExtractModel.requireField "name" DecodeModel.name fieldMap cx) (\field_name -> Right (ErrorModel.TypeVariableShadowingInTypeLambdaError {+ ErrorModel.typeVariableShadowingInTypeLambdaErrorLocation = field_location,+ ErrorModel.typeVariableShadowingInTypeLambdaErrorName = field_name}))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.error.model.TypeVariableShadowingInTypeLambdaError")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.error.model.UndeclaredVariantError+undeclaredVariantError :: Graph.Graph -> Model.Term -> Either Errors.DecodingError ErrorModel.UndeclaredVariantError+undeclaredVariantError cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "location" Paths.subtermPath fieldMap cx) (\field_location -> Eithers.bind (ExtractModel.requireField "typeName" DecodeModel.name fieldMap cx) (\field_typeName -> Eithers.bind (ExtractModel.requireField "variantName" DecodeModel.name fieldMap cx) (\field_variantName -> Right (ErrorModel.UndeclaredVariantError {+ ErrorModel.undeclaredVariantErrorLocation = field_location,+ ErrorModel.undeclaredVariantErrorTypeName = field_typeName,+ ErrorModel.undeclaredVariantErrorVariantName = field_variantName})))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.error.model.UndeclaredVariantError")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.error.model.UndefinedFieldError+undefinedFieldError :: Graph.Graph -> Model.Term -> Either Errors.DecodingError ErrorModel.UndefinedFieldError+undefinedFieldError cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "fieldName" DecodeModel.name fieldMap cx) (\field_fieldName -> Eithers.bind (ExtractModel.requireField "typeName" DecodeModel.name fieldMap cx) (\field_typeName -> Right (ErrorModel.UndefinedFieldError {+ ErrorModel.undefinedFieldErrorFieldName = field_fieldName,+ ErrorModel.undefinedFieldErrorTypeName = field_typeName}))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.error.model.UndefinedFieldError")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.error.model.UndefinedTermVariableError+undefinedTermVariableError :: Graph.Graph -> Model.Term -> Either Errors.DecodingError ErrorModel.UndefinedTermVariableError+undefinedTermVariableError cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "location" Paths.subtermPath fieldMap cx) (\field_location -> Eithers.bind (ExtractModel.requireField "name" DecodeModel.name fieldMap cx) (\field_name -> Right (ErrorModel.UndefinedTermVariableError {+ ErrorModel.undefinedTermVariableErrorLocation = field_location,+ ErrorModel.undefinedTermVariableErrorName = field_name}))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.error.model.UndefinedTermVariableError")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.error.model.UndefinedTypeVariableError+undefinedTypeVariableError :: Graph.Graph -> Model.Term -> Either Errors.DecodingError ErrorModel.UndefinedTypeVariableError+undefinedTypeVariableError cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "location" Paths.subtermPath fieldMap cx) (\field_location -> Eithers.bind (ExtractModel.requireField "name" DecodeModel.name fieldMap cx) (\field_name -> Right (ErrorModel.UndefinedTypeVariableError {+ ErrorModel.undefinedTypeVariableErrorLocation = field_location,+ ErrorModel.undefinedTypeVariableErrorName = field_name}))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.error.model.UndefinedTypeVariableError")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.error.model.UndefinedTypeVariableInBindingTypeError+undefinedTypeVariableInBindingTypeError :: Graph.Graph -> Model.Term -> Either Errors.DecodingError ErrorModel.UndefinedTypeVariableInBindingTypeError+undefinedTypeVariableInBindingTypeError cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "location" Paths.subtermPath fieldMap cx) (\field_location -> Eithers.bind (ExtractModel.requireField "name" DecodeModel.name fieldMap cx) (\field_name -> Right (ErrorModel.UndefinedTypeVariableInBindingTypeError {+ ErrorModel.undefinedTypeVariableInBindingTypeErrorLocation = field_location,+ ErrorModel.undefinedTypeVariableInBindingTypeErrorName = field_name}))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.error.model.UndefinedTypeVariableInBindingTypeError")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.error.model.UndefinedTypeVariableInLambdaDomainError+undefinedTypeVariableInLambdaDomainError :: Graph.Graph -> Model.Term -> Either Errors.DecodingError ErrorModel.UndefinedTypeVariableInLambdaDomainError+undefinedTypeVariableInLambdaDomainError cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "location" Paths.subtermPath fieldMap cx) (\field_location -> Eithers.bind (ExtractModel.requireField "name" DecodeModel.name fieldMap cx) (\field_name -> Right (ErrorModel.UndefinedTypeVariableInLambdaDomainError {+ ErrorModel.undefinedTypeVariableInLambdaDomainErrorLocation = field_location,+ ErrorModel.undefinedTypeVariableInLambdaDomainErrorName = field_name}))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.error.model.UndefinedTypeVariableInLambdaDomainError")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.error.model.UndefinedTypeVariableInTypeApplicationError+undefinedTypeVariableInTypeApplicationError :: Graph.Graph -> Model.Term -> Either Errors.DecodingError ErrorModel.UndefinedTypeVariableInTypeApplicationError+undefinedTypeVariableInTypeApplicationError cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "location" Paths.subtermPath fieldMap cx) (\field_location -> Eithers.bind (ExtractModel.requireField "name" DecodeModel.name fieldMap cx) (\field_name -> Right (ErrorModel.UndefinedTypeVariableInTypeApplicationError {+ ErrorModel.undefinedTypeVariableInTypeApplicationErrorLocation = field_location,+ ErrorModel.undefinedTypeVariableInTypeApplicationErrorName = field_name}))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.error.model.UndefinedTypeVariableInTypeApplicationError")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.error.model.UnexpectedTermVariantError+unexpectedTermVariantError :: Graph.Graph -> Model.Term -> Either Errors.DecodingError ErrorModel.UnexpectedTermVariantError+unexpectedTermVariantError cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "expectedVariant" Variants.termVariant fieldMap cx) (\field_expectedVariant -> Eithers.bind (ExtractModel.requireField "actualTerm" DecodeModel.term fieldMap cx) (\field_actualTerm -> Right (ErrorModel.UnexpectedTermVariantError {+ ErrorModel.unexpectedTermVariantErrorExpectedVariant = field_expectedVariant,+ ErrorModel.unexpectedTermVariantErrorActualTerm = field_actualTerm}))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.error.model.UnexpectedTermVariantError")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.error.model.UnexpectedTypeVariantError+unexpectedTypeVariantError :: Graph.Graph -> Model.Term -> Either Errors.DecodingError ErrorModel.UnexpectedTypeVariantError+unexpectedTypeVariantError cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "expectedVariant" Variants.typeVariant fieldMap cx) (\field_expectedVariant -> Eithers.bind (ExtractModel.requireField "actualType" DecodeModel.type_ fieldMap cx) (\field_actualType -> Right (ErrorModel.UnexpectedTypeVariantError {+ ErrorModel.unexpectedTypeVariantErrorExpectedVariant = field_expectedVariant,+ ErrorModel.unexpectedTypeVariantErrorActualType = field_actualType}))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.error.model.UnexpectedTypeVariantError")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.error.model.UnknownCaseAlternativeError+unknownCaseAlternativeError :: Graph.Graph -> Model.Term -> Either Errors.DecodingError ErrorModel.UnknownCaseAlternativeError+unknownCaseAlternativeError cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "location" Paths.subtermPath fieldMap cx) (\field_location -> Eithers.bind (ExtractModel.requireField "typeName" DecodeModel.name fieldMap cx) (\field_typeName -> Eithers.bind (ExtractModel.requireField "name" DecodeModel.name fieldMap cx) (\field_name -> Right (ErrorModel.UnknownCaseAlternativeError {+ ErrorModel.unknownCaseAlternativeErrorLocation = field_location,+ ErrorModel.unknownCaseAlternativeErrorTypeName = field_typeName,+ ErrorModel.unknownCaseAlternativeErrorName = field_name})))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.error.model.UnknownCaseAlternativeError")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.error.model.UnknownPrimitiveNameError+unknownPrimitiveNameError :: Graph.Graph -> Model.Term -> Either Errors.DecodingError ErrorModel.UnknownPrimitiveNameError+unknownPrimitiveNameError cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "location" Paths.subtermPath fieldMap cx) (\field_location -> Eithers.bind (ExtractModel.requireField "name" DecodeModel.name fieldMap cx) (\field_name -> Right (ErrorModel.UnknownPrimitiveNameError {+ ErrorModel.unknownPrimitiveNameErrorLocation = field_location,+ ErrorModel.unknownPrimitiveNameErrorName = field_name}))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.error.model.UnknownPrimitiveNameError")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.error.model.UnknownProjectedFieldError+unknownProjectedFieldError :: Graph.Graph -> Model.Term -> Either Errors.DecodingError ErrorModel.UnknownProjectedFieldError+unknownProjectedFieldError cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "location" Paths.subtermPath fieldMap cx) (\field_location -> Eithers.bind (ExtractModel.requireField "typeName" DecodeModel.name fieldMap cx) (\field_typeName -> Eithers.bind (ExtractModel.requireField "fieldName" DecodeModel.name fieldMap cx) (\field_fieldName -> Right (ErrorModel.UnknownProjectedFieldError {+ ErrorModel.unknownProjectedFieldErrorLocation = field_location,+ ErrorModel.unknownProjectedFieldErrorTypeName = field_typeName,+ ErrorModel.unknownProjectedFieldErrorFieldName = field_fieldName})))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.error.model.UnknownProjectedFieldError")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.error.model.UnnecessaryIdentityApplicationError+unnecessaryIdentityApplicationError :: Graph.Graph -> Model.Term -> Either Errors.DecodingError ErrorModel.UnnecessaryIdentityApplicationError+unnecessaryIdentityApplicationError cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "location" Paths.subtermPath fieldMap cx) (\field_location -> Right (ErrorModel.UnnecessaryIdentityApplicationError {+ ErrorModel.unnecessaryIdentityApplicationErrorLocation = field_location})))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.error.model.UnnecessaryIdentityApplicationError")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.error.model.UnresolvedNominalTypeError+unresolvedNominalTypeError :: Graph.Graph -> Model.Term -> Either Errors.DecodingError ErrorModel.UnresolvedNominalTypeError+unresolvedNominalTypeError cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "location" Paths.subtermPath fieldMap cx) (\field_location -> Eithers.bind (ExtractModel.requireField "typeName" DecodeModel.name fieldMap cx) (\field_typeName -> Right (ErrorModel.UnresolvedNominalTypeError {+ ErrorModel.unresolvedNominalTypeErrorLocation = field_location,+ ErrorModel.unresolvedNominalTypeErrorTypeName = field_typeName}))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.error.model.UnresolvedNominalTypeError")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.error.model.UntypedTermVariableError+untypedTermVariableError :: Graph.Graph -> Model.Term -> Either Errors.DecodingError ErrorModel.UntypedTermVariableError+untypedTermVariableError cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "location" Paths.subtermPath fieldMap cx) (\field_location -> Eithers.bind (ExtractModel.requireField "name" DecodeModel.name fieldMap cx) (\field_name -> Right (ErrorModel.UntypedTermVariableError {+ ErrorModel.untypedTermVariableErrorLocation = field_location,+ ErrorModel.untypedTermVariableErrorName = field_name}))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.error.model.UntypedTermVariableError")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.error.model.VoidInNonBottomPositionError+voidInNonBottomPositionError :: Graph.Graph -> Model.Term -> Either Errors.DecodingError ErrorModel.VoidInNonBottomPositionError+voidInNonBottomPositionError cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "location" Paths.subtermPath fieldMap cx) (\field_location -> Right (ErrorModel.VoidInNonBottomPositionError {+ ErrorModel.voidInNonBottomPositionErrorLocation = field_location})))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.error.model.VoidInNonBottomPositionError")) (ExtractModel.stripWithDecodingError cx raw)
@@ -0,0 +1,244 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Term decoders for hydra.core.error.packaging++module Hydra.Core.Decode.Error.Packaging where++import qualified Hydra.Core.Decode.Model as DecodeModel+import qualified Hydra.Core.Decode.Packaging as DecodePackaging+import qualified Hydra.Core.Decode.Util as DecodeUtil+import qualified Hydra.Core.Error.Packaging as ErrorPackaging+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.Extract.Model as ExtractModel+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Lexical as Lexical+import qualified Hydra.Core.Overlay.Haskell.Lib.Eithers as Eithers+import qualified Hydra.Core.Overlay.Haskell.Lib.Maps as Maps+import qualified Hydra.Core.Overlay.Haskell.Lib.Optionals as Optionals+import qualified Hydra.Core.Overlay.Haskell.Lib.Strings as Strings+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Rewriting as Rewriting+import qualified Hydra.Core.Util as Util+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | Decoder for hydra.core.error.packaging.ConflictingModuleNameError+conflictingModuleNameError :: Graph.Graph -> Model.Term -> Either Errors.DecodingError ErrorPackaging.ConflictingModuleNameError+conflictingModuleNameError cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "first" DecodePackaging.moduleName fieldMap cx) (\field_first -> Eithers.bind (ExtractModel.requireField "second" DecodePackaging.moduleName fieldMap cx) (\field_second -> Right (ErrorPackaging.ConflictingModuleNameError {+ ErrorPackaging.conflictingModuleNameErrorFirst = field_first,+ ErrorPackaging.conflictingModuleNameErrorSecond = field_second}))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.error.packaging.ConflictingModuleNameError")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.error.packaging.ConflictingVariantNameError+conflictingVariantNameError :: Graph.Graph -> Model.Term -> Either Errors.DecodingError ErrorPackaging.ConflictingVariantNameError+conflictingVariantNameError cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "moduleName" DecodePackaging.moduleName fieldMap cx) (\field_moduleName -> Eithers.bind (ExtractModel.requireField "typeName" DecodeModel.name fieldMap cx) (\field_typeName -> Eithers.bind (ExtractModel.requireField "variantName" DecodeModel.name fieldMap cx) (\field_variantName -> Eithers.bind (ExtractModel.requireField "conflictingName" DecodeModel.name fieldMap cx) (\field_conflictingName -> Right (ErrorPackaging.ConflictingVariantNameError {+ ErrorPackaging.conflictingVariantNameErrorModuleName = field_moduleName,+ ErrorPackaging.conflictingVariantNameErrorTypeName = field_typeName,+ ErrorPackaging.conflictingVariantNameErrorVariantName = field_variantName,+ ErrorPackaging.conflictingVariantNameErrorConflictingName = field_conflictingName}))))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.error.packaging.ConflictingVariantNameError")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.error.packaging.DefinitionNotInModuleNameError+definitionNotInModuleNameError :: Graph.Graph -> Model.Term -> Either Errors.DecodingError ErrorPackaging.DefinitionNotInModuleNameError+definitionNotInModuleNameError cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "moduleName" DecodePackaging.moduleName fieldMap cx) (\field_moduleName -> Eithers.bind (ExtractModel.requireField "name" DecodeModel.name fieldMap cx) (\field_name -> Right (ErrorPackaging.DefinitionNotInModuleNameError {+ ErrorPackaging.definitionNotInModuleNameErrorModuleName = field_moduleName,+ ErrorPackaging.definitionNotInModuleNameErrorName = field_name}))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.error.packaging.DefinitionNotInModuleNameError")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.error.packaging.DefinitionsOutOfOrderError+definitionsOutOfOrderError :: Graph.Graph -> Model.Term -> Either Errors.DecodingError ErrorPackaging.DefinitionsOutOfOrderError+definitionsOutOfOrderError cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "moduleName" DecodePackaging.moduleName fieldMap cx) (\field_moduleName -> Eithers.bind (ExtractModel.requireField "precedingName" DecodeModel.name fieldMap cx) (\field_precedingName -> Eithers.bind (ExtractModel.requireField "followingName" DecodeModel.name fieldMap cx) (\field_followingName -> Right (ErrorPackaging.DefinitionsOutOfOrderError {+ ErrorPackaging.definitionsOutOfOrderErrorModuleName = field_moduleName,+ ErrorPackaging.definitionsOutOfOrderErrorPrecedingName = field_precedingName,+ ErrorPackaging.definitionsOutOfOrderErrorFollowingName = field_followingName})))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.error.packaging.DefinitionsOutOfOrderError")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.error.packaging.DuplicateDefinitionNameError+duplicateDefinitionNameError :: Graph.Graph -> Model.Term -> Either Errors.DecodingError ErrorPackaging.DuplicateDefinitionNameError+duplicateDefinitionNameError cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "moduleName" DecodePackaging.moduleName fieldMap cx) (\field_moduleName -> Eithers.bind (ExtractModel.requireField "name" DecodeModel.name fieldMap cx) (\field_name -> Right (ErrorPackaging.DuplicateDefinitionNameError {+ ErrorPackaging.duplicateDefinitionNameErrorModuleName = field_moduleName,+ ErrorPackaging.duplicateDefinitionNameErrorName = field_name}))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.error.packaging.DuplicateDefinitionNameError")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.error.packaging.DuplicateModuleNameError+duplicateModuleNameError :: Graph.Graph -> Model.Term -> Either Errors.DecodingError ErrorPackaging.DuplicateModuleNameError+duplicateModuleNameError cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "moduleName" DecodePackaging.moduleName fieldMap cx) (\field_moduleName -> Right (ErrorPackaging.DuplicateModuleNameError {+ ErrorPackaging.duplicateModuleNameErrorModuleName = field_moduleName})))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.error.packaging.DuplicateModuleNameError")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.error.packaging.InvalidDefinitionNameError+invalidDefinitionNameError :: Graph.Graph -> Model.Term -> Either Errors.DecodingError ErrorPackaging.InvalidDefinitionNameError+invalidDefinitionNameError cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "moduleName" DecodePackaging.moduleName fieldMap cx) (\field_moduleName -> Eithers.bind (ExtractModel.requireField "name" DecodeModel.name fieldMap cx) (\field_name -> Eithers.bind (ExtractModel.requireField "expectedConvention" DecodeUtil.caseConvention fieldMap cx) (\field_expectedConvention -> Right (ErrorPackaging.InvalidDefinitionNameError {+ ErrorPackaging.invalidDefinitionNameErrorModuleName = field_moduleName,+ ErrorPackaging.invalidDefinitionNameErrorName = field_name,+ ErrorPackaging.invalidDefinitionNameErrorExpectedConvention = field_expectedConvention})))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.error.packaging.InvalidDefinitionNameError")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.error.packaging.InvalidModuleError+invalidModuleError :: Graph.Graph -> Model.Term -> Either Errors.DecodingError ErrorPackaging.InvalidModuleError+invalidModuleError cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermInject v0 ->+ let field = Model.injectionField v0+ fname = Model.fieldName field+ fterm = Model.fieldTerm field+ variantMap =+ Maps.fromList [+ (+ Model.Name "conflictingVariantName",+ (\input -> Eithers.map (\t -> ErrorPackaging.InvalidModuleErrorConflictingVariantName t) (conflictingVariantNameError cx input))),+ (+ Model.Name "definitionNotInModuleName",+ (\input -> Eithers.map (\t -> ErrorPackaging.InvalidModuleErrorDefinitionNotInModuleName t) (definitionNotInModuleNameError cx input))),+ (+ Model.Name "definitionsOutOfOrder",+ (\input -> Eithers.map (\t -> ErrorPackaging.InvalidModuleErrorDefinitionsOutOfOrder t) (definitionsOutOfOrderError cx input))),+ (+ Model.Name "duplicateDefinitionName",+ (\input -> Eithers.map (\t -> ErrorPackaging.InvalidModuleErrorDuplicateDefinitionName t) (duplicateDefinitionNameError cx input))),+ (+ Model.Name "invalidDefinitionName",+ (\input -> Eithers.map (\t -> ErrorPackaging.InvalidModuleErrorInvalidDefinitionName t) (invalidDefinitionNameError cx input))),+ (+ Model.Name "invalidModuleNameConvention",+ (\input -> Eithers.map (\t -> ErrorPackaging.InvalidModuleErrorInvalidModuleNameConvention t) (invalidModuleNameConventionError cx input))),+ (+ Model.Name "missingDocumentation",+ (\input -> Eithers.map (\t -> ErrorPackaging.InvalidModuleErrorMissingDocumentation t) (missingDocumentationError cx input)))]+ in (Optionals.match (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [+ "no such field ",+ (Model.unName fname),+ " in union"]))) (\f -> f fterm))+ _ -> Left (Errors.DecodingError "expected union")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.error.packaging.InvalidModuleNameConventionError+invalidModuleNameConventionError :: Graph.Graph -> Model.Term -> Either Errors.DecodingError ErrorPackaging.InvalidModuleNameConventionError+invalidModuleNameConventionError cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "moduleName" DecodePackaging.moduleName fieldMap cx) (\field_moduleName -> Right (ErrorPackaging.InvalidModuleNameConventionError {+ ErrorPackaging.invalidModuleNameConventionErrorModuleName = field_moduleName})))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.error.packaging.InvalidModuleNameConventionError")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.error.packaging.InvalidPackageError+invalidPackageError :: Graph.Graph -> Model.Term -> Either Errors.DecodingError ErrorPackaging.InvalidPackageError+invalidPackageError cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermInject v0 ->+ let field = Model.injectionField v0+ fname = Model.fieldName field+ fterm = Model.fieldTerm field+ variantMap =+ Maps.fromList [+ (+ Model.Name "conflictingModuleName",+ (\input -> Eithers.map (\t -> ErrorPackaging.InvalidPackageErrorConflictingModuleName t) (conflictingModuleNameError cx input))),+ (+ Model.Name "duplicateModuleName",+ (\input -> Eithers.map (\t -> ErrorPackaging.InvalidPackageErrorDuplicateModuleName t) (duplicateModuleNameError cx input))),+ (+ Model.Name "invalidModule",+ (\input -> Eithers.map (\t -> ErrorPackaging.InvalidPackageErrorInvalidModule t) (invalidModuleError cx input))),+ (+ Model.Name "invalidPackageName",+ (\input -> Eithers.map (\t -> ErrorPackaging.InvalidPackageErrorInvalidPackageName t) (invalidPackageNameError cx input))),+ (+ Model.Name "moduleInMultiplePackages",+ (\input -> Eithers.map (\t -> ErrorPackaging.InvalidPackageErrorModuleInMultiplePackages t) (moduleInMultiplePackagesError cx input))),+ (+ Model.Name "nestedModuleName",+ (\input -> Eithers.map (\t -> ErrorPackaging.InvalidPackageErrorNestedModuleName t) (nestedModuleNameError cx input))),+ (+ Model.Name "undeclaredDependency",+ (\input -> Eithers.map (\t -> ErrorPackaging.InvalidPackageErrorUndeclaredDependency t) (undeclaredDependencyError cx input)))]+ in (Optionals.match (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [+ "no such field ",+ (Model.unName fname),+ " in union"]))) (\f -> f fterm))+ _ -> Left (Errors.DecodingError "expected union")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.error.packaging.InvalidPackageNameError+invalidPackageNameError :: Graph.Graph -> Model.Term -> Either Errors.DecodingError ErrorPackaging.InvalidPackageNameError+invalidPackageNameError cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "packageName" DecodePackaging.packageName fieldMap cx) (\field_packageName -> Right (ErrorPackaging.InvalidPackageNameError {+ ErrorPackaging.invalidPackageNameErrorPackageName = field_packageName})))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.error.packaging.InvalidPackageNameError")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.error.packaging.MissingDocumentationError+missingDocumentationError :: Graph.Graph -> Model.Term -> Either Errors.DecodingError ErrorPackaging.MissingDocumentationError+missingDocumentationError cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "moduleName" DecodePackaging.moduleName fieldMap cx) (\field_moduleName -> Eithers.bind (ExtractModel.requireField "name" DecodeModel.name fieldMap cx) (\field_name -> Right (ErrorPackaging.MissingDocumentationError {+ ErrorPackaging.missingDocumentationErrorModuleName = field_moduleName,+ ErrorPackaging.missingDocumentationErrorName = field_name}))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.error.packaging.MissingDocumentationError")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.error.packaging.ModuleInMultiplePackagesError+moduleInMultiplePackagesError :: Graph.Graph -> Model.Term -> Either Errors.DecodingError ErrorPackaging.ModuleInMultiplePackagesError+moduleInMultiplePackagesError cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "moduleName" DecodePackaging.moduleName fieldMap cx) (\field_moduleName -> Eithers.bind (ExtractModel.requireField "firstPackage" DecodePackaging.packageName fieldMap cx) (\field_firstPackage -> Eithers.bind (ExtractModel.requireField "secondPackage" DecodePackaging.packageName fieldMap cx) (\field_secondPackage -> Right (ErrorPackaging.ModuleInMultiplePackagesError {+ ErrorPackaging.moduleInMultiplePackagesErrorModuleName = field_moduleName,+ ErrorPackaging.moduleInMultiplePackagesErrorFirstPackage = field_firstPackage,+ ErrorPackaging.moduleInMultiplePackagesErrorSecondPackage = field_secondPackage})))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.error.packaging.ModuleInMultiplePackagesError")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.error.packaging.NestedModuleNameError+nestedModuleNameError :: Graph.Graph -> Model.Term -> Either Errors.DecodingError ErrorPackaging.NestedModuleNameError+nestedModuleNameError cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "outer" DecodePackaging.moduleName fieldMap cx) (\field_outer -> Eithers.bind (ExtractModel.requireField "inner" DecodePackaging.moduleName fieldMap cx) (\field_inner -> Right (ErrorPackaging.NestedModuleNameError {+ ErrorPackaging.nestedModuleNameErrorOuter = field_outer,+ ErrorPackaging.nestedModuleNameErrorInner = field_inner}))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.error.packaging.NestedModuleNameError")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.error.packaging.UndeclaredDependencyError+undeclaredDependencyError :: Graph.Graph -> Model.Term -> Either Errors.DecodingError ErrorPackaging.UndeclaredDependencyError+undeclaredDependencyError cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "moduleName" DecodePackaging.moduleName fieldMap cx) (\field_moduleName -> Eithers.bind (ExtractModel.requireField "referencedName" DecodeModel.name fieldMap cx) (\field_referencedName -> Eithers.bind (ExtractModel.requireField "owningModuleName" DecodePackaging.moduleName fieldMap cx) (\field_owningModuleName -> Right (ErrorPackaging.UndeclaredDependencyError {+ ErrorPackaging.undeclaredDependencyErrorModuleName = field_moduleName,+ ErrorPackaging.undeclaredDependencyErrorReferencedName = field_referencedName,+ ErrorPackaging.undeclaredDependencyErrorOwningModuleName = field_owningModuleName})))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.error.packaging.UndeclaredDependencyError")) (ExtractModel.stripWithDecodingError cx raw)
@@ -0,0 +1,57 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Term decoders for hydra.core.error.system++module Hydra.Core.Decode.Error.System where++import qualified Hydra.Core.Decode.File as File+import qualified Hydra.Core.Error.System as System+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.Extract.Model as ExtractModel+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Lexical as Lexical+import qualified Hydra.Core.Overlay.Haskell.Lib.Eithers as Eithers+import qualified Hydra.Core.Overlay.Haskell.Lib.Maps as Maps+import qualified Hydra.Core.Overlay.Haskell.Lib.Optionals as Optionals+import qualified Hydra.Core.Overlay.Haskell.Lib.Strings as Strings+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Rewriting as Rewriting+import qualified Hydra.Core.Util as Util+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | Decoder for hydra.core.error.system.SystemError+systemError :: Graph.Graph -> Model.Term -> Either Errors.DecodingError System.SystemError+systemError cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermInject v0 ->+ let field = Model.injectionField v0+ fname = Model.fieldName field+ fterm = Model.fieldTerm field+ variantMap =+ Maps.fromList [+ (+ Model.Name "commandNotFound",+ (\input -> Eithers.map (\t -> System.SystemErrorCommandNotFound t) (File.filePath cx input))),+ (+ Model.Name "permissionDenied",+ (\input -> Eithers.map (\t -> System.SystemErrorPermissionDenied t) (File.filePath cx input))),+ (+ Model.Name "invalidWorkingDirectory",+ (\input -> Eithers.map (\t -> System.SystemErrorInvalidWorkingDirectory t) (File.filePath cx input))),+ (+ Model.Name "interrupted",+ (\input -> Eithers.map (\t -> System.SystemErrorInterrupted) (ExtractModel.decodeUnit cx input))),+ (+ Model.Name "other",+ (\input -> Eithers.map (\t -> System.SystemErrorOther t) (Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of+ Model.TermLiteral v1 -> case v1 of+ Model.LiteralString v2 -> Right v2+ _ -> Left (Errors.DecodingError "expected string literal")+ _ -> Left (Errors.DecodingError "expected literal")) (ExtractModel.stripWithDecodingError cx input))))]+ in (Optionals.match (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [+ "no such field ",+ (Model.unName fname),+ " in union"]))) (\f -> f fterm))+ _ -> Left (Errors.DecodingError "expected union")) (ExtractModel.stripWithDecodingError cx raw)
@@ -0,0 +1,310 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Term decoders for hydra.core.errors++module Hydra.Core.Decode.Errors where++import qualified Hydra.Core.Decode.Error.Checking as Checking+import qualified Hydra.Core.Decode.Error.Model as ErrorModel+import qualified Hydra.Core.Decode.Model as DecodeModel+import qualified Hydra.Core.Decode.Paths as Paths+import qualified Hydra.Core.Decode.Typing as Typing+import qualified Hydra.Core.Decode.Variants as Variants+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.Extract.Model as ExtractModel+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Lexical as Lexical+import qualified Hydra.Core.Overlay.Haskell.Lib.Eithers as Eithers+import qualified Hydra.Core.Overlay.Haskell.Lib.Maps as Maps+import qualified Hydra.Core.Overlay.Haskell.Lib.Optionals as Optionals+import qualified Hydra.Core.Overlay.Haskell.Lib.Strings as Strings+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Rewriting as Rewriting+import qualified Hydra.Core.Util as Util+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | Decoder for hydra.core.errors.DecodingError+decodingError :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Errors.DecodingError+decodingError cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermWrap v0 -> Eithers.map (\b -> Errors.DecodingError b) ((\raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of+ Model.TermLiteral v1 -> case v1 of+ Model.LiteralString v2 -> Right v2+ _ -> Left (Errors.DecodingError "expected string literal")+ _ -> Left (Errors.DecodingError "expected literal")) (ExtractModel.stripWithDecodingError cx raw2)) (Model.wrappedTermBody v0))+ _ -> Left (Errors.DecodingError "expected wrapped type")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.errors.EmptyListError+emptyListError :: Graph.Graph -> Model.Term -> Either Errors.DecodingError ()+emptyListError cx t = ExtractModel.decodeUnit cx t++-- | Decoder for hydra.core.errors.Error+error :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Errors.Error+error cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermInject v0 ->+ let field = Model.injectionField v0+ fname = Model.fieldName field+ fterm = Model.fieldTerm field+ variantMap =+ Maps.fromList [+ (Model.Name "checking", (\input -> Eithers.map (\t -> Errors.ErrorChecking t) (Checking.checkingError cx input))),+ (Model.Name "decoding", (\input -> Eithers.map (\t -> Errors.ErrorDecoding t) (decodingError cx input))),+ (+ Model.Name "duplicateBinding",+ (\input -> Eithers.map (\t -> Errors.ErrorDuplicateBinding t) (ErrorModel.duplicateBindingError cx input))),+ (+ Model.Name "duplicateField",+ (\input -> Eithers.map (\t -> Errors.ErrorDuplicateField t) (ErrorModel.duplicateFieldError cx input))),+ (Model.Name "extraction", (\input -> Eithers.map (\t -> Errors.ErrorExtraction t) (extractionError cx input))),+ (Model.Name "inference", (\input -> Eithers.map (\t -> Errors.ErrorInference t) (inferenceError cx input))),+ (+ Model.Name "invalidLiteral",+ (\input -> Eithers.map (\t -> Errors.ErrorInvalidLiteral t) (ErrorModel.invalidLiteralError cx input))),+ (Model.Name "other", (\input -> Eithers.map (\t -> Errors.ErrorOther t) (otherError cx input))),+ (Model.Name "resolution", (\input -> Eithers.map (\t -> Errors.ErrorResolution t) (resolutionError cx input))),+ (+ Model.Name "undefinedField",+ (\input -> Eithers.map (\t -> Errors.ErrorUndefinedField t) (ErrorModel.undefinedFieldError cx input))),+ (+ Model.Name "undefinedTermVariable",+ (\input -> Eithers.map (\t -> Errors.ErrorUndefinedTermVariable t) (ErrorModel.undefinedTermVariableError cx input))),+ (+ Model.Name "untypedTermVariable",+ (\input -> Eithers.map (\t -> Errors.ErrorUntypedTermVariable t) (ErrorModel.untypedTermVariableError cx input))),+ (+ Model.Name "unexpectedTermVariant",+ (\input -> Eithers.map (\t -> Errors.ErrorUnexpectedTermVariant t) (ErrorModel.unexpectedTermVariantError cx input))),+ (+ Model.Name "unexpectedTypeVariant",+ (\input -> Eithers.map (\t -> Errors.ErrorUnexpectedTypeVariant t) (ErrorModel.unexpectedTypeVariantError cx input))),+ (Model.Name "unification", (\input -> Eithers.map (\t -> Errors.ErrorUnification t) (unificationError cx input)))]+ in (Optionals.match (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [+ "no such field ",+ (Model.unName fname),+ " in union"]))) (\f -> f fterm))+ _ -> Left (Errors.DecodingError "expected union")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.errors.ExtractionError+extractionError :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Errors.ExtractionError+extractionError cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermInject v0 ->+ let field = Model.injectionField v0+ fname = Model.fieldName field+ fterm = Model.fieldTerm field+ variantMap =+ Maps.fromList [+ (Model.Name "emptyList", (\input -> Eithers.map (\t -> Errors.ExtractionErrorEmptyList t) (emptyListError cx input))),+ (+ Model.Name "multipleBindings",+ (\input -> Eithers.map (\t -> Errors.ExtractionErrorMultipleBindings t) (multipleBindingsError cx input))),+ (+ Model.Name "multipleFields",+ (\input -> Eithers.map (\t -> Errors.ExtractionErrorMultipleFields t) (multipleFieldsError cx input))),+ (+ Model.Name "noMatchingField",+ (\input -> Eithers.map (\t -> Errors.ExtractionErrorNoMatchingField t) (noMatchingFieldError cx input))),+ (+ Model.Name "noSuchBinding",+ (\input -> Eithers.map (\t -> Errors.ExtractionErrorNoSuchBinding t) (noSuchBindingError cx input))),+ (+ Model.Name "notEnoughCases",+ (\input -> Eithers.map (\t -> Errors.ExtractionErrorNotEnoughCases t) (notEnoughCasesError cx input))),+ (+ Model.Name "unexpectedShape",+ (\input -> Eithers.map (\t -> Errors.ExtractionErrorUnexpectedShape t) (unexpectedShapeError cx input)))]+ in (Optionals.match (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [+ "no such field ",+ (Model.unName fname),+ " in union"]))) (\f -> f fterm))+ _ -> Left (Errors.DecodingError "expected union")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.errors.InferenceError+inferenceError :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Errors.InferenceError+inferenceError cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermInject v0 ->+ let field = Model.injectionField v0+ fname = Model.fieldName field+ fterm = Model.fieldTerm field+ variantMap =+ Maps.fromList [+ (Model.Name "checking", (\input -> Eithers.map (\t -> Errors.InferenceErrorChecking t) (Checking.checkingError cx input))),+ (Model.Name "other", (\input -> Eithers.map (\t -> Errors.InferenceErrorOther t) (otherInferenceError cx input))),+ (+ Model.Name "unification",+ (\input -> Eithers.map (\t -> Errors.InferenceErrorUnification t) (unificationInferenceError cx input)))]+ in (Optionals.match (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [+ "no such field ",+ (Model.unName fname),+ " in union"]))) (\f -> f fterm))+ _ -> Left (Errors.DecodingError "expected union")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.errors.MultipleBindingsError+multipleBindingsError :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Errors.MultipleBindingsError+multipleBindingsError cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "name" DecodeModel.name fieldMap cx) (\field_name -> Right (Errors.MultipleBindingsError {+ Errors.multipleBindingsErrorName = field_name})))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.errors.MultipleBindingsError")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.errors.MultipleFieldsError+multipleFieldsError :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Errors.MultipleFieldsError+multipleFieldsError cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "fieldName" DecodeModel.name fieldMap cx) (\field_fieldName -> Right (Errors.MultipleFieldsError {+ Errors.multipleFieldsErrorFieldName = field_fieldName})))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.errors.MultipleFieldsError")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.errors.NoMatchingFieldError+noMatchingFieldError :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Errors.NoMatchingFieldError+noMatchingFieldError cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "fieldName" DecodeModel.name fieldMap cx) (\field_fieldName -> Right (Errors.NoMatchingFieldError {+ Errors.noMatchingFieldErrorFieldName = field_fieldName})))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.errors.NoMatchingFieldError")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.errors.NoSuchBindingError+noSuchBindingError :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Errors.NoSuchBindingError+noSuchBindingError cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "name" DecodeModel.name fieldMap cx) (\field_name -> Right (Errors.NoSuchBindingError {+ Errors.noSuchBindingErrorName = field_name})))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.errors.NoSuchBindingError")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.errors.NoSuchPrimitiveError+noSuchPrimitiveError :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Errors.NoSuchPrimitiveError+noSuchPrimitiveError cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "name" DecodeModel.name fieldMap cx) (\field_name -> Right (Errors.NoSuchPrimitiveError {+ Errors.noSuchPrimitiveErrorName = field_name})))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.errors.NoSuchPrimitiveError")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.errors.NotEnoughCasesError+notEnoughCasesError :: Graph.Graph -> Model.Term -> Either Errors.DecodingError ()+notEnoughCasesError cx t = ExtractModel.decodeUnit cx t++-- | Decoder for hydra.core.errors.OtherError+otherError :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Errors.OtherError+otherError cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermWrap v0 -> Eithers.map (\b -> Errors.OtherError b) ((\raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of+ Model.TermLiteral v1 -> case v1 of+ Model.LiteralString v2 -> Right v2+ _ -> Left (Errors.DecodingError "expected string literal")+ _ -> Left (Errors.DecodingError "expected literal")) (ExtractModel.stripWithDecodingError cx raw2)) (Model.wrappedTermBody v0))+ _ -> Left (Errors.DecodingError "expected wrapped type")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.errors.OtherInferenceError+otherInferenceError :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Errors.OtherInferenceError+otherInferenceError cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "path" Paths.subtermPath fieldMap cx) (\field_path -> Eithers.bind (ExtractModel.requireField "message" (\cx2 -> \raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of+ Model.TermLiteral v1 -> case v1 of+ Model.LiteralString v2 -> Right v2+ _ -> Left (Errors.DecodingError "expected string literal")+ _ -> Left (Errors.DecodingError "expected literal")) (ExtractModel.stripWithDecodingError cx2 raw2)) fieldMap cx) (\field_message -> Right (Errors.OtherInferenceError {+ Errors.otherInferenceErrorPath = field_path,+ Errors.otherInferenceErrorMessage = field_message}))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.errors.OtherInferenceError")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.errors.OtherResolutionError+otherResolutionError :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Errors.OtherResolutionError+otherResolutionError cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermWrap v0 -> Eithers.map (\b -> Errors.OtherResolutionError b) ((\raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of+ Model.TermLiteral v1 -> case v1 of+ Model.LiteralString v2 -> Right v2+ _ -> Left (Errors.DecodingError "expected string literal")+ _ -> Left (Errors.DecodingError "expected literal")) (ExtractModel.stripWithDecodingError cx raw2)) (Model.wrappedTermBody v0))+ _ -> Left (Errors.DecodingError "expected wrapped type")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.errors.ResolutionError+resolutionError :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Errors.ResolutionError+resolutionError cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermInject v0 ->+ let field = Model.injectionField v0+ fname = Model.fieldName field+ fterm = Model.fieldTerm field+ variantMap =+ Maps.fromList [+ (+ Model.Name "noSuchBinding",+ (\input -> Eithers.map (\t -> Errors.ResolutionErrorNoSuchBinding t) (noSuchBindingError cx input))),+ (+ Model.Name "noSuchPrimitive",+ (\input -> Eithers.map (\t -> Errors.ResolutionErrorNoSuchPrimitive t) (noSuchPrimitiveError cx input))),+ (+ Model.Name "noMatchingField",+ (\input -> Eithers.map (\t -> Errors.ResolutionErrorNoMatchingField t) (noMatchingFieldError cx input))),+ (Model.Name "other", (\input -> Eithers.map (\t -> Errors.ResolutionErrorOther t) (otherResolutionError cx input))),+ (+ Model.Name "unexpectedShape",+ (\input -> Eithers.map (\t -> Errors.ResolutionErrorUnexpectedShape t) (unexpectedShapeError cx input)))]+ in (Optionals.match (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [+ "no such field ",+ (Model.unName fname),+ " in union"]))) (\f -> f fterm))+ _ -> Left (Errors.DecodingError "expected union")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.errors.UnexpectedShapeError+unexpectedShapeError :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Errors.UnexpectedShapeError+unexpectedShapeError cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "expected" (\cx2 -> \raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of+ Model.TermLiteral v1 -> case v1 of+ Model.LiteralString v2 -> Right v2+ _ -> Left (Errors.DecodingError "expected string literal")+ _ -> Left (Errors.DecodingError "expected literal")) (ExtractModel.stripWithDecodingError cx2 raw2)) fieldMap cx) (\field_expected -> Eithers.bind (ExtractModel.requireField "actual" (\cx2 -> \raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of+ Model.TermLiteral v1 -> case v1 of+ Model.LiteralString v2 -> Right v2+ _ -> Left (Errors.DecodingError "expected string literal")+ _ -> Left (Errors.DecodingError "expected literal")) (ExtractModel.stripWithDecodingError cx2 raw2)) fieldMap cx) (\field_actual -> Right (Errors.UnexpectedShapeError {+ Errors.unexpectedShapeErrorExpected = field_expected,+ Errors.unexpectedShapeErrorActual = field_actual}))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.errors.UnexpectedShapeError")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.errors.UnificationError+unificationError :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Errors.UnificationError+unificationError cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "leftType" DecodeModel.type_ fieldMap cx) (\field_leftType -> Eithers.bind (ExtractModel.requireField "rightType" DecodeModel.type_ fieldMap cx) (\field_rightType -> Eithers.bind (ExtractModel.requireField "message" (\cx2 -> \raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of+ Model.TermLiteral v1 -> case v1 of+ Model.LiteralString v2 -> Right v2+ _ -> Left (Errors.DecodingError "expected string literal")+ _ -> Left (Errors.DecodingError "expected literal")) (ExtractModel.stripWithDecodingError cx2 raw2)) fieldMap cx) (\field_message -> Right (Errors.UnificationError {+ Errors.unificationErrorLeftType = field_leftType,+ Errors.unificationErrorRightType = field_rightType,+ Errors.unificationErrorMessage = field_message})))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.errors.UnificationError")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.errors.UnificationInferenceError+unificationInferenceError :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Errors.UnificationInferenceError+unificationInferenceError cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "path" Paths.subtermPath fieldMap cx) (\field_path -> Eithers.bind (ExtractModel.requireField "cause" unificationError fieldMap cx) (\field_cause -> Right (Errors.UnificationInferenceError {+ Errors.unificationInferenceErrorPath = field_path,+ Errors.unificationInferenceErrorCause = field_cause}))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.errors.UnificationInferenceError")) (ExtractModel.stripWithDecodingError cx raw)
@@ -0,0 +1,88 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Term decoders for hydra.core.file++module Hydra.Core.Decode.File where++import qualified Hydra.Core.Decode.Model as DecodeModel+import qualified Hydra.Core.Decode.Time as Time+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.Extract.Model as ExtractModel+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Lexical as Lexical+import qualified Hydra.Core.Overlay.Haskell.Lib.Eithers as Eithers+import qualified Hydra.Core.Overlay.Haskell.Lib.Maps as Maps+import qualified Hydra.Core.Overlay.Haskell.Lib.Optionals as Optionals+import qualified Hydra.Core.Overlay.Haskell.Lib.Strings as Strings+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Rewriting as Rewriting+import qualified Hydra.Core.Util as Util+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | Decoder for hydra.core.file.FileExtension+fileExtension :: Graph.Graph -> Model.Term -> Either Errors.DecodingError File.FileExtension+fileExtension cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermWrap v0 -> Eithers.map (\b -> File.FileExtension b) ((\raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of+ Model.TermLiteral v1 -> case v1 of+ Model.LiteralString v2 -> Right v2+ _ -> Left (Errors.DecodingError "expected string literal")+ _ -> Left (Errors.DecodingError "expected literal")) (ExtractModel.stripWithDecodingError cx raw2)) (Model.wrappedTermBody v0))+ _ -> Left (Errors.DecodingError "expected wrapped type")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.file.FilePath+filePath :: Graph.Graph -> Model.Term -> Either Errors.DecodingError File.FilePath+filePath cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermWrap v0 -> Eithers.map (\b -> File.FilePath b) ((\raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of+ Model.TermLiteral v1 -> case v1 of+ Model.LiteralString v2 -> Right v2+ _ -> Left (Errors.DecodingError "expected string literal")+ _ -> Left (Errors.DecodingError "expected literal")) (ExtractModel.stripWithDecodingError cx raw2)) (Model.wrappedTermBody v0))+ _ -> Left (Errors.DecodingError "expected wrapped type")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.file.FileStatus+fileStatus :: Graph.Graph -> Model.Term -> Either Errors.DecodingError File.FileStatus+fileStatus cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "fileType" fileType fieldMap cx) (\field_fileType -> Eithers.bind (ExtractModel.requireField "size" (\cx2 -> \raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of+ Model.TermLiteral v1 -> case v1 of+ Model.LiteralInteger v2 -> case v2 of+ Model.IntegerValueInt64 v3 -> Right v3+ _ -> Left (Errors.DecodingError "expected int64 value")+ _ -> Left (Errors.DecodingError "expected int64 literal")+ _ -> Left (Errors.DecodingError "expected literal")) (ExtractModel.stripWithDecodingError cx2 raw2)) fieldMap cx) (\field_size -> Eithers.bind (ExtractModel.requireField "modificationTime" Time.timespec fieldMap cx) (\field_modificationTime -> Eithers.bind (ExtractModel.requireField "accessTime" (ExtractModel.decodeMaybe Time.timespec) fieldMap cx) (\field_accessTime -> Eithers.bind (ExtractModel.requireField "statusChangeTime" (ExtractModel.decodeMaybe Time.timespec) fieldMap cx) (\field_statusChangeTime -> Right (File.FileStatus {+ File.fileStatusFileType = field_fileType,+ File.fileStatusSize = field_size,+ File.fileStatusModificationTime = field_modificationTime,+ File.fileStatusAccessTime = field_accessTime,+ File.fileStatusStatusChangeTime = field_statusChangeTime})))))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.file.FileStatus")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.file.FileType+fileType :: Graph.Graph -> Model.Term -> Either Errors.DecodingError File.FileType+fileType cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermInject v0 ->+ let field = Model.injectionField v0+ fname = Model.fieldName field+ fterm = Model.fieldTerm field+ variantMap =+ Maps.fromList [+ (Model.Name "block", (\input -> Eithers.map (\t -> File.FileTypeBlock) (ExtractModel.decodeUnit cx input))),+ (Model.Name "character", (\input -> Eithers.map (\t -> File.FileTypeCharacter) (ExtractModel.decodeUnit cx input))),+ (Model.Name "directory", (\input -> Eithers.map (\t -> File.FileTypeDirectory) (ExtractModel.decodeUnit cx input))),+ (Model.Name "fifo", (\input -> Eithers.map (\t -> File.FileTypeFifo) (ExtractModel.decodeUnit cx input))),+ (Model.Name "regular", (\input -> Eithers.map (\t -> File.FileTypeRegular) (ExtractModel.decodeUnit cx input))),+ (Model.Name "link", (\input -> Eithers.map (\t -> File.FileTypeLink) (ExtractModel.decodeUnit cx input))),+ (Model.Name "socket", (\input -> Eithers.map (\t -> File.FileTypeSocket) (ExtractModel.decodeUnit cx input)))]+ in (Optionals.match (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [+ "no such field ",+ (Model.unName fname),+ " in union"]))) (\f -> f fterm))+ _ -> Left (Errors.DecodingError "expected union")) (ExtractModel.stripWithDecodingError cx raw)
@@ -0,0 +1,68 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Term decoders for hydra.core.json.model++module Hydra.Core.Decode.Json.Model where++import qualified Hydra.Core.Decode.Model as DecodeModel+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.Extract.Model as ExtractModel+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Json.Model as JsonModel+import qualified Hydra.Core.Lexical as Lexical+import qualified Hydra.Core.Overlay.Haskell.Lib.Eithers as Eithers+import qualified Hydra.Core.Overlay.Haskell.Lib.Maps as Maps+import qualified Hydra.Core.Overlay.Haskell.Lib.Optionals as Optionals+import qualified Hydra.Core.Overlay.Haskell.Lib.Strings as Strings+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Rewriting as Rewriting+import qualified Hydra.Core.Util as Util+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | Decoder for hydra.core.json.model.Value+value :: Graph.Graph -> Model.Term -> Either Errors.DecodingError JsonModel.Value+value cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermInject v0 ->+ let field = Model.injectionField v0+ fname = Model.fieldName field+ fterm = Model.fieldTerm field+ variantMap =+ Maps.fromList [+ (Model.Name "array", (\input -> Eithers.map (\t -> JsonModel.ValueArray t) (ExtractModel.decodeList value cx input))),+ (+ Model.Name "boolean",+ (\input -> Eithers.map (\t -> JsonModel.ValueBoolean t) (Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of+ Model.TermLiteral v1 -> case v1 of+ Model.LiteralBoolean v2 -> Right v2+ _ -> Left (Errors.DecodingError "expected boolean literal")+ _ -> Left (Errors.DecodingError "expected literal")) (ExtractModel.stripWithDecodingError cx input)))),+ (Model.Name "null", (\input -> Eithers.map (\t -> JsonModel.ValueNull) (ExtractModel.decodeUnit cx input))),+ (+ Model.Name "number",+ (\input -> Eithers.map (\t -> JsonModel.ValueNumber t) (Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of+ Model.TermLiteral v1 -> case v1 of+ Model.LiteralDecimal v2 -> Right v2+ _ -> Left (Errors.DecodingError "expected decimal literal")+ _ -> Left (Errors.DecodingError "expected literal")) (ExtractModel.stripWithDecodingError cx input)))),+ (+ Model.Name "object",+ (\input -> Eithers.map (\t -> JsonModel.ValueObject t) (ExtractModel.decodeList (ExtractModel.decodePair (\cx2 -> \raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of+ Model.TermLiteral v1 -> case v1 of+ Model.LiteralString v2 -> Right v2+ _ -> Left (Errors.DecodingError "expected string literal")+ _ -> Left (Errors.DecodingError "expected literal")) (ExtractModel.stripWithDecodingError cx2 raw2)) value) cx input))),+ (+ Model.Name "string",+ (\input -> Eithers.map (\t -> JsonModel.ValueString t) (Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of+ Model.TermLiteral v1 -> case v1 of+ Model.LiteralString v2 -> Right v2+ _ -> Left (Errors.DecodingError "expected string literal")+ _ -> Left (Errors.DecodingError "expected literal")) (ExtractModel.stripWithDecodingError cx input))))]+ in (Optionals.match (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [+ "no such field ",+ (Model.unName fname),+ " in union"]))) (\f -> f fterm))+ _ -> Left (Errors.DecodingError "expected union")) (ExtractModel.stripWithDecodingError cx raw)
@@ -0,0 +1,233 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Term decoders for hydra.core.markdown++module Hydra.Core.Decode.Markdown where++import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.Extract.Model as ExtractModel+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Lexical as Lexical+import qualified Hydra.Core.Overlay.Haskell.Lib.Eithers as Eithers+import qualified Hydra.Core.Overlay.Haskell.Lib.Maps as Maps+import qualified Hydra.Core.Overlay.Haskell.Lib.Optionals as Optionals+import qualified Hydra.Core.Overlay.Haskell.Lib.Strings as Strings+import qualified Hydra.Core.Markdown as Markdown+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Rewriting as Rewriting+import qualified Hydra.Core.Util as Util+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | Decoder for hydra.core.markdown.Block+block :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Markdown.Block+block cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermInject v0 ->+ let field = Model.injectionField v0+ fname = Model.fieldName field+ fterm = Model.fieldTerm field+ variantMap =+ Maps.fromList [+ (Model.Name "codeBlock", (\input -> Eithers.map (\t -> Markdown.BlockCodeBlock t) (codeBlock cx input))),+ (Model.Name "list", (\input -> Eithers.map (\t -> Markdown.BlockList t) (list cx input))),+ (Model.Name "paragraph", (\input -> Eithers.map (\t -> Markdown.BlockParagraph t) (paragraph cx input))),+ (+ Model.Name "raw",+ (\input -> Eithers.map (\t -> Markdown.BlockRaw t) (Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of+ Model.TermLiteral v1 -> case v1 of+ Model.LiteralString v2 -> Right v2+ _ -> Left (Errors.DecodingError "expected string literal")+ _ -> Left (Errors.DecodingError "expected literal")) (ExtractModel.stripWithDecodingError cx input)))),+ (Model.Name "section", (\input -> Eithers.map (\t -> Markdown.BlockSection t) (section cx input))),+ (Model.Name "table", (\input -> Eithers.map (\t -> Markdown.BlockTable t) (table cx input)))]+ in (Optionals.match (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [+ "no such field ",+ (Model.unName fname),+ " in union"]))) (\f -> f fterm))+ _ -> Left (Errors.DecodingError "expected union")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.markdown.CodeBlock+codeBlock :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Markdown.CodeBlock+codeBlock cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "language" (ExtractModel.decodeMaybe (\cx2 -> \raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of+ Model.TermLiteral v1 -> case v1 of+ Model.LiteralString v2 -> Right v2+ _ -> Left (Errors.DecodingError "expected string literal")+ _ -> Left (Errors.DecodingError "expected literal")) (ExtractModel.stripWithDecodingError cx2 raw2))) fieldMap cx) (\field_language -> Eithers.bind (ExtractModel.requireField "content" (\cx2 -> \raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of+ Model.TermLiteral v1 -> case v1 of+ Model.LiteralString v2 -> Right v2+ _ -> Left (Errors.DecodingError "expected string literal")+ _ -> Left (Errors.DecodingError "expected literal")) (ExtractModel.stripWithDecodingError cx2 raw2)) fieldMap cx) (\field_content -> Right (Markdown.CodeBlock {+ Markdown.codeBlockLanguage = field_language,+ Markdown.codeBlockContent = field_content}))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.markdown.CodeBlock")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.markdown.Document+document :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Markdown.Document+document cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "title" (\cx2 -> \raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of+ Model.TermLiteral v1 -> case v1 of+ Model.LiteralString v2 -> Right v2+ _ -> Left (Errors.DecodingError "expected string literal")+ _ -> Left (Errors.DecodingError "expected literal")) (ExtractModel.stripWithDecodingError cx2 raw2)) fieldMap cx) (\field_title -> Eithers.bind (ExtractModel.requireField "content" (ExtractModel.decodeList block) fieldMap cx) (\field_content -> Right (Markdown.Document {+ Markdown.documentTitle = field_title,+ Markdown.documentContent = field_content}))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.markdown.Document")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.markdown.Heading+heading :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Markdown.Heading+heading cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "level" (\cx2 -> \raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of+ Model.TermLiteral v1 -> case v1 of+ Model.LiteralInteger v2 -> case v2 of+ Model.IntegerValueInt32 v3 -> Right v3+ _ -> Left (Errors.DecodingError "expected int32 value")+ _ -> Left (Errors.DecodingError "expected int32 literal")+ _ -> Left (Errors.DecodingError "expected literal")) (ExtractModel.stripWithDecodingError cx2 raw2)) fieldMap cx) (\field_level -> Eithers.bind (ExtractModel.requireField "content" (ExtractModel.decodeList inline) fieldMap cx) (\field_content -> Eithers.bind (ExtractModel.requireField "anchor" (ExtractModel.decodeMaybe (\cx2 -> \raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of+ Model.TermLiteral v1 -> case v1 of+ Model.LiteralString v2 -> Right v2+ _ -> Left (Errors.DecodingError "expected string literal")+ _ -> Left (Errors.DecodingError "expected literal")) (ExtractModel.stripWithDecodingError cx2 raw2))) fieldMap cx) (\field_anchor -> Right (Markdown.Heading {+ Markdown.headingLevel = field_level,+ Markdown.headingContent = field_content,+ Markdown.headingAnchor = field_anchor})))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.markdown.Heading")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.markdown.Inline+inline :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Markdown.Inline+inline cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermInject v0 ->+ let field = Model.injectionField v0+ fname = Model.fieldName field+ fterm = Model.fieldTerm field+ variantMap =+ Maps.fromList [+ (+ Model.Name "code",+ (\input -> Eithers.map (\t -> Markdown.InlineCode t) (Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of+ Model.TermLiteral v1 -> case v1 of+ Model.LiteralString v2 -> Right v2+ _ -> Left (Errors.DecodingError "expected string literal")+ _ -> Left (Errors.DecodingError "expected literal")) (ExtractModel.stripWithDecodingError cx input)))),+ (+ Model.Name "emphasis",+ (\input -> Eithers.map (\t -> Markdown.InlineEmphasis t) (ExtractModel.decodeList inline cx input))),+ (Model.Name "link", (\input -> Eithers.map (\t -> Markdown.InlineLink t) (link cx input))),+ (Model.Name "strong", (\input -> Eithers.map (\t -> Markdown.InlineStrong t) (ExtractModel.decodeList inline cx input))),+ (+ Model.Name "text",+ (\input -> Eithers.map (\t -> Markdown.InlineText t) (Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of+ Model.TermLiteral v1 -> case v1 of+ Model.LiteralString v2 -> Right v2+ _ -> Left (Errors.DecodingError "expected string literal")+ _ -> Left (Errors.DecodingError "expected literal")) (ExtractModel.stripWithDecodingError cx input))))]+ in (Optionals.match (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [+ "no such field ",+ (Model.unName fname),+ " in union"]))) (\f -> f fterm))+ _ -> Left (Errors.DecodingError "expected union")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.markdown.Link+link :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Markdown.Link+link cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "text" (ExtractModel.decodeList inline) fieldMap cx) (\field_text -> Eithers.bind (ExtractModel.requireField "target" (\cx2 -> \raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of+ Model.TermLiteral v1 -> case v1 of+ Model.LiteralString v2 -> Right v2+ _ -> Left (Errors.DecodingError "expected string literal")+ _ -> Left (Errors.DecodingError "expected literal")) (ExtractModel.stripWithDecodingError cx2 raw2)) fieldMap cx) (\field_target -> Right (Markdown.Link {+ Markdown.linkText = field_text,+ Markdown.linkTarget = field_target}))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.markdown.Link")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.markdown.List+list :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Markdown.List+list cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "ordered" (\cx2 -> \raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of+ Model.TermLiteral v1 -> case v1 of+ Model.LiteralBoolean v2 -> Right v2+ _ -> Left (Errors.DecodingError "expected boolean literal")+ _ -> Left (Errors.DecodingError "expected literal")) (ExtractModel.stripWithDecodingError cx2 raw2)) fieldMap cx) (\field_ordered -> Eithers.bind (ExtractModel.requireField "items" (ExtractModel.decodeList listItem) fieldMap cx) (\field_items -> Right (Markdown.List {+ Markdown.listOrdered = field_ordered,+ Markdown.listItems = field_items}))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.markdown.List")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.markdown.ListItem+listItem :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Markdown.ListItem+listItem cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermWrap v0 -> Eithers.map (\b -> Markdown.ListItem b) (ExtractModel.decodeList block cx (Model.wrappedTermBody v0))+ _ -> Left (Errors.DecodingError "expected wrapped type")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.markdown.Paragraph+paragraph :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Markdown.Paragraph+paragraph cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "content" (ExtractModel.decodeList inline) fieldMap cx) (\field_content -> Eithers.bind (ExtractModel.requireField "anchor" (ExtractModel.decodeMaybe (\cx2 -> \raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of+ Model.TermLiteral v1 -> case v1 of+ Model.LiteralString v2 -> Right v2+ _ -> Left (Errors.DecodingError "expected string literal")+ _ -> Left (Errors.DecodingError "expected literal")) (ExtractModel.stripWithDecodingError cx2 raw2))) fieldMap cx) (\field_anchor -> Right (Markdown.Paragraph {+ Markdown.paragraphContent = field_content,+ Markdown.paragraphAnchor = field_anchor}))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.markdown.Paragraph")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.markdown.Section+section :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Markdown.Section+section cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "heading" heading fieldMap cx) (\field_heading -> Eithers.bind (ExtractModel.requireField "content" (ExtractModel.decodeList block) fieldMap cx) (\field_content -> Eithers.bind (ExtractModel.requireField "anchor" (ExtractModel.decodeMaybe (\cx2 -> \raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of+ Model.TermLiteral v1 -> case v1 of+ Model.LiteralString v2 -> Right v2+ _ -> Left (Errors.DecodingError "expected string literal")+ _ -> Left (Errors.DecodingError "expected literal")) (ExtractModel.stripWithDecodingError cx2 raw2))) fieldMap cx) (\field_anchor -> Right (Markdown.Section {+ Markdown.sectionHeading = field_heading,+ Markdown.sectionContent = field_content,+ Markdown.sectionAnchor = field_anchor})))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.markdown.Section")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.markdown.Table+table :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Markdown.Table+table cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "header" tableRow fieldMap cx) (\field_header -> Eithers.bind (ExtractModel.requireField "rows" (ExtractModel.decodeList tableRow) fieldMap cx) (\field_rows -> Right (Markdown.Table {+ Markdown.tableHeader = field_header,+ Markdown.tableRows = field_rows}))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.markdown.Table")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.markdown.TableCell+tableCell :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Markdown.TableCell+tableCell cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermWrap v0 -> Eithers.map (\b -> Markdown.TableCell b) (ExtractModel.decodeList inline cx (Model.wrappedTermBody v0))+ _ -> Left (Errors.DecodingError "expected wrapped type")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.markdown.TableRow+tableRow :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Markdown.TableRow+tableRow cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermWrap v0 -> Eithers.map (\b -> Markdown.TableRow b) (ExtractModel.decodeList tableCell cx (Model.wrappedTermBody v0))+ _ -> Left (Errors.DecodingError "expected wrapped type")) (ExtractModel.stripWithDecodingError cx raw)
@@ -0,0 +1,628 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Term decoders for hydra.core.model++module Hydra.Core.Decode.Model where++import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.Extract.Model as ExtractModel+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Lexical as Lexical+import qualified Hydra.Core.Overlay.Haskell.Lib.Eithers as Eithers+import qualified Hydra.Core.Overlay.Haskell.Lib.Maps as Maps+import qualified Hydra.Core.Overlay.Haskell.Lib.Optionals as Optionals+import qualified Hydra.Core.Overlay.Haskell.Lib.Strings as Strings+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Rewriting as Rewriting+import qualified Hydra.Core.Util as Util+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | Decoder for hydra.core.model.AnnotatedTerm+annotatedTerm :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Model.AnnotatedTerm+annotatedTerm cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "body" term fieldMap cx) (\field_body -> Eithers.bind (ExtractModel.requireField "annotation" term fieldMap cx) (\field_annotation -> Right (Model.AnnotatedTerm {+ Model.annotatedTermBody = field_body,+ Model.annotatedTermAnnotation = field_annotation}))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.model.AnnotatedTerm")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.model.AnnotatedType+annotatedType :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Model.AnnotatedType+annotatedType cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "body" type_ fieldMap cx) (\field_body -> Eithers.bind (ExtractModel.requireField "annotation" term fieldMap cx) (\field_annotation -> Right (Model.AnnotatedType {+ Model.annotatedTypeBody = field_body,+ Model.annotatedTypeAnnotation = field_annotation}))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.model.AnnotatedType")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.model.Application+application :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Model.Application+application cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "function" term fieldMap cx) (\field_function -> Eithers.bind (ExtractModel.requireField "argument" term fieldMap cx) (\field_argument -> Right (Model.Application {+ Model.applicationFunction = field_function,+ Model.applicationArgument = field_argument}))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.model.Application")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.model.ApplicationType+applicationType :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Model.ApplicationType+applicationType cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "function" type_ fieldMap cx) (\field_function -> Eithers.bind (ExtractModel.requireField "argument" type_ fieldMap cx) (\field_argument -> Right (Model.ApplicationType {+ Model.applicationTypeFunction = field_function,+ Model.applicationTypeArgument = field_argument}))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.model.ApplicationType")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.model.Binding+binding :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Model.Binding+binding cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "name" name fieldMap cx) (\field_name -> Eithers.bind (ExtractModel.requireField "term" term fieldMap cx) (\field_term -> Eithers.bind (ExtractModel.requireField "typeScheme" (ExtractModel.decodeMaybe typeScheme) fieldMap cx) (\field_typeScheme -> Right (Model.Binding {+ Model.bindingName = field_name,+ Model.bindingTerm = field_term,+ Model.bindingTypeScheme = field_typeScheme})))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.model.Binding")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.model.CaseAlternative+caseAlternative :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Model.CaseAlternative+caseAlternative cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "name" name fieldMap cx) (\field_name -> Eithers.bind (ExtractModel.requireField "handler" term fieldMap cx) (\field_handler -> Right (Model.CaseAlternative {+ Model.caseAlternativeName = field_name,+ Model.caseAlternativeHandler = field_handler}))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.model.CaseAlternative")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.model.CaseStatement+caseStatement :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Model.CaseStatement+caseStatement cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "typeName" name fieldMap cx) (\field_typeName -> Eithers.bind (ExtractModel.requireField "default" (ExtractModel.decodeMaybe term) fieldMap cx) (\field_default -> Eithers.bind (ExtractModel.requireField "cases" (ExtractModel.decodeList caseAlternative) fieldMap cx) (\field_cases -> Right (Model.CaseStatement {+ Model.caseStatementTypeName = field_typeName,+ Model.caseStatementDefault = field_default,+ Model.caseStatementCases = field_cases})))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.model.CaseStatement")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.model.EitherType+eitherType :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Model.EitherType+eitherType cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "left" type_ fieldMap cx) (\field_left -> Eithers.bind (ExtractModel.requireField "right" type_ fieldMap cx) (\field_right -> Right (Model.EitherType {+ Model.eitherTypeLeft = field_left,+ Model.eitherTypeRight = field_right}))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.model.EitherType")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.model.Field+field :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Model.Field+field cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "name" name fieldMap cx) (\field_name -> Eithers.bind (ExtractModel.requireField "term" term fieldMap cx) (\field_term -> Right (Model.Field {+ Model.fieldName = field_name,+ Model.fieldTerm = field_term}))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.model.Field")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.model.FieldType+fieldType :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Model.FieldType+fieldType cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "name" name fieldMap cx) (\field_name -> Eithers.bind (ExtractModel.requireField "type" type_ fieldMap cx) (\field_type -> Right (Model.FieldType {+ Model.fieldTypeName = field_name,+ Model.fieldTypeType = field_type}))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.model.FieldType")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.model.FloatType+floatType :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Model.FloatType+floatType cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermInject v0 ->+ let field = Model.injectionField v0+ fname = Model.fieldName field+ fterm = Model.fieldTerm field+ variantMap =+ Maps.fromList [+ (Model.Name "float32", (\input -> Eithers.map (\t -> Model.FloatTypeFloat32) (ExtractModel.decodeUnit cx input))),+ (Model.Name "float64", (\input -> Eithers.map (\t -> Model.FloatTypeFloat64) (ExtractModel.decodeUnit cx input)))]+ in (Optionals.match (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [+ "no such field ",+ (Model.unName fname),+ " in union"]))) (\f -> f fterm))+ _ -> Left (Errors.DecodingError "expected union")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.model.FloatValue+floatValue :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Model.FloatValue+floatValue cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermInject v0 ->+ let field = Model.injectionField v0+ fname = Model.fieldName field+ fterm = Model.fieldTerm field+ variantMap =+ Maps.fromList [+ (+ Model.Name "float32",+ (\input -> Eithers.map (\t -> Model.FloatValueFloat32 t) (Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of+ Model.TermLiteral v1 -> case v1 of+ Model.LiteralFloat v2 -> case v2 of+ Model.FloatValueFloat32 v3 -> Right v3+ _ -> Left (Errors.DecodingError "expected float32 value")+ _ -> Left (Errors.DecodingError "expected float32 literal")+ _ -> Left (Errors.DecodingError "expected literal")) (ExtractModel.stripWithDecodingError cx input)))),+ (+ Model.Name "float64",+ (\input -> Eithers.map (\t -> Model.FloatValueFloat64 t) (Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of+ Model.TermLiteral v1 -> case v1 of+ Model.LiteralFloat v2 -> case v2 of+ Model.FloatValueFloat64 v3 -> Right v3+ _ -> Left (Errors.DecodingError "expected float64 value")+ _ -> Left (Errors.DecodingError "expected float64 literal")+ _ -> Left (Errors.DecodingError "expected literal")) (ExtractModel.stripWithDecodingError cx input))))]+ in (Optionals.match (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [+ "no such field ",+ (Model.unName fname),+ " in union"]))) (\f -> f fterm))+ _ -> Left (Errors.DecodingError "expected union")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.model.ForallType+forallType :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Model.ForallType+forallType cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "parameter" name fieldMap cx) (\field_parameter -> Eithers.bind (ExtractModel.requireField "body" type_ fieldMap cx) (\field_body -> Right (Model.ForallType {+ Model.forallTypeParameter = field_parameter,+ Model.forallTypeBody = field_body}))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.model.ForallType")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.model.FunctionType+functionType :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Model.FunctionType+functionType cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "domain" type_ fieldMap cx) (\field_domain -> Eithers.bind (ExtractModel.requireField "codomain" type_ fieldMap cx) (\field_codomain -> Right (Model.FunctionType {+ Model.functionTypeDomain = field_domain,+ Model.functionTypeCodomain = field_codomain}))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.model.FunctionType")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.model.Injection+injection :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Model.Injection+injection cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "typeName" name fieldMap cx) (\field_typeName -> Eithers.bind (ExtractModel.requireField "field" field fieldMap cx) (\field_field -> Right (Model.Injection {+ Model.injectionTypeName = field_typeName,+ Model.injectionField = field_field}))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.model.Injection")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.model.IntegerType+integerType :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Model.IntegerType+integerType cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermInject v0 ->+ let field = Model.injectionField v0+ fname = Model.fieldName field+ fterm = Model.fieldTerm field+ variantMap =+ Maps.fromList [+ (Model.Name "bigint", (\input -> Eithers.map (\t -> Model.IntegerTypeBigint) (ExtractModel.decodeUnit cx input))),+ (Model.Name "int8", (\input -> Eithers.map (\t -> Model.IntegerTypeInt8) (ExtractModel.decodeUnit cx input))),+ (Model.Name "int16", (\input -> Eithers.map (\t -> Model.IntegerTypeInt16) (ExtractModel.decodeUnit cx input))),+ (Model.Name "int32", (\input -> Eithers.map (\t -> Model.IntegerTypeInt32) (ExtractModel.decodeUnit cx input))),+ (Model.Name "int64", (\input -> Eithers.map (\t -> Model.IntegerTypeInt64) (ExtractModel.decodeUnit cx input))),+ (Model.Name "uint8", (\input -> Eithers.map (\t -> Model.IntegerTypeUint8) (ExtractModel.decodeUnit cx input))),+ (Model.Name "uint16", (\input -> Eithers.map (\t -> Model.IntegerTypeUint16) (ExtractModel.decodeUnit cx input))),+ (Model.Name "uint32", (\input -> Eithers.map (\t -> Model.IntegerTypeUint32) (ExtractModel.decodeUnit cx input))),+ (Model.Name "uint64", (\input -> Eithers.map (\t -> Model.IntegerTypeUint64) (ExtractModel.decodeUnit cx input)))]+ in (Optionals.match (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [+ "no such field ",+ (Model.unName fname),+ " in union"]))) (\f -> f fterm))+ _ -> Left (Errors.DecodingError "expected union")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.model.IntegerValue+integerValue :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Model.IntegerValue+integerValue cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermInject v0 ->+ let field = Model.injectionField v0+ fname = Model.fieldName field+ fterm = Model.fieldTerm field+ variantMap =+ Maps.fromList [+ (+ Model.Name "bigint",+ (\input -> Eithers.map (\t -> Model.IntegerValueBigint t) (Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of+ Model.TermLiteral v1 -> case v1 of+ Model.LiteralInteger v2 -> case v2 of+ Model.IntegerValueBigint v3 -> Right v3+ _ -> Left (Errors.DecodingError "expected bigint value")+ _ -> Left (Errors.DecodingError "expected bigint literal")+ _ -> Left (Errors.DecodingError "expected literal")) (ExtractModel.stripWithDecodingError cx input)))),+ (+ Model.Name "int8",+ (\input -> Eithers.map (\t -> Model.IntegerValueInt8 t) (Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of+ Model.TermLiteral v1 -> case v1 of+ Model.LiteralInteger v2 -> case v2 of+ Model.IntegerValueInt8 v3 -> Right v3+ _ -> Left (Errors.DecodingError "expected int8 value")+ _ -> Left (Errors.DecodingError "expected int8 literal")+ _ -> Left (Errors.DecodingError "expected literal")) (ExtractModel.stripWithDecodingError cx input)))),+ (+ Model.Name "int16",+ (\input -> Eithers.map (\t -> Model.IntegerValueInt16 t) (Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of+ Model.TermLiteral v1 -> case v1 of+ Model.LiteralInteger v2 -> case v2 of+ Model.IntegerValueInt16 v3 -> Right v3+ _ -> Left (Errors.DecodingError "expected int16 value")+ _ -> Left (Errors.DecodingError "expected int16 literal")+ _ -> Left (Errors.DecodingError "expected literal")) (ExtractModel.stripWithDecodingError cx input)))),+ (+ Model.Name "int32",+ (\input -> Eithers.map (\t -> Model.IntegerValueInt32 t) (Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of+ Model.TermLiteral v1 -> case v1 of+ Model.LiteralInteger v2 -> case v2 of+ Model.IntegerValueInt32 v3 -> Right v3+ _ -> Left (Errors.DecodingError "expected int32 value")+ _ -> Left (Errors.DecodingError "expected int32 literal")+ _ -> Left (Errors.DecodingError "expected literal")) (ExtractModel.stripWithDecodingError cx input)))),+ (+ Model.Name "int64",+ (\input -> Eithers.map (\t -> Model.IntegerValueInt64 t) (Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of+ Model.TermLiteral v1 -> case v1 of+ Model.LiteralInteger v2 -> case v2 of+ Model.IntegerValueInt64 v3 -> Right v3+ _ -> Left (Errors.DecodingError "expected int64 value")+ _ -> Left (Errors.DecodingError "expected int64 literal")+ _ -> Left (Errors.DecodingError "expected literal")) (ExtractModel.stripWithDecodingError cx input)))),+ (+ Model.Name "uint8",+ (\input -> Eithers.map (\t -> Model.IntegerValueUint8 t) (Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of+ Model.TermLiteral v1 -> case v1 of+ Model.LiteralInteger v2 -> case v2 of+ Model.IntegerValueUint8 v3 -> Right v3+ _ -> Left (Errors.DecodingError "expected uint8 value")+ _ -> Left (Errors.DecodingError "expected uint8 literal")+ _ -> Left (Errors.DecodingError "expected literal")) (ExtractModel.stripWithDecodingError cx input)))),+ (+ Model.Name "uint16",+ (\input -> Eithers.map (\t -> Model.IntegerValueUint16 t) (Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of+ Model.TermLiteral v1 -> case v1 of+ Model.LiteralInteger v2 -> case v2 of+ Model.IntegerValueUint16 v3 -> Right v3+ _ -> Left (Errors.DecodingError "expected uint16 value")+ _ -> Left (Errors.DecodingError "expected uint16 literal")+ _ -> Left (Errors.DecodingError "expected literal")) (ExtractModel.stripWithDecodingError cx input)))),+ (+ Model.Name "uint32",+ (\input -> Eithers.map (\t -> Model.IntegerValueUint32 t) (Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of+ Model.TermLiteral v1 -> case v1 of+ Model.LiteralInteger v2 -> case v2 of+ Model.IntegerValueUint32 v3 -> Right v3+ _ -> Left (Errors.DecodingError "expected uint32 value")+ _ -> Left (Errors.DecodingError "expected uint32 literal")+ _ -> Left (Errors.DecodingError "expected literal")) (ExtractModel.stripWithDecodingError cx input)))),+ (+ Model.Name "uint64",+ (\input -> Eithers.map (\t -> Model.IntegerValueUint64 t) (Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of+ Model.TermLiteral v1 -> case v1 of+ Model.LiteralInteger v2 -> case v2 of+ Model.IntegerValueUint64 v3 -> Right v3+ _ -> Left (Errors.DecodingError "expected uint64 value")+ _ -> Left (Errors.DecodingError "expected uint64 literal")+ _ -> Left (Errors.DecodingError "expected literal")) (ExtractModel.stripWithDecodingError cx input))))]+ in (Optionals.match (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [+ "no such field ",+ (Model.unName fname),+ " in union"]))) (\f -> f fterm))+ _ -> Left (Errors.DecodingError "expected union")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.model.Lambda+lambda :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Model.Lambda+lambda cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "parameter" name fieldMap cx) (\field_parameter -> Eithers.bind (ExtractModel.requireField "domain" (ExtractModel.decodeMaybe type_) fieldMap cx) (\field_domain -> Eithers.bind (ExtractModel.requireField "body" term fieldMap cx) (\field_body -> Right (Model.Lambda {+ Model.lambdaParameter = field_parameter,+ Model.lambdaDomain = field_domain,+ Model.lambdaBody = field_body})))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.model.Lambda")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.model.Let+let_ :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Model.Let+let_ cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "bindings" (ExtractModel.decodeList binding) fieldMap cx) (\field_bindings -> Eithers.bind (ExtractModel.requireField "body" term fieldMap cx) (\field_body -> Right (Model.Let {+ Model.letBindings = field_bindings,+ Model.letBody = field_body}))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.model.Let")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.model.Literal+literal :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Model.Literal+literal cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermInject v0 ->+ let field = Model.injectionField v0+ fname = Model.fieldName field+ fterm = Model.fieldTerm field+ variantMap =+ Maps.fromList [+ (+ Model.Name "binary",+ (\input -> Eithers.map (\t -> Model.LiteralBinary t) (Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of+ Model.TermLiteral v1 -> case v1 of+ Model.LiteralBinary v2 -> Right v2+ _ -> Left (Errors.DecodingError "expected binary literal")+ _ -> Left (Errors.DecodingError "expected literal")) (ExtractModel.stripWithDecodingError cx input)))),+ (+ Model.Name "boolean",+ (\input -> Eithers.map (\t -> Model.LiteralBoolean t) (Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of+ Model.TermLiteral v1 -> case v1 of+ Model.LiteralBoolean v2 -> Right v2+ _ -> Left (Errors.DecodingError "expected boolean literal")+ _ -> Left (Errors.DecodingError "expected literal")) (ExtractModel.stripWithDecodingError cx input)))),+ (+ Model.Name "decimal",+ (\input -> Eithers.map (\t -> Model.LiteralDecimal t) (Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of+ Model.TermLiteral v1 -> case v1 of+ Model.LiteralDecimal v2 -> Right v2+ _ -> Left (Errors.DecodingError "expected decimal literal")+ _ -> Left (Errors.DecodingError "expected literal")) (ExtractModel.stripWithDecodingError cx input)))),+ (Model.Name "float", (\input -> Eithers.map (\t -> Model.LiteralFloat t) (floatValue cx input))),+ (Model.Name "integer", (\input -> Eithers.map (\t -> Model.LiteralInteger t) (integerValue cx input))),+ (+ Model.Name "string",+ (\input -> Eithers.map (\t -> Model.LiteralString t) (Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of+ Model.TermLiteral v1 -> case v1 of+ Model.LiteralString v2 -> Right v2+ _ -> Left (Errors.DecodingError "expected string literal")+ _ -> Left (Errors.DecodingError "expected literal")) (ExtractModel.stripWithDecodingError cx input))))]+ in (Optionals.match (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [+ "no such field ",+ (Model.unName fname),+ " in union"]))) (\f -> f fterm))+ _ -> Left (Errors.DecodingError "expected union")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.model.LiteralType+literalType :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Model.LiteralType+literalType cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermInject v0 ->+ let field = Model.injectionField v0+ fname = Model.fieldName field+ fterm = Model.fieldTerm field+ variantMap =+ Maps.fromList [+ (Model.Name "binary", (\input -> Eithers.map (\t -> Model.LiteralTypeBinary) (ExtractModel.decodeUnit cx input))),+ (Model.Name "boolean", (\input -> Eithers.map (\t -> Model.LiteralTypeBoolean) (ExtractModel.decodeUnit cx input))),+ (Model.Name "decimal", (\input -> Eithers.map (\t -> Model.LiteralTypeDecimal) (ExtractModel.decodeUnit cx input))),+ (Model.Name "float", (\input -> Eithers.map (\t -> Model.LiteralTypeFloat t) (floatType cx input))),+ (Model.Name "integer", (\input -> Eithers.map (\t -> Model.LiteralTypeInteger t) (integerType cx input))),+ (Model.Name "string", (\input -> Eithers.map (\t -> Model.LiteralTypeString) (ExtractModel.decodeUnit cx input)))]+ in (Optionals.match (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [+ "no such field ",+ (Model.unName fname),+ " in union"]))) (\f -> f fterm))+ _ -> Left (Errors.DecodingError "expected union")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.model.MapType+mapType :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Model.MapType+mapType cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "keys" type_ fieldMap cx) (\field_keys -> Eithers.bind (ExtractModel.requireField "values" type_ fieldMap cx) (\field_values -> Right (Model.MapType {+ Model.mapTypeKeys = field_keys,+ Model.mapTypeValues = field_values}))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.model.MapType")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.model.Name+name :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Model.Name+name cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermWrap v0 -> Eithers.map (\b -> Model.Name b) ((\raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of+ Model.TermLiteral v1 -> case v1 of+ Model.LiteralString v2 -> Right v2+ _ -> Left (Errors.DecodingError "expected string literal")+ _ -> Left (Errors.DecodingError "expected literal")) (ExtractModel.stripWithDecodingError cx raw2)) (Model.wrappedTermBody v0))+ _ -> Left (Errors.DecodingError "expected wrapped type")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.model.PairType+pairType :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Model.PairType+pairType cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "first" type_ fieldMap cx) (\field_first -> Eithers.bind (ExtractModel.requireField "second" type_ fieldMap cx) (\field_second -> Right (Model.PairType {+ Model.pairTypeFirst = field_first,+ Model.pairTypeSecond = field_second}))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.model.PairType")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.model.Projection+projection :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Model.Projection+projection cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "typeName" name fieldMap cx) (\field_typeName -> Eithers.bind (ExtractModel.requireField "fieldName" name fieldMap cx) (\field_fieldName -> Right (Model.Projection {+ Model.projectionTypeName = field_typeName,+ Model.projectionFieldName = field_fieldName}))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.model.Projection")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.model.Record+record :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Model.Record+record cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "typeName" name fieldMap cx) (\field_typeName -> Eithers.bind (ExtractModel.requireField "fields" (ExtractModel.decodeList field) fieldMap cx) (\field_fields -> Right (Model.Record {+ Model.recordTypeName = field_typeName,+ Model.recordFields = field_fields}))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.model.Record")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.model.Term+term :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Model.Term+term cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermInject v0 ->+ let field = Model.injectionField v0+ fname = Model.fieldName field+ fterm = Model.fieldTerm field+ variantMap =+ Maps.fromList [+ (Model.Name "annotated", (\input -> Eithers.map (\t -> Model.TermAnnotated t) (annotatedTerm cx input))),+ (Model.Name "application", (\input -> Eithers.map (\t -> Model.TermApplication t) (application cx input))),+ (Model.Name "cases", (\input -> Eithers.map (\t -> Model.TermCases t) (caseStatement cx input))),+ (Model.Name "either", (\input -> Eithers.map (\t -> Model.TermEither t) (ExtractModel.decodeEither term term cx input))),+ (Model.Name "inject", (\input -> Eithers.map (\t -> Model.TermInject t) (injection cx input))),+ (Model.Name "lambda", (\input -> Eithers.map (\t -> Model.TermLambda t) (lambda cx input))),+ (Model.Name "let", (\input -> Eithers.map (\t -> Model.TermLet t) (let_ cx input))),+ (Model.Name "list", (\input -> Eithers.map (\t -> Model.TermList t) (ExtractModel.decodeList term cx input))),+ (Model.Name "literal", (\input -> Eithers.map (\t -> Model.TermLiteral t) (literal cx input))),+ (Model.Name "map", (\input -> Eithers.map (\t -> Model.TermMap t) (ExtractModel.decodeMap term term cx input))),+ (Model.Name "optional", (\input -> Eithers.map (\t -> Model.TermOptional t) (ExtractModel.decodeMaybe term cx input))),+ (Model.Name "pair", (\input -> Eithers.map (\t -> Model.TermPair t) (ExtractModel.decodePair term term cx input))),+ (Model.Name "project", (\input -> Eithers.map (\t -> Model.TermProject t) (projection cx input))),+ (Model.Name "record", (\input -> Eithers.map (\t -> Model.TermRecord t) (record cx input))),+ (Model.Name "set", (\input -> Eithers.map (\t -> Model.TermSet t) (ExtractModel.decodeSet term cx input))),+ (Model.Name "typeApplication", (\input -> Eithers.map (\t -> Model.TermTypeApplication t) (typeApplicationTerm cx input))),+ (Model.Name "typeLambda", (\input -> Eithers.map (\t -> Model.TermTypeLambda t) (typeLambda cx input))),+ (Model.Name "unit", (\input -> Eithers.map (\t -> Model.TermUnit) (ExtractModel.decodeUnit cx input))),+ (Model.Name "unwrap", (\input -> Eithers.map (\t -> Model.TermUnwrap t) (name cx input))),+ (Model.Name "variable", (\input -> Eithers.map (\t -> Model.TermVariable t) (name cx input))),+ (Model.Name "wrap", (\input -> Eithers.map (\t -> Model.TermWrap t) (wrappedTerm cx input)))]+ in (Optionals.match (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [+ "no such field ",+ (Model.unName fname),+ " in union"]))) (\f -> f fterm))+ _ -> Left (Errors.DecodingError "expected union")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.model.Type+type_ :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Model.Type+type_ cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermInject v0 ->+ let field = Model.injectionField v0+ fname = Model.fieldName field+ fterm = Model.fieldTerm field+ variantMap =+ Maps.fromList [+ (Model.Name "annotated", (\input -> Eithers.map (\t -> Model.TypeAnnotated t) (annotatedType cx input))),+ (Model.Name "application", (\input -> Eithers.map (\t -> Model.TypeApplication t) (applicationType cx input))),+ (Model.Name "effect", (\input -> Eithers.map (\t -> Model.TypeEffect t) (type_ cx input))),+ (Model.Name "either", (\input -> Eithers.map (\t -> Model.TypeEither t) (eitherType cx input))),+ (Model.Name "forall", (\input -> Eithers.map (\t -> Model.TypeForall t) (forallType cx input))),+ (Model.Name "function", (\input -> Eithers.map (\t -> Model.TypeFunction t) (functionType cx input))),+ (Model.Name "list", (\input -> Eithers.map (\t -> Model.TypeList t) (type_ cx input))),+ (Model.Name "literal", (\input -> Eithers.map (\t -> Model.TypeLiteral t) (literalType cx input))),+ (Model.Name "map", (\input -> Eithers.map (\t -> Model.TypeMap t) (mapType cx input))),+ (Model.Name "optional", (\input -> Eithers.map (\t -> Model.TypeOptional t) (type_ cx input))),+ (Model.Name "pair", (\input -> Eithers.map (\t -> Model.TypePair t) (pairType cx input))),+ (Model.Name "record", (\input -> Eithers.map (\t -> Model.TypeRecord t) (ExtractModel.decodeList fieldType cx input))),+ (Model.Name "set", (\input -> Eithers.map (\t -> Model.TypeSet t) (type_ cx input))),+ (Model.Name "union", (\input -> Eithers.map (\t -> Model.TypeUnion t) (ExtractModel.decodeList fieldType cx input))),+ (Model.Name "unit", (\input -> Eithers.map (\t -> Model.TypeUnit) (ExtractModel.decodeUnit cx input))),+ (Model.Name "variable", (\input -> Eithers.map (\t -> Model.TypeVariable t) (name cx input))),+ (Model.Name "void", (\input -> Eithers.map (\t -> Model.TypeVoid) (ExtractModel.decodeUnit cx input))),+ (Model.Name "wrap", (\input -> Eithers.map (\t -> Model.TypeWrap t) (type_ cx input)))]+ in (Optionals.match (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [+ "no such field ",+ (Model.unName fname),+ " in union"]))) (\f -> f fterm))+ _ -> Left (Errors.DecodingError "expected union")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.model.TypeApplicationTerm+typeApplicationTerm :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Model.TypeApplicationTerm+typeApplicationTerm cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "body" term fieldMap cx) (\field_body -> Eithers.bind (ExtractModel.requireField "type" type_ fieldMap cx) (\field_type -> Right (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = field_body,+ Model.typeApplicationTermType = field_type}))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.model.TypeApplicationTerm")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.model.TypeClassConstraint+typeClassConstraint :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Model.TypeClassConstraint+typeClassConstraint cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermInject v0 ->+ let field = Model.injectionField v0+ fname = Model.fieldName field+ fterm = Model.fieldTerm field+ variantMap =+ Maps.fromList [+ (Model.Name "simple", (\input -> Eithers.map (\t -> Model.TypeClassConstraintSimple t) (name cx input)))]+ in (Optionals.match (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [+ "no such field ",+ (Model.unName fname),+ " in union"]))) (\f -> f fterm))+ _ -> Left (Errors.DecodingError "expected union")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.model.TypeLambda+typeLambda :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Model.TypeLambda+typeLambda cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "parameter" name fieldMap cx) (\field_parameter -> Eithers.bind (ExtractModel.requireField "body" term fieldMap cx) (\field_body -> Right (Model.TypeLambda {+ Model.typeLambdaParameter = field_parameter,+ Model.typeLambdaBody = field_body}))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.model.TypeLambda")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.model.TypeScheme+typeScheme :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Model.TypeScheme+typeScheme cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "variables" (ExtractModel.decodeList name) fieldMap cx) (\field_variables -> Eithers.bind (ExtractModel.requireField "body" type_ fieldMap cx) (\field_body -> Eithers.bind (ExtractModel.requireField "constraints" (ExtractModel.decodeMap name typeVariableConstraints) fieldMap cx) (\field_constraints -> Right (Model.TypeScheme {+ Model.typeSchemeVariables = field_variables,+ Model.typeSchemeBody = field_body,+ Model.typeSchemeConstraints = field_constraints})))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.model.TypeScheme")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.model.TypeVariableConstraints+typeVariableConstraints :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Model.TypeVariableConstraints+typeVariableConstraints cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "classes" (ExtractModel.decodeSet typeClassConstraint) fieldMap cx) (\field_classes -> Right (Model.TypeVariableConstraints {+ Model.typeVariableConstraintsClasses = field_classes})))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.model.TypeVariableConstraints")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.model.WrappedTerm+wrappedTerm :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Model.WrappedTerm+wrappedTerm cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "typeName" name fieldMap cx) (\field_typeName -> Eithers.bind (ExtractModel.requireField "body" term fieldMap cx) (\field_body -> Right (Model.WrappedTerm {+ Model.wrappedTermTypeName = field_typeName,+ Model.wrappedTermBody = field_body}))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.model.WrappedTerm")) (ExtractModel.stripWithDecodingError cx raw)
@@ -0,0 +1,352 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Term decoders for hydra.core.packaging++module Hydra.Core.Decode.Packaging where++import qualified Hydra.Core.Decode.Model as DecodeModel+import qualified Hydra.Core.Decode.Typing as Typing+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.Extract.Model as ExtractModel+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Lexical as Lexical+import qualified Hydra.Core.Overlay.Haskell.Lib.Eithers as Eithers+import qualified Hydra.Core.Overlay.Haskell.Lib.Maps as Maps+import qualified Hydra.Core.Overlay.Haskell.Lib.Optionals as Optionals+import qualified Hydra.Core.Overlay.Haskell.Lib.Strings as Strings+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Rewriting as Rewriting+import qualified Hydra.Core.Util as Util+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | Decoder for hydra.core.packaging.Definition+definition :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Packaging.Definition+definition cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermInject v0 ->+ let field = Model.injectionField v0+ fname = Model.fieldName field+ fterm = Model.fieldTerm field+ variantMap =+ Maps.fromList [+ (Model.Name "primitive", (\input -> Eithers.map (\t -> Packaging.DefinitionPrimitive t) (primitiveDefinition cx input))),+ (Model.Name "term", (\input -> Eithers.map (\t -> Packaging.DefinitionTerm t) (termDefinition cx input))),+ (Model.Name "type", (\input -> Eithers.map (\t -> Packaging.DefinitionType t) (typeDefinition cx input)))]+ in (Optionals.match (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [+ "no such field ",+ (Model.unName fname),+ " in union"]))) (\f -> f fterm))+ _ -> Left (Errors.DecodingError "expected union")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.packaging.DefinitionReference+definitionReference :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Packaging.DefinitionReference+definitionReference cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermInject v0 ->+ let field = Model.injectionField v0+ fname = Model.fieldName field+ fterm = Model.fieldTerm field+ variantMap =+ Maps.fromList [+ (+ Model.Name "primitive",+ (\input -> Eithers.map (\t -> Packaging.DefinitionReferencePrimitive t) (DecodeModel.name cx input))),+ (Model.Name "term", (\input -> Eithers.map (\t -> Packaging.DefinitionReferenceTerm t) (DecodeModel.name cx input))),+ (Model.Name "type", (\input -> Eithers.map (\t -> Packaging.DefinitionReferenceType t) (DecodeModel.name cx input)))]+ in (Optionals.match (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [+ "no such field ",+ (Model.unName fname),+ " in union"]))) (\f -> f fterm))+ _ -> Left (Errors.DecodingError "expected union")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.packaging.DependencyScope+dependencyScope :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Packaging.DependencyScope+dependencyScope cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermInject v0 ->+ let field = Model.injectionField v0+ fname = Model.fieldName field+ fterm = Model.fieldTerm field+ variantMap =+ Maps.fromList [+ (Model.Name "api", (\input -> Eithers.map (\t -> Packaging.DependencyScopeApi) (ExtractModel.decodeUnit cx input))),+ (+ Model.Name "runtime",+ (\input -> Eithers.map (\t -> Packaging.DependencyScopeRuntime) (ExtractModel.decodeUnit cx input))),+ (Model.Name "test", (\input -> Eithers.map (\t -> Packaging.DependencyScopeTest) (ExtractModel.decodeUnit cx input))),+ (Model.Name "tool", (\input -> Eithers.map (\t -> Packaging.DependencyScopeTool) (ExtractModel.decodeUnit cx input)))]+ in (Optionals.match (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [+ "no such field ",+ (Model.unName fname),+ " in union"]))) (\f -> f fterm))+ _ -> Left (Errors.DecodingError "expected union")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.packaging.EntityMetadata+entityMetadata :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Packaging.EntityMetadata+entityMetadata cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "description" (ExtractModel.decodeMaybe (\cx2 -> \raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of+ Model.TermLiteral v1 -> case v1 of+ Model.LiteralString v2 -> Right v2+ _ -> Left (Errors.DecodingError "expected string literal")+ _ -> Left (Errors.DecodingError "expected literal")) (ExtractModel.stripWithDecodingError cx2 raw2))) fieldMap cx) (\field_description -> Eithers.bind (ExtractModel.requireField "comments" (ExtractModel.decodeList (\cx2 -> \raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of+ Model.TermLiteral v1 -> case v1 of+ Model.LiteralString v2 -> Right v2+ _ -> Left (Errors.DecodingError "expected string literal")+ _ -> Left (Errors.DecodingError "expected literal")) (ExtractModel.stripWithDecodingError cx2 raw2))) fieldMap cx) (\field_comments -> Eithers.bind (ExtractModel.requireField "seeAlso" (ExtractModel.decodeList entityReference) fieldMap cx) (\field_seeAlso -> Eithers.bind (ExtractModel.requireField "lifecycle" (ExtractModel.decodeMaybe lifecycleInfo) fieldMap cx) (\field_lifecycle -> Eithers.bind (ExtractModel.requireField "provisions" (ExtractModel.decodeList provision) fieldMap cx) (\field_provisions -> Right (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = field_description,+ Packaging.entityMetadataComments = field_comments,+ Packaging.entityMetadataSeeAlso = field_seeAlso,+ Packaging.entityMetadataLifecycle = field_lifecycle,+ Packaging.entityMetadataProvisions = field_provisions})))))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.packaging.EntityMetadata")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.packaging.EntityReference+entityReference :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Packaging.EntityReference+entityReference cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermInject v0 ->+ let field = Model.injectionField v0+ fname = Model.fieldName field+ fterm = Model.fieldTerm field+ variantMap =+ Maps.fromList [+ (+ Model.Name "definition",+ (\input -> Eithers.map (\t -> Packaging.EntityReferenceDefinition t) (definitionReference cx input))),+ (Model.Name "module", (\input -> Eithers.map (\t -> Packaging.EntityReferenceModule t) (moduleName cx input))),+ (Model.Name "package", (\input -> Eithers.map (\t -> Packaging.EntityReferencePackage t) (packageName cx input))),+ (+ Model.Name "termExpr",+ (\input -> Eithers.map (\t -> Packaging.EntityReferenceTermExpr t) (Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of+ Model.TermLiteral v1 -> case v1 of+ Model.LiteralString v2 -> Right v2+ _ -> Left (Errors.DecodingError "expected string literal")+ _ -> Left (Errors.DecodingError "expected literal")) (ExtractModel.stripWithDecodingError cx input)))),+ (+ Model.Name "typeExpr",+ (\input -> Eithers.map (\t -> Packaging.EntityReferenceTypeExpr t) (Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of+ Model.TermLiteral v1 -> case v1 of+ Model.LiteralString v2 -> Right v2+ _ -> Left (Errors.DecodingError "expected string literal")+ _ -> Left (Errors.DecodingError "expected literal")) (ExtractModel.stripWithDecodingError cx input))))]+ in (Optionals.match (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [+ "no such field ",+ (Model.unName fname),+ " in union"]))) (\f -> f fterm))+ _ -> Left (Errors.DecodingError "expected union")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.packaging.LifecycleInfo+lifecycleInfo :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Packaging.LifecycleInfo+lifecycleInfo cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "availableSince" (ExtractModel.decodeMaybe version) fieldMap cx) (\field_availableSince -> Eithers.bind (ExtractModel.requireField "deprecatedSince" (ExtractModel.decodeMaybe version) fieldMap cx) (\field_deprecatedSince -> Right (Packaging.LifecycleInfo {+ Packaging.lifecycleInfoAvailableSince = field_availableSince,+ Packaging.lifecycleInfoDeprecatedSince = field_deprecatedSince}))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.packaging.LifecycleInfo")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.packaging.Module+module_ :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Packaging.Module+module_ cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "name" moduleName fieldMap cx) (\field_name -> Eithers.bind (ExtractModel.requireField "metadata" (ExtractModel.decodeMaybe entityMetadata) fieldMap cx) (\field_metadata -> Eithers.bind (ExtractModel.requireField "dependencies" (ExtractModel.decodeList moduleDependency) fieldMap cx) (\field_dependencies -> Eithers.bind (ExtractModel.requireField "definitions" (ExtractModel.decodeList definition) fieldMap cx) (\field_definitions -> Right (Packaging.Module {+ Packaging.moduleName = field_name,+ Packaging.moduleMetadata = field_metadata,+ Packaging.moduleDependencies = field_dependencies,+ Packaging.moduleDefinitions = field_definitions}))))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.packaging.Module")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.packaging.ModuleDependency+moduleDependency :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Packaging.ModuleDependency+moduleDependency cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "module" moduleName fieldMap cx) (\field_module -> Eithers.bind (ExtractModel.requireField "package" (ExtractModel.decodeMaybe packageName) fieldMap cx) (\field_package -> Right (Packaging.ModuleDependency {+ Packaging.moduleDependencyModule = field_module,+ Packaging.moduleDependencyPackage = field_package}))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.packaging.ModuleDependency")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.packaging.ModuleName+moduleName :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Packaging.ModuleName+moduleName cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermWrap v0 -> Eithers.map (\b -> Packaging.ModuleName b) ((\raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of+ Model.TermLiteral v1 -> case v1 of+ Model.LiteralString v2 -> Right v2+ _ -> Left (Errors.DecodingError "expected string literal")+ _ -> Left (Errors.DecodingError "expected literal")) (ExtractModel.stripWithDecodingError cx raw2)) (Model.wrappedTermBody v0))+ _ -> Left (Errors.DecodingError "expected wrapped type")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.packaging.Package+package :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Packaging.Package+package cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "name" packageName fieldMap cx) (\field_name -> Eithers.bind (ExtractModel.requireField "metadata" (ExtractModel.decodeMaybe entityMetadata) fieldMap cx) (\field_metadata -> Eithers.bind (ExtractModel.requireField "dependencies" (ExtractModel.decodeList packageDependency) fieldMap cx) (\field_dependencies -> Eithers.bind (ExtractModel.requireField "modules" (ExtractModel.decodeList module_) fieldMap cx) (\field_modules -> Right (Packaging.Package {+ Packaging.packageName = field_name,+ Packaging.packageMetadata = field_metadata,+ Packaging.packageDependencies = field_dependencies,+ Packaging.packageModules = field_modules}))))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.packaging.Package")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.packaging.PackageDependency+packageDependency :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Packaging.PackageDependency+packageDependency cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "name" packageName fieldMap cx) (\field_name -> Eithers.bind (ExtractModel.requireField "version" versionSpecifier fieldMap cx) (\field_version -> Eithers.bind (ExtractModel.requireField "scope" (ExtractModel.decodeMaybe dependencyScope) fieldMap cx) (\field_scope -> Right (Packaging.PackageDependency {+ Packaging.packageDependencyName = field_name,+ Packaging.packageDependencyVersion = field_version,+ Packaging.packageDependencyScope = field_scope})))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.packaging.PackageDependency")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.packaging.PackageName+packageName :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Packaging.PackageName+packageName cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermWrap v0 -> Eithers.map (\b -> Packaging.PackageName b) ((\raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of+ Model.TermLiteral v1 -> case v1 of+ Model.LiteralString v2 -> Right v2+ _ -> Left (Errors.DecodingError "expected string literal")+ _ -> Left (Errors.DecodingError "expected literal")) (ExtractModel.stripWithDecodingError cx raw2)) (Model.wrappedTermBody v0))+ _ -> Left (Errors.DecodingError "expected wrapped type")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.packaging.PrimitiveDefinition+primitiveDefinition :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Packaging.PrimitiveDefinition+primitiveDefinition cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "name" DecodeModel.name fieldMap cx) (\field_name -> Eithers.bind (ExtractModel.requireField "metadata" (ExtractModel.decodeMaybe entityMetadata) fieldMap cx) (\field_metadata -> Eithers.bind (ExtractModel.requireField "signature" Typing.termSignature fieldMap cx) (\field_signature -> Eithers.bind (ExtractModel.requireField "isPure" (\cx2 -> \raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of+ Model.TermLiteral v1 -> case v1 of+ Model.LiteralBoolean v2 -> Right v2+ _ -> Left (Errors.DecodingError "expected boolean literal")+ _ -> Left (Errors.DecodingError "expected literal")) (ExtractModel.stripWithDecodingError cx2 raw2)) fieldMap cx) (\field_isPure -> Eithers.bind (ExtractModel.requireField "isTotal" (\cx2 -> \raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of+ Model.TermLiteral v1 -> case v1 of+ Model.LiteralBoolean v2 -> Right v2+ _ -> Left (Errors.DecodingError "expected boolean literal")+ _ -> Left (Errors.DecodingError "expected literal")) (ExtractModel.stripWithDecodingError cx2 raw2)) fieldMap cx) (\field_isTotal -> Eithers.bind (ExtractModel.requireField "defaultImplementation" (ExtractModel.decodeMaybe DecodeModel.term) fieldMap cx) (\field_defaultImplementation -> Right (Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = field_name,+ Packaging.primitiveDefinitionMetadata = field_metadata,+ Packaging.primitiveDefinitionSignature = field_signature,+ Packaging.primitiveDefinitionIsPure = field_isPure,+ Packaging.primitiveDefinitionIsTotal = field_isTotal,+ Packaging.primitiveDefinitionDefaultImplementation = field_defaultImplementation}))))))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.packaging.PrimitiveDefinition")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.packaging.Provision+provision :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Packaging.Provision+provision cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "name" DecodeModel.name fieldMap cx) (\field_name -> Eithers.bind (ExtractModel.requireField "kind" provisionKind fieldMap cx) (\field_kind -> Eithers.bind (ExtractModel.requireField "statement" (\cx2 -> \raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of+ Model.TermLiteral v1 -> case v1 of+ Model.LiteralString v2 -> Right v2+ _ -> Left (Errors.DecodingError "expected string literal")+ _ -> Left (Errors.DecodingError "expected literal")) (ExtractModel.stripWithDecodingError cx2 raw2)) fieldMap cx) (\field_statement -> Right (Packaging.Provision {+ Packaging.provisionName = field_name,+ Packaging.provisionKind = field_kind,+ Packaging.provisionStatement = field_statement})))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.packaging.Provision")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.packaging.ProvisionKind+provisionKind :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Packaging.ProvisionKind+provisionKind cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermInject v0 ->+ let field = Model.injectionField v0+ fname = Model.fieldName field+ fterm = Model.fieldTerm field+ variantMap =+ Maps.fromList [+ (+ Model.Name "requirement",+ (\input -> Eithers.map (\t -> Packaging.ProvisionKindRequirement) (ExtractModel.decodeUnit cx input))),+ (+ Model.Name "recommendation",+ (\input -> Eithers.map (\t -> Packaging.ProvisionKindRecommendation) (ExtractModel.decodeUnit cx input)))]+ in (Optionals.match (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [+ "no such field ",+ (Model.unName fname),+ " in union"]))) (\f -> f fterm))+ _ -> Left (Errors.DecodingError "expected union")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.packaging.TermDefinition+termDefinition :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Packaging.TermDefinition+termDefinition cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "name" DecodeModel.name fieldMap cx) (\field_name -> Eithers.bind (ExtractModel.requireField "metadata" (ExtractModel.decodeMaybe entityMetadata) fieldMap cx) (\field_metadata -> Eithers.bind (ExtractModel.requireField "signature" (ExtractModel.decodeMaybe Typing.termSignature) fieldMap cx) (\field_signature -> Eithers.bind (ExtractModel.requireField "body" DecodeModel.term fieldMap cx) (\field_body -> Right (Packaging.TermDefinition {+ Packaging.termDefinitionName = field_name,+ Packaging.termDefinitionMetadata = field_metadata,+ Packaging.termDefinitionSignature = field_signature,+ Packaging.termDefinitionBody = field_body}))))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.packaging.TermDefinition")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.packaging.TypeDefinition+typeDefinition :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Packaging.TypeDefinition+typeDefinition cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "name" DecodeModel.name fieldMap cx) (\field_name -> Eithers.bind (ExtractModel.requireField "metadata" (ExtractModel.decodeMaybe entityMetadata) fieldMap cx) (\field_metadata -> Eithers.bind (ExtractModel.requireField "body" DecodeModel.typeScheme fieldMap cx) (\field_body -> Right (Packaging.TypeDefinition {+ Packaging.typeDefinitionName = field_name,+ Packaging.typeDefinitionMetadata = field_metadata,+ Packaging.typeDefinitionBody = field_body})))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.packaging.TypeDefinition")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.packaging.Version+version :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Packaging.Version+version cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermWrap v0 -> Eithers.map (\b -> Packaging.Version b) ((\raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of+ Model.TermLiteral v1 -> case v1 of+ Model.LiteralString v2 -> Right v2+ _ -> Left (Errors.DecodingError "expected string literal")+ _ -> Left (Errors.DecodingError "expected literal")) (ExtractModel.stripWithDecodingError cx raw2)) (Model.wrappedTermBody v0))+ _ -> Left (Errors.DecodingError "expected wrapped type")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.packaging.VersionRange+versionRange :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Packaging.VersionRange+versionRange cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "lowerInclusive" (ExtractModel.decodeMaybe version) fieldMap cx) (\field_lowerInclusive -> Eithers.bind (ExtractModel.requireField "upperExclusive" (ExtractModel.decodeMaybe version) fieldMap cx) (\field_upperExclusive -> Right (Packaging.VersionRange {+ Packaging.versionRangeLowerInclusive = field_lowerInclusive,+ Packaging.versionRangeUpperExclusive = field_upperExclusive}))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.packaging.VersionRange")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.packaging.VersionSpecifier+versionSpecifier :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Packaging.VersionSpecifier+versionSpecifier cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermInject v0 ->+ let field = Model.injectionField v0+ fname = Model.fieldName field+ fterm = Model.fieldTerm field+ variantMap =+ Maps.fromList [+ (Model.Name "any", (\input -> Eithers.map (\t -> Packaging.VersionSpecifierAny) (ExtractModel.decodeUnit cx input))),+ (Model.Name "exact", (\input -> Eithers.map (\t -> Packaging.VersionSpecifierExact t) (version cx input))),+ (Model.Name "atLeast", (\input -> Eithers.map (\t -> Packaging.VersionSpecifierAtLeast t) (version cx input))),+ (Model.Name "range", (\input -> Eithers.map (\t -> Packaging.VersionSpecifierRange t) (versionRange cx input)))]+ in (Optionals.match (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [+ "no such field ",+ (Model.unName fname),+ " in union"]))) (\f -> f fterm))+ _ -> Left (Errors.DecodingError "expected union")) (ExtractModel.stripWithDecodingError cx raw)
@@ -0,0 +1,78 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Term decoders for hydra.core.parsing++module Hydra.Core.Decode.Parsing where++import qualified Hydra.Core.Decode.Model as DecodeModel+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.Extract.Model as ExtractModel+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Lexical as Lexical+import qualified Hydra.Core.Overlay.Haskell.Lib.Eithers as Eithers+import qualified Hydra.Core.Overlay.Haskell.Lib.Maps as Maps+import qualified Hydra.Core.Overlay.Haskell.Lib.Optionals as Optionals+import qualified Hydra.Core.Overlay.Haskell.Lib.Strings as Strings+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Parsing as Parsing+import qualified Hydra.Core.Rewriting as Rewriting+import qualified Hydra.Core.Util as Util+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | Decoder for hydra.core.parsing.ParseError+parseError :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Parsing.ParseError+parseError cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "message" (\cx2 -> \raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of+ Model.TermLiteral v1 -> case v1 of+ Model.LiteralString v2 -> Right v2+ _ -> Left (Errors.DecodingError "expected string literal")+ _ -> Left (Errors.DecodingError "expected literal")) (ExtractModel.stripWithDecodingError cx2 raw2)) fieldMap cx) (\field_message -> Eithers.bind (ExtractModel.requireField "remainder" (ExtractModel.decodeList (\cx2 -> \raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of+ Model.TermLiteral v1 -> case v1 of+ Model.LiteralInteger v2 -> case v2 of+ Model.IntegerValueInt32 v3 -> Right v3+ _ -> Left (Errors.DecodingError "expected int32 value")+ _ -> Left (Errors.DecodingError "expected int32 literal")+ _ -> Left (Errors.DecodingError "expected literal")) (ExtractModel.stripWithDecodingError cx2 raw2))) fieldMap cx) (\field_remainder -> Right (Parsing.ParseError {+ Parsing.parseErrorMessage = field_message,+ Parsing.parseErrorRemainder = field_remainder}))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.parsing.ParseError")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.parsing.ParseResult+parseResult :: (Graph.Graph -> Model.Term -> Either Errors.DecodingError a) -> Graph.Graph -> Model.Term -> Either Errors.DecodingError (Parsing.ParseResult a)+parseResult a cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermInject v0 ->+ let field = Model.injectionField v0+ fname = Model.fieldName field+ fterm = Model.fieldTerm field+ variantMap =+ Maps.fromList [+ (Model.Name "success", (\input -> Eithers.map (\t -> Parsing.ParseResultSuccess t) (parseSuccess a cx input))),+ (Model.Name "failure", (\input -> Eithers.map (\t -> Parsing.ParseResultFailure t) (parseError cx input)))]+ in (Optionals.match (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [+ "no such field ",+ (Model.unName fname),+ " in union"]))) (\f -> f fterm))+ _ -> Left (Errors.DecodingError "expected union")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.parsing.ParseSuccess+parseSuccess :: (Graph.Graph -> Model.Term -> Either Errors.DecodingError a) -> Graph.Graph -> Model.Term -> Either Errors.DecodingError (Parsing.ParseSuccess a)+parseSuccess a cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "value" a fieldMap cx) (\field_value -> Eithers.bind (ExtractModel.requireField "remainder" (ExtractModel.decodeList (\cx2 -> \raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of+ Model.TermLiteral v1 -> case v1 of+ Model.LiteralInteger v2 -> case v2 of+ Model.IntegerValueInt32 v3 -> Right v3+ _ -> Left (Errors.DecodingError "expected int32 value")+ _ -> Left (Errors.DecodingError "expected int32 literal")+ _ -> Left (Errors.DecodingError "expected literal")) (ExtractModel.stripWithDecodingError cx2 raw2))) fieldMap cx) (\field_remainder -> Right (Parsing.ParseSuccess {+ Parsing.parseSuccessValue = field_value,+ Parsing.parseSuccessRemainder = field_remainder}))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.parsing.ParseSuccess")) (ExtractModel.stripWithDecodingError cx raw)
@@ -0,0 +1,487 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Term decoders for hydra.core.paths++module Hydra.Core.Decode.Paths where++import qualified Hydra.Core.Decode.Model as DecodeModel+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.Extract.Model as ExtractModel+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Lexical as Lexical+import qualified Hydra.Core.Overlay.Haskell.Lib.Eithers as Eithers+import qualified Hydra.Core.Overlay.Haskell.Lib.Maps as Maps+import qualified Hydra.Core.Overlay.Haskell.Lib.Optionals as Optionals+import qualified Hydra.Core.Overlay.Haskell.Lib.Strings as Strings+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Rewriting as Rewriting+import qualified Hydra.Core.Util as Util+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | Decoder for hydra.core.paths.LambdaVariableReference+lambdaVariableReference :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Paths.LambdaVariableReference+lambdaVariableReference cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "variable" DecodeModel.name fieldMap cx) (\field_variable -> Eithers.bind (ExtractModel.requireField "boundByNode" termNodeId fieldMap cx) (\field_boundByNode -> Eithers.bind (ExtractModel.requireField "type" DecodeModel.type_ fieldMap cx) (\field_type -> Right (Paths.LambdaVariableReference {+ Paths.lambdaVariableReferenceVariable = field_variable,+ Paths.lambdaVariableReferenceBoundByNode = field_boundByNode,+ Paths.lambdaVariableReferenceType = field_type})))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.paths.LambdaVariableReference")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.paths.LetVariableReference+letVariableReference :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Paths.LetVariableReference+letVariableReference cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "variable" DecodeModel.name fieldMap cx) (\field_variable -> Eithers.bind (ExtractModel.requireField "bindingNode" termNodeId fieldMap cx) (\field_bindingNode -> Eithers.bind (ExtractModel.requireField "type" DecodeModel.type_ fieldMap cx) (\field_type -> Right (Paths.LetVariableReference {+ Paths.letVariableReferenceVariable = field_variable,+ Paths.letVariableReferenceBindingNode = field_bindingNode,+ Paths.letVariableReferenceType = field_type})))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.paths.LetVariableReference")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.paths.NominalTypeReference+nominalTypeReference :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Paths.NominalTypeReference+nominalTypeReference cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "name" DecodeModel.name fieldMap cx) (\field_name -> Right (Paths.NominalTypeReference {+ Paths.nominalTypeReferenceName = field_name})))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.paths.NominalTypeReference")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.paths.PrimitiveReference+primitiveReference :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Paths.PrimitiveReference+primitiveReference cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "name" DecodeModel.name fieldMap cx) (\field_name -> Eithers.bind (ExtractModel.requireField "type" DecodeModel.type_ fieldMap cx) (\field_type -> Right (Paths.PrimitiveReference {+ Paths.primitiveReferenceName = field_name,+ Paths.primitiveReferenceType = field_type}))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.paths.PrimitiveReference")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.paths.SubtermLink+subtermLink :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Paths.SubtermLink+subtermLink cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "step" subtermStep fieldMap cx) (\field_step -> Eithers.bind (ExtractModel.requireField "child" termNode fieldMap cx) (\field_child -> Right (Paths.SubtermLink {+ Paths.subtermLinkStep = field_step,+ Paths.subtermLinkChild = field_child}))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.paths.SubtermLink")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.paths.SubtermPath+subtermPath :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Paths.SubtermPath+subtermPath cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermWrap v0 -> Eithers.map (\b -> Paths.SubtermPath b) (ExtractModel.decodeList subtermStep cx (Model.wrappedTermBody v0))+ _ -> Left (Errors.DecodingError "expected wrapped type")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.paths.SubtermStep+subtermStep :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Paths.SubtermStep+subtermStep cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermInject v0 ->+ let field = Model.injectionField v0+ fname = Model.fieldName field+ fterm = Model.fieldTerm field+ variantMap =+ Maps.fromList [+ (+ Model.Name "annotatedAnnotation",+ (\input -> Eithers.map (\t -> Paths.SubtermStepAnnotatedAnnotation) (ExtractModel.decodeUnit cx input))),+ (+ Model.Name "annotatedBody",+ (\input -> Eithers.map (\t -> Paths.SubtermStepAnnotatedBody) (ExtractModel.decodeUnit cx input))),+ (+ Model.Name "applicationArgument",+ (\input -> Eithers.map (\t -> Paths.SubtermStepApplicationArgument) (ExtractModel.decodeUnit cx input))),+ (+ Model.Name "applicationFunction",+ (\input -> Eithers.map (\t -> Paths.SubtermStepApplicationFunction) (ExtractModel.decodeUnit cx input))),+ (Model.Name "casesCase", (\input -> Eithers.map (\t -> Paths.SubtermStepCasesCase t) (DecodeModel.name cx input))),+ (+ Model.Name "casesDefault",+ (\input -> Eithers.map (\t -> Paths.SubtermStepCasesDefault) (ExtractModel.decodeUnit cx input))),+ (Model.Name "eitherLeft", (\input -> Eithers.map (\t -> Paths.SubtermStepEitherLeft) (ExtractModel.decodeUnit cx input))),+ (+ Model.Name "eitherRight",+ (\input -> Eithers.map (\t -> Paths.SubtermStepEitherRight) (ExtractModel.decodeUnit cx input))),+ (Model.Name "injectField", (\input -> Eithers.map (\t -> Paths.SubtermStepInjectField t) (DecodeModel.name cx input))),+ (Model.Name "lambdaBody", (\input -> Eithers.map (\t -> Paths.SubtermStepLambdaBody) (ExtractModel.decodeUnit cx input))),+ (Model.Name "letBinding", (\input -> Eithers.map (\t -> Paths.SubtermStepLetBinding t) (DecodeModel.name cx input))),+ (Model.Name "letBody", (\input -> Eithers.map (\t -> Paths.SubtermStepLetBody) (ExtractModel.decodeUnit cx input))),+ (+ Model.Name "listElement",+ (\input -> Eithers.map (\t -> Paths.SubtermStepListElement t) (Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of+ Model.TermLiteral v1 -> case v1 of+ Model.LiteralInteger v2 -> case v2 of+ Model.IntegerValueInt32 v3 -> Right v3+ _ -> Left (Errors.DecodingError "expected int32 value")+ _ -> Left (Errors.DecodingError "expected int32 literal")+ _ -> Left (Errors.DecodingError "expected literal")) (ExtractModel.stripWithDecodingError cx input)))),+ (+ Model.Name "mapEntry",+ (\input -> Eithers.map (\t -> Paths.SubtermStepMapEntry t) (Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of+ Model.TermLiteral v1 -> case v1 of+ Model.LiteralInteger v2 -> case v2 of+ Model.IntegerValueInt32 v3 -> Right v3+ _ -> Left (Errors.DecodingError "expected int32 value")+ _ -> Left (Errors.DecodingError "expected int32 literal")+ _ -> Left (Errors.DecodingError "expected literal")) (ExtractModel.stripWithDecodingError cx input)))),+ (+ Model.Name "optionalGiven",+ (\input -> Eithers.map (\t -> Paths.SubtermStepOptionalGiven) (ExtractModel.decodeUnit cx input))),+ (Model.Name "pairFirst", (\input -> Eithers.map (\t -> Paths.SubtermStepPairFirst) (ExtractModel.decodeUnit cx input))),+ (Model.Name "pairSecond", (\input -> Eithers.map (\t -> Paths.SubtermStepPairSecond) (ExtractModel.decodeUnit cx input))),+ (Model.Name "recordField", (\input -> Eithers.map (\t -> Paths.SubtermStepRecordField t) (DecodeModel.name cx input))),+ (+ Model.Name "setElement",+ (\input -> Eithers.map (\t -> Paths.SubtermStepSetElement t) (Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of+ Model.TermLiteral v1 -> case v1 of+ Model.LiteralInteger v2 -> case v2 of+ Model.IntegerValueInt32 v3 -> Right v3+ _ -> Left (Errors.DecodingError "expected int32 value")+ _ -> Left (Errors.DecodingError "expected int32 literal")+ _ -> Left (Errors.DecodingError "expected literal")) (ExtractModel.stripWithDecodingError cx input)))),+ (+ Model.Name "typeApplicationBody",+ (\input -> Eithers.map (\t -> Paths.SubtermStepTypeApplicationBody) (ExtractModel.decodeUnit cx input))),+ (+ Model.Name "typeLambdaBody",+ (\input -> Eithers.map (\t -> Paths.SubtermStepTypeLambdaBody) (ExtractModel.decodeUnit cx input))),+ (Model.Name "wrapBody", (\input -> Eithers.map (\t -> Paths.SubtermStepWrapBody) (ExtractModel.decodeUnit cx input)))]+ in (Optionals.match (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [+ "no such field ",+ (Model.unName fname),+ " in union"]))) (\f -> f fterm))+ _ -> Left (Errors.DecodingError "expected union")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.paths.SubtypeLink+subtypeLink :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Paths.SubtypeLink+subtypeLink cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "step" subtypeStep fieldMap cx) (\field_step -> Eithers.bind (ExtractModel.requireField "child" typeNode fieldMap cx) (\field_child -> Right (Paths.SubtypeLink {+ Paths.subtypeLinkStep = field_step,+ Paths.subtypeLinkChild = field_child}))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.paths.SubtypeLink")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.paths.SubtypePath+subtypePath :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Paths.SubtypePath+subtypePath cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermWrap v0 -> Eithers.map (\b -> Paths.SubtypePath b) (ExtractModel.decodeList subtypeStep cx (Model.wrappedTermBody v0))+ _ -> Left (Errors.DecodingError "expected wrapped type")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.paths.SubtypeStep+subtypeStep :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Paths.SubtypeStep+subtypeStep cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermInject v0 ->+ let field = Model.injectionField v0+ fname = Model.fieldName field+ fterm = Model.fieldTerm field+ variantMap =+ Maps.fromList [+ (+ Model.Name "annotatedBody",+ (\input -> Eithers.map (\t -> Paths.SubtypeStepAnnotatedBody) (ExtractModel.decodeUnit cx input))),+ (+ Model.Name "applicationArgument",+ (\input -> Eithers.map (\t -> Paths.SubtypeStepApplicationArgument) (ExtractModel.decodeUnit cx input))),+ (+ Model.Name "applicationFunction",+ (\input -> Eithers.map (\t -> Paths.SubtypeStepApplicationFunction) (ExtractModel.decodeUnit cx input))),+ (+ Model.Name "effectValue",+ (\input -> Eithers.map (\t -> Paths.SubtypeStepEffectValue) (ExtractModel.decodeUnit cx input))),+ (Model.Name "eitherLeft", (\input -> Eithers.map (\t -> Paths.SubtypeStepEitherLeft) (ExtractModel.decodeUnit cx input))),+ (+ Model.Name "eitherRight",+ (\input -> Eithers.map (\t -> Paths.SubtypeStepEitherRight) (ExtractModel.decodeUnit cx input))),+ (Model.Name "forallBody", (\input -> Eithers.map (\t -> Paths.SubtypeStepForallBody) (ExtractModel.decodeUnit cx input))),+ (+ Model.Name "functionCodomain",+ (\input -> Eithers.map (\t -> Paths.SubtypeStepFunctionCodomain) (ExtractModel.decodeUnit cx input))),+ (+ Model.Name "functionDomain",+ (\input -> Eithers.map (\t -> Paths.SubtypeStepFunctionDomain) (ExtractModel.decodeUnit cx input))),+ (+ Model.Name "listElement",+ (\input -> Eithers.map (\t -> Paths.SubtypeStepListElement) (ExtractModel.decodeUnit cx input))),+ (Model.Name "mapKeys", (\input -> Eithers.map (\t -> Paths.SubtypeStepMapKeys) (ExtractModel.decodeUnit cx input))),+ (Model.Name "mapValues", (\input -> Eithers.map (\t -> Paths.SubtypeStepMapValues) (ExtractModel.decodeUnit cx input))),+ (+ Model.Name "optionalElement",+ (\input -> Eithers.map (\t -> Paths.SubtypeStepOptionalElement) (ExtractModel.decodeUnit cx input))),+ (Model.Name "pairFirst", (\input -> Eithers.map (\t -> Paths.SubtypeStepPairFirst) (ExtractModel.decodeUnit cx input))),+ (Model.Name "pairSecond", (\input -> Eithers.map (\t -> Paths.SubtypeStepPairSecond) (ExtractModel.decodeUnit cx input))),+ (Model.Name "recordField", (\input -> Eithers.map (\t -> Paths.SubtypeStepRecordField t) (DecodeModel.name cx input))),+ (Model.Name "setElement", (\input -> Eithers.map (\t -> Paths.SubtypeStepSetElement) (ExtractModel.decodeUnit cx input))),+ (Model.Name "unionField", (\input -> Eithers.map (\t -> Paths.SubtypeStepUnionField t) (DecodeModel.name cx input))),+ (Model.Name "wrapBody", (\input -> Eithers.map (\t -> Paths.SubtypeStepWrapBody) (ExtractModel.decodeUnit cx input)))]+ in (Optionals.match (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [+ "no such field ",+ (Model.unName fname),+ " in union"]))) (\f -> f fterm))+ _ -> Left (Errors.DecodingError "expected union")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.paths.TermAttributeLink+termAttributeLink :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Paths.TermAttributeLink+termAttributeLink cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermInject v0 ->+ let field = Model.injectionField v0+ fname = Model.fieldName field+ fterm = Model.fieldTerm field+ variantMap =+ Maps.fromList [+ (+ Model.Name "casesTypeName",+ (\input -> Eithers.map (\t -> Paths.TermAttributeLinkCasesTypeName t) (DecodeModel.name cx input))),+ (+ Model.Name "injectTypeName",+ (\input -> Eithers.map (\t -> Paths.TermAttributeLinkInjectTypeName t) (DecodeModel.name cx input))),+ (+ Model.Name "lambdaDomainGiven",+ (\input -> Eithers.map (\t -> Paths.TermAttributeLinkLambdaDomainGiven t) (DecodeModel.type_ cx input))),+ (+ Model.Name "lambdaParameter",+ (\input -> Eithers.map (\t -> Paths.TermAttributeLinkLambdaParameter t) (DecodeModel.name cx input))),+ (+ Model.Name "letBindingTypeSchemeGiven",+ (\input -> Eithers.map (\t -> Paths.TermAttributeLinkLetBindingTypeSchemeGiven t) (ExtractModel.decodePair DecodeModel.name DecodeModel.typeScheme cx input))),+ (Model.Name "literal", (\input -> Eithers.map (\t -> Paths.TermAttributeLinkLiteral t) (DecodeModel.literal cx input))),+ (+ Model.Name "projectFieldName",+ (\input -> Eithers.map (\t -> Paths.TermAttributeLinkProjectFieldName t) (DecodeModel.name cx input))),+ (+ Model.Name "projectTypeName",+ (\input -> Eithers.map (\t -> Paths.TermAttributeLinkProjectTypeName t) (DecodeModel.name cx input))),+ (+ Model.Name "recordTypeName",+ (\input -> Eithers.map (\t -> Paths.TermAttributeLinkRecordTypeName t) (DecodeModel.name cx input))),+ (+ Model.Name "typeApplicationType",+ (\input -> Eithers.map (\t -> Paths.TermAttributeLinkTypeApplicationType t) (DecodeModel.type_ cx input))),+ (+ Model.Name "typeLambdaParameter",+ (\input -> Eithers.map (\t -> Paths.TermAttributeLinkTypeLambdaParameter t) (DecodeModel.name cx input))),+ (+ Model.Name "unwrapTypeName",+ (\input -> Eithers.map (\t -> Paths.TermAttributeLinkUnwrapTypeName t) (DecodeModel.name cx input))),+ (+ Model.Name "wrapTypeName",+ (\input -> Eithers.map (\t -> Paths.TermAttributeLinkWrapTypeName t) (DecodeModel.name cx input)))]+ in (Optionals.match (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [+ "no such field ",+ (Model.unName fname),+ " in union"]))) (\f -> f fterm))+ _ -> Left (Errors.DecodingError "expected union")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.paths.TermGraph+termGraph :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Paths.TermGraph+termGraph cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "roots" (ExtractModel.decodeMap DecodeModel.name termNode) fieldMap cx) (\field_roots -> Right (Paths.TermGraph {+ Paths.termGraphRoots = field_roots})))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.paths.TermGraph")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.paths.TermLink+termLink :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Paths.TermLink+termLink cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermInject v0 ->+ let field = Model.injectionField v0+ fname = Model.fieldName field+ fterm = Model.fieldTerm field+ variantMap =+ Maps.fromList [+ (Model.Name "attribute", (\input -> Eithers.map (\t -> Paths.TermLinkAttribute t) (termAttributeLink cx input))),+ (Model.Name "reference", (\input -> Eithers.map (\t -> Paths.TermLinkReference t) (termReferenceLink cx input))),+ (Model.Name "subterm", (\input -> Eithers.map (\t -> Paths.TermLinkSubterm t) (subtermLink cx input)))]+ in (Optionals.match (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [+ "no such field ",+ (Model.unName fname),+ " in union"]))) (\f -> f fterm))+ _ -> Left (Errors.DecodingError "expected union")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.paths.TermNode+termNode :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Paths.TermNode+termNode cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "term" DecodeModel.term fieldMap cx) (\field_term -> Eithers.bind (ExtractModel.requireField "type" DecodeModel.type_ fieldMap cx) (\field_type -> Eithers.bind (ExtractModel.requireField "links" (ExtractModel.decodeList termLink) fieldMap cx) (\field_links -> Right (Paths.TermNode {+ Paths.termNodeTerm = field_term,+ Paths.termNodeType = field_type,+ Paths.termNodeLinks = field_links})))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.paths.TermNode")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.paths.TermNodeId+termNodeId :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Paths.TermNodeId+termNodeId cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "root" DecodeModel.name fieldMap cx) (\field_root -> Eithers.bind (ExtractModel.requireField "path" subtermPath fieldMap cx) (\field_path -> Right (Paths.TermNodeId {+ Paths.termNodeIdRoot = field_root,+ Paths.termNodeIdPath = field_path}))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.paths.TermNodeId")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.paths.TermReference+termReference :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Paths.TermReference+termReference cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermInject v0 ->+ let field = Model.injectionField v0+ fname = Model.fieldName field+ fterm = Model.fieldTerm field+ variantMap =+ Maps.fromList [+ (Model.Name "lambda", (\input -> Eithers.map (\t -> Paths.TermReferenceLambda t) (lambdaVariableReference cx input))),+ (Model.Name "let", (\input -> Eithers.map (\t -> Paths.TermReferenceLet t) (letVariableReference cx input))),+ (Model.Name "primitive", (\input -> Eithers.map (\t -> Paths.TermReferencePrimitive t) (primitiveReference cx input)))]+ in (Optionals.match (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [+ "no such field ",+ (Model.unName fname),+ " in union"]))) (\f -> f fterm))+ _ -> Left (Errors.DecodingError "expected union")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.paths.TermReferenceLink+termReferenceLink :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Paths.TermReferenceLink+termReferenceLink cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "step" subtermStep fieldMap cx) (\field_step -> Eithers.bind (ExtractModel.requireField "target" termReference fieldMap cx) (\field_target -> Right (Paths.TermReferenceLink {+ Paths.termReferenceLinkStep = field_step,+ Paths.termReferenceLinkTarget = field_target}))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.paths.TermReferenceLink")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.paths.TypeAttributeLink+typeAttributeLink :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Paths.TypeAttributeLink+typeAttributeLink cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermInject v0 ->+ let field = Model.injectionField v0+ fname = Model.fieldName field+ fterm = Model.fieldTerm field+ variantMap =+ Maps.fromList [+ (+ Model.Name "annotatedAnnotation",+ (\input -> Eithers.map (\t -> Paths.TypeAttributeLinkAnnotatedAnnotation t) (DecodeModel.term cx input))),+ (+ Model.Name "forallParameter",+ (\input -> Eithers.map (\t -> Paths.TypeAttributeLinkForallParameter t) (DecodeModel.name cx input))),+ (+ Model.Name "literal",+ (\input -> Eithers.map (\t -> Paths.TypeAttributeLinkLiteral t) (DecodeModel.literalType cx input)))]+ in (Optionals.match (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [+ "no such field ",+ (Model.unName fname),+ " in union"]))) (\f -> f fterm))+ _ -> Left (Errors.DecodingError "expected union")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.paths.TypeGraph+typeGraph :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Paths.TypeGraph+typeGraph cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "roots" (ExtractModel.decodeMap DecodeModel.name typeNode) fieldMap cx) (\field_roots -> Right (Paths.TypeGraph {+ Paths.typeGraphRoots = field_roots})))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.paths.TypeGraph")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.paths.TypeLink+typeLink :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Paths.TypeLink+typeLink cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermInject v0 ->+ let field = Model.injectionField v0+ fname = Model.fieldName field+ fterm = Model.fieldTerm field+ variantMap =+ Maps.fromList [+ (Model.Name "attribute", (\input -> Eithers.map (\t -> Paths.TypeLinkAttribute t) (typeAttributeLink cx input))),+ (Model.Name "reference", (\input -> Eithers.map (\t -> Paths.TypeLinkReference t) (typeReferenceLink cx input))),+ (Model.Name "subtype", (\input -> Eithers.map (\t -> Paths.TypeLinkSubtype t) (subtypeLink cx input)))]+ in (Optionals.match (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [+ "no such field ",+ (Model.unName fname),+ " in union"]))) (\f -> f fterm))+ _ -> Left (Errors.DecodingError "expected union")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.paths.TypeNode+typeNode :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Paths.TypeNode+typeNode cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "type" DecodeModel.type_ fieldMap cx) (\field_type -> Eithers.bind (ExtractModel.requireField "links" (ExtractModel.decodeList typeLink) fieldMap cx) (\field_links -> Right (Paths.TypeNode {+ Paths.typeNodeType = field_type,+ Paths.typeNodeLinks = field_links}))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.paths.TypeNode")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.paths.TypeNodeId+typeNodeId :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Paths.TypeNodeId+typeNodeId cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "root" DecodeModel.name fieldMap cx) (\field_root -> Eithers.bind (ExtractModel.requireField "path" subtypePath fieldMap cx) (\field_path -> Right (Paths.TypeNodeId {+ Paths.typeNodeIdRoot = field_root,+ Paths.typeNodeIdPath = field_path}))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.paths.TypeNodeId")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.paths.TypeReference+typeReference :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Paths.TypeReference+typeReference cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermInject v0 ->+ let field = Model.injectionField v0+ fname = Model.fieldName field+ fterm = Model.fieldTerm field+ variantMap =+ Maps.fromList [+ (Model.Name "nominal", (\input -> Eithers.map (\t -> Paths.TypeReferenceNominal t) (nominalTypeReference cx input))),+ (Model.Name "variable", (\input -> Eithers.map (\t -> Paths.TypeReferenceVariable t) (typeVariableReference cx input)))]+ in (Optionals.match (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [+ "no such field ",+ (Model.unName fname),+ " in union"]))) (\f -> f fterm))+ _ -> Left (Errors.DecodingError "expected union")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.paths.TypeReferenceLink+typeReferenceLink :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Paths.TypeReferenceLink+typeReferenceLink cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "step" subtypeStep fieldMap cx) (\field_step -> Eithers.bind (ExtractModel.requireField "target" typeReference fieldMap cx) (\field_target -> Right (Paths.TypeReferenceLink {+ Paths.typeReferenceLinkStep = field_step,+ Paths.typeReferenceLinkTarget = field_target}))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.paths.TypeReferenceLink")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.paths.TypeVariableReference+typeVariableReference :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Paths.TypeVariableReference+typeVariableReference cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "variable" DecodeModel.name fieldMap cx) (\field_variable -> Eithers.bind (ExtractModel.requireField "boundByNode" typeNodeId fieldMap cx) (\field_boundByNode -> Right (Paths.TypeVariableReference {+ Paths.typeVariableReferenceVariable = field_variable,+ Paths.typeVariableReferenceBoundByNode = field_boundByNode}))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.paths.TypeVariableReference")) (ExtractModel.stripWithDecodingError cx raw)
@@ -0,0 +1,294 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Term decoders for hydra.core.query++module Hydra.Core.Decode.Query where++import qualified Hydra.Core.Decode.Model as DecodeModel+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.Extract.Model as ExtractModel+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Lexical as Lexical+import qualified Hydra.Core.Overlay.Haskell.Lib.Eithers as Eithers+import qualified Hydra.Core.Overlay.Haskell.Lib.Maps as Maps+import qualified Hydra.Core.Overlay.Haskell.Lib.Optionals as Optionals+import qualified Hydra.Core.Overlay.Haskell.Lib.Strings as Strings+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Query as Query+import qualified Hydra.Core.Rewriting as Rewriting+import qualified Hydra.Core.Util as Util+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | Decoder for hydra.core.query.ComparisonConstraint+comparisonConstraint :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Query.ComparisonConstraint+comparisonConstraint cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermInject v0 ->+ let field = Model.injectionField v0+ fname = Model.fieldName field+ fterm = Model.fieldTerm field+ variantMap =+ Maps.fromList [+ (Model.Name "equal", (\input -> Eithers.map (\t -> Query.ComparisonConstraintEqual) (ExtractModel.decodeUnit cx input))),+ (+ Model.Name "notEqual",+ (\input -> Eithers.map (\t -> Query.ComparisonConstraintNotEqual) (ExtractModel.decodeUnit cx input))),+ (+ Model.Name "lessThan",+ (\input -> Eithers.map (\t -> Query.ComparisonConstraintLessThan) (ExtractModel.decodeUnit cx input))),+ (+ Model.Name "greaterThan",+ (\input -> Eithers.map (\t -> Query.ComparisonConstraintGreaterThan) (ExtractModel.decodeUnit cx input))),+ (+ Model.Name "lessThanOrEqual",+ (\input -> Eithers.map (\t -> Query.ComparisonConstraintLessThanOrEqual) (ExtractModel.decodeUnit cx input))),+ (+ Model.Name "greaterThanOrEqual",+ (\input -> Eithers.map (\t -> Query.ComparisonConstraintGreaterThanOrEqual) (ExtractModel.decodeUnit cx input)))]+ in (Optionals.match (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [+ "no such field ",+ (Model.unName fname),+ " in union"]))) (\f -> f fterm))+ _ -> Left (Errors.DecodingError "expected union")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.query.Edge+edge :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Query.Edge+edge cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "type" DecodeModel.name fieldMap cx) (\field_type -> Eithers.bind (ExtractModel.requireField "out" (ExtractModel.decodeMaybe DecodeModel.name) fieldMap cx) (\field_out -> Eithers.bind (ExtractModel.requireField "in" (ExtractModel.decodeMaybe DecodeModel.name) fieldMap cx) (\field_in -> Right (Query.Edge {+ Query.edgeType = field_type,+ Query.edgeOut = field_out,+ Query.edgeIn = field_in})))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.query.Edge")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.query.GraphPattern+graphPattern :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Query.GraphPattern+graphPattern cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "graph" DecodeModel.name fieldMap cx) (\field_graph -> Eithers.bind (ExtractModel.requireField "patterns" (ExtractModel.decodeList pattern) fieldMap cx) (\field_patterns -> Right (Query.GraphPattern {+ Query.graphPatternGraph = field_graph,+ Query.graphPatternPatterns = field_patterns}))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.query.GraphPattern")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.query.Node+node :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Query.Node+node cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermInject v0 ->+ let field = Model.injectionField v0+ fname = Model.fieldName field+ fterm = Model.fieldTerm field+ variantMap =+ Maps.fromList [+ (Model.Name "term", (\input -> Eithers.map (\t -> Query.NodeTerm t) (DecodeModel.term cx input))),+ (Model.Name "variable", (\input -> Eithers.map (\t -> Query.NodeVariable t) (variable cx input))),+ (Model.Name "wildcard", (\input -> Eithers.map (\t -> Query.NodeWildcard) (ExtractModel.decodeUnit cx input)))]+ in (Optionals.match (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [+ "no such field ",+ (Model.unName fname),+ " in union"]))) (\f -> f fterm))+ _ -> Left (Errors.DecodingError "expected union")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.query.Path+path :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Query.Path+path cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermInject v0 ->+ let field = Model.injectionField v0+ fname = Model.fieldName field+ fterm = Model.fieldTerm field+ variantMap =+ Maps.fromList [+ (Model.Name "step", (\input -> Eithers.map (\t -> Query.PathStep t) (step cx input))),+ (Model.Name "regex", (\input -> Eithers.map (\t -> Query.PathRegex t) (regexSequence cx input))),+ (Model.Name "inverse", (\input -> Eithers.map (\t -> Query.PathInverse t) (path cx input)))]+ in (Optionals.match (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [+ "no such field ",+ (Model.unName fname),+ " in union"]))) (\f -> f fterm))+ _ -> Left (Errors.DecodingError "expected union")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.query.PathEquation+pathEquation :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Query.PathEquation+pathEquation cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "left" path fieldMap cx) (\field_left -> Eithers.bind (ExtractModel.requireField "right" path fieldMap cx) (\field_right -> Right (Query.PathEquation {+ Query.pathEquationLeft = field_left,+ Query.pathEquationRight = field_right}))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.query.PathEquation")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.query.Pattern+pattern :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Query.Pattern+pattern cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermInject v0 ->+ let field = Model.injectionField v0+ fname = Model.fieldName field+ fterm = Model.fieldTerm field+ variantMap =+ Maps.fromList [+ (Model.Name "triple", (\input -> Eithers.map (\t -> Query.PatternTriple t) (triplePattern cx input))),+ (Model.Name "negation", (\input -> Eithers.map (\t -> Query.PatternNegation t) (pattern cx input))),+ (+ Model.Name "conjunction",+ (\input -> Eithers.map (\t -> Query.PatternConjunction t) (ExtractModel.decodeList pattern cx input))),+ (+ Model.Name "disjunction",+ (\input -> Eithers.map (\t -> Query.PatternDisjunction t) (ExtractModel.decodeList pattern cx input))),+ (Model.Name "graph", (\input -> Eithers.map (\t -> Query.PatternGraph t) (graphPattern cx input)))]+ in (Optionals.match (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [+ "no such field ",+ (Model.unName fname),+ " in union"]))) (\f -> f fterm))+ _ -> Left (Errors.DecodingError "expected union")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.query.PatternImplication+patternImplication :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Query.PatternImplication+patternImplication cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "antecedent" pattern fieldMap cx) (\field_antecedent -> Eithers.bind (ExtractModel.requireField "consequent" pattern fieldMap cx) (\field_consequent -> Right (Query.PatternImplication {+ Query.patternImplicationAntecedent = field_antecedent,+ Query.patternImplicationConsequent = field_consequent}))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.query.PatternImplication")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.query.Query+query :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Query.Query+query cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "variables" (ExtractModel.decodeList variable) fieldMap cx) (\field_variables -> Eithers.bind (ExtractModel.requireField "patterns" (ExtractModel.decodeList pattern) fieldMap cx) (\field_patterns -> Right (Query.Query {+ Query.queryVariables = field_variables,+ Query.queryPatterns = field_patterns}))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.query.Query")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.query.Range+range :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Query.Range+range cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "min" (\cx2 -> \raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of+ Model.TermLiteral v1 -> case v1 of+ Model.LiteralInteger v2 -> case v2 of+ Model.IntegerValueInt32 v3 -> Right v3+ _ -> Left (Errors.DecodingError "expected int32 value")+ _ -> Left (Errors.DecodingError "expected int32 literal")+ _ -> Left (Errors.DecodingError "expected literal")) (ExtractModel.stripWithDecodingError cx2 raw2)) fieldMap cx) (\field_min -> Eithers.bind (ExtractModel.requireField "max" (\cx2 -> \raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of+ Model.TermLiteral v1 -> case v1 of+ Model.LiteralInteger v2 -> case v2 of+ Model.IntegerValueInt32 v3 -> Right v3+ _ -> Left (Errors.DecodingError "expected int32 value")+ _ -> Left (Errors.DecodingError "expected int32 literal")+ _ -> Left (Errors.DecodingError "expected literal")) (ExtractModel.stripWithDecodingError cx2 raw2)) fieldMap cx) (\field_max -> Right (Query.Range {+ Query.rangeMin = field_min,+ Query.rangeMax = field_max}))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.query.Range")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.query.RegexQuantifier+regexQuantifier :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Query.RegexQuantifier+regexQuantifier cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermInject v0 ->+ let field = Model.injectionField v0+ fname = Model.fieldName field+ fterm = Model.fieldTerm field+ variantMap =+ Maps.fromList [+ (Model.Name "one", (\input -> Eithers.map (\t -> Query.RegexQuantifierOne) (ExtractModel.decodeUnit cx input))),+ (+ Model.Name "zeroOrOne",+ (\input -> Eithers.map (\t -> Query.RegexQuantifierZeroOrOne) (ExtractModel.decodeUnit cx input))),+ (+ Model.Name "zeroOrMore",+ (\input -> Eithers.map (\t -> Query.RegexQuantifierZeroOrMore) (ExtractModel.decodeUnit cx input))),+ (+ Model.Name "oneOrMore",+ (\input -> Eithers.map (\t -> Query.RegexQuantifierOneOrMore) (ExtractModel.decodeUnit cx input))),+ (+ Model.Name "exactly",+ (\input -> Eithers.map (\t -> Query.RegexQuantifierExactly t) (Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of+ Model.TermLiteral v1 -> case v1 of+ Model.LiteralInteger v2 -> case v2 of+ Model.IntegerValueInt32 v3 -> Right v3+ _ -> Left (Errors.DecodingError "expected int32 value")+ _ -> Left (Errors.DecodingError "expected int32 literal")+ _ -> Left (Errors.DecodingError "expected literal")) (ExtractModel.stripWithDecodingError cx input)))),+ (+ Model.Name "atLeast",+ (\input -> Eithers.map (\t -> Query.RegexQuantifierAtLeast t) (Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of+ Model.TermLiteral v1 -> case v1 of+ Model.LiteralInteger v2 -> case v2 of+ Model.IntegerValueInt32 v3 -> Right v3+ _ -> Left (Errors.DecodingError "expected int32 value")+ _ -> Left (Errors.DecodingError "expected int32 literal")+ _ -> Left (Errors.DecodingError "expected literal")) (ExtractModel.stripWithDecodingError cx input)))),+ (Model.Name "range", (\input -> Eithers.map (\t -> Query.RegexQuantifierRange t) (range cx input)))]+ in (Optionals.match (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [+ "no such field ",+ (Model.unName fname),+ " in union"]))) (\f -> f fterm))+ _ -> Left (Errors.DecodingError "expected union")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.query.RegexSequence+regexSequence :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Query.RegexSequence+regexSequence cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "path" path fieldMap cx) (\field_path -> Eithers.bind (ExtractModel.requireField "quantifier" regexQuantifier fieldMap cx) (\field_quantifier -> Right (Query.RegexSequence {+ Query.regexSequencePath = field_path,+ Query.regexSequenceQuantifier = field_quantifier}))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.query.RegexSequence")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.query.Step+step :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Query.Step+step cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermInject v0 ->+ let field = Model.injectionField v0+ fname = Model.fieldName field+ fterm = Model.fieldTerm field+ variantMap =+ Maps.fromList [+ (Model.Name "edge", (\input -> Eithers.map (\t -> Query.StepEdge t) (edge cx input))),+ (Model.Name "project", (\input -> Eithers.map (\t -> Query.StepProject t) (DecodeModel.projection cx input))),+ (Model.Name "compare", (\input -> Eithers.map (\t -> Query.StepCompare t) (comparisonConstraint cx input)))]+ in (Optionals.match (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [+ "no such field ",+ (Model.unName fname),+ " in union"]))) (\f -> f fterm))+ _ -> Left (Errors.DecodingError "expected union")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.query.TriplePattern+triplePattern :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Query.TriplePattern+triplePattern cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "subject" node fieldMap cx) (\field_subject -> Eithers.bind (ExtractModel.requireField "predicate" path fieldMap cx) (\field_predicate -> Eithers.bind (ExtractModel.requireField "object" node fieldMap cx) (\field_object -> Right (Query.TriplePattern {+ Query.triplePatternSubject = field_subject,+ Query.triplePatternPredicate = field_predicate,+ Query.triplePatternObject = field_object})))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.query.TriplePattern")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.query.Variable+variable :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Query.Variable+variable cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermWrap v0 -> Eithers.map (\b -> Query.Variable b) ((\raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of+ Model.TermLiteral v1 -> case v1 of+ Model.LiteralString v2 -> Right v2+ _ -> Left (Errors.DecodingError "expected string literal")+ _ -> Left (Errors.DecodingError "expected literal")) (ExtractModel.stripWithDecodingError cx raw2)) (Model.wrappedTermBody v0))+ _ -> Left (Errors.DecodingError "expected wrapped type")) (ExtractModel.stripWithDecodingError cx raw)
@@ -0,0 +1,201 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Term decoders for hydra.core.regex++module Hydra.Core.Decode.Regex where++import qualified Hydra.Core.Decode.Model as DecodeModel+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.Extract.Model as ExtractModel+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Lexical as Lexical+import qualified Hydra.Core.Overlay.Haskell.Lib.Eithers as Eithers+import qualified Hydra.Core.Overlay.Haskell.Lib.Maps as Maps+import qualified Hydra.Core.Overlay.Haskell.Lib.Optionals as Optionals+import qualified Hydra.Core.Overlay.Haskell.Lib.Strings as Strings+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Regex as Regex+import qualified Hydra.Core.Rewriting as Rewriting+import qualified Hydra.Core.Util as Util+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | Decoder for hydra.core.regex.Alternation+alternation :: Graph.Graph -> Model.Term -> Either Errors.DecodingError [Regex.RegexSequence]+alternation = ExtractModel.decodeList regexSequence++-- | Decoder for hydra.core.regex.Atom+atom :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Regex.Atom+atom cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermInject v0 ->+ let field = Model.injectionField v0+ fname = Model.fieldName field+ fterm = Model.fieldTerm field+ variantMap =+ Maps.fromList [+ (+ Model.Name "literal",+ (\input -> Eithers.map (\t -> Regex.AtomLiteral t) (Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of+ Model.TermLiteral v1 -> case v1 of+ Model.LiteralInteger v2 -> case v2 of+ Model.IntegerValueInt32 v3 -> Right v3+ _ -> Left (Errors.DecodingError "expected int32 value")+ _ -> Left (Errors.DecodingError "expected int32 literal")+ _ -> Left (Errors.DecodingError "expected literal")) (ExtractModel.stripWithDecodingError cx input)))),+ (Model.Name "any", (\input -> Eithers.map (\t -> Regex.AtomAny) (ExtractModel.decodeUnit cx input))),+ (Model.Name "anchorStart", (\input -> Eithers.map (\t -> Regex.AtomAnchorStart) (ExtractModel.decodeUnit cx input))),+ (Model.Name "anchorEnd", (\input -> Eithers.map (\t -> Regex.AtomAnchorEnd) (ExtractModel.decodeUnit cx input))),+ (Model.Name "group", (\input -> Eithers.map (\t -> Regex.AtomGroup t) (alternation cx input))),+ (Model.Name "class", (\input -> Eithers.map (\t -> Regex.AtomClass t) (characterClass cx input)))]+ in (Optionals.match (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [+ "no such field ",+ (Model.unName fname),+ " in union"]))) (\f -> f fterm))+ _ -> Left (Errors.DecodingError "expected union")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.regex.CharacterClass+characterClass :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Regex.CharacterClass+characterClass cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "negated" (\cx2 -> \raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of+ Model.TermLiteral v1 -> case v1 of+ Model.LiteralBoolean v2 -> Right v2+ _ -> Left (Errors.DecodingError "expected boolean literal")+ _ -> Left (Errors.DecodingError "expected literal")) (ExtractModel.stripWithDecodingError cx2 raw2)) fieldMap cx) (\field_negated -> Eithers.bind (ExtractModel.requireField "items" (ExtractModel.decodeList classItem) fieldMap cx) (\field_items -> Right (Regex.CharacterClass {+ Regex.characterClassNegated = field_negated,+ Regex.characterClassItems = field_items}))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.regex.CharacterClass")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.regex.CharacterRange+characterRange :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Regex.CharacterRange+characterRange cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "from" (\cx2 -> \raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of+ Model.TermLiteral v1 -> case v1 of+ Model.LiteralInteger v2 -> case v2 of+ Model.IntegerValueInt32 v3 -> Right v3+ _ -> Left (Errors.DecodingError "expected int32 value")+ _ -> Left (Errors.DecodingError "expected int32 literal")+ _ -> Left (Errors.DecodingError "expected literal")) (ExtractModel.stripWithDecodingError cx2 raw2)) fieldMap cx) (\field_from -> Eithers.bind (ExtractModel.requireField "to" (\cx2 -> \raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of+ Model.TermLiteral v1 -> case v1 of+ Model.LiteralInteger v2 -> case v2 of+ Model.IntegerValueInt32 v3 -> Right v3+ _ -> Left (Errors.DecodingError "expected int32 value")+ _ -> Left (Errors.DecodingError "expected int32 literal")+ _ -> Left (Errors.DecodingError "expected literal")) (ExtractModel.stripWithDecodingError cx2 raw2)) fieldMap cx) (\field_to -> Right (Regex.CharacterRange {+ Regex.characterRangeFrom = field_from,+ Regex.characterRangeTo = field_to}))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.regex.CharacterRange")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.regex.ClassItem+classItem :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Regex.ClassItem+classItem cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermInject v0 ->+ let field = Model.injectionField v0+ fname = Model.fieldName field+ fterm = Model.fieldTerm field+ variantMap =+ Maps.fromList [+ (+ Model.Name "character",+ (\input -> Eithers.map (\t -> Regex.ClassItemCharacter t) (Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of+ Model.TermLiteral v1 -> case v1 of+ Model.LiteralInteger v2 -> case v2 of+ Model.IntegerValueInt32 v3 -> Right v3+ _ -> Left (Errors.DecodingError "expected int32 value")+ _ -> Left (Errors.DecodingError "expected int32 literal")+ _ -> Left (Errors.DecodingError "expected literal")) (ExtractModel.stripWithDecodingError cx input)))),+ (Model.Name "range", (\input -> Eithers.map (\t -> Regex.ClassItemRange t) (characterRange cx input)))]+ in (Optionals.match (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [+ "no such field ",+ (Model.unName fname),+ " in union"]))) (\f -> f fterm))+ _ -> Left (Errors.DecodingError "expected union")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.regex.Quantified+quantified :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Regex.Quantified+quantified cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "atom" atom fieldMap cx) (\field_atom -> Eithers.bind (ExtractModel.requireField "quantifier" quantifier fieldMap cx) (\field_quantifier -> Right (Regex.Quantified {+ Regex.quantifiedAtom = field_atom,+ Regex.quantifiedQuantifier = field_quantifier}))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.regex.Quantified")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.regex.Quantifier+quantifier :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Regex.Quantifier+quantifier cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermInject v0 ->+ let field = Model.injectionField v0+ fname = Model.fieldName field+ fterm = Model.fieldTerm field+ variantMap =+ Maps.fromList [+ (Model.Name "one", (\input -> Eithers.map (\t -> Regex.QuantifierOne) (ExtractModel.decodeUnit cx input))),+ (Model.Name "zeroOrOne", (\input -> Eithers.map (\t -> Regex.QuantifierZeroOrOne) (ExtractModel.decodeUnit cx input))),+ (Model.Name "zeroOrMore", (\input -> Eithers.map (\t -> Regex.QuantifierZeroOrMore) (ExtractModel.decodeUnit cx input))),+ (Model.Name "oneOrMore", (\input -> Eithers.map (\t -> Regex.QuantifierOneOrMore) (ExtractModel.decodeUnit cx input))),+ (+ Model.Name "exactly",+ (\input -> Eithers.map (\t -> Regex.QuantifierExactly t) (Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of+ Model.TermLiteral v1 -> case v1 of+ Model.LiteralInteger v2 -> case v2 of+ Model.IntegerValueInt32 v3 -> Right v3+ _ -> Left (Errors.DecodingError "expected int32 value")+ _ -> Left (Errors.DecodingError "expected int32 literal")+ _ -> Left (Errors.DecodingError "expected literal")) (ExtractModel.stripWithDecodingError cx input)))),+ (+ Model.Name "atLeast",+ (\input -> Eithers.map (\t -> Regex.QuantifierAtLeast t) (Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of+ Model.TermLiteral v1 -> case v1 of+ Model.LiteralInteger v2 -> case v2 of+ Model.IntegerValueInt32 v3 -> Right v3+ _ -> Left (Errors.DecodingError "expected int32 value")+ _ -> Left (Errors.DecodingError "expected int32 literal")+ _ -> Left (Errors.DecodingError "expected literal")) (ExtractModel.stripWithDecodingError cx input)))),+ (Model.Name "range", (\input -> Eithers.map (\t -> Regex.QuantifierRange_ t) (quantifierRange cx input)))]+ in (Optionals.match (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [+ "no such field ",+ (Model.unName fname),+ " in union"]))) (\f -> f fterm))+ _ -> Left (Errors.DecodingError "expected union")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.regex.QuantifierRange+quantifierRange :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Regex.QuantifierRange+quantifierRange cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "min" (\cx2 -> \raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of+ Model.TermLiteral v1 -> case v1 of+ Model.LiteralInteger v2 -> case v2 of+ Model.IntegerValueInt32 v3 -> Right v3+ _ -> Left (Errors.DecodingError "expected int32 value")+ _ -> Left (Errors.DecodingError "expected int32 literal")+ _ -> Left (Errors.DecodingError "expected literal")) (ExtractModel.stripWithDecodingError cx2 raw2)) fieldMap cx) (\field_min -> Eithers.bind (ExtractModel.requireField "max" (\cx2 -> \raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of+ Model.TermLiteral v1 -> case v1 of+ Model.LiteralInteger v2 -> case v2 of+ Model.IntegerValueInt32 v3 -> Right v3+ _ -> Left (Errors.DecodingError "expected int32 value")+ _ -> Left (Errors.DecodingError "expected int32 literal")+ _ -> Left (Errors.DecodingError "expected literal")) (ExtractModel.stripWithDecodingError cx2 raw2)) fieldMap cx) (\field_max -> Right (Regex.QuantifierRange {+ Regex.quantifierRangeMin = field_min,+ Regex.quantifierRangeMax = field_max}))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.regex.QuantifierRange")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.regex.Regex+regex :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Regex.Alternation+regex = alternation++-- | Decoder for hydra.core.regex.RegexSequence+regexSequence :: Graph.Graph -> Model.Term -> Either Errors.DecodingError [Regex.Quantified]+regexSequence = ExtractModel.decodeList quantified
@@ -0,0 +1,104 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Term decoders for hydra.core.relational++module Hydra.Core.Decode.Relational where++import qualified Hydra.Core.Decode.Model as DecodeModel+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.Extract.Model as ExtractModel+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Lexical as Lexical+import qualified Hydra.Core.Overlay.Haskell.Lib.Eithers as Eithers+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Relational as Relational+import qualified Hydra.Core.Rewriting as Rewriting+import qualified Hydra.Core.Util as Util+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | Decoder for hydra.core.relational.ColumnName+columnName :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Relational.ColumnName+columnName cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermWrap v0 -> Eithers.map (\b -> Relational.ColumnName b) ((\raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of+ Model.TermLiteral v1 -> case v1 of+ Model.LiteralString v2 -> Right v2+ _ -> Left (Errors.DecodingError "expected string literal")+ _ -> Left (Errors.DecodingError "expected literal")) (ExtractModel.stripWithDecodingError cx raw2)) (Model.wrappedTermBody v0))+ _ -> Left (Errors.DecodingError "expected wrapped type")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.relational.ColumnSchema+columnSchema :: (Graph.Graph -> Model.Term -> Either Errors.DecodingError t) -> Graph.Graph -> Model.Term -> Either Errors.DecodingError (Relational.ColumnSchema t)+columnSchema t cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "name" columnName fieldMap cx) (\field_name -> Eithers.bind (ExtractModel.requireField "domain" t fieldMap cx) (\field_domain -> Right (Relational.ColumnSchema {+ Relational.columnSchemaName = field_name,+ Relational.columnSchemaDomain = field_domain}))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.relational.ColumnSchema")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.relational.ForeignKey+foreignKey :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Relational.ForeignKey+foreignKey cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "foreignRelation" relationName fieldMap cx) (\field_foreignRelation -> Eithers.bind (ExtractModel.requireField "keys" (ExtractModel.decodeMap columnName columnName) fieldMap cx) (\field_keys -> Right (Relational.ForeignKey {+ Relational.foreignKeyForeignRelation = field_foreignRelation,+ Relational.foreignKeyKeys = field_keys}))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.relational.ForeignKey")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.relational.PrimaryKey+primaryKey :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Relational.PrimaryKey+primaryKey cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermWrap v0 -> Eithers.map (\b -> Relational.PrimaryKey b) (ExtractModel.decodeList columnName cx (Model.wrappedTermBody v0))+ _ -> Left (Errors.DecodingError "expected wrapped type")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.relational.Relation+relation :: (Graph.Graph -> Model.Term -> Either Errors.DecodingError v) -> Graph.Graph -> Model.Term -> Either Errors.DecodingError (Relational.Relation v)+relation v cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermWrap v0 -> Eithers.map (\b -> Relational.Relation b) (ExtractModel.decodeList (row v) cx (Model.wrappedTermBody v0))+ _ -> Left (Errors.DecodingError "expected wrapped type")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.relational.RelationName+relationName :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Relational.RelationName+relationName cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermWrap v0 -> Eithers.map (\b -> Relational.RelationName b) ((\raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of+ Model.TermLiteral v1 -> case v1 of+ Model.LiteralString v2 -> Right v2+ _ -> Left (Errors.DecodingError "expected string literal")+ _ -> Left (Errors.DecodingError "expected literal")) (ExtractModel.stripWithDecodingError cx raw2)) (Model.wrappedTermBody v0))+ _ -> Left (Errors.DecodingError "expected wrapped type")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.relational.RelationSchema+relationSchema :: (Graph.Graph -> Model.Term -> Either Errors.DecodingError t) -> Graph.Graph -> Model.Term -> Either Errors.DecodingError (Relational.RelationSchema t)+relationSchema t cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "name" relationName fieldMap cx) (\field_name -> Eithers.bind (ExtractModel.requireField "columns" (ExtractModel.decodeList (columnSchema t)) fieldMap cx) (\field_columns -> Eithers.bind (ExtractModel.requireField "primaryKeys" (ExtractModel.decodeList primaryKey) fieldMap cx) (\field_primaryKeys -> Eithers.bind (ExtractModel.requireField "foreignKeys" (ExtractModel.decodeList foreignKey) fieldMap cx) (\field_foreignKeys -> Right (Relational.RelationSchema {+ Relational.relationSchemaName = field_name,+ Relational.relationSchemaColumns = field_columns,+ Relational.relationSchemaPrimaryKeys = field_primaryKeys,+ Relational.relationSchemaForeignKeys = field_foreignKeys}))))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.relational.RelationSchema")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.relational.Relationship+relationship :: Ord v => ((Graph.Graph -> Model.Term -> Either Errors.DecodingError v) -> Graph.Graph -> Model.Term -> Either Errors.DecodingError (Relational.Relationship v))+relationship v cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermWrap v0 -> Eithers.map (\b -> Relational.Relationship b) (ExtractModel.decodeSet (ExtractModel.decodeMap columnName v) cx (Model.wrappedTermBody v0))+ _ -> Left (Errors.DecodingError "expected wrapped type")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.relational.Row+row :: (Graph.Graph -> Model.Term -> Either Errors.DecodingError v) -> Graph.Graph -> Model.Term -> Either Errors.DecodingError (Relational.Row v)+row v cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermWrap v0 -> Eithers.map (\b -> Relational.Row b) (ExtractModel.decodeList v cx (Model.wrappedTermBody v0))+ _ -> Left (Errors.DecodingError "expected wrapped type")) (ExtractModel.stripWithDecodingError cx raw)
@@ -0,0 +1,85 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Term decoders for hydra.core.system++module Hydra.Core.Decode.System where++import qualified Hydra.Core.Decode.File as File+import qualified Hydra.Core.Decode.Model as DecodeModel+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.Extract.Model as ExtractModel+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Lexical as Lexical+import qualified Hydra.Core.Overlay.Haskell.Lib.Eithers as Eithers+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Rewriting as Rewriting+import qualified Hydra.Core.System as System+import qualified Hydra.Core.Util as Util+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | Decoder for hydra.core.system.Command+command :: Graph.Graph -> Model.Term -> Either Errors.DecodingError System.Command+command cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "program" File.filePath fieldMap cx) (\field_program -> Eithers.bind (ExtractModel.requireField "arguments" (ExtractModel.decodeList (\cx2 -> \raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of+ Model.TermLiteral v1 -> case v1 of+ Model.LiteralString v2 -> Right v2+ _ -> Left (Errors.DecodingError "expected string literal")+ _ -> Left (Errors.DecodingError "expected literal")) (ExtractModel.stripWithDecodingError cx2 raw2))) fieldMap cx) (\field_arguments -> Eithers.bind (ExtractModel.requireField "workingDirectory" (ExtractModel.decodeMaybe File.filePath) fieldMap cx) (\field_workingDirectory -> Eithers.bind (ExtractModel.requireField "environment" (ExtractModel.decodeMaybe (ExtractModel.decodeMap environmentVariable (\cx2 -> \raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of+ Model.TermLiteral v1 -> case v1 of+ Model.LiteralString v2 -> Right v2+ _ -> Left (Errors.DecodingError "expected string literal")+ _ -> Left (Errors.DecodingError "expected literal")) (ExtractModel.stripWithDecodingError cx2 raw2)))) fieldMap cx) (\field_environment -> Right (System.Command {+ System.commandProgram = field_program,+ System.commandArguments = field_arguments,+ System.commandWorkingDirectory = field_workingDirectory,+ System.commandEnvironment = field_environment}))))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.system.Command")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.system.EnvironmentVariable+environmentVariable :: Graph.Graph -> Model.Term -> Either Errors.DecodingError System.EnvironmentVariable+environmentVariable cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermWrap v0 -> Eithers.map (\b -> System.EnvironmentVariable b) ((\raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of+ Model.TermLiteral v1 -> case v1 of+ Model.LiteralString v2 -> Right v2+ _ -> Left (Errors.DecodingError "expected string literal")+ _ -> Left (Errors.DecodingError "expected literal")) (ExtractModel.stripWithDecodingError cx raw2)) (Model.wrappedTermBody v0))+ _ -> Left (Errors.DecodingError "expected wrapped type")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.system.ProcessResult+processResult :: Graph.Graph -> Model.Term -> Either Errors.DecodingError System.ProcessResult+processResult cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "exitCode" statusCode fieldMap cx) (\field_exitCode -> Eithers.bind (ExtractModel.requireField "stdout" (\cx2 -> \raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of+ Model.TermLiteral v1 -> case v1 of+ Model.LiteralBinary v2 -> Right v2+ _ -> Left (Errors.DecodingError "expected binary literal")+ _ -> Left (Errors.DecodingError "expected literal")) (ExtractModel.stripWithDecodingError cx2 raw2)) fieldMap cx) (\field_stdout -> Eithers.bind (ExtractModel.requireField "stderr" (\cx2 -> \raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of+ Model.TermLiteral v1 -> case v1 of+ Model.LiteralBinary v2 -> Right v2+ _ -> Left (Errors.DecodingError "expected binary literal")+ _ -> Left (Errors.DecodingError "expected literal")) (ExtractModel.stripWithDecodingError cx2 raw2)) fieldMap cx) (\field_stderr -> Right (System.ProcessResult {+ System.processResultExitCode = field_exitCode,+ System.processResultStdout = field_stdout,+ System.processResultStderr = field_stderr})))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.system.ProcessResult")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.system.StatusCode+statusCode :: Graph.Graph -> Model.Term -> Either Errors.DecodingError System.StatusCode+statusCode cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermWrap v0 -> Eithers.map (\b -> System.StatusCode b) ((\raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of+ Model.TermLiteral v1 -> case v1 of+ Model.LiteralInteger v2 -> case v2 of+ Model.IntegerValueInt32 v3 -> Right v3+ _ -> Left (Errors.DecodingError "expected int32 value")+ _ -> Left (Errors.DecodingError "expected int32 literal")+ _ -> Left (Errors.DecodingError "expected literal")) (ExtractModel.stripWithDecodingError cx raw2)) (Model.wrappedTermBody v0))+ _ -> Left (Errors.DecodingError "expected wrapped type")) (ExtractModel.stripWithDecodingError cx raw)
@@ -0,0 +1,71 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Term decoders for hydra.core.tabular++module Hydra.Core.Decode.Tabular where++import qualified Hydra.Core.Decode.Model as DecodeModel+import qualified Hydra.Core.Decode.Relational as Relational+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.Extract.Model as ExtractModel+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Lexical as Lexical+import qualified Hydra.Core.Overlay.Haskell.Lib.Eithers as Eithers+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Rewriting as Rewriting+import qualified Hydra.Core.Tabular as Tabular+import qualified Hydra.Core.Util as Util+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | Decoder for hydra.core.tabular.ColumnType+columnType :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Tabular.ColumnType+columnType cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "name" Relational.columnName fieldMap cx) (\field_name -> Eithers.bind (ExtractModel.requireField "type" DecodeModel.type_ fieldMap cx) (\field_type -> Right (Tabular.ColumnType {+ Tabular.columnTypeName = field_name,+ Tabular.columnTypeType = field_type}))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.tabular.ColumnType")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.tabular.DataRow+dataRow :: (Graph.Graph -> Model.Term -> Either Errors.DecodingError v) -> Graph.Graph -> Model.Term -> Either Errors.DecodingError (Tabular.DataRow v)+dataRow v cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermWrap v0 -> Eithers.map (\b -> Tabular.DataRow b) (ExtractModel.decodeList (ExtractModel.decodeMaybe v) cx (Model.wrappedTermBody v0))+ _ -> Left (Errors.DecodingError "expected wrapped type")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.tabular.HeaderRow+headerRow :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Tabular.HeaderRow+headerRow cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermWrap v0 -> Eithers.map (\b -> Tabular.HeaderRow b) (ExtractModel.decodeList (\cx2 -> \raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of+ Model.TermLiteral v1 -> case v1 of+ Model.LiteralString v2 -> Right v2+ _ -> Left (Errors.DecodingError "expected string literal")+ _ -> Left (Errors.DecodingError "expected literal")) (ExtractModel.stripWithDecodingError cx2 raw2)) cx (Model.wrappedTermBody v0))+ _ -> Left (Errors.DecodingError "expected wrapped type")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.tabular.Table+table :: (Graph.Graph -> Model.Term -> Either Errors.DecodingError v) -> Graph.Graph -> Model.Term -> Either Errors.DecodingError (Tabular.Table v)+table v cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "header" (ExtractModel.decodeMaybe headerRow) fieldMap cx) (\field_header -> Eithers.bind (ExtractModel.requireField "data" (ExtractModel.decodeList (dataRow v)) fieldMap cx) (\field_data -> Right (Tabular.Table {+ Tabular.tableHeader = field_header,+ Tabular.tableData = field_data}))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.tabular.Table")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.tabular.TableType+tableType :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Tabular.TableType+tableType cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "name" Relational.relationName fieldMap cx) (\field_name -> Eithers.bind (ExtractModel.requireField "columns" (ExtractModel.decodeList columnType) fieldMap cx) (\field_columns -> Right (Tabular.TableType {+ Tabular.tableTypeName = field_name,+ Tabular.tableTypeColumns = field_columns}))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.tabular.TableType")) (ExtractModel.stripWithDecodingError cx raw)
@@ -0,0 +1,30 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Term decoders for hydra.core.testing++module Hydra.Core.Decode.Testing where++import qualified Hydra.Core.Decode.Model as DecodeModel+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.Extract.Model as ExtractModel+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Lexical as Lexical+import qualified Hydra.Core.Overlay.Haskell.Lib.Eithers as Eithers+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Rewriting as Rewriting+import qualified Hydra.Core.Testing as Testing+import qualified Hydra.Core.Util as Util+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | Decoder for hydra.core.testing.Tag+tag :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Testing.Tag+tag cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermWrap v0 -> Eithers.map (\b -> Testing.Tag b) ((\raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of+ Model.TermLiteral v1 -> case v1 of+ Model.LiteralString v2 -> Right v2+ _ -> Left (Errors.DecodingError "expected string literal")+ _ -> Left (Errors.DecodingError "expected literal")) (ExtractModel.stripWithDecodingError cx raw2)) (Model.wrappedTermBody v0))+ _ -> Left (Errors.DecodingError "expected wrapped type")) (ExtractModel.stripWithDecodingError cx raw)
@@ -0,0 +1,42 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Term decoders for hydra.core.time++module Hydra.Core.Decode.Time where++import qualified Hydra.Core.Decode.Model as DecodeModel+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.Extract.Model as ExtractModel+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Lexical as Lexical+import qualified Hydra.Core.Overlay.Haskell.Lib.Eithers as Eithers+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Rewriting as Rewriting+import qualified Hydra.Core.Time as Time+import qualified Hydra.Core.Util as Util+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | Decoder for hydra.core.time.Timespec+timespec :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Time.Timespec+timespec cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "seconds" (\cx2 -> \raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of+ Model.TermLiteral v1 -> case v1 of+ Model.LiteralInteger v2 -> case v2 of+ Model.IntegerValueInt64 v3 -> Right v3+ _ -> Left (Errors.DecodingError "expected int64 value")+ _ -> Left (Errors.DecodingError "expected int64 literal")+ _ -> Left (Errors.DecodingError "expected literal")) (ExtractModel.stripWithDecodingError cx2 raw2)) fieldMap cx) (\field_seconds -> Eithers.bind (ExtractModel.requireField "nanoseconds" (\cx2 -> \raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of+ Model.TermLiteral v1 -> case v1 of+ Model.LiteralInteger v2 -> case v2 of+ Model.IntegerValueUint32 v3 -> Right v3+ _ -> Left (Errors.DecodingError "expected uint32 value")+ _ -> Left (Errors.DecodingError "expected uint32 literal")+ _ -> Left (Errors.DecodingError "expected literal")) (ExtractModel.stripWithDecodingError cx2 raw2)) fieldMap cx) (\field_nanoseconds -> Right (Time.Timespec {+ Time.timespecSeconds = field_seconds,+ Time.timespecNanoseconds = field_nanoseconds}))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.time.Timespec")) (ExtractModel.stripWithDecodingError cx raw)
@@ -0,0 +1,68 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Term decoders for hydra.core.topology++module Hydra.Core.Decode.Topology where++import qualified Hydra.Core.Decode.Model as DecodeModel+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.Extract.Model as ExtractModel+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Lexical as Lexical+import qualified Hydra.Core.Overlay.Haskell.Lib.Eithers as Eithers+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Rewriting as Rewriting+import qualified Hydra.Core.Topology as Topology+import qualified Hydra.Core.Util as Util+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void+import qualified Data.Map as M++-- | Decoder for hydra.core.topology.Graph+graph :: Graph.Graph -> Model.Term -> Either Errors.DecodingError (M.Map Topology.Vertex [Topology.Vertex])+graph = ExtractModel.decodeMap vertex (ExtractModel.decodeList vertex)++-- | Decoder for hydra.core.topology.TarjanState+tarjanState :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Topology.TarjanState+tarjanState cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "counter" (\cx2 -> \raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of+ Model.TermLiteral v1 -> case v1 of+ Model.LiteralInteger v2 -> case v2 of+ Model.IntegerValueInt32 v3 -> Right v3+ _ -> Left (Errors.DecodingError "expected int32 value")+ _ -> Left (Errors.DecodingError "expected int32 literal")+ _ -> Left (Errors.DecodingError "expected literal")) (ExtractModel.stripWithDecodingError cx2 raw2)) fieldMap cx) (\field_counter -> Eithers.bind (ExtractModel.requireField "indices" (ExtractModel.decodeMap vertex (\cx2 -> \raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of+ Model.TermLiteral v1 -> case v1 of+ Model.LiteralInteger v2 -> case v2 of+ Model.IntegerValueInt32 v3 -> Right v3+ _ -> Left (Errors.DecodingError "expected int32 value")+ _ -> Left (Errors.DecodingError "expected int32 literal")+ _ -> Left (Errors.DecodingError "expected literal")) (ExtractModel.stripWithDecodingError cx2 raw2))) fieldMap cx) (\field_indices -> Eithers.bind (ExtractModel.requireField "lowLinks" (ExtractModel.decodeMap vertex (\cx2 -> \raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of+ Model.TermLiteral v1 -> case v1 of+ Model.LiteralInteger v2 -> case v2 of+ Model.IntegerValueInt32 v3 -> Right v3+ _ -> Left (Errors.DecodingError "expected int32 value")+ _ -> Left (Errors.DecodingError "expected int32 literal")+ _ -> Left (Errors.DecodingError "expected literal")) (ExtractModel.stripWithDecodingError cx2 raw2))) fieldMap cx) (\field_lowLinks -> Eithers.bind (ExtractModel.requireField "stack" (ExtractModel.decodeList vertex) fieldMap cx) (\field_stack -> Eithers.bind (ExtractModel.requireField "onStack" (ExtractModel.decodeSet vertex) fieldMap cx) (\field_onStack -> Eithers.bind (ExtractModel.requireField "sccs" (ExtractModel.decodeList (ExtractModel.decodeList vertex)) fieldMap cx) (\field_sccs -> Right (Topology.TarjanState {+ Topology.tarjanStateCounter = field_counter,+ Topology.tarjanStateIndices = field_indices,+ Topology.tarjanStateLowLinks = field_lowLinks,+ Topology.tarjanStateStack = field_stack,+ Topology.tarjanStateOnStack = field_onStack,+ Topology.tarjanStateSccs = field_sccs}))))))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.topology.TarjanState")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.topology.Vertex+vertex :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Int+vertex cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermLiteral v0 -> case v0 of+ Model.LiteralInteger v1 -> case v1 of+ Model.IntegerValueInt32 v2 -> Right v2+ _ -> Left (Errors.DecodingError "expected int32 value")+ _ -> Left (Errors.DecodingError "expected int32 literal")+ _ -> Left (Errors.DecodingError "expected literal")) (ExtractModel.stripWithDecodingError cx raw)
@@ -0,0 +1,55 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Term decoders for hydra.core.typed++module Hydra.Core.Decode.Typed where++import qualified Hydra.Core.Decode.Model as DecodeModel+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.Extract.Model as ExtractModel+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Lexical as Lexical+import qualified Hydra.Core.Overlay.Haskell.Lib.Eithers as Eithers+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Rewriting as Rewriting+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Util as Util+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | Decoder for hydra.core.typed.TypedBinding+typedBinding :: (Graph.Graph -> Model.Term -> Either Errors.DecodingError a) -> Graph.Graph -> Model.Term -> Either Errors.DecodingError (Typed.TypedBinding a)+typedBinding a cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "name" DecodeModel.name fieldMap cx) (\field_name -> Eithers.bind (ExtractModel.requireField "term" (typedTerm a) fieldMap cx) (\field_term -> Right (Typed.TypedBinding {+ Typed.typedBindingName = field_name,+ Typed.typedBindingTerm = field_term}))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.typed.TypedBinding")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.typed.TypedName+typedName :: (Graph.Graph -> Model.Term -> Either Errors.DecodingError a) -> Graph.Graph -> Model.Term -> Either Errors.DecodingError (Typed.TypedName a)+typedName a cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermWrap v0 -> Eithers.map (\b -> Typed.TypedName b) (DecodeModel.name cx (Model.wrappedTermBody v0))+ _ -> Left (Errors.DecodingError "expected wrapped type")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.typed.TypedTerm+typedTerm :: (Graph.Graph -> Model.Term -> Either Errors.DecodingError a) -> Graph.Graph -> Model.Term -> Either Errors.DecodingError (Typed.TypedTerm a)+typedTerm a cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermWrap v0 -> Eithers.map (\b -> Typed.TypedTerm b) (DecodeModel.term cx (Model.wrappedTermBody v0))+ _ -> Left (Errors.DecodingError "expected wrapped type")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.typed.TypedTermDefinition+typedTermDefinition :: (Graph.Graph -> Model.Term -> Either Errors.DecodingError a) -> Graph.Graph -> Model.Term -> Either Errors.DecodingError (Typed.TypedTermDefinition a)+typedTermDefinition a cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "name" DecodeModel.name fieldMap cx) (\field_name -> Eithers.bind (ExtractModel.requireField "term" (typedTerm a) fieldMap cx) (\field_term -> Right (Typed.TypedTermDefinition {+ Typed.typedTermDefinitionName = field_name,+ Typed.typedTermDefinitionTerm = field_term}))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.typed.TypedTermDefinition")) (ExtractModel.stripWithDecodingError cx raw)
@@ -0,0 +1,170 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Term decoders for hydra.core.typing++module Hydra.Core.Decode.Typing where++import qualified Hydra.Core.Decode.Model as DecodeModel+import qualified Hydra.Core.Decode.Paths as Paths+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.Extract.Model as ExtractModel+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Lexical as Lexical+import qualified Hydra.Core.Overlay.Haskell.Lib.Eithers as Eithers+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Rewriting as Rewriting+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Util as Util+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | Decoder for hydra.core.typing.FunctionStructure+functionStructure :: (Graph.Graph -> Model.Term -> Either Errors.DecodingError env) -> Graph.Graph -> Model.Term -> Either Errors.DecodingError (Typing.FunctionStructure env)+functionStructure env cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "typeParams" (ExtractModel.decodeList DecodeModel.name) fieldMap cx) (\field_typeParams -> Eithers.bind (ExtractModel.requireField "params" (ExtractModel.decodeList DecodeModel.name) fieldMap cx) (\field_params -> Eithers.bind (ExtractModel.requireField "bindings" (ExtractModel.decodeList DecodeModel.binding) fieldMap cx) (\field_bindings -> Eithers.bind (ExtractModel.requireField "body" DecodeModel.term fieldMap cx) (\field_body -> Eithers.bind (ExtractModel.requireField "domains" (ExtractModel.decodeList DecodeModel.type_) fieldMap cx) (\field_domains -> Eithers.bind (ExtractModel.requireField "codomain" (ExtractModel.decodeMaybe DecodeModel.type_) fieldMap cx) (\field_codomain -> Eithers.bind (ExtractModel.requireField "environment" env fieldMap cx) (\field_environment -> Right (Typing.FunctionStructure {+ Typing.functionStructureTypeParams = field_typeParams,+ Typing.functionStructureParams = field_params,+ Typing.functionStructureBindings = field_bindings,+ Typing.functionStructureBody = field_body,+ Typing.functionStructureDomains = field_domains,+ Typing.functionStructureCodomain = field_codomain,+ Typing.functionStructureEnvironment = field_environment})))))))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.typing.FunctionStructure")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.typing.InferenceContext+inferenceContext :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Typing.InferenceContext+inferenceContext cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "freshTypeVariableCount" (\cx2 -> \raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of+ Model.TermLiteral v1 -> case v1 of+ Model.LiteralInteger v2 -> case v2 of+ Model.IntegerValueInt32 v3 -> Right v3+ _ -> Left (Errors.DecodingError "expected int32 value")+ _ -> Left (Errors.DecodingError "expected int32 literal")+ _ -> Left (Errors.DecodingError "expected literal")) (ExtractModel.stripWithDecodingError cx2 raw2)) fieldMap cx) (\field_freshTypeVariableCount -> Eithers.bind (ExtractModel.requireField "trace" (ExtractModel.decodeList Paths.subtermStep) fieldMap cx) (\field_trace -> Right (Typing.InferenceContext {+ Typing.inferenceContextFreshTypeVariableCount = field_freshTypeVariableCount,+ Typing.inferenceContextTrace = field_trace}))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.typing.InferenceContext")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.typing.InferenceResult+inferenceResult :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Typing.InferenceResult+inferenceResult cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "term" DecodeModel.term fieldMap cx) (\field_term -> Eithers.bind (ExtractModel.requireField "type" DecodeModel.type_ fieldMap cx) (\field_type -> Eithers.bind (ExtractModel.requireField "subst" typeSubst fieldMap cx) (\field_subst -> Eithers.bind (ExtractModel.requireField "classConstraints" (ExtractModel.decodeMap DecodeModel.name DecodeModel.typeVariableConstraints) fieldMap cx) (\field_classConstraints -> Eithers.bind (ExtractModel.requireField "context" inferenceContext fieldMap cx) (\field_context -> Right (Typing.InferenceResult {+ Typing.inferenceResultTerm = field_term,+ Typing.inferenceResultType = field_type,+ Typing.inferenceResultSubst = field_subst,+ Typing.inferenceResultClassConstraints = field_classConstraints,+ Typing.inferenceResultContext = field_context})))))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.typing.InferenceResult")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.typing.Parameter+parameter :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Typing.Parameter+parameter cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "name" DecodeModel.name fieldMap cx) (\field_name -> Eithers.bind (ExtractModel.requireField "description" (ExtractModel.decodeMaybe (\cx2 -> \raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of+ Model.TermLiteral v1 -> case v1 of+ Model.LiteralString v2 -> Right v2+ _ -> Left (Errors.DecodingError "expected string literal")+ _ -> Left (Errors.DecodingError "expected literal")) (ExtractModel.stripWithDecodingError cx2 raw2))) fieldMap cx) (\field_description -> Eithers.bind (ExtractModel.requireField "type" DecodeModel.type_ fieldMap cx) (\field_type -> Eithers.bind (ExtractModel.requireField "isLazy" (\cx2 -> \raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of+ Model.TermLiteral v1 -> case v1 of+ Model.LiteralBoolean v2 -> Right v2+ _ -> Left (Errors.DecodingError "expected boolean literal")+ _ -> Left (Errors.DecodingError "expected literal")) (ExtractModel.stripWithDecodingError cx2 raw2)) fieldMap cx) (\field_isLazy -> Right (Typing.Parameter {+ Typing.parameterName = field_name,+ Typing.parameterDescription = field_description,+ Typing.parameterType = field_type,+ Typing.parameterIsLazy = field_isLazy}))))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.typing.Parameter")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.typing.Result+result :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Typing.Result+result cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "description" (ExtractModel.decodeMaybe (\cx2 -> \raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of+ Model.TermLiteral v1 -> case v1 of+ Model.LiteralString v2 -> Right v2+ _ -> Left (Errors.DecodingError "expected string literal")+ _ -> Left (Errors.DecodingError "expected literal")) (ExtractModel.stripWithDecodingError cx2 raw2))) fieldMap cx) (\field_description -> Eithers.bind (ExtractModel.requireField "type" DecodeModel.type_ fieldMap cx) (\field_type -> Right (Typing.Result {+ Typing.resultDescription = field_description,+ Typing.resultType = field_type}))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.typing.Result")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.typing.TermSignature+termSignature :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Typing.TermSignature+termSignature cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "typeParameters" (ExtractModel.decodeList typeParameter) fieldMap cx) (\field_typeParameters -> Eithers.bind (ExtractModel.requireField "parameters" (ExtractModel.decodeList parameter) fieldMap cx) (\field_parameters -> Eithers.bind (ExtractModel.requireField "result" result fieldMap cx) (\field_result -> Right (Typing.TermSignature {+ Typing.termSignatureTypeParameters = field_typeParameters,+ Typing.termSignatureParameters = field_parameters,+ Typing.termSignatureResult = field_result})))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.typing.TermSignature")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.typing.TermSubst+termSubst :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Typing.TermSubst+termSubst cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermWrap v0 -> Eithers.map (\b -> Typing.TermSubst b) (ExtractModel.decodeMap DecodeModel.name DecodeModel.term cx (Model.wrappedTermBody v0))+ _ -> Left (Errors.DecodingError "expected wrapped type")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.typing.TypeClass+typeClass :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Typing.TypeClass+typeClass cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "description" (\cx2 -> \raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of+ Model.TermLiteral v1 -> case v1 of+ Model.LiteralString v2 -> Right v2+ _ -> Left (Errors.DecodingError "expected string literal")+ _ -> Left (Errors.DecodingError "expected literal")) (ExtractModel.stripWithDecodingError cx2 raw2)) fieldMap cx) (\field_description -> Right (Typing.TypeClass {+ Typing.typeClassDescription = field_description})))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.typing.TypeClass")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.typing.TypeConstraint+typeConstraint :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Typing.TypeConstraint+typeConstraint cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "left" DecodeModel.type_ fieldMap cx) (\field_left -> Eithers.bind (ExtractModel.requireField "right" DecodeModel.type_ fieldMap cx) (\field_right -> Eithers.bind (ExtractModel.requireField "comment" (\cx2 -> \raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of+ Model.TermLiteral v1 -> case v1 of+ Model.LiteralString v2 -> Right v2+ _ -> Left (Errors.DecodingError "expected string literal")+ _ -> Left (Errors.DecodingError "expected literal")) (ExtractModel.stripWithDecodingError cx2 raw2)) fieldMap cx) (\field_comment -> Right (Typing.TypeConstraint {+ Typing.typeConstraintLeft = field_left,+ Typing.typeConstraintRight = field_right,+ Typing.typeConstraintComment = field_comment})))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.typing.TypeConstraint")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.typing.TypeParameter+typeParameter :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Typing.TypeParameter+typeParameter cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "name" DecodeModel.name fieldMap cx) (\field_name -> Eithers.bind (ExtractModel.requireField "constraints" (ExtractModel.decodeList DecodeModel.typeClassConstraint) fieldMap cx) (\field_constraints -> Right (Typing.TypeParameter {+ Typing.typeParameterName = field_name,+ Typing.typeParameterConstraints = field_constraints}))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.typing.TypeParameter")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.typing.TypeSubst+typeSubst :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Typing.TypeSubst+typeSubst cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermWrap v0 -> Eithers.map (\b -> Typing.TypeSubst b) (ExtractModel.decodeMap DecodeModel.name DecodeModel.type_ cx (Model.wrappedTermBody v0))+ _ -> Left (Errors.DecodingError "expected wrapped type")) (ExtractModel.stripWithDecodingError cx raw)
@@ -0,0 +1,120 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Term decoders for hydra.core.util++module Hydra.Core.Decode.Util where++import qualified Hydra.Core.Decode.Model as DecodeModel+import qualified Hydra.Core.Decode.Packaging as Packaging+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.Extract.Model as ExtractModel+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Lexical as Lexical+import qualified Hydra.Core.Overlay.Haskell.Lib.Eithers as Eithers+import qualified Hydra.Core.Overlay.Haskell.Lib.Maps as Maps+import qualified Hydra.Core.Overlay.Haskell.Lib.Optionals as Optionals+import qualified Hydra.Core.Overlay.Haskell.Lib.Strings as Strings+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Rewriting as Rewriting+import qualified Hydra.Core.Util as Util+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | Decoder for hydra.core.util.CaseConvention+caseConvention :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Util.CaseConvention+caseConvention cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermInject v0 ->+ let field = Model.injectionField v0+ fname = Model.fieldName field+ fterm = Model.fieldTerm field+ variantMap =+ Maps.fromList [+ (Model.Name "camel", (\input -> Eithers.map (\t -> Util.CaseConventionCamel) (ExtractModel.decodeUnit cx input))),+ (Model.Name "pascal", (\input -> Eithers.map (\t -> Util.CaseConventionPascal) (ExtractModel.decodeUnit cx input))),+ (+ Model.Name "lowerSnake",+ (\input -> Eithers.map (\t -> Util.CaseConventionLowerSnake) (ExtractModel.decodeUnit cx input))),+ (+ Model.Name "upperSnake",+ (\input -> Eithers.map (\t -> Util.CaseConventionUpperSnake) (ExtractModel.decodeUnit cx input))),+ (+ Model.Name "upperDashed",+ (\input -> Eithers.map (\t -> Util.CaseConventionUpperDashed) (ExtractModel.decodeUnit cx input)))]+ in (Optionals.match (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [+ "no such field ",+ (Model.unName fname),+ " in union"]))) (\f -> f fterm))+ _ -> Left (Errors.DecodingError "expected union")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.util.Comparison+comparison :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Util.Comparison+comparison cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermInject v0 ->+ let field = Model.injectionField v0+ fname = Model.fieldName field+ fterm = Model.fieldTerm field+ variantMap =+ Maps.fromList [+ (Model.Name "lessThan", (\input -> Eithers.map (\t -> Util.ComparisonLessThan) (ExtractModel.decodeUnit cx input))),+ (Model.Name "equalTo", (\input -> Eithers.map (\t -> Util.ComparisonEqualTo) (ExtractModel.decodeUnit cx input))),+ (Model.Name "greaterThan", (\input -> Eithers.map (\t -> Util.ComparisonGreaterThan) (ExtractModel.decodeUnit cx input)))]+ in (Optionals.match (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [+ "no such field ",+ (Model.unName fname),+ " in union"]))) (\f -> f fterm))+ _ -> Left (Errors.DecodingError "expected union")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.util.ModuleNames+moduleNames :: (Graph.Graph -> Model.Term -> Either Errors.DecodingError n) -> Graph.Graph -> Model.Term -> Either Errors.DecodingError (Util.ModuleNames n)+moduleNames n cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "focus" (ExtractModel.decodePair Packaging.moduleName n) fieldMap cx) (\field_focus -> Eithers.bind (ExtractModel.requireField "mapping" (ExtractModel.decodeMap Packaging.moduleName n) fieldMap cx) (\field_mapping -> Right (Util.ModuleNames {+ Util.moduleNamesFocus = field_focus,+ Util.moduleNamesMapping = field_mapping}))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.util.ModuleNames")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.util.Precision+precision :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Util.Precision+precision cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermInject v0 ->+ let field = Model.injectionField v0+ fname = Model.fieldName field+ fterm = Model.fieldTerm field+ variantMap =+ Maps.fromList [+ (Model.Name "arbitrary", (\input -> Eithers.map (\t -> Util.PrecisionArbitrary) (ExtractModel.decodeUnit cx input))),+ (+ Model.Name "bits",+ (\input -> Eithers.map (\t -> Util.PrecisionBits t) (Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of+ Model.TermLiteral v1 -> case v1 of+ Model.LiteralInteger v2 -> case v2 of+ Model.IntegerValueInt32 v3 -> Right v3+ _ -> Left (Errors.DecodingError "expected int32 value")+ _ -> Left (Errors.DecodingError "expected int32 literal")+ _ -> Left (Errors.DecodingError "expected literal")) (ExtractModel.stripWithDecodingError cx input))))]+ in (Optionals.match (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [+ "no such field ",+ (Model.unName fname),+ " in union"]))) (\f -> f fterm))+ _ -> Left (Errors.DecodingError "expected union")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.util.QualifiedName+qualifiedName :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Util.QualifiedName+qualifiedName cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "moduleName" (ExtractModel.decodeMaybe Packaging.moduleName) fieldMap cx) (\field_moduleName -> Eithers.bind (ExtractModel.requireField "local" (\cx2 -> \raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of+ Model.TermLiteral v1 -> case v1 of+ Model.LiteralString v2 -> Right v2+ _ -> Left (Errors.DecodingError "expected string literal")+ _ -> Left (Errors.DecodingError "expected literal")) (ExtractModel.stripWithDecodingError cx2 raw2)) fieldMap cx) (\field_local -> Right (Util.QualifiedName {+ Util.qualifiedNameModuleName = field_moduleName,+ Util.qualifiedNameLocal = field_local}))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.util.QualifiedName")) (ExtractModel.stripWithDecodingError cx raw)
@@ -0,0 +1,56 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Term decoders for hydra.core.validation++module Hydra.Core.Decode.Validation where++import qualified Hydra.Core.Decode.Error.Model as ErrorModel+import qualified Hydra.Core.Decode.Model as DecodeModel+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.Extract.Model as ExtractModel+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Lexical as Lexical+import qualified Hydra.Core.Overlay.Haskell.Lib.Eithers as Eithers+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Rewriting as Rewriting+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Validation as Validation+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | Decoder for hydra.core.validation.ValidationProfile+validationProfile :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Validation.ValidationProfile+validationProfile cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "errorRules" (ExtractModel.decodeSet DecodeModel.name) fieldMap cx) (\field_errorRules -> Eithers.bind (ExtractModel.requireField "warningRules" (ExtractModel.decodeSet DecodeModel.name) fieldMap cx) (\field_warningRules -> Eithers.bind (ExtractModel.requireField "maxErrors" (\cx2 -> \raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of+ Model.TermLiteral v1 -> case v1 of+ Model.LiteralInteger v2 -> case v2 of+ Model.IntegerValueInt32 v3 -> Right v3+ _ -> Left (Errors.DecodingError "expected int32 value")+ _ -> Left (Errors.DecodingError "expected int32 literal")+ _ -> Left (Errors.DecodingError "expected literal")) (ExtractModel.stripWithDecodingError cx2 raw2)) fieldMap cx) (\field_maxErrors -> Eithers.bind (ExtractModel.requireField "maxWarnings" (\cx2 -> \raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of+ Model.TermLiteral v1 -> case v1 of+ Model.LiteralInteger v2 -> case v2 of+ Model.IntegerValueInt32 v3 -> Right v3+ _ -> Left (Errors.DecodingError "expected int32 value")+ _ -> Left (Errors.DecodingError "expected int32 literal")+ _ -> Left (Errors.DecodingError "expected literal")) (ExtractModel.stripWithDecodingError cx2 raw2)) fieldMap cx) (\field_maxWarnings -> Right (Validation.ValidationProfile {+ Validation.validationProfileErrorRules = field_errorRules,+ Validation.validationProfileWarningRules = field_warningRules,+ Validation.validationProfileMaxErrors = field_maxErrors,+ Validation.validationProfileMaxWarnings = field_maxWarnings}))))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.validation.ValidationProfile")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.validation.ValidationResult+validationResult :: (Graph.Graph -> Model.Term -> Either Errors.DecodingError e) -> Graph.Graph -> Model.Term -> Either Errors.DecodingError (Validation.ValidationResult e)+validationResult e cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermRecord v0 ->+ let fieldMap = ExtractModel.toFieldMap v0+ in (Eithers.bind (ExtractModel.requireField "errors" (ExtractModel.decodeList e) fieldMap cx) (\field_errors -> Eithers.bind (ExtractModel.requireField "warnings" (ExtractModel.decodeList e) fieldMap cx) (\field_warnings -> Right (Validation.ValidationResult {+ Validation.validationResultErrors = field_errors,+ Validation.validationResultWarnings = field_warnings}))))+ _ -> Left (Errors.DecodingError "expected a record of type hydra.core.validation.ValidationResult")) (ExtractModel.stripWithDecodingError cx raw)
@@ -0,0 +1,123 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Term decoders for hydra.core.variants++module Hydra.Core.Decode.Variants where++import qualified Hydra.Core.Decode.Model as DecodeModel+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.Extract.Model as ExtractModel+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Lexical as Lexical+import qualified Hydra.Core.Overlay.Haskell.Lib.Eithers as Eithers+import qualified Hydra.Core.Overlay.Haskell.Lib.Maps as Maps+import qualified Hydra.Core.Overlay.Haskell.Lib.Optionals as Optionals+import qualified Hydra.Core.Overlay.Haskell.Lib.Strings as Strings+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Rewriting as Rewriting+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | Decoder for hydra.core.variants.LiteralVariant+literalVariant :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Variants.LiteralVariant+literalVariant cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermInject v0 ->+ let field = Model.injectionField v0+ fname = Model.fieldName field+ fterm = Model.fieldTerm field+ variantMap =+ Maps.fromList [+ (Model.Name "binary", (\input -> Eithers.map (\t -> Variants.LiteralVariantBinary) (ExtractModel.decodeUnit cx input))),+ (Model.Name "boolean", (\input -> Eithers.map (\t -> Variants.LiteralVariantBoolean) (ExtractModel.decodeUnit cx input))),+ (Model.Name "decimal", (\input -> Eithers.map (\t -> Variants.LiteralVariantDecimal) (ExtractModel.decodeUnit cx input))),+ (Model.Name "float", (\input -> Eithers.map (\t -> Variants.LiteralVariantFloat) (ExtractModel.decodeUnit cx input))),+ (Model.Name "integer", (\input -> Eithers.map (\t -> Variants.LiteralVariantInteger) (ExtractModel.decodeUnit cx input))),+ (Model.Name "string", (\input -> Eithers.map (\t -> Variants.LiteralVariantString) (ExtractModel.decodeUnit cx input)))]+ in (Optionals.match (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [+ "no such field ",+ (Model.unName fname),+ " in union"]))) (\f -> f fterm))+ _ -> Left (Errors.DecodingError "expected union")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.variants.TermVariant+termVariant :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Variants.TermVariant+termVariant cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermInject v0 ->+ let field = Model.injectionField v0+ fname = Model.fieldName field+ fterm = Model.fieldTerm field+ variantMap =+ Maps.fromList [+ (Model.Name "annotated", (\input -> Eithers.map (\t -> Variants.TermVariantAnnotated) (ExtractModel.decodeUnit cx input))),+ (+ Model.Name "application",+ (\input -> Eithers.map (\t -> Variants.TermVariantApplication) (ExtractModel.decodeUnit cx input))),+ (Model.Name "cases", (\input -> Eithers.map (\t -> Variants.TermVariantCases) (ExtractModel.decodeUnit cx input))),+ (Model.Name "either", (\input -> Eithers.map (\t -> Variants.TermVariantEither) (ExtractModel.decodeUnit cx input))),+ (Model.Name "inject", (\input -> Eithers.map (\t -> Variants.TermVariantInject) (ExtractModel.decodeUnit cx input))),+ (Model.Name "lambda", (\input -> Eithers.map (\t -> Variants.TermVariantLambda) (ExtractModel.decodeUnit cx input))),+ (Model.Name "let", (\input -> Eithers.map (\t -> Variants.TermVariantLet) (ExtractModel.decodeUnit cx input))),+ (Model.Name "list", (\input -> Eithers.map (\t -> Variants.TermVariantList) (ExtractModel.decodeUnit cx input))),+ (Model.Name "literal", (\input -> Eithers.map (\t -> Variants.TermVariantLiteral) (ExtractModel.decodeUnit cx input))),+ (Model.Name "map", (\input -> Eithers.map (\t -> Variants.TermVariantMap) (ExtractModel.decodeUnit cx input))),+ (Model.Name "optional", (\input -> Eithers.map (\t -> Variants.TermVariantOptional) (ExtractModel.decodeUnit cx input))),+ (Model.Name "pair", (\input -> Eithers.map (\t -> Variants.TermVariantPair) (ExtractModel.decodeUnit cx input))),+ (Model.Name "project", (\input -> Eithers.map (\t -> Variants.TermVariantProject) (ExtractModel.decodeUnit cx input))),+ (Model.Name "record", (\input -> Eithers.map (\t -> Variants.TermVariantRecord) (ExtractModel.decodeUnit cx input))),+ (Model.Name "set", (\input -> Eithers.map (\t -> Variants.TermVariantSet) (ExtractModel.decodeUnit cx input))),+ (+ Model.Name "typeApplication",+ (\input -> Eithers.map (\t -> Variants.TermVariantTypeApplication) (ExtractModel.decodeUnit cx input))),+ (+ Model.Name "typeLambda",+ (\input -> Eithers.map (\t -> Variants.TermVariantTypeLambda) (ExtractModel.decodeUnit cx input))),+ (Model.Name "unit", (\input -> Eithers.map (\t -> Variants.TermVariantUnit) (ExtractModel.decodeUnit cx input))),+ (Model.Name "unwrap", (\input -> Eithers.map (\t -> Variants.TermVariantUnwrap) (ExtractModel.decodeUnit cx input))),+ (Model.Name "variable", (\input -> Eithers.map (\t -> Variants.TermVariantVariable) (ExtractModel.decodeUnit cx input))),+ (Model.Name "wrap", (\input -> Eithers.map (\t -> Variants.TermVariantWrap) (ExtractModel.decodeUnit cx input)))]+ in (Optionals.match (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [+ "no such field ",+ (Model.unName fname),+ " in union"]))) (\f -> f fterm))+ _ -> Left (Errors.DecodingError "expected union")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.variants.TypeVariant+typeVariant :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Variants.TypeVariant+typeVariant cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermInject v0 ->+ let field = Model.injectionField v0+ fname = Model.fieldName field+ fterm = Model.fieldTerm field+ variantMap =+ Maps.fromList [+ (Model.Name "annotated", (\input -> Eithers.map (\t -> Variants.TypeVariantAnnotated) (ExtractModel.decodeUnit cx input))),+ (+ Model.Name "application",+ (\input -> Eithers.map (\t -> Variants.TypeVariantApplication) (ExtractModel.decodeUnit cx input))),+ (Model.Name "effect", (\input -> Eithers.map (\t -> Variants.TypeVariantEffect) (ExtractModel.decodeUnit cx input))),+ (Model.Name "either", (\input -> Eithers.map (\t -> Variants.TypeVariantEither) (ExtractModel.decodeUnit cx input))),+ (Model.Name "forall", (\input -> Eithers.map (\t -> Variants.TypeVariantForall) (ExtractModel.decodeUnit cx input))),+ (Model.Name "function", (\input -> Eithers.map (\t -> Variants.TypeVariantFunction) (ExtractModel.decodeUnit cx input))),+ (Model.Name "list", (\input -> Eithers.map (\t -> Variants.TypeVariantList) (ExtractModel.decodeUnit cx input))),+ (Model.Name "literal", (\input -> Eithers.map (\t -> Variants.TypeVariantLiteral) (ExtractModel.decodeUnit cx input))),+ (Model.Name "map", (\input -> Eithers.map (\t -> Variants.TypeVariantMap) (ExtractModel.decodeUnit cx input))),+ (Model.Name "optional", (\input -> Eithers.map (\t -> Variants.TypeVariantOptional) (ExtractModel.decodeUnit cx input))),+ (Model.Name "pair", (\input -> Eithers.map (\t -> Variants.TypeVariantPair) (ExtractModel.decodeUnit cx input))),+ (Model.Name "record", (\input -> Eithers.map (\t -> Variants.TypeVariantRecord) (ExtractModel.decodeUnit cx input))),+ (Model.Name "set", (\input -> Eithers.map (\t -> Variants.TypeVariantSet) (ExtractModel.decodeUnit cx input))),+ (Model.Name "union", (\input -> Eithers.map (\t -> Variants.TypeVariantUnion) (ExtractModel.decodeUnit cx input))),+ (Model.Name "unit", (\input -> Eithers.map (\t -> Variants.TypeVariantUnit) (ExtractModel.decodeUnit cx input))),+ (Model.Name "variable", (\input -> Eithers.map (\t -> Variants.TypeVariantVariable) (ExtractModel.decodeUnit cx input))),+ (Model.Name "void", (\input -> Eithers.map (\t -> Variants.TypeVariantVoid) (ExtractModel.decodeUnit cx input))),+ (Model.Name "wrap", (\input -> Eithers.map (\t -> Variants.TypeVariantWrap) (ExtractModel.decodeUnit cx input)))]+ in (Optionals.match (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [+ "no such field ",+ (Model.unName fname),+ " in union"]))) (\f -> f fterm))+ _ -> Left (Errors.DecodingError "expected union")) (ExtractModel.stripWithDecodingError cx raw)
@@ -0,0 +1,99 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Term decoders for hydra.core.yaml.model++module Hydra.Core.Decode.Yaml.Model where++import qualified Hydra.Core.Decode.Model as DecodeModel+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.Extract.Model as ExtractModel+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Lexical as Lexical+import qualified Hydra.Core.Overlay.Haskell.Lib.Eithers as Eithers+import qualified Hydra.Core.Overlay.Haskell.Lib.Maps as Maps+import qualified Hydra.Core.Overlay.Haskell.Lib.Optionals as Optionals+import qualified Hydra.Core.Overlay.Haskell.Lib.Strings as Strings+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Rewriting as Rewriting+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Yaml.Model as YamlModel+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | Decoder for hydra.core.yaml.model.Node+node :: Graph.Graph -> Model.Term -> Either Errors.DecodingError YamlModel.Node+node cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermInject v0 ->+ let field = Model.injectionField v0+ fname = Model.fieldName field+ fterm = Model.fieldTerm field+ variantMap =+ Maps.fromList [+ (+ Model.Name "mapping",+ (\input -> Eithers.map (\t -> YamlModel.NodeMapping t) (ExtractModel.decodeMap node node cx input))),+ (Model.Name "scalar", (\input -> Eithers.map (\t -> YamlModel.NodeScalar t) (scalar cx input))),+ (Model.Name "sequence", (\input -> Eithers.map (\t -> YamlModel.NodeSequence t) (ExtractModel.decodeList node cx input)))]+ in (Optionals.match (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [+ "no such field ",+ (Model.unName fname),+ " in union"]))) (\f -> f fterm))+ _ -> Left (Errors.DecodingError "expected union")) (ExtractModel.stripWithDecodingError cx raw)++-- | Decoder for hydra.core.yaml.model.Scalar+scalar :: Graph.Graph -> Model.Term -> Either Errors.DecodingError YamlModel.Scalar+scalar cx raw =+ Eithers.either (\err -> Left err) (\stripped -> case stripped of+ Model.TermInject v0 ->+ let field = Model.injectionField v0+ fname = Model.fieldName field+ fterm = Model.fieldTerm field+ variantMap =+ Maps.fromList [+ (+ Model.Name "bool",+ (\input -> Eithers.map (\t -> YamlModel.ScalarBool t) (Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of+ Model.TermLiteral v1 -> case v1 of+ Model.LiteralBoolean v2 -> Right v2+ _ -> Left (Errors.DecodingError "expected boolean literal")+ _ -> Left (Errors.DecodingError "expected literal")) (ExtractModel.stripWithDecodingError cx input)))),+ (+ Model.Name "decimal",+ (\input -> Eithers.map (\t -> YamlModel.ScalarDecimal t) (Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of+ Model.TermLiteral v1 -> case v1 of+ Model.LiteralDecimal v2 -> Right v2+ _ -> Left (Errors.DecodingError "expected decimal literal")+ _ -> Left (Errors.DecodingError "expected literal")) (ExtractModel.stripWithDecodingError cx input)))),+ (+ Model.Name "float",+ (\input -> Eithers.map (\t -> YamlModel.ScalarFloat t) (Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of+ Model.TermLiteral v1 -> case v1 of+ Model.LiteralFloat v2 -> case v2 of+ Model.FloatValueFloat64 v3 -> Right v3+ _ -> Left (Errors.DecodingError "expected float64 value")+ _ -> Left (Errors.DecodingError "expected float64 literal")+ _ -> Left (Errors.DecodingError "expected literal")) (ExtractModel.stripWithDecodingError cx input)))),+ (+ Model.Name "int",+ (\input -> Eithers.map (\t -> YamlModel.ScalarInt t) (Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of+ Model.TermLiteral v1 -> case v1 of+ Model.LiteralInteger v2 -> case v2 of+ Model.IntegerValueBigint v3 -> Right v3+ _ -> Left (Errors.DecodingError "expected bigint value")+ _ -> Left (Errors.DecodingError "expected bigint literal")+ _ -> Left (Errors.DecodingError "expected literal")) (ExtractModel.stripWithDecodingError cx input)))),+ (Model.Name "null", (\input -> Eithers.map (\t -> YamlModel.ScalarNull) (ExtractModel.decodeUnit cx input))),+ (+ Model.Name "str",+ (\input -> Eithers.map (\t -> YamlModel.ScalarStr t) (Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of+ Model.TermLiteral v1 -> case v1 of+ Model.LiteralString v2 -> Right v2+ _ -> Left (Errors.DecodingError "expected string literal")+ _ -> Left (Errors.DecodingError "expected literal")) (ExtractModel.stripWithDecodingError cx input))))]+ in (Optionals.match (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [+ "no such field ",+ (Model.unName fname),+ " in union"]))) (\f -> f fterm))+ _ -> Left (Errors.DecodingError "expected union")) (ExtractModel.stripWithDecodingError cx raw)
@@ -0,0 +1,2267 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Functions for generating term decoders from type modules++module Hydra.Core.Decoding where++import qualified Hydra.Core.Annotations as Annotations+import qualified Hydra.Core.Ast as Ast+import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Constants as Constants+import qualified Hydra.Core.Decode.Model as DecodeModel+import qualified Hydra.Core.Diff as Diff+import qualified Hydra.Core.Docs as Docs+import qualified Hydra.Core.Encode.Model as EncodeModel+import qualified Hydra.Core.Error.Checking as Checking+import qualified Hydra.Core.Error.File as ErrorFile+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Error.Packaging as ErrorPackaging+import qualified Hydra.Core.Error.System as ErrorSystem+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.Extract.Model as ExtractModel+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Formatting as Formatting+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Json.Model as JsonModel+import qualified Hydra.Core.Lexical as Lexical+import qualified Hydra.Core.Overlay.Haskell.Lib.Eithers as Eithers+import qualified Hydra.Core.Overlay.Haskell.Lib.Lists as Lists+import qualified Hydra.Core.Overlay.Haskell.Lib.Logic as Logic+import qualified Hydra.Core.Overlay.Haskell.Lib.Maps as Maps+import qualified Hydra.Core.Overlay.Haskell.Lib.Optionals as Optionals+import qualified Hydra.Core.Overlay.Haskell.Lib.Sets as Sets+import qualified Hydra.Core.Overlay.Haskell.Lib.Strings as Strings+import qualified Hydra.Core.Markdown as Markdown+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Names as Names+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Parsing as Parsing+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Predicates as Predicates+import qualified Hydra.Core.Print.Model as PrintModel+import qualified Hydra.Core.Query as Query+import qualified Hydra.Core.Regex as Regex+import qualified Hydra.Core.Relational as Relational+import qualified Hydra.Core.Rewriting as Rewriting+import qualified Hydra.Core.Scoping as Scoping+import qualified Hydra.Core.System as System+import qualified Hydra.Core.Tabular as Tabular+import qualified Hydra.Core.Testing as Testing+import qualified Hydra.Core.Time as Time+import qualified Hydra.Core.Topology as Topology+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Validation as Validation+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | Left-apply type-variable params to a base type in binder order (fixes param reversal)+applyForallParamsInOrder :: Model.Type -> [Model.Name] -> Model.Type+applyForallParamsInOrder base params =+ Lists.foldl (\acc -> \p -> Model.TypeApplication (Model.ApplicationType {+ Model.applicationTypeFunction = acc,+ Model.applicationTypeArgument = (Model.TypeVariable p)})) base params++-- | Collect forall type variable names from a type+collectForallVariables :: Model.Type -> [Model.Name]+collectForallVariables typ =+ case typ of+ Model.TypeAnnotated v0 -> collectForallVariables (Model.annotatedTypeBody v0)+ Model.TypeForall v0 -> Lists.cons (Model.forallTypeParameter v0) (collectForallVariables (Model.forallTypeBody v0))+ _ -> []++-- | Collect type variables needing Ord constraints (from Map key and Set element types)+collectOrdConstrainedVariables :: Model.Type -> [Model.Name]+collectOrdConstrainedVariables typ =+ case typ of+ Model.TypeAnnotated v0 -> collectOrdConstrainedVariables (Model.annotatedTypeBody v0)+ Model.TypeApplication v0 -> Lists.concat2 (collectOrdConstrainedVariables (Model.applicationTypeFunction v0)) (collectOrdConstrainedVariables (Model.applicationTypeArgument v0))+ Model.TypeEffect v0 -> collectOrdConstrainedVariables v0+ Model.TypeEither v0 -> Lists.concat2 (collectOrdConstrainedVariables (Model.eitherTypeLeft v0)) (collectOrdConstrainedVariables (Model.eitherTypeRight v0))+ Model.TypeForall v0 -> collectOrdConstrainedVariables (Model.forallTypeBody v0)+ Model.TypeList v0 -> collectOrdConstrainedVariables v0+ Model.TypeMap v0 -> Lists.concat [+ collectTypeVariablesFromType (Model.mapTypeKeys v0),+ (collectOrdConstrainedVariables (Model.mapTypeKeys v0)),+ (collectOrdConstrainedVariables (Model.mapTypeValues v0))]+ Model.TypeOptional v0 -> collectOrdConstrainedVariables v0+ Model.TypePair v0 -> Lists.concat2 (collectOrdConstrainedVariables (Model.pairTypeFirst v0)) (collectOrdConstrainedVariables (Model.pairTypeSecond v0))+ Model.TypeRecord v0 -> Lists.concat (Lists.map (\ft -> collectOrdConstrainedVariables (Model.fieldTypeType ft)) v0)+ Model.TypeSet v0 -> Lists.concat2 (collectTypeVariablesFromType v0) (collectOrdConstrainedVariables v0)+ Model.TypeUnion v0 -> Lists.concat (Lists.map (\ft -> collectOrdConstrainedVariables (Model.fieldTypeType ft)) v0)+ Model.TypeWrap v0 -> collectOrdConstrainedVariables v0+ _ -> []++-- | Collect type variable names from a type (forall parameters only)+collectTypeVariables :: Model.Type -> [Model.Name]+collectTypeVariables typ = collectForallVariables typ++-- | Collect all type variable names from a type expression+collectTypeVariablesFromType :: Model.Type -> [Model.Name]+collectTypeVariablesFromType typ =+ case typ of+ Model.TypeAnnotated v0 -> collectTypeVariablesFromType (Model.annotatedTypeBody v0)+ Model.TypeApplication v0 -> Lists.concat2 (collectTypeVariablesFromType (Model.applicationTypeFunction v0)) (collectTypeVariablesFromType (Model.applicationTypeArgument v0))+ Model.TypeEffect v0 -> collectTypeVariablesFromType v0+ Model.TypeEither v0 -> Lists.concat2 (collectTypeVariablesFromType (Model.eitherTypeLeft v0)) (collectTypeVariablesFromType (Model.eitherTypeRight v0))+ Model.TypeForall v0 -> collectTypeVariablesFromType (Model.forallTypeBody v0)+ Model.TypeList v0 -> collectTypeVariablesFromType v0+ Model.TypeMap v0 -> Lists.concat2 (collectTypeVariablesFromType (Model.mapTypeKeys v0)) (collectTypeVariablesFromType (Model.mapTypeValues v0))+ Model.TypeOptional v0 -> collectTypeVariablesFromType v0+ Model.TypePair v0 -> Lists.concat2 (collectTypeVariablesFromType (Model.pairTypeFirst v0)) (collectTypeVariablesFromType (Model.pairTypeSecond v0))+ Model.TypeRecord v0 -> Lists.concat (Lists.map (\ft -> collectTypeVariablesFromType (Model.fieldTypeType ft)) v0)+ Model.TypeSet v0 -> collectTypeVariablesFromType v0+ Model.TypeUnion v0 -> Lists.concat (Lists.map (\ft -> collectTypeVariablesFromType (Model.fieldTypeType ft)) v0)+ Model.TypeVariable v0 -> [+ v0]+ Model.TypeWrap v0 -> collectTypeVariablesFromType v0+ _ -> []++-- | Transform a type binding into a decoder binding+decodeBinding :: t0 -> Graph.Graph -> Model.Binding -> Either Errors.DecodingError Model.Binding+decodeBinding cx graph b =+ Eithers.bind (DecodeModel.type_ graph (Model.bindingTerm b)) (\typ ->+ let rtype = decoderFullResultTypeNamed (Model.bindingName b) typ+ rawBody = decodeTypeNamed (Model.bindingName b) typ rtype+ description =+ Strings.concat [+ "Decoder for ",+ (Model.unName (Model.bindingName b))]+ in (Right (Model.Binding {+ Model.bindingName = (decodeBindingName (Model.bindingName b)),+ Model.bindingTerm = (Annotations.setTermDescription (Just description) rawBody),+ Model.bindingTypeScheme = (Just (decoderTypeSchemeNamed (Model.bindingName b) typ))})))++-- | Generate a binding name for a decoder function from a type name+decodeBindingName :: Model.Name -> Model.Name+decodeBindingName = Names.derivedBindingName [+ "decode"] True++-- | Generate a decoder for an Either type+decodeEitherType :: Model.EitherType -> Model.Term+decodeEitherType et =++ let leftDecoder = decodeType (Model.eitherTypeLeft et)+ rightDecoder = decodeType (Model.eitherTypeRight et)+ in (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermVariable (Model.Name "hydra.core.extract.model.decodeEither")),+ Model.typeApplicationTermType = (decoderFullResultType (Model.eitherTypeLeft et))})),+ Model.typeApplicationTermType = (decoderFullResultType (Model.eitherTypeRight et))})),+ Model.applicationArgument = leftDecoder})),+ Model.applicationArgument = rightDecoder}))++-- | Generate a decoder for a polymorphic (forall) type+decodeForallType :: Model.ForallType -> Model.Term+decodeForallType ft =+ Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (decodeBindingName (Model.forallTypeParameter ft)),+ Model.lambdaDomain = (Just (Model.TypeFunction (Model.FunctionType {+ Model.functionTypeDomain = (Model.TypeVariable (Model.Name "hydra.core.graph.Graph")),+ Model.functionTypeCodomain = (Model.TypeFunction (Model.FunctionType {+ Model.functionTypeDomain = (Model.TypeVariable (Model.Name "hydra.core.model.Term")),+ Model.functionTypeCodomain = (Model.TypeEither (Model.EitherType {+ Model.eitherTypeLeft = (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError")),+ Model.eitherTypeRight = (Model.TypeVariable (Model.forallTypeParameter ft))}))}))}))),+ Model.lambdaBody = (decodeType (Model.forallTypeBody ft))})++-- | Generate a decoder for a list type+decodeListType :: Model.Type -> Model.Term+decodeListType elemType =++ let elemDecoder = decodeType elemType+ in (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermVariable (Model.Name "hydra.core.extract.model.decodeList")),+ Model.typeApplicationTermType = (decoderFullResultType elemType)})),+ Model.applicationArgument = elemDecoder}))++-- | Generate a decoder for a literal type+decodeLiteralType :: Model.LiteralType -> Model.Term+decodeLiteralType lt =+ case lt of+ Model.LiteralTypeBinary -> Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "cx"),+ Model.lambdaDomain = (Just (Model.TypeVariable (Model.Name "hydra.core.graph.Graph"))),+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "raw"),+ Model.lambdaDomain = (Just (Model.TypeVariable (Model.Name "hydra.core.model.Term"))),+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermVariable (Model.Name "hydra.core.lib.eithers.either")),+ Model.typeApplicationTermType = (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError"))})),+ Model.typeApplicationTermType = (Model.TypeVariable (Model.Name "hydra.core.model.Term"))})),+ Model.typeApplicationTermType = (Model.TypeEither (Model.EitherType {+ Model.eitherTypeLeft = (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError")),+ Model.eitherTypeRight = (Model.TypeLiteral Model.LiteralTypeBinary)}))})),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "err"),+ Model.lambdaDomain = (Just (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError"))),+ Model.lambdaBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermEither (Left (Model.TermVariable (Model.Name "err")))),+ Model.typeApplicationTermType = (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError"))})),+ Model.typeApplicationTermType = (Model.TypeLiteral Model.LiteralTypeBinary)}))}))})),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "stripped"),+ Model.lambdaDomain = (Just (Model.TypeVariable (Model.Name "hydra.core.model.Term"))),+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermCases (Model.CaseStatement {+ Model.caseStatementTypeName = (Model.Name "hydra.core.model.Term"),+ Model.caseStatementDefault = (Just (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermEither (Left (Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.Name "hydra.core.errors.DecodingError"),+ Model.wrappedTermBody = (Model.TermLiteral (Model.LiteralString "expected literal"))})))),+ Model.typeApplicationTermType = (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError"))})),+ Model.typeApplicationTermType = (Model.TypeLiteral Model.LiteralTypeBinary)}))),+ Model.caseStatementCases = [+ Model.CaseAlternative {+ Model.caseAlternativeName = (Model.Name "literal"),+ Model.caseAlternativeHandler = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "v"),+ Model.lambdaDomain = (Just (Model.TypeVariable (Model.Name "hydra.core.model.Literal"))),+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermCases (Model.CaseStatement {+ Model.caseStatementTypeName = (Model.Name "hydra.core.model.Literal"),+ Model.caseStatementDefault = (Just (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermEither (Left (Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.Name "hydra.core.errors.DecodingError"),+ Model.wrappedTermBody = (Model.TermLiteral (Model.LiteralString "expected binary literal"))})))),+ Model.typeApplicationTermType = (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError"))})),+ Model.typeApplicationTermType = (Model.TypeLiteral Model.LiteralTypeBinary)}))),+ Model.caseStatementCases = [+ Model.CaseAlternative {+ Model.caseAlternativeName = (Model.Name "binary"),+ Model.caseAlternativeHandler = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "b"),+ Model.lambdaDomain = (Just (Model.TypeLiteral Model.LiteralTypeBinary)),+ Model.lambdaBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermEither (Right (Model.TermVariable (Model.Name "b")))),+ Model.typeApplicationTermType = (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError"))})),+ Model.typeApplicationTermType = (Model.TypeLiteral Model.LiteralTypeBinary)}))}))}]})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "v"))}))}))}]})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "stripped"))}))}))})),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.extract.model.stripWithDecodingError")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "cx"))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "raw"))}))}))}))})+ Model.LiteralTypeBoolean -> Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "cx"),+ Model.lambdaDomain = (Just (Model.TypeVariable (Model.Name "hydra.core.graph.Graph"))),+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "raw"),+ Model.lambdaDomain = (Just (Model.TypeVariable (Model.Name "hydra.core.model.Term"))),+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermVariable (Model.Name "hydra.core.lib.eithers.either")),+ Model.typeApplicationTermType = (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError"))})),+ Model.typeApplicationTermType = (Model.TypeVariable (Model.Name "hydra.core.model.Term"))})),+ Model.typeApplicationTermType = (Model.TypeEither (Model.EitherType {+ Model.eitherTypeLeft = (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError")),+ Model.eitherTypeRight = (Model.TypeLiteral Model.LiteralTypeBoolean)}))})),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "err"),+ Model.lambdaDomain = (Just (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError"))),+ Model.lambdaBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermEither (Left (Model.TermVariable (Model.Name "err")))),+ Model.typeApplicationTermType = (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError"))})),+ Model.typeApplicationTermType = (Model.TypeLiteral Model.LiteralTypeBoolean)}))}))})),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "stripped"),+ Model.lambdaDomain = (Just (Model.TypeVariable (Model.Name "hydra.core.model.Term"))),+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermCases (Model.CaseStatement {+ Model.caseStatementTypeName = (Model.Name "hydra.core.model.Term"),+ Model.caseStatementDefault = (Just (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermEither (Left (Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.Name "hydra.core.errors.DecodingError"),+ Model.wrappedTermBody = (Model.TermLiteral (Model.LiteralString "expected literal"))})))),+ Model.typeApplicationTermType = (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError"))})),+ Model.typeApplicationTermType = (Model.TypeLiteral Model.LiteralTypeBoolean)}))),+ Model.caseStatementCases = [+ Model.CaseAlternative {+ Model.caseAlternativeName = (Model.Name "literal"),+ Model.caseAlternativeHandler = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "v"),+ Model.lambdaDomain = (Just (Model.TypeVariable (Model.Name "hydra.core.model.Literal"))),+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermCases (Model.CaseStatement {+ Model.caseStatementTypeName = (Model.Name "hydra.core.model.Literal"),+ Model.caseStatementDefault = (Just (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermEither (Left (Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.Name "hydra.core.errors.DecodingError"),+ Model.wrappedTermBody = (Model.TermLiteral (Model.LiteralString "expected boolean literal"))})))),+ Model.typeApplicationTermType = (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError"))})),+ Model.typeApplicationTermType = (Model.TypeLiteral Model.LiteralTypeBoolean)}))),+ Model.caseStatementCases = [+ Model.CaseAlternative {+ Model.caseAlternativeName = (Model.Name "boolean"),+ Model.caseAlternativeHandler = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "b"),+ Model.lambdaDomain = (Just (Model.TypeLiteral Model.LiteralTypeBoolean)),+ Model.lambdaBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermEither (Right (Model.TermVariable (Model.Name "b")))),+ Model.typeApplicationTermType = (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError"))})),+ Model.typeApplicationTermType = (Model.TypeLiteral Model.LiteralTypeBoolean)}))}))}]})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "v"))}))}))}]})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "stripped"))}))}))})),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.extract.model.stripWithDecodingError")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "cx"))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "raw"))}))}))}))})+ Model.LiteralTypeDecimal -> Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "cx"),+ Model.lambdaDomain = (Just (Model.TypeVariable (Model.Name "hydra.core.graph.Graph"))),+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "raw"),+ Model.lambdaDomain = (Just (Model.TypeVariable (Model.Name "hydra.core.model.Term"))),+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermVariable (Model.Name "hydra.core.lib.eithers.either")),+ Model.typeApplicationTermType = (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError"))})),+ Model.typeApplicationTermType = (Model.TypeVariable (Model.Name "hydra.core.model.Term"))})),+ Model.typeApplicationTermType = (Model.TypeEither (Model.EitherType {+ Model.eitherTypeLeft = (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError")),+ Model.eitherTypeRight = (Model.TypeLiteral Model.LiteralTypeDecimal)}))})),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "err"),+ Model.lambdaDomain = (Just (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError"))),+ Model.lambdaBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermEither (Left (Model.TermVariable (Model.Name "err")))),+ Model.typeApplicationTermType = (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError"))})),+ Model.typeApplicationTermType = (Model.TypeLiteral Model.LiteralTypeDecimal)}))}))})),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "stripped"),+ Model.lambdaDomain = (Just (Model.TypeVariable (Model.Name "hydra.core.model.Term"))),+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermCases (Model.CaseStatement {+ Model.caseStatementTypeName = (Model.Name "hydra.core.model.Term"),+ Model.caseStatementDefault = (Just (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermEither (Left (Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.Name "hydra.core.errors.DecodingError"),+ Model.wrappedTermBody = (Model.TermLiteral (Model.LiteralString "expected literal"))})))),+ Model.typeApplicationTermType = (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError"))})),+ Model.typeApplicationTermType = (Model.TypeLiteral Model.LiteralTypeDecimal)}))),+ Model.caseStatementCases = [+ Model.CaseAlternative {+ Model.caseAlternativeName = (Model.Name "literal"),+ Model.caseAlternativeHandler = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "v"),+ Model.lambdaDomain = (Just (Model.TypeVariable (Model.Name "hydra.core.model.Literal"))),+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermCases (Model.CaseStatement {+ Model.caseStatementTypeName = (Model.Name "hydra.core.model.Literal"),+ Model.caseStatementDefault = (Just (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermEither (Left (Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.Name "hydra.core.errors.DecodingError"),+ Model.wrappedTermBody = (Model.TermLiteral (Model.LiteralString "expected decimal literal"))})))),+ Model.typeApplicationTermType = (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError"))})),+ Model.typeApplicationTermType = (Model.TypeLiteral Model.LiteralTypeDecimal)}))),+ Model.caseStatementCases = [+ Model.CaseAlternative {+ Model.caseAlternativeName = (Model.Name "decimal"),+ Model.caseAlternativeHandler = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "d"),+ Model.lambdaDomain = (Just (Model.TypeLiteral Model.LiteralTypeDecimal)),+ Model.lambdaBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermEither (Right (Model.TermVariable (Model.Name "d")))),+ Model.typeApplicationTermType = (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError"))})),+ Model.typeApplicationTermType = (Model.TypeLiteral Model.LiteralTypeDecimal)}))}))}]})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "v"))}))}))}]})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "stripped"))}))}))})),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.extract.model.stripWithDecodingError")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "cx"))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "raw"))}))}))}))})+ Model.LiteralTypeFloat v0 -> case v0 of+ Model.FloatTypeFloat32 -> Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "cx"),+ Model.lambdaDomain = (Just (Model.TypeVariable (Model.Name "hydra.core.graph.Graph"))),+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "raw"),+ Model.lambdaDomain = (Just (Model.TypeVariable (Model.Name "hydra.core.model.Term"))),+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermVariable (Model.Name "hydra.core.lib.eithers.either")),+ Model.typeApplicationTermType = (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError"))})),+ Model.typeApplicationTermType = (Model.TypeVariable (Model.Name "hydra.core.model.Term"))})),+ Model.typeApplicationTermType = (Model.TypeEither (Model.EitherType {+ Model.eitherTypeLeft = (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError")),+ Model.eitherTypeRight = (Model.TypeLiteral (Model.LiteralTypeFloat v0))}))})),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "err"),+ Model.lambdaDomain = (Just (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError"))),+ Model.lambdaBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermEither (Left (Model.TermVariable (Model.Name "err")))),+ Model.typeApplicationTermType = (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError"))})),+ Model.typeApplicationTermType = (Model.TypeLiteral (Model.LiteralTypeFloat v0))}))}))})),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "stripped"),+ Model.lambdaDomain = (Just (Model.TypeVariable (Model.Name "hydra.core.model.Term"))),+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermCases (Model.CaseStatement {+ Model.caseStatementTypeName = (Model.Name "hydra.core.model.Term"),+ Model.caseStatementDefault = (Just (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermEither (Left (Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.Name "hydra.core.errors.DecodingError"),+ Model.wrappedTermBody = (Model.TermLiteral (Model.LiteralString "expected literal"))})))),+ Model.typeApplicationTermType = (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError"))})),+ Model.typeApplicationTermType = (Model.TypeLiteral (Model.LiteralTypeFloat v0))}))),+ Model.caseStatementCases = [+ Model.CaseAlternative {+ Model.caseAlternativeName = (Model.Name "literal"),+ Model.caseAlternativeHandler = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "v"),+ Model.lambdaDomain = (Just (Model.TypeVariable (Model.Name "hydra.core.model.Literal"))),+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermCases (Model.CaseStatement {+ Model.caseStatementTypeName = (Model.Name "hydra.core.model.Literal"),+ Model.caseStatementDefault = (Just (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermEither (Left (Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.Name "hydra.core.errors.DecodingError"),+ Model.wrappedTermBody = (Model.TermLiteral (Model.LiteralString (Strings.concat [+ "expected ",+ "float32",+ " literal"])))})))),+ Model.typeApplicationTermType = (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError"))})),+ Model.typeApplicationTermType = (Model.TypeLiteral (Model.LiteralTypeFloat v0))}))),+ Model.caseStatementCases = [+ Model.CaseAlternative {+ Model.caseAlternativeName = (Model.Name "float"),+ Model.caseAlternativeHandler = (Model.TermCases (Model.CaseStatement {+ Model.caseStatementTypeName = (Model.Name "hydra.core.model.FloatValue"),+ Model.caseStatementDefault = (Just (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermEither (Left (Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.Name "hydra.core.errors.DecodingError"),+ Model.wrappedTermBody = (Model.TermLiteral (Model.LiteralString (Strings.concat [+ "expected ",+ "float32",+ " value"])))})))),+ Model.typeApplicationTermType = (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError"))})),+ Model.typeApplicationTermType = (Model.TypeLiteral (Model.LiteralTypeFloat v0))}))),+ Model.caseStatementCases = [+ Model.CaseAlternative {+ Model.caseAlternativeName = (Model.Name "float32"),+ Model.caseAlternativeHandler = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "f"),+ Model.lambdaDomain = (Just (Model.TypeLiteral (Model.LiteralTypeFloat v0))),+ Model.lambdaBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermEither (Right (Model.TermVariable (Model.Name "f")))),+ Model.typeApplicationTermType = (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError"))})),+ Model.typeApplicationTermType = (Model.TypeLiteral (Model.LiteralTypeFloat v0))}))}))}]}))}]})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "v"))}))}))}]})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "stripped"))}))}))})),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.extract.model.stripWithDecodingError")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "cx"))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "raw"))}))}))}))})+ Model.FloatTypeFloat64 -> Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "cx"),+ Model.lambdaDomain = (Just (Model.TypeVariable (Model.Name "hydra.core.graph.Graph"))),+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "raw"),+ Model.lambdaDomain = (Just (Model.TypeVariable (Model.Name "hydra.core.model.Term"))),+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermVariable (Model.Name "hydra.core.lib.eithers.either")),+ Model.typeApplicationTermType = (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError"))})),+ Model.typeApplicationTermType = (Model.TypeVariable (Model.Name "hydra.core.model.Term"))})),+ Model.typeApplicationTermType = (Model.TypeEither (Model.EitherType {+ Model.eitherTypeLeft = (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError")),+ Model.eitherTypeRight = (Model.TypeLiteral (Model.LiteralTypeFloat v0))}))})),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "err"),+ Model.lambdaDomain = (Just (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError"))),+ Model.lambdaBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermEither (Left (Model.TermVariable (Model.Name "err")))),+ Model.typeApplicationTermType = (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError"))})),+ Model.typeApplicationTermType = (Model.TypeLiteral (Model.LiteralTypeFloat v0))}))}))})),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "stripped"),+ Model.lambdaDomain = (Just (Model.TypeVariable (Model.Name "hydra.core.model.Term"))),+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermCases (Model.CaseStatement {+ Model.caseStatementTypeName = (Model.Name "hydra.core.model.Term"),+ Model.caseStatementDefault = (Just (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermEither (Left (Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.Name "hydra.core.errors.DecodingError"),+ Model.wrappedTermBody = (Model.TermLiteral (Model.LiteralString "expected literal"))})))),+ Model.typeApplicationTermType = (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError"))})),+ Model.typeApplicationTermType = (Model.TypeLiteral (Model.LiteralTypeFloat v0))}))),+ Model.caseStatementCases = [+ Model.CaseAlternative {+ Model.caseAlternativeName = (Model.Name "literal"),+ Model.caseAlternativeHandler = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "v"),+ Model.lambdaDomain = (Just (Model.TypeVariable (Model.Name "hydra.core.model.Literal"))),+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermCases (Model.CaseStatement {+ Model.caseStatementTypeName = (Model.Name "hydra.core.model.Literal"),+ Model.caseStatementDefault = (Just (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermEither (Left (Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.Name "hydra.core.errors.DecodingError"),+ Model.wrappedTermBody = (Model.TermLiteral (Model.LiteralString (Strings.concat [+ "expected ",+ "float64",+ " literal"])))})))),+ Model.typeApplicationTermType = (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError"))})),+ Model.typeApplicationTermType = (Model.TypeLiteral (Model.LiteralTypeFloat v0))}))),+ Model.caseStatementCases = [+ Model.CaseAlternative {+ Model.caseAlternativeName = (Model.Name "float"),+ Model.caseAlternativeHandler = (Model.TermCases (Model.CaseStatement {+ Model.caseStatementTypeName = (Model.Name "hydra.core.model.FloatValue"),+ Model.caseStatementDefault = (Just (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermEither (Left (Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.Name "hydra.core.errors.DecodingError"),+ Model.wrappedTermBody = (Model.TermLiteral (Model.LiteralString (Strings.concat [+ "expected ",+ "float64",+ " value"])))})))),+ Model.typeApplicationTermType = (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError"))})),+ Model.typeApplicationTermType = (Model.TypeLiteral (Model.LiteralTypeFloat v0))}))),+ Model.caseStatementCases = [+ Model.CaseAlternative {+ Model.caseAlternativeName = (Model.Name "float64"),+ Model.caseAlternativeHandler = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "f"),+ Model.lambdaDomain = (Just (Model.TypeLiteral (Model.LiteralTypeFloat v0))),+ Model.lambdaBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermEither (Right (Model.TermVariable (Model.Name "f")))),+ Model.typeApplicationTermType = (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError"))})),+ Model.typeApplicationTermType = (Model.TypeLiteral (Model.LiteralTypeFloat v0))}))}))}]}))}]})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "v"))}))}))}]})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "stripped"))}))}))})),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.extract.model.stripWithDecodingError")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "cx"))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "raw"))}))}))}))})+ Model.LiteralTypeInteger v0 -> case v0 of+ Model.IntegerTypeBigint -> Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "cx"),+ Model.lambdaDomain = (Just (Model.TypeVariable (Model.Name "hydra.core.graph.Graph"))),+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "raw"),+ Model.lambdaDomain = (Just (Model.TypeVariable (Model.Name "hydra.core.model.Term"))),+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermVariable (Model.Name "hydra.core.lib.eithers.either")),+ Model.typeApplicationTermType = (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError"))})),+ Model.typeApplicationTermType = (Model.TypeVariable (Model.Name "hydra.core.model.Term"))})),+ Model.typeApplicationTermType = (Model.TypeEither (Model.EitherType {+ Model.eitherTypeLeft = (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError")),+ Model.eitherTypeRight = (Model.TypeLiteral (Model.LiteralTypeInteger v0))}))})),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "err"),+ Model.lambdaDomain = (Just (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError"))),+ Model.lambdaBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermEither (Left (Model.TermVariable (Model.Name "err")))),+ Model.typeApplicationTermType = (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError"))})),+ Model.typeApplicationTermType = (Model.TypeLiteral (Model.LiteralTypeInteger v0))}))}))})),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "stripped"),+ Model.lambdaDomain = (Just (Model.TypeVariable (Model.Name "hydra.core.model.Term"))),+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermCases (Model.CaseStatement {+ Model.caseStatementTypeName = (Model.Name "hydra.core.model.Term"),+ Model.caseStatementDefault = (Just (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermEither (Left (Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.Name "hydra.core.errors.DecodingError"),+ Model.wrappedTermBody = (Model.TermLiteral (Model.LiteralString "expected literal"))})))),+ Model.typeApplicationTermType = (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError"))})),+ Model.typeApplicationTermType = (Model.TypeLiteral (Model.LiteralTypeInteger v0))}))),+ Model.caseStatementCases = [+ Model.CaseAlternative {+ Model.caseAlternativeName = (Model.Name "literal"),+ Model.caseAlternativeHandler = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "v"),+ Model.lambdaDomain = (Just (Model.TypeVariable (Model.Name "hydra.core.model.Literal"))),+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermCases (Model.CaseStatement {+ Model.caseStatementTypeName = (Model.Name "hydra.core.model.Literal"),+ Model.caseStatementDefault = (Just (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermEither (Left (Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.Name "hydra.core.errors.DecodingError"),+ Model.wrappedTermBody = (Model.TermLiteral (Model.LiteralString (Strings.concat [+ "expected ",+ "bigint",+ " literal"])))})))),+ Model.typeApplicationTermType = (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError"))})),+ Model.typeApplicationTermType = (Model.TypeLiteral (Model.LiteralTypeInteger v0))}))),+ Model.caseStatementCases = [+ Model.CaseAlternative {+ Model.caseAlternativeName = (Model.Name "integer"),+ Model.caseAlternativeHandler = (Model.TermCases (Model.CaseStatement {+ Model.caseStatementTypeName = (Model.Name "hydra.core.model.IntegerValue"),+ Model.caseStatementDefault = (Just (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermEither (Left (Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.Name "hydra.core.errors.DecodingError"),+ Model.wrappedTermBody = (Model.TermLiteral (Model.LiteralString (Strings.concat [+ "expected ",+ "bigint",+ " value"])))})))),+ Model.typeApplicationTermType = (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError"))})),+ Model.typeApplicationTermType = (Model.TypeLiteral (Model.LiteralTypeInteger v0))}))),+ Model.caseStatementCases = [+ Model.CaseAlternative {+ Model.caseAlternativeName = (Model.Name "bigint"),+ Model.caseAlternativeHandler = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "i"),+ Model.lambdaDomain = (Just (Model.TypeLiteral (Model.LiteralTypeInteger v0))),+ Model.lambdaBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermEither (Right (Model.TermVariable (Model.Name "i")))),+ Model.typeApplicationTermType = (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError"))})),+ Model.typeApplicationTermType = (Model.TypeLiteral (Model.LiteralTypeInteger v0))}))}))}]}))}]})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "v"))}))}))}]})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "stripped"))}))}))})),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.extract.model.stripWithDecodingError")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "cx"))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "raw"))}))}))}))})+ Model.IntegerTypeInt8 -> Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "cx"),+ Model.lambdaDomain = (Just (Model.TypeVariable (Model.Name "hydra.core.graph.Graph"))),+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "raw"),+ Model.lambdaDomain = (Just (Model.TypeVariable (Model.Name "hydra.core.model.Term"))),+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermVariable (Model.Name "hydra.core.lib.eithers.either")),+ Model.typeApplicationTermType = (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError"))})),+ Model.typeApplicationTermType = (Model.TypeVariable (Model.Name "hydra.core.model.Term"))})),+ Model.typeApplicationTermType = (Model.TypeEither (Model.EitherType {+ Model.eitherTypeLeft = (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError")),+ Model.eitherTypeRight = (Model.TypeLiteral (Model.LiteralTypeInteger v0))}))})),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "err"),+ Model.lambdaDomain = (Just (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError"))),+ Model.lambdaBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermEither (Left (Model.TermVariable (Model.Name "err")))),+ Model.typeApplicationTermType = (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError"))})),+ Model.typeApplicationTermType = (Model.TypeLiteral (Model.LiteralTypeInteger v0))}))}))})),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "stripped"),+ Model.lambdaDomain = (Just (Model.TypeVariable (Model.Name "hydra.core.model.Term"))),+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermCases (Model.CaseStatement {+ Model.caseStatementTypeName = (Model.Name "hydra.core.model.Term"),+ Model.caseStatementDefault = (Just (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermEither (Left (Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.Name "hydra.core.errors.DecodingError"),+ Model.wrappedTermBody = (Model.TermLiteral (Model.LiteralString "expected literal"))})))),+ Model.typeApplicationTermType = (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError"))})),+ Model.typeApplicationTermType = (Model.TypeLiteral (Model.LiteralTypeInteger v0))}))),+ Model.caseStatementCases = [+ Model.CaseAlternative {+ Model.caseAlternativeName = (Model.Name "literal"),+ Model.caseAlternativeHandler = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "v"),+ Model.lambdaDomain = (Just (Model.TypeVariable (Model.Name "hydra.core.model.Literal"))),+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermCases (Model.CaseStatement {+ Model.caseStatementTypeName = (Model.Name "hydra.core.model.Literal"),+ Model.caseStatementDefault = (Just (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermEither (Left (Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.Name "hydra.core.errors.DecodingError"),+ Model.wrappedTermBody = (Model.TermLiteral (Model.LiteralString (Strings.concat [+ "expected ",+ "int8",+ " literal"])))})))),+ Model.typeApplicationTermType = (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError"))})),+ Model.typeApplicationTermType = (Model.TypeLiteral (Model.LiteralTypeInteger v0))}))),+ Model.caseStatementCases = [+ Model.CaseAlternative {+ Model.caseAlternativeName = (Model.Name "integer"),+ Model.caseAlternativeHandler = (Model.TermCases (Model.CaseStatement {+ Model.caseStatementTypeName = (Model.Name "hydra.core.model.IntegerValue"),+ Model.caseStatementDefault = (Just (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermEither (Left (Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.Name "hydra.core.errors.DecodingError"),+ Model.wrappedTermBody = (Model.TermLiteral (Model.LiteralString (Strings.concat [+ "expected ",+ "int8",+ " value"])))})))),+ Model.typeApplicationTermType = (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError"))})),+ Model.typeApplicationTermType = (Model.TypeLiteral (Model.LiteralTypeInteger v0))}))),+ Model.caseStatementCases = [+ Model.CaseAlternative {+ Model.caseAlternativeName = (Model.Name "int8"),+ Model.caseAlternativeHandler = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "i"),+ Model.lambdaDomain = (Just (Model.TypeLiteral (Model.LiteralTypeInteger v0))),+ Model.lambdaBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermEither (Right (Model.TermVariable (Model.Name "i")))),+ Model.typeApplicationTermType = (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError"))})),+ Model.typeApplicationTermType = (Model.TypeLiteral (Model.LiteralTypeInteger v0))}))}))}]}))}]})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "v"))}))}))}]})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "stripped"))}))}))})),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.extract.model.stripWithDecodingError")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "cx"))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "raw"))}))}))}))})+ Model.IntegerTypeInt16 -> Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "cx"),+ Model.lambdaDomain = (Just (Model.TypeVariable (Model.Name "hydra.core.graph.Graph"))),+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "raw"),+ Model.lambdaDomain = (Just (Model.TypeVariable (Model.Name "hydra.core.model.Term"))),+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermVariable (Model.Name "hydra.core.lib.eithers.either")),+ Model.typeApplicationTermType = (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError"))})),+ Model.typeApplicationTermType = (Model.TypeVariable (Model.Name "hydra.core.model.Term"))})),+ Model.typeApplicationTermType = (Model.TypeEither (Model.EitherType {+ Model.eitherTypeLeft = (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError")),+ Model.eitherTypeRight = (Model.TypeLiteral (Model.LiteralTypeInteger v0))}))})),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "err"),+ Model.lambdaDomain = (Just (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError"))),+ Model.lambdaBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermEither (Left (Model.TermVariable (Model.Name "err")))),+ Model.typeApplicationTermType = (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError"))})),+ Model.typeApplicationTermType = (Model.TypeLiteral (Model.LiteralTypeInteger v0))}))}))})),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "stripped"),+ Model.lambdaDomain = (Just (Model.TypeVariable (Model.Name "hydra.core.model.Term"))),+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermCases (Model.CaseStatement {+ Model.caseStatementTypeName = (Model.Name "hydra.core.model.Term"),+ Model.caseStatementDefault = (Just (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermEither (Left (Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.Name "hydra.core.errors.DecodingError"),+ Model.wrappedTermBody = (Model.TermLiteral (Model.LiteralString "expected literal"))})))),+ Model.typeApplicationTermType = (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError"))})),+ Model.typeApplicationTermType = (Model.TypeLiteral (Model.LiteralTypeInteger v0))}))),+ Model.caseStatementCases = [+ Model.CaseAlternative {+ Model.caseAlternativeName = (Model.Name "literal"),+ Model.caseAlternativeHandler = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "v"),+ Model.lambdaDomain = (Just (Model.TypeVariable (Model.Name "hydra.core.model.Literal"))),+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermCases (Model.CaseStatement {+ Model.caseStatementTypeName = (Model.Name "hydra.core.model.Literal"),+ Model.caseStatementDefault = (Just (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermEither (Left (Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.Name "hydra.core.errors.DecodingError"),+ Model.wrappedTermBody = (Model.TermLiteral (Model.LiteralString (Strings.concat [+ "expected ",+ "int16",+ " literal"])))})))),+ Model.typeApplicationTermType = (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError"))})),+ Model.typeApplicationTermType = (Model.TypeLiteral (Model.LiteralTypeInteger v0))}))),+ Model.caseStatementCases = [+ Model.CaseAlternative {+ Model.caseAlternativeName = (Model.Name "integer"),+ Model.caseAlternativeHandler = (Model.TermCases (Model.CaseStatement {+ Model.caseStatementTypeName = (Model.Name "hydra.core.model.IntegerValue"),+ Model.caseStatementDefault = (Just (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermEither (Left (Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.Name "hydra.core.errors.DecodingError"),+ Model.wrappedTermBody = (Model.TermLiteral (Model.LiteralString (Strings.concat [+ "expected ",+ "int16",+ " value"])))})))),+ Model.typeApplicationTermType = (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError"))})),+ Model.typeApplicationTermType = (Model.TypeLiteral (Model.LiteralTypeInteger v0))}))),+ Model.caseStatementCases = [+ Model.CaseAlternative {+ Model.caseAlternativeName = (Model.Name "int16"),+ Model.caseAlternativeHandler = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "i"),+ Model.lambdaDomain = (Just (Model.TypeLiteral (Model.LiteralTypeInteger v0))),+ Model.lambdaBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermEither (Right (Model.TermVariable (Model.Name "i")))),+ Model.typeApplicationTermType = (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError"))})),+ Model.typeApplicationTermType = (Model.TypeLiteral (Model.LiteralTypeInteger v0))}))}))}]}))}]})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "v"))}))}))}]})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "stripped"))}))}))})),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.extract.model.stripWithDecodingError")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "cx"))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "raw"))}))}))}))})+ Model.IntegerTypeInt32 -> Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "cx"),+ Model.lambdaDomain = (Just (Model.TypeVariable (Model.Name "hydra.core.graph.Graph"))),+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "raw"),+ Model.lambdaDomain = (Just (Model.TypeVariable (Model.Name "hydra.core.model.Term"))),+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermVariable (Model.Name "hydra.core.lib.eithers.either")),+ Model.typeApplicationTermType = (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError"))})),+ Model.typeApplicationTermType = (Model.TypeVariable (Model.Name "hydra.core.model.Term"))})),+ Model.typeApplicationTermType = (Model.TypeEither (Model.EitherType {+ Model.eitherTypeLeft = (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError")),+ Model.eitherTypeRight = (Model.TypeLiteral (Model.LiteralTypeInteger v0))}))})),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "err"),+ Model.lambdaDomain = (Just (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError"))),+ Model.lambdaBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermEither (Left (Model.TermVariable (Model.Name "err")))),+ Model.typeApplicationTermType = (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError"))})),+ Model.typeApplicationTermType = (Model.TypeLiteral (Model.LiteralTypeInteger v0))}))}))})),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "stripped"),+ Model.lambdaDomain = (Just (Model.TypeVariable (Model.Name "hydra.core.model.Term"))),+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermCases (Model.CaseStatement {+ Model.caseStatementTypeName = (Model.Name "hydra.core.model.Term"),+ Model.caseStatementDefault = (Just (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermEither (Left (Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.Name "hydra.core.errors.DecodingError"),+ Model.wrappedTermBody = (Model.TermLiteral (Model.LiteralString "expected literal"))})))),+ Model.typeApplicationTermType = (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError"))})),+ Model.typeApplicationTermType = (Model.TypeLiteral (Model.LiteralTypeInteger v0))}))),+ Model.caseStatementCases = [+ Model.CaseAlternative {+ Model.caseAlternativeName = (Model.Name "literal"),+ Model.caseAlternativeHandler = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "v"),+ Model.lambdaDomain = (Just (Model.TypeVariable (Model.Name "hydra.core.model.Literal"))),+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermCases (Model.CaseStatement {+ Model.caseStatementTypeName = (Model.Name "hydra.core.model.Literal"),+ Model.caseStatementDefault = (Just (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermEither (Left (Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.Name "hydra.core.errors.DecodingError"),+ Model.wrappedTermBody = (Model.TermLiteral (Model.LiteralString (Strings.concat [+ "expected ",+ "int32",+ " literal"])))})))),+ Model.typeApplicationTermType = (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError"))})),+ Model.typeApplicationTermType = (Model.TypeLiteral (Model.LiteralTypeInteger v0))}))),+ Model.caseStatementCases = [+ Model.CaseAlternative {+ Model.caseAlternativeName = (Model.Name "integer"),+ Model.caseAlternativeHandler = (Model.TermCases (Model.CaseStatement {+ Model.caseStatementTypeName = (Model.Name "hydra.core.model.IntegerValue"),+ Model.caseStatementDefault = (Just (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermEither (Left (Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.Name "hydra.core.errors.DecodingError"),+ Model.wrappedTermBody = (Model.TermLiteral (Model.LiteralString (Strings.concat [+ "expected ",+ "int32",+ " value"])))})))),+ Model.typeApplicationTermType = (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError"))})),+ Model.typeApplicationTermType = (Model.TypeLiteral (Model.LiteralTypeInteger v0))}))),+ Model.caseStatementCases = [+ Model.CaseAlternative {+ Model.caseAlternativeName = (Model.Name "int32"),+ Model.caseAlternativeHandler = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "i"),+ Model.lambdaDomain = (Just (Model.TypeLiteral (Model.LiteralTypeInteger v0))),+ Model.lambdaBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermEither (Right (Model.TermVariable (Model.Name "i")))),+ Model.typeApplicationTermType = (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError"))})),+ Model.typeApplicationTermType = (Model.TypeLiteral (Model.LiteralTypeInteger v0))}))}))}]}))}]})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "v"))}))}))}]})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "stripped"))}))}))})),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.extract.model.stripWithDecodingError")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "cx"))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "raw"))}))}))}))})+ Model.IntegerTypeInt64 -> Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "cx"),+ Model.lambdaDomain = (Just (Model.TypeVariable (Model.Name "hydra.core.graph.Graph"))),+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "raw"),+ Model.lambdaDomain = (Just (Model.TypeVariable (Model.Name "hydra.core.model.Term"))),+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermVariable (Model.Name "hydra.core.lib.eithers.either")),+ Model.typeApplicationTermType = (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError"))})),+ Model.typeApplicationTermType = (Model.TypeVariable (Model.Name "hydra.core.model.Term"))})),+ Model.typeApplicationTermType = (Model.TypeEither (Model.EitherType {+ Model.eitherTypeLeft = (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError")),+ Model.eitherTypeRight = (Model.TypeLiteral (Model.LiteralTypeInteger v0))}))})),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "err"),+ Model.lambdaDomain = (Just (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError"))),+ Model.lambdaBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermEither (Left (Model.TermVariable (Model.Name "err")))),+ Model.typeApplicationTermType = (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError"))})),+ Model.typeApplicationTermType = (Model.TypeLiteral (Model.LiteralTypeInteger v0))}))}))})),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "stripped"),+ Model.lambdaDomain = (Just (Model.TypeVariable (Model.Name "hydra.core.model.Term"))),+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermCases (Model.CaseStatement {+ Model.caseStatementTypeName = (Model.Name "hydra.core.model.Term"),+ Model.caseStatementDefault = (Just (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermEither (Left (Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.Name "hydra.core.errors.DecodingError"),+ Model.wrappedTermBody = (Model.TermLiteral (Model.LiteralString "expected literal"))})))),+ Model.typeApplicationTermType = (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError"))})),+ Model.typeApplicationTermType = (Model.TypeLiteral (Model.LiteralTypeInteger v0))}))),+ Model.caseStatementCases = [+ Model.CaseAlternative {+ Model.caseAlternativeName = (Model.Name "literal"),+ Model.caseAlternativeHandler = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "v"),+ Model.lambdaDomain = (Just (Model.TypeVariable (Model.Name "hydra.core.model.Literal"))),+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermCases (Model.CaseStatement {+ Model.caseStatementTypeName = (Model.Name "hydra.core.model.Literal"),+ Model.caseStatementDefault = (Just (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermEither (Left (Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.Name "hydra.core.errors.DecodingError"),+ Model.wrappedTermBody = (Model.TermLiteral (Model.LiteralString (Strings.concat [+ "expected ",+ "int64",+ " literal"])))})))),+ Model.typeApplicationTermType = (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError"))})),+ Model.typeApplicationTermType = (Model.TypeLiteral (Model.LiteralTypeInteger v0))}))),+ Model.caseStatementCases = [+ Model.CaseAlternative {+ Model.caseAlternativeName = (Model.Name "integer"),+ Model.caseAlternativeHandler = (Model.TermCases (Model.CaseStatement {+ Model.caseStatementTypeName = (Model.Name "hydra.core.model.IntegerValue"),+ Model.caseStatementDefault = (Just (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermEither (Left (Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.Name "hydra.core.errors.DecodingError"),+ Model.wrappedTermBody = (Model.TermLiteral (Model.LiteralString (Strings.concat [+ "expected ",+ "int64",+ " value"])))})))),+ Model.typeApplicationTermType = (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError"))})),+ Model.typeApplicationTermType = (Model.TypeLiteral (Model.LiteralTypeInteger v0))}))),+ Model.caseStatementCases = [+ Model.CaseAlternative {+ Model.caseAlternativeName = (Model.Name "int64"),+ Model.caseAlternativeHandler = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "i"),+ Model.lambdaDomain = (Just (Model.TypeLiteral (Model.LiteralTypeInteger v0))),+ Model.lambdaBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermEither (Right (Model.TermVariable (Model.Name "i")))),+ Model.typeApplicationTermType = (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError"))})),+ Model.typeApplicationTermType = (Model.TypeLiteral (Model.LiteralTypeInteger v0))}))}))}]}))}]})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "v"))}))}))}]})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "stripped"))}))}))})),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.extract.model.stripWithDecodingError")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "cx"))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "raw"))}))}))}))})+ Model.IntegerTypeUint8 -> Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "cx"),+ Model.lambdaDomain = (Just (Model.TypeVariable (Model.Name "hydra.core.graph.Graph"))),+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "raw"),+ Model.lambdaDomain = (Just (Model.TypeVariable (Model.Name "hydra.core.model.Term"))),+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermVariable (Model.Name "hydra.core.lib.eithers.either")),+ Model.typeApplicationTermType = (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError"))})),+ Model.typeApplicationTermType = (Model.TypeVariable (Model.Name "hydra.core.model.Term"))})),+ Model.typeApplicationTermType = (Model.TypeEither (Model.EitherType {+ Model.eitherTypeLeft = (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError")),+ Model.eitherTypeRight = (Model.TypeLiteral (Model.LiteralTypeInteger v0))}))})),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "err"),+ Model.lambdaDomain = (Just (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError"))),+ Model.lambdaBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermEither (Left (Model.TermVariable (Model.Name "err")))),+ Model.typeApplicationTermType = (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError"))})),+ Model.typeApplicationTermType = (Model.TypeLiteral (Model.LiteralTypeInteger v0))}))}))})),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "stripped"),+ Model.lambdaDomain = (Just (Model.TypeVariable (Model.Name "hydra.core.model.Term"))),+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermCases (Model.CaseStatement {+ Model.caseStatementTypeName = (Model.Name "hydra.core.model.Term"),+ Model.caseStatementDefault = (Just (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermEither (Left (Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.Name "hydra.core.errors.DecodingError"),+ Model.wrappedTermBody = (Model.TermLiteral (Model.LiteralString "expected literal"))})))),+ Model.typeApplicationTermType = (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError"))})),+ Model.typeApplicationTermType = (Model.TypeLiteral (Model.LiteralTypeInteger v0))}))),+ Model.caseStatementCases = [+ Model.CaseAlternative {+ Model.caseAlternativeName = (Model.Name "literal"),+ Model.caseAlternativeHandler = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "v"),+ Model.lambdaDomain = (Just (Model.TypeVariable (Model.Name "hydra.core.model.Literal"))),+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermCases (Model.CaseStatement {+ Model.caseStatementTypeName = (Model.Name "hydra.core.model.Literal"),+ Model.caseStatementDefault = (Just (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermEither (Left (Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.Name "hydra.core.errors.DecodingError"),+ Model.wrappedTermBody = (Model.TermLiteral (Model.LiteralString (Strings.concat [+ "expected ",+ "uint8",+ " literal"])))})))),+ Model.typeApplicationTermType = (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError"))})),+ Model.typeApplicationTermType = (Model.TypeLiteral (Model.LiteralTypeInteger v0))}))),+ Model.caseStatementCases = [+ Model.CaseAlternative {+ Model.caseAlternativeName = (Model.Name "integer"),+ Model.caseAlternativeHandler = (Model.TermCases (Model.CaseStatement {+ Model.caseStatementTypeName = (Model.Name "hydra.core.model.IntegerValue"),+ Model.caseStatementDefault = (Just (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermEither (Left (Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.Name "hydra.core.errors.DecodingError"),+ Model.wrappedTermBody = (Model.TermLiteral (Model.LiteralString (Strings.concat [+ "expected ",+ "uint8",+ " value"])))})))),+ Model.typeApplicationTermType = (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError"))})),+ Model.typeApplicationTermType = (Model.TypeLiteral (Model.LiteralTypeInteger v0))}))),+ Model.caseStatementCases = [+ Model.CaseAlternative {+ Model.caseAlternativeName = (Model.Name "uint8"),+ Model.caseAlternativeHandler = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "i"),+ Model.lambdaDomain = (Just (Model.TypeLiteral (Model.LiteralTypeInteger v0))),+ Model.lambdaBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermEither (Right (Model.TermVariable (Model.Name "i")))),+ Model.typeApplicationTermType = (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError"))})),+ Model.typeApplicationTermType = (Model.TypeLiteral (Model.LiteralTypeInteger v0))}))}))}]}))}]})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "v"))}))}))}]})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "stripped"))}))}))})),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.extract.model.stripWithDecodingError")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "cx"))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "raw"))}))}))}))})+ Model.IntegerTypeUint16 -> Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "cx"),+ Model.lambdaDomain = (Just (Model.TypeVariable (Model.Name "hydra.core.graph.Graph"))),+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "raw"),+ Model.lambdaDomain = (Just (Model.TypeVariable (Model.Name "hydra.core.model.Term"))),+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermVariable (Model.Name "hydra.core.lib.eithers.either")),+ Model.typeApplicationTermType = (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError"))})),+ Model.typeApplicationTermType = (Model.TypeVariable (Model.Name "hydra.core.model.Term"))})),+ Model.typeApplicationTermType = (Model.TypeEither (Model.EitherType {+ Model.eitherTypeLeft = (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError")),+ Model.eitherTypeRight = (Model.TypeLiteral (Model.LiteralTypeInteger v0))}))})),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "err"),+ Model.lambdaDomain = (Just (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError"))),+ Model.lambdaBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermEither (Left (Model.TermVariable (Model.Name "err")))),+ Model.typeApplicationTermType = (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError"))})),+ Model.typeApplicationTermType = (Model.TypeLiteral (Model.LiteralTypeInteger v0))}))}))})),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "stripped"),+ Model.lambdaDomain = (Just (Model.TypeVariable (Model.Name "hydra.core.model.Term"))),+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermCases (Model.CaseStatement {+ Model.caseStatementTypeName = (Model.Name "hydra.core.model.Term"),+ Model.caseStatementDefault = (Just (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermEither (Left (Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.Name "hydra.core.errors.DecodingError"),+ Model.wrappedTermBody = (Model.TermLiteral (Model.LiteralString "expected literal"))})))),+ Model.typeApplicationTermType = (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError"))})),+ Model.typeApplicationTermType = (Model.TypeLiteral (Model.LiteralTypeInteger v0))}))),+ Model.caseStatementCases = [+ Model.CaseAlternative {+ Model.caseAlternativeName = (Model.Name "literal"),+ Model.caseAlternativeHandler = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "v"),+ Model.lambdaDomain = (Just (Model.TypeVariable (Model.Name "hydra.core.model.Literal"))),+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermCases (Model.CaseStatement {+ Model.caseStatementTypeName = (Model.Name "hydra.core.model.Literal"),+ Model.caseStatementDefault = (Just (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermEither (Left (Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.Name "hydra.core.errors.DecodingError"),+ Model.wrappedTermBody = (Model.TermLiteral (Model.LiteralString (Strings.concat [+ "expected ",+ "uint16",+ " literal"])))})))),+ Model.typeApplicationTermType = (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError"))})),+ Model.typeApplicationTermType = (Model.TypeLiteral (Model.LiteralTypeInteger v0))}))),+ Model.caseStatementCases = [+ Model.CaseAlternative {+ Model.caseAlternativeName = (Model.Name "integer"),+ Model.caseAlternativeHandler = (Model.TermCases (Model.CaseStatement {+ Model.caseStatementTypeName = (Model.Name "hydra.core.model.IntegerValue"),+ Model.caseStatementDefault = (Just (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermEither (Left (Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.Name "hydra.core.errors.DecodingError"),+ Model.wrappedTermBody = (Model.TermLiteral (Model.LiteralString (Strings.concat [+ "expected ",+ "uint16",+ " value"])))})))),+ Model.typeApplicationTermType = (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError"))})),+ Model.typeApplicationTermType = (Model.TypeLiteral (Model.LiteralTypeInteger v0))}))),+ Model.caseStatementCases = [+ Model.CaseAlternative {+ Model.caseAlternativeName = (Model.Name "uint16"),+ Model.caseAlternativeHandler = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "i"),+ Model.lambdaDomain = (Just (Model.TypeLiteral (Model.LiteralTypeInteger v0))),+ Model.lambdaBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermEither (Right (Model.TermVariable (Model.Name "i")))),+ Model.typeApplicationTermType = (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError"))})),+ Model.typeApplicationTermType = (Model.TypeLiteral (Model.LiteralTypeInteger v0))}))}))}]}))}]})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "v"))}))}))}]})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "stripped"))}))}))})),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.extract.model.stripWithDecodingError")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "cx"))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "raw"))}))}))}))})+ Model.IntegerTypeUint32 -> Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "cx"),+ Model.lambdaDomain = (Just (Model.TypeVariable (Model.Name "hydra.core.graph.Graph"))),+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "raw"),+ Model.lambdaDomain = (Just (Model.TypeVariable (Model.Name "hydra.core.model.Term"))),+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermVariable (Model.Name "hydra.core.lib.eithers.either")),+ Model.typeApplicationTermType = (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError"))})),+ Model.typeApplicationTermType = (Model.TypeVariable (Model.Name "hydra.core.model.Term"))})),+ Model.typeApplicationTermType = (Model.TypeEither (Model.EitherType {+ Model.eitherTypeLeft = (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError")),+ Model.eitherTypeRight = (Model.TypeLiteral (Model.LiteralTypeInteger v0))}))})),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "err"),+ Model.lambdaDomain = (Just (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError"))),+ Model.lambdaBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermEither (Left (Model.TermVariable (Model.Name "err")))),+ Model.typeApplicationTermType = (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError"))})),+ Model.typeApplicationTermType = (Model.TypeLiteral (Model.LiteralTypeInteger v0))}))}))})),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "stripped"),+ Model.lambdaDomain = (Just (Model.TypeVariable (Model.Name "hydra.core.model.Term"))),+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermCases (Model.CaseStatement {+ Model.caseStatementTypeName = (Model.Name "hydra.core.model.Term"),+ Model.caseStatementDefault = (Just (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermEither (Left (Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.Name "hydra.core.errors.DecodingError"),+ Model.wrappedTermBody = (Model.TermLiteral (Model.LiteralString "expected literal"))})))),+ Model.typeApplicationTermType = (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError"))})),+ Model.typeApplicationTermType = (Model.TypeLiteral (Model.LiteralTypeInteger v0))}))),+ Model.caseStatementCases = [+ Model.CaseAlternative {+ Model.caseAlternativeName = (Model.Name "literal"),+ Model.caseAlternativeHandler = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "v"),+ Model.lambdaDomain = (Just (Model.TypeVariable (Model.Name "hydra.core.model.Literal"))),+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermCases (Model.CaseStatement {+ Model.caseStatementTypeName = (Model.Name "hydra.core.model.Literal"),+ Model.caseStatementDefault = (Just (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermEither (Left (Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.Name "hydra.core.errors.DecodingError"),+ Model.wrappedTermBody = (Model.TermLiteral (Model.LiteralString (Strings.concat [+ "expected ",+ "uint32",+ " literal"])))})))),+ Model.typeApplicationTermType = (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError"))})),+ Model.typeApplicationTermType = (Model.TypeLiteral (Model.LiteralTypeInteger v0))}))),+ Model.caseStatementCases = [+ Model.CaseAlternative {+ Model.caseAlternativeName = (Model.Name "integer"),+ Model.caseAlternativeHandler = (Model.TermCases (Model.CaseStatement {+ Model.caseStatementTypeName = (Model.Name "hydra.core.model.IntegerValue"),+ Model.caseStatementDefault = (Just (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermEither (Left (Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.Name "hydra.core.errors.DecodingError"),+ Model.wrappedTermBody = (Model.TermLiteral (Model.LiteralString (Strings.concat [+ "expected ",+ "uint32",+ " value"])))})))),+ Model.typeApplicationTermType = (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError"))})),+ Model.typeApplicationTermType = (Model.TypeLiteral (Model.LiteralTypeInteger v0))}))),+ Model.caseStatementCases = [+ Model.CaseAlternative {+ Model.caseAlternativeName = (Model.Name "uint32"),+ Model.caseAlternativeHandler = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "i"),+ Model.lambdaDomain = (Just (Model.TypeLiteral (Model.LiteralTypeInteger v0))),+ Model.lambdaBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermEither (Right (Model.TermVariable (Model.Name "i")))),+ Model.typeApplicationTermType = (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError"))})),+ Model.typeApplicationTermType = (Model.TypeLiteral (Model.LiteralTypeInteger v0))}))}))}]}))}]})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "v"))}))}))}]})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "stripped"))}))}))})),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.extract.model.stripWithDecodingError")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "cx"))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "raw"))}))}))}))})+ Model.IntegerTypeUint64 -> Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "cx"),+ Model.lambdaDomain = (Just (Model.TypeVariable (Model.Name "hydra.core.graph.Graph"))),+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "raw"),+ Model.lambdaDomain = (Just (Model.TypeVariable (Model.Name "hydra.core.model.Term"))),+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermVariable (Model.Name "hydra.core.lib.eithers.either")),+ Model.typeApplicationTermType = (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError"))})),+ Model.typeApplicationTermType = (Model.TypeVariable (Model.Name "hydra.core.model.Term"))})),+ Model.typeApplicationTermType = (Model.TypeEither (Model.EitherType {+ Model.eitherTypeLeft = (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError")),+ Model.eitherTypeRight = (Model.TypeLiteral (Model.LiteralTypeInteger v0))}))})),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "err"),+ Model.lambdaDomain = (Just (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError"))),+ Model.lambdaBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermEither (Left (Model.TermVariable (Model.Name "err")))),+ Model.typeApplicationTermType = (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError"))})),+ Model.typeApplicationTermType = (Model.TypeLiteral (Model.LiteralTypeInteger v0))}))}))})),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "stripped"),+ Model.lambdaDomain = (Just (Model.TypeVariable (Model.Name "hydra.core.model.Term"))),+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermCases (Model.CaseStatement {+ Model.caseStatementTypeName = (Model.Name "hydra.core.model.Term"),+ Model.caseStatementDefault = (Just (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermEither (Left (Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.Name "hydra.core.errors.DecodingError"),+ Model.wrappedTermBody = (Model.TermLiteral (Model.LiteralString "expected literal"))})))),+ Model.typeApplicationTermType = (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError"))})),+ Model.typeApplicationTermType = (Model.TypeLiteral (Model.LiteralTypeInteger v0))}))),+ Model.caseStatementCases = [+ Model.CaseAlternative {+ Model.caseAlternativeName = (Model.Name "literal"),+ Model.caseAlternativeHandler = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "v"),+ Model.lambdaDomain = (Just (Model.TypeVariable (Model.Name "hydra.core.model.Literal"))),+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermCases (Model.CaseStatement {+ Model.caseStatementTypeName = (Model.Name "hydra.core.model.Literal"),+ Model.caseStatementDefault = (Just (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermEither (Left (Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.Name "hydra.core.errors.DecodingError"),+ Model.wrappedTermBody = (Model.TermLiteral (Model.LiteralString (Strings.concat [+ "expected ",+ "uint64",+ " literal"])))})))),+ Model.typeApplicationTermType = (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError"))})),+ Model.typeApplicationTermType = (Model.TypeLiteral (Model.LiteralTypeInteger v0))}))),+ Model.caseStatementCases = [+ Model.CaseAlternative {+ Model.caseAlternativeName = (Model.Name "integer"),+ Model.caseAlternativeHandler = (Model.TermCases (Model.CaseStatement {+ Model.caseStatementTypeName = (Model.Name "hydra.core.model.IntegerValue"),+ Model.caseStatementDefault = (Just (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermEither (Left (Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.Name "hydra.core.errors.DecodingError"),+ Model.wrappedTermBody = (Model.TermLiteral (Model.LiteralString (Strings.concat [+ "expected ",+ "uint64",+ " value"])))})))),+ Model.typeApplicationTermType = (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError"))})),+ Model.typeApplicationTermType = (Model.TypeLiteral (Model.LiteralTypeInteger v0))}))),+ Model.caseStatementCases = [+ Model.CaseAlternative {+ Model.caseAlternativeName = (Model.Name "uint64"),+ Model.caseAlternativeHandler = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "i"),+ Model.lambdaDomain = (Just (Model.TypeLiteral (Model.LiteralTypeInteger v0))),+ Model.lambdaBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermEither (Right (Model.TermVariable (Model.Name "i")))),+ Model.typeApplicationTermType = (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError"))})),+ Model.typeApplicationTermType = (Model.TypeLiteral (Model.LiteralTypeInteger v0))}))}))}]}))}]})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "v"))}))}))}]})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "stripped"))}))}))})),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.extract.model.stripWithDecodingError")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "cx"))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "raw"))}))}))}))})+ Model.LiteralTypeString -> Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "cx"),+ Model.lambdaDomain = (Just (Model.TypeVariable (Model.Name "hydra.core.graph.Graph"))),+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "raw"),+ Model.lambdaDomain = (Just (Model.TypeVariable (Model.Name "hydra.core.model.Term"))),+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermVariable (Model.Name "hydra.core.lib.eithers.either")),+ Model.typeApplicationTermType = (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError"))})),+ Model.typeApplicationTermType = (Model.TypeVariable (Model.Name "hydra.core.model.Term"))})),+ Model.typeApplicationTermType = (Model.TypeEither (Model.EitherType {+ Model.eitherTypeLeft = (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError")),+ Model.eitherTypeRight = (Model.TypeLiteral Model.LiteralTypeString)}))})),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "err"),+ Model.lambdaDomain = (Just (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError"))),+ Model.lambdaBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermEither (Left (Model.TermVariable (Model.Name "err")))),+ Model.typeApplicationTermType = (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError"))})),+ Model.typeApplicationTermType = (Model.TypeLiteral Model.LiteralTypeString)}))}))})),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "stripped"),+ Model.lambdaDomain = (Just (Model.TypeVariable (Model.Name "hydra.core.model.Term"))),+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermCases (Model.CaseStatement {+ Model.caseStatementTypeName = (Model.Name "hydra.core.model.Term"),+ Model.caseStatementDefault = (Just (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermEither (Left (Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.Name "hydra.core.errors.DecodingError"),+ Model.wrappedTermBody = (Model.TermLiteral (Model.LiteralString "expected literal"))})))),+ Model.typeApplicationTermType = (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError"))})),+ Model.typeApplicationTermType = (Model.TypeLiteral Model.LiteralTypeString)}))),+ Model.caseStatementCases = [+ Model.CaseAlternative {+ Model.caseAlternativeName = (Model.Name "literal"),+ Model.caseAlternativeHandler = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "v"),+ Model.lambdaDomain = (Just (Model.TypeVariable (Model.Name "hydra.core.model.Literal"))),+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermCases (Model.CaseStatement {+ Model.caseStatementTypeName = (Model.Name "hydra.core.model.Literal"),+ Model.caseStatementDefault = (Just (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermEither (Left (Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.Name "hydra.core.errors.DecodingError"),+ Model.wrappedTermBody = (Model.TermLiteral (Model.LiteralString "expected string literal"))})))),+ Model.typeApplicationTermType = (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError"))})),+ Model.typeApplicationTermType = (Model.TypeLiteral Model.LiteralTypeString)}))),+ Model.caseStatementCases = [+ Model.CaseAlternative {+ Model.caseAlternativeName = (Model.Name "string"),+ Model.caseAlternativeHandler = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "s"),+ Model.lambdaDomain = (Just (Model.TypeLiteral Model.LiteralTypeString)),+ Model.lambdaBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermEither (Right (Model.TermVariable (Model.Name "s")))),+ Model.typeApplicationTermType = (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError"))})),+ Model.typeApplicationTermType = (Model.TypeLiteral Model.LiteralTypeString)}))}))}]})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "v"))}))}))}]})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "stripped"))}))}))})),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.extract.model.stripWithDecodingError")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "cx"))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "raw"))}))}))}))})++-- | Generate a decoder for a map type+decodeMapType :: Model.MapType -> Model.Term+decodeMapType mt =++ let keyDecoder = decodeType (Model.mapTypeKeys mt)+ valDecoder = decodeType (Model.mapTypeValues mt)+ in (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermVariable (Model.Name "hydra.core.extract.model.decodeMap")),+ Model.typeApplicationTermType = (decoderFullResultType (Model.mapTypeKeys mt))})),+ Model.typeApplicationTermType = (decoderFullResultType (Model.mapTypeValues mt))})),+ Model.applicationArgument = keyDecoder})),+ Model.applicationArgument = valDecoder}))++-- | Generate a decoder for an optional type+decodeMaybeType :: Model.Type -> Model.Term+decodeMaybeType elemType =++ let elemDecoder = decodeType elemType+ in (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermVariable (Model.Name "hydra.core.extract.model.decodeMaybe")),+ Model.typeApplicationTermType = (decoderFullResultType elemType)})),+ Model.applicationArgument = elemDecoder}))++-- | Transform a type module into a decoder module+decodeModule :: t0 -> Graph.Graph -> Packaging.Module -> Either Errors.Error (Maybe Packaging.Module)+decodeModule cx graph mod =+ Eithers.bind (filterTypeBindings cx graph (Optionals.givens (Lists.map (\d -> case d of+ Packaging.DefinitionType v0 -> Just ((\name -> \typ ->+ let schemaTerm = Model.TermVariable (Model.Name "hydra.core.model.Type")+ dataTerm =+ Annotations.normalizeTermAnnotations (Model.TermAnnotated (Model.AnnotatedTerm {+ Model.annotatedTermBody = (EncodeModel.type_ typ),+ Model.annotatedTermAnnotation = (Annotations.wrapAnnotationMap (Maps.fromList [+ (Constants.keyType, schemaTerm)]))}))+ in Model.Binding {+ Model.bindingName = name,+ Model.bindingTerm = dataTerm,+ Model.bindingTypeScheme = (Just (Model.TypeScheme {+ Model.typeSchemeVariables = [],+ Model.typeSchemeBody = (Model.TypeVariable (Model.Name "hydra.core.model.Type")),+ Model.typeSchemeConstraints = Maps.empty}))}) (Packaging.typeDefinitionName v0) (Model.typeSchemeBody (Packaging.typeDefinitionBody v0)))+ _ -> Nothing) (Packaging.moduleDefinitions mod)))) (\typeBindings -> Logic.ifElse (Lists.isEmpty typeBindings) (Right Nothing) (Eithers.bind (Eithers.mapList (\b -> Eithers.bimap (\_e -> Errors.ErrorDecoding _e) (\x -> x) (decodeBinding cx graph b)) typeBindings) (\decodedBindings ->+ let allDecodedDeps =+ Lists.distinct (Lists.map decodeModuleName (Lists.map (\dep -> Packaging.moduleDependencyModule dep) (Packaging.moduleDependencies mod)))+ in (Right (Just (Packaging.Module {+ Packaging.moduleName = (decodeModuleName (Packaging.moduleName mod)),+ Packaging.moduleMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just (Strings.concat [+ "Term decoders for ",+ (Packaging.unModuleName (Packaging.moduleName mod))])),+ Packaging.entityMetadataComments = [],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.moduleDependencies = (Lists.map (\ns -> Packaging.ModuleDependency {+ Packaging.moduleDependencyModule = ns,+ Packaging.moduleDependencyPackage = Nothing}) (Lists.concat2 [+ Packaging.ModuleName "hydra.core.extract.model",+ (Packaging.ModuleName "hydra.core.lexical"),+ (Packaging.ModuleName "hydra.core.rewriting"),+ (Packaging.moduleName mod),+ (Packaging.ModuleName "hydra.core.util")] allDecodedDeps)),+ Packaging.moduleDefinitions = (Lists.map (\b -> Packaging.DefinitionTerm (Packaging.TermDefinition {+ Packaging.termDefinitionName = (Model.bindingName b),+ Packaging.termDefinitionMetadata = Nothing,+ Packaging.termDefinitionSignature = (Optionals.map Scoping.typeSchemeToTermSignature (Model.bindingTypeScheme b)),+ Packaging.termDefinitionBody = (Model.bindingTerm b)})) decodedBindings)}))))))++-- | Generate a decoder module name from a source module name+decodeModuleName :: Packaging.ModuleName -> Packaging.ModuleName+decodeModuleName = Names.derivedModuleName [+ "decode"] True++-- | Generate a decoder for a pair type+decodePairType :: Model.PairType -> Model.Term+decodePairType pt =++ let firstDecoder = decodeType (Model.pairTypeFirst pt)+ secondDecoder = decodeType (Model.pairTypeSecond pt)+ in (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermVariable (Model.Name "hydra.core.extract.model.decodePair")),+ Model.typeApplicationTermType = (decoderFullResultType (Model.pairTypeFirst pt))})),+ Model.typeApplicationTermType = (decoderFullResultType (Model.pairTypeSecond pt))})),+ Model.applicationArgument = firstDecoder})),+ Model.applicationArgument = secondDecoder}))++-- | Generate a decoder for a record type+decodeRecordType :: [Model.FieldType] -> Model.Term+decodeRecordType rt = decodeRecordTypeImpl (Model.Name "unknown") rt (Model.TypeVariable (Model.Name "unknown"))++-- | Generate a decoder for a record type with a type name. rtype is the fully-applied result type (e.g. Table<v>) used for the record's body annotations. (#476)+decodeRecordTypeImpl :: Model.Name -> [Model.FieldType] -> Model.Type -> Model.Term+decodeRecordTypeImpl tname rt rtype =++ let recType = rtype+ graphType = Model.TypeVariable (Model.Name "hydra.core.graph.Graph")+ termType = Model.TypeVariable (Model.Name "hydra.core.model.Term")+ decodeFieldTerm =+ \ft -> Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermVariable (Model.Name "hydra.core.extract.model.requireField")),+ Model.typeApplicationTermType = graphType})),+ Model.typeApplicationTermType = termType})),+ Model.typeApplicationTermType = (decoderFullResultType (Model.fieldTypeType ft))})),+ Model.applicationArgument = (Model.TermLiteral (Model.LiteralString (Model.unName (Model.fieldTypeName ft))))})),+ Model.applicationArgument = (decodeType (Model.fieldTypeType ft))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "fieldMap"))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "cx"))})+ localVarName =+ \ft -> Model.Name (Strings.concat [+ "field_",+ (Model.unName (Model.fieldTypeName ft))])+ toFieldLambda =+ \ft -> \body -> Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (localVarName ft),+ Model.lambdaDomain = (Just (decoderFullResultType (Model.fieldTypeType ft))),+ Model.lambdaBody = body})+ decodeBody =+ Lists.foldl (\acc -> \ft -> Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermVariable (Model.Name "hydra.core.lib.eithers.bind")),+ Model.typeApplicationTermType = (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError"))})),+ Model.typeApplicationTermType = (decoderFullResultType (Model.fieldTypeType ft))})),+ Model.typeApplicationTermType = recType})),+ Model.applicationArgument = (decodeFieldTerm ft)})),+ Model.applicationArgument = (toFieldLambda ft acc)})) (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermEither (Right (Model.TermRecord (Model.Record {+ Model.recordTypeName = tname,+ Model.recordFields = (Lists.map (\ft -> Model.Field {+ Model.fieldName = (Model.fieldTypeName ft),+ Model.fieldTerm = (Model.TermVariable (localVarName ft))}) rt)})))),+ Model.typeApplicationTermType = (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError"))})),+ Model.typeApplicationTermType = recType})) (Lists.reverse rt)+ in (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "cx"),+ Model.lambdaDomain = (Just (Model.TypeVariable (Model.Name "hydra.core.graph.Graph"))),+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "raw"),+ Model.lambdaDomain = (Just (Model.TypeVariable (Model.Name "hydra.core.model.Term"))),+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermVariable (Model.Name "hydra.core.lib.eithers.either")),+ Model.typeApplicationTermType = (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError"))})),+ Model.typeApplicationTermType = (Model.TypeVariable (Model.Name "hydra.core.model.Term"))})),+ Model.typeApplicationTermType = (Model.TypeEither (Model.EitherType {+ Model.eitherTypeLeft = (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError")),+ Model.eitherTypeRight = recType}))})),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "err"),+ Model.lambdaDomain = (Just (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError"))),+ Model.lambdaBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermEither (Left (Model.TermVariable (Model.Name "err")))),+ Model.typeApplicationTermType = (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError"))})),+ Model.typeApplicationTermType = recType}))}))})),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "stripped"),+ Model.lambdaDomain = (Just (Model.TypeVariable (Model.Name "hydra.core.model.Term"))),+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermCases (Model.CaseStatement {+ Model.caseStatementTypeName = (Model.Name "hydra.core.model.Term"),+ Model.caseStatementDefault = (Just (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermEither (Left (Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.Name "hydra.core.errors.DecodingError"),+ Model.wrappedTermBody = (Model.TermLiteral (Model.LiteralString (Strings.concat [+ "expected a record of type ",+ (Model.unName tname)])))})))),+ Model.typeApplicationTermType = (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError"))})),+ Model.typeApplicationTermType = recType}))),+ Model.caseStatementCases = [+ Model.CaseAlternative {+ Model.caseAlternativeName = (Model.Name "record"),+ Model.caseAlternativeHandler = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "record"),+ Model.lambdaDomain = (Just (Model.TypeVariable (Model.Name "hydra.core.model.Record"))),+ Model.lambdaBody = (Model.TermLet (Model.Let {+ Model.letBindings = [+ Model.Binding {+ Model.bindingName = (Model.Name "fieldMap"),+ Model.bindingTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.extract.model.toFieldMap")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "record"))})),+ Model.bindingTypeScheme = (Just (Model.TypeScheme {+ Model.typeSchemeVariables = [],+ Model.typeSchemeBody = (Model.TypeMap (Model.MapType {+ Model.mapTypeKeys = (Model.TypeVariable (Model.Name "hydra.core.model.Name")),+ Model.mapTypeValues = (Model.TypeVariable (Model.Name "hydra.core.model.Term"))})),+ Model.typeSchemeConstraints = Maps.empty}))}],+ Model.letBody = decodeBody}))}))}]})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "stripped"))}))}))})),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.extract.model.stripWithDecodingError")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "cx"))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "raw"))}))}))}))}))++-- | Generate a decoder for a record type with element name+decodeRecordTypeNamed :: Model.Name -> [Model.FieldType] -> Model.Type -> Model.Term+decodeRecordTypeNamed ename rt rtype = decodeRecordTypeImpl ename rt rtype++-- | Generate a decoder for a set type+decodeSetType :: Model.Type -> Model.Term+decodeSetType elemType =++ let elemDecoder = decodeType elemType+ in (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermVariable (Model.Name "hydra.core.extract.model.decodeSet")),+ Model.typeApplicationTermType = (decoderFullResultType elemType)})),+ Model.applicationArgument = elemDecoder}))++-- | Generate a decoder term for a Type+decodeType :: Model.Type -> Model.Term+decodeType typ =+ case typ of+ Model.TypeAnnotated v0 -> decodeType (Model.annotatedTypeBody v0)+ Model.TypeApplication v0 -> Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (decodeType (Model.applicationTypeFunction v0)),+ Model.typeApplicationTermType = (decoderFullResultType (Model.applicationTypeArgument v0))})),+ Model.applicationArgument = (decodeType (Model.applicationTypeArgument v0))})+ Model.TypeEither v0 -> decodeEitherType v0+ Model.TypeForall v0 -> decodeForallType v0+ Model.TypeList v0 -> decodeListType v0+ Model.TypeLiteral v0 -> decodeLiteralType v0+ Model.TypeMap v0 -> decodeMapType v0+ Model.TypeOptional v0 -> decodeMaybeType v0+ Model.TypePair v0 -> decodePairType v0+ Model.TypeRecord v0 -> decodeRecordType v0+ Model.TypeSet v0 -> decodeSetType v0+ Model.TypeUnion v0 -> decodeUnionType v0+ Model.TypeUnit -> decodeUnitType+ Model.TypeVoid -> decodeUnitType+ Model.TypeWrap v0 -> decodeWrappedType v0+ Model.TypeVariable v0 -> Model.TermVariable (decodeBindingName v0)+ _ -> Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "cx"),+ Model.lambdaDomain = (Just (Model.TypeVariable (Model.Name "hydra.core.graph.Graph"))),+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "t"),+ Model.lambdaDomain = (Just (Model.TypeVariable (Model.Name "hydra.core.model.Term"))),+ Model.lambdaBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermEither (Left (Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.Name "hydra.core.errors.DecodingError"),+ Model.wrappedTermBody = (Model.TermLiteral (Model.LiteralString "unsupported type variant"))})))),+ Model.typeApplicationTermType = (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError"))})),+ Model.typeApplicationTermType = (Model.TypeVariable (Model.Name "hydra.core.model.Term"))}))}))})++-- | Generate a decoder term for a Type, with element name for nominal types. rtype is the FULLY-APPLIED result type for nominal bodies (e.g. DataRow<v> for forall v. wrap...), so the body's intermediate type annotations carry the type parameters rather than a bare nominal name — otherwise Java/Scala coders emit raw types that fail to compile against the parameterized signature. (#476)+decodeTypeNamed :: Model.Name -> Model.Type -> Model.Type -> Model.Term+decodeTypeNamed ename typ rtype =+ case typ of+ Model.TypeAnnotated v0 -> decodeTypeNamed ename (Model.annotatedTypeBody v0) rtype+ Model.TypeApplication v0 -> Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (decodeType (Model.applicationTypeFunction v0)),+ Model.typeApplicationTermType = (decoderFullResultType (Model.applicationTypeArgument v0))})),+ Model.applicationArgument = (decodeType (Model.applicationTypeArgument v0))})+ Model.TypeEither v0 -> decodeEitherType v0+ Model.TypeForall v0 -> Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (decodeBindingName (Model.forallTypeParameter v0)),+ Model.lambdaDomain = (Just (Model.TypeFunction (Model.FunctionType {+ Model.functionTypeDomain = (Model.TypeVariable (Model.Name "hydra.core.graph.Graph")),+ Model.functionTypeCodomain = (Model.TypeFunction (Model.FunctionType {+ Model.functionTypeDomain = (Model.TypeVariable (Model.Name "hydra.core.model.Term")),+ Model.functionTypeCodomain = (Model.TypeEither (Model.EitherType {+ Model.eitherTypeLeft = (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError")),+ Model.eitherTypeRight = (Model.TypeVariable (Model.forallTypeParameter v0))}))}))}))),+ Model.lambdaBody = (decodeTypeNamed ename (Model.forallTypeBody v0) rtype)})+ Model.TypeList v0 -> decodeListType v0+ Model.TypeLiteral v0 -> decodeLiteralType v0+ Model.TypeMap v0 -> decodeMapType v0+ Model.TypeOptional v0 -> decodeMaybeType v0+ Model.TypePair v0 -> decodePairType v0+ Model.TypeRecord v0 -> decodeRecordTypeNamed ename v0 rtype+ Model.TypeSet v0 -> decodeSetType v0+ Model.TypeUnion v0 -> decodeUnionTypeNamed ename v0 rtype+ Model.TypeUnit -> decodeUnitType+ Model.TypeVoid -> decodeUnitType+ Model.TypeWrap v0 -> decodeWrappedTypeNamed ename v0 rtype+ Model.TypeVariable v0 -> Model.TermVariable (decodeBindingName v0)+ _ -> Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "cx"),+ Model.lambdaDomain = (Just (Model.TypeVariable (Model.Name "hydra.core.graph.Graph"))),+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "t"),+ Model.lambdaDomain = (Just (Model.TypeVariable (Model.Name "hydra.core.model.Term"))),+ Model.lambdaBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermEither (Left (Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.Name "hydra.core.errors.DecodingError"),+ Model.wrappedTermBody = (Model.TermLiteral (Model.LiteralString "unsupported type variant"))})))),+ Model.typeApplicationTermType = (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError"))})),+ Model.typeApplicationTermType = (Model.TypeVariable (Model.Name "hydra.core.model.Term"))}))}))})++-- | Generate a decoder for a union type+decodeUnionType :: [Model.FieldType] -> Model.Term+decodeUnionType rt = decodeUnionTypeNamed (Model.Name "unknown") rt (Model.TypeVariable (Model.Name "unknown"))++-- | Generate a decoder for a union type with the given element name. rtype is the fully-applied result type (e.g. Foo<v>) used for body annotations. (#476)+decodeUnionTypeNamed :: Model.Name -> [Model.FieldType] -> Model.Type -> Model.Term+decodeUnionTypeNamed ename rt rtype =++ let unionType = rtype+ decErrType = Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError")+ nameType = Model.TypeVariable (Model.Name "hydra.core.model.Name")+ variantFnType =+ Model.TypeFunction (Model.FunctionType {+ Model.functionTypeDomain = (Model.TypeVariable (Model.Name "hydra.core.model.Term")),+ Model.functionTypeCodomain = (Model.TypeEither (Model.EitherType {+ Model.eitherTypeLeft = decErrType,+ Model.eitherTypeRight = unionType}))})+ toVariantPair =+ \ft ->+ let fldType = decoderFullResultType (Model.fieldTypeType ft)+ in (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermPair (+ Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.Name "hydra.core.model.Name"),+ Model.wrappedTermBody = (Model.TermLiteral (Model.LiteralString (Model.unName (Model.fieldTypeName ft))))}),+ (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "input"),+ Model.lambdaDomain = (Just (Model.TypeVariable (Model.Name "hydra.core.model.Term"))),+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermVariable (Model.Name "hydra.core.lib.eithers.map")),+ Model.typeApplicationTermType = fldType})),+ Model.typeApplicationTermType = unionType})),+ Model.typeApplicationTermType = decErrType})),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "t"),+ Model.lambdaDomain = (Just fldType),+ Model.lambdaBody = (Model.TermInject (Model.Injection {+ Model.injectionTypeName = ename,+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.fieldTypeName ft),+ Model.fieldTerm = (Model.TermVariable (Model.Name "t"))}}))}))})),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (decodeType (Model.fieldTypeType ft)),+ Model.applicationArgument = (Model.TermVariable (Model.Name "cx"))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "input"))}))}))})))),+ Model.typeApplicationTermType = (Model.TypeVariable (Model.Name "hydra.core.model.Name"))})),+ Model.typeApplicationTermType = variantFnType}))+ in (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "cx"),+ Model.lambdaDomain = (Just (Model.TypeVariable (Model.Name "hydra.core.graph.Graph"))),+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "raw"),+ Model.lambdaDomain = (Just (Model.TypeVariable (Model.Name "hydra.core.model.Term"))),+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermVariable (Model.Name "hydra.core.lib.eithers.either")),+ Model.typeApplicationTermType = (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError"))})),+ Model.typeApplicationTermType = (Model.TypeVariable (Model.Name "hydra.core.model.Term"))})),+ Model.typeApplicationTermType = (Model.TypeEither (Model.EitherType {+ Model.eitherTypeLeft = (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError")),+ Model.eitherTypeRight = unionType}))})),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "err"),+ Model.lambdaDomain = (Just (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError"))),+ Model.lambdaBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermEither (Left (Model.TermVariable (Model.Name "err")))),+ Model.typeApplicationTermType = (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError"))})),+ Model.typeApplicationTermType = unionType}))}))})),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "stripped"),+ Model.lambdaDomain = (Just (Model.TypeVariable (Model.Name "hydra.core.model.Term"))),+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermCases (Model.CaseStatement {+ Model.caseStatementTypeName = (Model.Name "hydra.core.model.Term"),+ Model.caseStatementDefault = (Just (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermEither (Left (Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.Name "hydra.core.errors.DecodingError"),+ Model.wrappedTermBody = (Model.TermLiteral (Model.LiteralString "expected union"))})))),+ Model.typeApplicationTermType = (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError"))})),+ Model.typeApplicationTermType = unionType}))),+ Model.caseStatementCases = [+ Model.CaseAlternative {+ Model.caseAlternativeName = (Model.Name "inject"),+ Model.caseAlternativeHandler = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "inj"),+ Model.lambdaDomain = (Just (Model.TypeVariable (Model.Name "hydra.core.model.Injection"))),+ Model.lambdaBody = (Model.TermLet (Model.Let {+ Model.letBindings = [+ Model.Binding {+ Model.bindingName = (Model.Name "field"),+ Model.bindingTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.model.Injection"),+ Model.projectionFieldName = (Model.Name "field")})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "inj"))})),+ Model.bindingTypeScheme = (Just (Model.TypeScheme {+ Model.typeSchemeVariables = [],+ Model.typeSchemeBody = (Model.TypeVariable (Model.Name "hydra.core.model.Field")),+ Model.typeSchemeConstraints = Maps.empty}))},+ Model.Binding {+ Model.bindingName = (Model.Name "fname"),+ Model.bindingTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.model.Field"),+ Model.projectionFieldName = (Model.Name "name")})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "field"))})),+ Model.bindingTypeScheme = (Just (Model.TypeScheme {+ Model.typeSchemeVariables = [],+ Model.typeSchemeBody = (Model.TypeVariable (Model.Name "hydra.core.model.Name")),+ Model.typeSchemeConstraints = Maps.empty}))},+ Model.Binding {+ Model.bindingName = (Model.Name "fterm"),+ Model.bindingTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.model.Field"),+ Model.projectionFieldName = (Model.Name "term")})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "field"))})),+ Model.bindingTypeScheme = (Just (Model.TypeScheme {+ Model.typeSchemeVariables = [],+ Model.typeSchemeBody = (Model.TypeVariable (Model.Name "hydra.core.model.Term")),+ Model.typeSchemeConstraints = Maps.empty}))},+ Model.Binding {+ Model.bindingName = (Model.Name "variantMap"),+ Model.bindingTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermVariable (Model.Name "hydra.core.lib.maps.fromList")),+ Model.typeApplicationTermType = nameType})),+ Model.typeApplicationTermType = variantFnType})),+ Model.applicationArgument = (Model.TermList (Lists.map toVariantPair rt))})),+ Model.bindingTypeScheme = (Just (Model.TypeScheme {+ Model.typeSchemeVariables = [],+ Model.typeSchemeBody = (Model.TypeMap (Model.MapType {+ Model.mapTypeKeys = nameType,+ Model.mapTypeValues = variantFnType})),+ Model.typeSchemeConstraints = Maps.empty}))}],+ Model.letBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermVariable (Model.Name "hydra.core.lib.optionals.match")),+ Model.typeApplicationTermType = variantFnType})),+ Model.typeApplicationTermType = (Model.TypeEither (Model.EitherType {+ Model.eitherTypeLeft = decErrType,+ Model.eitherTypeRight = unionType}))})),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermVariable (Model.Name "hydra.core.lib.maps.lookup")),+ Model.typeApplicationTermType = nameType})),+ Model.typeApplicationTermType = variantFnType})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "fname"))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "variantMap"))}))})),+ Model.applicationArgument = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermEither (Left (Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.Name "hydra.core.errors.DecodingError"),+ Model.wrappedTermBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.strings.concat")),+ Model.applicationArgument = (Model.TermList [+ Model.TermLiteral (Model.LiteralString "no such field "),+ (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermUnwrap (Model.Name "hydra.core.model.Name")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "fname"))})),+ (Model.TermLiteral (Model.LiteralString " in union"))])}))})))),+ Model.typeApplicationTermType = (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError"))})),+ Model.typeApplicationTermType = unionType}))})),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "f"),+ Model.lambdaDomain = (Just variantFnType),+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "f")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "fterm"))}))}))}))}))}))}]})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "stripped"))}))}))})),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.extract.model.stripWithDecodingError")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "cx"))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "raw"))}))}))}))}))++-- | Generate a decoder for the unit type+decodeUnitType :: Model.Term+decodeUnitType =+ Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "cx"),+ Model.lambdaDomain = (Just (Model.TypeVariable (Model.Name "hydra.core.graph.Graph"))),+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "t"),+ Model.lambdaDomain = (Just (Model.TypeVariable (Model.Name "hydra.core.model.Term"))),+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.extract.model.decodeUnit")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "cx"))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "t"))}))}))})++-- | Generate a decoder for a wrapped type+decodeWrappedType :: Model.Type -> Model.Term+decodeWrappedType wt = decodeWrappedTypeNamed (Model.Name "unknown") wt (Model.TypeVariable (Model.Name "unknown"))++-- | Generate a decoder for a wrapped type with the given element name. rtype is the fully-applied result type (e.g. DataRow<v>) used for body annotations. (#476)+decodeWrappedTypeNamed :: Model.Name -> Model.Type -> Model.Type -> Model.Term+decodeWrappedTypeNamed ename wt rtype =++ let bodyDecoder = decodeType wt+ bodyType = decoderFullResultType wt+ in (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "cx"),+ Model.lambdaDomain = (Just (Model.TypeVariable (Model.Name "hydra.core.graph.Graph"))),+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "raw"),+ Model.lambdaDomain = (Just (Model.TypeVariable (Model.Name "hydra.core.model.Term"))),+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermVariable (Model.Name "hydra.core.lib.eithers.either")),+ Model.typeApplicationTermType = (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError"))})),+ Model.typeApplicationTermType = (Model.TypeVariable (Model.Name "hydra.core.model.Term"))})),+ Model.typeApplicationTermType = (Model.TypeEither (Model.EitherType {+ Model.eitherTypeLeft = (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError")),+ Model.eitherTypeRight = rtype}))})),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "err"),+ Model.lambdaDomain = (Just (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError"))),+ Model.lambdaBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermEither (Left (Model.TermVariable (Model.Name "err")))),+ Model.typeApplicationTermType = (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError"))})),+ Model.typeApplicationTermType = rtype}))}))})),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "stripped"),+ Model.lambdaDomain = (Just (Model.TypeVariable (Model.Name "hydra.core.model.Term"))),+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermCases (Model.CaseStatement {+ Model.caseStatementTypeName = (Model.Name "hydra.core.model.Term"),+ Model.caseStatementDefault = (Just (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermEither (Left (Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.Name "hydra.core.errors.DecodingError"),+ Model.wrappedTermBody = (Model.TermLiteral (Model.LiteralString "expected wrapped type"))})))),+ Model.typeApplicationTermType = (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError"))})),+ Model.typeApplicationTermType = rtype}))),+ Model.caseStatementCases = [+ Model.CaseAlternative {+ Model.caseAlternativeName = (Model.Name "wrap"),+ Model.caseAlternativeHandler = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "wrappedTerm"),+ Model.lambdaDomain = (Just (Model.TypeVariable (Model.Name "hydra.core.model.WrappedTerm"))),+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermVariable (Model.Name "hydra.core.lib.eithers.map")),+ Model.typeApplicationTermType = bodyType})),+ Model.typeApplicationTermType = rtype})),+ Model.typeApplicationTermType = (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError"))})),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "b"),+ Model.lambdaDomain = (Just bodyType),+ Model.lambdaBody = (Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = ename,+ Model.wrappedTermBody = (Model.TermVariable (Model.Name "b"))}))}))})),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = bodyDecoder,+ Model.applicationArgument = (Model.TermVariable (Model.Name "cx"))})),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.model.WrappedTerm"),+ Model.projectionFieldName = (Model.Name "body")})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "wrappedTerm"))}))}))}))}))}]})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "stripped"))}))}))})),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.extract.model.stripWithDecodingError")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "cx"))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "raw"))}))}))}))}))++-- | Get full result type for decoder+decoderFullResultType :: Model.Type -> Model.Type+decoderFullResultType typ =+ case typ of+ Model.TypeAnnotated v0 -> decoderFullResultType (Model.annotatedTypeBody v0)+ Model.TypeApplication v0 -> Model.TypeApplication (Model.ApplicationType {+ Model.applicationTypeFunction = (decoderFullResultType (Model.applicationTypeFunction v0)),+ Model.applicationTypeArgument = (Model.applicationTypeArgument v0)})+ Model.TypeEffect v0 -> Model.TypeEffect (decoderFullResultType v0)+ Model.TypeEither v0 -> Model.TypeEither (Model.EitherType {+ Model.eitherTypeLeft = (decoderFullResultType (Model.eitherTypeLeft v0)),+ Model.eitherTypeRight = (decoderFullResultType (Model.eitherTypeRight v0))})+ Model.TypeForall v0 -> applyForallParamsInOrder (decoderFullResultType (stripForalls (Model.forallTypeBody v0))) (collectForallVariables typ)+ Model.TypeList v0 -> Model.TypeList (decoderFullResultType v0)+ Model.TypeLiteral v0 -> Model.TypeLiteral v0+ Model.TypeMap v0 -> Model.TypeMap (Model.MapType {+ Model.mapTypeKeys = (decoderFullResultType (Model.mapTypeKeys v0)),+ Model.mapTypeValues = (decoderFullResultType (Model.mapTypeValues v0))})+ Model.TypeOptional v0 -> Model.TypeOptional (decoderFullResultType v0)+ Model.TypePair v0 -> Model.TypePair (Model.PairType {+ Model.pairTypeFirst = (decoderFullResultType (Model.pairTypeFirst v0)),+ Model.pairTypeSecond = (decoderFullResultType (Model.pairTypeSecond v0))})+ Model.TypeRecord _ -> Model.TypeVariable (Model.Name "hydra.core.model.Term")+ Model.TypeSet v0 -> Model.TypeSet (decoderFullResultType v0)+ Model.TypeUnion _ -> Model.TypeVariable (Model.Name "hydra.core.model.Term")+ Model.TypeUnit -> Model.TypeUnit+ Model.TypeVariable v0 -> Model.TypeVariable v0+ Model.TypeVoid -> Model.TypeVoid+ Model.TypeWrap v0 -> decoderFullResultType v0+ _ -> Model.TypeVariable (Model.Name "hydra.core.model.Term")++-- | Get full result type for decoder with element name+decoderFullResultTypeNamed :: Model.Name -> Model.Type -> Model.Type+decoderFullResultTypeNamed ename typ =+ case typ of+ Model.TypeAnnotated v0 -> decoderFullResultTypeNamed ename (Model.annotatedTypeBody v0)+ Model.TypeForall v0 -> applyForallParamsInOrder (decoderFullResultTypeNamed ename (stripForalls (Model.forallTypeBody v0))) (collectForallVariables typ)+ Model.TypeRecord _ -> Model.TypeVariable ename+ Model.TypeUnion _ -> Model.TypeVariable ename+ Model.TypeWrap _ -> Model.TypeVariable ename+ Model.TypeApplication v0 -> Model.TypeApplication (Model.ApplicationType {+ Model.applicationTypeFunction = (decoderFullResultType (Model.applicationTypeFunction v0)),+ Model.applicationTypeArgument = (Model.applicationTypeArgument v0)})+ Model.TypeEffect v0 -> Model.TypeEffect (decoderFullResultType v0)+ Model.TypeEither v0 -> Model.TypeEither (Model.EitherType {+ Model.eitherTypeLeft = (decoderFullResultType (Model.eitherTypeLeft v0)),+ Model.eitherTypeRight = (decoderFullResultType (Model.eitherTypeRight v0))})+ Model.TypeList v0 -> Model.TypeList (decoderFullResultType v0)+ Model.TypeLiteral v0 -> Model.TypeLiteral v0+ Model.TypeMap v0 -> Model.TypeMap (Model.MapType {+ Model.mapTypeKeys = (decoderFullResultType (Model.mapTypeKeys v0)),+ Model.mapTypeValues = (decoderFullResultType (Model.mapTypeValues v0))})+ Model.TypeOptional v0 -> Model.TypeOptional (decoderFullResultType v0)+ Model.TypePair v0 -> Model.TypePair (Model.PairType {+ Model.pairTypeFirst = (decoderFullResultType (Model.pairTypeFirst v0)),+ Model.pairTypeSecond = (decoderFullResultType (Model.pairTypeSecond v0))})+ Model.TypeSet v0 -> Model.TypeSet (decoderFullResultType v0)+ Model.TypeUnit -> Model.TypeUnit+ Model.TypeVariable v0 -> Model.TypeVariable v0+ Model.TypeVoid -> Model.TypeVoid+ _ -> Model.TypeVariable (Model.Name "hydra.core.model.Term")++-- | Compute the result type name for a decoder+decoderResultType :: Model.Type -> Model.Name+decoderResultType typ =+ case typ of+ Model.TypeAnnotated v0 -> decoderResultType (Model.annotatedTypeBody v0)+ Model.TypeApplication v0 -> decoderResultType (Model.applicationTypeFunction v0)+ Model.TypeForall v0 -> decoderResultType (Model.forallTypeBody v0)+ Model.TypeLiteral _ -> Model.Name "hydra.core.model.Literal"+ Model.TypeRecord _ -> Model.Name "hydra.core.model.Term"+ Model.TypeUnion _ -> Model.Name "hydra.core.model.Term"+ Model.TypeWrap _ -> Model.Name "hydra.core.model.Term"+ _ -> Model.Name "hydra.core.model.Term"++-- | Build decoder function type+decoderType :: Model.Type -> Model.Type+decoderType typ =++ let resultType = decoderFullResultType typ+ baseType =+ Model.TypeFunction (Model.FunctionType {+ Model.functionTypeDomain = (Model.TypeVariable (Model.Name "hydra.core.graph.Graph")),+ Model.functionTypeCodomain = (Model.TypeFunction (Model.FunctionType {+ Model.functionTypeDomain = (Model.TypeVariable (Model.Name "hydra.core.model.Term")),+ Model.functionTypeCodomain = (Model.TypeEither (Model.EitherType {+ Model.eitherTypeLeft = (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError")),+ Model.eitherTypeRight = resultType}))}))})+ in (prependForallDecoders baseType typ)++-- | Build decoder function type with element name+decoderTypeNamed :: Model.Name -> Model.Type -> Model.Type+decoderTypeNamed ename typ =++ let resultType = decoderFullResultTypeNamed ename typ+ baseType =+ Model.TypeFunction (Model.FunctionType {+ Model.functionTypeDomain = (Model.TypeVariable (Model.Name "hydra.core.graph.Graph")),+ Model.functionTypeCodomain = (Model.TypeFunction (Model.FunctionType {+ Model.functionTypeDomain = (Model.TypeVariable (Model.Name "hydra.core.model.Term")),+ Model.functionTypeCodomain = (Model.TypeEither (Model.EitherType {+ Model.eitherTypeLeft = (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError")),+ Model.eitherTypeRight = resultType}))}))})+ in (prependForallDecoders baseType typ)++-- | Build type scheme for a decoder function+decoderTypeScheme :: Model.Type -> Model.TypeScheme+decoderTypeScheme typ =++ let typeVars = collectTypeVariables typ+ allOrdVars = collectOrdConstrainedVariables typ+ ordVars = Lists.filter (\v -> Lists.member v typeVars) allOrdVars+ constraints =+ Maps.fromList (Lists.map (\v -> (+ v,+ Model.TypeVariableConstraints {+ Model.typeVariableConstraintsClasses = (Sets.singleton (Model.TypeClassConstraintSimple (Model.Name "ordering")))})) ordVars)+ in Model.TypeScheme {+ Model.typeSchemeVariables = typeVars,+ Model.typeSchemeBody = (decoderType typ),+ Model.typeSchemeConstraints = constraints}++-- | Build type scheme for a decoder function with element name+decoderTypeSchemeNamed :: Model.Name -> Model.Type -> Model.TypeScheme+decoderTypeSchemeNamed ename typ =++ let typeVars = collectTypeVariables typ+ allOrdVars = collectOrdConstrainedVariables typ+ ordVars = Lists.filter (\v -> Lists.member v typeVars) allOrdVars+ constraints =+ Maps.fromList (Lists.map (\v -> (+ v,+ Model.TypeVariableConstraints {+ Model.typeVariableConstraintsClasses = (Sets.singleton (Model.TypeClassConstraintSimple (Model.Name "ordering")))})) ordVars)+ in Model.TypeScheme {+ Model.typeSchemeVariables = typeVars,+ Model.typeSchemeBody = (decoderTypeNamed ename typ),+ Model.typeSchemeConstraints = constraints}++-- | Filter bindings to only decodable type definitions+filterTypeBindings :: t0 -> Graph.Graph -> [Model.Binding] -> Either Errors.Error [Model.Binding]+filterTypeBindings cx graph bindings =+ Eithers.map Optionals.givens (Eithers.mapList (isDecodableBinding cx graph) (Lists.filter Annotations.isNativeType bindings))++-- | Check if a binding is decodable (serializable type)+isDecodableBinding :: t0 -> Graph.Graph -> Model.Binding -> Either Errors.Error (Maybe Model.Binding)+isDecodableBinding cx graph b =+ Eithers.bind (Predicates.isSerializableByName cx graph (Model.bindingName b)) (\serializable -> Right (Logic.ifElse serializable (Just b) Nothing))++-- | Prepend decoder types for forall parameters to base type+prependForallDecoders :: Model.Type -> Model.Type -> Model.Type+prependForallDecoders baseType typ =+ case typ of+ Model.TypeAnnotated v0 -> prependForallDecoders baseType (Model.annotatedTypeBody v0)+ Model.TypeForall v0 -> Model.TypeFunction (Model.FunctionType {+ Model.functionTypeDomain = (Model.TypeFunction (Model.FunctionType {+ Model.functionTypeDomain = (Model.TypeVariable (Model.Name "hydra.core.graph.Graph")),+ Model.functionTypeCodomain = (Model.TypeFunction (Model.FunctionType {+ Model.functionTypeDomain = (Model.TypeVariable (Model.Name "hydra.core.model.Term")),+ Model.functionTypeCodomain = (Model.TypeEither (Model.EitherType {+ Model.eitherTypeLeft = (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError")),+ Model.eitherTypeRight = (Model.TypeVariable (Model.forallTypeParameter v0))}))}))})),+ Model.functionTypeCodomain = (prependForallDecoders baseType (Model.forallTypeBody v0))})+ _ -> baseType++-- | Remove all leading forall quantifiers, returning the quantified body+stripForalls :: Model.Type -> Model.Type+stripForalls typ =+ case typ of+ Model.TypeAnnotated v0 -> stripForalls (Model.annotatedTypeBody v0)+ Model.TypeForall v0 -> stripForalls (Model.forallTypeBody v0)+ _ -> typ
@@ -0,0 +1,360 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Dependency extraction, binding sort, and let normalization++module Hydra.Core.Dependencies where++import qualified Hydra.Core.Annotations as Annotations+import qualified Hydra.Core.Ast as Ast+import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Constants as Constants+import qualified Hydra.Core.Diff as Diff+import qualified Hydra.Core.Docs as Docs+import qualified Hydra.Core.Error.Checking as Checking+import qualified Hydra.Core.Error.File as ErrorFile+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Error.Packaging as ErrorPackaging+import qualified Hydra.Core.Error.System as ErrorSystem+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Json.Model as JsonModel+import qualified Hydra.Core.Lexical as Lexical+import qualified Hydra.Core.Overlay.Haskell.Lib.Eithers as Eithers+import qualified Hydra.Core.Overlay.Haskell.Lib.Equality as Equality+import qualified Hydra.Core.Overlay.Haskell.Lib.Lists as Lists+import qualified Hydra.Core.Overlay.Haskell.Lib.Literals as Literals+import qualified Hydra.Core.Overlay.Haskell.Lib.Logic as Logic+import qualified Hydra.Core.Overlay.Haskell.Lib.Maps as Maps+import qualified Hydra.Core.Overlay.Haskell.Lib.Math as Math+import qualified Hydra.Core.Overlay.Haskell.Lib.Optionals as Optionals+import qualified Hydra.Core.Overlay.Haskell.Lib.Ordering as Ordering+import qualified Hydra.Core.Overlay.Haskell.Lib.Pairs as Pairs+import qualified Hydra.Core.Overlay.Haskell.Lib.Sets as Sets+import qualified Hydra.Core.Overlay.Haskell.Lib.Strings as Strings+import qualified Hydra.Core.Markdown as Markdown+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Names as Names+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Parsing as Parsing+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Query as Query+import qualified Hydra.Core.Regex as Regex+import qualified Hydra.Core.Relational as Relational+import qualified Hydra.Core.Rewriting as Rewriting+import qualified Hydra.Core.Sorting as Sorting+import qualified Hydra.Core.Strip as Strip+import qualified Hydra.Core.System as System+import qualified Hydra.Core.Tabular as Tabular+import qualified Hydra.Core.Testing as Testing+import qualified Hydra.Core.Time as Time+import qualified Hydra.Core.Topology as Topology+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Validation as Validation+import qualified Hydra.Core.Variables as Variables+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void+import qualified Data.Map as M+import qualified Data.Set as S++-- | Get definitions with their dependencies+definitionsWithDependencies :: t0 -> Graph.Graph -> [Model.Binding] -> Either Errors.Error [Model.Binding]+definitionsWithDependencies cx graph original =++ let depNames = \el -> Sets.toList (termDependencyNames True False False (Model.bindingTerm el))+ allDepNames = Lists.distinct (Lists.concat2 (Lists.map Model.bindingName original) (Lists.concat (Lists.map depNames original)))+ in (Eithers.mapList (\name -> Lexical.requireBinding graph name) allDepNames)++-- | Flatten nested let expressions+flattenLetTerms :: Model.Term -> Model.Term+flattenLetTerms term =++ let rewriteBinding =+ \binding ->+ let key0 = Model.bindingName binding+ val0 = Model.bindingTerm binding+ t = Model.bindingTypeScheme binding+ in case val0 of+ Model.TermAnnotated v0 ->+ let val1 = Model.annotatedTermBody v0+ ann = Model.annotatedTermAnnotation v0+ recursive =+ rewriteBinding (Model.Binding {+ Model.bindingName = key0,+ Model.bindingTerm = val1,+ Model.bindingTypeScheme = t})+ innerBinding = Pairs.first recursive+ deps = Pairs.second recursive+ val2 = Model.bindingTerm innerBinding+ in (+ Model.Binding {+ Model.bindingName = key0,+ Model.bindingTerm = (Model.TermAnnotated (Model.AnnotatedTerm {+ Model.annotatedTermBody = val2,+ Model.annotatedTermAnnotation = ann})),+ Model.bindingTypeScheme = t},+ deps)+ Model.TermLet v0 ->+ let bindings1 = Model.letBindings v0+ body1 = Model.letBody v0+ prefix = Strings.concat2 (Model.unName key0) "_"+ qualify = \n -> Model.Name (Strings.concat2 prefix (Model.unName n))+ toSubstPair = \b -> (Model.bindingName b, (qualify (Model.bindingName b)))+ subst = Maps.fromList (Lists.map toSubstPair bindings1)+ replaceVars = Variables.substituteVariables subst+ newBody = replaceVars body1+ newBinding =+ \b -> Model.Binding {+ Model.bindingName = (qualify (Model.bindingName b)),+ Model.bindingTerm = (replaceVars (Model.bindingTerm b)),+ Model.bindingTypeScheme = (Model.bindingTypeScheme b)}+ in (+ Model.Binding {+ Model.bindingName = key0,+ Model.bindingTerm = newBody,+ Model.bindingTypeScheme = t},+ (Lists.map newBinding bindings1))+ _ -> (+ Model.Binding {+ Model.bindingName = key0,+ Model.bindingTerm = val0,+ Model.bindingTypeScheme = t},+ [])+ flattenBodyLet =+ \bindings -> \body -> case body of+ Model.TermLet v0 ->+ let innerBindings = Model.letBindings v0+ innerBody = Model.letBody v0+ in (flattenBodyLet (Lists.concat2 bindings innerBindings) innerBody)+ _ -> (Lists.concat2 [] bindings, body)+ flatten =+ \recurse -> \term2 ->+ let rewritten = recurse term2+ in case rewritten of+ Model.TermLet v0 ->+ let bindings = Model.letBindings v0+ body = Model.letBody v0+ forResult = \hr -> Lists.concat2 (Pairs.second hr) (Lists.singleton (Pairs.first hr))+ flattenedBindings = Lists.concat (Lists.map (\arg_ -> forResult (rewriteBinding arg_)) bindings)+ merged = flattenBodyLet flattenedBindings body+ newBindings = Pairs.first merged+ newBody = Pairs.second merged+ in (Model.TermLet (Model.Let {+ Model.letBindings = newBindings,+ Model.letBody = newBody}))+ _ -> rewritten+ in (Rewriting.rewriteTerm flatten term)++-- | Inline all type variables in a type using the provided schema (Either version). Note: this function is only appropriate for nonrecursive type definitions+inlineType :: M.Map Model.Name Model.Type -> Model.Type -> Either Errors.Error Model.Type+inlineType schema typ =++ let f =+ \recurse -> \typ2 ->+ let afterRecurse =+ \tr -> case tr of+ Model.TypeVariable v0 -> Optionals.match (Maps.lookup v0 schema) (Left (Errors.ErrorOther (Errors.OtherError (Strings.concat2 "No such type in schema: " (Model.unName v0))))) (inlineType schema)+ _ -> Right tr+ in (Eithers.bind (recurse typ2) (\tr -> afterRecurse tr))+ in (Rewriting.rewriteTypeM f typ)++-- | Check whether a term is a lambda, possibly nested within let and/or annotation terms+isLambda :: Model.Term -> Bool+isLambda term =+ case (Strip.deannotateTerm term) of+ Model.TermLambda _ -> True+ Model.TermLet v0 -> isLambda (Model.letBody v0)+ _ -> False++-- | Rewrite terms like `let foo = bar in λx.baz` to `λx.let foo = bar in baz`, lifting lambda-bound variables above let-bound variables, recursively. This is helpful for targets such as Python.+liftLambdaAboveLet :: Model.Term -> Model.Term+liftLambdaAboveLet term0 =++ let rewrite =+ \recurse -> \term ->+ let rewriteBinding =+ \b -> Model.Binding {+ Model.bindingName = (Model.bindingName b),+ Model.bindingTerm = (rewrite recurse (Model.bindingTerm b)),+ Model.bindingTypeScheme = (Model.bindingTypeScheme b)}+ rewriteBindings = \bs -> Lists.map rewriteBinding bs+ digForLambdas =+ \original -> \cons -> \term2 -> case term2 of+ Model.TermAnnotated v0 -> digForLambdas original (\t -> Model.TermAnnotated (Model.AnnotatedTerm {+ Model.annotatedTermBody = (cons t),+ Model.annotatedTermAnnotation = (Model.annotatedTermAnnotation v0)})) (Model.annotatedTermBody v0)+ Model.TermLambda v0 -> Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.lambdaParameter v0),+ Model.lambdaDomain = (Model.lambdaDomain v0),+ Model.lambdaBody = (digForLambdas (cons (Model.lambdaBody v0)) (\t -> cons t) (Model.lambdaBody v0))})+ Model.TermLet v0 -> digForLambdas original (\t -> cons (Model.TermLet (Model.Let {+ Model.letBindings = (rewriteBindings (Model.letBindings v0)),+ Model.letBody = t}))) (Model.letBody v0)+ _ -> recurse original+ in case term of+ Model.TermLet v0 -> digForLambdas term (\t -> Model.TermLet (Model.Let {+ Model.letBindings = (rewriteBindings (Model.letBindings v0)),+ Model.letBody = t})) (Model.letBody v0)+ _ -> recurse term+ in (Rewriting.rewriteTerm rewrite term0)++-- | Given a let expression, remove any unused bindings. The resulting expression is still a let, even if has no remaining bindings+pruneLet :: Model.Let -> Model.Let+pruneLet l =++ let bindingMap = Maps.fromList (Lists.map (\b -> (Model.bindingName b, (Model.bindingTerm b))) (Model.letBindings l))+ rootName = Model.Name "[[[root]]]"+ adj =+ \n -> Sets.intersection (Sets.fromList (Maps.keys bindingMap)) (Variables.freeVariablesInTerm (Logic.ifElse (Equality.equal n rootName) (Model.letBody l) (Optionals.withDefault Model.TermUnit (Maps.lookup n bindingMap))))+ reachable = Sorting.findReachableNodes adj rootName+ prunedBindings = Lists.filter (\b -> Sets.member (Model.bindingName b) reachable) (Model.letBindings l)+ in Model.Let {+ Model.letBindings = prunedBindings,+ Model.letBody = (Model.letBody l)}++-- | Replace all occurrences of simple typedefs (type aliases) with the aliased types, recursively+replaceTypedefs :: M.Map Model.Name Model.TypeScheme -> Model.Type -> Model.Type+replaceTypedefs types typ0 =++ let rewrite =+ \recurse -> \typ -> case typ of+ Model.TypeAnnotated v0 -> Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (rewrite recurse (Model.annotatedTypeBody v0)),+ Model.annotatedTypeAnnotation = (Model.annotatedTypeAnnotation v0)})+ Model.TypeRecord _ -> typ+ Model.TypeUnion _ -> typ+ Model.TypeVariable v0 ->+ let forMono =+ \t -> case t of+ Model.TypeRecord _ -> typ+ Model.TypeUnion _ -> typ+ Model.TypeWrap _ -> typ+ _ -> rewrite recurse t+ forTypeScheme =+ \ts ->+ let t = Model.typeSchemeBody ts+ in (Logic.ifElse (Lists.isEmpty (Model.typeSchemeVariables ts)) (forMono t) typ)+ in (Optionals.match (Maps.lookup v0 types) typ (\ts -> forTypeScheme ts))+ Model.TypeWrap _ -> typ+ _ -> recurse typ+ in (Rewriting.rewriteType rewrite typ0)++-- | Simplify terms by applying beta reduction where possible+simplifyTerm :: Model.Term -> Model.Term+simplifyTerm term =++ let simplify =+ \recurse -> \term2 ->+ let forRhs =+ \rhs -> \var -> \body -> case (Strip.deannotateTerm rhs) of+ Model.TermVariable v0 -> simplifyTerm (Variables.substituteVariable var v0 body)+ _ -> term2+ forLhs =+ \lhs -> \rhs -> case (Strip.deannotateTerm lhs) of+ Model.TermLambda v0 ->+ let var = Model.lambdaParameter v0+ body = Model.lambdaBody v0+ in (Logic.ifElse (Sets.member var (Variables.freeVariablesInTerm body)) (forRhs rhs var body) (simplifyTerm body))+ _ -> term2+ forTerm =+ \stripped -> case stripped of+ Model.TermApplication v0 ->+ let lhs = Model.applicationFunction v0+ rhs = Model.applicationArgument v0+ in (forLhs lhs rhs)+ _ -> term2+ stripped = Strip.deannotateTerm term2+ in (recurse (forTerm stripped))+ in (Rewriting.rewriteTerm simplify term)++-- | Note: does not distinguish between bound and free variables; use freeVariablesInTerm for that+termDependencyNames :: Bool -> Bool -> Bool -> Model.Term -> S.Set Model.Name+termDependencyNames binds withPrims withNoms term0 =++ let addNames =+ \names -> \term ->+ let nominal = \name -> Logic.ifElse withNoms (Sets.insert name names) names+ prim = \name -> Logic.ifElse withPrims (Sets.insert name names) names+ var = \name -> Logic.ifElse binds (Sets.insert name names) names+ in case term of+ Model.TermCases v0 -> nominal (Model.caseStatementTypeName v0)+ Model.TermProject v0 -> nominal (Model.projectionTypeName v0)+ Model.TermUnwrap v0 -> nominal v0+ Model.TermRecord v0 -> nominal (Model.recordTypeName v0)+ Model.TermInject v0 -> nominal (Model.injectionTypeName v0)+ Model.TermVariable v0 -> var v0+ Model.TermWrap v0 -> nominal (Model.wrappedTermTypeName v0)+ _ -> names+ in (Rewriting.foldOverTerm Coders.TraversalOrderPre addNames Sets.empty term0)++-- | Generate short names from a list of fully qualified names+toShortNames :: [Model.Name] -> M.Map Model.Name Model.Name+toShortNames original =++ let addName =+ \acc -> \name ->+ let local = Names.localNameOf name+ group = Optionals.withDefault Sets.empty (Maps.lookup local acc)+ in (Maps.insert local (Sets.insert name group) acc)+ groupNamesByLocal = \names -> Lists.foldl addName Maps.empty names+ groups = groupNamesByLocal original+ renameGroup =+ \localNames ->+ let local = Pairs.first localNames+ names = Pairs.second localNames+ rangeFrom = \start -> Lists.cons start (rangeFrom (Math.add start 1))+ rename =+ \name -> \i -> (name, (Model.Name (Logic.ifElse (Ordering.gt i 1) (Strings.concat2 local (Literals.printInt32 i)) local)))+ in (Lists.zipWith rename (Sets.toList names) (rangeFrom 1))+ in (Maps.fromList (Lists.concat (Lists.map renameGroup (Maps.toList groups))))++-- | Topological sort of connected components, in terms of dependencies between variable/term binding pairs. The SCC partitioning is what makes the result usable as an emission order in every target language: non-recursive bindings emit in dependency order, while a mutually recursive cluster is delivered together so the emitter can wrap it in whatever construct the host requires (mutual `let`s, joint class files, forward declarations).+topologicalSortBindingMap :: M.Map Model.Name Model.Term -> [[(Model.Name, Model.Term)]]+topologicalSortBindingMap bindingMap =++ let bindings = Maps.toList bindingMap+ keys = Sets.fromList (Lists.map Pairs.first bindings)+ hasTypeAnnotation = \term -> Optionals.isGiven (Annotations.getTermAnnotation Constants.keyType term)+ depsOf =+ \nameAndTerm ->+ let name = Pairs.first nameAndTerm+ term = Pairs.second nameAndTerm+ in (name, (Logic.ifElse (hasTypeAnnotation term) [] (Sets.toList (Sets.intersection keys (Variables.freeVariablesInTerm term)))))+ toPair =+ \name -> (name, (Optionals.withDefault (Model.TermLiteral (Model.LiteralString "Impossible!")) (Maps.lookup name bindingMap)))+ in (Lists.map (Lists.map toPair) (Sorting.topologicalSortComponents (Lists.map depsOf bindings)))++-- | Topological sort of bindings based on their dependencies. Returns `Right` with a flat order when the dependency graph is acyclic; returns `Left` with the cyclic SCCs when it is not. Use this variant when the consumer needs a strict acyclic ordering and must reject cycles (e.g. import resolution); use `topologicalSortBindingMap` when mutual recursion should be packaged into SCC groups instead.+topologicalSortBindings :: [Model.Binding] -> Either [[Model.Name]] [Model.Name]+topologicalSortBindings els =++ let adjlist = \e -> (Model.bindingName e, (Sets.toList (termDependencyNames False True True (Model.bindingTerm e))))+ in (Sorting.topologicalSort (Lists.map adjlist els))++-- | Topologically sort type definitions by their structural dependencies, grouped into SCCs. The SCC grouping handles mutually recursive types (e.g. a pair of records that reference each other's names) by delivering them together as one cluster, so the emitter can produce a coherent set of declarations rather than failing with an undefined-name error mid-emission.+topologicalSortTypeDefinitions :: [Packaging.TypeDefinition] -> [[Packaging.TypeDefinition]]+topologicalSortTypeDefinitions defs =++ let toPair =+ \def -> (+ Packaging.typeDefinitionName def,+ (Sets.toList (typeDependencyNames False (Model.typeSchemeBody (Packaging.typeDefinitionBody def)))))+ nameToDef = Maps.fromList (Lists.map (\d -> (Packaging.typeDefinitionName d, d)) defs)+ sorted = Sorting.topologicalSortComponents (Lists.map toPair defs)+ in (Lists.map (\names -> Optionals.givens (Lists.map (\n -> Maps.lookup n nameToDef) names)) sorted)++-- | Collect all type names referenced by a type. The boolean controls whether type-scheme references (free variables in type expressions) are included alongside structural references+typeDependencyNames :: Bool -> Model.Type -> S.Set Model.Name+typeDependencyNames withSchema typ =+ Logic.ifElse withSchema (Sets.union (Variables.freeVariablesInType typ) (typeNamesInType typ)) (Variables.freeVariablesInType typ)++-- | Collect every type name that appears anywhere inside a type expression+typeNamesInType :: Ord t0 => (Model.Type -> S.Set t0)+typeNamesInType typ0 =++ let addNames = \names -> \typ -> names+ in (Rewriting.foldOverType Coders.TraversalOrderPre addNames Sets.empty typ0)
@@ -0,0 +1,194 @@+-- Note: this is an automatically generated file. Do not edit.++-- | A generic, domain-agnostic framework for diffs, patches, and migrations over any 'type'/'value' grammar (hydra.core.model.Type/Term, property-graph types, RDF shapes, ...). Fully parameterized: no Type/Term/Name/step type is hardcoded. Type parameters: a = the thing being edited (a type or a value); t = a 'type' type; v = a value/instance type; s = a step into a value; n = a name/key. Fill and Migrator hold host functions and are runtime-only (not serialized).++module Hydra.Core.Diff where++import qualified Hydra.Core.Model as Model+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void+import qualified Data.Map as M++-- | A base-relative edit (delta) transforming a value into a new value. Applied forward against a base; a symmetric before/after 'diff' is derived from (base, Edit), not stored here. Canonical by construction: descend carries single-step StepEdits, so there is exactly one encoding of any change.+data Edit a s =+ -- | Leave this position unchanged+ EditRetain |+ -- | Set this position to the given value (upsert: prior presence is irrelevant)+ EditSet a |+ -- | Remove this position (valid only at a removable position, e.g. a record field or collection element)+ EditDelete |+ -- | Edit specific immediate children, one StepEdit per changed step+ EditDescend [StepEdit a s]+ deriving (Eq, Ord, Read, Show)++_Edit = Model.Name "hydra.core.diff.Edit"++_Edit_retain = Model.Name "retain"++_Edit_set = Model.Name "set"++_Edit_delete = Model.Name "delete"++_Edit_descend = Model.Name "descend"++-- | A user's answer to a hole. RUNTIME-ONLY (holds a host function; not serialized). fillNow supplies the value here (a constant is a function ignoring its input); defer leaves the hole open for an enclosing context to supply.+data Fill v =+ -- | Fill the hole here: a function from the old value (context) to the filled value+ FillFillNow (v -> v) |+ -- | Leave the hole open, to be supplied by an enclosing context where this value is embedded+ FillDefer++_Fill = Model.Name "hydra.core.diff.Fill"++_Fill_fillNow = Model.Name "fillNow"++_Fill_defer = Model.Name "defer"++-- | A demand the migration cannot satisfy from the old value alone: at a value-path, a value of the given 'type' must be supplied.+data Hole t s =+ Hole {+ -- | The value-path (sequence of steps) to the position needing a value+ holePath :: [s],+ -- | The 'type' a fill must produce at this hole+ holeType :: t}+ deriving (Eq, Ord, Read, Show)++_Hole = Model.Name "hydra.core.diff.Hole"++_Hole_path = Model.Name "path"++_Hole_type = Model.Name "type"++-- | A value supplied for a residual (deferred) hole, identified by its path (engine-internal)+data HoleFiller v s =+ HoleFiller {+ -- | The path of the residual hole being supplied+ holeFillerPath :: [s],+ -- | The value supplied for that hole+ holeFillerValue :: v}+ deriving (Eq, Ord, Read, Show)++_HoleFiller = Model.Name "hydra.core.diff.HoleFiller"++_HoleFiller_path = Model.Name "path"++_HoleFiller_value = Model.Name "value"++-- | A validation-time failure: the user's fills do not correctly answer the plan's holes+data InvalidFillError t v s =+ -- | A fillNow produced a value that does not inhabit the hole's type+ InvalidFillErrorIllTyped (Hole t s) |+ -- | A hole received no fill+ InvalidFillErrorMissingFill (Hole t s) |+ -- | A surplus fill at this index, with no hole to answer+ InvalidFillErrorExtraFill Int+ deriving (Eq, Ord, Read, Show)++_InvalidFillError = Model.Name "hydra.core.diff.InvalidFillError"++_InvalidFillError_illTyped = Model.Name "illTyped"++_InvalidFillError_missingFill = Model.Name "missingFill"++_InvalidFillError_extraFill = Model.Name "extraFill"++-- | An application-time failure: a specific instance could not be migrated by a valid Migrator+data MigrationError t v s =+ -- | The input value is not a valid instance of the old type+ MigrationErrorNotAnInstance v |+ -- | A value failed a narrowing conversion (e.g. numeric overflow); fail-fast rather than truncate+ MigrationErrorOutOfRange v |+ -- | An instance of a removed union variant whose handler is reject+ MigrationErrorRejectedVariant v |+ -- | A fill or resolver produced a value that does not inhabit the hole's type+ MigrationErrorIllTypedResult (Mistyped t v) |+ -- | A deferred hole reached application time still unanswered+ MigrationErrorUnfilledHole (Hole t s)+ deriving (Eq, Ord, Read, Show)++_MigrationError = Model.Name "hydra.core.diff.MigrationError"++_MigrationError_notAnInstance = Model.Name "notAnInstance"++_MigrationError_outOfRange = Model.Name "outOfRange"++_MigrationError_rejectedVariant = Model.Name "rejectedVariant"++_MigrationError_illTypedResult = Model.Name "illTypedResult"++_MigrationError_unfilledHole = Model.Name "unfilledHole"++-- | The result of diffing two schemas: the per-type edits (which drive the transform) bundled with the ordered holes the user must answer. Supplied once to constructMigrator so the diff is never re-passed.+data MigrationPlan n t s =+ MigrationPlan {+ -- | The schema diff: an edit per changed type, keyed by type name+ migrationPlanEdits :: (M.Map n (Edit t s)),+ -- | The ordered holes across all changed types, for the user to answer+ migrationPlanHoles :: [SchemaHole n t s]}+ deriving (Eq, Ord, Read, Show)++_MigrationPlan = Model.Name "hydra.core.diff.MigrationPlan"++_MigrationPlan_edits = Model.Name "edits"++_MigrationPlan_holes = Model.Name "holes"++-- | A constructed instance migrator. RUNTIME-ONLY (apply is a host function; not serialized). Carries the residual (deferred) holes an enclosing context must supply, and applies to a value given values for those residual holes.+data Migrator t v s =+ Migrator {+ -- | Deferred holes that an enclosing context must supply when composing this migrator+ migratorResidualHoles :: [Hole t s],+ -- | Migrate a value, given values for the residual holes; fails with a MigrationError per instance+ migratorApply :: ([HoleFiller v s] -> v -> Either (MigrationError t v s) v)}++_Migrator = Model.Name "hydra.core.diff.Migrator"++_Migrator_residualHoles = Model.Name "residualHoles"++_Migrator_apply = Model.Name "apply"++-- | A value together with the 'type' it failed to inhabit+data Mistyped t v =+ Mistyped {+ -- | The offending value+ mistypedValue :: v,+ -- | The type the value did not inhabit+ mistypedType :: t}+ deriving (Eq, Ord, Read, Show)++_Mistyped = Model.Name "hydra.core.diff.Mistyped"++_Mistyped_value = Model.Name "value"++_Mistyped_type = Model.Name "type"++-- | A hole located within a named type of a schema. A type with several holes yields several SchemaHoles sharing a typeName.+data SchemaHole n t s =+ SchemaHole {+ -- | The name of the type (a schema entry) containing this hole+ schemaHoleTypeName :: n,+ -- | The hole within that type+ schemaHoleHole :: (Hole t s)}+ deriving (Eq, Ord, Read, Show)++_SchemaHole = Model.Name "hydra.core.diff.SchemaHole"++_SchemaHole_typeName = Model.Name "typeName"++_SchemaHole_hole = Model.Name "hole"++-- | An edit applied at a single immediate step of a value+data StepEdit a s =+ StepEdit {+ -- | The immediate step to descend into+ stepEditStep :: s,+ -- | The edit to apply at that step+ stepEditEdit :: (Edit a s)}+ deriving (Eq, Ord, Read, Show)++_StepEdit = Model.Name "hydra.core.diff.StepEdit"++_StepEdit_step = Model.Name "step"++_StepEdit_edit = Model.Name "edit"
@@ -0,0 +1,451 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Source-to-source automatic differentiation for Float64 terms.++module Hydra.Core.Differentiation where++import qualified Hydra.Core.Ast as Ast+import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Diff as Diff+import qualified Hydra.Core.Docs as Docs+import qualified Hydra.Core.Error.Checking as Checking+import qualified Hydra.Core.Error.File as ErrorFile+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Error.Packaging as ErrorPackaging+import qualified Hydra.Core.Error.System as ErrorSystem+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Json.Model as JsonModel+import qualified Hydra.Core.Overlay.Haskell.Lib.Equality as Equality+import qualified Hydra.Core.Overlay.Haskell.Lib.Lists as Lists+import qualified Hydra.Core.Overlay.Haskell.Lib.Logic as Logic+import qualified Hydra.Core.Overlay.Haskell.Lib.Optionals as Optionals+import qualified Hydra.Core.Overlay.Haskell.Lib.Pairs as Pairs+import qualified Hydra.Core.Markdown as Markdown+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Parsing as Parsing+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Query as Query+import qualified Hydra.Core.Regex as Regex+import qualified Hydra.Core.Relational as Relational+import qualified Hydra.Core.Strip as Strip+import qualified Hydra.Core.System as System+import qualified Hydra.Core.Tabular as Tabular+import qualified Hydra.Core.Testing as Testing+import qualified Hydra.Core.Time as Time+import qualified Hydra.Core.Topology as Topology+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Validation as Validation+import qualified Hydra.Core.Variables as Variables+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | Differentiate a binary primitive application given both arguments and their derivatives+differentiateBinary :: Model.Name -> Model.Term -> Model.Term -> Model.Term -> Model.Term -> Model.Term+differentiateBinary bfname a b da db =+ Logic.ifElse (Logic.or (Equality.equal bfname (Model.Name "hydra.core.lib.math.add")) (Equality.equal bfname (Model.Name "hydra.core.lib.math.addFloat64"))) (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.math.addFloat64")),+ Model.applicationArgument = da})),+ Model.applicationArgument = db})) (Logic.ifElse (Logic.or (Equality.equal bfname (Model.Name "hydra.core.lib.math.sub")) (Equality.equal bfname (Model.Name "hydra.core.lib.math.subFloat64"))) (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.math.subFloat64")),+ Model.applicationArgument = da})),+ Model.applicationArgument = db})) (Logic.ifElse (Logic.or (Equality.equal bfname (Model.Name "hydra.core.lib.math.mul")) (Equality.equal bfname (Model.Name "hydra.core.lib.math.mulFloat64"))) (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.math.addFloat64")),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.math.mulFloat64")),+ Model.applicationArgument = a})),+ Model.applicationArgument = db}))})),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.math.mulFloat64")),+ Model.applicationArgument = b})),+ Model.applicationArgument = da}))})) (Logic.ifElse (Equality.equal bfname (Model.Name "hydra.core.lib.math.pow")) (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.math.mulFloat64")),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.math.pow")),+ Model.applicationArgument = a})),+ Model.applicationArgument = b}))})),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.math.addFloat64")),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.math.mulFloat64")),+ Model.applicationArgument = db})),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.math.log")),+ Model.applicationArgument = a}))}))})),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.math.mulFloat64")),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.math.mulFloat64")),+ Model.applicationArgument = b})),+ Model.applicationArgument = da}))})),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.math.pow")),+ Model.applicationArgument = a})),+ Model.applicationArgument = (Model.TermLiteral (Model.LiteralFloat (Model.FloatValueFloat64 (-1.0))))}))}))}))})) (Logic.ifElse (Equality.equal bfname (Model.Name "hydra.core.lib.math.atan2")) (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.math.mulFloat64")),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.math.subFloat64")),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.math.mulFloat64")),+ Model.applicationArgument = b})),+ Model.applicationArgument = da}))})),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.math.mulFloat64")),+ Model.applicationArgument = a})),+ Model.applicationArgument = db}))}))})),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.math.pow")),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.math.addFloat64")),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.math.mulFloat64")),+ Model.applicationArgument = a})),+ Model.applicationArgument = a}))})),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.math.mulFloat64")),+ Model.applicationArgument = b})),+ Model.applicationArgument = b}))}))})),+ Model.applicationArgument = (Model.TermLiteral (Model.LiteralFloat (Model.FloatValueFloat64 (-1.0))))}))})) (Logic.ifElse (Equality.equal bfname (Model.Name "hydra.core.lib.math.logBase")) (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.math.mulFloat64")),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.math.subFloat64")),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.math.mulFloat64")),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.math.log")),+ Model.applicationArgument = a}))})),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.math.mulFloat64")),+ Model.applicationArgument = db})),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.math.pow")),+ Model.applicationArgument = b})),+ Model.applicationArgument = (Model.TermLiteral (Model.LiteralFloat (Model.FloatValueFloat64 (-1.0))))}))}))}))})),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.math.mulFloat64")),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.math.log")),+ Model.applicationArgument = b}))})),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.math.mulFloat64")),+ Model.applicationArgument = da})),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.math.pow")),+ Model.applicationArgument = a})),+ Model.applicationArgument = (Model.TermLiteral (Model.LiteralFloat (Model.FloatValueFloat64 (-1.0))))}))}))}))}))})),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.math.pow")),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.math.mulFloat64")),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.math.log")),+ Model.applicationArgument = a}))})),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.math.log")),+ Model.applicationArgument = a}))}))})),+ Model.applicationArgument = (Model.TermLiteral (Model.LiteralFloat (Model.FloatValueFloat64 (-1.0))))}))})) (Model.TermLiteral (Model.LiteralFloat (Model.FloatValueFloat64 0.0))))))))++-- | Differentiate a function term (Float64 -> Float64) with respect to its parameter+differentiateFunction :: Model.Term -> Model.Term+differentiateFunction term =+ case term of+ Model.TermAnnotated v0 -> differentiateFunction (Model.annotatedTermBody v0)+ Model.TermLambda v0 ->+ let paramName = Model.lambdaParameter v0+ body = Model.lambdaBody v0+ in (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = paramName,+ Model.lambdaDomain = (Model.lambdaDomain v0),+ Model.lambdaBody = (differentiateTerm paramName body)}))+ _ -> term++-- | Differentiate a term with respect to a named variable+differentiateTerm :: Model.Name -> Model.Term -> Model.Term+differentiateTerm dx term =+ case term of+ Model.TermVariable v0 -> Logic.ifElse (Equality.equal v0 dx) (Model.TermLiteral (Model.LiteralFloat (Model.FloatValueFloat64 1.0))) (Model.TermLiteral (Model.LiteralFloat (Model.FloatValueFloat64 0.0)))+ Model.TermLiteral _ -> Model.TermLiteral (Model.LiteralFloat (Model.FloatValueFloat64 0.0))+ Model.TermApplication v0 ->+ let func = Model.applicationFunction v0+ arg = Model.applicationArgument v0+ in case func of+ Model.TermVariable v1 -> Optionals.match (primitiveDerivative v1) (differentiateTerm dx (Model.TermApplication (Model.Application {+ Model.applicationFunction = func,+ Model.applicationArgument = arg}))) (\derivTerm -> Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.math.mulFloat64")),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = derivTerm,+ Model.applicationArgument = arg}))})),+ Model.applicationArgument = (differentiateTerm dx arg)}))+ Model.TermApplication v1 ->+ let innerFunc = Model.applicationFunction v1+ innerArg = Model.applicationArgument v1+ in case innerFunc of+ Model.TermVariable v2 -> differentiateBinary v2 innerArg arg (differentiateTerm dx innerArg) (differentiateTerm dx arg)+ _ -> Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.math.mulFloat64")),+ Model.applicationArgument = (differentiateTerm dx (Model.TermApplication (Model.Application {+ Model.applicationFunction = func,+ Model.applicationArgument = arg})))})),+ Model.applicationArgument = (differentiateTerm dx arg)})+ _ -> Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.math.mulFloat64")),+ Model.applicationArgument = (differentiateTerm dx (Model.TermApplication (Model.Application {+ Model.applicationFunction = func,+ Model.applicationArgument = arg})))})),+ Model.applicationArgument = (differentiateTerm dx arg)})+ Model.TermLambda v0 -> Logic.ifElse (Equality.equal (Model.lambdaParameter v0) dx) (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.lambdaParameter v0),+ Model.lambdaDomain = (Model.lambdaDomain v0),+ Model.lambdaBody = (Model.TermLiteral (Model.LiteralFloat (Model.FloatValueFloat64 0.0)))})) (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.lambdaParameter v0),+ Model.lambdaDomain = (Model.lambdaDomain v0),+ Model.lambdaBody = (differentiateTerm dx (Model.lambdaBody v0))}))+ Model.TermCases _ -> Model.TermLiteral (Model.LiteralFloat (Model.FloatValueFloat64 0.0))+ Model.TermProject _ -> Model.TermLiteral (Model.LiteralFloat (Model.FloatValueFloat64 0.0))+ Model.TermUnwrap _ -> Model.TermLiteral (Model.LiteralFloat (Model.FloatValueFloat64 0.0))+ Model.TermLet v0 -> Model.TermLet (Model.Let {+ Model.letBindings = (Lists.map (\b -> Model.Binding {+ Model.bindingName = (Model.bindingName b),+ Model.bindingTerm = (differentiateTerm dx (Model.bindingTerm b)),+ Model.bindingTypeScheme = Nothing}) (Model.letBindings v0)),+ Model.letBody = (differentiateTerm dx (Model.letBody v0))})+ Model.TermAnnotated v0 -> differentiateTerm dx (Model.annotatedTermBody v0)+ Model.TermList v0 -> Model.TermList (Lists.map (differentiateTerm dx) v0)+ Model.TermPair v0 -> Model.TermPair (differentiateTerm dx (Pairs.first v0), (differentiateTerm dx (Pairs.second v0)))+ Model.TermRecord v0 -> Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.recordTypeName v0),+ Model.recordFields = (Lists.map (\fld -> Model.Field {+ Model.fieldName = (Model.fieldName fld),+ Model.fieldTerm = (differentiateTerm dx (Model.fieldTerm fld))}) (Model.recordFields v0))})+ Model.TermTypeApplication v0 -> differentiateTerm dx (Model.typeApplicationTermBody v0)+ Model.TermTypeLambda v0 -> differentiateTerm dx (Model.typeLambdaBody v0)+ Model.TermUnit -> Model.TermLiteral (Model.LiteralFloat (Model.FloatValueFloat64 0.0))+ Model.TermSet _ -> Model.TermLiteral (Model.LiteralFloat (Model.FloatValueFloat64 0.0))+ Model.TermMap _ -> Model.TermLiteral (Model.LiteralFloat (Model.FloatValueFloat64 0.0))+ Model.TermEither _ -> Model.TermLiteral (Model.LiteralFloat (Model.FloatValueFloat64 0.0))+ Model.TermOptional _ -> Model.TermLiteral (Model.LiteralFloat (Model.FloatValueFloat64 0.0))+ Model.TermInject _ -> Model.TermLiteral (Model.LiteralFloat (Model.FloatValueFloat64 0.0))+ Model.TermWrap _ -> Model.TermLiteral (Model.LiteralFloat (Model.FloatValueFloat64 0.0))++-- | Compute the gradient of a term as a record of partial derivatives+gradient :: Model.Name -> [Model.Name] -> Model.Term -> Model.Term+gradient typeName vars term =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = typeName,+ Model.recordFields = (Lists.map (\v -> Model.Field {+ Model.fieldName = v,+ Model.fieldTerm = (differentiateTerm v term)}) vars)})++-- | Look up the derivative of a unary Float64 primitive+primitiveDerivative :: Model.Name -> Maybe Model.Term+primitiveDerivative name =+ Logic.ifElse (Equality.equal name (Model.Name "hydra.core.lib.math.sin")) (Just (Model.TermVariable (Model.Name "hydra.core.lib.math.cos"))) (Logic.ifElse (Equality.equal name (Model.Name "hydra.core.lib.math.cos")) (Just (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "_x"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.math.negateFloat64")),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.math.sin")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "_x"))}))}))}))) (Logic.ifElse (Equality.equal name (Model.Name "hydra.core.lib.math.tan")) (Just (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "_x"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.math.pow")),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.math.cos")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "_x"))}))})),+ Model.applicationArgument = (Model.TermLiteral (Model.LiteralFloat (Model.FloatValueFloat64 (-2.0))))}))}))) (Logic.ifElse (Equality.equal name (Model.Name "hydra.core.lib.math.exp")) (Just (Model.TermVariable (Model.Name "hydra.core.lib.math.exp"))) (Logic.ifElse (Equality.equal name (Model.Name "hydra.core.lib.math.log")) (Just (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "_x"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.math.pow")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "_x"))})),+ Model.applicationArgument = (Model.TermLiteral (Model.LiteralFloat (Model.FloatValueFloat64 (-1.0))))}))}))) (Logic.ifElse (Equality.equal name (Model.Name "hydra.core.lib.math.sqrt")) (Just (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "_x"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.math.mulFloat64")),+ Model.applicationArgument = (Model.TermLiteral (Model.LiteralFloat (Model.FloatValueFloat64 0.5)))})),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.math.pow")),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.math.sqrt")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "_x"))}))})),+ Model.applicationArgument = (Model.TermLiteral (Model.LiteralFloat (Model.FloatValueFloat64 (-1.0))))}))}))}))) (Logic.ifElse (Equality.equal name (Model.Name "hydra.core.lib.math.asin")) (Just (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "_x"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.math.pow")),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.math.sqrt")),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.math.subFloat64")),+ Model.applicationArgument = (Model.TermLiteral (Model.LiteralFloat (Model.FloatValueFloat64 1.0)))})),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.math.mulFloat64")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "_x"))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "_x"))}))}))}))})),+ Model.applicationArgument = (Model.TermLiteral (Model.LiteralFloat (Model.FloatValueFloat64 (-1.0))))}))}))) (Logic.ifElse (Equality.equal name (Model.Name "hydra.core.lib.math.acos")) (Just (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "_x"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.math.negateFloat64")),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.math.pow")),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.math.sqrt")),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.math.subFloat64")),+ Model.applicationArgument = (Model.TermLiteral (Model.LiteralFloat (Model.FloatValueFloat64 1.0)))})),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.math.mulFloat64")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "_x"))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "_x"))}))}))}))})),+ Model.applicationArgument = (Model.TermLiteral (Model.LiteralFloat (Model.FloatValueFloat64 (-1.0))))}))}))}))) (Logic.ifElse (Equality.equal name (Model.Name "hydra.core.lib.math.atan")) (Just (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "_x"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.math.pow")),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.math.addFloat64")),+ Model.applicationArgument = (Model.TermLiteral (Model.LiteralFloat (Model.FloatValueFloat64 1.0)))})),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.math.mulFloat64")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "_x"))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "_x"))}))}))})),+ Model.applicationArgument = (Model.TermLiteral (Model.LiteralFloat (Model.FloatValueFloat64 (-1.0))))}))}))) (Logic.ifElse (Equality.equal name (Model.Name "hydra.core.lib.math.sinh")) (Just (Model.TermVariable (Model.Name "hydra.core.lib.math.cosh"))) (Logic.ifElse (Equality.equal name (Model.Name "hydra.core.lib.math.cosh")) (Just (Model.TermVariable (Model.Name "hydra.core.lib.math.sinh"))) (Logic.ifElse (Equality.equal name (Model.Name "hydra.core.lib.math.tanh")) (Just (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "_x"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.math.subFloat64")),+ Model.applicationArgument = (Model.TermLiteral (Model.LiteralFloat (Model.FloatValueFloat64 1.0)))})),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.math.mulFloat64")),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.math.tanh")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "_x"))}))})),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.math.tanh")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "_x"))}))}))}))}))) (Logic.ifElse (Equality.equal name (Model.Name "hydra.core.lib.math.asinh")) (Just (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "_x"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.math.pow")),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.math.sqrt")),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.math.addFloat64")),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.math.mulFloat64")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "_x"))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "_x"))}))})),+ Model.applicationArgument = (Model.TermLiteral (Model.LiteralFloat (Model.FloatValueFloat64 1.0)))}))}))})),+ Model.applicationArgument = (Model.TermLiteral (Model.LiteralFloat (Model.FloatValueFloat64 (-1.0))))}))}))) (Logic.ifElse (Equality.equal name (Model.Name "hydra.core.lib.math.acosh")) (Just (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "_x"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.math.pow")),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.math.sqrt")),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.math.subFloat64")),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.math.mulFloat64")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "_x"))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "_x"))}))})),+ Model.applicationArgument = (Model.TermLiteral (Model.LiteralFloat (Model.FloatValueFloat64 1.0)))}))}))})),+ Model.applicationArgument = (Model.TermLiteral (Model.LiteralFloat (Model.FloatValueFloat64 (-1.0))))}))}))) (Logic.ifElse (Equality.equal name (Model.Name "hydra.core.lib.math.atanh")) (Just (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "_x"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.math.pow")),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.math.subFloat64")),+ Model.applicationArgument = (Model.TermLiteral (Model.LiteralFloat (Model.FloatValueFloat64 1.0)))})),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.math.mulFloat64")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "_x"))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "_x"))}))}))})),+ Model.applicationArgument = (Model.TermLiteral (Model.LiteralFloat (Model.FloatValueFloat64 (-1.0))))}))}))) (Logic.ifElse (Equality.equal name (Model.Name "hydra.core.lib.math.negate")) (Just (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "_x"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLiteral (Model.LiteralFloat (Model.FloatValueFloat64 (-1.0))))}))) (Logic.ifElse (Equality.equal name (Model.Name "hydra.core.lib.math.abs")) (Just (Model.TermVariable (Model.Name "hydra.core.lib.math.signum"))) (Logic.ifElse (Equality.equal name (Model.Name "hydra.core.lib.math.ceiling")) (Just (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "_x"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLiteral (Model.LiteralFloat (Model.FloatValueFloat64 0.0)))}))) (Logic.ifElse (Equality.equal name (Model.Name "hydra.core.lib.math.floor")) (Just (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "_x"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLiteral (Model.LiteralFloat (Model.FloatValueFloat64 0.0)))}))) (Logic.ifElse (Equality.equal name (Model.Name "hydra.core.lib.math.round")) (Just (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "_x"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLiteral (Model.LiteralFloat (Model.FloatValueFloat64 0.0)))}))) (Logic.ifElse (Equality.equal name (Model.Name "hydra.core.lib.math.truncate")) (Just (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "_x"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLiteral (Model.LiteralFloat (Model.FloatValueFloat64 0.0)))}))) (Logic.ifElse (Equality.equal name (Model.Name "hydra.core.lib.math.signum")) (Just (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "_x"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLiteral (Model.LiteralFloat (Model.FloatValueFloat64 0.0)))}))) Nothing)))))))))))))))))))))
@@ -0,0 +1,25 @@+-- Note: this is an automatically generated file. Do not edit.++-- | A model for Hydra documentation strings, including inline annotations and entity references++module Hydra.Core.Docs where++import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Packaging as Packaging+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | A segment of a documentation string, either a raw text fragment or an inline entity reference. Documentation strings are parsed into a sequence of DocSegments for host-specific rendering.+data DocSegment =+ -- | An inline reference to a Hydra entity+ DocSegmentRef Packaging.EntityReference |+ -- | A raw prose fragment, passed through verbatim+ DocSegmentText String+ deriving (Eq, Ord, Read, Show)++_DocSegment = Model.Name "hydra.core.docs.DocSegment"++_DocSegment_ref = Model.Name "ref"++_DocSegment_text = Model.Name "text"
@@ -0,0 +1,314 @@+-- Note: this is an automatically generated file. Do not edit.++-- | DSL functions for hydra.core.analysis++module Hydra.Core.Dsl.Analysis where++import qualified Hydra.Core.Analysis as Analysis+import qualified Hydra.Core.Annotations as Annotations+import qualified Hydra.Core.Arity as Arity+import qualified Hydra.Core.Ast as Ast+import qualified Hydra.Core.Checking as Checking+import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Constants as Constants+import qualified Hydra.Core.Decode.Model as DecodeModel+import qualified Hydra.Core.Dependencies as Dependencies+import qualified Hydra.Core.Diff as Diff+import qualified Hydra.Core.Docs as Docs+import qualified Hydra.Core.Dsl.Annotations as DslAnnotations+import qualified Hydra.Core.Dsl.Arity as DslArity+import qualified Hydra.Core.Dsl.Ast as DslAst+import qualified Hydra.Core.Dsl.Checking as DslChecking+import qualified Hydra.Core.Dsl.Coders as DslCoders+import qualified Hydra.Core.Dsl.Constants as DslConstants+import qualified Hydra.Core.Dsl.Dependencies as DslDependencies+import qualified Hydra.Core.Dsl.Diff as DslDiff+import qualified Hydra.Core.Dsl.Docs as DslDocs+import qualified Hydra.Core.Dsl.Error.Checking as DslErrorChecking+import qualified Hydra.Core.Dsl.Error.File as DslErrorFile+import qualified Hydra.Core.Dsl.Error.Model as DslErrorModel+import qualified Hydra.Core.Dsl.Error.Packaging as DslErrorPackaging+import qualified Hydra.Core.Dsl.Error.System as DslErrorSystem+import qualified Hydra.Core.Dsl.Errors as DslErrors+import qualified Hydra.Core.Dsl.File as DslFile+import qualified Hydra.Core.Dsl.Graph as DslGraph+import qualified Hydra.Core.Dsl.Json.Model as DslJsonModel+import qualified Hydra.Core.Dsl.Lexical as DslLexical+import qualified Hydra.Core.Dsl.Markdown as DslMarkdown+import qualified Hydra.Core.Dsl.Model as DslModel+import qualified Hydra.Core.Dsl.Names as DslNames+import qualified Hydra.Core.Dsl.Packaging as DslPackaging+import qualified Hydra.Core.Dsl.Parsing as DslParsing+import qualified Hydra.Core.Dsl.Paths as DslPaths+import qualified Hydra.Core.Dsl.Predicates as DslPredicates+import qualified Hydra.Core.Dsl.Query as DslQuery+import qualified Hydra.Core.Dsl.Regex as DslRegex+import qualified Hydra.Core.Dsl.Relational as DslRelational+import qualified Hydra.Core.Dsl.Rewriting as DslRewriting+import qualified Hydra.Core.Dsl.Scoping as DslScoping+import qualified Hydra.Core.Dsl.Strip as DslStrip+import qualified Hydra.Core.Dsl.System as DslSystem+import qualified Hydra.Core.Dsl.Tabular as DslTabular+import qualified Hydra.Core.Dsl.Testing as DslTesting+import qualified Hydra.Core.Dsl.Time as DslTime+import qualified Hydra.Core.Dsl.Topology as DslTopology+import qualified Hydra.Core.Dsl.Typing as DslTyping+import qualified Hydra.Core.Dsl.Util as DslUtil+import qualified Hydra.Core.Dsl.Validation as DslValidation+import qualified Hydra.Core.Dsl.Variables as DslVariables+import qualified Hydra.Core.Dsl.Variants as DslVariants+import qualified Hydra.Core.Error.Checking as ErrorChecking+import qualified Hydra.Core.Error.File as ErrorFile+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Error.Packaging as ErrorPackaging+import qualified Hydra.Core.Error.System as ErrorSystem+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Json.Model as JsonModel+import qualified Hydra.Core.Lexical as Lexical+import qualified Hydra.Core.Markdown as Markdown+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Names as Names+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Parsing as Parsing+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Predicates as Predicates+import qualified Hydra.Core.Query as Query+import qualified Hydra.Core.Regex as Regex+import qualified Hydra.Core.Relational as Relational+import qualified Hydra.Core.Rewriting as Rewriting+import qualified Hydra.Core.Scoping as Scoping+import qualified Hydra.Core.Strip as Strip+import qualified Hydra.Core.System as System+import qualified Hydra.Core.Tabular as Tabular+import qualified Hydra.Core.Testing as Testing+import qualified Hydra.Core.Time as Time+import qualified Hydra.Core.Topology as Topology+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Validation as Validation+import qualified Hydra.Core.Variables as Variables+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void+import qualified Data.Set as S++-- | DSL reference to hydra.core.analysis.addNamesToModuleNames+addNamesToModuleNames :: Typed.TypedTerm (Packaging.ModuleName -> t0) -> Typed.TypedTerm (S.Set Model.Name) -> Typed.TypedTerm (Util.ModuleNames t0) -> Typed.TypedTerm (Util.ModuleNames t0)+addNamesToModuleNames arg0 arg1 arg2 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.analysis.addNamesToModuleNames")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)})),+ Model.applicationArgument = (Typed.unTypedTerm arg2)}))++-- | DSL reference to hydra.core.analysis.analyzeFunctionTerm+analyzeFunctionTerm :: Typed.TypedTerm Typing.InferenceContext -> Typed.TypedTerm (t0 -> Graph.Graph) -> Typed.TypedTerm (Graph.Graph -> t0 -> t0) -> Typed.TypedTerm t0 -> Typed.TypedTerm Model.Term -> Typed.TypedTerm (Either t1 (Typing.FunctionStructure t0))+analyzeFunctionTerm arg0 arg1 arg2 arg3 arg4 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.analysis.analyzeFunctionTerm")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)})),+ Model.applicationArgument = (Typed.unTypedTerm arg2)})),+ Model.applicationArgument = (Typed.unTypedTerm arg3)})),+ Model.applicationArgument = (Typed.unTypedTerm arg4)}))++-- | DSL reference to hydra.core.analysis.analyzeFunctionTermWith+analyzeFunctionTermWith :: Typed.TypedTerm Typing.InferenceContext -> Typed.TypedTerm (Graph.Graph -> Model.Binding -> Maybe Model.Term) -> Typed.TypedTerm (t0 -> Graph.Graph) -> Typed.TypedTerm (Graph.Graph -> t0 -> t0) -> Typed.TypedTerm t0 -> Typed.TypedTerm Model.Term -> Typed.TypedTerm (Either t1 (Typing.FunctionStructure t0))+analyzeFunctionTermWith arg0 arg1 arg2 arg3 arg4 arg5 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.analysis.analyzeFunctionTermWith")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)})),+ Model.applicationArgument = (Typed.unTypedTerm arg2)})),+ Model.applicationArgument = (Typed.unTypedTerm arg3)})),+ Model.applicationArgument = (Typed.unTypedTerm arg4)})),+ Model.applicationArgument = (Typed.unTypedTerm arg5)}))++-- | DSL reference to hydra.core.analysis.analyzeFunctionTermWithFinish+analyzeFunctionTermWithFinish :: Typed.TypedTerm Typing.InferenceContext -> Typed.TypedTerm (t0 -> Graph.Graph) -> Typed.TypedTerm t0 -> Typed.TypedTerm [Model.Name] -> Typed.TypedTerm [Model.Name] -> Typed.TypedTerm [Model.Binding] -> Typed.TypedTerm [Model.Type] -> Typed.TypedTerm [Model.Type] -> Typed.TypedTerm Model.Term -> Typed.TypedTerm (Either t1 (Typing.FunctionStructure t0))+analyzeFunctionTermWithFinish arg0 arg1 arg2 arg3 arg4 arg5 arg6 arg7 arg8 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.analysis.analyzeFunctionTermWithFinish")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)})),+ Model.applicationArgument = (Typed.unTypedTerm arg2)})),+ Model.applicationArgument = (Typed.unTypedTerm arg3)})),+ Model.applicationArgument = (Typed.unTypedTerm arg4)})),+ Model.applicationArgument = (Typed.unTypedTerm arg5)})),+ Model.applicationArgument = (Typed.unTypedTerm arg6)})),+ Model.applicationArgument = (Typed.unTypedTerm arg7)})),+ Model.applicationArgument = (Typed.unTypedTerm arg8)}))++-- | DSL reference to hydra.core.analysis.analyzeFunctionTermWithGather+analyzeFunctionTermWithGather :: Typed.TypedTerm Typing.InferenceContext -> Typed.TypedTerm (Graph.Graph -> Model.Binding -> Maybe Model.Term) -> Typed.TypedTerm (t0 -> Graph.Graph) -> Typed.TypedTerm (Graph.Graph -> t0 -> t0) -> Typed.TypedTerm Bool -> Typed.TypedTerm t0 -> Typed.TypedTerm [Model.Name] -> Typed.TypedTerm [Model.Name] -> Typed.TypedTerm [Model.Binding] -> Typed.TypedTerm [Model.Type] -> Typed.TypedTerm [Model.Type] -> Typed.TypedTerm Model.Term -> Typed.TypedTerm (Either t1 (Typing.FunctionStructure t0))+analyzeFunctionTermWithGather arg0 arg1 arg2 arg3 arg4 arg5 arg6 arg7 arg8 arg9 arg10 arg11 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.analysis.analyzeFunctionTermWithGather")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)})),+ Model.applicationArgument = (Typed.unTypedTerm arg2)})),+ Model.applicationArgument = (Typed.unTypedTerm arg3)})),+ Model.applicationArgument = (Typed.unTypedTerm arg4)})),+ Model.applicationArgument = (Typed.unTypedTerm arg5)})),+ Model.applicationArgument = (Typed.unTypedTerm arg6)})),+ Model.applicationArgument = (Typed.unTypedTerm arg7)})),+ Model.applicationArgument = (Typed.unTypedTerm arg8)})),+ Model.applicationArgument = (Typed.unTypedTerm arg9)})),+ Model.applicationArgument = (Typed.unTypedTerm arg10)})),+ Model.applicationArgument = (Typed.unTypedTerm arg11)}))++-- | DSL reference to hydra.core.analysis.definitionDependencyModuleNames+definitionDependencyModuleNames :: Typed.TypedTerm [Packaging.Definition] -> Typed.TypedTerm (S.Set Packaging.ModuleName)+definitionDependencyModuleNames arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.analysis.definitionDependencyModuleNames")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.analysis.dependencyModuleNames+dependencyModuleNames :: Typed.TypedTerm t0 -> Typed.TypedTerm Graph.Graph -> Typed.TypedTerm Bool -> Typed.TypedTerm Bool -> Typed.TypedTerm Bool -> Typed.TypedTerm Bool -> Typed.TypedTerm [Model.Binding] -> Typed.TypedTerm (Either Errors.Error (S.Set Packaging.ModuleName))+dependencyModuleNames arg0 arg1 arg2 arg3 arg4 arg5 arg6 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.analysis.dependencyModuleNames")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)})),+ Model.applicationArgument = (Typed.unTypedTerm arg2)})),+ Model.applicationArgument = (Typed.unTypedTerm arg3)})),+ Model.applicationArgument = (Typed.unTypedTerm arg4)})),+ Model.applicationArgument = (Typed.unTypedTerm arg5)})),+ Model.applicationArgument = (Typed.unTypedTerm arg6)}))++-- | DSL reference to hydra.core.analysis.gatherApplications+gatherApplications :: Typed.TypedTerm Model.Term -> Typed.TypedTerm ([Model.Term], Model.Term)+gatherApplications arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.analysis.gatherApplications")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.analysis.gatherArgs+gatherArgs :: Typed.TypedTerm Model.Term -> Typed.TypedTerm [Model.Term] -> Typed.TypedTerm (Model.Term, [Model.Term])+gatherArgs arg0 arg1 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.analysis.gatherArgs")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)}))++-- | DSL reference to hydra.core.analysis.gatherArgsWithTypeApps+gatherArgsWithTypeApps :: Typed.TypedTerm Model.Term -> Typed.TypedTerm [Model.Term] -> Typed.TypedTerm [Model.Type] -> Typed.TypedTerm (Model.Term, ([Model.Term], [Model.Type]))+gatherArgsWithTypeApps arg0 arg1 arg2 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.analysis.gatherArgsWithTypeApps")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)})),+ Model.applicationArgument = (Typed.unTypedTerm arg2)}))++-- | DSL reference to hydra.core.analysis.isSelfTailRecursive+isSelfTailRecursive :: Typed.TypedTerm Model.Name -> Typed.TypedTerm Model.Term -> Typed.TypedTerm Bool+isSelfTailRecursive arg0 arg1 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.analysis.isSelfTailRecursive")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)}))++-- | DSL reference to hydra.core.analysis.isSimpleAssignment+isSimpleAssignment :: Typed.TypedTerm Model.Term -> Typed.TypedTerm Bool+isSimpleAssignment arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.analysis.isSimpleAssignment")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.analysis.isTailRecursiveInTailPosition+isTailRecursiveInTailPosition :: Typed.TypedTerm Model.Name -> Typed.TypedTerm Model.Term -> Typed.TypedTerm Bool+isTailRecursiveInTailPosition arg0 arg1 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.analysis.isTailRecursiveInTailPosition")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)}))++-- | DSL reference to hydra.core.analysis.moduleContainsBinaryLiterals+moduleContainsBinaryLiterals :: Typed.TypedTerm Packaging.Module -> Typed.TypedTerm Bool+moduleContainsBinaryLiterals arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.analysis.moduleContainsBinaryLiterals")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.analysis.moduleContainsDecimalLiterals+moduleContainsDecimalLiterals :: Typed.TypedTerm Packaging.Module -> Typed.TypedTerm Bool+moduleContainsDecimalLiterals arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.analysis.moduleContainsDecimalLiterals")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.analysis.moduleDependencyModuleNames+moduleDependencyModuleNames :: Typed.TypedTerm t0 -> Typed.TypedTerm Graph.Graph -> Typed.TypedTerm Bool -> Typed.TypedTerm Bool -> Typed.TypedTerm Bool -> Typed.TypedTerm Bool -> Typed.TypedTerm Packaging.Module -> Typed.TypedTerm (Either Errors.Error (S.Set Packaging.ModuleName))+moduleDependencyModuleNames arg0 arg1 arg2 arg3 arg4 arg5 arg6 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.analysis.moduleDependencyModuleNames")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)})),+ Model.applicationArgument = (Typed.unTypedTerm arg2)})),+ Model.applicationArgument = (Typed.unTypedTerm arg3)})),+ Model.applicationArgument = (Typed.unTypedTerm arg4)})),+ Model.applicationArgument = (Typed.unTypedTerm arg5)})),+ Model.applicationArgument = (Typed.unTypedTerm arg6)}))++-- | DSL reference to hydra.core.analysis.moduleNamesForDefinitions+moduleNamesForDefinitions :: Typed.TypedTerm (Packaging.ModuleName -> t0) -> Typed.TypedTerm Packaging.ModuleName -> Typed.TypedTerm [Packaging.Definition] -> Typed.TypedTerm (Util.ModuleNames t0)+moduleNamesForDefinitions arg0 arg1 arg2 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.analysis.moduleNamesForDefinitions")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)})),+ Model.applicationArgument = (Typed.unTypedTerm arg2)}))
@@ -0,0 +1,331 @@+-- Note: this is an automatically generated file. Do not edit.++-- | DSL functions for hydra.core.annotations++module Hydra.Core.Dsl.Annotations where++import qualified Hydra.Core.Annotations as Annotations+import qualified Hydra.Core.Ast as Ast+import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Constants as Constants+import qualified Hydra.Core.Decode.Model as DecodeModel+import qualified Hydra.Core.Diff as Diff+import qualified Hydra.Core.Docs as Docs+import qualified Hydra.Core.Dsl.Ast as DslAst+import qualified Hydra.Core.Dsl.Coders as DslCoders+import qualified Hydra.Core.Dsl.Constants as DslConstants+import qualified Hydra.Core.Dsl.Diff as DslDiff+import qualified Hydra.Core.Dsl.Docs as DslDocs+import qualified Hydra.Core.Dsl.Error.Checking as ErrorChecking+import qualified Hydra.Core.Dsl.Error.File as DslErrorFile+import qualified Hydra.Core.Dsl.Error.Model as DslErrorModel+import qualified Hydra.Core.Dsl.Error.Packaging as DslErrorPackaging+import qualified Hydra.Core.Dsl.Error.System as DslErrorSystem+import qualified Hydra.Core.Dsl.Errors as DslErrors+import qualified Hydra.Core.Dsl.File as DslFile+import qualified Hydra.Core.Dsl.Graph as DslGraph+import qualified Hydra.Core.Dsl.Json.Model as DslJsonModel+import qualified Hydra.Core.Dsl.Lexical as DslLexical+import qualified Hydra.Core.Dsl.Markdown as DslMarkdown+import qualified Hydra.Core.Dsl.Model as DslModel+import qualified Hydra.Core.Dsl.Packaging as DslPackaging+import qualified Hydra.Core.Dsl.Parsing as DslParsing+import qualified Hydra.Core.Dsl.Paths as DslPaths+import qualified Hydra.Core.Dsl.Query as DslQuery+import qualified Hydra.Core.Dsl.Regex as DslRegex+import qualified Hydra.Core.Dsl.Relational as DslRelational+import qualified Hydra.Core.Dsl.Strip as DslStrip+import qualified Hydra.Core.Dsl.System as DslSystem+import qualified Hydra.Core.Dsl.Tabular as DslTabular+import qualified Hydra.Core.Dsl.Testing as DslTesting+import qualified Hydra.Core.Dsl.Time as DslTime+import qualified Hydra.Core.Dsl.Topology as DslTopology+import qualified Hydra.Core.Dsl.Typing as DslTyping+import qualified Hydra.Core.Dsl.Util as DslUtil+import qualified Hydra.Core.Dsl.Validation as DslValidation+import qualified Hydra.Core.Dsl.Variants as DslVariants+import qualified Hydra.Core.Encode.Model as EncodeModel+import qualified Hydra.Core.Error.Checking as Checking+import qualified Hydra.Core.Error.File as ErrorFile+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Error.Packaging as ErrorPackaging+import qualified Hydra.Core.Error.System as ErrorSystem+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.Extract.Model as ExtractModel+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Json.Model as JsonModel+import qualified Hydra.Core.Lexical as Lexical+import qualified Hydra.Core.Markdown as Markdown+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Parsing as Parsing+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Print.Errors as PrintErrors+import qualified Hydra.Core.Print.Model as PrintModel+import qualified Hydra.Core.Query as Query+import qualified Hydra.Core.Regex as Regex+import qualified Hydra.Core.Relational as Relational+import qualified Hydra.Core.Strip as Strip+import qualified Hydra.Core.System as System+import qualified Hydra.Core.Tabular as Tabular+import qualified Hydra.Core.Testing as Testing+import qualified Hydra.Core.Time as Time+import qualified Hydra.Core.Topology as Topology+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Validation as Validation+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void+import qualified Data.Map as M+import qualified Data.Set as S++-- | DSL reference to hydra.core.annotations.aggregateAnnotations+aggregateAnnotations :: Typed.TypedTerm (t0 -> Maybe t1) -> Typed.TypedTerm (t1 -> t0) -> Typed.TypedTerm (t1 -> M.Map t2 t3) -> Typed.TypedTerm t0 -> Typed.TypedTerm (M.Map t2 t3)+aggregateAnnotations arg0 arg1 arg2 arg3 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.annotations.aggregateAnnotations")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)})),+ Model.applicationArgument = (Typed.unTypedTerm arg2)})),+ Model.applicationArgument = (Typed.unTypedTerm arg3)}))++-- | DSL reference to hydra.core.annotations.commentsFromBinding+commentsFromBinding :: Typed.TypedTerm t0 -> Typed.TypedTerm Graph.Graph -> Typed.TypedTerm Model.Binding -> Typed.TypedTerm (Either Errors.Error (Maybe String))+commentsFromBinding arg0 arg1 arg2 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.annotations.commentsFromBinding")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)})),+ Model.applicationArgument = (Typed.unTypedTerm arg2)}))++-- | DSL reference to hydra.core.annotations.commentsFromFieldType+commentsFromFieldType :: Typed.TypedTerm t0 -> Typed.TypedTerm Graph.Graph -> Typed.TypedTerm Model.FieldType -> Typed.TypedTerm (Either Errors.Error (Maybe String))+commentsFromFieldType arg0 arg1 arg2 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.annotations.commentsFromFieldType")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)})),+ Model.applicationArgument = (Typed.unTypedTerm arg2)}))++-- | DSL reference to hydra.core.annotations.getAnnotationMap+getAnnotationMap :: Typed.TypedTerm Model.Term -> Typed.TypedTerm (M.Map Model.Name Model.Term)+getAnnotationMap arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.annotations.getAnnotationMap")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.annotations.getDescription+getDescription :: Typed.TypedTerm t0 -> Typed.TypedTerm Graph.Graph -> Typed.TypedTerm (M.Map Model.Name Model.Term) -> Typed.TypedTerm (Either Errors.Error (Maybe String))+getDescription arg0 arg1 arg2 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.annotations.getDescription")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)})),+ Model.applicationArgument = (Typed.unTypedTerm arg2)}))++-- | DSL reference to hydra.core.annotations.getTermAnnotation+getTermAnnotation :: Typed.TypedTerm Model.Name -> Typed.TypedTerm Model.Term -> Typed.TypedTerm (Maybe Model.Term)+getTermAnnotation arg0 arg1 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.annotations.getTermAnnotation")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)}))++-- | DSL reference to hydra.core.annotations.getTermDescription+getTermDescription :: Typed.TypedTerm t0 -> Typed.TypedTerm Graph.Graph -> Typed.TypedTerm Model.Term -> Typed.TypedTerm (Either Errors.Error (Maybe String))+getTermDescription arg0 arg1 arg2 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.annotations.getTermDescription")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)})),+ Model.applicationArgument = (Typed.unTypedTerm arg2)}))++-- | DSL reference to hydra.core.annotations.getType+getType :: Typed.TypedTerm Graph.Graph -> Typed.TypedTerm (M.Map Model.Name Model.Term) -> Typed.TypedTerm (Either Errors.DecodingError (Maybe Model.Type))+getType arg0 arg1 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.annotations.getType")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)}))++-- | DSL reference to hydra.core.annotations.getTypeAnnotation+getTypeAnnotation :: Typed.TypedTerm Model.Name -> Typed.TypedTerm Model.Type -> Typed.TypedTerm (Maybe Model.Term)+getTypeAnnotation arg0 arg1 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.annotations.getTypeAnnotation")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)}))++-- | DSL reference to hydra.core.annotations.getTypeClasses+getTypeClasses :: Typed.TypedTerm t0 -> Typed.TypedTerm Graph.Graph -> Typed.TypedTerm Model.Term -> Typed.TypedTerm (Either Errors.Error (M.Map Model.Name (S.Set Model.Name)))+getTypeClasses arg0 arg1 arg2 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.annotations.getTypeClasses")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)})),+ Model.applicationArgument = (Typed.unTypedTerm arg2)}))++-- | DSL reference to hydra.core.annotations.getTypeDescription+getTypeDescription :: Typed.TypedTerm t0 -> Typed.TypedTerm Graph.Graph -> Typed.TypedTerm Model.Type -> Typed.TypedTerm (Either Errors.Error (Maybe String))+getTypeDescription arg0 arg1 arg2 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.annotations.getTypeDescription")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)})),+ Model.applicationArgument = (Typed.unTypedTerm arg2)}))++-- | DSL reference to hydra.core.annotations.hasDescription+hasDescription :: Typed.TypedTerm (M.Map Model.Name t0) -> Typed.TypedTerm Bool+hasDescription arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.annotations.hasDescription")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.annotations.hasTypeDescription+hasTypeDescription :: Typed.TypedTerm Model.Type -> Typed.TypedTerm Bool+hasTypeDescription arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.annotations.hasTypeDescription")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.annotations.isNativeType+isNativeType :: Typed.TypedTerm Model.Binding -> Typed.TypedTerm Bool+isNativeType arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.annotations.isNativeType")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.annotations.normalizeTermAnnotations+normalizeTermAnnotations :: Typed.TypedTerm Model.Term -> Typed.TypedTerm Model.Term+normalizeTermAnnotations arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.annotations.normalizeTermAnnotations")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.annotations.normalizeTypeAnnotations+normalizeTypeAnnotations :: Typed.TypedTerm Model.Type -> Typed.TypedTerm Model.Type+normalizeTypeAnnotations arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.annotations.normalizeTypeAnnotations")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.annotations.setAnnotation+setAnnotation :: Typed.TypedTerm t0 -> Typed.TypedTerm (Maybe t1) -> Typed.TypedTerm (M.Map t0 t1) -> Typed.TypedTerm (M.Map t0 t1)+setAnnotation arg0 arg1 arg2 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.annotations.setAnnotation")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)})),+ Model.applicationArgument = (Typed.unTypedTerm arg2)}))++-- | DSL reference to hydra.core.annotations.setDescription+setDescription :: Typed.TypedTerm (Maybe String) -> Typed.TypedTerm (M.Map Model.Name Model.Term) -> Typed.TypedTerm (M.Map Model.Name Model.Term)+setDescription arg0 arg1 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.annotations.setDescription")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)}))++-- | DSL reference to hydra.core.annotations.setTermAnnotation+setTermAnnotation :: Typed.TypedTerm Model.Name -> Typed.TypedTerm (Maybe Model.Term) -> Typed.TypedTerm Model.Term -> Typed.TypedTerm Model.Term+setTermAnnotation arg0 arg1 arg2 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.annotations.setTermAnnotation")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)})),+ Model.applicationArgument = (Typed.unTypedTerm arg2)}))++-- | DSL reference to hydra.core.annotations.setTermDescription+setTermDescription :: Typed.TypedTerm (Maybe String) -> Typed.TypedTerm Model.Term -> Typed.TypedTerm Model.Term+setTermDescription arg0 arg1 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.annotations.setTermDescription")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)}))++-- | DSL reference to hydra.core.annotations.setType+setType :: Typed.TypedTerm (Maybe Model.Type) -> Typed.TypedTerm (M.Map Model.Name Model.Term) -> Typed.TypedTerm (M.Map Model.Name Model.Term)+setType arg0 arg1 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.annotations.setType")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)}))++-- | DSL reference to hydra.core.annotations.setTypeAnnotation+setTypeAnnotation :: Typed.TypedTerm Model.Name -> Typed.TypedTerm (Maybe Model.Term) -> Typed.TypedTerm Model.Type -> Typed.TypedTerm Model.Type+setTypeAnnotation arg0 arg1 arg2 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.annotations.setTypeAnnotation")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)})),+ Model.applicationArgument = (Typed.unTypedTerm arg2)}))++-- | DSL reference to hydra.core.annotations.setTypeClasses+setTypeClasses :: Typed.TypedTerm (M.Map Model.Name (S.Set Model.Name)) -> Typed.TypedTerm Model.Term -> Typed.TypedTerm Model.Term+setTypeClasses arg0 arg1 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.annotations.setTypeClasses")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)}))++-- | DSL reference to hydra.core.annotations.setTypeDescription+setTypeDescription :: Typed.TypedTerm (Maybe String) -> Typed.TypedTerm Model.Type -> Typed.TypedTerm Model.Type+setTypeDescription arg0 arg1 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.annotations.setTypeDescription")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)}))++-- | DSL reference to hydra.core.annotations.termAnnotationInternal+termAnnotationInternal :: Typed.TypedTerm Model.Term -> Typed.TypedTerm (M.Map Model.Name Model.Term)+termAnnotationInternal arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.annotations.termAnnotationInternal")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.annotations.typeAnnotationInternal+typeAnnotationInternal :: Typed.TypedTerm Model.Type -> Typed.TypedTerm (M.Map Model.Name Model.Term)+typeAnnotationInternal arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.annotations.typeAnnotationInternal")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.annotations.wrapAnnotationMap+wrapAnnotationMap :: Typed.TypedTerm (M.Map Model.Name Model.Term) -> Typed.TypedTerm Model.Term+wrapAnnotationMap arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.annotations.wrapAnnotationMap")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))
@@ -0,0 +1,106 @@+-- Note: this is an automatically generated file. Do not edit.++-- | DSL functions for hydra.core.arity++module Hydra.Core.Dsl.Arity where++import qualified Hydra.Core.Arity as Arity+import qualified Hydra.Core.Ast as Ast+import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Diff as Diff+import qualified Hydra.Core.Docs as Docs+import qualified Hydra.Core.Dsl.Ast as DslAst+import qualified Hydra.Core.Dsl.Coders as DslCoders+import qualified Hydra.Core.Dsl.Diff as DslDiff+import qualified Hydra.Core.Dsl.Docs as DslDocs+import qualified Hydra.Core.Dsl.Error.Checking as ErrorChecking+import qualified Hydra.Core.Dsl.Error.File as DslErrorFile+import qualified Hydra.Core.Dsl.Error.Model as DslErrorModel+import qualified Hydra.Core.Dsl.Error.Packaging as DslErrorPackaging+import qualified Hydra.Core.Dsl.Error.System as DslErrorSystem+import qualified Hydra.Core.Dsl.Errors as DslErrors+import qualified Hydra.Core.Dsl.File as DslFile+import qualified Hydra.Core.Dsl.Graph as DslGraph+import qualified Hydra.Core.Dsl.Json.Model as DslJsonModel+import qualified Hydra.Core.Dsl.Markdown as DslMarkdown+import qualified Hydra.Core.Dsl.Model as DslModel+import qualified Hydra.Core.Dsl.Packaging as DslPackaging+import qualified Hydra.Core.Dsl.Parsing as DslParsing+import qualified Hydra.Core.Dsl.Paths as DslPaths+import qualified Hydra.Core.Dsl.Query as DslQuery+import qualified Hydra.Core.Dsl.Regex as DslRegex+import qualified Hydra.Core.Dsl.Relational as DslRelational+import qualified Hydra.Core.Dsl.System as DslSystem+import qualified Hydra.Core.Dsl.Tabular as DslTabular+import qualified Hydra.Core.Dsl.Testing as DslTesting+import qualified Hydra.Core.Dsl.Time as DslTime+import qualified Hydra.Core.Dsl.Topology as DslTopology+import qualified Hydra.Core.Dsl.Typing as DslTyping+import qualified Hydra.Core.Dsl.Util as DslUtil+import qualified Hydra.Core.Dsl.Validation as DslValidation+import qualified Hydra.Core.Dsl.Variants as DslVariants+import qualified Hydra.Core.Error.Checking as Checking+import qualified Hydra.Core.Error.File as ErrorFile+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Error.Packaging as ErrorPackaging+import qualified Hydra.Core.Error.System as ErrorSystem+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Json.Model as JsonModel+import qualified Hydra.Core.Markdown as Markdown+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Parsing as Parsing+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Query as Query+import qualified Hydra.Core.Regex as Regex+import qualified Hydra.Core.Relational as Relational+import qualified Hydra.Core.System as System+import qualified Hydra.Core.Tabular as Tabular+import qualified Hydra.Core.Testing as Testing+import qualified Hydra.Core.Time as Time+import qualified Hydra.Core.Topology as Topology+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Validation as Validation+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | DSL reference to hydra.core.arity.primitiveArity+primitiveArity :: Typed.TypedTerm Graph.Primitive -> Typed.TypedTerm Int+primitiveArity arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.arity.primitiveArity")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.arity.termArity+termArity :: Typed.TypedTerm Model.Term -> Typed.TypedTerm Int+termArity arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.arity.termArity")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.arity.typeArity+typeArity :: Typed.TypedTerm Model.Type -> Typed.TypedTerm Int+typeArity arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.arity.typeArity")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.arity.typeSchemeArity+typeSchemeArity :: Typed.TypedTerm Model.TypeScheme -> Typed.TypedTerm Int+typeSchemeArity arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.arity.typeSchemeArity")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.arity.uncurryType+uncurryType :: Typed.TypedTerm Model.Type -> Typed.TypedTerm [Model.Type]+uncurryType arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.arity.uncurryType")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))
@@ -0,0 +1,1027 @@+-- Note: this is an automatically generated file. Do not edit.++-- | DSL functions for hydra.core.ast++module Hydra.Core.Dsl.Ast where++import qualified Hydra.Core.Ast as Ast+import qualified Hydra.Core.Decode.Ast as DecodeAst+import qualified Hydra.Core.Dsl.Model as DslModel+import qualified Hydra.Core.Encode.Ast as EncodeAst+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Typed as Typed+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | DSL name token for hydra.core.ast.Associativity+associativityAssociativity :: Typed.TypedName Ast.Associativity+associativityAssociativity = Typed.TypedName (Model.Name "hydra.core.ast.Associativity")++-- | DSL injection for the both variant of hydra.core.ast.Associativity+associativityBoth :: Typed.TypedTerm Ast.Associativity+associativityBoth =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.ast.Associativity"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "both"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL injection for the left variant of hydra.core.ast.Associativity+associativityLeft :: Typed.TypedTerm Ast.Associativity+associativityLeft =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.ast.Associativity"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "left"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL injection for the none variant of hydra.core.ast.Associativity+associativityNone :: Typed.TypedTerm Ast.Associativity+associativityNone =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.ast.Associativity"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "none"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL injection for the right variant of hydra.core.ast.Associativity+associativityRight :: Typed.TypedTerm Ast.Associativity+associativityRight =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.ast.Associativity"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "right"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL constructor for hydra.core.ast.BlockStyle+blockStyle :: Typed.TypedTerm (Maybe String) -> Typed.TypedTerm Bool -> Typed.TypedTerm Bool -> Typed.TypedTerm Ast.BlockStyle+blockStyle indent newlineBeforeContent newlineAfterContent =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.ast.BlockStyle"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "indent"),+ Model.fieldTerm = (Typed.unTypedTerm indent)},+ Model.Field {+ Model.fieldName = (Model.Name "newlineBeforeContent"),+ Model.fieldTerm = (Typed.unTypedTerm newlineBeforeContent)},+ Model.Field {+ Model.fieldName = (Model.Name "newlineAfterContent"),+ Model.fieldTerm = (Typed.unTypedTerm newlineAfterContent)}]}))++-- | DSL name token for hydra.core.ast.BlockStyle+blockStyleBlockStyle :: Typed.TypedName Ast.BlockStyle+blockStyleBlockStyle = Typed.TypedName (Model.Name "hydra.core.ast.BlockStyle")++-- | DSL accessor for the indent field of hydra.core.ast.BlockStyle+blockStyleIndent :: Typed.TypedTerm Ast.BlockStyle -> Typed.TypedTerm (Maybe String)+blockStyleIndent x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.ast.BlockStyle"),+ Model.projectionFieldName = (Model.Name "indent")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the newlineAfterContent field of hydra.core.ast.BlockStyle+blockStyleNewlineAfterContent :: Typed.TypedTerm Ast.BlockStyle -> Typed.TypedTerm Bool+blockStyleNewlineAfterContent x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.ast.BlockStyle"),+ Model.projectionFieldName = (Model.Name "newlineAfterContent")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the newlineBeforeContent field of hydra.core.ast.BlockStyle+blockStyleNewlineBeforeContent :: Typed.TypedTerm Ast.BlockStyle -> Typed.TypedTerm Bool+blockStyleNewlineBeforeContent x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.ast.BlockStyle"),+ Model.projectionFieldName = (Model.Name "newlineBeforeContent")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL updater for the indent field of hydra.core.ast.BlockStyle+blockStyleWithIndent :: Typed.TypedTerm Ast.BlockStyle -> Typed.TypedTerm (Maybe String) -> Typed.TypedTerm Ast.BlockStyle+blockStyleWithIndent original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.ast.BlockStyle"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "indent"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "newlineBeforeContent"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.ast.BlockStyle"),+ Model.projectionFieldName = (Model.Name "newlineBeforeContent")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "newlineAfterContent"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.ast.BlockStyle"),+ Model.projectionFieldName = (Model.Name "newlineAfterContent")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the newlineAfterContent field of hydra.core.ast.BlockStyle+blockStyleWithNewlineAfterContent :: Typed.TypedTerm Ast.BlockStyle -> Typed.TypedTerm Bool -> Typed.TypedTerm Ast.BlockStyle+blockStyleWithNewlineAfterContent original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.ast.BlockStyle"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "indent"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.ast.BlockStyle"),+ Model.projectionFieldName = (Model.Name "indent")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "newlineBeforeContent"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.ast.BlockStyle"),+ Model.projectionFieldName = (Model.Name "newlineBeforeContent")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "newlineAfterContent"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL updater for the newlineBeforeContent field of hydra.core.ast.BlockStyle+blockStyleWithNewlineBeforeContent :: Typed.TypedTerm Ast.BlockStyle -> Typed.TypedTerm Bool -> Typed.TypedTerm Ast.BlockStyle+blockStyleWithNewlineBeforeContent original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.ast.BlockStyle"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "indent"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.ast.BlockStyle"),+ Model.projectionFieldName = (Model.Name "indent")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "newlineBeforeContent"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "newlineAfterContent"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.ast.BlockStyle"),+ Model.projectionFieldName = (Model.Name "newlineAfterContent")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL constructor for hydra.core.ast.BracketExpr+bracketExpr :: Typed.TypedTerm Ast.Brackets -> Typed.TypedTerm Ast.Expr -> Typed.TypedTerm Ast.BlockStyle -> Typed.TypedTerm Ast.BracketExpr+bracketExpr brackets enclosed style =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.ast.BracketExpr"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "brackets"),+ Model.fieldTerm = (Typed.unTypedTerm brackets)},+ Model.Field {+ Model.fieldName = (Model.Name "enclosed"),+ Model.fieldTerm = (Typed.unTypedTerm enclosed)},+ Model.Field {+ Model.fieldName = (Model.Name "style"),+ Model.fieldTerm = (Typed.unTypedTerm style)}]}))++-- | DSL name token for hydra.core.ast.BracketExpr+bracketExprBracketExpr :: Typed.TypedName Ast.BracketExpr+bracketExprBracketExpr = Typed.TypedName (Model.Name "hydra.core.ast.BracketExpr")++-- | DSL accessor for the brackets field of hydra.core.ast.BracketExpr+bracketExprBrackets :: Typed.TypedTerm Ast.BracketExpr -> Typed.TypedTerm Ast.Brackets+bracketExprBrackets x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.ast.BracketExpr"),+ Model.projectionFieldName = (Model.Name "brackets")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the enclosed field of hydra.core.ast.BracketExpr+bracketExprEnclosed :: Typed.TypedTerm Ast.BracketExpr -> Typed.TypedTerm Ast.Expr+bracketExprEnclosed x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.ast.BracketExpr"),+ Model.projectionFieldName = (Model.Name "enclosed")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the style field of hydra.core.ast.BracketExpr+bracketExprStyle :: Typed.TypedTerm Ast.BracketExpr -> Typed.TypedTerm Ast.BlockStyle+bracketExprStyle x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.ast.BracketExpr"),+ Model.projectionFieldName = (Model.Name "style")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL updater for the brackets field of hydra.core.ast.BracketExpr+bracketExprWithBrackets :: Typed.TypedTerm Ast.BracketExpr -> Typed.TypedTerm Ast.Brackets -> Typed.TypedTerm Ast.BracketExpr+bracketExprWithBrackets original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.ast.BracketExpr"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "brackets"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "enclosed"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.ast.BracketExpr"),+ Model.projectionFieldName = (Model.Name "enclosed")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "style"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.ast.BracketExpr"),+ Model.projectionFieldName = (Model.Name "style")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the enclosed field of hydra.core.ast.BracketExpr+bracketExprWithEnclosed :: Typed.TypedTerm Ast.BracketExpr -> Typed.TypedTerm Ast.Expr -> Typed.TypedTerm Ast.BracketExpr+bracketExprWithEnclosed original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.ast.BracketExpr"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "brackets"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.ast.BracketExpr"),+ Model.projectionFieldName = (Model.Name "brackets")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "enclosed"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "style"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.ast.BracketExpr"),+ Model.projectionFieldName = (Model.Name "style")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the style field of hydra.core.ast.BracketExpr+bracketExprWithStyle :: Typed.TypedTerm Ast.BracketExpr -> Typed.TypedTerm Ast.BlockStyle -> Typed.TypedTerm Ast.BracketExpr+bracketExprWithStyle original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.ast.BracketExpr"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "brackets"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.ast.BracketExpr"),+ Model.projectionFieldName = (Model.Name "brackets")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "enclosed"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.ast.BracketExpr"),+ Model.projectionFieldName = (Model.Name "enclosed")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "style"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL constructor for hydra.core.ast.Brackets+brackets :: Typed.TypedTerm Ast.Symbol -> Typed.TypedTerm Ast.Symbol -> Typed.TypedTerm Ast.Brackets+brackets open close =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.ast.Brackets"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "open"),+ Model.fieldTerm = (Typed.unTypedTerm open)},+ Model.Field {+ Model.fieldName = (Model.Name "close"),+ Model.fieldTerm = (Typed.unTypedTerm close)}]}))++-- | DSL name token for hydra.core.ast.Brackets+bracketsBrackets :: Typed.TypedName Ast.Brackets+bracketsBrackets = Typed.TypedName (Model.Name "hydra.core.ast.Brackets")++-- | DSL accessor for the close field of hydra.core.ast.Brackets+bracketsClose :: Typed.TypedTerm Ast.Brackets -> Typed.TypedTerm Ast.Symbol+bracketsClose x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.ast.Brackets"),+ Model.projectionFieldName = (Model.Name "close")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the open field of hydra.core.ast.Brackets+bracketsOpen :: Typed.TypedTerm Ast.Brackets -> Typed.TypedTerm Ast.Symbol+bracketsOpen x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.ast.Brackets"),+ Model.projectionFieldName = (Model.Name "open")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL updater for the close field of hydra.core.ast.Brackets+bracketsWithClose :: Typed.TypedTerm Ast.Brackets -> Typed.TypedTerm Ast.Symbol -> Typed.TypedTerm Ast.Brackets+bracketsWithClose original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.ast.Brackets"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "open"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.ast.Brackets"),+ Model.projectionFieldName = (Model.Name "open")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "close"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL updater for the open field of hydra.core.ast.Brackets+bracketsWithOpen :: Typed.TypedTerm Ast.Brackets -> Typed.TypedTerm Ast.Symbol -> Typed.TypedTerm Ast.Brackets+bracketsWithOpen original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.ast.Brackets"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "open"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "close"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.ast.Brackets"),+ Model.projectionFieldName = (Model.Name "close")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL injection for the brackets variant of hydra.core.ast.Expr+exprBrackets :: Typed.TypedTerm Ast.BracketExpr -> Typed.TypedTerm Ast.Expr+exprBrackets x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.ast.Expr"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "brackets"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the const variant of hydra.core.ast.Expr+exprConst :: Typed.TypedTerm Ast.Symbol -> Typed.TypedTerm Ast.Expr+exprConst x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.ast.Expr"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "const"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL name token for hydra.core.ast.Expr+exprExpr :: Typed.TypedName Ast.Expr+exprExpr = Typed.TypedName (Model.Name "hydra.core.ast.Expr")++-- | DSL injection for the indent variant of hydra.core.ast.Expr+exprIndent :: Typed.TypedTerm Ast.IndentedExpression -> Typed.TypedTerm Ast.Expr+exprIndent x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.ast.Expr"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "indent"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the op variant of hydra.core.ast.Expr+exprOp :: Typed.TypedTerm Ast.OpExpr -> Typed.TypedTerm Ast.Expr+exprOp x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.ast.Expr"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "op"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the seq variant of hydra.core.ast.Expr+exprSeq :: Typed.TypedTerm Ast.SeqExpr -> Typed.TypedTerm Ast.Expr+exprSeq x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.ast.Expr"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "seq"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the allLines variant of hydra.core.ast.IndentStyle+indentStyleAllLines :: Typed.TypedTerm String -> Typed.TypedTerm Ast.IndentStyle+indentStyleAllLines x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.ast.IndentStyle"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "allLines"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL name token for hydra.core.ast.IndentStyle+indentStyleIndentStyle :: Typed.TypedName Ast.IndentStyle+indentStyleIndentStyle = Typed.TypedName (Model.Name "hydra.core.ast.IndentStyle")++-- | DSL injection for the subsequentLines variant of hydra.core.ast.IndentStyle+indentStyleSubsequentLines :: Typed.TypedTerm String -> Typed.TypedTerm Ast.IndentStyle+indentStyleSubsequentLines x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.ast.IndentStyle"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "subsequentLines"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL constructor for hydra.core.ast.IndentedExpression+indentedExpression :: Typed.TypedTerm Ast.IndentStyle -> Typed.TypedTerm Ast.Expr -> Typed.TypedTerm Ast.IndentedExpression+indentedExpression style expr =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.ast.IndentedExpression"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "style"),+ Model.fieldTerm = (Typed.unTypedTerm style)},+ Model.Field {+ Model.fieldName = (Model.Name "expr"),+ Model.fieldTerm = (Typed.unTypedTerm expr)}]}))++-- | DSL accessor for the expr field of hydra.core.ast.IndentedExpression+indentedExpressionExpr :: Typed.TypedTerm Ast.IndentedExpression -> Typed.TypedTerm Ast.Expr+indentedExpressionExpr x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.ast.IndentedExpression"),+ Model.projectionFieldName = (Model.Name "expr")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.ast.IndentedExpression+indentedExpressionIndentedExpression :: Typed.TypedName Ast.IndentedExpression+indentedExpressionIndentedExpression = Typed.TypedName (Model.Name "hydra.core.ast.IndentedExpression")++-- | DSL accessor for the style field of hydra.core.ast.IndentedExpression+indentedExpressionStyle :: Typed.TypedTerm Ast.IndentedExpression -> Typed.TypedTerm Ast.IndentStyle+indentedExpressionStyle x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.ast.IndentedExpression"),+ Model.projectionFieldName = (Model.Name "style")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL updater for the expr field of hydra.core.ast.IndentedExpression+indentedExpressionWithExpr :: Typed.TypedTerm Ast.IndentedExpression -> Typed.TypedTerm Ast.Expr -> Typed.TypedTerm Ast.IndentedExpression+indentedExpressionWithExpr original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.ast.IndentedExpression"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "style"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.ast.IndentedExpression"),+ Model.projectionFieldName = (Model.Name "style")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "expr"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL updater for the style field of hydra.core.ast.IndentedExpression+indentedExpressionWithStyle :: Typed.TypedTerm Ast.IndentedExpression -> Typed.TypedTerm Ast.IndentStyle -> Typed.TypedTerm Ast.IndentedExpression+indentedExpressionWithStyle original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.ast.IndentedExpression"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "style"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "expr"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.ast.IndentedExpression"),+ Model.projectionFieldName = (Model.Name "expr")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL constructor for hydra.core.ast.Op+op :: Typed.TypedTerm Ast.Symbol -> Typed.TypedTerm Ast.Padding -> Typed.TypedTerm Ast.Precedence -> Typed.TypedTerm Ast.Associativity -> Typed.TypedTerm Ast.Op+op symbol padding precedence associativity =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.ast.Op"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "symbol"),+ Model.fieldTerm = (Typed.unTypedTerm symbol)},+ Model.Field {+ Model.fieldName = (Model.Name "padding"),+ Model.fieldTerm = (Typed.unTypedTerm padding)},+ Model.Field {+ Model.fieldName = (Model.Name "precedence"),+ Model.fieldTerm = (Typed.unTypedTerm precedence)},+ Model.Field {+ Model.fieldName = (Model.Name "associativity"),+ Model.fieldTerm = (Typed.unTypedTerm associativity)}]}))++-- | DSL accessor for the associativity field of hydra.core.ast.Op+opAssociativity :: Typed.TypedTerm Ast.Op -> Typed.TypedTerm Ast.Associativity+opAssociativity x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.ast.Op"),+ Model.projectionFieldName = (Model.Name "associativity")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL constructor for hydra.core.ast.OpExpr+opExpr :: Typed.TypedTerm Ast.Op -> Typed.TypedTerm Ast.Expr -> Typed.TypedTerm Ast.Expr -> Typed.TypedTerm Ast.OpExpr+opExpr op lhs rhs =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.ast.OpExpr"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "op"),+ Model.fieldTerm = (Typed.unTypedTerm op)},+ Model.Field {+ Model.fieldName = (Model.Name "lhs"),+ Model.fieldTerm = (Typed.unTypedTerm lhs)},+ Model.Field {+ Model.fieldName = (Model.Name "rhs"),+ Model.fieldTerm = (Typed.unTypedTerm rhs)}]}))++-- | DSL accessor for the lhs field of hydra.core.ast.OpExpr+opExprLhs :: Typed.TypedTerm Ast.OpExpr -> Typed.TypedTerm Ast.Expr+opExprLhs x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.ast.OpExpr"),+ Model.projectionFieldName = (Model.Name "lhs")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the op field of hydra.core.ast.OpExpr+opExprOp :: Typed.TypedTerm Ast.OpExpr -> Typed.TypedTerm Ast.Op+opExprOp x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.ast.OpExpr"),+ Model.projectionFieldName = (Model.Name "op")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.ast.OpExpr+opExprOpExpr :: Typed.TypedName Ast.OpExpr+opExprOpExpr = Typed.TypedName (Model.Name "hydra.core.ast.OpExpr")++-- | DSL accessor for the rhs field of hydra.core.ast.OpExpr+opExprRhs :: Typed.TypedTerm Ast.OpExpr -> Typed.TypedTerm Ast.Expr+opExprRhs x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.ast.OpExpr"),+ Model.projectionFieldName = (Model.Name "rhs")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL updater for the lhs field of hydra.core.ast.OpExpr+opExprWithLhs :: Typed.TypedTerm Ast.OpExpr -> Typed.TypedTerm Ast.Expr -> Typed.TypedTerm Ast.OpExpr+opExprWithLhs original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.ast.OpExpr"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "op"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.ast.OpExpr"),+ Model.projectionFieldName = (Model.Name "op")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "lhs"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "rhs"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.ast.OpExpr"),+ Model.projectionFieldName = (Model.Name "rhs")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the op field of hydra.core.ast.OpExpr+opExprWithOp :: Typed.TypedTerm Ast.OpExpr -> Typed.TypedTerm Ast.Op -> Typed.TypedTerm Ast.OpExpr+opExprWithOp original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.ast.OpExpr"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "op"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "lhs"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.ast.OpExpr"),+ Model.projectionFieldName = (Model.Name "lhs")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "rhs"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.ast.OpExpr"),+ Model.projectionFieldName = (Model.Name "rhs")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the rhs field of hydra.core.ast.OpExpr+opExprWithRhs :: Typed.TypedTerm Ast.OpExpr -> Typed.TypedTerm Ast.Expr -> Typed.TypedTerm Ast.OpExpr+opExprWithRhs original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.ast.OpExpr"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "op"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.ast.OpExpr"),+ Model.projectionFieldName = (Model.Name "op")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "lhs"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.ast.OpExpr"),+ Model.projectionFieldName = (Model.Name "lhs")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "rhs"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL name token for hydra.core.ast.Op+opOp :: Typed.TypedName Ast.Op+opOp = Typed.TypedName (Model.Name "hydra.core.ast.Op")++-- | DSL accessor for the padding field of hydra.core.ast.Op+opPadding :: Typed.TypedTerm Ast.Op -> Typed.TypedTerm Ast.Padding+opPadding x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.ast.Op"),+ Model.projectionFieldName = (Model.Name "padding")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the precedence field of hydra.core.ast.Op+opPrecedence :: Typed.TypedTerm Ast.Op -> Typed.TypedTerm Ast.Precedence+opPrecedence x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.ast.Op"),+ Model.projectionFieldName = (Model.Name "precedence")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the symbol field of hydra.core.ast.Op+opSymbol :: Typed.TypedTerm Ast.Op -> Typed.TypedTerm Ast.Symbol+opSymbol x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.ast.Op"),+ Model.projectionFieldName = (Model.Name "symbol")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL updater for the associativity field of hydra.core.ast.Op+opWithAssociativity :: Typed.TypedTerm Ast.Op -> Typed.TypedTerm Ast.Associativity -> Typed.TypedTerm Ast.Op+opWithAssociativity original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.ast.Op"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "symbol"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.ast.Op"),+ Model.projectionFieldName = (Model.Name "symbol")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "padding"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.ast.Op"),+ Model.projectionFieldName = (Model.Name "padding")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "precedence"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.ast.Op"),+ Model.projectionFieldName = (Model.Name "precedence")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "associativity"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL updater for the padding field of hydra.core.ast.Op+opWithPadding :: Typed.TypedTerm Ast.Op -> Typed.TypedTerm Ast.Padding -> Typed.TypedTerm Ast.Op+opWithPadding original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.ast.Op"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "symbol"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.ast.Op"),+ Model.projectionFieldName = (Model.Name "symbol")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "padding"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "precedence"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.ast.Op"),+ Model.projectionFieldName = (Model.Name "precedence")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "associativity"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.ast.Op"),+ Model.projectionFieldName = (Model.Name "associativity")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the precedence field of hydra.core.ast.Op+opWithPrecedence :: Typed.TypedTerm Ast.Op -> Typed.TypedTerm Ast.Precedence -> Typed.TypedTerm Ast.Op+opWithPrecedence original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.ast.Op"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "symbol"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.ast.Op"),+ Model.projectionFieldName = (Model.Name "symbol")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "padding"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.ast.Op"),+ Model.projectionFieldName = (Model.Name "padding")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "precedence"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "associativity"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.ast.Op"),+ Model.projectionFieldName = (Model.Name "associativity")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the symbol field of hydra.core.ast.Op+opWithSymbol :: Typed.TypedTerm Ast.Op -> Typed.TypedTerm Ast.Symbol -> Typed.TypedTerm Ast.Op+opWithSymbol original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.ast.Op"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "symbol"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "padding"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.ast.Op"),+ Model.projectionFieldName = (Model.Name "padding")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "precedence"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.ast.Op"),+ Model.projectionFieldName = (Model.Name "precedence")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "associativity"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.ast.Op"),+ Model.projectionFieldName = (Model.Name "associativity")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL constructor for hydra.core.ast.Padding+padding :: Typed.TypedTerm Ast.Ws -> Typed.TypedTerm Ast.Ws -> Typed.TypedTerm Ast.Padding+padding left right =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.ast.Padding"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "left"),+ Model.fieldTerm = (Typed.unTypedTerm left)},+ Model.Field {+ Model.fieldName = (Model.Name "right"),+ Model.fieldTerm = (Typed.unTypedTerm right)}]}))++-- | DSL accessor for the left field of hydra.core.ast.Padding+paddingLeft :: Typed.TypedTerm Ast.Padding -> Typed.TypedTerm Ast.Ws+paddingLeft x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.ast.Padding"),+ Model.projectionFieldName = (Model.Name "left")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.ast.Padding+paddingPadding :: Typed.TypedName Ast.Padding+paddingPadding = Typed.TypedName (Model.Name "hydra.core.ast.Padding")++-- | DSL accessor for the right field of hydra.core.ast.Padding+paddingRight :: Typed.TypedTerm Ast.Padding -> Typed.TypedTerm Ast.Ws+paddingRight x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.ast.Padding"),+ Model.projectionFieldName = (Model.Name "right")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL updater for the left field of hydra.core.ast.Padding+paddingWithLeft :: Typed.TypedTerm Ast.Padding -> Typed.TypedTerm Ast.Ws -> Typed.TypedTerm Ast.Padding+paddingWithLeft original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.ast.Padding"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "left"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "right"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.ast.Padding"),+ Model.projectionFieldName = (Model.Name "right")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the right field of hydra.core.ast.Padding+paddingWithRight :: Typed.TypedTerm Ast.Padding -> Typed.TypedTerm Ast.Ws -> Typed.TypedTerm Ast.Padding+paddingWithRight original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.ast.Padding"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "left"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.ast.Padding"),+ Model.projectionFieldName = (Model.Name "left")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "right"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL constructor for the hydra.core.ast.Precedence wrapper+precedence :: Typed.TypedTerm Int -> Typed.TypedTerm Ast.Precedence+precedence x =+ Typed.TypedTerm (Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.Name "hydra.core.ast.Precedence"),+ Model.wrappedTermBody = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.ast.Precedence+precedencePrecedence :: Typed.TypedName Ast.Precedence+precedencePrecedence = Typed.TypedName (Model.Name "hydra.core.ast.Precedence")++-- | DSL constructor for hydra.core.ast.SeqExpr+seqExpr :: Typed.TypedTerm Ast.Op -> Typed.TypedTerm [Ast.Expr] -> Typed.TypedTerm Ast.SeqExpr+seqExpr op elements =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.ast.SeqExpr"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "op"),+ Model.fieldTerm = (Typed.unTypedTerm op)},+ Model.Field {+ Model.fieldName = (Model.Name "elements"),+ Model.fieldTerm = (Typed.unTypedTerm elements)}]}))++-- | DSL accessor for the elements field of hydra.core.ast.SeqExpr+seqExprElements :: Typed.TypedTerm Ast.SeqExpr -> Typed.TypedTerm [Ast.Expr]+seqExprElements x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.ast.SeqExpr"),+ Model.projectionFieldName = (Model.Name "elements")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the op field of hydra.core.ast.SeqExpr+seqExprOp :: Typed.TypedTerm Ast.SeqExpr -> Typed.TypedTerm Ast.Op+seqExprOp x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.ast.SeqExpr"),+ Model.projectionFieldName = (Model.Name "op")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.ast.SeqExpr+seqExprSeqExpr :: Typed.TypedName Ast.SeqExpr+seqExprSeqExpr = Typed.TypedName (Model.Name "hydra.core.ast.SeqExpr")++-- | DSL updater for the elements field of hydra.core.ast.SeqExpr+seqExprWithElements :: Typed.TypedTerm Ast.SeqExpr -> Typed.TypedTerm [Ast.Expr] -> Typed.TypedTerm Ast.SeqExpr+seqExprWithElements original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.ast.SeqExpr"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "op"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.ast.SeqExpr"),+ Model.projectionFieldName = (Model.Name "op")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "elements"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL updater for the op field of hydra.core.ast.SeqExpr+seqExprWithOp :: Typed.TypedTerm Ast.SeqExpr -> Typed.TypedTerm Ast.Op -> Typed.TypedTerm Ast.SeqExpr+seqExprWithOp original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.ast.SeqExpr"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "op"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "elements"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.ast.SeqExpr"),+ Model.projectionFieldName = (Model.Name "elements")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL constructor for the hydra.core.ast.Symbol wrapper+symbol :: Typed.TypedTerm String -> Typed.TypedTerm Ast.Symbol+symbol x =+ Typed.TypedTerm (Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.Name "hydra.core.ast.Symbol"),+ Model.wrappedTermBody = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.ast.Symbol+symbolSymbol :: Typed.TypedName Ast.Symbol+symbolSymbol = Typed.TypedName (Model.Name "hydra.core.ast.Symbol")++-- | DSL accessor for the body of hydra.core.ast.Precedence+unPrecedence :: Typed.TypedTerm Ast.Precedence -> Typed.TypedTerm Int+unPrecedence x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermUnwrap (Model.Name "hydra.core.ast.Precedence")),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the body of hydra.core.ast.Symbol+unSymbol :: Typed.TypedTerm Ast.Symbol -> Typed.TypedTerm String+unSymbol x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermUnwrap (Model.Name "hydra.core.ast.Symbol")),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL injection for the break variant of hydra.core.ast.Ws+wsBreak :: Typed.TypedTerm Ast.Ws+wsBreak =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.ast.Ws"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "break"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL injection for the breakAndIndent variant of hydra.core.ast.Ws+wsBreakAndIndent :: Typed.TypedTerm String -> Typed.TypedTerm Ast.Ws+wsBreakAndIndent x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.ast.Ws"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "breakAndIndent"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the doubleBreak variant of hydra.core.ast.Ws+wsDoubleBreak :: Typed.TypedTerm Ast.Ws+wsDoubleBreak =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.ast.Ws"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "doubleBreak"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL injection for the none variant of hydra.core.ast.Ws+wsNone :: Typed.TypedTerm Ast.Ws+wsNone =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.ast.Ws"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "none"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL injection for the space variant of hydra.core.ast.Ws+wsSpace :: Typed.TypedTerm Ast.Ws+wsSpace =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.ast.Ws"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "space"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL name token for hydra.core.ast.Ws+wsWs :: Typed.TypedName Ast.Ws+wsWs = Typed.TypedName (Model.Name "hydra.core.ast.Ws")
@@ -0,0 +1,516 @@+-- Note: this is an automatically generated file. Do not edit.++-- | DSL functions for hydra.core.checking++module Hydra.Core.Dsl.Checking where++import qualified Hydra.Core.Ast as Ast+import qualified Hydra.Core.Checking as Checking+import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Constants as Constants+import qualified Hydra.Core.Dependencies as Dependencies+import qualified Hydra.Core.Diff as Diff+import qualified Hydra.Core.Docs as Docs+import qualified Hydra.Core.Dsl.Ast as DslAst+import qualified Hydra.Core.Dsl.Coders as DslCoders+import qualified Hydra.Core.Dsl.Constants as DslConstants+import qualified Hydra.Core.Dsl.Dependencies as DslDependencies+import qualified Hydra.Core.Dsl.Diff as DslDiff+import qualified Hydra.Core.Dsl.Docs as DslDocs+import qualified Hydra.Core.Dsl.Error.Checking as DslErrorChecking+import qualified Hydra.Core.Dsl.Error.File as DslErrorFile+import qualified Hydra.Core.Dsl.Error.Model as DslErrorModel+import qualified Hydra.Core.Dsl.Error.Packaging as DslErrorPackaging+import qualified Hydra.Core.Dsl.Error.System as DslErrorSystem+import qualified Hydra.Core.Dsl.Errors as DslErrors+import qualified Hydra.Core.Dsl.File as DslFile+import qualified Hydra.Core.Dsl.Formatting as DslFormatting+import qualified Hydra.Core.Dsl.Graph as DslGraph+import qualified Hydra.Core.Dsl.Json.Model as DslJsonModel+import qualified Hydra.Core.Dsl.Lexical as DslLexical+import qualified Hydra.Core.Dsl.Markdown as DslMarkdown+import qualified Hydra.Core.Dsl.Model as DslModel+import qualified Hydra.Core.Dsl.Names as DslNames+import qualified Hydra.Core.Dsl.Packaging as DslPackaging+import qualified Hydra.Core.Dsl.Parsing as DslParsing+import qualified Hydra.Core.Dsl.Paths as DslPaths+import qualified Hydra.Core.Dsl.Query as DslQuery+import qualified Hydra.Core.Dsl.Regex as DslRegex+import qualified Hydra.Core.Dsl.Relational as DslRelational+import qualified Hydra.Core.Dsl.Resolution as DslResolution+import qualified Hydra.Core.Dsl.Rewriting as DslRewriting+import qualified Hydra.Core.Dsl.Scoping as DslScoping+import qualified Hydra.Core.Dsl.Strip as DslStrip+import qualified Hydra.Core.Dsl.System as DslSystem+import qualified Hydra.Core.Dsl.Tabular as DslTabular+import qualified Hydra.Core.Dsl.Testing as DslTesting+import qualified Hydra.Core.Dsl.Time as DslTime+import qualified Hydra.Core.Dsl.Topology as DslTopology+import qualified Hydra.Core.Dsl.Typing as DslTyping+import qualified Hydra.Core.Dsl.Util as DslUtil+import qualified Hydra.Core.Dsl.Validation as DslValidation+import qualified Hydra.Core.Dsl.Variables as DslVariables+import qualified Hydra.Core.Dsl.Variants as DslVariants+import qualified Hydra.Core.Error.Checking as ErrorChecking+import qualified Hydra.Core.Error.File as ErrorFile+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Error.Packaging as ErrorPackaging+import qualified Hydra.Core.Error.System as ErrorSystem+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.Extract.Model as ExtractModel+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Formatting as Formatting+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Json.Model as JsonModel+import qualified Hydra.Core.Lexical as Lexical+import qualified Hydra.Core.Markdown as Markdown+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Names as Names+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Parsing as Parsing+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Print.Errors as PrintErrors+import qualified Hydra.Core.Print.Model as PrintModel+import qualified Hydra.Core.Print.Variants as PrintVariants+import qualified Hydra.Core.Query as Query+import qualified Hydra.Core.Reflect as Reflect+import qualified Hydra.Core.Regex as Regex+import qualified Hydra.Core.Relational as Relational+import qualified Hydra.Core.Resolution as Resolution+import qualified Hydra.Core.Rewriting as Rewriting+import qualified Hydra.Core.Scoping as Scoping+import qualified Hydra.Core.Strip as Strip+import qualified Hydra.Core.Substitution as Substitution+import qualified Hydra.Core.System as System+import qualified Hydra.Core.Tabular as Tabular+import qualified Hydra.Core.Testing as Testing+import qualified Hydra.Core.Time as Time+import qualified Hydra.Core.Topology as Topology+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Validation as Validation+import qualified Hydra.Core.Variables as Variables+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void+import qualified Data.Map as M+import qualified Data.Set as S++-- | DSL reference to hydra.core.checking.allEqual+allEqual :: Typed.TypedTerm [t0] -> Typed.TypedTerm Bool+allEqual arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.checking.allEqual")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.checking.applyTypeArgumentsToType+applyTypeArgumentsToType :: Typed.TypedTerm Typing.InferenceContext -> Typed.TypedTerm Graph.Graph -> Typed.TypedTerm [Model.Type] -> Typed.TypedTerm Model.Type -> Typed.TypedTerm (Either Errors.Error Model.Type)+applyTypeArgumentsToType arg0 arg1 arg2 arg3 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.checking.applyTypeArgumentsToType")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)})),+ Model.applicationArgument = (Typed.unTypedTerm arg2)})),+ Model.applicationArgument = (Typed.unTypedTerm arg3)}))++-- | DSL reference to hydra.core.checking.checkForUnboundTypeVariables+checkForUnboundTypeVariables :: Typed.TypedTerm t0 -> Typed.TypedTerm Graph.Graph -> Typed.TypedTerm Model.Term -> Typed.TypedTerm (Either Errors.Error ())+checkForUnboundTypeVariables arg0 arg1 arg2 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.checking.checkForUnboundTypeVariables")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)})),+ Model.applicationArgument = (Typed.unTypedTerm arg2)}))++-- | DSL reference to hydra.core.checking.checkSameType+checkSameType :: Typed.TypedTerm t0 -> Typed.TypedTerm Graph.Graph -> Typed.TypedTerm String -> Typed.TypedTerm [Model.Type] -> Typed.TypedTerm (Either Errors.Error Model.Type)+checkSameType arg0 arg1 arg2 arg3 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.checking.checkSameType")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)})),+ Model.applicationArgument = (Typed.unTypedTerm arg2)})),+ Model.applicationArgument = (Typed.unTypedTerm arg3)}))++-- | DSL reference to hydra.core.checking.checkTypeSubst+checkTypeSubst :: Typed.TypedTerm t0 -> Typed.TypedTerm Graph.Graph -> Typed.TypedTerm Typing.TypeSubst -> Typed.TypedTerm (Either Errors.Error Typing.TypeSubst)+checkTypeSubst arg0 arg1 arg2 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.checking.checkTypeSubst")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)})),+ Model.applicationArgument = (Typed.unTypedTerm arg2)}))++-- | DSL reference to hydra.core.checking.containsInScopeTypeVars+containsInScopeTypeVars :: Typed.TypedTerm Graph.Graph -> Typed.TypedTerm Model.Type -> Typed.TypedTerm Bool+containsInScopeTypeVars arg0 arg1 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.checking.containsInScopeTypeVars")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)}))++-- | DSL reference to hydra.core.checking.normalizeTypeFreeVars+normalizeTypeFreeVars :: Typed.TypedTerm Model.Type -> Typed.TypedTerm Model.Type+normalizeTypeFreeVars arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.checking.normalizeTypeFreeVars")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.checking.toFContext+toFContext :: Typed.TypedTerm Graph.Graph -> Typed.TypedTerm (M.Map Model.Name Model.Type)+toFContext arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.checking.toFContext")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.checking.typeListsEffectivelyEqual+typeListsEffectivelyEqual :: Typed.TypedTerm Graph.Graph -> Typed.TypedTerm [Model.Type] -> Typed.TypedTerm [Model.Type] -> Typed.TypedTerm Bool+typeListsEffectivelyEqual arg0 arg1 arg2 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.checking.typeListsEffectivelyEqual")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)})),+ Model.applicationArgument = (Typed.unTypedTerm arg2)}))++-- | DSL reference to hydra.core.checking.typeOf+typeOf :: Typed.TypedTerm Typing.InferenceContext -> Typed.TypedTerm Graph.Graph -> Typed.TypedTerm [Model.Type] -> Typed.TypedTerm Model.Term -> Typed.TypedTerm (Either Errors.Error (Model.Type, Typing.InferenceContext))+typeOf arg0 arg1 arg2 arg3 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.checking.typeOf")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)})),+ Model.applicationArgument = (Typed.unTypedTerm arg2)})),+ Model.applicationArgument = (Typed.unTypedTerm arg3)}))++-- | DSL reference to hydra.core.checking.typeOfAnnotatedTerm+typeOfAnnotatedTerm :: Typed.TypedTerm Typing.InferenceContext -> Typed.TypedTerm Graph.Graph -> Typed.TypedTerm [Model.Type] -> Typed.TypedTerm Model.AnnotatedTerm -> Typed.TypedTerm (Either Errors.Error (Model.Type, Typing.InferenceContext))+typeOfAnnotatedTerm arg0 arg1 arg2 arg3 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.checking.typeOfAnnotatedTerm")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)})),+ Model.applicationArgument = (Typed.unTypedTerm arg2)})),+ Model.applicationArgument = (Typed.unTypedTerm arg3)}))++-- | DSL reference to hydra.core.checking.typeOfApplication+typeOfApplication :: Typed.TypedTerm Typing.InferenceContext -> Typed.TypedTerm Graph.Graph -> Typed.TypedTerm [Model.Type] -> Typed.TypedTerm Model.Application -> Typed.TypedTerm (Either Errors.Error (Model.Type, Typing.InferenceContext))+typeOfApplication arg0 arg1 arg2 arg3 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.checking.typeOfApplication")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)})),+ Model.applicationArgument = (Typed.unTypedTerm arg2)})),+ Model.applicationArgument = (Typed.unTypedTerm arg3)}))++-- | DSL reference to hydra.core.checking.typeOfCaseStatement+typeOfCaseStatement :: Typed.TypedTerm Typing.InferenceContext -> Typed.TypedTerm Graph.Graph -> Typed.TypedTerm [Model.Type] -> Typed.TypedTerm Model.CaseStatement -> Typed.TypedTerm (Either Errors.Error (Model.Type, Typing.InferenceContext))+typeOfCaseStatement arg0 arg1 arg2 arg3 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.checking.typeOfCaseStatement")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)})),+ Model.applicationArgument = (Typed.unTypedTerm arg2)})),+ Model.applicationArgument = (Typed.unTypedTerm arg3)}))++-- | DSL reference to hydra.core.checking.typeOfEither+typeOfEither :: Typed.TypedTerm Typing.InferenceContext -> Typed.TypedTerm Graph.Graph -> Typed.TypedTerm [Model.Type] -> Typed.TypedTerm (Either Model.Term Model.Term) -> Typed.TypedTerm (Either Errors.Error (Model.Type, Typing.InferenceContext))+typeOfEither arg0 arg1 arg2 arg3 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.checking.typeOfEither")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)})),+ Model.applicationArgument = (Typed.unTypedTerm arg2)})),+ Model.applicationArgument = (Typed.unTypedTerm arg3)}))++-- | DSL reference to hydra.core.checking.typeOfInjection+typeOfInjection :: Typed.TypedTerm Typing.InferenceContext -> Typed.TypedTerm Graph.Graph -> Typed.TypedTerm [Model.Type] -> Typed.TypedTerm Model.Injection -> Typed.TypedTerm (Either Errors.Error (Model.Type, Typing.InferenceContext))+typeOfInjection arg0 arg1 arg2 arg3 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.checking.typeOfInjection")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)})),+ Model.applicationArgument = (Typed.unTypedTerm arg2)})),+ Model.applicationArgument = (Typed.unTypedTerm arg3)}))++-- | DSL reference to hydra.core.checking.typeOfLambda+typeOfLambda :: Typed.TypedTerm Typing.InferenceContext -> Typed.TypedTerm Graph.Graph -> Typed.TypedTerm [Model.Type] -> Typed.TypedTerm Model.Lambda -> Typed.TypedTerm (Either Errors.Error (Model.Type, Typing.InferenceContext))+typeOfLambda arg0 arg1 arg2 arg3 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.checking.typeOfLambda")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)})),+ Model.applicationArgument = (Typed.unTypedTerm arg2)})),+ Model.applicationArgument = (Typed.unTypedTerm arg3)}))++-- | DSL reference to hydra.core.checking.typeOfLet+typeOfLet :: Typed.TypedTerm Typing.InferenceContext -> Typed.TypedTerm Graph.Graph -> Typed.TypedTerm [Model.Type] -> Typed.TypedTerm Model.Let -> Typed.TypedTerm (Either Errors.Error (Model.Type, Typing.InferenceContext))+typeOfLet arg0 arg1 arg2 arg3 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.checking.typeOfLet")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)})),+ Model.applicationArgument = (Typed.unTypedTerm arg2)})),+ Model.applicationArgument = (Typed.unTypedTerm arg3)}))++-- | DSL reference to hydra.core.checking.typeOfList+typeOfList :: Typed.TypedTerm Typing.InferenceContext -> Typed.TypedTerm Graph.Graph -> Typed.TypedTerm [Model.Type] -> Typed.TypedTerm [Model.Term] -> Typed.TypedTerm (Either Errors.Error (Model.Type, Typing.InferenceContext))+typeOfList arg0 arg1 arg2 arg3 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.checking.typeOfList")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)})),+ Model.applicationArgument = (Typed.unTypedTerm arg2)})),+ Model.applicationArgument = (Typed.unTypedTerm arg3)}))++-- | DSL reference to hydra.core.checking.typeOfLiteral+typeOfLiteral :: Typed.TypedTerm Typing.InferenceContext -> Typed.TypedTerm Graph.Graph -> Typed.TypedTerm [Model.Type] -> Typed.TypedTerm Model.Literal -> Typed.TypedTerm (Either Errors.Error (Model.Type, Typing.InferenceContext))+typeOfLiteral arg0 arg1 arg2 arg3 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.checking.typeOfLiteral")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)})),+ Model.applicationArgument = (Typed.unTypedTerm arg2)})),+ Model.applicationArgument = (Typed.unTypedTerm arg3)}))++-- | DSL reference to hydra.core.checking.typeOfMap+typeOfMap :: Typed.TypedTerm Typing.InferenceContext -> Typed.TypedTerm Graph.Graph -> Typed.TypedTerm [Model.Type] -> Typed.TypedTerm (M.Map Model.Term Model.Term) -> Typed.TypedTerm (Either Errors.Error (Model.Type, Typing.InferenceContext))+typeOfMap arg0 arg1 arg2 arg3 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.checking.typeOfMap")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)})),+ Model.applicationArgument = (Typed.unTypedTerm arg2)})),+ Model.applicationArgument = (Typed.unTypedTerm arg3)}))++-- | DSL reference to hydra.core.checking.typeOfMaybe+typeOfMaybe :: Typed.TypedTerm Typing.InferenceContext -> Typed.TypedTerm Graph.Graph -> Typed.TypedTerm [Model.Type] -> Typed.TypedTerm (Maybe Model.Term) -> Typed.TypedTerm (Either Errors.Error (Model.Type, Typing.InferenceContext))+typeOfMaybe arg0 arg1 arg2 arg3 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.checking.typeOfMaybe")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)})),+ Model.applicationArgument = (Typed.unTypedTerm arg2)})),+ Model.applicationArgument = (Typed.unTypedTerm arg3)}))++-- | DSL reference to hydra.core.checking.typeOfPair+typeOfPair :: Typed.TypedTerm Typing.InferenceContext -> Typed.TypedTerm Graph.Graph -> Typed.TypedTerm [Model.Type] -> Typed.TypedTerm (Model.Term, Model.Term) -> Typed.TypedTerm (Either Errors.Error (Model.Type, Typing.InferenceContext))+typeOfPair arg0 arg1 arg2 arg3 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.checking.typeOfPair")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)})),+ Model.applicationArgument = (Typed.unTypedTerm arg2)})),+ Model.applicationArgument = (Typed.unTypedTerm arg3)}))++-- | DSL reference to hydra.core.checking.typeOfPrimitive+typeOfPrimitive :: Typed.TypedTerm Typing.InferenceContext -> Typed.TypedTerm Graph.Graph -> Typed.TypedTerm [Model.Type] -> Typed.TypedTerm Model.Name -> Typed.TypedTerm (Either Errors.Error (Model.Type, Typing.InferenceContext))+typeOfPrimitive arg0 arg1 arg2 arg3 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.checking.typeOfPrimitive")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)})),+ Model.applicationArgument = (Typed.unTypedTerm arg2)})),+ Model.applicationArgument = (Typed.unTypedTerm arg3)}))++-- | DSL reference to hydra.core.checking.typeOfProjection+typeOfProjection :: Typed.TypedTerm Typing.InferenceContext -> Typed.TypedTerm Graph.Graph -> Typed.TypedTerm [Model.Type] -> Typed.TypedTerm Model.Projection -> Typed.TypedTerm (Either Errors.Error (Model.Type, Typing.InferenceContext))+typeOfProjection arg0 arg1 arg2 arg3 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.checking.typeOfProjection")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)})),+ Model.applicationArgument = (Typed.unTypedTerm arg2)})),+ Model.applicationArgument = (Typed.unTypedTerm arg3)}))++-- | DSL reference to hydra.core.checking.typeOfRecord+typeOfRecord :: Typed.TypedTerm Typing.InferenceContext -> Typed.TypedTerm Graph.Graph -> Typed.TypedTerm [Model.Type] -> Typed.TypedTerm Model.Record -> Typed.TypedTerm (Either Errors.Error (Model.Type, Typing.InferenceContext))+typeOfRecord arg0 arg1 arg2 arg3 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.checking.typeOfRecord")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)})),+ Model.applicationArgument = (Typed.unTypedTerm arg2)})),+ Model.applicationArgument = (Typed.unTypedTerm arg3)}))++-- | DSL reference to hydra.core.checking.typeOfSet+typeOfSet :: Typed.TypedTerm Typing.InferenceContext -> Typed.TypedTerm Graph.Graph -> Typed.TypedTerm [Model.Type] -> Typed.TypedTerm (S.Set Model.Term) -> Typed.TypedTerm (Either Errors.Error (Model.Type, Typing.InferenceContext))+typeOfSet arg0 arg1 arg2 arg3 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.checking.typeOfSet")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)})),+ Model.applicationArgument = (Typed.unTypedTerm arg2)})),+ Model.applicationArgument = (Typed.unTypedTerm arg3)}))++-- | DSL reference to hydra.core.checking.typeOfTerm+typeOfTerm :: Typed.TypedTerm Typing.InferenceContext -> Typed.TypedTerm Graph.Graph -> Typed.TypedTerm Model.Term -> Typed.TypedTerm (Either Errors.Error Model.Type)+typeOfTerm arg0 arg1 arg2 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.checking.typeOfTerm")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)})),+ Model.applicationArgument = (Typed.unTypedTerm arg2)}))++-- | DSL reference to hydra.core.checking.typeOfTypeApplication+typeOfTypeApplication :: Typed.TypedTerm Typing.InferenceContext -> Typed.TypedTerm Graph.Graph -> Typed.TypedTerm [Model.Type] -> Typed.TypedTerm Model.TypeApplicationTerm -> Typed.TypedTerm (Either Errors.Error (Model.Type, Typing.InferenceContext))+typeOfTypeApplication arg0 arg1 arg2 arg3 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.checking.typeOfTypeApplication")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)})),+ Model.applicationArgument = (Typed.unTypedTerm arg2)})),+ Model.applicationArgument = (Typed.unTypedTerm arg3)}))++-- | DSL reference to hydra.core.checking.typeOfTypeLambda+typeOfTypeLambda :: Typed.TypedTerm Typing.InferenceContext -> Typed.TypedTerm Graph.Graph -> Typed.TypedTerm [Model.Type] -> Typed.TypedTerm Model.TypeLambda -> Typed.TypedTerm (Either Errors.Error (Model.Type, Typing.InferenceContext))+typeOfTypeLambda arg0 arg1 arg2 arg3 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.checking.typeOfTypeLambda")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)})),+ Model.applicationArgument = (Typed.unTypedTerm arg2)})),+ Model.applicationArgument = (Typed.unTypedTerm arg3)}))++-- | DSL reference to hydra.core.checking.typeOfUnit+typeOfUnit :: Typed.TypedTerm Typing.InferenceContext -> Typed.TypedTerm Graph.Graph -> Typed.TypedTerm [Model.Type] -> Typed.TypedTerm (Either Errors.Error (Model.Type, Typing.InferenceContext))+typeOfUnit arg0 arg1 arg2 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.checking.typeOfUnit")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)})),+ Model.applicationArgument = (Typed.unTypedTerm arg2)}))++-- | DSL reference to hydra.core.checking.typeOfUnwrap+typeOfUnwrap :: Typed.TypedTerm Typing.InferenceContext -> Typed.TypedTerm Graph.Graph -> Typed.TypedTerm [Model.Type] -> Typed.TypedTerm Model.Name -> Typed.TypedTerm (Either Errors.Error (Model.Type, Typing.InferenceContext))+typeOfUnwrap arg0 arg1 arg2 arg3 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.checking.typeOfUnwrap")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)})),+ Model.applicationArgument = (Typed.unTypedTerm arg2)})),+ Model.applicationArgument = (Typed.unTypedTerm arg3)}))++-- | DSL reference to hydra.core.checking.typeOfVariable+typeOfVariable :: Typed.TypedTerm Typing.InferenceContext -> Typed.TypedTerm Graph.Graph -> Typed.TypedTerm [Model.Type] -> Typed.TypedTerm Model.Name -> Typed.TypedTerm (Either Errors.Error (Model.Type, Typing.InferenceContext))+typeOfVariable arg0 arg1 arg2 arg3 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.checking.typeOfVariable")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)})),+ Model.applicationArgument = (Typed.unTypedTerm arg2)})),+ Model.applicationArgument = (Typed.unTypedTerm arg3)}))++-- | DSL reference to hydra.core.checking.typeOfWrappedTerm+typeOfWrappedTerm :: Typed.TypedTerm Typing.InferenceContext -> Typed.TypedTerm Graph.Graph -> Typed.TypedTerm [Model.Type] -> Typed.TypedTerm Model.WrappedTerm -> Typed.TypedTerm (Either Errors.Error (Model.Type, Typing.InferenceContext))+typeOfWrappedTerm arg0 arg1 arg2 arg3 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.checking.typeOfWrappedTerm")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)})),+ Model.applicationArgument = (Typed.unTypedTerm arg2)})),+ Model.applicationArgument = (Typed.unTypedTerm arg3)}))++-- | DSL reference to hydra.core.checking.typesAllEffectivelyEqual+typesAllEffectivelyEqual :: Typed.TypedTerm Graph.Graph -> Typed.TypedTerm [Model.Type] -> Typed.TypedTerm Bool+typesAllEffectivelyEqual arg0 arg1 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.checking.typesAllEffectivelyEqual")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)}))++-- | DSL reference to hydra.core.checking.typesEffectivelyEqual+typesEffectivelyEqual :: Typed.TypedTerm Graph.Graph -> Typed.TypedTerm Model.Type -> Typed.TypedTerm Model.Type -> Typed.TypedTerm Bool+typesEffectivelyEqual arg0 arg1 arg2 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.checking.typesEffectivelyEqual")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)})),+ Model.applicationArgument = (Typed.unTypedTerm arg2)}))
@@ -0,0 +1,2117 @@+-- Note: this is an automatically generated file. Do not edit.++-- | DSL functions for hydra.core.coders++module Hydra.Core.Dsl.Coders where++import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Decode.Coders as DecodeCoders+import qualified Hydra.Core.Dsl.Errors as DslErrors+import qualified Hydra.Core.Dsl.File as DslFile+import qualified Hydra.Core.Dsl.Graph as DslGraph+import qualified Hydra.Core.Dsl.Model as DslModel+import qualified Hydra.Core.Dsl.Util as DslUtil+import qualified Hydra.Core.Dsl.Variants as DslVariants+import qualified Hydra.Core.Encode.Coders as EncodeCoders+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void+import qualified Data.Map as M+import qualified Data.Set as S++-- | DSL constructor for hydra.core.coders.Adapter+adapter :: Typed.TypedTerm Bool -> Typed.TypedTerm t1 -> Typed.TypedTerm t2 -> Typed.TypedTerm (Coders.Coder v1 v2 e) -> Typed.TypedTerm (Coders.Adapter t1 t2 v1 v2 e)+adapter isLossy source target coder =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.coders.Adapter"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "isLossy"),+ Model.fieldTerm = (Typed.unTypedTerm isLossy)},+ Model.Field {+ Model.fieldName = (Model.Name "source"),+ Model.fieldTerm = (Typed.unTypedTerm source)},+ Model.Field {+ Model.fieldName = (Model.Name "target"),+ Model.fieldTerm = (Typed.unTypedTerm target)},+ Model.Field {+ Model.fieldName = (Model.Name "coder"),+ Model.fieldTerm = (Typed.unTypedTerm coder)}]}))++-- | DSL name token for hydra.core.coders.Adapter+adapterAdapter :: Typed.TypedName (Coders.Adapter t1 t2 v1 v2 e)+adapterAdapter = Typed.TypedName (Model.Name "hydra.core.coders.Adapter")++-- | DSL accessor for the coder field of hydra.core.coders.Adapter+adapterCoder :: Typed.TypedTerm (Coders.Adapter t1 t2 v1 v2 e) -> Typed.TypedTerm (Coders.Coder v1 v2 e)+adapterCoder x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.Adapter"),+ Model.projectionFieldName = (Model.Name "coder")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL constructor for hydra.core.coders.AdapterContext+adapterContext :: Typed.TypedTerm Graph.Graph -> Typed.TypedTerm Coders.Language -> Typed.TypedTerm (M.Map Model.Name (Coders.Adapter Model.Type Model.Type Model.Term Model.Term Errors.Error)) -> Typed.TypedTerm Coders.AdapterContext+adapterContext graph language adapters =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.coders.AdapterContext"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "graph"),+ Model.fieldTerm = (Typed.unTypedTerm graph)},+ Model.Field {+ Model.fieldName = (Model.Name "language"),+ Model.fieldTerm = (Typed.unTypedTerm language)},+ Model.Field {+ Model.fieldName = (Model.Name "adapters"),+ Model.fieldTerm = (Typed.unTypedTerm adapters)}]}))++-- | DSL name token for hydra.core.coders.AdapterContext+adapterContextAdapterContext :: Typed.TypedName Coders.AdapterContext+adapterContextAdapterContext = Typed.TypedName (Model.Name "hydra.core.coders.AdapterContext")++-- | DSL accessor for the adapters field of hydra.core.coders.AdapterContext+adapterContextAdapters :: Typed.TypedTerm Coders.AdapterContext -> Typed.TypedTerm (M.Map Model.Name (Coders.Adapter Model.Type Model.Type Model.Term Model.Term Errors.Error))+adapterContextAdapters x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.AdapterContext"),+ Model.projectionFieldName = (Model.Name "adapters")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the graph field of hydra.core.coders.AdapterContext+adapterContextGraph :: Typed.TypedTerm Coders.AdapterContext -> Typed.TypedTerm Graph.Graph+adapterContextGraph x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.AdapterContext"),+ Model.projectionFieldName = (Model.Name "graph")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the language field of hydra.core.coders.AdapterContext+adapterContextLanguage :: Typed.TypedTerm Coders.AdapterContext -> Typed.TypedTerm Coders.Language+adapterContextLanguage x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.AdapterContext"),+ Model.projectionFieldName = (Model.Name "language")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL updater for the adapters field of hydra.core.coders.AdapterContext+adapterContextWithAdapters :: Typed.TypedTerm Coders.AdapterContext -> Typed.TypedTerm (M.Map Model.Name (Coders.Adapter Model.Type Model.Type Model.Term Model.Term Errors.Error)) -> Typed.TypedTerm Coders.AdapterContext+adapterContextWithAdapters original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.coders.AdapterContext"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "graph"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.AdapterContext"),+ Model.projectionFieldName = (Model.Name "graph")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "language"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.AdapterContext"),+ Model.projectionFieldName = (Model.Name "language")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "adapters"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL updater for the graph field of hydra.core.coders.AdapterContext+adapterContextWithGraph :: Typed.TypedTerm Coders.AdapterContext -> Typed.TypedTerm Graph.Graph -> Typed.TypedTerm Coders.AdapterContext+adapterContextWithGraph original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.coders.AdapterContext"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "graph"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "language"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.AdapterContext"),+ Model.projectionFieldName = (Model.Name "language")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "adapters"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.AdapterContext"),+ Model.projectionFieldName = (Model.Name "adapters")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the language field of hydra.core.coders.AdapterContext+adapterContextWithLanguage :: Typed.TypedTerm Coders.AdapterContext -> Typed.TypedTerm Coders.Language -> Typed.TypedTerm Coders.AdapterContext+adapterContextWithLanguage original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.coders.AdapterContext"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "graph"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.AdapterContext"),+ Model.projectionFieldName = (Model.Name "graph")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "language"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "adapters"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.AdapterContext"),+ Model.projectionFieldName = (Model.Name "adapters")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL accessor for the isLossy field of hydra.core.coders.Adapter+adapterIsLossy :: Typed.TypedTerm (Coders.Adapter t1 t2 v1 v2 e) -> Typed.TypedTerm Bool+adapterIsLossy x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.Adapter"),+ Model.projectionFieldName = (Model.Name "isLossy")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the source field of hydra.core.coders.Adapter+adapterSource :: Typed.TypedTerm (Coders.Adapter t1 t2 v1 v2 e) -> Typed.TypedTerm t1+adapterSource x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.Adapter"),+ Model.projectionFieldName = (Model.Name "source")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the target field of hydra.core.coders.Adapter+adapterTarget :: Typed.TypedTerm (Coders.Adapter t1 t2 v1 v2 e) -> Typed.TypedTerm t2+adapterTarget x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.Adapter"),+ Model.projectionFieldName = (Model.Name "target")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL updater for the coder field of hydra.core.coders.Adapter+adapterWithCoder :: Typed.TypedTerm (Coders.Adapter t1 t2 v1 v2 e) -> Typed.TypedTerm (Coders.Coder v1 v2 e) -> Typed.TypedTerm (Coders.Adapter t1 t2 v1 v2 e)+adapterWithCoder original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.coders.Adapter"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "isLossy"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.Adapter"),+ Model.projectionFieldName = (Model.Name "isLossy")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "source"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.Adapter"),+ Model.projectionFieldName = (Model.Name "source")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "target"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.Adapter"),+ Model.projectionFieldName = (Model.Name "target")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "coder"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL updater for the isLossy field of hydra.core.coders.Adapter+adapterWithIsLossy :: Typed.TypedTerm (Coders.Adapter t1 t2 v1 v2 e) -> Typed.TypedTerm Bool -> Typed.TypedTerm (Coders.Adapter t1 t2 v1 v2 e)+adapterWithIsLossy original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.coders.Adapter"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "isLossy"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "source"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.Adapter"),+ Model.projectionFieldName = (Model.Name "source")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "target"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.Adapter"),+ Model.projectionFieldName = (Model.Name "target")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "coder"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.Adapter"),+ Model.projectionFieldName = (Model.Name "coder")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the source field of hydra.core.coders.Adapter+adapterWithSource :: Typed.TypedTerm (Coders.Adapter t1 t2 v1 v2 e) -> Typed.TypedTerm t1 -> Typed.TypedTerm (Coders.Adapter t1 t2 v1 v2 e)+adapterWithSource original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.coders.Adapter"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "isLossy"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.Adapter"),+ Model.projectionFieldName = (Model.Name "isLossy")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "source"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "target"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.Adapter"),+ Model.projectionFieldName = (Model.Name "target")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "coder"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.Adapter"),+ Model.projectionFieldName = (Model.Name "coder")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the target field of hydra.core.coders.Adapter+adapterWithTarget :: Typed.TypedTerm (Coders.Adapter t1 t2 v1 v2 e) -> Typed.TypedTerm t2 -> Typed.TypedTerm (Coders.Adapter t1 t2 v1 v2 e)+adapterWithTarget original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.coders.Adapter"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "isLossy"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.Adapter"),+ Model.projectionFieldName = (Model.Name "isLossy")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "source"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.Adapter"),+ Model.projectionFieldName = (Model.Name "source")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "target"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "coder"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.Adapter"),+ Model.projectionFieldName = (Model.Name "coder")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL constructor for hydra.core.coders.Bicoder+bicoder :: Typed.TypedTerm (t1 -> Coders.Adapter t1 t2 v1 v2 e) -> Typed.TypedTerm (t2 -> Coders.Adapter t2 t1 v2 v1 e) -> Typed.TypedTerm (Coders.Bicoder t1 t2 v1 v2 e)+bicoder encode decode =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.coders.Bicoder"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "encode"),+ Model.fieldTerm = (Typed.unTypedTerm encode)},+ Model.Field {+ Model.fieldName = (Model.Name "decode"),+ Model.fieldTerm = (Typed.unTypedTerm decode)}]}))++-- | DSL name token for hydra.core.coders.Bicoder+bicoderBicoder :: Typed.TypedName (Coders.Bicoder t1 t2 v1 v2 e)+bicoderBicoder = Typed.TypedName (Model.Name "hydra.core.coders.Bicoder")++-- | DSL accessor for the decode field of hydra.core.coders.Bicoder+bicoderDecode :: Typed.TypedTerm (Coders.Bicoder t1 t2 v1 v2 e) -> Typed.TypedTerm (t2 -> Coders.Adapter t2 t1 v2 v1 e)+bicoderDecode x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.Bicoder"),+ Model.projectionFieldName = (Model.Name "decode")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the encode field of hydra.core.coders.Bicoder+bicoderEncode :: Typed.TypedTerm (Coders.Bicoder t1 t2 v1 v2 e) -> Typed.TypedTerm (t1 -> Coders.Adapter t1 t2 v1 v2 e)+bicoderEncode x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.Bicoder"),+ Model.projectionFieldName = (Model.Name "encode")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL updater for the decode field of hydra.core.coders.Bicoder+bicoderWithDecode :: Typed.TypedTerm (Coders.Bicoder t1 t2 v1 v2 e) -> Typed.TypedTerm (t2 -> Coders.Adapter t2 t1 v2 v1 e) -> Typed.TypedTerm (Coders.Bicoder t1 t2 v1 v2 e)+bicoderWithDecode original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.coders.Bicoder"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "encode"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.Bicoder"),+ Model.projectionFieldName = (Model.Name "encode")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "decode"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL updater for the encode field of hydra.core.coders.Bicoder+bicoderWithEncode :: Typed.TypedTerm (Coders.Bicoder t1 t2 v1 v2 e) -> Typed.TypedTerm (t1 -> Coders.Adapter t1 t2 v1 v2 e) -> Typed.TypedTerm (Coders.Bicoder t1 t2 v1 v2 e)+bicoderWithEncode original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.coders.Bicoder"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "encode"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "decode"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.Bicoder"),+ Model.projectionFieldName = (Model.Name "decode")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL constructor for hydra.core.coders.CaseConventions+caseConventions :: Typed.TypedTerm Util.CaseConvention -> Typed.TypedTerm Util.CaseConvention -> Typed.TypedTerm Util.CaseConvention -> Typed.TypedTerm Util.CaseConvention -> Typed.TypedTerm Util.CaseConvention -> Typed.TypedTerm Util.CaseConvention -> Typed.TypedTerm Util.CaseConvention -> Typed.TypedTerm Util.CaseConvention -> Typed.TypedTerm Util.CaseConvention -> Typed.TypedTerm Util.CaseConvention -> Typed.TypedTerm Coders.CaseConventions+caseConventions constant directory enumValue field file module_ term termVariable type_ typeVariable =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.coders.CaseConventions"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "constant"),+ Model.fieldTerm = (Typed.unTypedTerm constant)},+ Model.Field {+ Model.fieldName = (Model.Name "directory"),+ Model.fieldTerm = (Typed.unTypedTerm directory)},+ Model.Field {+ Model.fieldName = (Model.Name "enumValue"),+ Model.fieldTerm = (Typed.unTypedTerm enumValue)},+ Model.Field {+ Model.fieldName = (Model.Name "field"),+ Model.fieldTerm = (Typed.unTypedTerm field)},+ Model.Field {+ Model.fieldName = (Model.Name "file"),+ Model.fieldTerm = (Typed.unTypedTerm file)},+ Model.Field {+ Model.fieldName = (Model.Name "module"),+ Model.fieldTerm = (Typed.unTypedTerm module_)},+ Model.Field {+ Model.fieldName = (Model.Name "term"),+ Model.fieldTerm = (Typed.unTypedTerm term)},+ Model.Field {+ Model.fieldName = (Model.Name "termVariable"),+ Model.fieldTerm = (Typed.unTypedTerm termVariable)},+ Model.Field {+ Model.fieldName = (Model.Name "type"),+ Model.fieldTerm = (Typed.unTypedTerm type_)},+ Model.Field {+ Model.fieldName = (Model.Name "typeVariable"),+ Model.fieldTerm = (Typed.unTypedTerm typeVariable)}]}))++-- | DSL name token for hydra.core.coders.CaseConventions+caseConventionsCaseConventions :: Typed.TypedName Coders.CaseConventions+caseConventionsCaseConventions = Typed.TypedName (Model.Name "hydra.core.coders.CaseConventions")++-- | DSL accessor for the constant field of hydra.core.coders.CaseConventions+caseConventionsConstant :: Typed.TypedTerm Coders.CaseConventions -> Typed.TypedTerm Util.CaseConvention+caseConventionsConstant x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.CaseConventions"),+ Model.projectionFieldName = (Model.Name "constant")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the directory field of hydra.core.coders.CaseConventions+caseConventionsDirectory :: Typed.TypedTerm Coders.CaseConventions -> Typed.TypedTerm Util.CaseConvention+caseConventionsDirectory x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.CaseConventions"),+ Model.projectionFieldName = (Model.Name "directory")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the enumValue field of hydra.core.coders.CaseConventions+caseConventionsEnumValue :: Typed.TypedTerm Coders.CaseConventions -> Typed.TypedTerm Util.CaseConvention+caseConventionsEnumValue x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.CaseConventions"),+ Model.projectionFieldName = (Model.Name "enumValue")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the field field of hydra.core.coders.CaseConventions+caseConventionsField :: Typed.TypedTerm Coders.CaseConventions -> Typed.TypedTerm Util.CaseConvention+caseConventionsField x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.CaseConventions"),+ Model.projectionFieldName = (Model.Name "field")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the file field of hydra.core.coders.CaseConventions+caseConventionsFile :: Typed.TypedTerm Coders.CaseConventions -> Typed.TypedTerm Util.CaseConvention+caseConventionsFile x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.CaseConventions"),+ Model.projectionFieldName = (Model.Name "file")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the module field of hydra.core.coders.CaseConventions+caseConventionsModule :: Typed.TypedTerm Coders.CaseConventions -> Typed.TypedTerm Util.CaseConvention+caseConventionsModule x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.CaseConventions"),+ Model.projectionFieldName = (Model.Name "module")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the term field of hydra.core.coders.CaseConventions+caseConventionsTerm :: Typed.TypedTerm Coders.CaseConventions -> Typed.TypedTerm Util.CaseConvention+caseConventionsTerm x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.CaseConventions"),+ Model.projectionFieldName = (Model.Name "term")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the termVariable field of hydra.core.coders.CaseConventions+caseConventionsTermVariable :: Typed.TypedTerm Coders.CaseConventions -> Typed.TypedTerm Util.CaseConvention+caseConventionsTermVariable x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.CaseConventions"),+ Model.projectionFieldName = (Model.Name "termVariable")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the type field of hydra.core.coders.CaseConventions+caseConventionsType :: Typed.TypedTerm Coders.CaseConventions -> Typed.TypedTerm Util.CaseConvention+caseConventionsType x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.CaseConventions"),+ Model.projectionFieldName = (Model.Name "type")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the typeVariable field of hydra.core.coders.CaseConventions+caseConventionsTypeVariable :: Typed.TypedTerm Coders.CaseConventions -> Typed.TypedTerm Util.CaseConvention+caseConventionsTypeVariable x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.CaseConventions"),+ Model.projectionFieldName = (Model.Name "typeVariable")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL updater for the constant field of hydra.core.coders.CaseConventions+caseConventionsWithConstant :: Typed.TypedTerm Coders.CaseConventions -> Typed.TypedTerm Util.CaseConvention -> Typed.TypedTerm Coders.CaseConventions+caseConventionsWithConstant original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.coders.CaseConventions"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "constant"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "directory"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.CaseConventions"),+ Model.projectionFieldName = (Model.Name "directory")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "enumValue"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.CaseConventions"),+ Model.projectionFieldName = (Model.Name "enumValue")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "field"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.CaseConventions"),+ Model.projectionFieldName = (Model.Name "field")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "file"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.CaseConventions"),+ Model.projectionFieldName = (Model.Name "file")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "module"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.CaseConventions"),+ Model.projectionFieldName = (Model.Name "module")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "term"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.CaseConventions"),+ Model.projectionFieldName = (Model.Name "term")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "termVariable"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.CaseConventions"),+ Model.projectionFieldName = (Model.Name "termVariable")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "type"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.CaseConventions"),+ Model.projectionFieldName = (Model.Name "type")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "typeVariable"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.CaseConventions"),+ Model.projectionFieldName = (Model.Name "typeVariable")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the directory field of hydra.core.coders.CaseConventions+caseConventionsWithDirectory :: Typed.TypedTerm Coders.CaseConventions -> Typed.TypedTerm Util.CaseConvention -> Typed.TypedTerm Coders.CaseConventions+caseConventionsWithDirectory original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.coders.CaseConventions"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "constant"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.CaseConventions"),+ Model.projectionFieldName = (Model.Name "constant")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "directory"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "enumValue"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.CaseConventions"),+ Model.projectionFieldName = (Model.Name "enumValue")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "field"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.CaseConventions"),+ Model.projectionFieldName = (Model.Name "field")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "file"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.CaseConventions"),+ Model.projectionFieldName = (Model.Name "file")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "module"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.CaseConventions"),+ Model.projectionFieldName = (Model.Name "module")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "term"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.CaseConventions"),+ Model.projectionFieldName = (Model.Name "term")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "termVariable"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.CaseConventions"),+ Model.projectionFieldName = (Model.Name "termVariable")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "type"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.CaseConventions"),+ Model.projectionFieldName = (Model.Name "type")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "typeVariable"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.CaseConventions"),+ Model.projectionFieldName = (Model.Name "typeVariable")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the enumValue field of hydra.core.coders.CaseConventions+caseConventionsWithEnumValue :: Typed.TypedTerm Coders.CaseConventions -> Typed.TypedTerm Util.CaseConvention -> Typed.TypedTerm Coders.CaseConventions+caseConventionsWithEnumValue original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.coders.CaseConventions"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "constant"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.CaseConventions"),+ Model.projectionFieldName = (Model.Name "constant")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "directory"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.CaseConventions"),+ Model.projectionFieldName = (Model.Name "directory")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "enumValue"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "field"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.CaseConventions"),+ Model.projectionFieldName = (Model.Name "field")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "file"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.CaseConventions"),+ Model.projectionFieldName = (Model.Name "file")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "module"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.CaseConventions"),+ Model.projectionFieldName = (Model.Name "module")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "term"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.CaseConventions"),+ Model.projectionFieldName = (Model.Name "term")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "termVariable"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.CaseConventions"),+ Model.projectionFieldName = (Model.Name "termVariable")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "type"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.CaseConventions"),+ Model.projectionFieldName = (Model.Name "type")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "typeVariable"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.CaseConventions"),+ Model.projectionFieldName = (Model.Name "typeVariable")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the field field of hydra.core.coders.CaseConventions+caseConventionsWithField :: Typed.TypedTerm Coders.CaseConventions -> Typed.TypedTerm Util.CaseConvention -> Typed.TypedTerm Coders.CaseConventions+caseConventionsWithField original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.coders.CaseConventions"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "constant"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.CaseConventions"),+ Model.projectionFieldName = (Model.Name "constant")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "directory"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.CaseConventions"),+ Model.projectionFieldName = (Model.Name "directory")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "enumValue"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.CaseConventions"),+ Model.projectionFieldName = (Model.Name "enumValue")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "field"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "file"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.CaseConventions"),+ Model.projectionFieldName = (Model.Name "file")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "module"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.CaseConventions"),+ Model.projectionFieldName = (Model.Name "module")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "term"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.CaseConventions"),+ Model.projectionFieldName = (Model.Name "term")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "termVariable"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.CaseConventions"),+ Model.projectionFieldName = (Model.Name "termVariable")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "type"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.CaseConventions"),+ Model.projectionFieldName = (Model.Name "type")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "typeVariable"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.CaseConventions"),+ Model.projectionFieldName = (Model.Name "typeVariable")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the file field of hydra.core.coders.CaseConventions+caseConventionsWithFile :: Typed.TypedTerm Coders.CaseConventions -> Typed.TypedTerm Util.CaseConvention -> Typed.TypedTerm Coders.CaseConventions+caseConventionsWithFile original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.coders.CaseConventions"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "constant"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.CaseConventions"),+ Model.projectionFieldName = (Model.Name "constant")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "directory"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.CaseConventions"),+ Model.projectionFieldName = (Model.Name "directory")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "enumValue"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.CaseConventions"),+ Model.projectionFieldName = (Model.Name "enumValue")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "field"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.CaseConventions"),+ Model.projectionFieldName = (Model.Name "field")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "file"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "module"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.CaseConventions"),+ Model.projectionFieldName = (Model.Name "module")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "term"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.CaseConventions"),+ Model.projectionFieldName = (Model.Name "term")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "termVariable"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.CaseConventions"),+ Model.projectionFieldName = (Model.Name "termVariable")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "type"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.CaseConventions"),+ Model.projectionFieldName = (Model.Name "type")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "typeVariable"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.CaseConventions"),+ Model.projectionFieldName = (Model.Name "typeVariable")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the module field of hydra.core.coders.CaseConventions+caseConventionsWithModule :: Typed.TypedTerm Coders.CaseConventions -> Typed.TypedTerm Util.CaseConvention -> Typed.TypedTerm Coders.CaseConventions+caseConventionsWithModule original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.coders.CaseConventions"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "constant"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.CaseConventions"),+ Model.projectionFieldName = (Model.Name "constant")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "directory"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.CaseConventions"),+ Model.projectionFieldName = (Model.Name "directory")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "enumValue"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.CaseConventions"),+ Model.projectionFieldName = (Model.Name "enumValue")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "field"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.CaseConventions"),+ Model.projectionFieldName = (Model.Name "field")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "file"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.CaseConventions"),+ Model.projectionFieldName = (Model.Name "file")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "module"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "term"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.CaseConventions"),+ Model.projectionFieldName = (Model.Name "term")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "termVariable"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.CaseConventions"),+ Model.projectionFieldName = (Model.Name "termVariable")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "type"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.CaseConventions"),+ Model.projectionFieldName = (Model.Name "type")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "typeVariable"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.CaseConventions"),+ Model.projectionFieldName = (Model.Name "typeVariable")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the term field of hydra.core.coders.CaseConventions+caseConventionsWithTerm :: Typed.TypedTerm Coders.CaseConventions -> Typed.TypedTerm Util.CaseConvention -> Typed.TypedTerm Coders.CaseConventions+caseConventionsWithTerm original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.coders.CaseConventions"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "constant"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.CaseConventions"),+ Model.projectionFieldName = (Model.Name "constant")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "directory"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.CaseConventions"),+ Model.projectionFieldName = (Model.Name "directory")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "enumValue"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.CaseConventions"),+ Model.projectionFieldName = (Model.Name "enumValue")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "field"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.CaseConventions"),+ Model.projectionFieldName = (Model.Name "field")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "file"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.CaseConventions"),+ Model.projectionFieldName = (Model.Name "file")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "module"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.CaseConventions"),+ Model.projectionFieldName = (Model.Name "module")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "term"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "termVariable"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.CaseConventions"),+ Model.projectionFieldName = (Model.Name "termVariable")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "type"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.CaseConventions"),+ Model.projectionFieldName = (Model.Name "type")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "typeVariable"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.CaseConventions"),+ Model.projectionFieldName = (Model.Name "typeVariable")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the termVariable field of hydra.core.coders.CaseConventions+caseConventionsWithTermVariable :: Typed.TypedTerm Coders.CaseConventions -> Typed.TypedTerm Util.CaseConvention -> Typed.TypedTerm Coders.CaseConventions+caseConventionsWithTermVariable original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.coders.CaseConventions"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "constant"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.CaseConventions"),+ Model.projectionFieldName = (Model.Name "constant")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "directory"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.CaseConventions"),+ Model.projectionFieldName = (Model.Name "directory")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "enumValue"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.CaseConventions"),+ Model.projectionFieldName = (Model.Name "enumValue")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "field"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.CaseConventions"),+ Model.projectionFieldName = (Model.Name "field")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "file"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.CaseConventions"),+ Model.projectionFieldName = (Model.Name "file")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "module"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.CaseConventions"),+ Model.projectionFieldName = (Model.Name "module")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "term"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.CaseConventions"),+ Model.projectionFieldName = (Model.Name "term")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "termVariable"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "type"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.CaseConventions"),+ Model.projectionFieldName = (Model.Name "type")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "typeVariable"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.CaseConventions"),+ Model.projectionFieldName = (Model.Name "typeVariable")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the type field of hydra.core.coders.CaseConventions+caseConventionsWithType :: Typed.TypedTerm Coders.CaseConventions -> Typed.TypedTerm Util.CaseConvention -> Typed.TypedTerm Coders.CaseConventions+caseConventionsWithType original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.coders.CaseConventions"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "constant"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.CaseConventions"),+ Model.projectionFieldName = (Model.Name "constant")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "directory"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.CaseConventions"),+ Model.projectionFieldName = (Model.Name "directory")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "enumValue"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.CaseConventions"),+ Model.projectionFieldName = (Model.Name "enumValue")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "field"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.CaseConventions"),+ Model.projectionFieldName = (Model.Name "field")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "file"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.CaseConventions"),+ Model.projectionFieldName = (Model.Name "file")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "module"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.CaseConventions"),+ Model.projectionFieldName = (Model.Name "module")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "term"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.CaseConventions"),+ Model.projectionFieldName = (Model.Name "term")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "termVariable"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.CaseConventions"),+ Model.projectionFieldName = (Model.Name "termVariable")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "type"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "typeVariable"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.CaseConventions"),+ Model.projectionFieldName = (Model.Name "typeVariable")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the typeVariable field of hydra.core.coders.CaseConventions+caseConventionsWithTypeVariable :: Typed.TypedTerm Coders.CaseConventions -> Typed.TypedTerm Util.CaseConvention -> Typed.TypedTerm Coders.CaseConventions+caseConventionsWithTypeVariable original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.coders.CaseConventions"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "constant"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.CaseConventions"),+ Model.projectionFieldName = (Model.Name "constant")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "directory"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.CaseConventions"),+ Model.projectionFieldName = (Model.Name "directory")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "enumValue"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.CaseConventions"),+ Model.projectionFieldName = (Model.Name "enumValue")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "field"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.CaseConventions"),+ Model.projectionFieldName = (Model.Name "field")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "file"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.CaseConventions"),+ Model.projectionFieldName = (Model.Name "file")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "module"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.CaseConventions"),+ Model.projectionFieldName = (Model.Name "module")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "term"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.CaseConventions"),+ Model.projectionFieldName = (Model.Name "term")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "termVariable"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.CaseConventions"),+ Model.projectionFieldName = (Model.Name "termVariable")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "type"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.CaseConventions"),+ Model.projectionFieldName = (Model.Name "type")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "typeVariable"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL constructor for hydra.core.coders.Coder+coder :: Typed.TypedTerm (v1 -> Either e v2) -> Typed.TypedTerm (v2 -> Either e v1) -> Typed.TypedTerm (Coders.Coder v1 v2 e)+coder encode decode =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.coders.Coder"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "encode"),+ Model.fieldTerm = (Typed.unTypedTerm encode)},+ Model.Field {+ Model.fieldName = (Model.Name "decode"),+ Model.fieldTerm = (Typed.unTypedTerm decode)}]}))++-- | DSL name token for hydra.core.coders.Coder+coderCoder :: Typed.TypedName (Coders.Coder v1 v2 e)+coderCoder = Typed.TypedName (Model.Name "hydra.core.coders.Coder")++-- | DSL accessor for the decode field of hydra.core.coders.Coder+coderDecode :: Typed.TypedTerm (Coders.Coder v1 v2 e) -> Typed.TypedTerm (v2 -> Either e v1)+coderDecode x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.Coder"),+ Model.projectionFieldName = (Model.Name "decode")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.coders.CoderDirection+coderDirectionCoderDirection :: Typed.TypedName Coders.CoderDirection+coderDirectionCoderDirection = Typed.TypedName (Model.Name "hydra.core.coders.CoderDirection")++-- | DSL injection for the decode variant of hydra.core.coders.CoderDirection+coderDirectionDecode :: Typed.TypedTerm Coders.CoderDirection+coderDirectionDecode =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.coders.CoderDirection"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "decode"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL injection for the encode variant of hydra.core.coders.CoderDirection+coderDirectionEncode :: Typed.TypedTerm Coders.CoderDirection+coderDirectionEncode =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.coders.CoderDirection"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "encode"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL accessor for the encode field of hydra.core.coders.Coder+coderEncode :: Typed.TypedTerm (Coders.Coder v1 v2 e) -> Typed.TypedTerm (v1 -> Either e v2)+coderEncode x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.Coder"),+ Model.projectionFieldName = (Model.Name "encode")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL updater for the decode field of hydra.core.coders.Coder+coderWithDecode :: Typed.TypedTerm (Coders.Coder v1 v2 e) -> Typed.TypedTerm (v2 -> Either e v1) -> Typed.TypedTerm (Coders.Coder v1 v2 e)+coderWithDecode original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.coders.Coder"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "encode"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.Coder"),+ Model.projectionFieldName = (Model.Name "encode")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "decode"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL updater for the encode field of hydra.core.coders.Coder+coderWithEncode :: Typed.TypedTerm (Coders.Coder v1 v2 e) -> Typed.TypedTerm (v1 -> Either e v2) -> Typed.TypedTerm (Coders.Coder v1 v2 e)+coderWithEncode original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.coders.Coder"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "encode"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "decode"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.Coder"),+ Model.projectionFieldName = (Model.Name "decode")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL composition builder for the decoder of hydra.core.coders.Adapter+decodeAdapter :: Typed.TypedTerm (Graph.Graph -> Model.Term -> Either Errors.DecodingError t1) -> Typed.TypedTerm (Graph.Graph -> Model.Term -> Either Errors.DecodingError t2) -> Typed.TypedTerm (Graph.Graph -> Model.Term -> Either Errors.DecodingError v1) -> Typed.TypedTerm (Graph.Graph -> Model.Term -> Either Errors.DecodingError v2) -> Typed.TypedTerm (Graph.Graph -> Model.Term -> Either Errors.DecodingError e) -> Typed.TypedTerm (Graph.Graph -> Model.Term -> Either Errors.DecodingError (Coders.Adapter t1 t2 v1 v2 e))+decodeAdapter t1 t2 v1 v2 e =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.decode.coders.adapter")),+ Model.applicationArgument = (Typed.unTypedTerm t1)})),+ Model.applicationArgument = (Typed.unTypedTerm t2)})),+ Model.applicationArgument = (Typed.unTypedTerm v1)})),+ Model.applicationArgument = (Typed.unTypedTerm v2)})),+ Model.applicationArgument = (Typed.unTypedTerm e)}))++-- | DSL composition builder for the decoder of hydra.core.coders.Bicoder+decodeBicoder :: Typed.TypedTerm (Graph.Graph -> Model.Term -> Either Errors.DecodingError t1) -> Typed.TypedTerm (Graph.Graph -> Model.Term -> Either Errors.DecodingError t2) -> Typed.TypedTerm (Graph.Graph -> Model.Term -> Either Errors.DecodingError v1) -> Typed.TypedTerm (Graph.Graph -> Model.Term -> Either Errors.DecodingError v2) -> Typed.TypedTerm (Graph.Graph -> Model.Term -> Either Errors.DecodingError e) -> Typed.TypedTerm (Graph.Graph -> Model.Term -> Either Errors.DecodingError (Coders.Bicoder t1 t2 v1 v2 e))+decodeBicoder t1 t2 v1 v2 e =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.decode.coders.bicoder")),+ Model.applicationArgument = (Typed.unTypedTerm t1)})),+ Model.applicationArgument = (Typed.unTypedTerm t2)})),+ Model.applicationArgument = (Typed.unTypedTerm v1)})),+ Model.applicationArgument = (Typed.unTypedTerm v2)})),+ Model.applicationArgument = (Typed.unTypedTerm e)}))++-- | DSL composition builder for the decoder of hydra.core.coders.Coder+decodeCoder :: Typed.TypedTerm (Graph.Graph -> Model.Term -> Either Errors.DecodingError v1) -> Typed.TypedTerm (Graph.Graph -> Model.Term -> Either Errors.DecodingError v2) -> Typed.TypedTerm (Graph.Graph -> Model.Term -> Either Errors.DecodingError e) -> Typed.TypedTerm (Graph.Graph -> Model.Term -> Either Errors.DecodingError (Coders.Coder v1 v2 e))+decodeCoder v1 v2 e =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.decode.coders.coder")),+ Model.applicationArgument = (Typed.unTypedTerm v1)})),+ Model.applicationArgument = (Typed.unTypedTerm v2)})),+ Model.applicationArgument = (Typed.unTypedTerm e)}))++-- | DSL composition builder for the encoder of hydra.core.coders.Adapter+encodeAdapter :: Typed.TypedTerm (t1 -> Model.Term) -> Typed.TypedTerm (t2 -> Model.Term) -> Typed.TypedTerm (v1 -> Model.Term) -> Typed.TypedTerm (v2 -> Model.Term) -> Typed.TypedTerm (e -> Model.Term) -> Typed.TypedTerm (Coders.Adapter t1 t2 v1 v2 e -> Model.Term)+encodeAdapter t1 t2 v1 v2 e =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.encode.coders.adapter")),+ Model.applicationArgument = (Typed.unTypedTerm t1)})),+ Model.applicationArgument = (Typed.unTypedTerm t2)})),+ Model.applicationArgument = (Typed.unTypedTerm v1)})),+ Model.applicationArgument = (Typed.unTypedTerm v2)})),+ Model.applicationArgument = (Typed.unTypedTerm e)}))++-- | DSL composition builder for the encoder of hydra.core.coders.Bicoder+encodeBicoder :: Typed.TypedTerm (t1 -> Model.Term) -> Typed.TypedTerm (t2 -> Model.Term) -> Typed.TypedTerm (v1 -> Model.Term) -> Typed.TypedTerm (v2 -> Model.Term) -> Typed.TypedTerm (e -> Model.Term) -> Typed.TypedTerm (Coders.Bicoder t1 t2 v1 v2 e -> Model.Term)+encodeBicoder t1 t2 v1 v2 e =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.encode.coders.bicoder")),+ Model.applicationArgument = (Typed.unTypedTerm t1)})),+ Model.applicationArgument = (Typed.unTypedTerm t2)})),+ Model.applicationArgument = (Typed.unTypedTerm v1)})),+ Model.applicationArgument = (Typed.unTypedTerm v2)})),+ Model.applicationArgument = (Typed.unTypedTerm e)}))++-- | DSL composition builder for the encoder of hydra.core.coders.Coder+encodeCoder :: Typed.TypedTerm (v1 -> Model.Term) -> Typed.TypedTerm (v2 -> Model.Term) -> Typed.TypedTerm (e -> Model.Term) -> Typed.TypedTerm (Coders.Coder v1 v2 e -> Model.Term)+encodeCoder v1 v2 e =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.encode.coders.coder")),+ Model.applicationArgument = (Typed.unTypedTerm v1)})),+ Model.applicationArgument = (Typed.unTypedTerm v2)})),+ Model.applicationArgument = (Typed.unTypedTerm e)}))++-- | DSL constructor for hydra.core.coders.Language+language :: Typed.TypedTerm Coders.LanguageName -> Typed.TypedTerm Coders.LanguageConstraints -> Typed.TypedTerm (S.Set Coders.LanguageFeature) -> Typed.TypedTerm Coders.CaseConventions -> Typed.TypedTerm File.FileExtension -> Typed.TypedTerm Coders.Language+language name constraints supportedFeatures caseConventions defaultFileExtension =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.coders.Language"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Typed.unTypedTerm name)},+ Model.Field {+ Model.fieldName = (Model.Name "constraints"),+ Model.fieldTerm = (Typed.unTypedTerm constraints)},+ Model.Field {+ Model.fieldName = (Model.Name "supportedFeatures"),+ Model.fieldTerm = (Typed.unTypedTerm supportedFeatures)},+ Model.Field {+ Model.fieldName = (Model.Name "caseConventions"),+ Model.fieldTerm = (Typed.unTypedTerm caseConventions)},+ Model.Field {+ Model.fieldName = (Model.Name "defaultFileExtension"),+ Model.fieldTerm = (Typed.unTypedTerm defaultFileExtension)}]}))++-- | DSL accessor for the caseConventions field of hydra.core.coders.Language+languageCaseConventions :: Typed.TypedTerm Coders.Language -> Typed.TypedTerm Coders.CaseConventions+languageCaseConventions x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.Language"),+ Model.projectionFieldName = (Model.Name "caseConventions")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the constraints field of hydra.core.coders.Language+languageConstraints :: Typed.TypedTerm Coders.Language -> Typed.TypedTerm Coders.LanguageConstraints+languageConstraints x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.Language"),+ Model.projectionFieldName = (Model.Name "constraints")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL constructor for hydra.core.coders.LanguageConstraints+languageConstraints2 :: Typed.TypedTerm (S.Set Variants.LiteralVariant) -> Typed.TypedTerm (S.Set Model.FloatType) -> Typed.TypedTerm (S.Set Model.IntegerType) -> Typed.TypedTerm (S.Set Variants.TermVariant) -> Typed.TypedTerm (S.Set Variants.TypeVariant) -> Typed.TypedTerm (Model.Type -> Bool) -> Typed.TypedTerm Coders.LanguageConstraints+languageConstraints2 literalVariants floatTypes integerTypes termVariants typeVariants types =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.coders.LanguageConstraints"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "literalVariants"),+ Model.fieldTerm = (Typed.unTypedTerm literalVariants)},+ Model.Field {+ Model.fieldName = (Model.Name "floatTypes"),+ Model.fieldTerm = (Typed.unTypedTerm floatTypes)},+ Model.Field {+ Model.fieldName = (Model.Name "integerTypes"),+ Model.fieldTerm = (Typed.unTypedTerm integerTypes)},+ Model.Field {+ Model.fieldName = (Model.Name "termVariants"),+ Model.fieldTerm = (Typed.unTypedTerm termVariants)},+ Model.Field {+ Model.fieldName = (Model.Name "typeVariants"),+ Model.fieldTerm = (Typed.unTypedTerm typeVariants)},+ Model.Field {+ Model.fieldName = (Model.Name "types"),+ Model.fieldTerm = (Typed.unTypedTerm types)}]}))++-- | DSL accessor for the floatTypes field of hydra.core.coders.LanguageConstraints+languageConstraintsFloatTypes :: Typed.TypedTerm Coders.LanguageConstraints -> Typed.TypedTerm (S.Set Model.FloatType)+languageConstraintsFloatTypes x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.LanguageConstraints"),+ Model.projectionFieldName = (Model.Name "floatTypes")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the integerTypes field of hydra.core.coders.LanguageConstraints+languageConstraintsIntegerTypes :: Typed.TypedTerm Coders.LanguageConstraints -> Typed.TypedTerm (S.Set Model.IntegerType)+languageConstraintsIntegerTypes x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.LanguageConstraints"),+ Model.projectionFieldName = (Model.Name "integerTypes")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.coders.LanguageConstraints+languageConstraintsLanguageConstraints :: Typed.TypedName Coders.LanguageConstraints+languageConstraintsLanguageConstraints = Typed.TypedName (Model.Name "hydra.core.coders.LanguageConstraints")++-- | DSL accessor for the literalVariants field of hydra.core.coders.LanguageConstraints+languageConstraintsLiteralVariants :: Typed.TypedTerm Coders.LanguageConstraints -> Typed.TypedTerm (S.Set Variants.LiteralVariant)+languageConstraintsLiteralVariants x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.LanguageConstraints"),+ Model.projectionFieldName = (Model.Name "literalVariants")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the termVariants field of hydra.core.coders.LanguageConstraints+languageConstraintsTermVariants :: Typed.TypedTerm Coders.LanguageConstraints -> Typed.TypedTerm (S.Set Variants.TermVariant)+languageConstraintsTermVariants x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.LanguageConstraints"),+ Model.projectionFieldName = (Model.Name "termVariants")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the typeVariants field of hydra.core.coders.LanguageConstraints+languageConstraintsTypeVariants :: Typed.TypedTerm Coders.LanguageConstraints -> Typed.TypedTerm (S.Set Variants.TypeVariant)+languageConstraintsTypeVariants x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.LanguageConstraints"),+ Model.projectionFieldName = (Model.Name "typeVariants")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the types field of hydra.core.coders.LanguageConstraints+languageConstraintsTypes :: Typed.TypedTerm Coders.LanguageConstraints -> Typed.TypedTerm (Model.Type -> Bool)+languageConstraintsTypes x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.LanguageConstraints"),+ Model.projectionFieldName = (Model.Name "types")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL updater for the floatTypes field of hydra.core.coders.LanguageConstraints+languageConstraintsWithFloatTypes :: Typed.TypedTerm Coders.LanguageConstraints -> Typed.TypedTerm (S.Set Model.FloatType) -> Typed.TypedTerm Coders.LanguageConstraints+languageConstraintsWithFloatTypes original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.coders.LanguageConstraints"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "literalVariants"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.LanguageConstraints"),+ Model.projectionFieldName = (Model.Name "literalVariants")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "floatTypes"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "integerTypes"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.LanguageConstraints"),+ Model.projectionFieldName = (Model.Name "integerTypes")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "termVariants"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.LanguageConstraints"),+ Model.projectionFieldName = (Model.Name "termVariants")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "typeVariants"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.LanguageConstraints"),+ Model.projectionFieldName = (Model.Name "typeVariants")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "types"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.LanguageConstraints"),+ Model.projectionFieldName = (Model.Name "types")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the integerTypes field of hydra.core.coders.LanguageConstraints+languageConstraintsWithIntegerTypes :: Typed.TypedTerm Coders.LanguageConstraints -> Typed.TypedTerm (S.Set Model.IntegerType) -> Typed.TypedTerm Coders.LanguageConstraints+languageConstraintsWithIntegerTypes original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.coders.LanguageConstraints"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "literalVariants"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.LanguageConstraints"),+ Model.projectionFieldName = (Model.Name "literalVariants")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "floatTypes"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.LanguageConstraints"),+ Model.projectionFieldName = (Model.Name "floatTypes")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "integerTypes"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "termVariants"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.LanguageConstraints"),+ Model.projectionFieldName = (Model.Name "termVariants")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "typeVariants"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.LanguageConstraints"),+ Model.projectionFieldName = (Model.Name "typeVariants")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "types"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.LanguageConstraints"),+ Model.projectionFieldName = (Model.Name "types")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the literalVariants field of hydra.core.coders.LanguageConstraints+languageConstraintsWithLiteralVariants :: Typed.TypedTerm Coders.LanguageConstraints -> Typed.TypedTerm (S.Set Variants.LiteralVariant) -> Typed.TypedTerm Coders.LanguageConstraints+languageConstraintsWithLiteralVariants original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.coders.LanguageConstraints"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "literalVariants"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "floatTypes"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.LanguageConstraints"),+ Model.projectionFieldName = (Model.Name "floatTypes")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "integerTypes"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.LanguageConstraints"),+ Model.projectionFieldName = (Model.Name "integerTypes")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "termVariants"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.LanguageConstraints"),+ Model.projectionFieldName = (Model.Name "termVariants")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "typeVariants"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.LanguageConstraints"),+ Model.projectionFieldName = (Model.Name "typeVariants")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "types"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.LanguageConstraints"),+ Model.projectionFieldName = (Model.Name "types")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the termVariants field of hydra.core.coders.LanguageConstraints+languageConstraintsWithTermVariants :: Typed.TypedTerm Coders.LanguageConstraints -> Typed.TypedTerm (S.Set Variants.TermVariant) -> Typed.TypedTerm Coders.LanguageConstraints+languageConstraintsWithTermVariants original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.coders.LanguageConstraints"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "literalVariants"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.LanguageConstraints"),+ Model.projectionFieldName = (Model.Name "literalVariants")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "floatTypes"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.LanguageConstraints"),+ Model.projectionFieldName = (Model.Name "floatTypes")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "integerTypes"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.LanguageConstraints"),+ Model.projectionFieldName = (Model.Name "integerTypes")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "termVariants"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "typeVariants"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.LanguageConstraints"),+ Model.projectionFieldName = (Model.Name "typeVariants")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "types"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.LanguageConstraints"),+ Model.projectionFieldName = (Model.Name "types")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the typeVariants field of hydra.core.coders.LanguageConstraints+languageConstraintsWithTypeVariants :: Typed.TypedTerm Coders.LanguageConstraints -> Typed.TypedTerm (S.Set Variants.TypeVariant) -> Typed.TypedTerm Coders.LanguageConstraints+languageConstraintsWithTypeVariants original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.coders.LanguageConstraints"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "literalVariants"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.LanguageConstraints"),+ Model.projectionFieldName = (Model.Name "literalVariants")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "floatTypes"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.LanguageConstraints"),+ Model.projectionFieldName = (Model.Name "floatTypes")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "integerTypes"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.LanguageConstraints"),+ Model.projectionFieldName = (Model.Name "integerTypes")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "termVariants"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.LanguageConstraints"),+ Model.projectionFieldName = (Model.Name "termVariants")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "typeVariants"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "types"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.LanguageConstraints"),+ Model.projectionFieldName = (Model.Name "types")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the types field of hydra.core.coders.LanguageConstraints+languageConstraintsWithTypes :: Typed.TypedTerm Coders.LanguageConstraints -> Typed.TypedTerm (Model.Type -> Bool) -> Typed.TypedTerm Coders.LanguageConstraints+languageConstraintsWithTypes original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.coders.LanguageConstraints"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "literalVariants"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.LanguageConstraints"),+ Model.projectionFieldName = (Model.Name "literalVariants")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "floatTypes"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.LanguageConstraints"),+ Model.projectionFieldName = (Model.Name "floatTypes")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "integerTypes"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.LanguageConstraints"),+ Model.projectionFieldName = (Model.Name "integerTypes")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "termVariants"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.LanguageConstraints"),+ Model.projectionFieldName = (Model.Name "termVariants")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "typeVariants"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.LanguageConstraints"),+ Model.projectionFieldName = (Model.Name "typeVariants")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "types"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL accessor for the defaultFileExtension field of hydra.core.coders.Language+languageDefaultFileExtension :: Typed.TypedTerm Coders.Language -> Typed.TypedTerm File.FileExtension+languageDefaultFileExtension x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.Language"),+ Model.projectionFieldName = (Model.Name "defaultFileExtension")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.coders.LanguageFeature+languageFeatureLanguageFeature :: Typed.TypedName Coders.LanguageFeature+languageFeatureLanguageFeature = Typed.TypedName (Model.Name "hydra.core.coders.LanguageFeature")++-- | DSL injection for the nestedCaseStatements variant of hydra.core.coders.LanguageFeature+languageFeatureNestedCaseStatements :: Typed.TypedTerm Coders.LanguageFeature+languageFeatureNestedCaseStatements =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.coders.LanguageFeature"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "nestedCaseStatements"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL injection for the nestedPolymorphicLetBindings variant of hydra.core.coders.LanguageFeature+languageFeatureNestedPolymorphicLetBindings :: Typed.TypedTerm Coders.LanguageFeature+languageFeatureNestedPolymorphicLetBindings =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.coders.LanguageFeature"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "nestedPolymorphicLetBindings"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL injection for the partialApplication variant of hydra.core.coders.LanguageFeature+languageFeaturePartialApplication :: Typed.TypedTerm Coders.LanguageFeature+languageFeaturePartialApplication =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.coders.LanguageFeature"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "partialApplication"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL name token for hydra.core.coders.Language+languageLanguage :: Typed.TypedName Coders.Language+languageLanguage = Typed.TypedName (Model.Name "hydra.core.coders.Language")++-- | DSL accessor for the name field of hydra.core.coders.Language+languageName :: Typed.TypedTerm Coders.Language -> Typed.TypedTerm Coders.LanguageName+languageName x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.Language"),+ Model.projectionFieldName = (Model.Name "name")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL constructor for the hydra.core.coders.LanguageName wrapper+languageName2 :: Typed.TypedTerm String -> Typed.TypedTerm Coders.LanguageName+languageName2 x =+ Typed.TypedTerm (Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.Name "hydra.core.coders.LanguageName"),+ Model.wrappedTermBody = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.coders.LanguageName+languageNameLanguageName :: Typed.TypedName Coders.LanguageName+languageNameLanguageName = Typed.TypedName (Model.Name "hydra.core.coders.LanguageName")++-- | DSL accessor for the supportedFeatures field of hydra.core.coders.Language+languageSupportedFeatures :: Typed.TypedTerm Coders.Language -> Typed.TypedTerm (S.Set Coders.LanguageFeature)+languageSupportedFeatures x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.Language"),+ Model.projectionFieldName = (Model.Name "supportedFeatures")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL updater for the caseConventions field of hydra.core.coders.Language+languageWithCaseConventions :: Typed.TypedTerm Coders.Language -> Typed.TypedTerm Coders.CaseConventions -> Typed.TypedTerm Coders.Language+languageWithCaseConventions original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.coders.Language"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.Language"),+ Model.projectionFieldName = (Model.Name "name")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "constraints"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.Language"),+ Model.projectionFieldName = (Model.Name "constraints")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "supportedFeatures"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.Language"),+ Model.projectionFieldName = (Model.Name "supportedFeatures")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "caseConventions"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "defaultFileExtension"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.Language"),+ Model.projectionFieldName = (Model.Name "defaultFileExtension")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the constraints field of hydra.core.coders.Language+languageWithConstraints :: Typed.TypedTerm Coders.Language -> Typed.TypedTerm Coders.LanguageConstraints -> Typed.TypedTerm Coders.Language+languageWithConstraints original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.coders.Language"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.Language"),+ Model.projectionFieldName = (Model.Name "name")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "constraints"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "supportedFeatures"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.Language"),+ Model.projectionFieldName = (Model.Name "supportedFeatures")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "caseConventions"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.Language"),+ Model.projectionFieldName = (Model.Name "caseConventions")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "defaultFileExtension"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.Language"),+ Model.projectionFieldName = (Model.Name "defaultFileExtension")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the defaultFileExtension field of hydra.core.coders.Language+languageWithDefaultFileExtension :: Typed.TypedTerm Coders.Language -> Typed.TypedTerm File.FileExtension -> Typed.TypedTerm Coders.Language+languageWithDefaultFileExtension original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.coders.Language"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.Language"),+ Model.projectionFieldName = (Model.Name "name")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "constraints"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.Language"),+ Model.projectionFieldName = (Model.Name "constraints")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "supportedFeatures"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.Language"),+ Model.projectionFieldName = (Model.Name "supportedFeatures")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "caseConventions"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.Language"),+ Model.projectionFieldName = (Model.Name "caseConventions")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "defaultFileExtension"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL updater for the name field of hydra.core.coders.Language+languageWithName :: Typed.TypedTerm Coders.Language -> Typed.TypedTerm Coders.LanguageName -> Typed.TypedTerm Coders.Language+languageWithName original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.coders.Language"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "constraints"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.Language"),+ Model.projectionFieldName = (Model.Name "constraints")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "supportedFeatures"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.Language"),+ Model.projectionFieldName = (Model.Name "supportedFeatures")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "caseConventions"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.Language"),+ Model.projectionFieldName = (Model.Name "caseConventions")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "defaultFileExtension"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.Language"),+ Model.projectionFieldName = (Model.Name "defaultFileExtension")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the supportedFeatures field of hydra.core.coders.Language+languageWithSupportedFeatures :: Typed.TypedTerm Coders.Language -> Typed.TypedTerm (S.Set Coders.LanguageFeature) -> Typed.TypedTerm Coders.Language+languageWithSupportedFeatures original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.coders.Language"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.Language"),+ Model.projectionFieldName = (Model.Name "name")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "constraints"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.Language"),+ Model.projectionFieldName = (Model.Name "constraints")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "supportedFeatures"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "caseConventions"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.Language"),+ Model.projectionFieldName = (Model.Name "caseConventions")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "defaultFileExtension"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.coders.Language"),+ Model.projectionFieldName = (Model.Name "defaultFileExtension")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL injection for the post variant of hydra.core.coders.TraversalOrder+traversalOrderPost :: Typed.TypedTerm Coders.TraversalOrder+traversalOrderPost =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.coders.TraversalOrder"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "post"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL injection for the pre variant of hydra.core.coders.TraversalOrder+traversalOrderPre :: Typed.TypedTerm Coders.TraversalOrder+traversalOrderPre =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.coders.TraversalOrder"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "pre"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL name token for hydra.core.coders.TraversalOrder+traversalOrderTraversalOrder :: Typed.TypedName Coders.TraversalOrder+traversalOrderTraversalOrder = Typed.TypedName (Model.Name "hydra.core.coders.TraversalOrder")++-- | DSL accessor for the body of hydra.core.coders.LanguageName+unLanguageName :: Typed.TypedTerm Coders.LanguageName -> Typed.TypedTerm String+unLanguageName x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermUnwrap (Model.Name "hydra.core.coders.LanguageName")),+ Model.applicationArgument = (Typed.unTypedTerm x)}))
@@ -0,0 +1,152 @@+-- Note: this is an automatically generated file. Do not edit.++-- | DSL functions for hydra.core.constants++module Hydra.Core.Dsl.Constants where++import qualified Hydra.Core.Ast as Ast+import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Constants as Constants+import qualified Hydra.Core.Diff as Diff+import qualified Hydra.Core.Docs as Docs+import qualified Hydra.Core.Dsl.Ast as DslAst+import qualified Hydra.Core.Dsl.Coders as DslCoders+import qualified Hydra.Core.Dsl.Diff as DslDiff+import qualified Hydra.Core.Dsl.Docs as DslDocs+import qualified Hydra.Core.Dsl.Error.Checking as ErrorChecking+import qualified Hydra.Core.Dsl.Error.File as DslErrorFile+import qualified Hydra.Core.Dsl.Error.Model as DslErrorModel+import qualified Hydra.Core.Dsl.Error.Packaging as DslErrorPackaging+import qualified Hydra.Core.Dsl.Error.System as DslErrorSystem+import qualified Hydra.Core.Dsl.Errors as DslErrors+import qualified Hydra.Core.Dsl.File as DslFile+import qualified Hydra.Core.Dsl.Graph as DslGraph+import qualified Hydra.Core.Dsl.Json.Model as DslJsonModel+import qualified Hydra.Core.Dsl.Markdown as DslMarkdown+import qualified Hydra.Core.Dsl.Model as DslModel+import qualified Hydra.Core.Dsl.Packaging as DslPackaging+import qualified Hydra.Core.Dsl.Parsing as DslParsing+import qualified Hydra.Core.Dsl.Paths as DslPaths+import qualified Hydra.Core.Dsl.Query as DslQuery+import qualified Hydra.Core.Dsl.Regex as DslRegex+import qualified Hydra.Core.Dsl.Relational as DslRelational+import qualified Hydra.Core.Dsl.System as DslSystem+import qualified Hydra.Core.Dsl.Tabular as DslTabular+import qualified Hydra.Core.Dsl.Testing as DslTesting+import qualified Hydra.Core.Dsl.Time as DslTime+import qualified Hydra.Core.Dsl.Topology as DslTopology+import qualified Hydra.Core.Dsl.Typing as DslTyping+import qualified Hydra.Core.Dsl.Util as DslUtil+import qualified Hydra.Core.Dsl.Validation as DslValidation+import qualified Hydra.Core.Dsl.Variants as DslVariants+import qualified Hydra.Core.Error.Checking as Checking+import qualified Hydra.Core.Error.File as ErrorFile+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Error.Packaging as ErrorPackaging+import qualified Hydra.Core.Error.System as ErrorSystem+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Json.Model as JsonModel+import qualified Hydra.Core.Markdown as Markdown+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Parsing as Parsing+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Query as Query+import qualified Hydra.Core.Regex as Regex+import qualified Hydra.Core.Relational as Relational+import qualified Hydra.Core.System as System+import qualified Hydra.Core.Tabular as Tabular+import qualified Hydra.Core.Testing as Testing+import qualified Hydra.Core.Time as Time+import qualified Hydra.Core.Topology as Topology+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Validation as Validation+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | DSL reference to hydra.core.constants.fieldNameValue+fieldNameValue :: Typed.TypedTerm String+fieldNameValue = Typed.TypedTerm (Model.TermVariable (Model.Name "hydra.core.constants.fieldNameValue"))++-- | DSL reference to hydra.core.constants.ignoredVariable+ignoredVariable :: Typed.TypedTerm String+ignoredVariable = Typed.TypedTerm (Model.TermVariable (Model.Name "hydra.core.constants.ignoredVariable"))++-- | DSL reference to hydra.core.constants.keyClasses+keyClasses :: Typed.TypedTerm Model.Name+keyClasses = Typed.TypedTerm (Model.TermVariable (Model.Name "hydra.core.constants.keyClasses"))++-- | DSL reference to hydra.core.constants.keyDebugId+keyDebugId :: Typed.TypedTerm Model.Name+keyDebugId = Typed.TypedTerm (Model.TermVariable (Model.Name "hydra.core.constants.keyDebugId"))++-- | DSL reference to hydra.core.constants.keyDeprecated+keyDeprecated :: Typed.TypedTerm Model.Name+keyDeprecated = Typed.TypedTerm (Model.TermVariable (Model.Name "hydra.core.constants.keyDeprecated"))++-- | DSL reference to hydra.core.constants.keyDescription+keyDescription :: Typed.TypedTerm Model.Name+keyDescription = Typed.TypedTerm (Model.TermVariable (Model.Name "hydra.core.constants.keyDescription"))++-- | DSL reference to hydra.core.constants.keyExclude+keyExclude :: Typed.TypedTerm Model.Name+keyExclude = Typed.TypedTerm (Model.TermVariable (Model.Name "hydra.core.constants.keyExclude"))++-- | DSL reference to hydra.core.constants.keyFirstClassType+keyFirstClassType :: Typed.TypedTerm Model.Name+keyFirstClassType = Typed.TypedTerm (Model.TermVariable (Model.Name "hydra.core.constants.keyFirstClassType"))++-- | DSL reference to hydra.core.constants.keyFreshTypeVariableCount+keyFreshTypeVariableCount :: Typed.TypedTerm Model.Name+keyFreshTypeVariableCount =+ Typed.TypedTerm (Model.TermVariable (Model.Name "hydra.core.constants.keyFreshTypeVariableCount"))++-- | DSL reference to hydra.core.constants.keyMaxLength+keyMaxLength :: Typed.TypedTerm Model.Name+keyMaxLength = Typed.TypedTerm (Model.TermVariable (Model.Name "hydra.core.constants.keyMaxLength"))++-- | DSL reference to hydra.core.constants.keyMinLength+keyMinLength :: Typed.TypedTerm Model.Name+keyMinLength = Typed.TypedTerm (Model.TermVariable (Model.Name "hydra.core.constants.keyMinLength"))++-- | DSL reference to hydra.core.constants.keyPreserveFieldName+keyPreserveFieldName :: Typed.TypedTerm Model.Name+keyPreserveFieldName = Typed.TypedTerm (Model.TermVariable (Model.Name "hydra.core.constants.keyPreserveFieldName"))++-- | DSL reference to hydra.core.constants.keyType+keyType :: Typed.TypedTerm Model.Name+keyType = Typed.TypedTerm (Model.TermVariable (Model.Name "hydra.core.constants.keyType"))++-- | DSL reference to hydra.core.constants.maxInt32+maxInt32 :: Typed.TypedTerm Int+maxInt32 = Typed.TypedTerm (Model.TermVariable (Model.Name "hydra.core.constants.maxInt32"))++-- | DSL reference to hydra.core.constants.maxTraceDepth+maxTraceDepth :: Typed.TypedTerm Int+maxTraceDepth = Typed.TypedTerm (Model.TermVariable (Model.Name "hydra.core.constants.maxTraceDepth"))++-- | DSL reference to hydra.core.constants.regexCamelCase+regexCamelCase :: Typed.TypedTerm String+regexCamelCase = Typed.TypedTerm (Model.TermVariable (Model.Name "hydra.core.constants.regexCamelCase"))++-- | DSL reference to hydra.core.constants.regexNamespace+regexNamespace :: Typed.TypedTerm String+regexNamespace = Typed.TypedTerm (Model.TermVariable (Model.Name "hydra.core.constants.regexNamespace"))++-- | DSL reference to hydra.core.constants.regexPackageName+regexPackageName :: Typed.TypedTerm String+regexPackageName = Typed.TypedTerm (Model.TermVariable (Model.Name "hydra.core.constants.regexPackageName"))++-- | DSL reference to hydra.core.constants.regexPascalCase+regexPascalCase :: Typed.TypedTerm String+regexPascalCase = Typed.TypedTerm (Model.TermVariable (Model.Name "hydra.core.constants.regexPascalCase"))++-- | DSL reference to hydra.core.constants.warningAutoGeneratedFile+warningAutoGeneratedFile :: Typed.TypedTerm String+warningAutoGeneratedFile = Typed.TypedTerm (Model.TermVariable (Model.Name "hydra.core.constants.warningAutoGeneratedFile"))
@@ -0,0 +1,210 @@+-- Note: this is an automatically generated file. Do not edit.++-- | DSL functions for hydra.core.dependencies++module Hydra.Core.Dsl.Dependencies where++import qualified Hydra.Core.Annotations as Annotations+import qualified Hydra.Core.Ast as Ast+import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Constants as Constants+import qualified Hydra.Core.Dependencies as Dependencies+import qualified Hydra.Core.Diff as Diff+import qualified Hydra.Core.Docs as Docs+import qualified Hydra.Core.Dsl.Annotations as DslAnnotations+import qualified Hydra.Core.Dsl.Ast as DslAst+import qualified Hydra.Core.Dsl.Coders as DslCoders+import qualified Hydra.Core.Dsl.Constants as DslConstants+import qualified Hydra.Core.Dsl.Diff as DslDiff+import qualified Hydra.Core.Dsl.Docs as DslDocs+import qualified Hydra.Core.Dsl.Error.Checking as ErrorChecking+import qualified Hydra.Core.Dsl.Error.File as DslErrorFile+import qualified Hydra.Core.Dsl.Error.Model as DslErrorModel+import qualified Hydra.Core.Dsl.Error.Packaging as DslErrorPackaging+import qualified Hydra.Core.Dsl.Error.System as DslErrorSystem+import qualified Hydra.Core.Dsl.Errors as DslErrors+import qualified Hydra.Core.Dsl.File as DslFile+import qualified Hydra.Core.Dsl.Graph as DslGraph+import qualified Hydra.Core.Dsl.Json.Model as DslJsonModel+import qualified Hydra.Core.Dsl.Lexical as DslLexical+import qualified Hydra.Core.Dsl.Markdown as DslMarkdown+import qualified Hydra.Core.Dsl.Model as DslModel+import qualified Hydra.Core.Dsl.Names as DslNames+import qualified Hydra.Core.Dsl.Packaging as DslPackaging+import qualified Hydra.Core.Dsl.Parsing as DslParsing+import qualified Hydra.Core.Dsl.Paths as DslPaths+import qualified Hydra.Core.Dsl.Query as DslQuery+import qualified Hydra.Core.Dsl.Regex as DslRegex+import qualified Hydra.Core.Dsl.Relational as DslRelational+import qualified Hydra.Core.Dsl.Rewriting as DslRewriting+import qualified Hydra.Core.Dsl.Sorting as DslSorting+import qualified Hydra.Core.Dsl.Strip as DslStrip+import qualified Hydra.Core.Dsl.System as DslSystem+import qualified Hydra.Core.Dsl.Tabular as DslTabular+import qualified Hydra.Core.Dsl.Testing as DslTesting+import qualified Hydra.Core.Dsl.Time as DslTime+import qualified Hydra.Core.Dsl.Topology as DslTopology+import qualified Hydra.Core.Dsl.Typing as DslTyping+import qualified Hydra.Core.Dsl.Util as DslUtil+import qualified Hydra.Core.Dsl.Validation as DslValidation+import qualified Hydra.Core.Dsl.Variables as DslVariables+import qualified Hydra.Core.Dsl.Variants as DslVariants+import qualified Hydra.Core.Error.Checking as Checking+import qualified Hydra.Core.Error.File as ErrorFile+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Error.Packaging as ErrorPackaging+import qualified Hydra.Core.Error.System as ErrorSystem+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Json.Model as JsonModel+import qualified Hydra.Core.Lexical as Lexical+import qualified Hydra.Core.Markdown as Markdown+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Names as Names+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Parsing as Parsing+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Query as Query+import qualified Hydra.Core.Regex as Regex+import qualified Hydra.Core.Relational as Relational+import qualified Hydra.Core.Rewriting as Rewriting+import qualified Hydra.Core.Sorting as Sorting+import qualified Hydra.Core.Strip as Strip+import qualified Hydra.Core.System as System+import qualified Hydra.Core.Tabular as Tabular+import qualified Hydra.Core.Testing as Testing+import qualified Hydra.Core.Time as Time+import qualified Hydra.Core.Topology as Topology+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Validation as Validation+import qualified Hydra.Core.Variables as Variables+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void+import qualified Data.Map as M+import qualified Data.Set as S++-- | DSL reference to hydra.core.dependencies.definitionsWithDependencies+definitionsWithDependencies :: Typed.TypedTerm t0 -> Typed.TypedTerm Graph.Graph -> Typed.TypedTerm [Model.Binding] -> Typed.TypedTerm (Either Errors.Error [Model.Binding])+definitionsWithDependencies arg0 arg1 arg2 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.dependencies.definitionsWithDependencies")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)})),+ Model.applicationArgument = (Typed.unTypedTerm arg2)}))++-- | DSL reference to hydra.core.dependencies.flattenLetTerms+flattenLetTerms :: Typed.TypedTerm Model.Term -> Typed.TypedTerm Model.Term+flattenLetTerms arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.dependencies.flattenLetTerms")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.dependencies.inlineType+inlineType :: Typed.TypedTerm (M.Map Model.Name Model.Type) -> Typed.TypedTerm Model.Type -> Typed.TypedTerm (Either Errors.Error Model.Type)+inlineType arg0 arg1 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.dependencies.inlineType")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)}))++-- | DSL reference to hydra.core.dependencies.isLambda+isLambda :: Typed.TypedTerm Model.Term -> Typed.TypedTerm Bool+isLambda arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.dependencies.isLambda")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.dependencies.liftLambdaAboveLet+liftLambdaAboveLet :: Typed.TypedTerm Model.Term -> Typed.TypedTerm Model.Term+liftLambdaAboveLet arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.dependencies.liftLambdaAboveLet")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.dependencies.pruneLet+pruneLet :: Typed.TypedTerm Model.Let -> Typed.TypedTerm Model.Let+pruneLet arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.dependencies.pruneLet")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.dependencies.replaceTypedefs+replaceTypedefs :: Typed.TypedTerm (M.Map Model.Name Model.TypeScheme) -> Typed.TypedTerm Model.Type -> Typed.TypedTerm Model.Type+replaceTypedefs arg0 arg1 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.dependencies.replaceTypedefs")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)}))++-- | DSL reference to hydra.core.dependencies.simplifyTerm+simplifyTerm :: Typed.TypedTerm Model.Term -> Typed.TypedTerm Model.Term+simplifyTerm arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.dependencies.simplifyTerm")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.dependencies.termDependencyNames+termDependencyNames :: Typed.TypedTerm Bool -> Typed.TypedTerm Bool -> Typed.TypedTerm Bool -> Typed.TypedTerm Model.Term -> Typed.TypedTerm (S.Set Model.Name)+termDependencyNames arg0 arg1 arg2 arg3 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.dependencies.termDependencyNames")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)})),+ Model.applicationArgument = (Typed.unTypedTerm arg2)})),+ Model.applicationArgument = (Typed.unTypedTerm arg3)}))++-- | DSL reference to hydra.core.dependencies.toShortNames+toShortNames :: Typed.TypedTerm [Model.Name] -> Typed.TypedTerm (M.Map Model.Name Model.Name)+toShortNames arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.dependencies.toShortNames")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.dependencies.topologicalSortBindingMap+topologicalSortBindingMap :: Typed.TypedTerm (M.Map Model.Name Model.Term) -> Typed.TypedTerm [[(Model.Name, Model.Term)]]+topologicalSortBindingMap arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.dependencies.topologicalSortBindingMap")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.dependencies.topologicalSortBindings+topologicalSortBindings :: Typed.TypedTerm [Model.Binding] -> Typed.TypedTerm (Either [[Model.Name]] [Model.Name])+topologicalSortBindings arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.dependencies.topologicalSortBindings")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.dependencies.topologicalSortTypeDefinitions+topologicalSortTypeDefinitions :: Typed.TypedTerm [Packaging.TypeDefinition] -> Typed.TypedTerm [[Packaging.TypeDefinition]]+topologicalSortTypeDefinitions arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.dependencies.topologicalSortTypeDefinitions")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.dependencies.typeDependencyNames+typeDependencyNames :: Typed.TypedTerm Bool -> Typed.TypedTerm Model.Type -> Typed.TypedTerm (S.Set Model.Name)+typeDependencyNames arg0 arg1 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.dependencies.typeDependencyNames")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)}))++-- | DSL reference to hydra.core.dependencies.typeNamesInType+typeNamesInType :: Typed.TypedTerm Model.Type -> Typed.TypedTerm (S.Set t0)+typeNamesInType arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.dependencies.typeNamesInType")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))
@@ -0,0 +1,857 @@+-- Note: this is an automatically generated file. Do not edit.++-- | DSL functions for hydra.core.diff++module Hydra.Core.Dsl.Diff where++import qualified Hydra.Core.Decode.Diff as DecodeDiff+import qualified Hydra.Core.Diff as Diff+import qualified Hydra.Core.Dsl.Model as DslModel+import qualified Hydra.Core.Encode.Diff as EncodeDiff+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Typed as Typed+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void+import qualified Data.Map as M++-- | DSL composition builder for the decoder of hydra.core.diff.Edit+decodeEdit :: Typed.TypedTerm (Graph.Graph -> Model.Term -> Either Errors.DecodingError a) -> Typed.TypedTerm (Graph.Graph -> Model.Term -> Either Errors.DecodingError s) -> Typed.TypedTerm (Graph.Graph -> Model.Term -> Either Errors.DecodingError (Diff.Edit a s))+decodeEdit a s =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.decode.diff.edit")),+ Model.applicationArgument = (Typed.unTypedTerm a)})),+ Model.applicationArgument = (Typed.unTypedTerm s)}))++-- | DSL composition builder for the decoder of hydra.core.diff.Fill+decodeFill :: Typed.TypedTerm (Graph.Graph -> Model.Term -> Either Errors.DecodingError v) -> Typed.TypedTerm (Graph.Graph -> Model.Term -> Either Errors.DecodingError (Diff.Fill v))+decodeFill v =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.decode.diff.fill")),+ Model.applicationArgument = (Typed.unTypedTerm v)}))++-- | DSL composition builder for the decoder of hydra.core.diff.Hole+decodeHole :: Typed.TypedTerm (Graph.Graph -> Model.Term -> Either Errors.DecodingError t) -> Typed.TypedTerm (Graph.Graph -> Model.Term -> Either Errors.DecodingError s) -> Typed.TypedTerm (Graph.Graph -> Model.Term -> Either Errors.DecodingError (Diff.Hole t s))+decodeHole t s =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.decode.diff.hole")),+ Model.applicationArgument = (Typed.unTypedTerm t)})),+ Model.applicationArgument = (Typed.unTypedTerm s)}))++-- | DSL composition builder for the decoder of hydra.core.diff.HoleFiller+decodeHoleFiller :: Typed.TypedTerm (Graph.Graph -> Model.Term -> Either Errors.DecodingError v) -> Typed.TypedTerm (Graph.Graph -> Model.Term -> Either Errors.DecodingError s) -> Typed.TypedTerm (Graph.Graph -> Model.Term -> Either Errors.DecodingError (Diff.HoleFiller v s))+decodeHoleFiller v s =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.decode.diff.holeFiller")),+ Model.applicationArgument = (Typed.unTypedTerm v)})),+ Model.applicationArgument = (Typed.unTypedTerm s)}))++-- | DSL composition builder for the decoder of hydra.core.diff.InvalidFillError+decodeInvalidFillError :: Typed.TypedTerm (Graph.Graph -> Model.Term -> Either Errors.DecodingError t) -> Typed.TypedTerm (Graph.Graph -> Model.Term -> Either Errors.DecodingError v) -> Typed.TypedTerm (Graph.Graph -> Model.Term -> Either Errors.DecodingError s) -> Typed.TypedTerm (Graph.Graph -> Model.Term -> Either Errors.DecodingError (Diff.InvalidFillError t v s))+decodeInvalidFillError t v s =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.decode.diff.invalidFillError")),+ Model.applicationArgument = (Typed.unTypedTerm t)})),+ Model.applicationArgument = (Typed.unTypedTerm v)})),+ Model.applicationArgument = (Typed.unTypedTerm s)}))++-- | DSL composition builder for the decoder of hydra.core.diff.MigrationError+decodeMigrationError :: Typed.TypedTerm (Graph.Graph -> Model.Term -> Either Errors.DecodingError t) -> Typed.TypedTerm (Graph.Graph -> Model.Term -> Either Errors.DecodingError v) -> Typed.TypedTerm (Graph.Graph -> Model.Term -> Either Errors.DecodingError s) -> Typed.TypedTerm (Graph.Graph -> Model.Term -> Either Errors.DecodingError (Diff.MigrationError t v s))+decodeMigrationError t v s =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.decode.diff.migrationError")),+ Model.applicationArgument = (Typed.unTypedTerm t)})),+ Model.applicationArgument = (Typed.unTypedTerm v)})),+ Model.applicationArgument = (Typed.unTypedTerm s)}))++-- | DSL composition builder for the decoder of hydra.core.diff.MigrationPlan+decodeMigrationPlan :: Typed.TypedTerm (Graph.Graph -> Model.Term -> Either Errors.DecodingError n) -> Typed.TypedTerm (Graph.Graph -> Model.Term -> Either Errors.DecodingError t) -> Typed.TypedTerm (Graph.Graph -> Model.Term -> Either Errors.DecodingError s) -> Typed.TypedTerm (Graph.Graph -> Model.Term -> Either Errors.DecodingError (Diff.MigrationPlan n t s))+decodeMigrationPlan n t s =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.decode.diff.migrationPlan")),+ Model.applicationArgument = (Typed.unTypedTerm n)})),+ Model.applicationArgument = (Typed.unTypedTerm t)})),+ Model.applicationArgument = (Typed.unTypedTerm s)}))++-- | DSL composition builder for the decoder of hydra.core.diff.Migrator+decodeMigrator :: Typed.TypedTerm (Graph.Graph -> Model.Term -> Either Errors.DecodingError t) -> Typed.TypedTerm (Graph.Graph -> Model.Term -> Either Errors.DecodingError v) -> Typed.TypedTerm (Graph.Graph -> Model.Term -> Either Errors.DecodingError s) -> Typed.TypedTerm (Graph.Graph -> Model.Term -> Either Errors.DecodingError (Diff.Migrator t v s))+decodeMigrator t v s =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.decode.diff.migrator")),+ Model.applicationArgument = (Typed.unTypedTerm t)})),+ Model.applicationArgument = (Typed.unTypedTerm v)})),+ Model.applicationArgument = (Typed.unTypedTerm s)}))++-- | DSL composition builder for the decoder of hydra.core.diff.Mistyped+decodeMistyped :: Typed.TypedTerm (Graph.Graph -> Model.Term -> Either Errors.DecodingError t) -> Typed.TypedTerm (Graph.Graph -> Model.Term -> Either Errors.DecodingError v) -> Typed.TypedTerm (Graph.Graph -> Model.Term -> Either Errors.DecodingError (Diff.Mistyped t v))+decodeMistyped t v =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.decode.diff.mistyped")),+ Model.applicationArgument = (Typed.unTypedTerm t)})),+ Model.applicationArgument = (Typed.unTypedTerm v)}))++-- | DSL composition builder for the decoder of hydra.core.diff.SchemaHole+decodeSchemaHole :: Typed.TypedTerm (Graph.Graph -> Model.Term -> Either Errors.DecodingError n) -> Typed.TypedTerm (Graph.Graph -> Model.Term -> Either Errors.DecodingError t) -> Typed.TypedTerm (Graph.Graph -> Model.Term -> Either Errors.DecodingError s) -> Typed.TypedTerm (Graph.Graph -> Model.Term -> Either Errors.DecodingError (Diff.SchemaHole n t s))+decodeSchemaHole n t s =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.decode.diff.schemaHole")),+ Model.applicationArgument = (Typed.unTypedTerm n)})),+ Model.applicationArgument = (Typed.unTypedTerm t)})),+ Model.applicationArgument = (Typed.unTypedTerm s)}))++-- | DSL composition builder for the decoder of hydra.core.diff.StepEdit+decodeStepEdit :: Typed.TypedTerm (Graph.Graph -> Model.Term -> Either Errors.DecodingError a) -> Typed.TypedTerm (Graph.Graph -> Model.Term -> Either Errors.DecodingError s) -> Typed.TypedTerm (Graph.Graph -> Model.Term -> Either Errors.DecodingError (Diff.StepEdit a s))+decodeStepEdit a s =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.decode.diff.stepEdit")),+ Model.applicationArgument = (Typed.unTypedTerm a)})),+ Model.applicationArgument = (Typed.unTypedTerm s)}))++-- | DSL injection for the delete variant of hydra.core.diff.Edit+editDelete :: Typed.TypedTerm (Diff.Edit a s)+editDelete =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.diff.Edit"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "delete"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL injection for the descend variant of hydra.core.diff.Edit+editDescend :: Typed.TypedTerm [Diff.StepEdit a s] -> Typed.TypedTerm (Diff.Edit a s)+editDescend x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.diff.Edit"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "descend"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL name token for hydra.core.diff.Edit+editEdit :: Typed.TypedName (Diff.Edit a s)+editEdit = Typed.TypedName (Model.Name "hydra.core.diff.Edit")++-- | DSL injection for the retain variant of hydra.core.diff.Edit+editRetain :: Typed.TypedTerm (Diff.Edit a s)+editRetain =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.diff.Edit"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "retain"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL injection for the set variant of hydra.core.diff.Edit+editSet :: Typed.TypedTerm a -> Typed.TypedTerm (Diff.Edit a s)+editSet x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.diff.Edit"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "set"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL composition builder for the encoder of hydra.core.diff.Edit+encodeEdit :: Typed.TypedTerm (a -> Model.Term) -> Typed.TypedTerm (s -> Model.Term) -> Typed.TypedTerm (Diff.Edit a s -> Model.Term)+encodeEdit a s =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.encode.diff.edit")),+ Model.applicationArgument = (Typed.unTypedTerm a)})),+ Model.applicationArgument = (Typed.unTypedTerm s)}))++-- | DSL composition builder for the encoder of hydra.core.diff.Fill+encodeFill :: Typed.TypedTerm (v -> Model.Term) -> Typed.TypedTerm (Diff.Fill v -> Model.Term)+encodeFill v =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.encode.diff.fill")),+ Model.applicationArgument = (Typed.unTypedTerm v)}))++-- | DSL composition builder for the encoder of hydra.core.diff.Hole+encodeHole :: Typed.TypedTerm (t -> Model.Term) -> Typed.TypedTerm (s -> Model.Term) -> Typed.TypedTerm (Diff.Hole t s -> Model.Term)+encodeHole t s =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.encode.diff.hole")),+ Model.applicationArgument = (Typed.unTypedTerm t)})),+ Model.applicationArgument = (Typed.unTypedTerm s)}))++-- | DSL composition builder for the encoder of hydra.core.diff.HoleFiller+encodeHoleFiller :: Typed.TypedTerm (v -> Model.Term) -> Typed.TypedTerm (s -> Model.Term) -> Typed.TypedTerm (Diff.HoleFiller v s -> Model.Term)+encodeHoleFiller v s =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.encode.diff.holeFiller")),+ Model.applicationArgument = (Typed.unTypedTerm v)})),+ Model.applicationArgument = (Typed.unTypedTerm s)}))++-- | DSL composition builder for the encoder of hydra.core.diff.InvalidFillError+encodeInvalidFillError :: Typed.TypedTerm (t -> Model.Term) -> Typed.TypedTerm (v -> Model.Term) -> Typed.TypedTerm (s -> Model.Term) -> Typed.TypedTerm (Diff.InvalidFillError t v s -> Model.Term)+encodeInvalidFillError t v s =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.encode.diff.invalidFillError")),+ Model.applicationArgument = (Typed.unTypedTerm t)})),+ Model.applicationArgument = (Typed.unTypedTerm v)})),+ Model.applicationArgument = (Typed.unTypedTerm s)}))++-- | DSL composition builder for the encoder of hydra.core.diff.MigrationError+encodeMigrationError :: Typed.TypedTerm (t -> Model.Term) -> Typed.TypedTerm (v -> Model.Term) -> Typed.TypedTerm (s -> Model.Term) -> Typed.TypedTerm (Diff.MigrationError t v s -> Model.Term)+encodeMigrationError t v s =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.encode.diff.migrationError")),+ Model.applicationArgument = (Typed.unTypedTerm t)})),+ Model.applicationArgument = (Typed.unTypedTerm v)})),+ Model.applicationArgument = (Typed.unTypedTerm s)}))++-- | DSL composition builder for the encoder of hydra.core.diff.MigrationPlan+encodeMigrationPlan :: Typed.TypedTerm (n -> Model.Term) -> Typed.TypedTerm (t -> Model.Term) -> Typed.TypedTerm (s -> Model.Term) -> Typed.TypedTerm (Diff.MigrationPlan n t s -> Model.Term)+encodeMigrationPlan n t s =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.encode.diff.migrationPlan")),+ Model.applicationArgument = (Typed.unTypedTerm n)})),+ Model.applicationArgument = (Typed.unTypedTerm t)})),+ Model.applicationArgument = (Typed.unTypedTerm s)}))++-- | DSL composition builder for the encoder of hydra.core.diff.Migrator+encodeMigrator :: Typed.TypedTerm (t -> Model.Term) -> Typed.TypedTerm (v -> Model.Term) -> Typed.TypedTerm (s -> Model.Term) -> Typed.TypedTerm (Diff.Migrator t v s -> Model.Term)+encodeMigrator t v s =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.encode.diff.migrator")),+ Model.applicationArgument = (Typed.unTypedTerm t)})),+ Model.applicationArgument = (Typed.unTypedTerm v)})),+ Model.applicationArgument = (Typed.unTypedTerm s)}))++-- | DSL composition builder for the encoder of hydra.core.diff.Mistyped+encodeMistyped :: Typed.TypedTerm (t -> Model.Term) -> Typed.TypedTerm (v -> Model.Term) -> Typed.TypedTerm (Diff.Mistyped t v -> Model.Term)+encodeMistyped t v =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.encode.diff.mistyped")),+ Model.applicationArgument = (Typed.unTypedTerm t)})),+ Model.applicationArgument = (Typed.unTypedTerm v)}))++-- | DSL composition builder for the encoder of hydra.core.diff.SchemaHole+encodeSchemaHole :: Typed.TypedTerm (n -> Model.Term) -> Typed.TypedTerm (t -> Model.Term) -> Typed.TypedTerm (s -> Model.Term) -> Typed.TypedTerm (Diff.SchemaHole n t s -> Model.Term)+encodeSchemaHole n t s =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.encode.diff.schemaHole")),+ Model.applicationArgument = (Typed.unTypedTerm n)})),+ Model.applicationArgument = (Typed.unTypedTerm t)})),+ Model.applicationArgument = (Typed.unTypedTerm s)}))++-- | DSL composition builder for the encoder of hydra.core.diff.StepEdit+encodeStepEdit :: Typed.TypedTerm (a -> Model.Term) -> Typed.TypedTerm (s -> Model.Term) -> Typed.TypedTerm (Diff.StepEdit a s -> Model.Term)+encodeStepEdit a s =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.encode.diff.stepEdit")),+ Model.applicationArgument = (Typed.unTypedTerm a)})),+ Model.applicationArgument = (Typed.unTypedTerm s)}))++-- | DSL injection for the defer variant of hydra.core.diff.Fill+fillDefer :: Typed.TypedTerm (Diff.Fill v)+fillDefer =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.diff.Fill"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "defer"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL name token for hydra.core.diff.Fill+fillFill :: Typed.TypedName (Diff.Fill v)+fillFill = Typed.TypedName (Model.Name "hydra.core.diff.Fill")++-- | DSL injection for the fillNow variant of hydra.core.diff.Fill+fillFillNow :: Typed.TypedTerm (v -> v) -> Typed.TypedTerm (Diff.Fill v)+fillFillNow x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.diff.Fill"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "fillNow"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL constructor for hydra.core.diff.Hole+hole :: Typed.TypedTerm [s] -> Typed.TypedTerm t -> Typed.TypedTerm (Diff.Hole t s)+hole path type_ =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.diff.Hole"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "path"),+ Model.fieldTerm = (Typed.unTypedTerm path)},+ Model.Field {+ Model.fieldName = (Model.Name "type"),+ Model.fieldTerm = (Typed.unTypedTerm type_)}]}))++-- | DSL constructor for hydra.core.diff.HoleFiller+holeFiller :: Typed.TypedTerm [s] -> Typed.TypedTerm v -> Typed.TypedTerm (Diff.HoleFiller v s)+holeFiller path value =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.diff.HoleFiller"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "path"),+ Model.fieldTerm = (Typed.unTypedTerm path)},+ Model.Field {+ Model.fieldName = (Model.Name "value"),+ Model.fieldTerm = (Typed.unTypedTerm value)}]}))++-- | DSL name token for hydra.core.diff.HoleFiller+holeFillerHoleFiller :: Typed.TypedName (Diff.HoleFiller v s)+holeFillerHoleFiller = Typed.TypedName (Model.Name "hydra.core.diff.HoleFiller")++-- | DSL accessor for the path field of hydra.core.diff.HoleFiller+holeFillerPath :: Typed.TypedTerm (Diff.HoleFiller v s) -> Typed.TypedTerm [s]+holeFillerPath x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.diff.HoleFiller"),+ Model.projectionFieldName = (Model.Name "path")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the value field of hydra.core.diff.HoleFiller+holeFillerValue :: Typed.TypedTerm (Diff.HoleFiller v s) -> Typed.TypedTerm v+holeFillerValue x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.diff.HoleFiller"),+ Model.projectionFieldName = (Model.Name "value")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL updater for the path field of hydra.core.diff.HoleFiller+holeFillerWithPath :: Typed.TypedTerm (Diff.HoleFiller v s) -> Typed.TypedTerm [s] -> Typed.TypedTerm (Diff.HoleFiller v s)+holeFillerWithPath original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.diff.HoleFiller"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "path"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "value"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.diff.HoleFiller"),+ Model.projectionFieldName = (Model.Name "value")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the value field of hydra.core.diff.HoleFiller+holeFillerWithValue :: Typed.TypedTerm (Diff.HoleFiller v s) -> Typed.TypedTerm v -> Typed.TypedTerm (Diff.HoleFiller v s)+holeFillerWithValue original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.diff.HoleFiller"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "path"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.diff.HoleFiller"),+ Model.projectionFieldName = (Model.Name "path")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "value"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL name token for hydra.core.diff.Hole+holeHole :: Typed.TypedName (Diff.Hole t s)+holeHole = Typed.TypedName (Model.Name "hydra.core.diff.Hole")++-- | DSL accessor for the path field of hydra.core.diff.Hole+holePath :: Typed.TypedTerm (Diff.Hole t s) -> Typed.TypedTerm [s]+holePath x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.diff.Hole"),+ Model.projectionFieldName = (Model.Name "path")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the type field of hydra.core.diff.Hole+holeType :: Typed.TypedTerm (Diff.Hole t s) -> Typed.TypedTerm t+holeType x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.diff.Hole"),+ Model.projectionFieldName = (Model.Name "type")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL updater for the path field of hydra.core.diff.Hole+holeWithPath :: Typed.TypedTerm (Diff.Hole t s) -> Typed.TypedTerm [s] -> Typed.TypedTerm (Diff.Hole t s)+holeWithPath original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.diff.Hole"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "path"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "type"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.diff.Hole"),+ Model.projectionFieldName = (Model.Name "type")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the type field of hydra.core.diff.Hole+holeWithType :: Typed.TypedTerm (Diff.Hole t s) -> Typed.TypedTerm t -> Typed.TypedTerm (Diff.Hole t s)+holeWithType original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.diff.Hole"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "path"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.diff.Hole"),+ Model.projectionFieldName = (Model.Name "path")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "type"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL injection for the extraFill variant of hydra.core.diff.InvalidFillError+invalidFillErrorExtraFill :: Typed.TypedTerm Int -> Typed.TypedTerm (Diff.InvalidFillError t v s)+invalidFillErrorExtraFill x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.diff.InvalidFillError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "extraFill"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the illTyped variant of hydra.core.diff.InvalidFillError+invalidFillErrorIllTyped :: Typed.TypedTerm (Diff.Hole t s) -> Typed.TypedTerm (Diff.InvalidFillError t v s)+invalidFillErrorIllTyped x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.diff.InvalidFillError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "illTyped"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL name token for hydra.core.diff.InvalidFillError+invalidFillErrorInvalidFillError :: Typed.TypedName (Diff.InvalidFillError t v s)+invalidFillErrorInvalidFillError = Typed.TypedName (Model.Name "hydra.core.diff.InvalidFillError")++-- | DSL injection for the missingFill variant of hydra.core.diff.InvalidFillError+invalidFillErrorMissingFill :: Typed.TypedTerm (Diff.Hole t s) -> Typed.TypedTerm (Diff.InvalidFillError t v s)+invalidFillErrorMissingFill x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.diff.InvalidFillError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "missingFill"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the illTypedResult variant of hydra.core.diff.MigrationError+migrationErrorIllTypedResult :: Typed.TypedTerm (Diff.Mistyped t v) -> Typed.TypedTerm (Diff.MigrationError t v s)+migrationErrorIllTypedResult x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.diff.MigrationError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "illTypedResult"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL name token for hydra.core.diff.MigrationError+migrationErrorMigrationError :: Typed.TypedName (Diff.MigrationError t v s)+migrationErrorMigrationError = Typed.TypedName (Model.Name "hydra.core.diff.MigrationError")++-- | DSL injection for the notAnInstance variant of hydra.core.diff.MigrationError+migrationErrorNotAnInstance :: Typed.TypedTerm v -> Typed.TypedTerm (Diff.MigrationError t v s)+migrationErrorNotAnInstance x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.diff.MigrationError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "notAnInstance"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the outOfRange variant of hydra.core.diff.MigrationError+migrationErrorOutOfRange :: Typed.TypedTerm v -> Typed.TypedTerm (Diff.MigrationError t v s)+migrationErrorOutOfRange x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.diff.MigrationError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "outOfRange"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the rejectedVariant variant of hydra.core.diff.MigrationError+migrationErrorRejectedVariant :: Typed.TypedTerm v -> Typed.TypedTerm (Diff.MigrationError t v s)+migrationErrorRejectedVariant x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.diff.MigrationError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "rejectedVariant"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the unfilledHole variant of hydra.core.diff.MigrationError+migrationErrorUnfilledHole :: Typed.TypedTerm (Diff.Hole t s) -> Typed.TypedTerm (Diff.MigrationError t v s)+migrationErrorUnfilledHole x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.diff.MigrationError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "unfilledHole"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL constructor for hydra.core.diff.MigrationPlan+migrationPlan :: Typed.TypedTerm (M.Map n (Diff.Edit t s)) -> Typed.TypedTerm [Diff.SchemaHole n t s] -> Typed.TypedTerm (Diff.MigrationPlan n t s)+migrationPlan edits holes =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.diff.MigrationPlan"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "edits"),+ Model.fieldTerm = (Typed.unTypedTerm edits)},+ Model.Field {+ Model.fieldName = (Model.Name "holes"),+ Model.fieldTerm = (Typed.unTypedTerm holes)}]}))++-- | DSL accessor for the edits field of hydra.core.diff.MigrationPlan+migrationPlanEdits :: Typed.TypedTerm (Diff.MigrationPlan n t s) -> Typed.TypedTerm (M.Map n (Diff.Edit t s))+migrationPlanEdits x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.diff.MigrationPlan"),+ Model.projectionFieldName = (Model.Name "edits")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the holes field of hydra.core.diff.MigrationPlan+migrationPlanHoles :: Typed.TypedTerm (Diff.MigrationPlan n t s) -> Typed.TypedTerm [Diff.SchemaHole n t s]+migrationPlanHoles x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.diff.MigrationPlan"),+ Model.projectionFieldName = (Model.Name "holes")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.diff.MigrationPlan+migrationPlanMigrationPlan :: Typed.TypedName (Diff.MigrationPlan n t s)+migrationPlanMigrationPlan = Typed.TypedName (Model.Name "hydra.core.diff.MigrationPlan")++-- | DSL updater for the edits field of hydra.core.diff.MigrationPlan+migrationPlanWithEdits :: Typed.TypedTerm (Diff.MigrationPlan n t s) -> Typed.TypedTerm (M.Map n (Diff.Edit t s)) -> Typed.TypedTerm (Diff.MigrationPlan n t s)+migrationPlanWithEdits original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.diff.MigrationPlan"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "edits"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "holes"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.diff.MigrationPlan"),+ Model.projectionFieldName = (Model.Name "holes")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the holes field of hydra.core.diff.MigrationPlan+migrationPlanWithHoles :: Typed.TypedTerm (Diff.MigrationPlan n t s) -> Typed.TypedTerm [Diff.SchemaHole n t s] -> Typed.TypedTerm (Diff.MigrationPlan n t s)+migrationPlanWithHoles original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.diff.MigrationPlan"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "edits"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.diff.MigrationPlan"),+ Model.projectionFieldName = (Model.Name "edits")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "holes"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL constructor for hydra.core.diff.Migrator+migrator :: Typed.TypedTerm [Diff.Hole t s] -> Typed.TypedTerm ([Diff.HoleFiller v s] -> v -> Either (Diff.MigrationError t v s) v) -> Typed.TypedTerm (Diff.Migrator t v s)+migrator residualHoles apply =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.diff.Migrator"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "residualHoles"),+ Model.fieldTerm = (Typed.unTypedTerm residualHoles)},+ Model.Field {+ Model.fieldName = (Model.Name "apply"),+ Model.fieldTerm = (Typed.unTypedTerm apply)}]}))++-- | DSL accessor for the apply field of hydra.core.diff.Migrator+migratorApply :: Typed.TypedTerm (Diff.Migrator t v s) -> Typed.TypedTerm ([Diff.HoleFiller v s] -> v -> Either (Diff.MigrationError t v s) v)+migratorApply x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.diff.Migrator"),+ Model.projectionFieldName = (Model.Name "apply")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.diff.Migrator+migratorMigrator :: Typed.TypedName (Diff.Migrator t v s)+migratorMigrator = Typed.TypedName (Model.Name "hydra.core.diff.Migrator")++-- | DSL accessor for the residualHoles field of hydra.core.diff.Migrator+migratorResidualHoles :: Typed.TypedTerm (Diff.Migrator t v s) -> Typed.TypedTerm [Diff.Hole t s]+migratorResidualHoles x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.diff.Migrator"),+ Model.projectionFieldName = (Model.Name "residualHoles")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL updater for the apply field of hydra.core.diff.Migrator+migratorWithApply :: Typed.TypedTerm (Diff.Migrator t v s) -> Typed.TypedTerm ([Diff.HoleFiller v s] -> v -> Either (Diff.MigrationError t v s) v) -> Typed.TypedTerm (Diff.Migrator t v s)+migratorWithApply original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.diff.Migrator"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "residualHoles"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.diff.Migrator"),+ Model.projectionFieldName = (Model.Name "residualHoles")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "apply"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL updater for the residualHoles field of hydra.core.diff.Migrator+migratorWithResidualHoles :: Typed.TypedTerm (Diff.Migrator t v s) -> Typed.TypedTerm [Diff.Hole t s] -> Typed.TypedTerm (Diff.Migrator t v s)+migratorWithResidualHoles original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.diff.Migrator"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "residualHoles"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "apply"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.diff.Migrator"),+ Model.projectionFieldName = (Model.Name "apply")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL constructor for hydra.core.diff.Mistyped+mistyped :: Typed.TypedTerm v -> Typed.TypedTerm t -> Typed.TypedTerm (Diff.Mistyped t v)+mistyped value type_ =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.diff.Mistyped"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "value"),+ Model.fieldTerm = (Typed.unTypedTerm value)},+ Model.Field {+ Model.fieldName = (Model.Name "type"),+ Model.fieldTerm = (Typed.unTypedTerm type_)}]}))++-- | DSL name token for hydra.core.diff.Mistyped+mistypedMistyped :: Typed.TypedName (Diff.Mistyped t v)+mistypedMistyped = Typed.TypedName (Model.Name "hydra.core.diff.Mistyped")++-- | DSL accessor for the type field of hydra.core.diff.Mistyped+mistypedType :: Typed.TypedTerm (Diff.Mistyped t v) -> Typed.TypedTerm t+mistypedType x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.diff.Mistyped"),+ Model.projectionFieldName = (Model.Name "type")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the value field of hydra.core.diff.Mistyped+mistypedValue :: Typed.TypedTerm (Diff.Mistyped t v) -> Typed.TypedTerm v+mistypedValue x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.diff.Mistyped"),+ Model.projectionFieldName = (Model.Name "value")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL updater for the type field of hydra.core.diff.Mistyped+mistypedWithType :: Typed.TypedTerm (Diff.Mistyped t v) -> Typed.TypedTerm t -> Typed.TypedTerm (Diff.Mistyped t v)+mistypedWithType original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.diff.Mistyped"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "value"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.diff.Mistyped"),+ Model.projectionFieldName = (Model.Name "value")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "type"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL updater for the value field of hydra.core.diff.Mistyped+mistypedWithValue :: Typed.TypedTerm (Diff.Mistyped t v) -> Typed.TypedTerm v -> Typed.TypedTerm (Diff.Mistyped t v)+mistypedWithValue original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.diff.Mistyped"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "value"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "type"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.diff.Mistyped"),+ Model.projectionFieldName = (Model.Name "type")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL constructor for hydra.core.diff.SchemaHole+schemaHole :: Typed.TypedTerm n -> Typed.TypedTerm (Diff.Hole t s) -> Typed.TypedTerm (Diff.SchemaHole n t s)+schemaHole typeName hole =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.diff.SchemaHole"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "typeName"),+ Model.fieldTerm = (Typed.unTypedTerm typeName)},+ Model.Field {+ Model.fieldName = (Model.Name "hole"),+ Model.fieldTerm = (Typed.unTypedTerm hole)}]}))++-- | DSL accessor for the hole field of hydra.core.diff.SchemaHole+schemaHoleHole :: Typed.TypedTerm (Diff.SchemaHole n t s) -> Typed.TypedTerm (Diff.Hole t s)+schemaHoleHole x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.diff.SchemaHole"),+ Model.projectionFieldName = (Model.Name "hole")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.diff.SchemaHole+schemaHoleSchemaHole :: Typed.TypedName (Diff.SchemaHole n t s)+schemaHoleSchemaHole = Typed.TypedName (Model.Name "hydra.core.diff.SchemaHole")++-- | DSL accessor for the typeName field of hydra.core.diff.SchemaHole+schemaHoleTypeName :: Typed.TypedTerm (Diff.SchemaHole n t s) -> Typed.TypedTerm n+schemaHoleTypeName x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.diff.SchemaHole"),+ Model.projectionFieldName = (Model.Name "typeName")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL updater for the hole field of hydra.core.diff.SchemaHole+schemaHoleWithHole :: Typed.TypedTerm (Diff.SchemaHole n t s) -> Typed.TypedTerm (Diff.Hole t s) -> Typed.TypedTerm (Diff.SchemaHole n t s)+schemaHoleWithHole original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.diff.SchemaHole"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "typeName"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.diff.SchemaHole"),+ Model.projectionFieldName = (Model.Name "typeName")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "hole"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL updater for the typeName field of hydra.core.diff.SchemaHole+schemaHoleWithTypeName :: Typed.TypedTerm (Diff.SchemaHole n t s) -> Typed.TypedTerm n -> Typed.TypedTerm (Diff.SchemaHole n t s)+schemaHoleWithTypeName original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.diff.SchemaHole"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "typeName"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "hole"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.diff.SchemaHole"),+ Model.projectionFieldName = (Model.Name "hole")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL constructor for hydra.core.diff.StepEdit+stepEdit :: Typed.TypedTerm s -> Typed.TypedTerm (Diff.Edit a s) -> Typed.TypedTerm (Diff.StepEdit a s)+stepEdit step edit =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.diff.StepEdit"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "step"),+ Model.fieldTerm = (Typed.unTypedTerm step)},+ Model.Field {+ Model.fieldName = (Model.Name "edit"),+ Model.fieldTerm = (Typed.unTypedTerm edit)}]}))++-- | DSL accessor for the edit field of hydra.core.diff.StepEdit+stepEditEdit :: Typed.TypedTerm (Diff.StepEdit a s) -> Typed.TypedTerm (Diff.Edit a s)+stepEditEdit x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.diff.StepEdit"),+ Model.projectionFieldName = (Model.Name "edit")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the step field of hydra.core.diff.StepEdit+stepEditStep :: Typed.TypedTerm (Diff.StepEdit a s) -> Typed.TypedTerm s+stepEditStep x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.diff.StepEdit"),+ Model.projectionFieldName = (Model.Name "step")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.diff.StepEdit+stepEditStepEdit :: Typed.TypedName (Diff.StepEdit a s)+stepEditStepEdit = Typed.TypedName (Model.Name "hydra.core.diff.StepEdit")++-- | DSL updater for the edit field of hydra.core.diff.StepEdit+stepEditWithEdit :: Typed.TypedTerm (Diff.StepEdit a s) -> Typed.TypedTerm (Diff.Edit a s) -> Typed.TypedTerm (Diff.StepEdit a s)+stepEditWithEdit original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.diff.StepEdit"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "step"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.diff.StepEdit"),+ Model.projectionFieldName = (Model.Name "step")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "edit"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL updater for the step field of hydra.core.diff.StepEdit+stepEditWithStep :: Typed.TypedTerm (Diff.StepEdit a s) -> Typed.TypedTerm s -> Typed.TypedTerm (Diff.StepEdit a s)+stepEditWithStep original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.diff.StepEdit"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "step"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "edit"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.diff.StepEdit"),+ Model.projectionFieldName = (Model.Name "edit")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))
@@ -0,0 +1,38 @@+-- Note: this is an automatically generated file. Do not edit.++-- | DSL functions for hydra.core.docs++module Hydra.Core.Dsl.Docs where++import qualified Hydra.Core.Decode.Docs as DecodeDocs+import qualified Hydra.Core.Docs as Docs+import qualified Hydra.Core.Dsl.Packaging as DslPackaging+import qualified Hydra.Core.Encode.Docs as EncodeDocs+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Typed as Typed+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | DSL name token for hydra.core.docs.DocSegment+docSegmentDocSegment :: Typed.TypedName Docs.DocSegment+docSegmentDocSegment = Typed.TypedName (Model.Name "hydra.core.docs.DocSegment")++-- | DSL injection for the ref variant of hydra.core.docs.DocSegment+docSegmentRef :: Typed.TypedTerm Packaging.EntityReference -> Typed.TypedTerm Docs.DocSegment+docSegmentRef x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.docs.DocSegment"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "ref"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the text variant of hydra.core.docs.DocSegment+docSegmentText :: Typed.TypedTerm String -> Typed.TypedTerm Docs.DocSegment+docSegmentText x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.docs.DocSegment"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "text"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))
@@ -0,0 +1,200 @@+-- Note: this is an automatically generated file. Do not edit.++-- | DSL functions for hydra.core.environment++module Hydra.Core.Dsl.Environment where++import qualified Hydra.Core.Ast as Ast+import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Decode.Model as DecodeModel+import qualified Hydra.Core.Diff as Diff+import qualified Hydra.Core.Docs as Docs+import qualified Hydra.Core.Dsl.Ast as DslAst+import qualified Hydra.Core.Dsl.Coders as DslCoders+import qualified Hydra.Core.Dsl.Diff as DslDiff+import qualified Hydra.Core.Dsl.Docs as DslDocs+import qualified Hydra.Core.Dsl.Error.Checking as ErrorChecking+import qualified Hydra.Core.Dsl.Error.File as DslErrorFile+import qualified Hydra.Core.Dsl.Error.Model as DslErrorModel+import qualified Hydra.Core.Dsl.Error.Packaging as DslErrorPackaging+import qualified Hydra.Core.Dsl.Error.System as DslErrorSystem+import qualified Hydra.Core.Dsl.Errors as DslErrors+import qualified Hydra.Core.Dsl.File as DslFile+import qualified Hydra.Core.Dsl.Graph as DslGraph+import qualified Hydra.Core.Dsl.Json.Model as DslJsonModel+import qualified Hydra.Core.Dsl.Lexical as DslLexical+import qualified Hydra.Core.Dsl.Markdown as DslMarkdown+import qualified Hydra.Core.Dsl.Model as DslModel+import qualified Hydra.Core.Dsl.Packaging as DslPackaging+import qualified Hydra.Core.Dsl.Parsing as DslParsing+import qualified Hydra.Core.Dsl.Paths as DslPaths+import qualified Hydra.Core.Dsl.Query as DslQuery+import qualified Hydra.Core.Dsl.Regex as DslRegex+import qualified Hydra.Core.Dsl.Relational as DslRelational+import qualified Hydra.Core.Dsl.Scoping as DslScoping+import qualified Hydra.Core.Dsl.Sorting as DslSorting+import qualified Hydra.Core.Dsl.Strip as DslStrip+import qualified Hydra.Core.Dsl.System as DslSystem+import qualified Hydra.Core.Dsl.Tabular as DslTabular+import qualified Hydra.Core.Dsl.Testing as DslTesting+import qualified Hydra.Core.Dsl.Time as DslTime+import qualified Hydra.Core.Dsl.Topology as DslTopology+import qualified Hydra.Core.Dsl.Typing as DslTyping+import qualified Hydra.Core.Dsl.Util as DslUtil+import qualified Hydra.Core.Dsl.Validation as DslValidation+import qualified Hydra.Core.Dsl.Variables as DslVariables+import qualified Hydra.Core.Dsl.Variants as DslVariants+import qualified Hydra.Core.Encode.Model as EncodeModel+import qualified Hydra.Core.Environment as Environment+import qualified Hydra.Core.Error.Checking as Checking+import qualified Hydra.Core.Error.File as ErrorFile+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Error.Packaging as ErrorPackaging+import qualified Hydra.Core.Error.System as ErrorSystem+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Json.Model as JsonModel+import qualified Hydra.Core.Lexical as Lexical+import qualified Hydra.Core.Markdown as Markdown+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Parsing as Parsing+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Query as Query+import qualified Hydra.Core.Regex as Regex+import qualified Hydra.Core.Relational as Relational+import qualified Hydra.Core.Scoping as Scoping+import qualified Hydra.Core.Sorting as Sorting+import qualified Hydra.Core.Strip as Strip+import qualified Hydra.Core.System as System+import qualified Hydra.Core.Tabular as Tabular+import qualified Hydra.Core.Testing as Testing+import qualified Hydra.Core.Time as Time+import qualified Hydra.Core.Topology as Topology+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Validation as Validation+import qualified Hydra.Core.Variables as Variables+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void+import qualified Data.Map as M++-- | DSL reference to hydra.core.environment.definitionAsTypeApplicationTerm+definitionAsTypeApplicationTerm :: Typed.TypedTerm Model.Binding -> Typed.TypedTerm (Either Errors.Error Model.TypeApplicationTerm)+definitionAsTypeApplicationTerm arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.environment.definitionAsTypeApplicationTerm")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.environment.graphAsLet+graphAsLet :: Typed.TypedTerm [Model.Binding] -> Typed.TypedTerm Model.Term -> Typed.TypedTerm Model.Let+graphAsLet arg0 arg1 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.environment.graphAsLet")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)}))++-- | DSL reference to hydra.core.environment.graphAsTerm+graphAsTerm :: Typed.TypedTerm [Model.Binding] -> Typed.TypedTerm Model.Term -> Typed.TypedTerm Model.Term+graphAsTerm arg0 arg1 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.environment.graphAsTerm")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)}))++-- | DSL reference to hydra.core.environment.graphAsTypes+graphAsTypes :: Typed.TypedTerm Graph.Graph -> Typed.TypedTerm [Model.Binding] -> Typed.TypedTerm (Either Errors.DecodingError (M.Map Model.Name Model.Type))+graphAsTypes arg0 arg1 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.environment.graphAsTypes")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)}))++-- | DSL reference to hydra.core.environment.partitionDefinitions+partitionDefinitions :: Typed.TypedTerm [Packaging.Definition] -> Typed.TypedTerm ([Packaging.TypeDefinition], [Packaging.TermDefinition])+partitionDefinitions arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.environment.partitionDefinitions")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.environment.reorderDefs+reorderDefs :: Typed.TypedTerm [Packaging.Definition] -> Typed.TypedTerm [Packaging.Definition]+reorderDefs arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.environment.reorderDefs")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.environment.schemaGraphToTypingEnvironment+schemaGraphToTypingEnvironment :: Typed.TypedTerm Graph.Graph -> Typed.TypedTerm (Either Errors.Error (M.Map Model.Name Model.TypeScheme))+schemaGraphToTypingEnvironment arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.environment.schemaGraphToTypingEnvironment")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.environment.termAsBindings+termAsBindings :: Typed.TypedTerm Model.Term -> Typed.TypedTerm [Model.Binding]+termAsBindings arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.environment.termAsBindings")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.environment.typesToDefinitions+typesToDefinitions :: Typed.TypedTerm (M.Map Model.Name Model.Type) -> Typed.TypedTerm [Model.Binding]+typesToDefinitions arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.environment.typesToDefinitions")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.environment.withLambdaContext+withLambdaContext :: Typed.TypedTerm (t0 -> Graph.Graph) -> Typed.TypedTerm (Graph.Graph -> t0 -> t1) -> Typed.TypedTerm t0 -> Typed.TypedTerm Model.Lambda -> Typed.TypedTerm (t1 -> t2) -> Typed.TypedTerm t2+withLambdaContext arg0 arg1 arg2 arg3 arg4 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.environment.withLambdaContext")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)})),+ Model.applicationArgument = (Typed.unTypedTerm arg2)})),+ Model.applicationArgument = (Typed.unTypedTerm arg3)})),+ Model.applicationArgument = (Typed.unTypedTerm arg4)}))++-- | DSL reference to hydra.core.environment.withLetContext+withLetContext :: Typed.TypedTerm (t0 -> Graph.Graph) -> Typed.TypedTerm (Graph.Graph -> t0 -> t1) -> Typed.TypedTerm (Graph.Graph -> Model.Binding -> Maybe Model.Term) -> Typed.TypedTerm t0 -> Typed.TypedTerm Model.Let -> Typed.TypedTerm (t1 -> t2) -> Typed.TypedTerm t2+withLetContext arg0 arg1 arg2 arg3 arg4 arg5 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.environment.withLetContext")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)})),+ Model.applicationArgument = (Typed.unTypedTerm arg2)})),+ Model.applicationArgument = (Typed.unTypedTerm arg3)})),+ Model.applicationArgument = (Typed.unTypedTerm arg4)})),+ Model.applicationArgument = (Typed.unTypedTerm arg5)}))++-- | DSL reference to hydra.core.environment.withTypeLambdaContext+withTypeLambdaContext :: Typed.TypedTerm (t0 -> Graph.Graph) -> Typed.TypedTerm (Graph.Graph -> t0 -> t1) -> Typed.TypedTerm t0 -> Typed.TypedTerm Model.TypeLambda -> Typed.TypedTerm (t1 -> t2) -> Typed.TypedTerm t2+withTypeLambdaContext arg0 arg1 arg2 arg3 arg4 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.environment.withTypeLambdaContext")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)})),+ Model.applicationArgument = (Typed.unTypedTerm arg2)})),+ Model.applicationArgument = (Typed.unTypedTerm arg3)})),+ Model.applicationArgument = (Typed.unTypedTerm arg4)}))
@@ -0,0 +1,960 @@+-- Note: this is an automatically generated file. Do not edit.++-- | DSL functions for hydra.core.error.checking++module Hydra.Core.Dsl.Error.Checking where++import qualified Hydra.Core.Decode.Error.Checking as DecodeErrorChecking+import qualified Hydra.Core.Dsl.Model as DslModel+import qualified Hydra.Core.Dsl.Paths as DslPaths+import qualified Hydra.Core.Dsl.Typing as DslTyping+import qualified Hydra.Core.Dsl.Variants as DslVariants+import qualified Hydra.Core.Encode.Error.Checking as EncodeErrorChecking+import qualified Hydra.Core.Error.Checking as Checking+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void+import qualified Data.Set as S++-- | DSL name token for hydra.core.error.checking.CheckingError+checkingErrorCheckingError :: Typed.TypedName Checking.CheckingError+checkingErrorCheckingError = Typed.TypedName (Model.Name "hydra.core.error.checking.CheckingError")++-- | DSL injection for the incorrectUnification variant of hydra.core.error.checking.CheckingError+checkingErrorIncorrectUnification :: Typed.TypedTerm Checking.IncorrectUnificationError -> Typed.TypedTerm Checking.CheckingError+checkingErrorIncorrectUnification x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.checking.CheckingError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "incorrectUnification"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the notAForallType variant of hydra.core.error.checking.CheckingError+checkingErrorNotAForallType :: Typed.TypedTerm Checking.NotAForallTypeError -> Typed.TypedTerm Checking.CheckingError+checkingErrorNotAForallType x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.checking.CheckingError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "notAForallType"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the notAFunctionType variant of hydra.core.error.checking.CheckingError+checkingErrorNotAFunctionType :: Typed.TypedTerm Checking.NotAFunctionTypeError -> Typed.TypedTerm Checking.CheckingError+checkingErrorNotAFunctionType x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.checking.CheckingError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "notAFunctionType"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the other variant of hydra.core.error.checking.CheckingError+checkingErrorOther :: Typed.TypedTerm Checking.OtherCheckingError -> Typed.TypedTerm Checking.CheckingError+checkingErrorOther x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.checking.CheckingError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "other"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the typeArityMismatch variant of hydra.core.error.checking.CheckingError+checkingErrorTypeArityMismatch :: Typed.TypedTerm Checking.TypeArityMismatchError -> Typed.TypedTerm Checking.CheckingError+checkingErrorTypeArityMismatch x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.checking.CheckingError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "typeArityMismatch"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the typeMismatch variant of hydra.core.error.checking.CheckingError+checkingErrorTypeMismatch :: Typed.TypedTerm Checking.TypeMismatchError -> Typed.TypedTerm Checking.CheckingError+checkingErrorTypeMismatch x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.checking.CheckingError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "typeMismatch"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the unboundTypeVariables variant of hydra.core.error.checking.CheckingError+checkingErrorUnboundTypeVariables :: Typed.TypedTerm Checking.UnboundTypeVariablesError -> Typed.TypedTerm Checking.CheckingError+checkingErrorUnboundTypeVariables x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.checking.CheckingError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "unboundTypeVariables"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the undefinedTermVariable variant of hydra.core.error.checking.CheckingError+checkingErrorUndefinedTermVariable :: Typed.TypedTerm Checking.UndefinedTermVariableCheckingError -> Typed.TypedTerm Checking.CheckingError+checkingErrorUndefinedTermVariable x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.checking.CheckingError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "undefinedTermVariable"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the unequalTypes variant of hydra.core.error.checking.CheckingError+checkingErrorUnequalTypes :: Typed.TypedTerm Checking.UnequalTypesError -> Typed.TypedTerm Checking.CheckingError+checkingErrorUnequalTypes x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.checking.CheckingError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "unequalTypes"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the unsupportedTermVariant variant of hydra.core.error.checking.CheckingError+checkingErrorUnsupportedTermVariant :: Typed.TypedTerm Checking.UnsupportedTermVariantError -> Typed.TypedTerm Checking.CheckingError+checkingErrorUnsupportedTermVariant x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.checking.CheckingError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "unsupportedTermVariant"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the untypedLambda variant of hydra.core.error.checking.CheckingError+checkingErrorUntypedLambda :: Typed.TypedTerm Checking.UntypedLambdaError -> Typed.TypedTerm Checking.CheckingError+checkingErrorUntypedLambda x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.checking.CheckingError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "untypedLambda"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the untypedLetBinding variant of hydra.core.error.checking.CheckingError+checkingErrorUntypedLetBinding :: Typed.TypedTerm Checking.UntypedLetBindingError -> Typed.TypedTerm Checking.CheckingError+checkingErrorUntypedLetBinding x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.checking.CheckingError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "untypedLetBinding"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the untypedTermVariable variant of hydra.core.error.checking.CheckingError+checkingErrorUntypedTermVariable :: Typed.TypedTerm Checking.UntypedTermVariableCheckingError -> Typed.TypedTerm Checking.CheckingError+checkingErrorUntypedTermVariable x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.checking.CheckingError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "untypedTermVariable"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL constructor for hydra.core.error.checking.IncorrectUnificationError+incorrectUnificationError :: Typed.TypedTerm Typing.TypeSubst -> Typed.TypedTerm Checking.IncorrectUnificationError+incorrectUnificationError substitution =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.checking.IncorrectUnificationError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "substitution"),+ Model.fieldTerm = (Typed.unTypedTerm substitution)}]}))++-- | DSL name token for hydra.core.error.checking.IncorrectUnificationError+incorrectUnificationErrorIncorrectUnificationError :: Typed.TypedName Checking.IncorrectUnificationError+incorrectUnificationErrorIncorrectUnificationError =+ Typed.TypedName (Model.Name "hydra.core.error.checking.IncorrectUnificationError")++-- | DSL accessor for the substitution field of hydra.core.error.checking.IncorrectUnificationError+incorrectUnificationErrorSubstitution :: Typed.TypedTerm Checking.IncorrectUnificationError -> Typed.TypedTerm Typing.TypeSubst+incorrectUnificationErrorSubstitution x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.checking.IncorrectUnificationError"),+ Model.projectionFieldName = (Model.Name "substitution")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL updater for the substitution field of hydra.core.error.checking.IncorrectUnificationError+incorrectUnificationErrorWithSubstitution :: Typed.TypedTerm Checking.IncorrectUnificationError -> Typed.TypedTerm Typing.TypeSubst -> Typed.TypedTerm Checking.IncorrectUnificationError+incorrectUnificationErrorWithSubstitution original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.checking.IncorrectUnificationError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "substitution"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL constructor for hydra.core.error.checking.NotAForallTypeError+notAForallTypeError :: Typed.TypedTerm Model.Type -> Typed.TypedTerm [Model.Type] -> Typed.TypedTerm Checking.NotAForallTypeError+notAForallTypeError type_ typeArguments =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.checking.NotAForallTypeError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "type"),+ Model.fieldTerm = (Typed.unTypedTerm type_)},+ Model.Field {+ Model.fieldName = (Model.Name "typeArguments"),+ Model.fieldTerm = (Typed.unTypedTerm typeArguments)}]}))++-- | DSL name token for hydra.core.error.checking.NotAForallTypeError+notAForallTypeErrorNotAForallTypeError :: Typed.TypedName Checking.NotAForallTypeError+notAForallTypeErrorNotAForallTypeError = Typed.TypedName (Model.Name "hydra.core.error.checking.NotAForallTypeError")++-- | DSL accessor for the type field of hydra.core.error.checking.NotAForallTypeError+notAForallTypeErrorType :: Typed.TypedTerm Checking.NotAForallTypeError -> Typed.TypedTerm Model.Type+notAForallTypeErrorType x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.checking.NotAForallTypeError"),+ Model.projectionFieldName = (Model.Name "type")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the typeArguments field of hydra.core.error.checking.NotAForallTypeError+notAForallTypeErrorTypeArguments :: Typed.TypedTerm Checking.NotAForallTypeError -> Typed.TypedTerm [Model.Type]+notAForallTypeErrorTypeArguments x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.checking.NotAForallTypeError"),+ Model.projectionFieldName = (Model.Name "typeArguments")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL updater for the type field of hydra.core.error.checking.NotAForallTypeError+notAForallTypeErrorWithType :: Typed.TypedTerm Checking.NotAForallTypeError -> Typed.TypedTerm Model.Type -> Typed.TypedTerm Checking.NotAForallTypeError+notAForallTypeErrorWithType original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.checking.NotAForallTypeError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "type"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "typeArguments"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.checking.NotAForallTypeError"),+ Model.projectionFieldName = (Model.Name "typeArguments")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the typeArguments field of hydra.core.error.checking.NotAForallTypeError+notAForallTypeErrorWithTypeArguments :: Typed.TypedTerm Checking.NotAForallTypeError -> Typed.TypedTerm [Model.Type] -> Typed.TypedTerm Checking.NotAForallTypeError+notAForallTypeErrorWithTypeArguments original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.checking.NotAForallTypeError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "type"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.checking.NotAForallTypeError"),+ Model.projectionFieldName = (Model.Name "type")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "typeArguments"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL constructor for hydra.core.error.checking.NotAFunctionTypeError+notAFunctionTypeError :: Typed.TypedTerm Model.Type -> Typed.TypedTerm Checking.NotAFunctionTypeError+notAFunctionTypeError type_ =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.checking.NotAFunctionTypeError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "type"),+ Model.fieldTerm = (Typed.unTypedTerm type_)}]}))++-- | DSL name token for hydra.core.error.checking.NotAFunctionTypeError+notAFunctionTypeErrorNotAFunctionTypeError :: Typed.TypedName Checking.NotAFunctionTypeError+notAFunctionTypeErrorNotAFunctionTypeError =+ Typed.TypedName (Model.Name "hydra.core.error.checking.NotAFunctionTypeError")++-- | DSL accessor for the type field of hydra.core.error.checking.NotAFunctionTypeError+notAFunctionTypeErrorType :: Typed.TypedTerm Checking.NotAFunctionTypeError -> Typed.TypedTerm Model.Type+notAFunctionTypeErrorType x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.checking.NotAFunctionTypeError"),+ Model.projectionFieldName = (Model.Name "type")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL updater for the type field of hydra.core.error.checking.NotAFunctionTypeError+notAFunctionTypeErrorWithType :: Typed.TypedTerm Checking.NotAFunctionTypeError -> Typed.TypedTerm Model.Type -> Typed.TypedTerm Checking.NotAFunctionTypeError+notAFunctionTypeErrorWithType original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.checking.NotAFunctionTypeError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "type"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL constructor for hydra.core.error.checking.OtherCheckingError+otherCheckingError :: Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm String -> Typed.TypedTerm Checking.OtherCheckingError+otherCheckingError path message =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.checking.OtherCheckingError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "path"),+ Model.fieldTerm = (Typed.unTypedTerm path)},+ Model.Field {+ Model.fieldName = (Model.Name "message"),+ Model.fieldTerm = (Typed.unTypedTerm message)}]}))++-- | DSL accessor for the message field of hydra.core.error.checking.OtherCheckingError+otherCheckingErrorMessage :: Typed.TypedTerm Checking.OtherCheckingError -> Typed.TypedTerm String+otherCheckingErrorMessage x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.checking.OtherCheckingError"),+ Model.projectionFieldName = (Model.Name "message")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.error.checking.OtherCheckingError+otherCheckingErrorOtherCheckingError :: Typed.TypedName Checking.OtherCheckingError+otherCheckingErrorOtherCheckingError = Typed.TypedName (Model.Name "hydra.core.error.checking.OtherCheckingError")++-- | DSL accessor for the path field of hydra.core.error.checking.OtherCheckingError+otherCheckingErrorPath :: Typed.TypedTerm Checking.OtherCheckingError -> Typed.TypedTerm Paths.SubtermPath+otherCheckingErrorPath x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.checking.OtherCheckingError"),+ Model.projectionFieldName = (Model.Name "path")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL updater for the message field of hydra.core.error.checking.OtherCheckingError+otherCheckingErrorWithMessage :: Typed.TypedTerm Checking.OtherCheckingError -> Typed.TypedTerm String -> Typed.TypedTerm Checking.OtherCheckingError+otherCheckingErrorWithMessage original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.checking.OtherCheckingError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "path"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.checking.OtherCheckingError"),+ Model.projectionFieldName = (Model.Name "path")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "message"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL updater for the path field of hydra.core.error.checking.OtherCheckingError+otherCheckingErrorWithPath :: Typed.TypedTerm Checking.OtherCheckingError -> Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm Checking.OtherCheckingError+otherCheckingErrorWithPath original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.checking.OtherCheckingError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "path"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "message"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.checking.OtherCheckingError"),+ Model.projectionFieldName = (Model.Name "message")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL constructor for hydra.core.error.checking.TypeArityMismatchError+typeArityMismatchError :: Typed.TypedTerm Model.Type -> Typed.TypedTerm Int -> Typed.TypedTerm Int -> Typed.TypedTerm [Model.Type] -> Typed.TypedTerm Checking.TypeArityMismatchError+typeArityMismatchError type_ expectedArity actualArity typeArguments =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.checking.TypeArityMismatchError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "type"),+ Model.fieldTerm = (Typed.unTypedTerm type_)},+ Model.Field {+ Model.fieldName = (Model.Name "expectedArity"),+ Model.fieldTerm = (Typed.unTypedTerm expectedArity)},+ Model.Field {+ Model.fieldName = (Model.Name "actualArity"),+ Model.fieldTerm = (Typed.unTypedTerm actualArity)},+ Model.Field {+ Model.fieldName = (Model.Name "typeArguments"),+ Model.fieldTerm = (Typed.unTypedTerm typeArguments)}]}))++-- | DSL accessor for the actualArity field of hydra.core.error.checking.TypeArityMismatchError+typeArityMismatchErrorActualArity :: Typed.TypedTerm Checking.TypeArityMismatchError -> Typed.TypedTerm Int+typeArityMismatchErrorActualArity x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.checking.TypeArityMismatchError"),+ Model.projectionFieldName = (Model.Name "actualArity")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the expectedArity field of hydra.core.error.checking.TypeArityMismatchError+typeArityMismatchErrorExpectedArity :: Typed.TypedTerm Checking.TypeArityMismatchError -> Typed.TypedTerm Int+typeArityMismatchErrorExpectedArity x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.checking.TypeArityMismatchError"),+ Model.projectionFieldName = (Model.Name "expectedArity")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the type field of hydra.core.error.checking.TypeArityMismatchError+typeArityMismatchErrorType :: Typed.TypedTerm Checking.TypeArityMismatchError -> Typed.TypedTerm Model.Type+typeArityMismatchErrorType x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.checking.TypeArityMismatchError"),+ Model.projectionFieldName = (Model.Name "type")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the typeArguments field of hydra.core.error.checking.TypeArityMismatchError+typeArityMismatchErrorTypeArguments :: Typed.TypedTerm Checking.TypeArityMismatchError -> Typed.TypedTerm [Model.Type]+typeArityMismatchErrorTypeArguments x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.checking.TypeArityMismatchError"),+ Model.projectionFieldName = (Model.Name "typeArguments")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.error.checking.TypeArityMismatchError+typeArityMismatchErrorTypeArityMismatchError :: Typed.TypedName Checking.TypeArityMismatchError+typeArityMismatchErrorTypeArityMismatchError =+ Typed.TypedName (Model.Name "hydra.core.error.checking.TypeArityMismatchError")++-- | DSL updater for the actualArity field of hydra.core.error.checking.TypeArityMismatchError+typeArityMismatchErrorWithActualArity :: Typed.TypedTerm Checking.TypeArityMismatchError -> Typed.TypedTerm Int -> Typed.TypedTerm Checking.TypeArityMismatchError+typeArityMismatchErrorWithActualArity original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.checking.TypeArityMismatchError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "type"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.checking.TypeArityMismatchError"),+ Model.projectionFieldName = (Model.Name "type")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "expectedArity"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.checking.TypeArityMismatchError"),+ Model.projectionFieldName = (Model.Name "expectedArity")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "actualArity"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "typeArguments"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.checking.TypeArityMismatchError"),+ Model.projectionFieldName = (Model.Name "typeArguments")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the expectedArity field of hydra.core.error.checking.TypeArityMismatchError+typeArityMismatchErrorWithExpectedArity :: Typed.TypedTerm Checking.TypeArityMismatchError -> Typed.TypedTerm Int -> Typed.TypedTerm Checking.TypeArityMismatchError+typeArityMismatchErrorWithExpectedArity original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.checking.TypeArityMismatchError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "type"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.checking.TypeArityMismatchError"),+ Model.projectionFieldName = (Model.Name "type")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "expectedArity"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "actualArity"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.checking.TypeArityMismatchError"),+ Model.projectionFieldName = (Model.Name "actualArity")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "typeArguments"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.checking.TypeArityMismatchError"),+ Model.projectionFieldName = (Model.Name "typeArguments")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the type field of hydra.core.error.checking.TypeArityMismatchError+typeArityMismatchErrorWithType :: Typed.TypedTerm Checking.TypeArityMismatchError -> Typed.TypedTerm Model.Type -> Typed.TypedTerm Checking.TypeArityMismatchError+typeArityMismatchErrorWithType original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.checking.TypeArityMismatchError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "type"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "expectedArity"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.checking.TypeArityMismatchError"),+ Model.projectionFieldName = (Model.Name "expectedArity")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "actualArity"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.checking.TypeArityMismatchError"),+ Model.projectionFieldName = (Model.Name "actualArity")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "typeArguments"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.checking.TypeArityMismatchError"),+ Model.projectionFieldName = (Model.Name "typeArguments")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the typeArguments field of hydra.core.error.checking.TypeArityMismatchError+typeArityMismatchErrorWithTypeArguments :: Typed.TypedTerm Checking.TypeArityMismatchError -> Typed.TypedTerm [Model.Type] -> Typed.TypedTerm Checking.TypeArityMismatchError+typeArityMismatchErrorWithTypeArguments original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.checking.TypeArityMismatchError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "type"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.checking.TypeArityMismatchError"),+ Model.projectionFieldName = (Model.Name "type")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "expectedArity"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.checking.TypeArityMismatchError"),+ Model.projectionFieldName = (Model.Name "expectedArity")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "actualArity"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.checking.TypeArityMismatchError"),+ Model.projectionFieldName = (Model.Name "actualArity")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "typeArguments"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL constructor for hydra.core.error.checking.TypeMismatchError+typeMismatchError :: Typed.TypedTerm Model.Type -> Typed.TypedTerm Model.Type -> Typed.TypedTerm Checking.TypeMismatchError+typeMismatchError expectedType actualType =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.checking.TypeMismatchError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "expectedType"),+ Model.fieldTerm = (Typed.unTypedTerm expectedType)},+ Model.Field {+ Model.fieldName = (Model.Name "actualType"),+ Model.fieldTerm = (Typed.unTypedTerm actualType)}]}))++-- | DSL accessor for the actualType field of hydra.core.error.checking.TypeMismatchError+typeMismatchErrorActualType :: Typed.TypedTerm Checking.TypeMismatchError -> Typed.TypedTerm Model.Type+typeMismatchErrorActualType x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.checking.TypeMismatchError"),+ Model.projectionFieldName = (Model.Name "actualType")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the expectedType field of hydra.core.error.checking.TypeMismatchError+typeMismatchErrorExpectedType :: Typed.TypedTerm Checking.TypeMismatchError -> Typed.TypedTerm Model.Type+typeMismatchErrorExpectedType x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.checking.TypeMismatchError"),+ Model.projectionFieldName = (Model.Name "expectedType")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.error.checking.TypeMismatchError+typeMismatchErrorTypeMismatchError :: Typed.TypedName Checking.TypeMismatchError+typeMismatchErrorTypeMismatchError = Typed.TypedName (Model.Name "hydra.core.error.checking.TypeMismatchError")++-- | DSL updater for the actualType field of hydra.core.error.checking.TypeMismatchError+typeMismatchErrorWithActualType :: Typed.TypedTerm Checking.TypeMismatchError -> Typed.TypedTerm Model.Type -> Typed.TypedTerm Checking.TypeMismatchError+typeMismatchErrorWithActualType original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.checking.TypeMismatchError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "expectedType"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.checking.TypeMismatchError"),+ Model.projectionFieldName = (Model.Name "expectedType")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "actualType"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL updater for the expectedType field of hydra.core.error.checking.TypeMismatchError+typeMismatchErrorWithExpectedType :: Typed.TypedTerm Checking.TypeMismatchError -> Typed.TypedTerm Model.Type -> Typed.TypedTerm Checking.TypeMismatchError+typeMismatchErrorWithExpectedType original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.checking.TypeMismatchError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "expectedType"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "actualType"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.checking.TypeMismatchError"),+ Model.projectionFieldName = (Model.Name "actualType")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL constructor for hydra.core.error.checking.UnboundTypeVariablesError+unboundTypeVariablesError :: Typed.TypedTerm (S.Set Model.Name) -> Typed.TypedTerm Model.Type -> Typed.TypedTerm Checking.UnboundTypeVariablesError+unboundTypeVariablesError variables type_ =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.checking.UnboundTypeVariablesError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "variables"),+ Model.fieldTerm = (Typed.unTypedTerm variables)},+ Model.Field {+ Model.fieldName = (Model.Name "type"),+ Model.fieldTerm = (Typed.unTypedTerm type_)}]}))++-- | DSL accessor for the type field of hydra.core.error.checking.UnboundTypeVariablesError+unboundTypeVariablesErrorType :: Typed.TypedTerm Checking.UnboundTypeVariablesError -> Typed.TypedTerm Model.Type+unboundTypeVariablesErrorType x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.checking.UnboundTypeVariablesError"),+ Model.projectionFieldName = (Model.Name "type")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.error.checking.UnboundTypeVariablesError+unboundTypeVariablesErrorUnboundTypeVariablesError :: Typed.TypedName Checking.UnboundTypeVariablesError+unboundTypeVariablesErrorUnboundTypeVariablesError =+ Typed.TypedName (Model.Name "hydra.core.error.checking.UnboundTypeVariablesError")++-- | DSL accessor for the variables field of hydra.core.error.checking.UnboundTypeVariablesError+unboundTypeVariablesErrorVariables :: Typed.TypedTerm Checking.UnboundTypeVariablesError -> Typed.TypedTerm (S.Set Model.Name)+unboundTypeVariablesErrorVariables x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.checking.UnboundTypeVariablesError"),+ Model.projectionFieldName = (Model.Name "variables")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL updater for the type field of hydra.core.error.checking.UnboundTypeVariablesError+unboundTypeVariablesErrorWithType :: Typed.TypedTerm Checking.UnboundTypeVariablesError -> Typed.TypedTerm Model.Type -> Typed.TypedTerm Checking.UnboundTypeVariablesError+unboundTypeVariablesErrorWithType original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.checking.UnboundTypeVariablesError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "variables"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.checking.UnboundTypeVariablesError"),+ Model.projectionFieldName = (Model.Name "variables")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "type"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL updater for the variables field of hydra.core.error.checking.UnboundTypeVariablesError+unboundTypeVariablesErrorWithVariables :: Typed.TypedTerm Checking.UnboundTypeVariablesError -> Typed.TypedTerm (S.Set Model.Name) -> Typed.TypedTerm Checking.UnboundTypeVariablesError+unboundTypeVariablesErrorWithVariables original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.checking.UnboundTypeVariablesError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "variables"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "type"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.checking.UnboundTypeVariablesError"),+ Model.projectionFieldName = (Model.Name "type")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL constructor for hydra.core.error.checking.UndefinedTermVariableCheckingError+undefinedTermVariableCheckingError :: Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm Model.Name -> Typed.TypedTerm Checking.UndefinedTermVariableCheckingError+undefinedTermVariableCheckingError path name =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.checking.UndefinedTermVariableCheckingError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "path"),+ Model.fieldTerm = (Typed.unTypedTerm path)},+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Typed.unTypedTerm name)}]}))++-- | DSL accessor for the name field of hydra.core.error.checking.UndefinedTermVariableCheckingError+undefinedTermVariableCheckingErrorName :: Typed.TypedTerm Checking.UndefinedTermVariableCheckingError -> Typed.TypedTerm Model.Name+undefinedTermVariableCheckingErrorName x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.checking.UndefinedTermVariableCheckingError"),+ Model.projectionFieldName = (Model.Name "name")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the path field of hydra.core.error.checking.UndefinedTermVariableCheckingError+undefinedTermVariableCheckingErrorPath :: Typed.TypedTerm Checking.UndefinedTermVariableCheckingError -> Typed.TypedTerm Paths.SubtermPath+undefinedTermVariableCheckingErrorPath x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.checking.UndefinedTermVariableCheckingError"),+ Model.projectionFieldName = (Model.Name "path")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.error.checking.UndefinedTermVariableCheckingError+undefinedTermVariableCheckingErrorUndefinedTermVariableCheckingError :: Typed.TypedName Checking.UndefinedTermVariableCheckingError+undefinedTermVariableCheckingErrorUndefinedTermVariableCheckingError =+ Typed.TypedName (Model.Name "hydra.core.error.checking.UndefinedTermVariableCheckingError")++-- | DSL updater for the name field of hydra.core.error.checking.UndefinedTermVariableCheckingError+undefinedTermVariableCheckingErrorWithName :: Typed.TypedTerm Checking.UndefinedTermVariableCheckingError -> Typed.TypedTerm Model.Name -> Typed.TypedTerm Checking.UndefinedTermVariableCheckingError+undefinedTermVariableCheckingErrorWithName original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.checking.UndefinedTermVariableCheckingError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "path"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.checking.UndefinedTermVariableCheckingError"),+ Model.projectionFieldName = (Model.Name "path")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL updater for the path field of hydra.core.error.checking.UndefinedTermVariableCheckingError+undefinedTermVariableCheckingErrorWithPath :: Typed.TypedTerm Checking.UndefinedTermVariableCheckingError -> Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm Checking.UndefinedTermVariableCheckingError+undefinedTermVariableCheckingErrorWithPath original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.checking.UndefinedTermVariableCheckingError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "path"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.checking.UndefinedTermVariableCheckingError"),+ Model.projectionFieldName = (Model.Name "name")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL constructor for hydra.core.error.checking.UnequalTypesError+unequalTypesError :: Typed.TypedTerm [Model.Type] -> Typed.TypedTerm String -> Typed.TypedTerm Checking.UnequalTypesError+unequalTypesError types description =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.checking.UnequalTypesError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "types"),+ Model.fieldTerm = (Typed.unTypedTerm types)},+ Model.Field {+ Model.fieldName = (Model.Name "description"),+ Model.fieldTerm = (Typed.unTypedTerm description)}]}))++-- | DSL accessor for the description field of hydra.core.error.checking.UnequalTypesError+unequalTypesErrorDescription :: Typed.TypedTerm Checking.UnequalTypesError -> Typed.TypedTerm String+unequalTypesErrorDescription x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.checking.UnequalTypesError"),+ Model.projectionFieldName = (Model.Name "description")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the types field of hydra.core.error.checking.UnequalTypesError+unequalTypesErrorTypes :: Typed.TypedTerm Checking.UnequalTypesError -> Typed.TypedTerm [Model.Type]+unequalTypesErrorTypes x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.checking.UnequalTypesError"),+ Model.projectionFieldName = (Model.Name "types")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.error.checking.UnequalTypesError+unequalTypesErrorUnequalTypesError :: Typed.TypedName Checking.UnequalTypesError+unequalTypesErrorUnequalTypesError = Typed.TypedName (Model.Name "hydra.core.error.checking.UnequalTypesError")++-- | DSL updater for the description field of hydra.core.error.checking.UnequalTypesError+unequalTypesErrorWithDescription :: Typed.TypedTerm Checking.UnequalTypesError -> Typed.TypedTerm String -> Typed.TypedTerm Checking.UnequalTypesError+unequalTypesErrorWithDescription original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.checking.UnequalTypesError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "types"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.checking.UnequalTypesError"),+ Model.projectionFieldName = (Model.Name "types")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "description"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL updater for the types field of hydra.core.error.checking.UnequalTypesError+unequalTypesErrorWithTypes :: Typed.TypedTerm Checking.UnequalTypesError -> Typed.TypedTerm [Model.Type] -> Typed.TypedTerm Checking.UnequalTypesError+unequalTypesErrorWithTypes original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.checking.UnequalTypesError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "types"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "description"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.checking.UnequalTypesError"),+ Model.projectionFieldName = (Model.Name "description")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL constructor for hydra.core.error.checking.UnsupportedTermVariantError+unsupportedTermVariantError :: Typed.TypedTerm Variants.TermVariant -> Typed.TypedTerm Checking.UnsupportedTermVariantError+unsupportedTermVariantError termVariant =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.checking.UnsupportedTermVariantError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "termVariant"),+ Model.fieldTerm = (Typed.unTypedTerm termVariant)}]}))++-- | DSL accessor for the termVariant field of hydra.core.error.checking.UnsupportedTermVariantError+unsupportedTermVariantErrorTermVariant :: Typed.TypedTerm Checking.UnsupportedTermVariantError -> Typed.TypedTerm Variants.TermVariant+unsupportedTermVariantErrorTermVariant x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.checking.UnsupportedTermVariantError"),+ Model.projectionFieldName = (Model.Name "termVariant")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.error.checking.UnsupportedTermVariantError+unsupportedTermVariantErrorUnsupportedTermVariantError :: Typed.TypedName Checking.UnsupportedTermVariantError+unsupportedTermVariantErrorUnsupportedTermVariantError =+ Typed.TypedName (Model.Name "hydra.core.error.checking.UnsupportedTermVariantError")++-- | DSL updater for the termVariant field of hydra.core.error.checking.UnsupportedTermVariantError+unsupportedTermVariantErrorWithTermVariant :: Typed.TypedTerm Checking.UnsupportedTermVariantError -> Typed.TypedTerm Variants.TermVariant -> Typed.TypedTerm Checking.UnsupportedTermVariantError+unsupportedTermVariantErrorWithTermVariant original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.checking.UnsupportedTermVariantError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "termVariant"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL constructor for hydra.core.error.checking.UntypedLambdaError+untypedLambdaError :: Typed.TypedTerm Checking.UntypedLambdaError+untypedLambdaError =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.checking.UntypedLambdaError"),+ Model.recordFields = []}))++-- | DSL name token for hydra.core.error.checking.UntypedLambdaError+untypedLambdaErrorUntypedLambdaError :: Typed.TypedName Checking.UntypedLambdaError+untypedLambdaErrorUntypedLambdaError = Typed.TypedName (Model.Name "hydra.core.error.checking.UntypedLambdaError")++-- | DSL constructor for hydra.core.error.checking.UntypedLetBindingError+untypedLetBindingError :: Typed.TypedTerm Model.Binding -> Typed.TypedTerm Checking.UntypedLetBindingError+untypedLetBindingError binding =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.checking.UntypedLetBindingError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "binding"),+ Model.fieldTerm = (Typed.unTypedTerm binding)}]}))++-- | DSL accessor for the binding field of hydra.core.error.checking.UntypedLetBindingError+untypedLetBindingErrorBinding :: Typed.TypedTerm Checking.UntypedLetBindingError -> Typed.TypedTerm Model.Binding+untypedLetBindingErrorBinding x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.checking.UntypedLetBindingError"),+ Model.projectionFieldName = (Model.Name "binding")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.error.checking.UntypedLetBindingError+untypedLetBindingErrorUntypedLetBindingError :: Typed.TypedName Checking.UntypedLetBindingError+untypedLetBindingErrorUntypedLetBindingError =+ Typed.TypedName (Model.Name "hydra.core.error.checking.UntypedLetBindingError")++-- | DSL updater for the binding field of hydra.core.error.checking.UntypedLetBindingError+untypedLetBindingErrorWithBinding :: Typed.TypedTerm Checking.UntypedLetBindingError -> Typed.TypedTerm Model.Binding -> Typed.TypedTerm Checking.UntypedLetBindingError+untypedLetBindingErrorWithBinding original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.checking.UntypedLetBindingError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "binding"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL constructor for hydra.core.error.checking.UntypedTermVariableCheckingError+untypedTermVariableCheckingError :: Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm Model.Name -> Typed.TypedTerm Checking.UntypedTermVariableCheckingError+untypedTermVariableCheckingError path name =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.checking.UntypedTermVariableCheckingError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "path"),+ Model.fieldTerm = (Typed.unTypedTerm path)},+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Typed.unTypedTerm name)}]}))++-- | DSL accessor for the name field of hydra.core.error.checking.UntypedTermVariableCheckingError+untypedTermVariableCheckingErrorName :: Typed.TypedTerm Checking.UntypedTermVariableCheckingError -> Typed.TypedTerm Model.Name+untypedTermVariableCheckingErrorName x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.checking.UntypedTermVariableCheckingError"),+ Model.projectionFieldName = (Model.Name "name")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the path field of hydra.core.error.checking.UntypedTermVariableCheckingError+untypedTermVariableCheckingErrorPath :: Typed.TypedTerm Checking.UntypedTermVariableCheckingError -> Typed.TypedTerm Paths.SubtermPath+untypedTermVariableCheckingErrorPath x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.checking.UntypedTermVariableCheckingError"),+ Model.projectionFieldName = (Model.Name "path")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.error.checking.UntypedTermVariableCheckingError+untypedTermVariableCheckingErrorUntypedTermVariableCheckingError :: Typed.TypedName Checking.UntypedTermVariableCheckingError+untypedTermVariableCheckingErrorUntypedTermVariableCheckingError =+ Typed.TypedName (Model.Name "hydra.core.error.checking.UntypedTermVariableCheckingError")++-- | DSL updater for the name field of hydra.core.error.checking.UntypedTermVariableCheckingError+untypedTermVariableCheckingErrorWithName :: Typed.TypedTerm Checking.UntypedTermVariableCheckingError -> Typed.TypedTerm Model.Name -> Typed.TypedTerm Checking.UntypedTermVariableCheckingError+untypedTermVariableCheckingErrorWithName original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.checking.UntypedTermVariableCheckingError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "path"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.checking.UntypedTermVariableCheckingError"),+ Model.projectionFieldName = (Model.Name "path")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL updater for the path field of hydra.core.error.checking.UntypedTermVariableCheckingError+untypedTermVariableCheckingErrorWithPath :: Typed.TypedTerm Checking.UntypedTermVariableCheckingError -> Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm Checking.UntypedTermVariableCheckingError+untypedTermVariableCheckingErrorWithPath original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.checking.UntypedTermVariableCheckingError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "path"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.checking.UntypedTermVariableCheckingError"),+ Model.projectionFieldName = (Model.Name "name")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))
@@ -0,0 +1,65 @@+-- Note: this is an automatically generated file. Do not edit.++-- | DSL functions for hydra.core.error.file++module Hydra.Core.Dsl.Error.File where++import qualified Hydra.Core.Decode.Error.File as DecodeErrorFile+import qualified Hydra.Core.Dsl.File as DslFile+import qualified Hydra.Core.Encode.Error.File as EncodeErrorFile+import qualified Hydra.Core.Error.File as ErrorFile+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Typed as Typed+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | DSL injection for the alreadyExists variant of hydra.core.error.file.FileError+fileErrorAlreadyExists :: Typed.TypedTerm File.FilePath -> Typed.TypedTerm ErrorFile.FileError+fileErrorAlreadyExists x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.file.FileError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "alreadyExists"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL name token for hydra.core.error.file.FileError+fileErrorFileError :: Typed.TypedName ErrorFile.FileError+fileErrorFileError = Typed.TypedName (Model.Name "hydra.core.error.file.FileError")++-- | DSL injection for the invalidPath variant of hydra.core.error.file.FileError+fileErrorInvalidPath :: Typed.TypedTerm String -> Typed.TypedTerm ErrorFile.FileError+fileErrorInvalidPath x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.file.FileError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "invalidPath"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the notFound variant of hydra.core.error.file.FileError+fileErrorNotFound :: Typed.TypedTerm File.FilePath -> Typed.TypedTerm ErrorFile.FileError+fileErrorNotFound x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.file.FileError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "notFound"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the other variant of hydra.core.error.file.FileError+fileErrorOther :: Typed.TypedTerm String -> Typed.TypedTerm ErrorFile.FileError+fileErrorOther x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.file.FileError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "other"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the permissionDenied variant of hydra.core.error.file.FileError+fileErrorPermissionDenied :: Typed.TypedTerm File.FilePath -> Typed.TypedTerm ErrorFile.FileError+fileErrorPermissionDenied x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.file.FileError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "permissionDenied"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))
@@ -0,0 +1,3843 @@+-- Note: this is an automatically generated file. Do not edit.++-- | DSL functions for hydra.core.error.model++module Hydra.Core.Dsl.Error.Model where++import qualified Hydra.Core.Decode.Error.Model as DecodeErrorModel+import qualified Hydra.Core.Dsl.Model as DslModel+import qualified Hydra.Core.Dsl.Paths as DslPaths+import qualified Hydra.Core.Dsl.Variants as DslVariants+import qualified Hydra.Core.Encode.Error.Model as EncodeErrorModel+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | DSL constructor for hydra.core.error.model.ConstantConditionError+constantConditionError :: Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm Bool -> Typed.TypedTerm ErrorModel.ConstantConditionError+constantConditionError location value =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.ConstantConditionError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Typed.unTypedTerm location)},+ Model.Field {+ Model.fieldName = (Model.Name "value"),+ Model.fieldTerm = (Typed.unTypedTerm value)}]}))++-- | DSL name token for hydra.core.error.model.ConstantConditionError+constantConditionErrorConstantConditionError :: Typed.TypedName ErrorModel.ConstantConditionError+constantConditionErrorConstantConditionError =+ Typed.TypedName (Model.Name "hydra.core.error.model.ConstantConditionError")++-- | DSL accessor for the location field of hydra.core.error.model.ConstantConditionError+constantConditionErrorLocation :: Typed.TypedTerm ErrorModel.ConstantConditionError -> Typed.TypedTerm Paths.SubtermPath+constantConditionErrorLocation x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.ConstantConditionError"),+ Model.projectionFieldName = (Model.Name "location")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the value field of hydra.core.error.model.ConstantConditionError+constantConditionErrorValue :: Typed.TypedTerm ErrorModel.ConstantConditionError -> Typed.TypedTerm Bool+constantConditionErrorValue x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.ConstantConditionError"),+ Model.projectionFieldName = (Model.Name "value")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL updater for the location field of hydra.core.error.model.ConstantConditionError+constantConditionErrorWithLocation :: Typed.TypedTerm ErrorModel.ConstantConditionError -> Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm ErrorModel.ConstantConditionError+constantConditionErrorWithLocation original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.ConstantConditionError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "value"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.ConstantConditionError"),+ Model.projectionFieldName = (Model.Name "value")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the value field of hydra.core.error.model.ConstantConditionError+constantConditionErrorWithValue :: Typed.TypedTerm ErrorModel.ConstantConditionError -> Typed.TypedTerm Bool -> Typed.TypedTerm ErrorModel.ConstantConditionError+constantConditionErrorWithValue original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.ConstantConditionError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.ConstantConditionError"),+ Model.projectionFieldName = (Model.Name "location")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "value"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL constructor for hydra.core.error.model.DuplicateBindingError+duplicateBindingError :: Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm Model.Name -> Typed.TypedTerm ErrorModel.DuplicateBindingError+duplicateBindingError location name =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.DuplicateBindingError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Typed.unTypedTerm location)},+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Typed.unTypedTerm name)}]}))++-- | DSL name token for hydra.core.error.model.DuplicateBindingError+duplicateBindingErrorDuplicateBindingError :: Typed.TypedName ErrorModel.DuplicateBindingError+duplicateBindingErrorDuplicateBindingError = Typed.TypedName (Model.Name "hydra.core.error.model.DuplicateBindingError")++-- | DSL accessor for the location field of hydra.core.error.model.DuplicateBindingError+duplicateBindingErrorLocation :: Typed.TypedTerm ErrorModel.DuplicateBindingError -> Typed.TypedTerm Paths.SubtermPath+duplicateBindingErrorLocation x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.DuplicateBindingError"),+ Model.projectionFieldName = (Model.Name "location")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the name field of hydra.core.error.model.DuplicateBindingError+duplicateBindingErrorName :: Typed.TypedTerm ErrorModel.DuplicateBindingError -> Typed.TypedTerm Model.Name+duplicateBindingErrorName x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.DuplicateBindingError"),+ Model.projectionFieldName = (Model.Name "name")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL updater for the location field of hydra.core.error.model.DuplicateBindingError+duplicateBindingErrorWithLocation :: Typed.TypedTerm ErrorModel.DuplicateBindingError -> Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm ErrorModel.DuplicateBindingError+duplicateBindingErrorWithLocation original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.DuplicateBindingError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.DuplicateBindingError"),+ Model.projectionFieldName = (Model.Name "name")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the name field of hydra.core.error.model.DuplicateBindingError+duplicateBindingErrorWithName :: Typed.TypedTerm ErrorModel.DuplicateBindingError -> Typed.TypedTerm Model.Name -> Typed.TypedTerm ErrorModel.DuplicateBindingError+duplicateBindingErrorWithName original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.DuplicateBindingError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.DuplicateBindingError"),+ Model.projectionFieldName = (Model.Name "location")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL constructor for hydra.core.error.model.DuplicateFieldError+duplicateFieldError :: Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm Model.Name -> Typed.TypedTerm ErrorModel.DuplicateFieldError+duplicateFieldError location name =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.DuplicateFieldError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Typed.unTypedTerm location)},+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Typed.unTypedTerm name)}]}))++-- | DSL name token for hydra.core.error.model.DuplicateFieldError+duplicateFieldErrorDuplicateFieldError :: Typed.TypedName ErrorModel.DuplicateFieldError+duplicateFieldErrorDuplicateFieldError = Typed.TypedName (Model.Name "hydra.core.error.model.DuplicateFieldError")++-- | DSL accessor for the location field of hydra.core.error.model.DuplicateFieldError+duplicateFieldErrorLocation :: Typed.TypedTerm ErrorModel.DuplicateFieldError -> Typed.TypedTerm Paths.SubtermPath+duplicateFieldErrorLocation x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.DuplicateFieldError"),+ Model.projectionFieldName = (Model.Name "location")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the name field of hydra.core.error.model.DuplicateFieldError+duplicateFieldErrorName :: Typed.TypedTerm ErrorModel.DuplicateFieldError -> Typed.TypedTerm Model.Name+duplicateFieldErrorName x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.DuplicateFieldError"),+ Model.projectionFieldName = (Model.Name "name")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL updater for the location field of hydra.core.error.model.DuplicateFieldError+duplicateFieldErrorWithLocation :: Typed.TypedTerm ErrorModel.DuplicateFieldError -> Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm ErrorModel.DuplicateFieldError+duplicateFieldErrorWithLocation original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.DuplicateFieldError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.DuplicateFieldError"),+ Model.projectionFieldName = (Model.Name "name")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the name field of hydra.core.error.model.DuplicateFieldError+duplicateFieldErrorWithName :: Typed.TypedTerm ErrorModel.DuplicateFieldError -> Typed.TypedTerm Model.Name -> Typed.TypedTerm ErrorModel.DuplicateFieldError+duplicateFieldErrorWithName original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.DuplicateFieldError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.DuplicateFieldError"),+ Model.projectionFieldName = (Model.Name "location")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL constructor for hydra.core.error.model.DuplicateRecordTypeFieldNamesError+duplicateRecordTypeFieldNamesError :: Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm Model.Name -> Typed.TypedTerm ErrorModel.DuplicateRecordTypeFieldNamesError+duplicateRecordTypeFieldNamesError location name =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.DuplicateRecordTypeFieldNamesError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Typed.unTypedTerm location)},+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Typed.unTypedTerm name)}]}))++-- | DSL name token for hydra.core.error.model.DuplicateRecordTypeFieldNamesError+duplicateRecordTypeFieldNamesErrorDuplicateRecordTypeFieldNamesError :: Typed.TypedName ErrorModel.DuplicateRecordTypeFieldNamesError+duplicateRecordTypeFieldNamesErrorDuplicateRecordTypeFieldNamesError =+ Typed.TypedName (Model.Name "hydra.core.error.model.DuplicateRecordTypeFieldNamesError")++-- | DSL accessor for the location field of hydra.core.error.model.DuplicateRecordTypeFieldNamesError+duplicateRecordTypeFieldNamesErrorLocation :: Typed.TypedTerm ErrorModel.DuplicateRecordTypeFieldNamesError -> Typed.TypedTerm Paths.SubtermPath+duplicateRecordTypeFieldNamesErrorLocation x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.DuplicateRecordTypeFieldNamesError"),+ Model.projectionFieldName = (Model.Name "location")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the name field of hydra.core.error.model.DuplicateRecordTypeFieldNamesError+duplicateRecordTypeFieldNamesErrorName :: Typed.TypedTerm ErrorModel.DuplicateRecordTypeFieldNamesError -> Typed.TypedTerm Model.Name+duplicateRecordTypeFieldNamesErrorName x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.DuplicateRecordTypeFieldNamesError"),+ Model.projectionFieldName = (Model.Name "name")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL updater for the location field of hydra.core.error.model.DuplicateRecordTypeFieldNamesError+duplicateRecordTypeFieldNamesErrorWithLocation :: Typed.TypedTerm ErrorModel.DuplicateRecordTypeFieldNamesError -> Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm ErrorModel.DuplicateRecordTypeFieldNamesError+duplicateRecordTypeFieldNamesErrorWithLocation original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.DuplicateRecordTypeFieldNamesError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.DuplicateRecordTypeFieldNamesError"),+ Model.projectionFieldName = (Model.Name "name")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the name field of hydra.core.error.model.DuplicateRecordTypeFieldNamesError+duplicateRecordTypeFieldNamesErrorWithName :: Typed.TypedTerm ErrorModel.DuplicateRecordTypeFieldNamesError -> Typed.TypedTerm Model.Name -> Typed.TypedTerm ErrorModel.DuplicateRecordTypeFieldNamesError+duplicateRecordTypeFieldNamesErrorWithName original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.DuplicateRecordTypeFieldNamesError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.DuplicateRecordTypeFieldNamesError"),+ Model.projectionFieldName = (Model.Name "location")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL constructor for hydra.core.error.model.DuplicateUnionTypeFieldNamesError+duplicateUnionTypeFieldNamesError :: Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm Model.Name -> Typed.TypedTerm ErrorModel.DuplicateUnionTypeFieldNamesError+duplicateUnionTypeFieldNamesError location name =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.DuplicateUnionTypeFieldNamesError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Typed.unTypedTerm location)},+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Typed.unTypedTerm name)}]}))++-- | DSL name token for hydra.core.error.model.DuplicateUnionTypeFieldNamesError+duplicateUnionTypeFieldNamesErrorDuplicateUnionTypeFieldNamesError :: Typed.TypedName ErrorModel.DuplicateUnionTypeFieldNamesError+duplicateUnionTypeFieldNamesErrorDuplicateUnionTypeFieldNamesError =+ Typed.TypedName (Model.Name "hydra.core.error.model.DuplicateUnionTypeFieldNamesError")++-- | DSL accessor for the location field of hydra.core.error.model.DuplicateUnionTypeFieldNamesError+duplicateUnionTypeFieldNamesErrorLocation :: Typed.TypedTerm ErrorModel.DuplicateUnionTypeFieldNamesError -> Typed.TypedTerm Paths.SubtermPath+duplicateUnionTypeFieldNamesErrorLocation x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.DuplicateUnionTypeFieldNamesError"),+ Model.projectionFieldName = (Model.Name "location")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the name field of hydra.core.error.model.DuplicateUnionTypeFieldNamesError+duplicateUnionTypeFieldNamesErrorName :: Typed.TypedTerm ErrorModel.DuplicateUnionTypeFieldNamesError -> Typed.TypedTerm Model.Name+duplicateUnionTypeFieldNamesErrorName x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.DuplicateUnionTypeFieldNamesError"),+ Model.projectionFieldName = (Model.Name "name")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL updater for the location field of hydra.core.error.model.DuplicateUnionTypeFieldNamesError+duplicateUnionTypeFieldNamesErrorWithLocation :: Typed.TypedTerm ErrorModel.DuplicateUnionTypeFieldNamesError -> Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm ErrorModel.DuplicateUnionTypeFieldNamesError+duplicateUnionTypeFieldNamesErrorWithLocation original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.DuplicateUnionTypeFieldNamesError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.DuplicateUnionTypeFieldNamesError"),+ Model.projectionFieldName = (Model.Name "name")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the name field of hydra.core.error.model.DuplicateUnionTypeFieldNamesError+duplicateUnionTypeFieldNamesErrorWithName :: Typed.TypedTerm ErrorModel.DuplicateUnionTypeFieldNamesError -> Typed.TypedTerm Model.Name -> Typed.TypedTerm ErrorModel.DuplicateUnionTypeFieldNamesError+duplicateUnionTypeFieldNamesErrorWithName original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.DuplicateUnionTypeFieldNamesError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.DuplicateUnionTypeFieldNamesError"),+ Model.projectionFieldName = (Model.Name "location")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL constructor for hydra.core.error.model.EmptyCaseStatementError+emptyCaseStatementError :: Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm Model.Name -> Typed.TypedTerm ErrorModel.EmptyCaseStatementError+emptyCaseStatementError location typeName =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.EmptyCaseStatementError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Typed.unTypedTerm location)},+ Model.Field {+ Model.fieldName = (Model.Name "typeName"),+ Model.fieldTerm = (Typed.unTypedTerm typeName)}]}))++-- | DSL name token for hydra.core.error.model.EmptyCaseStatementError+emptyCaseStatementErrorEmptyCaseStatementError :: Typed.TypedName ErrorModel.EmptyCaseStatementError+emptyCaseStatementErrorEmptyCaseStatementError =+ Typed.TypedName (Model.Name "hydra.core.error.model.EmptyCaseStatementError")++-- | DSL accessor for the location field of hydra.core.error.model.EmptyCaseStatementError+emptyCaseStatementErrorLocation :: Typed.TypedTerm ErrorModel.EmptyCaseStatementError -> Typed.TypedTerm Paths.SubtermPath+emptyCaseStatementErrorLocation x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.EmptyCaseStatementError"),+ Model.projectionFieldName = (Model.Name "location")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the typeName field of hydra.core.error.model.EmptyCaseStatementError+emptyCaseStatementErrorTypeName :: Typed.TypedTerm ErrorModel.EmptyCaseStatementError -> Typed.TypedTerm Model.Name+emptyCaseStatementErrorTypeName x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.EmptyCaseStatementError"),+ Model.projectionFieldName = (Model.Name "typeName")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL updater for the location field of hydra.core.error.model.EmptyCaseStatementError+emptyCaseStatementErrorWithLocation :: Typed.TypedTerm ErrorModel.EmptyCaseStatementError -> Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm ErrorModel.EmptyCaseStatementError+emptyCaseStatementErrorWithLocation original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.EmptyCaseStatementError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "typeName"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.EmptyCaseStatementError"),+ Model.projectionFieldName = (Model.Name "typeName")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the typeName field of hydra.core.error.model.EmptyCaseStatementError+emptyCaseStatementErrorWithTypeName :: Typed.TypedTerm ErrorModel.EmptyCaseStatementError -> Typed.TypedTerm Model.Name -> Typed.TypedTerm ErrorModel.EmptyCaseStatementError+emptyCaseStatementErrorWithTypeName original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.EmptyCaseStatementError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.EmptyCaseStatementError"),+ Model.projectionFieldName = (Model.Name "location")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "typeName"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL constructor for hydra.core.error.model.EmptyLetBindingsError+emptyLetBindingsError :: Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm ErrorModel.EmptyLetBindingsError+emptyLetBindingsError location =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.EmptyLetBindingsError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Typed.unTypedTerm location)}]}))++-- | DSL name token for hydra.core.error.model.EmptyLetBindingsError+emptyLetBindingsErrorEmptyLetBindingsError :: Typed.TypedName ErrorModel.EmptyLetBindingsError+emptyLetBindingsErrorEmptyLetBindingsError = Typed.TypedName (Model.Name "hydra.core.error.model.EmptyLetBindingsError")++-- | DSL accessor for the location field of hydra.core.error.model.EmptyLetBindingsError+emptyLetBindingsErrorLocation :: Typed.TypedTerm ErrorModel.EmptyLetBindingsError -> Typed.TypedTerm Paths.SubtermPath+emptyLetBindingsErrorLocation x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.EmptyLetBindingsError"),+ Model.projectionFieldName = (Model.Name "location")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL updater for the location field of hydra.core.error.model.EmptyLetBindingsError+emptyLetBindingsErrorWithLocation :: Typed.TypedTerm ErrorModel.EmptyLetBindingsError -> Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm ErrorModel.EmptyLetBindingsError+emptyLetBindingsErrorWithLocation original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.EmptyLetBindingsError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL constructor for hydra.core.error.model.EmptyRecordTypeError+emptyRecordTypeError :: Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm ErrorModel.EmptyRecordTypeError+emptyRecordTypeError location =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.EmptyRecordTypeError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Typed.unTypedTerm location)}]}))++-- | DSL name token for hydra.core.error.model.EmptyRecordTypeError+emptyRecordTypeErrorEmptyRecordTypeError :: Typed.TypedName ErrorModel.EmptyRecordTypeError+emptyRecordTypeErrorEmptyRecordTypeError = Typed.TypedName (Model.Name "hydra.core.error.model.EmptyRecordTypeError")++-- | DSL accessor for the location field of hydra.core.error.model.EmptyRecordTypeError+emptyRecordTypeErrorLocation :: Typed.TypedTerm ErrorModel.EmptyRecordTypeError -> Typed.TypedTerm Paths.SubtermPath+emptyRecordTypeErrorLocation x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.EmptyRecordTypeError"),+ Model.projectionFieldName = (Model.Name "location")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL updater for the location field of hydra.core.error.model.EmptyRecordTypeError+emptyRecordTypeErrorWithLocation :: Typed.TypedTerm ErrorModel.EmptyRecordTypeError -> Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm ErrorModel.EmptyRecordTypeError+emptyRecordTypeErrorWithLocation original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.EmptyRecordTypeError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL constructor for hydra.core.error.model.EmptyTermAnnotationError+emptyTermAnnotationError :: Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm ErrorModel.EmptyTermAnnotationError+emptyTermAnnotationError location =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.EmptyTermAnnotationError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Typed.unTypedTerm location)}]}))++-- | DSL name token for hydra.core.error.model.EmptyTermAnnotationError+emptyTermAnnotationErrorEmptyTermAnnotationError :: Typed.TypedName ErrorModel.EmptyTermAnnotationError+emptyTermAnnotationErrorEmptyTermAnnotationError =+ Typed.TypedName (Model.Name "hydra.core.error.model.EmptyTermAnnotationError")++-- | DSL accessor for the location field of hydra.core.error.model.EmptyTermAnnotationError+emptyTermAnnotationErrorLocation :: Typed.TypedTerm ErrorModel.EmptyTermAnnotationError -> Typed.TypedTerm Paths.SubtermPath+emptyTermAnnotationErrorLocation x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.EmptyTermAnnotationError"),+ Model.projectionFieldName = (Model.Name "location")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL updater for the location field of hydra.core.error.model.EmptyTermAnnotationError+emptyTermAnnotationErrorWithLocation :: Typed.TypedTerm ErrorModel.EmptyTermAnnotationError -> Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm ErrorModel.EmptyTermAnnotationError+emptyTermAnnotationErrorWithLocation original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.EmptyTermAnnotationError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL constructor for hydra.core.error.model.EmptyTypeAnnotationError+emptyTypeAnnotationError :: Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm ErrorModel.EmptyTypeAnnotationError+emptyTypeAnnotationError location =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.EmptyTypeAnnotationError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Typed.unTypedTerm location)}]}))++-- | DSL name token for hydra.core.error.model.EmptyTypeAnnotationError+emptyTypeAnnotationErrorEmptyTypeAnnotationError :: Typed.TypedName ErrorModel.EmptyTypeAnnotationError+emptyTypeAnnotationErrorEmptyTypeAnnotationError =+ Typed.TypedName (Model.Name "hydra.core.error.model.EmptyTypeAnnotationError")++-- | DSL accessor for the location field of hydra.core.error.model.EmptyTypeAnnotationError+emptyTypeAnnotationErrorLocation :: Typed.TypedTerm ErrorModel.EmptyTypeAnnotationError -> Typed.TypedTerm Paths.SubtermPath+emptyTypeAnnotationErrorLocation x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.EmptyTypeAnnotationError"),+ Model.projectionFieldName = (Model.Name "location")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL updater for the location field of hydra.core.error.model.EmptyTypeAnnotationError+emptyTypeAnnotationErrorWithLocation :: Typed.TypedTerm ErrorModel.EmptyTypeAnnotationError -> Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm ErrorModel.EmptyTypeAnnotationError+emptyTypeAnnotationErrorWithLocation original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.EmptyTypeAnnotationError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL constructor for hydra.core.error.model.EmptyTypeNameInTermError+emptyTypeNameInTermError :: Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm ErrorModel.EmptyTypeNameInTermError+emptyTypeNameInTermError location =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.EmptyTypeNameInTermError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Typed.unTypedTerm location)}]}))++-- | DSL name token for hydra.core.error.model.EmptyTypeNameInTermError+emptyTypeNameInTermErrorEmptyTypeNameInTermError :: Typed.TypedName ErrorModel.EmptyTypeNameInTermError+emptyTypeNameInTermErrorEmptyTypeNameInTermError =+ Typed.TypedName (Model.Name "hydra.core.error.model.EmptyTypeNameInTermError")++-- | DSL accessor for the location field of hydra.core.error.model.EmptyTypeNameInTermError+emptyTypeNameInTermErrorLocation :: Typed.TypedTerm ErrorModel.EmptyTypeNameInTermError -> Typed.TypedTerm Paths.SubtermPath+emptyTypeNameInTermErrorLocation x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.EmptyTypeNameInTermError"),+ Model.projectionFieldName = (Model.Name "location")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL updater for the location field of hydra.core.error.model.EmptyTypeNameInTermError+emptyTypeNameInTermErrorWithLocation :: Typed.TypedTerm ErrorModel.EmptyTypeNameInTermError -> Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm ErrorModel.EmptyTypeNameInTermError+emptyTypeNameInTermErrorWithLocation original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.EmptyTypeNameInTermError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL constructor for hydra.core.error.model.EmptyUnionTypeError+emptyUnionTypeError :: Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm ErrorModel.EmptyUnionTypeError+emptyUnionTypeError location =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.EmptyUnionTypeError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Typed.unTypedTerm location)}]}))++-- | DSL name token for hydra.core.error.model.EmptyUnionTypeError+emptyUnionTypeErrorEmptyUnionTypeError :: Typed.TypedName ErrorModel.EmptyUnionTypeError+emptyUnionTypeErrorEmptyUnionTypeError = Typed.TypedName (Model.Name "hydra.core.error.model.EmptyUnionTypeError")++-- | DSL accessor for the location field of hydra.core.error.model.EmptyUnionTypeError+emptyUnionTypeErrorLocation :: Typed.TypedTerm ErrorModel.EmptyUnionTypeError -> Typed.TypedTerm Paths.SubtermPath+emptyUnionTypeErrorLocation x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.EmptyUnionTypeError"),+ Model.projectionFieldName = (Model.Name "location")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL updater for the location field of hydra.core.error.model.EmptyUnionTypeError+emptyUnionTypeErrorWithLocation :: Typed.TypedTerm ErrorModel.EmptyUnionTypeError -> Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm ErrorModel.EmptyUnionTypeError+emptyUnionTypeErrorWithLocation original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.EmptyUnionTypeError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL constructor for hydra.core.error.model.ExtraRecordFieldsError+extraRecordFieldsError :: Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm Model.Name -> Typed.TypedTerm [Model.Name] -> Typed.TypedTerm ErrorModel.ExtraRecordFieldsError+extraRecordFieldsError location typeName fieldNames =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.ExtraRecordFieldsError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Typed.unTypedTerm location)},+ Model.Field {+ Model.fieldName = (Model.Name "typeName"),+ Model.fieldTerm = (Typed.unTypedTerm typeName)},+ Model.Field {+ Model.fieldName = (Model.Name "fieldNames"),+ Model.fieldTerm = (Typed.unTypedTerm fieldNames)}]}))++-- | DSL name token for hydra.core.error.model.ExtraRecordFieldsError+extraRecordFieldsErrorExtraRecordFieldsError :: Typed.TypedName ErrorModel.ExtraRecordFieldsError+extraRecordFieldsErrorExtraRecordFieldsError =+ Typed.TypedName (Model.Name "hydra.core.error.model.ExtraRecordFieldsError")++-- | DSL accessor for the fieldNames field of hydra.core.error.model.ExtraRecordFieldsError+extraRecordFieldsErrorFieldNames :: Typed.TypedTerm ErrorModel.ExtraRecordFieldsError -> Typed.TypedTerm [Model.Name]+extraRecordFieldsErrorFieldNames x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.ExtraRecordFieldsError"),+ Model.projectionFieldName = (Model.Name "fieldNames")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the location field of hydra.core.error.model.ExtraRecordFieldsError+extraRecordFieldsErrorLocation :: Typed.TypedTerm ErrorModel.ExtraRecordFieldsError -> Typed.TypedTerm Paths.SubtermPath+extraRecordFieldsErrorLocation x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.ExtraRecordFieldsError"),+ Model.projectionFieldName = (Model.Name "location")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the typeName field of hydra.core.error.model.ExtraRecordFieldsError+extraRecordFieldsErrorTypeName :: Typed.TypedTerm ErrorModel.ExtraRecordFieldsError -> Typed.TypedTerm Model.Name+extraRecordFieldsErrorTypeName x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.ExtraRecordFieldsError"),+ Model.projectionFieldName = (Model.Name "typeName")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL updater for the fieldNames field of hydra.core.error.model.ExtraRecordFieldsError+extraRecordFieldsErrorWithFieldNames :: Typed.TypedTerm ErrorModel.ExtraRecordFieldsError -> Typed.TypedTerm [Model.Name] -> Typed.TypedTerm ErrorModel.ExtraRecordFieldsError+extraRecordFieldsErrorWithFieldNames original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.ExtraRecordFieldsError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.ExtraRecordFieldsError"),+ Model.projectionFieldName = (Model.Name "location")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "typeName"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.ExtraRecordFieldsError"),+ Model.projectionFieldName = (Model.Name "typeName")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "fieldNames"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL updater for the location field of hydra.core.error.model.ExtraRecordFieldsError+extraRecordFieldsErrorWithLocation :: Typed.TypedTerm ErrorModel.ExtraRecordFieldsError -> Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm ErrorModel.ExtraRecordFieldsError+extraRecordFieldsErrorWithLocation original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.ExtraRecordFieldsError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "typeName"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.ExtraRecordFieldsError"),+ Model.projectionFieldName = (Model.Name "typeName")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "fieldNames"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.ExtraRecordFieldsError"),+ Model.projectionFieldName = (Model.Name "fieldNames")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the typeName field of hydra.core.error.model.ExtraRecordFieldsError+extraRecordFieldsErrorWithTypeName :: Typed.TypedTerm ErrorModel.ExtraRecordFieldsError -> Typed.TypedTerm Model.Name -> Typed.TypedTerm ErrorModel.ExtraRecordFieldsError+extraRecordFieldsErrorWithTypeName original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.ExtraRecordFieldsError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.ExtraRecordFieldsError"),+ Model.projectionFieldName = (Model.Name "location")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "typeName"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "fieldNames"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.ExtraRecordFieldsError"),+ Model.projectionFieldName = (Model.Name "fieldNames")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL constructor for hydra.core.error.model.InvalidForallParameterNameError+invalidForallParameterNameError :: Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm Model.Name -> Typed.TypedTerm ErrorModel.InvalidForallParameterNameError+invalidForallParameterNameError location name =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.InvalidForallParameterNameError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Typed.unTypedTerm location)},+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Typed.unTypedTerm name)}]}))++-- | DSL name token for hydra.core.error.model.InvalidForallParameterNameError+invalidForallParameterNameErrorInvalidForallParameterNameError :: Typed.TypedName ErrorModel.InvalidForallParameterNameError+invalidForallParameterNameErrorInvalidForallParameterNameError =+ Typed.TypedName (Model.Name "hydra.core.error.model.InvalidForallParameterNameError")++-- | DSL accessor for the location field of hydra.core.error.model.InvalidForallParameterNameError+invalidForallParameterNameErrorLocation :: Typed.TypedTerm ErrorModel.InvalidForallParameterNameError -> Typed.TypedTerm Paths.SubtermPath+invalidForallParameterNameErrorLocation x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.InvalidForallParameterNameError"),+ Model.projectionFieldName = (Model.Name "location")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the name field of hydra.core.error.model.InvalidForallParameterNameError+invalidForallParameterNameErrorName :: Typed.TypedTerm ErrorModel.InvalidForallParameterNameError -> Typed.TypedTerm Model.Name+invalidForallParameterNameErrorName x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.InvalidForallParameterNameError"),+ Model.projectionFieldName = (Model.Name "name")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL updater for the location field of hydra.core.error.model.InvalidForallParameterNameError+invalidForallParameterNameErrorWithLocation :: Typed.TypedTerm ErrorModel.InvalidForallParameterNameError -> Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm ErrorModel.InvalidForallParameterNameError+invalidForallParameterNameErrorWithLocation original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.InvalidForallParameterNameError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.InvalidForallParameterNameError"),+ Model.projectionFieldName = (Model.Name "name")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the name field of hydra.core.error.model.InvalidForallParameterNameError+invalidForallParameterNameErrorWithName :: Typed.TypedTerm ErrorModel.InvalidForallParameterNameError -> Typed.TypedTerm Model.Name -> Typed.TypedTerm ErrorModel.InvalidForallParameterNameError+invalidForallParameterNameErrorWithName original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.InvalidForallParameterNameError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.InvalidForallParameterNameError"),+ Model.projectionFieldName = (Model.Name "location")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL constructor for hydra.core.error.model.InvalidLambdaParameterNameError+invalidLambdaParameterNameError :: Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm Model.Name -> Typed.TypedTerm ErrorModel.InvalidLambdaParameterNameError+invalidLambdaParameterNameError location name =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.InvalidLambdaParameterNameError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Typed.unTypedTerm location)},+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Typed.unTypedTerm name)}]}))++-- | DSL name token for hydra.core.error.model.InvalidLambdaParameterNameError+invalidLambdaParameterNameErrorInvalidLambdaParameterNameError :: Typed.TypedName ErrorModel.InvalidLambdaParameterNameError+invalidLambdaParameterNameErrorInvalidLambdaParameterNameError =+ Typed.TypedName (Model.Name "hydra.core.error.model.InvalidLambdaParameterNameError")++-- | DSL accessor for the location field of hydra.core.error.model.InvalidLambdaParameterNameError+invalidLambdaParameterNameErrorLocation :: Typed.TypedTerm ErrorModel.InvalidLambdaParameterNameError -> Typed.TypedTerm Paths.SubtermPath+invalidLambdaParameterNameErrorLocation x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.InvalidLambdaParameterNameError"),+ Model.projectionFieldName = (Model.Name "location")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the name field of hydra.core.error.model.InvalidLambdaParameterNameError+invalidLambdaParameterNameErrorName :: Typed.TypedTerm ErrorModel.InvalidLambdaParameterNameError -> Typed.TypedTerm Model.Name+invalidLambdaParameterNameErrorName x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.InvalidLambdaParameterNameError"),+ Model.projectionFieldName = (Model.Name "name")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL updater for the location field of hydra.core.error.model.InvalidLambdaParameterNameError+invalidLambdaParameterNameErrorWithLocation :: Typed.TypedTerm ErrorModel.InvalidLambdaParameterNameError -> Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm ErrorModel.InvalidLambdaParameterNameError+invalidLambdaParameterNameErrorWithLocation original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.InvalidLambdaParameterNameError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.InvalidLambdaParameterNameError"),+ Model.projectionFieldName = (Model.Name "name")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the name field of hydra.core.error.model.InvalidLambdaParameterNameError+invalidLambdaParameterNameErrorWithName :: Typed.TypedTerm ErrorModel.InvalidLambdaParameterNameError -> Typed.TypedTerm Model.Name -> Typed.TypedTerm ErrorModel.InvalidLambdaParameterNameError+invalidLambdaParameterNameErrorWithName original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.InvalidLambdaParameterNameError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.InvalidLambdaParameterNameError"),+ Model.projectionFieldName = (Model.Name "location")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL constructor for hydra.core.error.model.InvalidLetBindingNameError+invalidLetBindingNameError :: Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm Model.Name -> Typed.TypedTerm ErrorModel.InvalidLetBindingNameError+invalidLetBindingNameError location name =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.InvalidLetBindingNameError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Typed.unTypedTerm location)},+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Typed.unTypedTerm name)}]}))++-- | DSL name token for hydra.core.error.model.InvalidLetBindingNameError+invalidLetBindingNameErrorInvalidLetBindingNameError :: Typed.TypedName ErrorModel.InvalidLetBindingNameError+invalidLetBindingNameErrorInvalidLetBindingNameError =+ Typed.TypedName (Model.Name "hydra.core.error.model.InvalidLetBindingNameError")++-- | DSL accessor for the location field of hydra.core.error.model.InvalidLetBindingNameError+invalidLetBindingNameErrorLocation :: Typed.TypedTerm ErrorModel.InvalidLetBindingNameError -> Typed.TypedTerm Paths.SubtermPath+invalidLetBindingNameErrorLocation x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.InvalidLetBindingNameError"),+ Model.projectionFieldName = (Model.Name "location")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the name field of hydra.core.error.model.InvalidLetBindingNameError+invalidLetBindingNameErrorName :: Typed.TypedTerm ErrorModel.InvalidLetBindingNameError -> Typed.TypedTerm Model.Name+invalidLetBindingNameErrorName x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.InvalidLetBindingNameError"),+ Model.projectionFieldName = (Model.Name "name")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL updater for the location field of hydra.core.error.model.InvalidLetBindingNameError+invalidLetBindingNameErrorWithLocation :: Typed.TypedTerm ErrorModel.InvalidLetBindingNameError -> Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm ErrorModel.InvalidLetBindingNameError+invalidLetBindingNameErrorWithLocation original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.InvalidLetBindingNameError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.InvalidLetBindingNameError"),+ Model.projectionFieldName = (Model.Name "name")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the name field of hydra.core.error.model.InvalidLetBindingNameError+invalidLetBindingNameErrorWithName :: Typed.TypedTerm ErrorModel.InvalidLetBindingNameError -> Typed.TypedTerm Model.Name -> Typed.TypedTerm ErrorModel.InvalidLetBindingNameError+invalidLetBindingNameErrorWithName original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.InvalidLetBindingNameError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.InvalidLetBindingNameError"),+ Model.projectionFieldName = (Model.Name "location")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL name token for hydra.core.error.model.InvalidLiteralError+invalidLiteralErrorInvalidLiteralError :: Typed.TypedName ErrorModel.InvalidLiteralError+invalidLiteralErrorInvalidLiteralError = Typed.TypedName (Model.Name "hydra.core.error.model.InvalidLiteralError")++-- | DSL injection for the typeMismatch variant of hydra.core.error.model.InvalidLiteralError+invalidLiteralErrorTypeMismatch :: Typed.TypedTerm ErrorModel.LiteralTypeMismatchError -> Typed.TypedTerm ErrorModel.InvalidLiteralError+invalidLiteralErrorTypeMismatch x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.model.InvalidLiteralError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "typeMismatch"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the constantCondition variant of hydra.core.error.model.InvalidTermError+invalidTermErrorConstantCondition :: Typed.TypedTerm ErrorModel.ConstantConditionError -> Typed.TypedTerm ErrorModel.InvalidTermError+invalidTermErrorConstantCondition x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.model.InvalidTermError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "constantCondition"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the duplicateBinding variant of hydra.core.error.model.InvalidTermError+invalidTermErrorDuplicateBinding :: Typed.TypedTerm ErrorModel.DuplicateBindingError -> Typed.TypedTerm ErrorModel.InvalidTermError+invalidTermErrorDuplicateBinding x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.model.InvalidTermError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "duplicateBinding"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the duplicateField variant of hydra.core.error.model.InvalidTermError+invalidTermErrorDuplicateField :: Typed.TypedTerm ErrorModel.DuplicateFieldError -> Typed.TypedTerm ErrorModel.InvalidTermError+invalidTermErrorDuplicateField x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.model.InvalidTermError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "duplicateField"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the emptyCaseStatement variant of hydra.core.error.model.InvalidTermError+invalidTermErrorEmptyCaseStatement :: Typed.TypedTerm ErrorModel.EmptyCaseStatementError -> Typed.TypedTerm ErrorModel.InvalidTermError+invalidTermErrorEmptyCaseStatement x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.model.InvalidTermError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "emptyCaseStatement"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the emptyLetBindings variant of hydra.core.error.model.InvalidTermError+invalidTermErrorEmptyLetBindings :: Typed.TypedTerm ErrorModel.EmptyLetBindingsError -> Typed.TypedTerm ErrorModel.InvalidTermError+invalidTermErrorEmptyLetBindings x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.model.InvalidTermError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "emptyLetBindings"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the emptyTermAnnotation variant of hydra.core.error.model.InvalidTermError+invalidTermErrorEmptyTermAnnotation :: Typed.TypedTerm ErrorModel.EmptyTermAnnotationError -> Typed.TypedTerm ErrorModel.InvalidTermError+invalidTermErrorEmptyTermAnnotation x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.model.InvalidTermError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "emptyTermAnnotation"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the emptyTypeNameInTerm variant of hydra.core.error.model.InvalidTermError+invalidTermErrorEmptyTypeNameInTerm :: Typed.TypedTerm ErrorModel.EmptyTypeNameInTermError -> Typed.TypedTerm ErrorModel.InvalidTermError+invalidTermErrorEmptyTypeNameInTerm x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.model.InvalidTermError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "emptyTypeNameInTerm"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the extraRecordFields variant of hydra.core.error.model.InvalidTermError+invalidTermErrorExtraRecordFields :: Typed.TypedTerm ErrorModel.ExtraRecordFieldsError -> Typed.TypedTerm ErrorModel.InvalidTermError+invalidTermErrorExtraRecordFields x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.model.InvalidTermError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "extraRecordFields"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the invalidLambdaParameterName variant of hydra.core.error.model.InvalidTermError+invalidTermErrorInvalidLambdaParameterName :: Typed.TypedTerm ErrorModel.InvalidLambdaParameterNameError -> Typed.TypedTerm ErrorModel.InvalidTermError+invalidTermErrorInvalidLambdaParameterName x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.model.InvalidTermError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "invalidLambdaParameterName"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the invalidLetBindingName variant of hydra.core.error.model.InvalidTermError+invalidTermErrorInvalidLetBindingName :: Typed.TypedTerm ErrorModel.InvalidLetBindingNameError -> Typed.TypedTerm ErrorModel.InvalidTermError+invalidTermErrorInvalidLetBindingName x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.model.InvalidTermError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "invalidLetBindingName"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL name token for hydra.core.error.model.InvalidTermError+invalidTermErrorInvalidTermError :: Typed.TypedName ErrorModel.InvalidTermError+invalidTermErrorInvalidTermError = Typed.TypedName (Model.Name "hydra.core.error.model.InvalidTermError")++-- | DSL injection for the invalidTypeLambdaParameterName variant of hydra.core.error.model.InvalidTermError+invalidTermErrorInvalidTypeLambdaParameterName :: Typed.TypedTerm ErrorModel.InvalidTypeLambdaParameterNameError -> Typed.TypedTerm ErrorModel.InvalidTermError+invalidTermErrorInvalidTypeLambdaParameterName x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.model.InvalidTermError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "invalidTypeLambdaParameterName"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the missingCaseBranches variant of hydra.core.error.model.InvalidTermError+invalidTermErrorMissingCaseBranches :: Typed.TypedTerm ErrorModel.MissingCaseBranchesError -> Typed.TypedTerm ErrorModel.InvalidTermError+invalidTermErrorMissingCaseBranches x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.model.InvalidTermError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "missingCaseBranches"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the missingRecordFields variant of hydra.core.error.model.InvalidTermError+invalidTermErrorMissingRecordFields :: Typed.TypedTerm ErrorModel.MissingRecordFieldsError -> Typed.TypedTerm ErrorModel.InvalidTermError+invalidTermErrorMissingRecordFields x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.model.InvalidTermError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "missingRecordFields"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the nestedTermAnnotation variant of hydra.core.error.model.InvalidTermError+invalidTermErrorNestedTermAnnotation :: Typed.TypedTerm ErrorModel.NestedTermAnnotationError -> Typed.TypedTerm ErrorModel.InvalidTermError+invalidTermErrorNestedTermAnnotation x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.model.InvalidTermError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "nestedTermAnnotation"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the nominalTypeKindMismatch variant of hydra.core.error.model.InvalidTermError+invalidTermErrorNominalTypeKindMismatch :: Typed.TypedTerm ErrorModel.NominalTypeKindMismatchError -> Typed.TypedTerm ErrorModel.InvalidTermError+invalidTermErrorNominalTypeKindMismatch x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.model.InvalidTermError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "nominalTypeKindMismatch"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the redundantWrapUnwrap variant of hydra.core.error.model.InvalidTermError+invalidTermErrorRedundantWrapUnwrap :: Typed.TypedTerm ErrorModel.RedundantWrapUnwrapError -> Typed.TypedTerm ErrorModel.InvalidTermError+invalidTermErrorRedundantWrapUnwrap x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.model.InvalidTermError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "redundantWrapUnwrap"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the selfApplication variant of hydra.core.error.model.InvalidTermError+invalidTermErrorSelfApplication :: Typed.TypedTerm ErrorModel.SelfApplicationError -> Typed.TypedTerm ErrorModel.InvalidTermError+invalidTermErrorSelfApplication x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.model.InvalidTermError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "selfApplication"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the termVariableShadowing variant of hydra.core.error.model.InvalidTermError+invalidTermErrorTermVariableShadowing :: Typed.TypedTerm ErrorModel.TermVariableShadowingError -> Typed.TypedTerm ErrorModel.InvalidTermError+invalidTermErrorTermVariableShadowing x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.model.InvalidTermError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "termVariableShadowing"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the typeVariableShadowingInTypeLambda variant of hydra.core.error.model.InvalidTermError+invalidTermErrorTypeVariableShadowingInTypeLambda :: Typed.TypedTerm ErrorModel.TypeVariableShadowingInTypeLambdaError -> Typed.TypedTerm ErrorModel.InvalidTermError+invalidTermErrorTypeVariableShadowingInTypeLambda x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.model.InvalidTermError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "typeVariableShadowingInTypeLambda"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the undeclaredVariant variant of hydra.core.error.model.InvalidTermError+invalidTermErrorUndeclaredVariant :: Typed.TypedTerm ErrorModel.UndeclaredVariantError -> Typed.TypedTerm ErrorModel.InvalidTermError+invalidTermErrorUndeclaredVariant x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.model.InvalidTermError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "undeclaredVariant"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the undefinedTermVariable variant of hydra.core.error.model.InvalidTermError+invalidTermErrorUndefinedTermVariable :: Typed.TypedTerm ErrorModel.UndefinedTermVariableError -> Typed.TypedTerm ErrorModel.InvalidTermError+invalidTermErrorUndefinedTermVariable x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.model.InvalidTermError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "undefinedTermVariable"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the undefinedTypeVariableInBindingType variant of hydra.core.error.model.InvalidTermError+invalidTermErrorUndefinedTypeVariableInBindingType :: Typed.TypedTerm ErrorModel.UndefinedTypeVariableInBindingTypeError -> Typed.TypedTerm ErrorModel.InvalidTermError+invalidTermErrorUndefinedTypeVariableInBindingType x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.model.InvalidTermError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "undefinedTypeVariableInBindingType"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the undefinedTypeVariableInLambdaDomain variant of hydra.core.error.model.InvalidTermError+invalidTermErrorUndefinedTypeVariableInLambdaDomain :: Typed.TypedTerm ErrorModel.UndefinedTypeVariableInLambdaDomainError -> Typed.TypedTerm ErrorModel.InvalidTermError+invalidTermErrorUndefinedTypeVariableInLambdaDomain x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.model.InvalidTermError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "undefinedTypeVariableInLambdaDomain"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the undefinedTypeVariableInTypeApplication variant of hydra.core.error.model.InvalidTermError+invalidTermErrorUndefinedTypeVariableInTypeApplication :: Typed.TypedTerm ErrorModel.UndefinedTypeVariableInTypeApplicationError -> Typed.TypedTerm ErrorModel.InvalidTermError+invalidTermErrorUndefinedTypeVariableInTypeApplication x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.model.InvalidTermError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "undefinedTypeVariableInTypeApplication"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the unknownCaseAlternative variant of hydra.core.error.model.InvalidTermError+invalidTermErrorUnknownCaseAlternative :: Typed.TypedTerm ErrorModel.UnknownCaseAlternativeError -> Typed.TypedTerm ErrorModel.InvalidTermError+invalidTermErrorUnknownCaseAlternative x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.model.InvalidTermError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "unknownCaseAlternative"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the unknownPrimitiveName variant of hydra.core.error.model.InvalidTermError+invalidTermErrorUnknownPrimitiveName :: Typed.TypedTerm ErrorModel.UnknownPrimitiveNameError -> Typed.TypedTerm ErrorModel.InvalidTermError+invalidTermErrorUnknownPrimitiveName x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.model.InvalidTermError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "unknownPrimitiveName"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the unknownProjectedField variant of hydra.core.error.model.InvalidTermError+invalidTermErrorUnknownProjectedField :: Typed.TypedTerm ErrorModel.UnknownProjectedFieldError -> Typed.TypedTerm ErrorModel.InvalidTermError+invalidTermErrorUnknownProjectedField x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.model.InvalidTermError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "unknownProjectedField"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the unnecessaryIdentityApplication variant of hydra.core.error.model.InvalidTermError+invalidTermErrorUnnecessaryIdentityApplication :: Typed.TypedTerm ErrorModel.UnnecessaryIdentityApplicationError -> Typed.TypedTerm ErrorModel.InvalidTermError+invalidTermErrorUnnecessaryIdentityApplication x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.model.InvalidTermError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "unnecessaryIdentityApplication"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the unresolvedNominalType variant of hydra.core.error.model.InvalidTermError+invalidTermErrorUnresolvedNominalType :: Typed.TypedTerm ErrorModel.UnresolvedNominalTypeError -> Typed.TypedTerm ErrorModel.InvalidTermError+invalidTermErrorUnresolvedNominalType x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.model.InvalidTermError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "unresolvedNominalType"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the untypedTermVariable variant of hydra.core.error.model.InvalidTermError+invalidTermErrorUntypedTermVariable :: Typed.TypedTerm ErrorModel.UntypedTermVariableError -> Typed.TypedTerm ErrorModel.InvalidTermError+invalidTermErrorUntypedTermVariable x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.model.InvalidTermError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "untypedTermVariable"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the duplicateRecordTypeFieldNames variant of hydra.core.error.model.InvalidTypeError+invalidTypeErrorDuplicateRecordTypeFieldNames :: Typed.TypedTerm ErrorModel.DuplicateRecordTypeFieldNamesError -> Typed.TypedTerm ErrorModel.InvalidTypeError+invalidTypeErrorDuplicateRecordTypeFieldNames x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.model.InvalidTypeError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "duplicateRecordTypeFieldNames"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the duplicateUnionTypeFieldNames variant of hydra.core.error.model.InvalidTypeError+invalidTypeErrorDuplicateUnionTypeFieldNames :: Typed.TypedTerm ErrorModel.DuplicateUnionTypeFieldNamesError -> Typed.TypedTerm ErrorModel.InvalidTypeError+invalidTypeErrorDuplicateUnionTypeFieldNames x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.model.InvalidTypeError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "duplicateUnionTypeFieldNames"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the emptyRecordType variant of hydra.core.error.model.InvalidTypeError+invalidTypeErrorEmptyRecordType :: Typed.TypedTerm ErrorModel.EmptyRecordTypeError -> Typed.TypedTerm ErrorModel.InvalidTypeError+invalidTypeErrorEmptyRecordType x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.model.InvalidTypeError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "emptyRecordType"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the emptyTypeAnnotation variant of hydra.core.error.model.InvalidTypeError+invalidTypeErrorEmptyTypeAnnotation :: Typed.TypedTerm ErrorModel.EmptyTypeAnnotationError -> Typed.TypedTerm ErrorModel.InvalidTypeError+invalidTypeErrorEmptyTypeAnnotation x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.model.InvalidTypeError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "emptyTypeAnnotation"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the emptyUnionType variant of hydra.core.error.model.InvalidTypeError+invalidTypeErrorEmptyUnionType :: Typed.TypedTerm ErrorModel.EmptyUnionTypeError -> Typed.TypedTerm ErrorModel.InvalidTypeError+invalidTypeErrorEmptyUnionType x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.model.InvalidTypeError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "emptyUnionType"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the invalidForallParameterName variant of hydra.core.error.model.InvalidTypeError+invalidTypeErrorInvalidForallParameterName :: Typed.TypedTerm ErrorModel.InvalidForallParameterNameError -> Typed.TypedTerm ErrorModel.InvalidTypeError+invalidTypeErrorInvalidForallParameterName x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.model.InvalidTypeError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "invalidForallParameterName"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL name token for hydra.core.error.model.InvalidTypeError+invalidTypeErrorInvalidTypeError :: Typed.TypedName ErrorModel.InvalidTypeError+invalidTypeErrorInvalidTypeError = Typed.TypedName (Model.Name "hydra.core.error.model.InvalidTypeError")++-- | DSL injection for the invalidTypeSchemeVariableName variant of hydra.core.error.model.InvalidTypeError+invalidTypeErrorInvalidTypeSchemeVariableName :: Typed.TypedTerm ErrorModel.InvalidTypeSchemeVariableNameError -> Typed.TypedTerm ErrorModel.InvalidTypeError+invalidTypeErrorInvalidTypeSchemeVariableName x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.model.InvalidTypeError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "invalidTypeSchemeVariableName"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the nestedTypeAnnotation variant of hydra.core.error.model.InvalidTypeError+invalidTypeErrorNestedTypeAnnotation :: Typed.TypedTerm ErrorModel.NestedTypeAnnotationError -> Typed.TypedTerm ErrorModel.InvalidTypeError+invalidTypeErrorNestedTypeAnnotation x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.model.InvalidTypeError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "nestedTypeAnnotation"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the nonComparableMapKeyType variant of hydra.core.error.model.InvalidTypeError+invalidTypeErrorNonComparableMapKeyType :: Typed.TypedTerm ErrorModel.NonComparableMapKeyTypeError -> Typed.TypedTerm ErrorModel.InvalidTypeError+invalidTypeErrorNonComparableMapKeyType x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.model.InvalidTypeError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "nonComparableMapKeyType"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the nonComparableSetElementType variant of hydra.core.error.model.InvalidTypeError+invalidTypeErrorNonComparableSetElementType :: Typed.TypedTerm ErrorModel.NonComparableSetElementTypeError -> Typed.TypedTerm ErrorModel.InvalidTypeError+invalidTypeErrorNonComparableSetElementType x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.model.InvalidTypeError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "nonComparableSetElementType"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the singleVariantUnion variant of hydra.core.error.model.InvalidTypeError+invalidTypeErrorSingleVariantUnion :: Typed.TypedTerm ErrorModel.SingleVariantUnionError -> Typed.TypedTerm ErrorModel.InvalidTypeError+invalidTypeErrorSingleVariantUnion x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.model.InvalidTypeError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "singleVariantUnion"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the typeVariableShadowingInForall variant of hydra.core.error.model.InvalidTypeError+invalidTypeErrorTypeVariableShadowingInForall :: Typed.TypedTerm ErrorModel.TypeVariableShadowingInForallError -> Typed.TypedTerm ErrorModel.InvalidTypeError+invalidTypeErrorTypeVariableShadowingInForall x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.model.InvalidTypeError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "typeVariableShadowingInForall"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the undefinedTypeVariable variant of hydra.core.error.model.InvalidTypeError+invalidTypeErrorUndefinedTypeVariable :: Typed.TypedTerm ErrorModel.UndefinedTypeVariableError -> Typed.TypedTerm ErrorModel.InvalidTypeError+invalidTypeErrorUndefinedTypeVariable x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.model.InvalidTypeError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "undefinedTypeVariable"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the voidInNonBottomPosition variant of hydra.core.error.model.InvalidTypeError+invalidTypeErrorVoidInNonBottomPosition :: Typed.TypedTerm ErrorModel.VoidInNonBottomPositionError -> Typed.TypedTerm ErrorModel.InvalidTypeError+invalidTypeErrorVoidInNonBottomPosition x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.model.InvalidTypeError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "voidInNonBottomPosition"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL constructor for hydra.core.error.model.InvalidTypeLambdaParameterNameError+invalidTypeLambdaParameterNameError :: Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm Model.Name -> Typed.TypedTerm ErrorModel.InvalidTypeLambdaParameterNameError+invalidTypeLambdaParameterNameError location name =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.InvalidTypeLambdaParameterNameError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Typed.unTypedTerm location)},+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Typed.unTypedTerm name)}]}))++-- | DSL name token for hydra.core.error.model.InvalidTypeLambdaParameterNameError+invalidTypeLambdaParameterNameErrorInvalidTypeLambdaParameterNameError :: Typed.TypedName ErrorModel.InvalidTypeLambdaParameterNameError+invalidTypeLambdaParameterNameErrorInvalidTypeLambdaParameterNameError =+ Typed.TypedName (Model.Name "hydra.core.error.model.InvalidTypeLambdaParameterNameError")++-- | DSL accessor for the location field of hydra.core.error.model.InvalidTypeLambdaParameterNameError+invalidTypeLambdaParameterNameErrorLocation :: Typed.TypedTerm ErrorModel.InvalidTypeLambdaParameterNameError -> Typed.TypedTerm Paths.SubtermPath+invalidTypeLambdaParameterNameErrorLocation x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.InvalidTypeLambdaParameterNameError"),+ Model.projectionFieldName = (Model.Name "location")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the name field of hydra.core.error.model.InvalidTypeLambdaParameterNameError+invalidTypeLambdaParameterNameErrorName :: Typed.TypedTerm ErrorModel.InvalidTypeLambdaParameterNameError -> Typed.TypedTerm Model.Name+invalidTypeLambdaParameterNameErrorName x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.InvalidTypeLambdaParameterNameError"),+ Model.projectionFieldName = (Model.Name "name")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL updater for the location field of hydra.core.error.model.InvalidTypeLambdaParameterNameError+invalidTypeLambdaParameterNameErrorWithLocation :: Typed.TypedTerm ErrorModel.InvalidTypeLambdaParameterNameError -> Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm ErrorModel.InvalidTypeLambdaParameterNameError+invalidTypeLambdaParameterNameErrorWithLocation original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.InvalidTypeLambdaParameterNameError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.InvalidTypeLambdaParameterNameError"),+ Model.projectionFieldName = (Model.Name "name")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the name field of hydra.core.error.model.InvalidTypeLambdaParameterNameError+invalidTypeLambdaParameterNameErrorWithName :: Typed.TypedTerm ErrorModel.InvalidTypeLambdaParameterNameError -> Typed.TypedTerm Model.Name -> Typed.TypedTerm ErrorModel.InvalidTypeLambdaParameterNameError+invalidTypeLambdaParameterNameErrorWithName original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.InvalidTypeLambdaParameterNameError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.InvalidTypeLambdaParameterNameError"),+ Model.projectionFieldName = (Model.Name "location")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL constructor for hydra.core.error.model.InvalidTypeSchemeVariableNameError+invalidTypeSchemeVariableNameError :: Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm Model.Name -> Typed.TypedTerm ErrorModel.InvalidTypeSchemeVariableNameError+invalidTypeSchemeVariableNameError location name =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.InvalidTypeSchemeVariableNameError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Typed.unTypedTerm location)},+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Typed.unTypedTerm name)}]}))++-- | DSL name token for hydra.core.error.model.InvalidTypeSchemeVariableNameError+invalidTypeSchemeVariableNameErrorInvalidTypeSchemeVariableNameError :: Typed.TypedName ErrorModel.InvalidTypeSchemeVariableNameError+invalidTypeSchemeVariableNameErrorInvalidTypeSchemeVariableNameError =+ Typed.TypedName (Model.Name "hydra.core.error.model.InvalidTypeSchemeVariableNameError")++-- | DSL accessor for the location field of hydra.core.error.model.InvalidTypeSchemeVariableNameError+invalidTypeSchemeVariableNameErrorLocation :: Typed.TypedTerm ErrorModel.InvalidTypeSchemeVariableNameError -> Typed.TypedTerm Paths.SubtermPath+invalidTypeSchemeVariableNameErrorLocation x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.InvalidTypeSchemeVariableNameError"),+ Model.projectionFieldName = (Model.Name "location")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the name field of hydra.core.error.model.InvalidTypeSchemeVariableNameError+invalidTypeSchemeVariableNameErrorName :: Typed.TypedTerm ErrorModel.InvalidTypeSchemeVariableNameError -> Typed.TypedTerm Model.Name+invalidTypeSchemeVariableNameErrorName x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.InvalidTypeSchemeVariableNameError"),+ Model.projectionFieldName = (Model.Name "name")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL updater for the location field of hydra.core.error.model.InvalidTypeSchemeVariableNameError+invalidTypeSchemeVariableNameErrorWithLocation :: Typed.TypedTerm ErrorModel.InvalidTypeSchemeVariableNameError -> Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm ErrorModel.InvalidTypeSchemeVariableNameError+invalidTypeSchemeVariableNameErrorWithLocation original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.InvalidTypeSchemeVariableNameError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.InvalidTypeSchemeVariableNameError"),+ Model.projectionFieldName = (Model.Name "name")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the name field of hydra.core.error.model.InvalidTypeSchemeVariableNameError+invalidTypeSchemeVariableNameErrorWithName :: Typed.TypedTerm ErrorModel.InvalidTypeSchemeVariableNameError -> Typed.TypedTerm Model.Name -> Typed.TypedTerm ErrorModel.InvalidTypeSchemeVariableNameError+invalidTypeSchemeVariableNameErrorWithName original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.InvalidTypeSchemeVariableNameError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.InvalidTypeSchemeVariableNameError"),+ Model.projectionFieldName = (Model.Name "location")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL constructor for hydra.core.error.model.LiteralTypeMismatchError+literalTypeMismatchError :: Typed.TypedTerm Model.LiteralType -> Typed.TypedTerm Model.LiteralType -> Typed.TypedTerm ErrorModel.LiteralTypeMismatchError+literalTypeMismatchError expectedType actualType =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.LiteralTypeMismatchError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "expectedType"),+ Model.fieldTerm = (Typed.unTypedTerm expectedType)},+ Model.Field {+ Model.fieldName = (Model.Name "actualType"),+ Model.fieldTerm = (Typed.unTypedTerm actualType)}]}))++-- | DSL accessor for the actualType field of hydra.core.error.model.LiteralTypeMismatchError+literalTypeMismatchErrorActualType :: Typed.TypedTerm ErrorModel.LiteralTypeMismatchError -> Typed.TypedTerm Model.LiteralType+literalTypeMismatchErrorActualType x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.LiteralTypeMismatchError"),+ Model.projectionFieldName = (Model.Name "actualType")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the expectedType field of hydra.core.error.model.LiteralTypeMismatchError+literalTypeMismatchErrorExpectedType :: Typed.TypedTerm ErrorModel.LiteralTypeMismatchError -> Typed.TypedTerm Model.LiteralType+literalTypeMismatchErrorExpectedType x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.LiteralTypeMismatchError"),+ Model.projectionFieldName = (Model.Name "expectedType")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.error.model.LiteralTypeMismatchError+literalTypeMismatchErrorLiteralTypeMismatchError :: Typed.TypedName ErrorModel.LiteralTypeMismatchError+literalTypeMismatchErrorLiteralTypeMismatchError =+ Typed.TypedName (Model.Name "hydra.core.error.model.LiteralTypeMismatchError")++-- | DSL updater for the actualType field of hydra.core.error.model.LiteralTypeMismatchError+literalTypeMismatchErrorWithActualType :: Typed.TypedTerm ErrorModel.LiteralTypeMismatchError -> Typed.TypedTerm Model.LiteralType -> Typed.TypedTerm ErrorModel.LiteralTypeMismatchError+literalTypeMismatchErrorWithActualType original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.LiteralTypeMismatchError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "expectedType"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.LiteralTypeMismatchError"),+ Model.projectionFieldName = (Model.Name "expectedType")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "actualType"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL updater for the expectedType field of hydra.core.error.model.LiteralTypeMismatchError+literalTypeMismatchErrorWithExpectedType :: Typed.TypedTerm ErrorModel.LiteralTypeMismatchError -> Typed.TypedTerm Model.LiteralType -> Typed.TypedTerm ErrorModel.LiteralTypeMismatchError+literalTypeMismatchErrorWithExpectedType original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.LiteralTypeMismatchError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "expectedType"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "actualType"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.LiteralTypeMismatchError"),+ Model.projectionFieldName = (Model.Name "actualType")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL constructor for hydra.core.error.model.MissingCaseBranchesError+missingCaseBranchesError :: Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm Model.Name -> Typed.TypedTerm [Model.Name] -> Typed.TypedTerm ErrorModel.MissingCaseBranchesError+missingCaseBranchesError location typeName variantNames =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.MissingCaseBranchesError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Typed.unTypedTerm location)},+ Model.Field {+ Model.fieldName = (Model.Name "typeName"),+ Model.fieldTerm = (Typed.unTypedTerm typeName)},+ Model.Field {+ Model.fieldName = (Model.Name "variantNames"),+ Model.fieldTerm = (Typed.unTypedTerm variantNames)}]}))++-- | DSL accessor for the location field of hydra.core.error.model.MissingCaseBranchesError+missingCaseBranchesErrorLocation :: Typed.TypedTerm ErrorModel.MissingCaseBranchesError -> Typed.TypedTerm Paths.SubtermPath+missingCaseBranchesErrorLocation x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.MissingCaseBranchesError"),+ Model.projectionFieldName = (Model.Name "location")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.error.model.MissingCaseBranchesError+missingCaseBranchesErrorMissingCaseBranchesError :: Typed.TypedName ErrorModel.MissingCaseBranchesError+missingCaseBranchesErrorMissingCaseBranchesError =+ Typed.TypedName (Model.Name "hydra.core.error.model.MissingCaseBranchesError")++-- | DSL accessor for the typeName field of hydra.core.error.model.MissingCaseBranchesError+missingCaseBranchesErrorTypeName :: Typed.TypedTerm ErrorModel.MissingCaseBranchesError -> Typed.TypedTerm Model.Name+missingCaseBranchesErrorTypeName x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.MissingCaseBranchesError"),+ Model.projectionFieldName = (Model.Name "typeName")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the variantNames field of hydra.core.error.model.MissingCaseBranchesError+missingCaseBranchesErrorVariantNames :: Typed.TypedTerm ErrorModel.MissingCaseBranchesError -> Typed.TypedTerm [Model.Name]+missingCaseBranchesErrorVariantNames x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.MissingCaseBranchesError"),+ Model.projectionFieldName = (Model.Name "variantNames")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL updater for the location field of hydra.core.error.model.MissingCaseBranchesError+missingCaseBranchesErrorWithLocation :: Typed.TypedTerm ErrorModel.MissingCaseBranchesError -> Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm ErrorModel.MissingCaseBranchesError+missingCaseBranchesErrorWithLocation original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.MissingCaseBranchesError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "typeName"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.MissingCaseBranchesError"),+ Model.projectionFieldName = (Model.Name "typeName")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "variantNames"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.MissingCaseBranchesError"),+ Model.projectionFieldName = (Model.Name "variantNames")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the typeName field of hydra.core.error.model.MissingCaseBranchesError+missingCaseBranchesErrorWithTypeName :: Typed.TypedTerm ErrorModel.MissingCaseBranchesError -> Typed.TypedTerm Model.Name -> Typed.TypedTerm ErrorModel.MissingCaseBranchesError+missingCaseBranchesErrorWithTypeName original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.MissingCaseBranchesError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.MissingCaseBranchesError"),+ Model.projectionFieldName = (Model.Name "location")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "typeName"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "variantNames"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.MissingCaseBranchesError"),+ Model.projectionFieldName = (Model.Name "variantNames")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the variantNames field of hydra.core.error.model.MissingCaseBranchesError+missingCaseBranchesErrorWithVariantNames :: Typed.TypedTerm ErrorModel.MissingCaseBranchesError -> Typed.TypedTerm [Model.Name] -> Typed.TypedTerm ErrorModel.MissingCaseBranchesError+missingCaseBranchesErrorWithVariantNames original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.MissingCaseBranchesError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.MissingCaseBranchesError"),+ Model.projectionFieldName = (Model.Name "location")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "typeName"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.MissingCaseBranchesError"),+ Model.projectionFieldName = (Model.Name "typeName")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "variantNames"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL constructor for hydra.core.error.model.MissingRecordFieldsError+missingRecordFieldsError :: Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm Model.Name -> Typed.TypedTerm [Model.Name] -> Typed.TypedTerm ErrorModel.MissingRecordFieldsError+missingRecordFieldsError location typeName fieldNames =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.MissingRecordFieldsError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Typed.unTypedTerm location)},+ Model.Field {+ Model.fieldName = (Model.Name "typeName"),+ Model.fieldTerm = (Typed.unTypedTerm typeName)},+ Model.Field {+ Model.fieldName = (Model.Name "fieldNames"),+ Model.fieldTerm = (Typed.unTypedTerm fieldNames)}]}))++-- | DSL accessor for the fieldNames field of hydra.core.error.model.MissingRecordFieldsError+missingRecordFieldsErrorFieldNames :: Typed.TypedTerm ErrorModel.MissingRecordFieldsError -> Typed.TypedTerm [Model.Name]+missingRecordFieldsErrorFieldNames x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.MissingRecordFieldsError"),+ Model.projectionFieldName = (Model.Name "fieldNames")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the location field of hydra.core.error.model.MissingRecordFieldsError+missingRecordFieldsErrorLocation :: Typed.TypedTerm ErrorModel.MissingRecordFieldsError -> Typed.TypedTerm Paths.SubtermPath+missingRecordFieldsErrorLocation x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.MissingRecordFieldsError"),+ Model.projectionFieldName = (Model.Name "location")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.error.model.MissingRecordFieldsError+missingRecordFieldsErrorMissingRecordFieldsError :: Typed.TypedName ErrorModel.MissingRecordFieldsError+missingRecordFieldsErrorMissingRecordFieldsError =+ Typed.TypedName (Model.Name "hydra.core.error.model.MissingRecordFieldsError")++-- | DSL accessor for the typeName field of hydra.core.error.model.MissingRecordFieldsError+missingRecordFieldsErrorTypeName :: Typed.TypedTerm ErrorModel.MissingRecordFieldsError -> Typed.TypedTerm Model.Name+missingRecordFieldsErrorTypeName x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.MissingRecordFieldsError"),+ Model.projectionFieldName = (Model.Name "typeName")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL updater for the fieldNames field of hydra.core.error.model.MissingRecordFieldsError+missingRecordFieldsErrorWithFieldNames :: Typed.TypedTerm ErrorModel.MissingRecordFieldsError -> Typed.TypedTerm [Model.Name] -> Typed.TypedTerm ErrorModel.MissingRecordFieldsError+missingRecordFieldsErrorWithFieldNames original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.MissingRecordFieldsError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.MissingRecordFieldsError"),+ Model.projectionFieldName = (Model.Name "location")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "typeName"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.MissingRecordFieldsError"),+ Model.projectionFieldName = (Model.Name "typeName")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "fieldNames"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL updater for the location field of hydra.core.error.model.MissingRecordFieldsError+missingRecordFieldsErrorWithLocation :: Typed.TypedTerm ErrorModel.MissingRecordFieldsError -> Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm ErrorModel.MissingRecordFieldsError+missingRecordFieldsErrorWithLocation original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.MissingRecordFieldsError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "typeName"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.MissingRecordFieldsError"),+ Model.projectionFieldName = (Model.Name "typeName")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "fieldNames"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.MissingRecordFieldsError"),+ Model.projectionFieldName = (Model.Name "fieldNames")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the typeName field of hydra.core.error.model.MissingRecordFieldsError+missingRecordFieldsErrorWithTypeName :: Typed.TypedTerm ErrorModel.MissingRecordFieldsError -> Typed.TypedTerm Model.Name -> Typed.TypedTerm ErrorModel.MissingRecordFieldsError+missingRecordFieldsErrorWithTypeName original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.MissingRecordFieldsError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.MissingRecordFieldsError"),+ Model.projectionFieldName = (Model.Name "location")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "typeName"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "fieldNames"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.MissingRecordFieldsError"),+ Model.projectionFieldName = (Model.Name "fieldNames")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL constructor for hydra.core.error.model.NestedTermAnnotationError+nestedTermAnnotationError :: Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm ErrorModel.NestedTermAnnotationError+nestedTermAnnotationError location =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.NestedTermAnnotationError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Typed.unTypedTerm location)}]}))++-- | DSL accessor for the location field of hydra.core.error.model.NestedTermAnnotationError+nestedTermAnnotationErrorLocation :: Typed.TypedTerm ErrorModel.NestedTermAnnotationError -> Typed.TypedTerm Paths.SubtermPath+nestedTermAnnotationErrorLocation x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.NestedTermAnnotationError"),+ Model.projectionFieldName = (Model.Name "location")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.error.model.NestedTermAnnotationError+nestedTermAnnotationErrorNestedTermAnnotationError :: Typed.TypedName ErrorModel.NestedTermAnnotationError+nestedTermAnnotationErrorNestedTermAnnotationError =+ Typed.TypedName (Model.Name "hydra.core.error.model.NestedTermAnnotationError")++-- | DSL updater for the location field of hydra.core.error.model.NestedTermAnnotationError+nestedTermAnnotationErrorWithLocation :: Typed.TypedTerm ErrorModel.NestedTermAnnotationError -> Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm ErrorModel.NestedTermAnnotationError+nestedTermAnnotationErrorWithLocation original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.NestedTermAnnotationError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL constructor for hydra.core.error.model.NestedTypeAnnotationError+nestedTypeAnnotationError :: Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm ErrorModel.NestedTypeAnnotationError+nestedTypeAnnotationError location =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.NestedTypeAnnotationError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Typed.unTypedTerm location)}]}))++-- | DSL accessor for the location field of hydra.core.error.model.NestedTypeAnnotationError+nestedTypeAnnotationErrorLocation :: Typed.TypedTerm ErrorModel.NestedTypeAnnotationError -> Typed.TypedTerm Paths.SubtermPath+nestedTypeAnnotationErrorLocation x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.NestedTypeAnnotationError"),+ Model.projectionFieldName = (Model.Name "location")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.error.model.NestedTypeAnnotationError+nestedTypeAnnotationErrorNestedTypeAnnotationError :: Typed.TypedName ErrorModel.NestedTypeAnnotationError+nestedTypeAnnotationErrorNestedTypeAnnotationError =+ Typed.TypedName (Model.Name "hydra.core.error.model.NestedTypeAnnotationError")++-- | DSL updater for the location field of hydra.core.error.model.NestedTypeAnnotationError+nestedTypeAnnotationErrorWithLocation :: Typed.TypedTerm ErrorModel.NestedTypeAnnotationError -> Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm ErrorModel.NestedTypeAnnotationError+nestedTypeAnnotationErrorWithLocation original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.NestedTypeAnnotationError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL constructor for hydra.core.error.model.NominalTypeKindMismatchError+nominalTypeKindMismatchError :: Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm Model.Name -> Typed.TypedTerm Variants.TypeVariant -> Typed.TypedTerm Variants.TypeVariant -> Typed.TypedTerm ErrorModel.NominalTypeKindMismatchError+nominalTypeKindMismatchError location typeName expectedVariant actualVariant =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.NominalTypeKindMismatchError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Typed.unTypedTerm location)},+ Model.Field {+ Model.fieldName = (Model.Name "typeName"),+ Model.fieldTerm = (Typed.unTypedTerm typeName)},+ Model.Field {+ Model.fieldName = (Model.Name "expectedVariant"),+ Model.fieldTerm = (Typed.unTypedTerm expectedVariant)},+ Model.Field {+ Model.fieldName = (Model.Name "actualVariant"),+ Model.fieldTerm = (Typed.unTypedTerm actualVariant)}]}))++-- | DSL accessor for the actualVariant field of hydra.core.error.model.NominalTypeKindMismatchError+nominalTypeKindMismatchErrorActualVariant :: Typed.TypedTerm ErrorModel.NominalTypeKindMismatchError -> Typed.TypedTerm Variants.TypeVariant+nominalTypeKindMismatchErrorActualVariant x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.NominalTypeKindMismatchError"),+ Model.projectionFieldName = (Model.Name "actualVariant")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the expectedVariant field of hydra.core.error.model.NominalTypeKindMismatchError+nominalTypeKindMismatchErrorExpectedVariant :: Typed.TypedTerm ErrorModel.NominalTypeKindMismatchError -> Typed.TypedTerm Variants.TypeVariant+nominalTypeKindMismatchErrorExpectedVariant x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.NominalTypeKindMismatchError"),+ Model.projectionFieldName = (Model.Name "expectedVariant")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the location field of hydra.core.error.model.NominalTypeKindMismatchError+nominalTypeKindMismatchErrorLocation :: Typed.TypedTerm ErrorModel.NominalTypeKindMismatchError -> Typed.TypedTerm Paths.SubtermPath+nominalTypeKindMismatchErrorLocation x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.NominalTypeKindMismatchError"),+ Model.projectionFieldName = (Model.Name "location")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.error.model.NominalTypeKindMismatchError+nominalTypeKindMismatchErrorNominalTypeKindMismatchError :: Typed.TypedName ErrorModel.NominalTypeKindMismatchError+nominalTypeKindMismatchErrorNominalTypeKindMismatchError =+ Typed.TypedName (Model.Name "hydra.core.error.model.NominalTypeKindMismatchError")++-- | DSL accessor for the typeName field of hydra.core.error.model.NominalTypeKindMismatchError+nominalTypeKindMismatchErrorTypeName :: Typed.TypedTerm ErrorModel.NominalTypeKindMismatchError -> Typed.TypedTerm Model.Name+nominalTypeKindMismatchErrorTypeName x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.NominalTypeKindMismatchError"),+ Model.projectionFieldName = (Model.Name "typeName")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL updater for the actualVariant field of hydra.core.error.model.NominalTypeKindMismatchError+nominalTypeKindMismatchErrorWithActualVariant :: Typed.TypedTerm ErrorModel.NominalTypeKindMismatchError -> Typed.TypedTerm Variants.TypeVariant -> Typed.TypedTerm ErrorModel.NominalTypeKindMismatchError+nominalTypeKindMismatchErrorWithActualVariant original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.NominalTypeKindMismatchError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.NominalTypeKindMismatchError"),+ Model.projectionFieldName = (Model.Name "location")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "typeName"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.NominalTypeKindMismatchError"),+ Model.projectionFieldName = (Model.Name "typeName")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "expectedVariant"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.NominalTypeKindMismatchError"),+ Model.projectionFieldName = (Model.Name "expectedVariant")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "actualVariant"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL updater for the expectedVariant field of hydra.core.error.model.NominalTypeKindMismatchError+nominalTypeKindMismatchErrorWithExpectedVariant :: Typed.TypedTerm ErrorModel.NominalTypeKindMismatchError -> Typed.TypedTerm Variants.TypeVariant -> Typed.TypedTerm ErrorModel.NominalTypeKindMismatchError+nominalTypeKindMismatchErrorWithExpectedVariant original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.NominalTypeKindMismatchError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.NominalTypeKindMismatchError"),+ Model.projectionFieldName = (Model.Name "location")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "typeName"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.NominalTypeKindMismatchError"),+ Model.projectionFieldName = (Model.Name "typeName")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "expectedVariant"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "actualVariant"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.NominalTypeKindMismatchError"),+ Model.projectionFieldName = (Model.Name "actualVariant")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the location field of hydra.core.error.model.NominalTypeKindMismatchError+nominalTypeKindMismatchErrorWithLocation :: Typed.TypedTerm ErrorModel.NominalTypeKindMismatchError -> Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm ErrorModel.NominalTypeKindMismatchError+nominalTypeKindMismatchErrorWithLocation original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.NominalTypeKindMismatchError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "typeName"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.NominalTypeKindMismatchError"),+ Model.projectionFieldName = (Model.Name "typeName")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "expectedVariant"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.NominalTypeKindMismatchError"),+ Model.projectionFieldName = (Model.Name "expectedVariant")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "actualVariant"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.NominalTypeKindMismatchError"),+ Model.projectionFieldName = (Model.Name "actualVariant")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the typeName field of hydra.core.error.model.NominalTypeKindMismatchError+nominalTypeKindMismatchErrorWithTypeName :: Typed.TypedTerm ErrorModel.NominalTypeKindMismatchError -> Typed.TypedTerm Model.Name -> Typed.TypedTerm ErrorModel.NominalTypeKindMismatchError+nominalTypeKindMismatchErrorWithTypeName original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.NominalTypeKindMismatchError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.NominalTypeKindMismatchError"),+ Model.projectionFieldName = (Model.Name "location")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "typeName"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "expectedVariant"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.NominalTypeKindMismatchError"),+ Model.projectionFieldName = (Model.Name "expectedVariant")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "actualVariant"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.NominalTypeKindMismatchError"),+ Model.projectionFieldName = (Model.Name "actualVariant")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL constructor for hydra.core.error.model.NonComparableMapKeyTypeError+nonComparableMapKeyTypeError :: Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm Model.Type -> Typed.TypedTerm ErrorModel.NonComparableMapKeyTypeError+nonComparableMapKeyTypeError location keyType =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.NonComparableMapKeyTypeError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Typed.unTypedTerm location)},+ Model.Field {+ Model.fieldName = (Model.Name "keyType"),+ Model.fieldTerm = (Typed.unTypedTerm keyType)}]}))++-- | DSL accessor for the keyType field of hydra.core.error.model.NonComparableMapKeyTypeError+nonComparableMapKeyTypeErrorKeyType :: Typed.TypedTerm ErrorModel.NonComparableMapKeyTypeError -> Typed.TypedTerm Model.Type+nonComparableMapKeyTypeErrorKeyType x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.NonComparableMapKeyTypeError"),+ Model.projectionFieldName = (Model.Name "keyType")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the location field of hydra.core.error.model.NonComparableMapKeyTypeError+nonComparableMapKeyTypeErrorLocation :: Typed.TypedTerm ErrorModel.NonComparableMapKeyTypeError -> Typed.TypedTerm Paths.SubtermPath+nonComparableMapKeyTypeErrorLocation x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.NonComparableMapKeyTypeError"),+ Model.projectionFieldName = (Model.Name "location")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.error.model.NonComparableMapKeyTypeError+nonComparableMapKeyTypeErrorNonComparableMapKeyTypeError :: Typed.TypedName ErrorModel.NonComparableMapKeyTypeError+nonComparableMapKeyTypeErrorNonComparableMapKeyTypeError =+ Typed.TypedName (Model.Name "hydra.core.error.model.NonComparableMapKeyTypeError")++-- | DSL updater for the keyType field of hydra.core.error.model.NonComparableMapKeyTypeError+nonComparableMapKeyTypeErrorWithKeyType :: Typed.TypedTerm ErrorModel.NonComparableMapKeyTypeError -> Typed.TypedTerm Model.Type -> Typed.TypedTerm ErrorModel.NonComparableMapKeyTypeError+nonComparableMapKeyTypeErrorWithKeyType original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.NonComparableMapKeyTypeError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.NonComparableMapKeyTypeError"),+ Model.projectionFieldName = (Model.Name "location")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "keyType"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL updater for the location field of hydra.core.error.model.NonComparableMapKeyTypeError+nonComparableMapKeyTypeErrorWithLocation :: Typed.TypedTerm ErrorModel.NonComparableMapKeyTypeError -> Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm ErrorModel.NonComparableMapKeyTypeError+nonComparableMapKeyTypeErrorWithLocation original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.NonComparableMapKeyTypeError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "keyType"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.NonComparableMapKeyTypeError"),+ Model.projectionFieldName = (Model.Name "keyType")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL constructor for hydra.core.error.model.NonComparableSetElementTypeError+nonComparableSetElementTypeError :: Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm Model.Type -> Typed.TypedTerm ErrorModel.NonComparableSetElementTypeError+nonComparableSetElementTypeError location elementType =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.NonComparableSetElementTypeError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Typed.unTypedTerm location)},+ Model.Field {+ Model.fieldName = (Model.Name "elementType"),+ Model.fieldTerm = (Typed.unTypedTerm elementType)}]}))++-- | DSL accessor for the elementType field of hydra.core.error.model.NonComparableSetElementTypeError+nonComparableSetElementTypeErrorElementType :: Typed.TypedTerm ErrorModel.NonComparableSetElementTypeError -> Typed.TypedTerm Model.Type+nonComparableSetElementTypeErrorElementType x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.NonComparableSetElementTypeError"),+ Model.projectionFieldName = (Model.Name "elementType")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the location field of hydra.core.error.model.NonComparableSetElementTypeError+nonComparableSetElementTypeErrorLocation :: Typed.TypedTerm ErrorModel.NonComparableSetElementTypeError -> Typed.TypedTerm Paths.SubtermPath+nonComparableSetElementTypeErrorLocation x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.NonComparableSetElementTypeError"),+ Model.projectionFieldName = (Model.Name "location")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.error.model.NonComparableSetElementTypeError+nonComparableSetElementTypeErrorNonComparableSetElementTypeError :: Typed.TypedName ErrorModel.NonComparableSetElementTypeError+nonComparableSetElementTypeErrorNonComparableSetElementTypeError =+ Typed.TypedName (Model.Name "hydra.core.error.model.NonComparableSetElementTypeError")++-- | DSL updater for the elementType field of hydra.core.error.model.NonComparableSetElementTypeError+nonComparableSetElementTypeErrorWithElementType :: Typed.TypedTerm ErrorModel.NonComparableSetElementTypeError -> Typed.TypedTerm Model.Type -> Typed.TypedTerm ErrorModel.NonComparableSetElementTypeError+nonComparableSetElementTypeErrorWithElementType original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.NonComparableSetElementTypeError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.NonComparableSetElementTypeError"),+ Model.projectionFieldName = (Model.Name "location")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "elementType"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL updater for the location field of hydra.core.error.model.NonComparableSetElementTypeError+nonComparableSetElementTypeErrorWithLocation :: Typed.TypedTerm ErrorModel.NonComparableSetElementTypeError -> Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm ErrorModel.NonComparableSetElementTypeError+nonComparableSetElementTypeErrorWithLocation original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.NonComparableSetElementTypeError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "elementType"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.NonComparableSetElementTypeError"),+ Model.projectionFieldName = (Model.Name "elementType")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL constructor for hydra.core.error.model.RedundantWrapUnwrapError+redundantWrapUnwrapError :: Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm Model.Name -> Typed.TypedTerm ErrorModel.RedundantWrapUnwrapError+redundantWrapUnwrapError location typeName =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.RedundantWrapUnwrapError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Typed.unTypedTerm location)},+ Model.Field {+ Model.fieldName = (Model.Name "typeName"),+ Model.fieldTerm = (Typed.unTypedTerm typeName)}]}))++-- | DSL accessor for the location field of hydra.core.error.model.RedundantWrapUnwrapError+redundantWrapUnwrapErrorLocation :: Typed.TypedTerm ErrorModel.RedundantWrapUnwrapError -> Typed.TypedTerm Paths.SubtermPath+redundantWrapUnwrapErrorLocation x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.RedundantWrapUnwrapError"),+ Model.projectionFieldName = (Model.Name "location")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.error.model.RedundantWrapUnwrapError+redundantWrapUnwrapErrorRedundantWrapUnwrapError :: Typed.TypedName ErrorModel.RedundantWrapUnwrapError+redundantWrapUnwrapErrorRedundantWrapUnwrapError =+ Typed.TypedName (Model.Name "hydra.core.error.model.RedundantWrapUnwrapError")++-- | DSL accessor for the typeName field of hydra.core.error.model.RedundantWrapUnwrapError+redundantWrapUnwrapErrorTypeName :: Typed.TypedTerm ErrorModel.RedundantWrapUnwrapError -> Typed.TypedTerm Model.Name+redundantWrapUnwrapErrorTypeName x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.RedundantWrapUnwrapError"),+ Model.projectionFieldName = (Model.Name "typeName")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL updater for the location field of hydra.core.error.model.RedundantWrapUnwrapError+redundantWrapUnwrapErrorWithLocation :: Typed.TypedTerm ErrorModel.RedundantWrapUnwrapError -> Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm ErrorModel.RedundantWrapUnwrapError+redundantWrapUnwrapErrorWithLocation original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.RedundantWrapUnwrapError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "typeName"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.RedundantWrapUnwrapError"),+ Model.projectionFieldName = (Model.Name "typeName")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the typeName field of hydra.core.error.model.RedundantWrapUnwrapError+redundantWrapUnwrapErrorWithTypeName :: Typed.TypedTerm ErrorModel.RedundantWrapUnwrapError -> Typed.TypedTerm Model.Name -> Typed.TypedTerm ErrorModel.RedundantWrapUnwrapError+redundantWrapUnwrapErrorWithTypeName original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.RedundantWrapUnwrapError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.RedundantWrapUnwrapError"),+ Model.projectionFieldName = (Model.Name "location")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "typeName"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL constructor for hydra.core.error.model.SelfApplicationError+selfApplicationError :: Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm Model.Name -> Typed.TypedTerm ErrorModel.SelfApplicationError+selfApplicationError location name =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.SelfApplicationError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Typed.unTypedTerm location)},+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Typed.unTypedTerm name)}]}))++-- | DSL accessor for the location field of hydra.core.error.model.SelfApplicationError+selfApplicationErrorLocation :: Typed.TypedTerm ErrorModel.SelfApplicationError -> Typed.TypedTerm Paths.SubtermPath+selfApplicationErrorLocation x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.SelfApplicationError"),+ Model.projectionFieldName = (Model.Name "location")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the name field of hydra.core.error.model.SelfApplicationError+selfApplicationErrorName :: Typed.TypedTerm ErrorModel.SelfApplicationError -> Typed.TypedTerm Model.Name+selfApplicationErrorName x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.SelfApplicationError"),+ Model.projectionFieldName = (Model.Name "name")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.error.model.SelfApplicationError+selfApplicationErrorSelfApplicationError :: Typed.TypedName ErrorModel.SelfApplicationError+selfApplicationErrorSelfApplicationError = Typed.TypedName (Model.Name "hydra.core.error.model.SelfApplicationError")++-- | DSL updater for the location field of hydra.core.error.model.SelfApplicationError+selfApplicationErrorWithLocation :: Typed.TypedTerm ErrorModel.SelfApplicationError -> Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm ErrorModel.SelfApplicationError+selfApplicationErrorWithLocation original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.SelfApplicationError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.SelfApplicationError"),+ Model.projectionFieldName = (Model.Name "name")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the name field of hydra.core.error.model.SelfApplicationError+selfApplicationErrorWithName :: Typed.TypedTerm ErrorModel.SelfApplicationError -> Typed.TypedTerm Model.Name -> Typed.TypedTerm ErrorModel.SelfApplicationError+selfApplicationErrorWithName original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.SelfApplicationError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.SelfApplicationError"),+ Model.projectionFieldName = (Model.Name "location")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL constructor for hydra.core.error.model.SingleVariantUnionError+singleVariantUnionError :: Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm Model.Name -> Typed.TypedTerm ErrorModel.SingleVariantUnionError+singleVariantUnionError location fieldName =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.SingleVariantUnionError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Typed.unTypedTerm location)},+ Model.Field {+ Model.fieldName = (Model.Name "fieldName"),+ Model.fieldTerm = (Typed.unTypedTerm fieldName)}]}))++-- | DSL accessor for the fieldName field of hydra.core.error.model.SingleVariantUnionError+singleVariantUnionErrorFieldName :: Typed.TypedTerm ErrorModel.SingleVariantUnionError -> Typed.TypedTerm Model.Name+singleVariantUnionErrorFieldName x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.SingleVariantUnionError"),+ Model.projectionFieldName = (Model.Name "fieldName")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the location field of hydra.core.error.model.SingleVariantUnionError+singleVariantUnionErrorLocation :: Typed.TypedTerm ErrorModel.SingleVariantUnionError -> Typed.TypedTerm Paths.SubtermPath+singleVariantUnionErrorLocation x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.SingleVariantUnionError"),+ Model.projectionFieldName = (Model.Name "location")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.error.model.SingleVariantUnionError+singleVariantUnionErrorSingleVariantUnionError :: Typed.TypedName ErrorModel.SingleVariantUnionError+singleVariantUnionErrorSingleVariantUnionError =+ Typed.TypedName (Model.Name "hydra.core.error.model.SingleVariantUnionError")++-- | DSL updater for the fieldName field of hydra.core.error.model.SingleVariantUnionError+singleVariantUnionErrorWithFieldName :: Typed.TypedTerm ErrorModel.SingleVariantUnionError -> Typed.TypedTerm Model.Name -> Typed.TypedTerm ErrorModel.SingleVariantUnionError+singleVariantUnionErrorWithFieldName original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.SingleVariantUnionError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.SingleVariantUnionError"),+ Model.projectionFieldName = (Model.Name "location")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "fieldName"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL updater for the location field of hydra.core.error.model.SingleVariantUnionError+singleVariantUnionErrorWithLocation :: Typed.TypedTerm ErrorModel.SingleVariantUnionError -> Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm ErrorModel.SingleVariantUnionError+singleVariantUnionErrorWithLocation original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.SingleVariantUnionError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "fieldName"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.SingleVariantUnionError"),+ Model.projectionFieldName = (Model.Name "fieldName")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL constructor for hydra.core.error.model.TermVariableShadowingError+termVariableShadowingError :: Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm Model.Name -> Typed.TypedTerm ErrorModel.TermVariableShadowingError+termVariableShadowingError location name =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.TermVariableShadowingError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Typed.unTypedTerm location)},+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Typed.unTypedTerm name)}]}))++-- | DSL accessor for the location field of hydra.core.error.model.TermVariableShadowingError+termVariableShadowingErrorLocation :: Typed.TypedTerm ErrorModel.TermVariableShadowingError -> Typed.TypedTerm Paths.SubtermPath+termVariableShadowingErrorLocation x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.TermVariableShadowingError"),+ Model.projectionFieldName = (Model.Name "location")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the name field of hydra.core.error.model.TermVariableShadowingError+termVariableShadowingErrorName :: Typed.TypedTerm ErrorModel.TermVariableShadowingError -> Typed.TypedTerm Model.Name+termVariableShadowingErrorName x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.TermVariableShadowingError"),+ Model.projectionFieldName = (Model.Name "name")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.error.model.TermVariableShadowingError+termVariableShadowingErrorTermVariableShadowingError :: Typed.TypedName ErrorModel.TermVariableShadowingError+termVariableShadowingErrorTermVariableShadowingError =+ Typed.TypedName (Model.Name "hydra.core.error.model.TermVariableShadowingError")++-- | DSL updater for the location field of hydra.core.error.model.TermVariableShadowingError+termVariableShadowingErrorWithLocation :: Typed.TypedTerm ErrorModel.TermVariableShadowingError -> Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm ErrorModel.TermVariableShadowingError+termVariableShadowingErrorWithLocation original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.TermVariableShadowingError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.TermVariableShadowingError"),+ Model.projectionFieldName = (Model.Name "name")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the name field of hydra.core.error.model.TermVariableShadowingError+termVariableShadowingErrorWithName :: Typed.TypedTerm ErrorModel.TermVariableShadowingError -> Typed.TypedTerm Model.Name -> Typed.TypedTerm ErrorModel.TermVariableShadowingError+termVariableShadowingErrorWithName original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.TermVariableShadowingError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.TermVariableShadowingError"),+ Model.projectionFieldName = (Model.Name "location")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL constructor for hydra.core.error.model.TypeVariableShadowingInForallError+typeVariableShadowingInForallError :: Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm Model.Name -> Typed.TypedTerm ErrorModel.TypeVariableShadowingInForallError+typeVariableShadowingInForallError location name =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.TypeVariableShadowingInForallError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Typed.unTypedTerm location)},+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Typed.unTypedTerm name)}]}))++-- | DSL accessor for the location field of hydra.core.error.model.TypeVariableShadowingInForallError+typeVariableShadowingInForallErrorLocation :: Typed.TypedTerm ErrorModel.TypeVariableShadowingInForallError -> Typed.TypedTerm Paths.SubtermPath+typeVariableShadowingInForallErrorLocation x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.TypeVariableShadowingInForallError"),+ Model.projectionFieldName = (Model.Name "location")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the name field of hydra.core.error.model.TypeVariableShadowingInForallError+typeVariableShadowingInForallErrorName :: Typed.TypedTerm ErrorModel.TypeVariableShadowingInForallError -> Typed.TypedTerm Model.Name+typeVariableShadowingInForallErrorName x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.TypeVariableShadowingInForallError"),+ Model.projectionFieldName = (Model.Name "name")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.error.model.TypeVariableShadowingInForallError+typeVariableShadowingInForallErrorTypeVariableShadowingInForallError :: Typed.TypedName ErrorModel.TypeVariableShadowingInForallError+typeVariableShadowingInForallErrorTypeVariableShadowingInForallError =+ Typed.TypedName (Model.Name "hydra.core.error.model.TypeVariableShadowingInForallError")++-- | DSL updater for the location field of hydra.core.error.model.TypeVariableShadowingInForallError+typeVariableShadowingInForallErrorWithLocation :: Typed.TypedTerm ErrorModel.TypeVariableShadowingInForallError -> Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm ErrorModel.TypeVariableShadowingInForallError+typeVariableShadowingInForallErrorWithLocation original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.TypeVariableShadowingInForallError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.TypeVariableShadowingInForallError"),+ Model.projectionFieldName = (Model.Name "name")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the name field of hydra.core.error.model.TypeVariableShadowingInForallError+typeVariableShadowingInForallErrorWithName :: Typed.TypedTerm ErrorModel.TypeVariableShadowingInForallError -> Typed.TypedTerm Model.Name -> Typed.TypedTerm ErrorModel.TypeVariableShadowingInForallError+typeVariableShadowingInForallErrorWithName original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.TypeVariableShadowingInForallError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.TypeVariableShadowingInForallError"),+ Model.projectionFieldName = (Model.Name "location")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL constructor for hydra.core.error.model.TypeVariableShadowingInTypeLambdaError+typeVariableShadowingInTypeLambdaError :: Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm Model.Name -> Typed.TypedTerm ErrorModel.TypeVariableShadowingInTypeLambdaError+typeVariableShadowingInTypeLambdaError location name =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.TypeVariableShadowingInTypeLambdaError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Typed.unTypedTerm location)},+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Typed.unTypedTerm name)}]}))++-- | DSL accessor for the location field of hydra.core.error.model.TypeVariableShadowingInTypeLambdaError+typeVariableShadowingInTypeLambdaErrorLocation :: Typed.TypedTerm ErrorModel.TypeVariableShadowingInTypeLambdaError -> Typed.TypedTerm Paths.SubtermPath+typeVariableShadowingInTypeLambdaErrorLocation x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.TypeVariableShadowingInTypeLambdaError"),+ Model.projectionFieldName = (Model.Name "location")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the name field of hydra.core.error.model.TypeVariableShadowingInTypeLambdaError+typeVariableShadowingInTypeLambdaErrorName :: Typed.TypedTerm ErrorModel.TypeVariableShadowingInTypeLambdaError -> Typed.TypedTerm Model.Name+typeVariableShadowingInTypeLambdaErrorName x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.TypeVariableShadowingInTypeLambdaError"),+ Model.projectionFieldName = (Model.Name "name")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.error.model.TypeVariableShadowingInTypeLambdaError+typeVariableShadowingInTypeLambdaErrorTypeVariableShadowingInTypeLambdaError :: Typed.TypedName ErrorModel.TypeVariableShadowingInTypeLambdaError+typeVariableShadowingInTypeLambdaErrorTypeVariableShadowingInTypeLambdaError =+ Typed.TypedName (Model.Name "hydra.core.error.model.TypeVariableShadowingInTypeLambdaError")++-- | DSL updater for the location field of hydra.core.error.model.TypeVariableShadowingInTypeLambdaError+typeVariableShadowingInTypeLambdaErrorWithLocation :: Typed.TypedTerm ErrorModel.TypeVariableShadowingInTypeLambdaError -> Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm ErrorModel.TypeVariableShadowingInTypeLambdaError+typeVariableShadowingInTypeLambdaErrorWithLocation original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.TypeVariableShadowingInTypeLambdaError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.TypeVariableShadowingInTypeLambdaError"),+ Model.projectionFieldName = (Model.Name "name")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the name field of hydra.core.error.model.TypeVariableShadowingInTypeLambdaError+typeVariableShadowingInTypeLambdaErrorWithName :: Typed.TypedTerm ErrorModel.TypeVariableShadowingInTypeLambdaError -> Typed.TypedTerm Model.Name -> Typed.TypedTerm ErrorModel.TypeVariableShadowingInTypeLambdaError+typeVariableShadowingInTypeLambdaErrorWithName original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.TypeVariableShadowingInTypeLambdaError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.TypeVariableShadowingInTypeLambdaError"),+ Model.projectionFieldName = (Model.Name "location")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL constructor for hydra.core.error.model.UndeclaredVariantError+undeclaredVariantError :: Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm Model.Name -> Typed.TypedTerm Model.Name -> Typed.TypedTerm ErrorModel.UndeclaredVariantError+undeclaredVariantError location typeName variantName =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.UndeclaredVariantError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Typed.unTypedTerm location)},+ Model.Field {+ Model.fieldName = (Model.Name "typeName"),+ Model.fieldTerm = (Typed.unTypedTerm typeName)},+ Model.Field {+ Model.fieldName = (Model.Name "variantName"),+ Model.fieldTerm = (Typed.unTypedTerm variantName)}]}))++-- | DSL accessor for the location field of hydra.core.error.model.UndeclaredVariantError+undeclaredVariantErrorLocation :: Typed.TypedTerm ErrorModel.UndeclaredVariantError -> Typed.TypedTerm Paths.SubtermPath+undeclaredVariantErrorLocation x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.UndeclaredVariantError"),+ Model.projectionFieldName = (Model.Name "location")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the typeName field of hydra.core.error.model.UndeclaredVariantError+undeclaredVariantErrorTypeName :: Typed.TypedTerm ErrorModel.UndeclaredVariantError -> Typed.TypedTerm Model.Name+undeclaredVariantErrorTypeName x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.UndeclaredVariantError"),+ Model.projectionFieldName = (Model.Name "typeName")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.error.model.UndeclaredVariantError+undeclaredVariantErrorUndeclaredVariantError :: Typed.TypedName ErrorModel.UndeclaredVariantError+undeclaredVariantErrorUndeclaredVariantError =+ Typed.TypedName (Model.Name "hydra.core.error.model.UndeclaredVariantError")++-- | DSL accessor for the variantName field of hydra.core.error.model.UndeclaredVariantError+undeclaredVariantErrorVariantName :: Typed.TypedTerm ErrorModel.UndeclaredVariantError -> Typed.TypedTerm Model.Name+undeclaredVariantErrorVariantName x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.UndeclaredVariantError"),+ Model.projectionFieldName = (Model.Name "variantName")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL updater for the location field of hydra.core.error.model.UndeclaredVariantError+undeclaredVariantErrorWithLocation :: Typed.TypedTerm ErrorModel.UndeclaredVariantError -> Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm ErrorModel.UndeclaredVariantError+undeclaredVariantErrorWithLocation original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.UndeclaredVariantError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "typeName"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.UndeclaredVariantError"),+ Model.projectionFieldName = (Model.Name "typeName")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "variantName"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.UndeclaredVariantError"),+ Model.projectionFieldName = (Model.Name "variantName")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the typeName field of hydra.core.error.model.UndeclaredVariantError+undeclaredVariantErrorWithTypeName :: Typed.TypedTerm ErrorModel.UndeclaredVariantError -> Typed.TypedTerm Model.Name -> Typed.TypedTerm ErrorModel.UndeclaredVariantError+undeclaredVariantErrorWithTypeName original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.UndeclaredVariantError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.UndeclaredVariantError"),+ Model.projectionFieldName = (Model.Name "location")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "typeName"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "variantName"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.UndeclaredVariantError"),+ Model.projectionFieldName = (Model.Name "variantName")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the variantName field of hydra.core.error.model.UndeclaredVariantError+undeclaredVariantErrorWithVariantName :: Typed.TypedTerm ErrorModel.UndeclaredVariantError -> Typed.TypedTerm Model.Name -> Typed.TypedTerm ErrorModel.UndeclaredVariantError+undeclaredVariantErrorWithVariantName original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.UndeclaredVariantError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.UndeclaredVariantError"),+ Model.projectionFieldName = (Model.Name "location")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "typeName"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.UndeclaredVariantError"),+ Model.projectionFieldName = (Model.Name "typeName")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "variantName"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL constructor for hydra.core.error.model.UndefinedFieldError+undefinedFieldError :: Typed.TypedTerm Model.Name -> Typed.TypedTerm Model.Name -> Typed.TypedTerm ErrorModel.UndefinedFieldError+undefinedFieldError fieldName typeName =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.UndefinedFieldError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "fieldName"),+ Model.fieldTerm = (Typed.unTypedTerm fieldName)},+ Model.Field {+ Model.fieldName = (Model.Name "typeName"),+ Model.fieldTerm = (Typed.unTypedTerm typeName)}]}))++-- | DSL accessor for the fieldName field of hydra.core.error.model.UndefinedFieldError+undefinedFieldErrorFieldName :: Typed.TypedTerm ErrorModel.UndefinedFieldError -> Typed.TypedTerm Model.Name+undefinedFieldErrorFieldName x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.UndefinedFieldError"),+ Model.projectionFieldName = (Model.Name "fieldName")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the typeName field of hydra.core.error.model.UndefinedFieldError+undefinedFieldErrorTypeName :: Typed.TypedTerm ErrorModel.UndefinedFieldError -> Typed.TypedTerm Model.Name+undefinedFieldErrorTypeName x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.UndefinedFieldError"),+ Model.projectionFieldName = (Model.Name "typeName")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.error.model.UndefinedFieldError+undefinedFieldErrorUndefinedFieldError :: Typed.TypedName ErrorModel.UndefinedFieldError+undefinedFieldErrorUndefinedFieldError = Typed.TypedName (Model.Name "hydra.core.error.model.UndefinedFieldError")++-- | DSL updater for the fieldName field of hydra.core.error.model.UndefinedFieldError+undefinedFieldErrorWithFieldName :: Typed.TypedTerm ErrorModel.UndefinedFieldError -> Typed.TypedTerm Model.Name -> Typed.TypedTerm ErrorModel.UndefinedFieldError+undefinedFieldErrorWithFieldName original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.UndefinedFieldError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "fieldName"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "typeName"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.UndefinedFieldError"),+ Model.projectionFieldName = (Model.Name "typeName")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the typeName field of hydra.core.error.model.UndefinedFieldError+undefinedFieldErrorWithTypeName :: Typed.TypedTerm ErrorModel.UndefinedFieldError -> Typed.TypedTerm Model.Name -> Typed.TypedTerm ErrorModel.UndefinedFieldError+undefinedFieldErrorWithTypeName original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.UndefinedFieldError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "fieldName"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.UndefinedFieldError"),+ Model.projectionFieldName = (Model.Name "fieldName")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "typeName"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL constructor for hydra.core.error.model.UndefinedTermVariableError+undefinedTermVariableError :: Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm Model.Name -> Typed.TypedTerm ErrorModel.UndefinedTermVariableError+undefinedTermVariableError location name =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.UndefinedTermVariableError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Typed.unTypedTerm location)},+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Typed.unTypedTerm name)}]}))++-- | DSL accessor for the location field of hydra.core.error.model.UndefinedTermVariableError+undefinedTermVariableErrorLocation :: Typed.TypedTerm ErrorModel.UndefinedTermVariableError -> Typed.TypedTerm Paths.SubtermPath+undefinedTermVariableErrorLocation x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.UndefinedTermVariableError"),+ Model.projectionFieldName = (Model.Name "location")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the name field of hydra.core.error.model.UndefinedTermVariableError+undefinedTermVariableErrorName :: Typed.TypedTerm ErrorModel.UndefinedTermVariableError -> Typed.TypedTerm Model.Name+undefinedTermVariableErrorName x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.UndefinedTermVariableError"),+ Model.projectionFieldName = (Model.Name "name")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.error.model.UndefinedTermVariableError+undefinedTermVariableErrorUndefinedTermVariableError :: Typed.TypedName ErrorModel.UndefinedTermVariableError+undefinedTermVariableErrorUndefinedTermVariableError =+ Typed.TypedName (Model.Name "hydra.core.error.model.UndefinedTermVariableError")++-- | DSL updater for the location field of hydra.core.error.model.UndefinedTermVariableError+undefinedTermVariableErrorWithLocation :: Typed.TypedTerm ErrorModel.UndefinedTermVariableError -> Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm ErrorModel.UndefinedTermVariableError+undefinedTermVariableErrorWithLocation original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.UndefinedTermVariableError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.UndefinedTermVariableError"),+ Model.projectionFieldName = (Model.Name "name")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the name field of hydra.core.error.model.UndefinedTermVariableError+undefinedTermVariableErrorWithName :: Typed.TypedTerm ErrorModel.UndefinedTermVariableError -> Typed.TypedTerm Model.Name -> Typed.TypedTerm ErrorModel.UndefinedTermVariableError+undefinedTermVariableErrorWithName original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.UndefinedTermVariableError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.UndefinedTermVariableError"),+ Model.projectionFieldName = (Model.Name "location")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL constructor for hydra.core.error.model.UndefinedTypeVariableError+undefinedTypeVariableError :: Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm Model.Name -> Typed.TypedTerm ErrorModel.UndefinedTypeVariableError+undefinedTypeVariableError location name =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.UndefinedTypeVariableError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Typed.unTypedTerm location)},+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Typed.unTypedTerm name)}]}))++-- | DSL accessor for the location field of hydra.core.error.model.UndefinedTypeVariableError+undefinedTypeVariableErrorLocation :: Typed.TypedTerm ErrorModel.UndefinedTypeVariableError -> Typed.TypedTerm Paths.SubtermPath+undefinedTypeVariableErrorLocation x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.UndefinedTypeVariableError"),+ Model.projectionFieldName = (Model.Name "location")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the name field of hydra.core.error.model.UndefinedTypeVariableError+undefinedTypeVariableErrorName :: Typed.TypedTerm ErrorModel.UndefinedTypeVariableError -> Typed.TypedTerm Model.Name+undefinedTypeVariableErrorName x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.UndefinedTypeVariableError"),+ Model.projectionFieldName = (Model.Name "name")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.error.model.UndefinedTypeVariableError+undefinedTypeVariableErrorUndefinedTypeVariableError :: Typed.TypedName ErrorModel.UndefinedTypeVariableError+undefinedTypeVariableErrorUndefinedTypeVariableError =+ Typed.TypedName (Model.Name "hydra.core.error.model.UndefinedTypeVariableError")++-- | DSL updater for the location field of hydra.core.error.model.UndefinedTypeVariableError+undefinedTypeVariableErrorWithLocation :: Typed.TypedTerm ErrorModel.UndefinedTypeVariableError -> Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm ErrorModel.UndefinedTypeVariableError+undefinedTypeVariableErrorWithLocation original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.UndefinedTypeVariableError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.UndefinedTypeVariableError"),+ Model.projectionFieldName = (Model.Name "name")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the name field of hydra.core.error.model.UndefinedTypeVariableError+undefinedTypeVariableErrorWithName :: Typed.TypedTerm ErrorModel.UndefinedTypeVariableError -> Typed.TypedTerm Model.Name -> Typed.TypedTerm ErrorModel.UndefinedTypeVariableError+undefinedTypeVariableErrorWithName original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.UndefinedTypeVariableError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.UndefinedTypeVariableError"),+ Model.projectionFieldName = (Model.Name "location")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL constructor for hydra.core.error.model.UndefinedTypeVariableInBindingTypeError+undefinedTypeVariableInBindingTypeError :: Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm Model.Name -> Typed.TypedTerm ErrorModel.UndefinedTypeVariableInBindingTypeError+undefinedTypeVariableInBindingTypeError location name =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.UndefinedTypeVariableInBindingTypeError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Typed.unTypedTerm location)},+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Typed.unTypedTerm name)}]}))++-- | DSL accessor for the location field of hydra.core.error.model.UndefinedTypeVariableInBindingTypeError+undefinedTypeVariableInBindingTypeErrorLocation :: Typed.TypedTerm ErrorModel.UndefinedTypeVariableInBindingTypeError -> Typed.TypedTerm Paths.SubtermPath+undefinedTypeVariableInBindingTypeErrorLocation x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.UndefinedTypeVariableInBindingTypeError"),+ Model.projectionFieldName = (Model.Name "location")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the name field of hydra.core.error.model.UndefinedTypeVariableInBindingTypeError+undefinedTypeVariableInBindingTypeErrorName :: Typed.TypedTerm ErrorModel.UndefinedTypeVariableInBindingTypeError -> Typed.TypedTerm Model.Name+undefinedTypeVariableInBindingTypeErrorName x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.UndefinedTypeVariableInBindingTypeError"),+ Model.projectionFieldName = (Model.Name "name")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.error.model.UndefinedTypeVariableInBindingTypeError+undefinedTypeVariableInBindingTypeErrorUndefinedTypeVariableInBindingTypeError :: Typed.TypedName ErrorModel.UndefinedTypeVariableInBindingTypeError+undefinedTypeVariableInBindingTypeErrorUndefinedTypeVariableInBindingTypeError =+ Typed.TypedName (Model.Name "hydra.core.error.model.UndefinedTypeVariableInBindingTypeError")++-- | DSL updater for the location field of hydra.core.error.model.UndefinedTypeVariableInBindingTypeError+undefinedTypeVariableInBindingTypeErrorWithLocation :: Typed.TypedTerm ErrorModel.UndefinedTypeVariableInBindingTypeError -> Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm ErrorModel.UndefinedTypeVariableInBindingTypeError+undefinedTypeVariableInBindingTypeErrorWithLocation original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.UndefinedTypeVariableInBindingTypeError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.UndefinedTypeVariableInBindingTypeError"),+ Model.projectionFieldName = (Model.Name "name")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the name field of hydra.core.error.model.UndefinedTypeVariableInBindingTypeError+undefinedTypeVariableInBindingTypeErrorWithName :: Typed.TypedTerm ErrorModel.UndefinedTypeVariableInBindingTypeError -> Typed.TypedTerm Model.Name -> Typed.TypedTerm ErrorModel.UndefinedTypeVariableInBindingTypeError+undefinedTypeVariableInBindingTypeErrorWithName original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.UndefinedTypeVariableInBindingTypeError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.UndefinedTypeVariableInBindingTypeError"),+ Model.projectionFieldName = (Model.Name "location")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL constructor for hydra.core.error.model.UndefinedTypeVariableInLambdaDomainError+undefinedTypeVariableInLambdaDomainError :: Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm Model.Name -> Typed.TypedTerm ErrorModel.UndefinedTypeVariableInLambdaDomainError+undefinedTypeVariableInLambdaDomainError location name =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.UndefinedTypeVariableInLambdaDomainError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Typed.unTypedTerm location)},+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Typed.unTypedTerm name)}]}))++-- | DSL accessor for the location field of hydra.core.error.model.UndefinedTypeVariableInLambdaDomainError+undefinedTypeVariableInLambdaDomainErrorLocation :: Typed.TypedTerm ErrorModel.UndefinedTypeVariableInLambdaDomainError -> Typed.TypedTerm Paths.SubtermPath+undefinedTypeVariableInLambdaDomainErrorLocation x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.UndefinedTypeVariableInLambdaDomainError"),+ Model.projectionFieldName = (Model.Name "location")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the name field of hydra.core.error.model.UndefinedTypeVariableInLambdaDomainError+undefinedTypeVariableInLambdaDomainErrorName :: Typed.TypedTerm ErrorModel.UndefinedTypeVariableInLambdaDomainError -> Typed.TypedTerm Model.Name+undefinedTypeVariableInLambdaDomainErrorName x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.UndefinedTypeVariableInLambdaDomainError"),+ Model.projectionFieldName = (Model.Name "name")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.error.model.UndefinedTypeVariableInLambdaDomainError+undefinedTypeVariableInLambdaDomainErrorUndefinedTypeVariableInLambdaDomainError :: Typed.TypedName ErrorModel.UndefinedTypeVariableInLambdaDomainError+undefinedTypeVariableInLambdaDomainErrorUndefinedTypeVariableInLambdaDomainError =+ Typed.TypedName (Model.Name "hydra.core.error.model.UndefinedTypeVariableInLambdaDomainError")++-- | DSL updater for the location field of hydra.core.error.model.UndefinedTypeVariableInLambdaDomainError+undefinedTypeVariableInLambdaDomainErrorWithLocation :: Typed.TypedTerm ErrorModel.UndefinedTypeVariableInLambdaDomainError -> Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm ErrorModel.UndefinedTypeVariableInLambdaDomainError+undefinedTypeVariableInLambdaDomainErrorWithLocation original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.UndefinedTypeVariableInLambdaDomainError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.UndefinedTypeVariableInLambdaDomainError"),+ Model.projectionFieldName = (Model.Name "name")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the name field of hydra.core.error.model.UndefinedTypeVariableInLambdaDomainError+undefinedTypeVariableInLambdaDomainErrorWithName :: Typed.TypedTerm ErrorModel.UndefinedTypeVariableInLambdaDomainError -> Typed.TypedTerm Model.Name -> Typed.TypedTerm ErrorModel.UndefinedTypeVariableInLambdaDomainError+undefinedTypeVariableInLambdaDomainErrorWithName original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.UndefinedTypeVariableInLambdaDomainError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.UndefinedTypeVariableInLambdaDomainError"),+ Model.projectionFieldName = (Model.Name "location")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL constructor for hydra.core.error.model.UndefinedTypeVariableInTypeApplicationError+undefinedTypeVariableInTypeApplicationError :: Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm Model.Name -> Typed.TypedTerm ErrorModel.UndefinedTypeVariableInTypeApplicationError+undefinedTypeVariableInTypeApplicationError location name =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.UndefinedTypeVariableInTypeApplicationError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Typed.unTypedTerm location)},+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Typed.unTypedTerm name)}]}))++-- | DSL accessor for the location field of hydra.core.error.model.UndefinedTypeVariableInTypeApplicationError+undefinedTypeVariableInTypeApplicationErrorLocation :: Typed.TypedTerm ErrorModel.UndefinedTypeVariableInTypeApplicationError -> Typed.TypedTerm Paths.SubtermPath+undefinedTypeVariableInTypeApplicationErrorLocation x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.UndefinedTypeVariableInTypeApplicationError"),+ Model.projectionFieldName = (Model.Name "location")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the name field of hydra.core.error.model.UndefinedTypeVariableInTypeApplicationError+undefinedTypeVariableInTypeApplicationErrorName :: Typed.TypedTerm ErrorModel.UndefinedTypeVariableInTypeApplicationError -> Typed.TypedTerm Model.Name+undefinedTypeVariableInTypeApplicationErrorName x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.UndefinedTypeVariableInTypeApplicationError"),+ Model.projectionFieldName = (Model.Name "name")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.error.model.UndefinedTypeVariableInTypeApplicationError+undefinedTypeVariableInTypeApplicationErrorUndefinedTypeVariableInTypeApplicationError :: Typed.TypedName ErrorModel.UndefinedTypeVariableInTypeApplicationError+undefinedTypeVariableInTypeApplicationErrorUndefinedTypeVariableInTypeApplicationError =+ Typed.TypedName (Model.Name "hydra.core.error.model.UndefinedTypeVariableInTypeApplicationError")++-- | DSL updater for the location field of hydra.core.error.model.UndefinedTypeVariableInTypeApplicationError+undefinedTypeVariableInTypeApplicationErrorWithLocation :: Typed.TypedTerm ErrorModel.UndefinedTypeVariableInTypeApplicationError -> Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm ErrorModel.UndefinedTypeVariableInTypeApplicationError+undefinedTypeVariableInTypeApplicationErrorWithLocation original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.UndefinedTypeVariableInTypeApplicationError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.UndefinedTypeVariableInTypeApplicationError"),+ Model.projectionFieldName = (Model.Name "name")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the name field of hydra.core.error.model.UndefinedTypeVariableInTypeApplicationError+undefinedTypeVariableInTypeApplicationErrorWithName :: Typed.TypedTerm ErrorModel.UndefinedTypeVariableInTypeApplicationError -> Typed.TypedTerm Model.Name -> Typed.TypedTerm ErrorModel.UndefinedTypeVariableInTypeApplicationError+undefinedTypeVariableInTypeApplicationErrorWithName original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.UndefinedTypeVariableInTypeApplicationError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.UndefinedTypeVariableInTypeApplicationError"),+ Model.projectionFieldName = (Model.Name "location")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL constructor for hydra.core.error.model.UnexpectedTermVariantError+unexpectedTermVariantError :: Typed.TypedTerm Variants.TermVariant -> Typed.TypedTerm Model.Term -> Typed.TypedTerm ErrorModel.UnexpectedTermVariantError+unexpectedTermVariantError expectedVariant actualTerm =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.UnexpectedTermVariantError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "expectedVariant"),+ Model.fieldTerm = (Typed.unTypedTerm expectedVariant)},+ Model.Field {+ Model.fieldName = (Model.Name "actualTerm"),+ Model.fieldTerm = (Typed.unTypedTerm actualTerm)}]}))++-- | DSL accessor for the actualTerm field of hydra.core.error.model.UnexpectedTermVariantError+unexpectedTermVariantErrorActualTerm :: Typed.TypedTerm ErrorModel.UnexpectedTermVariantError -> Typed.TypedTerm Model.Term+unexpectedTermVariantErrorActualTerm x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.UnexpectedTermVariantError"),+ Model.projectionFieldName = (Model.Name "actualTerm")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the expectedVariant field of hydra.core.error.model.UnexpectedTermVariantError+unexpectedTermVariantErrorExpectedVariant :: Typed.TypedTerm ErrorModel.UnexpectedTermVariantError -> Typed.TypedTerm Variants.TermVariant+unexpectedTermVariantErrorExpectedVariant x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.UnexpectedTermVariantError"),+ Model.projectionFieldName = (Model.Name "expectedVariant")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.error.model.UnexpectedTermVariantError+unexpectedTermVariantErrorUnexpectedTermVariantError :: Typed.TypedName ErrorModel.UnexpectedTermVariantError+unexpectedTermVariantErrorUnexpectedTermVariantError =+ Typed.TypedName (Model.Name "hydra.core.error.model.UnexpectedTermVariantError")++-- | DSL updater for the actualTerm field of hydra.core.error.model.UnexpectedTermVariantError+unexpectedTermVariantErrorWithActualTerm :: Typed.TypedTerm ErrorModel.UnexpectedTermVariantError -> Typed.TypedTerm Model.Term -> Typed.TypedTerm ErrorModel.UnexpectedTermVariantError+unexpectedTermVariantErrorWithActualTerm original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.UnexpectedTermVariantError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "expectedVariant"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.UnexpectedTermVariantError"),+ Model.projectionFieldName = (Model.Name "expectedVariant")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "actualTerm"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL updater for the expectedVariant field of hydra.core.error.model.UnexpectedTermVariantError+unexpectedTermVariantErrorWithExpectedVariant :: Typed.TypedTerm ErrorModel.UnexpectedTermVariantError -> Typed.TypedTerm Variants.TermVariant -> Typed.TypedTerm ErrorModel.UnexpectedTermVariantError+unexpectedTermVariantErrorWithExpectedVariant original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.UnexpectedTermVariantError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "expectedVariant"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "actualTerm"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.UnexpectedTermVariantError"),+ Model.projectionFieldName = (Model.Name "actualTerm")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL constructor for hydra.core.error.model.UnexpectedTypeVariantError+unexpectedTypeVariantError :: Typed.TypedTerm Variants.TypeVariant -> Typed.TypedTerm Model.Type -> Typed.TypedTerm ErrorModel.UnexpectedTypeVariantError+unexpectedTypeVariantError expectedVariant actualType =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.UnexpectedTypeVariantError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "expectedVariant"),+ Model.fieldTerm = (Typed.unTypedTerm expectedVariant)},+ Model.Field {+ Model.fieldName = (Model.Name "actualType"),+ Model.fieldTerm = (Typed.unTypedTerm actualType)}]}))++-- | DSL accessor for the actualType field of hydra.core.error.model.UnexpectedTypeVariantError+unexpectedTypeVariantErrorActualType :: Typed.TypedTerm ErrorModel.UnexpectedTypeVariantError -> Typed.TypedTerm Model.Type+unexpectedTypeVariantErrorActualType x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.UnexpectedTypeVariantError"),+ Model.projectionFieldName = (Model.Name "actualType")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the expectedVariant field of hydra.core.error.model.UnexpectedTypeVariantError+unexpectedTypeVariantErrorExpectedVariant :: Typed.TypedTerm ErrorModel.UnexpectedTypeVariantError -> Typed.TypedTerm Variants.TypeVariant+unexpectedTypeVariantErrorExpectedVariant x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.UnexpectedTypeVariantError"),+ Model.projectionFieldName = (Model.Name "expectedVariant")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.error.model.UnexpectedTypeVariantError+unexpectedTypeVariantErrorUnexpectedTypeVariantError :: Typed.TypedName ErrorModel.UnexpectedTypeVariantError+unexpectedTypeVariantErrorUnexpectedTypeVariantError =+ Typed.TypedName (Model.Name "hydra.core.error.model.UnexpectedTypeVariantError")++-- | DSL updater for the actualType field of hydra.core.error.model.UnexpectedTypeVariantError+unexpectedTypeVariantErrorWithActualType :: Typed.TypedTerm ErrorModel.UnexpectedTypeVariantError -> Typed.TypedTerm Model.Type -> Typed.TypedTerm ErrorModel.UnexpectedTypeVariantError+unexpectedTypeVariantErrorWithActualType original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.UnexpectedTypeVariantError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "expectedVariant"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.UnexpectedTypeVariantError"),+ Model.projectionFieldName = (Model.Name "expectedVariant")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "actualType"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL updater for the expectedVariant field of hydra.core.error.model.UnexpectedTypeVariantError+unexpectedTypeVariantErrorWithExpectedVariant :: Typed.TypedTerm ErrorModel.UnexpectedTypeVariantError -> Typed.TypedTerm Variants.TypeVariant -> Typed.TypedTerm ErrorModel.UnexpectedTypeVariantError+unexpectedTypeVariantErrorWithExpectedVariant original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.UnexpectedTypeVariantError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "expectedVariant"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "actualType"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.UnexpectedTypeVariantError"),+ Model.projectionFieldName = (Model.Name "actualType")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL constructor for hydra.core.error.model.UnknownCaseAlternativeError+unknownCaseAlternativeError :: Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm Model.Name -> Typed.TypedTerm Model.Name -> Typed.TypedTerm ErrorModel.UnknownCaseAlternativeError+unknownCaseAlternativeError location typeName name =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.UnknownCaseAlternativeError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Typed.unTypedTerm location)},+ Model.Field {+ Model.fieldName = (Model.Name "typeName"),+ Model.fieldTerm = (Typed.unTypedTerm typeName)},+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Typed.unTypedTerm name)}]}))++-- | DSL accessor for the location field of hydra.core.error.model.UnknownCaseAlternativeError+unknownCaseAlternativeErrorLocation :: Typed.TypedTerm ErrorModel.UnknownCaseAlternativeError -> Typed.TypedTerm Paths.SubtermPath+unknownCaseAlternativeErrorLocation x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.UnknownCaseAlternativeError"),+ Model.projectionFieldName = (Model.Name "location")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the name field of hydra.core.error.model.UnknownCaseAlternativeError+unknownCaseAlternativeErrorName :: Typed.TypedTerm ErrorModel.UnknownCaseAlternativeError -> Typed.TypedTerm Model.Name+unknownCaseAlternativeErrorName x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.UnknownCaseAlternativeError"),+ Model.projectionFieldName = (Model.Name "name")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the typeName field of hydra.core.error.model.UnknownCaseAlternativeError+unknownCaseAlternativeErrorTypeName :: Typed.TypedTerm ErrorModel.UnknownCaseAlternativeError -> Typed.TypedTerm Model.Name+unknownCaseAlternativeErrorTypeName x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.UnknownCaseAlternativeError"),+ Model.projectionFieldName = (Model.Name "typeName")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.error.model.UnknownCaseAlternativeError+unknownCaseAlternativeErrorUnknownCaseAlternativeError :: Typed.TypedName ErrorModel.UnknownCaseAlternativeError+unknownCaseAlternativeErrorUnknownCaseAlternativeError =+ Typed.TypedName (Model.Name "hydra.core.error.model.UnknownCaseAlternativeError")++-- | DSL updater for the location field of hydra.core.error.model.UnknownCaseAlternativeError+unknownCaseAlternativeErrorWithLocation :: Typed.TypedTerm ErrorModel.UnknownCaseAlternativeError -> Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm ErrorModel.UnknownCaseAlternativeError+unknownCaseAlternativeErrorWithLocation original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.UnknownCaseAlternativeError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "typeName"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.UnknownCaseAlternativeError"),+ Model.projectionFieldName = (Model.Name "typeName")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.UnknownCaseAlternativeError"),+ Model.projectionFieldName = (Model.Name "name")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the name field of hydra.core.error.model.UnknownCaseAlternativeError+unknownCaseAlternativeErrorWithName :: Typed.TypedTerm ErrorModel.UnknownCaseAlternativeError -> Typed.TypedTerm Model.Name -> Typed.TypedTerm ErrorModel.UnknownCaseAlternativeError+unknownCaseAlternativeErrorWithName original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.UnknownCaseAlternativeError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.UnknownCaseAlternativeError"),+ Model.projectionFieldName = (Model.Name "location")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "typeName"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.UnknownCaseAlternativeError"),+ Model.projectionFieldName = (Model.Name "typeName")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL updater for the typeName field of hydra.core.error.model.UnknownCaseAlternativeError+unknownCaseAlternativeErrorWithTypeName :: Typed.TypedTerm ErrorModel.UnknownCaseAlternativeError -> Typed.TypedTerm Model.Name -> Typed.TypedTerm ErrorModel.UnknownCaseAlternativeError+unknownCaseAlternativeErrorWithTypeName original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.UnknownCaseAlternativeError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.UnknownCaseAlternativeError"),+ Model.projectionFieldName = (Model.Name "location")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "typeName"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.UnknownCaseAlternativeError"),+ Model.projectionFieldName = (Model.Name "name")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL constructor for hydra.core.error.model.UnknownPrimitiveNameError+unknownPrimitiveNameError :: Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm Model.Name -> Typed.TypedTerm ErrorModel.UnknownPrimitiveNameError+unknownPrimitiveNameError location name =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.UnknownPrimitiveNameError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Typed.unTypedTerm location)},+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Typed.unTypedTerm name)}]}))++-- | DSL accessor for the location field of hydra.core.error.model.UnknownPrimitiveNameError+unknownPrimitiveNameErrorLocation :: Typed.TypedTerm ErrorModel.UnknownPrimitiveNameError -> Typed.TypedTerm Paths.SubtermPath+unknownPrimitiveNameErrorLocation x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.UnknownPrimitiveNameError"),+ Model.projectionFieldName = (Model.Name "location")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the name field of hydra.core.error.model.UnknownPrimitiveNameError+unknownPrimitiveNameErrorName :: Typed.TypedTerm ErrorModel.UnknownPrimitiveNameError -> Typed.TypedTerm Model.Name+unknownPrimitiveNameErrorName x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.UnknownPrimitiveNameError"),+ Model.projectionFieldName = (Model.Name "name")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.error.model.UnknownPrimitiveNameError+unknownPrimitiveNameErrorUnknownPrimitiveNameError :: Typed.TypedName ErrorModel.UnknownPrimitiveNameError+unknownPrimitiveNameErrorUnknownPrimitiveNameError =+ Typed.TypedName (Model.Name "hydra.core.error.model.UnknownPrimitiveNameError")++-- | DSL updater for the location field of hydra.core.error.model.UnknownPrimitiveNameError+unknownPrimitiveNameErrorWithLocation :: Typed.TypedTerm ErrorModel.UnknownPrimitiveNameError -> Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm ErrorModel.UnknownPrimitiveNameError+unknownPrimitiveNameErrorWithLocation original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.UnknownPrimitiveNameError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.UnknownPrimitiveNameError"),+ Model.projectionFieldName = (Model.Name "name")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the name field of hydra.core.error.model.UnknownPrimitiveNameError+unknownPrimitiveNameErrorWithName :: Typed.TypedTerm ErrorModel.UnknownPrimitiveNameError -> Typed.TypedTerm Model.Name -> Typed.TypedTerm ErrorModel.UnknownPrimitiveNameError+unknownPrimitiveNameErrorWithName original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.UnknownPrimitiveNameError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.UnknownPrimitiveNameError"),+ Model.projectionFieldName = (Model.Name "location")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL constructor for hydra.core.error.model.UnknownProjectedFieldError+unknownProjectedFieldError :: Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm Model.Name -> Typed.TypedTerm Model.Name -> Typed.TypedTerm ErrorModel.UnknownProjectedFieldError+unknownProjectedFieldError location typeName fieldName =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.UnknownProjectedFieldError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Typed.unTypedTerm location)},+ Model.Field {+ Model.fieldName = (Model.Name "typeName"),+ Model.fieldTerm = (Typed.unTypedTerm typeName)},+ Model.Field {+ Model.fieldName = (Model.Name "fieldName"),+ Model.fieldTerm = (Typed.unTypedTerm fieldName)}]}))++-- | DSL accessor for the fieldName field of hydra.core.error.model.UnknownProjectedFieldError+unknownProjectedFieldErrorFieldName :: Typed.TypedTerm ErrorModel.UnknownProjectedFieldError -> Typed.TypedTerm Model.Name+unknownProjectedFieldErrorFieldName x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.UnknownProjectedFieldError"),+ Model.projectionFieldName = (Model.Name "fieldName")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the location field of hydra.core.error.model.UnknownProjectedFieldError+unknownProjectedFieldErrorLocation :: Typed.TypedTerm ErrorModel.UnknownProjectedFieldError -> Typed.TypedTerm Paths.SubtermPath+unknownProjectedFieldErrorLocation x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.UnknownProjectedFieldError"),+ Model.projectionFieldName = (Model.Name "location")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the typeName field of hydra.core.error.model.UnknownProjectedFieldError+unknownProjectedFieldErrorTypeName :: Typed.TypedTerm ErrorModel.UnknownProjectedFieldError -> Typed.TypedTerm Model.Name+unknownProjectedFieldErrorTypeName x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.UnknownProjectedFieldError"),+ Model.projectionFieldName = (Model.Name "typeName")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.error.model.UnknownProjectedFieldError+unknownProjectedFieldErrorUnknownProjectedFieldError :: Typed.TypedName ErrorModel.UnknownProjectedFieldError+unknownProjectedFieldErrorUnknownProjectedFieldError =+ Typed.TypedName (Model.Name "hydra.core.error.model.UnknownProjectedFieldError")++-- | DSL updater for the fieldName field of hydra.core.error.model.UnknownProjectedFieldError+unknownProjectedFieldErrorWithFieldName :: Typed.TypedTerm ErrorModel.UnknownProjectedFieldError -> Typed.TypedTerm Model.Name -> Typed.TypedTerm ErrorModel.UnknownProjectedFieldError+unknownProjectedFieldErrorWithFieldName original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.UnknownProjectedFieldError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.UnknownProjectedFieldError"),+ Model.projectionFieldName = (Model.Name "location")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "typeName"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.UnknownProjectedFieldError"),+ Model.projectionFieldName = (Model.Name "typeName")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "fieldName"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL updater for the location field of hydra.core.error.model.UnknownProjectedFieldError+unknownProjectedFieldErrorWithLocation :: Typed.TypedTerm ErrorModel.UnknownProjectedFieldError -> Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm ErrorModel.UnknownProjectedFieldError+unknownProjectedFieldErrorWithLocation original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.UnknownProjectedFieldError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "typeName"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.UnknownProjectedFieldError"),+ Model.projectionFieldName = (Model.Name "typeName")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "fieldName"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.UnknownProjectedFieldError"),+ Model.projectionFieldName = (Model.Name "fieldName")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the typeName field of hydra.core.error.model.UnknownProjectedFieldError+unknownProjectedFieldErrorWithTypeName :: Typed.TypedTerm ErrorModel.UnknownProjectedFieldError -> Typed.TypedTerm Model.Name -> Typed.TypedTerm ErrorModel.UnknownProjectedFieldError+unknownProjectedFieldErrorWithTypeName original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.UnknownProjectedFieldError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.UnknownProjectedFieldError"),+ Model.projectionFieldName = (Model.Name "location")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "typeName"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "fieldName"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.UnknownProjectedFieldError"),+ Model.projectionFieldName = (Model.Name "fieldName")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL constructor for hydra.core.error.model.UnnecessaryIdentityApplicationError+unnecessaryIdentityApplicationError :: Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm ErrorModel.UnnecessaryIdentityApplicationError+unnecessaryIdentityApplicationError location =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.UnnecessaryIdentityApplicationError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Typed.unTypedTerm location)}]}))++-- | DSL accessor for the location field of hydra.core.error.model.UnnecessaryIdentityApplicationError+unnecessaryIdentityApplicationErrorLocation :: Typed.TypedTerm ErrorModel.UnnecessaryIdentityApplicationError -> Typed.TypedTerm Paths.SubtermPath+unnecessaryIdentityApplicationErrorLocation x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.UnnecessaryIdentityApplicationError"),+ Model.projectionFieldName = (Model.Name "location")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.error.model.UnnecessaryIdentityApplicationError+unnecessaryIdentityApplicationErrorUnnecessaryIdentityApplicationError :: Typed.TypedName ErrorModel.UnnecessaryIdentityApplicationError+unnecessaryIdentityApplicationErrorUnnecessaryIdentityApplicationError =+ Typed.TypedName (Model.Name "hydra.core.error.model.UnnecessaryIdentityApplicationError")++-- | DSL updater for the location field of hydra.core.error.model.UnnecessaryIdentityApplicationError+unnecessaryIdentityApplicationErrorWithLocation :: Typed.TypedTerm ErrorModel.UnnecessaryIdentityApplicationError -> Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm ErrorModel.UnnecessaryIdentityApplicationError+unnecessaryIdentityApplicationErrorWithLocation original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.UnnecessaryIdentityApplicationError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL constructor for hydra.core.error.model.UnresolvedNominalTypeError+unresolvedNominalTypeError :: Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm Model.Name -> Typed.TypedTerm ErrorModel.UnresolvedNominalTypeError+unresolvedNominalTypeError location typeName =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.UnresolvedNominalTypeError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Typed.unTypedTerm location)},+ Model.Field {+ Model.fieldName = (Model.Name "typeName"),+ Model.fieldTerm = (Typed.unTypedTerm typeName)}]}))++-- | DSL accessor for the location field of hydra.core.error.model.UnresolvedNominalTypeError+unresolvedNominalTypeErrorLocation :: Typed.TypedTerm ErrorModel.UnresolvedNominalTypeError -> Typed.TypedTerm Paths.SubtermPath+unresolvedNominalTypeErrorLocation x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.UnresolvedNominalTypeError"),+ Model.projectionFieldName = (Model.Name "location")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the typeName field of hydra.core.error.model.UnresolvedNominalTypeError+unresolvedNominalTypeErrorTypeName :: Typed.TypedTerm ErrorModel.UnresolvedNominalTypeError -> Typed.TypedTerm Model.Name+unresolvedNominalTypeErrorTypeName x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.UnresolvedNominalTypeError"),+ Model.projectionFieldName = (Model.Name "typeName")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.error.model.UnresolvedNominalTypeError+unresolvedNominalTypeErrorUnresolvedNominalTypeError :: Typed.TypedName ErrorModel.UnresolvedNominalTypeError+unresolvedNominalTypeErrorUnresolvedNominalTypeError =+ Typed.TypedName (Model.Name "hydra.core.error.model.UnresolvedNominalTypeError")++-- | DSL updater for the location field of hydra.core.error.model.UnresolvedNominalTypeError+unresolvedNominalTypeErrorWithLocation :: Typed.TypedTerm ErrorModel.UnresolvedNominalTypeError -> Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm ErrorModel.UnresolvedNominalTypeError+unresolvedNominalTypeErrorWithLocation original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.UnresolvedNominalTypeError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "typeName"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.UnresolvedNominalTypeError"),+ Model.projectionFieldName = (Model.Name "typeName")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the typeName field of hydra.core.error.model.UnresolvedNominalTypeError+unresolvedNominalTypeErrorWithTypeName :: Typed.TypedTerm ErrorModel.UnresolvedNominalTypeError -> Typed.TypedTerm Model.Name -> Typed.TypedTerm ErrorModel.UnresolvedNominalTypeError+unresolvedNominalTypeErrorWithTypeName original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.UnresolvedNominalTypeError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.UnresolvedNominalTypeError"),+ Model.projectionFieldName = (Model.Name "location")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "typeName"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL constructor for hydra.core.error.model.UntypedTermVariableError+untypedTermVariableError :: Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm Model.Name -> Typed.TypedTerm ErrorModel.UntypedTermVariableError+untypedTermVariableError location name =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.UntypedTermVariableError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Typed.unTypedTerm location)},+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Typed.unTypedTerm name)}]}))++-- | DSL accessor for the location field of hydra.core.error.model.UntypedTermVariableError+untypedTermVariableErrorLocation :: Typed.TypedTerm ErrorModel.UntypedTermVariableError -> Typed.TypedTerm Paths.SubtermPath+untypedTermVariableErrorLocation x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.UntypedTermVariableError"),+ Model.projectionFieldName = (Model.Name "location")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the name field of hydra.core.error.model.UntypedTermVariableError+untypedTermVariableErrorName :: Typed.TypedTerm ErrorModel.UntypedTermVariableError -> Typed.TypedTerm Model.Name+untypedTermVariableErrorName x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.UntypedTermVariableError"),+ Model.projectionFieldName = (Model.Name "name")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.error.model.UntypedTermVariableError+untypedTermVariableErrorUntypedTermVariableError :: Typed.TypedName ErrorModel.UntypedTermVariableError+untypedTermVariableErrorUntypedTermVariableError =+ Typed.TypedName (Model.Name "hydra.core.error.model.UntypedTermVariableError")++-- | DSL updater for the location field of hydra.core.error.model.UntypedTermVariableError+untypedTermVariableErrorWithLocation :: Typed.TypedTerm ErrorModel.UntypedTermVariableError -> Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm ErrorModel.UntypedTermVariableError+untypedTermVariableErrorWithLocation original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.UntypedTermVariableError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.UntypedTermVariableError"),+ Model.projectionFieldName = (Model.Name "name")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the name field of hydra.core.error.model.UntypedTermVariableError+untypedTermVariableErrorWithName :: Typed.TypedTerm ErrorModel.UntypedTermVariableError -> Typed.TypedTerm Model.Name -> Typed.TypedTerm ErrorModel.UntypedTermVariableError+untypedTermVariableErrorWithName original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.UntypedTermVariableError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.UntypedTermVariableError"),+ Model.projectionFieldName = (Model.Name "location")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL constructor for hydra.core.error.model.VoidInNonBottomPositionError+voidInNonBottomPositionError :: Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm ErrorModel.VoidInNonBottomPositionError+voidInNonBottomPositionError location =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.VoidInNonBottomPositionError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Typed.unTypedTerm location)}]}))++-- | DSL accessor for the location field of hydra.core.error.model.VoidInNonBottomPositionError+voidInNonBottomPositionErrorLocation :: Typed.TypedTerm ErrorModel.VoidInNonBottomPositionError -> Typed.TypedTerm Paths.SubtermPath+voidInNonBottomPositionErrorLocation x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.model.VoidInNonBottomPositionError"),+ Model.projectionFieldName = (Model.Name "location")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.error.model.VoidInNonBottomPositionError+voidInNonBottomPositionErrorVoidInNonBottomPositionError :: Typed.TypedName ErrorModel.VoidInNonBottomPositionError+voidInNonBottomPositionErrorVoidInNonBottomPositionError =+ Typed.TypedName (Model.Name "hydra.core.error.model.VoidInNonBottomPositionError")++-- | DSL updater for the location field of hydra.core.error.model.VoidInNonBottomPositionError+voidInNonBottomPositionErrorWithLocation :: Typed.TypedTerm ErrorModel.VoidInNonBottomPositionError -> Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm ErrorModel.VoidInNonBottomPositionError+voidInNonBottomPositionErrorWithLocation original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.VoidInNonBottomPositionError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))
@@ -0,0 +1,1269 @@+-- Note: this is an automatically generated file. Do not edit.++-- | DSL functions for hydra.core.error.packaging++module Hydra.Core.Dsl.Error.Packaging where++import qualified Hydra.Core.Decode.Error.Packaging as DecodeErrorPackaging+import qualified Hydra.Core.Dsl.Model as DslModel+import qualified Hydra.Core.Dsl.Packaging as DslPackaging+import qualified Hydra.Core.Dsl.Util as DslUtil+import qualified Hydra.Core.Encode.Error.Packaging as EncodeErrorPackaging+import qualified Hydra.Core.Error.Packaging as ErrorPackaging+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Util as Util+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | DSL constructor for hydra.core.error.packaging.ConflictingModuleNameError+conflictingModuleNameError :: Typed.TypedTerm Packaging.ModuleName -> Typed.TypedTerm Packaging.ModuleName -> Typed.TypedTerm ErrorPackaging.ConflictingModuleNameError+conflictingModuleNameError first second =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.packaging.ConflictingModuleNameError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "first"),+ Model.fieldTerm = (Typed.unTypedTerm first)},+ Model.Field {+ Model.fieldName = (Model.Name "second"),+ Model.fieldTerm = (Typed.unTypedTerm second)}]}))++-- | DSL name token for hydra.core.error.packaging.ConflictingModuleNameError+conflictingModuleNameErrorConflictingModuleNameError :: Typed.TypedName ErrorPackaging.ConflictingModuleNameError+conflictingModuleNameErrorConflictingModuleNameError =+ Typed.TypedName (Model.Name "hydra.core.error.packaging.ConflictingModuleNameError")++-- | DSL accessor for the first field of hydra.core.error.packaging.ConflictingModuleNameError+conflictingModuleNameErrorFirst :: Typed.TypedTerm ErrorPackaging.ConflictingModuleNameError -> Typed.TypedTerm Packaging.ModuleName+conflictingModuleNameErrorFirst x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.packaging.ConflictingModuleNameError"),+ Model.projectionFieldName = (Model.Name "first")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the second field of hydra.core.error.packaging.ConflictingModuleNameError+conflictingModuleNameErrorSecond :: Typed.TypedTerm ErrorPackaging.ConflictingModuleNameError -> Typed.TypedTerm Packaging.ModuleName+conflictingModuleNameErrorSecond x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.packaging.ConflictingModuleNameError"),+ Model.projectionFieldName = (Model.Name "second")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL updater for the first field of hydra.core.error.packaging.ConflictingModuleNameError+conflictingModuleNameErrorWithFirst :: Typed.TypedTerm ErrorPackaging.ConflictingModuleNameError -> Typed.TypedTerm Packaging.ModuleName -> Typed.TypedTerm ErrorPackaging.ConflictingModuleNameError+conflictingModuleNameErrorWithFirst original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.packaging.ConflictingModuleNameError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "first"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "second"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.packaging.ConflictingModuleNameError"),+ Model.projectionFieldName = (Model.Name "second")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the second field of hydra.core.error.packaging.ConflictingModuleNameError+conflictingModuleNameErrorWithSecond :: Typed.TypedTerm ErrorPackaging.ConflictingModuleNameError -> Typed.TypedTerm Packaging.ModuleName -> Typed.TypedTerm ErrorPackaging.ConflictingModuleNameError+conflictingModuleNameErrorWithSecond original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.packaging.ConflictingModuleNameError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "first"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.packaging.ConflictingModuleNameError"),+ Model.projectionFieldName = (Model.Name "first")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "second"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL constructor for hydra.core.error.packaging.ConflictingVariantNameError+conflictingVariantNameError :: Typed.TypedTerm Packaging.ModuleName -> Typed.TypedTerm Model.Name -> Typed.TypedTerm Model.Name -> Typed.TypedTerm Model.Name -> Typed.TypedTerm ErrorPackaging.ConflictingVariantNameError+conflictingVariantNameError moduleName typeName variantName conflictingName =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.packaging.ConflictingVariantNameError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "moduleName"),+ Model.fieldTerm = (Typed.unTypedTerm moduleName)},+ Model.Field {+ Model.fieldName = (Model.Name "typeName"),+ Model.fieldTerm = (Typed.unTypedTerm typeName)},+ Model.Field {+ Model.fieldName = (Model.Name "variantName"),+ Model.fieldTerm = (Typed.unTypedTerm variantName)},+ Model.Field {+ Model.fieldName = (Model.Name "conflictingName"),+ Model.fieldTerm = (Typed.unTypedTerm conflictingName)}]}))++-- | DSL accessor for the conflictingName field of hydra.core.error.packaging.ConflictingVariantNameError+conflictingVariantNameErrorConflictingName :: Typed.TypedTerm ErrorPackaging.ConflictingVariantNameError -> Typed.TypedTerm Model.Name+conflictingVariantNameErrorConflictingName x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.packaging.ConflictingVariantNameError"),+ Model.projectionFieldName = (Model.Name "conflictingName")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.error.packaging.ConflictingVariantNameError+conflictingVariantNameErrorConflictingVariantNameError :: Typed.TypedName ErrorPackaging.ConflictingVariantNameError+conflictingVariantNameErrorConflictingVariantNameError =+ Typed.TypedName (Model.Name "hydra.core.error.packaging.ConflictingVariantNameError")++-- | DSL accessor for the moduleName field of hydra.core.error.packaging.ConflictingVariantNameError+conflictingVariantNameErrorModuleName :: Typed.TypedTerm ErrorPackaging.ConflictingVariantNameError -> Typed.TypedTerm Packaging.ModuleName+conflictingVariantNameErrorModuleName x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.packaging.ConflictingVariantNameError"),+ Model.projectionFieldName = (Model.Name "moduleName")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the typeName field of hydra.core.error.packaging.ConflictingVariantNameError+conflictingVariantNameErrorTypeName :: Typed.TypedTerm ErrorPackaging.ConflictingVariantNameError -> Typed.TypedTerm Model.Name+conflictingVariantNameErrorTypeName x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.packaging.ConflictingVariantNameError"),+ Model.projectionFieldName = (Model.Name "typeName")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the variantName field of hydra.core.error.packaging.ConflictingVariantNameError+conflictingVariantNameErrorVariantName :: Typed.TypedTerm ErrorPackaging.ConflictingVariantNameError -> Typed.TypedTerm Model.Name+conflictingVariantNameErrorVariantName x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.packaging.ConflictingVariantNameError"),+ Model.projectionFieldName = (Model.Name "variantName")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL updater for the conflictingName field of hydra.core.error.packaging.ConflictingVariantNameError+conflictingVariantNameErrorWithConflictingName :: Typed.TypedTerm ErrorPackaging.ConflictingVariantNameError -> Typed.TypedTerm Model.Name -> Typed.TypedTerm ErrorPackaging.ConflictingVariantNameError+conflictingVariantNameErrorWithConflictingName original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.packaging.ConflictingVariantNameError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "moduleName"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.packaging.ConflictingVariantNameError"),+ Model.projectionFieldName = (Model.Name "moduleName")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "typeName"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.packaging.ConflictingVariantNameError"),+ Model.projectionFieldName = (Model.Name "typeName")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "variantName"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.packaging.ConflictingVariantNameError"),+ Model.projectionFieldName = (Model.Name "variantName")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "conflictingName"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL updater for the moduleName field of hydra.core.error.packaging.ConflictingVariantNameError+conflictingVariantNameErrorWithModuleName :: Typed.TypedTerm ErrorPackaging.ConflictingVariantNameError -> Typed.TypedTerm Packaging.ModuleName -> Typed.TypedTerm ErrorPackaging.ConflictingVariantNameError+conflictingVariantNameErrorWithModuleName original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.packaging.ConflictingVariantNameError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "moduleName"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "typeName"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.packaging.ConflictingVariantNameError"),+ Model.projectionFieldName = (Model.Name "typeName")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "variantName"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.packaging.ConflictingVariantNameError"),+ Model.projectionFieldName = (Model.Name "variantName")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "conflictingName"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.packaging.ConflictingVariantNameError"),+ Model.projectionFieldName = (Model.Name "conflictingName")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the typeName field of hydra.core.error.packaging.ConflictingVariantNameError+conflictingVariantNameErrorWithTypeName :: Typed.TypedTerm ErrorPackaging.ConflictingVariantNameError -> Typed.TypedTerm Model.Name -> Typed.TypedTerm ErrorPackaging.ConflictingVariantNameError+conflictingVariantNameErrorWithTypeName original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.packaging.ConflictingVariantNameError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "moduleName"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.packaging.ConflictingVariantNameError"),+ Model.projectionFieldName = (Model.Name "moduleName")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "typeName"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "variantName"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.packaging.ConflictingVariantNameError"),+ Model.projectionFieldName = (Model.Name "variantName")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "conflictingName"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.packaging.ConflictingVariantNameError"),+ Model.projectionFieldName = (Model.Name "conflictingName")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the variantName field of hydra.core.error.packaging.ConflictingVariantNameError+conflictingVariantNameErrorWithVariantName :: Typed.TypedTerm ErrorPackaging.ConflictingVariantNameError -> Typed.TypedTerm Model.Name -> Typed.TypedTerm ErrorPackaging.ConflictingVariantNameError+conflictingVariantNameErrorWithVariantName original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.packaging.ConflictingVariantNameError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "moduleName"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.packaging.ConflictingVariantNameError"),+ Model.projectionFieldName = (Model.Name "moduleName")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "typeName"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.packaging.ConflictingVariantNameError"),+ Model.projectionFieldName = (Model.Name "typeName")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "variantName"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "conflictingName"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.packaging.ConflictingVariantNameError"),+ Model.projectionFieldName = (Model.Name "conflictingName")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL constructor for hydra.core.error.packaging.DefinitionNotInModuleNameError+definitionNotInModuleNameError :: Typed.TypedTerm Packaging.ModuleName -> Typed.TypedTerm Model.Name -> Typed.TypedTerm ErrorPackaging.DefinitionNotInModuleNameError+definitionNotInModuleNameError moduleName name =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.packaging.DefinitionNotInModuleNameError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "moduleName"),+ Model.fieldTerm = (Typed.unTypedTerm moduleName)},+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Typed.unTypedTerm name)}]}))++-- | DSL name token for hydra.core.error.packaging.DefinitionNotInModuleNameError+definitionNotInModuleNameErrorDefinitionNotInModuleNameError :: Typed.TypedName ErrorPackaging.DefinitionNotInModuleNameError+definitionNotInModuleNameErrorDefinitionNotInModuleNameError =+ Typed.TypedName (Model.Name "hydra.core.error.packaging.DefinitionNotInModuleNameError")++-- | DSL accessor for the moduleName field of hydra.core.error.packaging.DefinitionNotInModuleNameError+definitionNotInModuleNameErrorModuleName :: Typed.TypedTerm ErrorPackaging.DefinitionNotInModuleNameError -> Typed.TypedTerm Packaging.ModuleName+definitionNotInModuleNameErrorModuleName x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.packaging.DefinitionNotInModuleNameError"),+ Model.projectionFieldName = (Model.Name "moduleName")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the name field of hydra.core.error.packaging.DefinitionNotInModuleNameError+definitionNotInModuleNameErrorName :: Typed.TypedTerm ErrorPackaging.DefinitionNotInModuleNameError -> Typed.TypedTerm Model.Name+definitionNotInModuleNameErrorName x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.packaging.DefinitionNotInModuleNameError"),+ Model.projectionFieldName = (Model.Name "name")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL updater for the moduleName field of hydra.core.error.packaging.DefinitionNotInModuleNameError+definitionNotInModuleNameErrorWithModuleName :: Typed.TypedTerm ErrorPackaging.DefinitionNotInModuleNameError -> Typed.TypedTerm Packaging.ModuleName -> Typed.TypedTerm ErrorPackaging.DefinitionNotInModuleNameError+definitionNotInModuleNameErrorWithModuleName original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.packaging.DefinitionNotInModuleNameError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "moduleName"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.packaging.DefinitionNotInModuleNameError"),+ Model.projectionFieldName = (Model.Name "name")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the name field of hydra.core.error.packaging.DefinitionNotInModuleNameError+definitionNotInModuleNameErrorWithName :: Typed.TypedTerm ErrorPackaging.DefinitionNotInModuleNameError -> Typed.TypedTerm Model.Name -> Typed.TypedTerm ErrorPackaging.DefinitionNotInModuleNameError+definitionNotInModuleNameErrorWithName original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.packaging.DefinitionNotInModuleNameError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "moduleName"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.packaging.DefinitionNotInModuleNameError"),+ Model.projectionFieldName = (Model.Name "moduleName")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL constructor for hydra.core.error.packaging.DefinitionsOutOfOrderError+definitionsOutOfOrderError :: Typed.TypedTerm Packaging.ModuleName -> Typed.TypedTerm Model.Name -> Typed.TypedTerm Model.Name -> Typed.TypedTerm ErrorPackaging.DefinitionsOutOfOrderError+definitionsOutOfOrderError moduleName precedingName followingName =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.packaging.DefinitionsOutOfOrderError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "moduleName"),+ Model.fieldTerm = (Typed.unTypedTerm moduleName)},+ Model.Field {+ Model.fieldName = (Model.Name "precedingName"),+ Model.fieldTerm = (Typed.unTypedTerm precedingName)},+ Model.Field {+ Model.fieldName = (Model.Name "followingName"),+ Model.fieldTerm = (Typed.unTypedTerm followingName)}]}))++-- | DSL name token for hydra.core.error.packaging.DefinitionsOutOfOrderError+definitionsOutOfOrderErrorDefinitionsOutOfOrderError :: Typed.TypedName ErrorPackaging.DefinitionsOutOfOrderError+definitionsOutOfOrderErrorDefinitionsOutOfOrderError =+ Typed.TypedName (Model.Name "hydra.core.error.packaging.DefinitionsOutOfOrderError")++-- | DSL accessor for the followingName field of hydra.core.error.packaging.DefinitionsOutOfOrderError+definitionsOutOfOrderErrorFollowingName :: Typed.TypedTerm ErrorPackaging.DefinitionsOutOfOrderError -> Typed.TypedTerm Model.Name+definitionsOutOfOrderErrorFollowingName x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.packaging.DefinitionsOutOfOrderError"),+ Model.projectionFieldName = (Model.Name "followingName")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the moduleName field of hydra.core.error.packaging.DefinitionsOutOfOrderError+definitionsOutOfOrderErrorModuleName :: Typed.TypedTerm ErrorPackaging.DefinitionsOutOfOrderError -> Typed.TypedTerm Packaging.ModuleName+definitionsOutOfOrderErrorModuleName x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.packaging.DefinitionsOutOfOrderError"),+ Model.projectionFieldName = (Model.Name "moduleName")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the precedingName field of hydra.core.error.packaging.DefinitionsOutOfOrderError+definitionsOutOfOrderErrorPrecedingName :: Typed.TypedTerm ErrorPackaging.DefinitionsOutOfOrderError -> Typed.TypedTerm Model.Name+definitionsOutOfOrderErrorPrecedingName x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.packaging.DefinitionsOutOfOrderError"),+ Model.projectionFieldName = (Model.Name "precedingName")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL updater for the followingName field of hydra.core.error.packaging.DefinitionsOutOfOrderError+definitionsOutOfOrderErrorWithFollowingName :: Typed.TypedTerm ErrorPackaging.DefinitionsOutOfOrderError -> Typed.TypedTerm Model.Name -> Typed.TypedTerm ErrorPackaging.DefinitionsOutOfOrderError+definitionsOutOfOrderErrorWithFollowingName original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.packaging.DefinitionsOutOfOrderError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "moduleName"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.packaging.DefinitionsOutOfOrderError"),+ Model.projectionFieldName = (Model.Name "moduleName")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "precedingName"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.packaging.DefinitionsOutOfOrderError"),+ Model.projectionFieldName = (Model.Name "precedingName")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "followingName"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL updater for the moduleName field of hydra.core.error.packaging.DefinitionsOutOfOrderError+definitionsOutOfOrderErrorWithModuleName :: Typed.TypedTerm ErrorPackaging.DefinitionsOutOfOrderError -> Typed.TypedTerm Packaging.ModuleName -> Typed.TypedTerm ErrorPackaging.DefinitionsOutOfOrderError+definitionsOutOfOrderErrorWithModuleName original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.packaging.DefinitionsOutOfOrderError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "moduleName"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "precedingName"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.packaging.DefinitionsOutOfOrderError"),+ Model.projectionFieldName = (Model.Name "precedingName")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "followingName"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.packaging.DefinitionsOutOfOrderError"),+ Model.projectionFieldName = (Model.Name "followingName")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the precedingName field of hydra.core.error.packaging.DefinitionsOutOfOrderError+definitionsOutOfOrderErrorWithPrecedingName :: Typed.TypedTerm ErrorPackaging.DefinitionsOutOfOrderError -> Typed.TypedTerm Model.Name -> Typed.TypedTerm ErrorPackaging.DefinitionsOutOfOrderError+definitionsOutOfOrderErrorWithPrecedingName original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.packaging.DefinitionsOutOfOrderError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "moduleName"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.packaging.DefinitionsOutOfOrderError"),+ Model.projectionFieldName = (Model.Name "moduleName")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "precedingName"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "followingName"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.packaging.DefinitionsOutOfOrderError"),+ Model.projectionFieldName = (Model.Name "followingName")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL constructor for hydra.core.error.packaging.DuplicateDefinitionNameError+duplicateDefinitionNameError :: Typed.TypedTerm Packaging.ModuleName -> Typed.TypedTerm Model.Name -> Typed.TypedTerm ErrorPackaging.DuplicateDefinitionNameError+duplicateDefinitionNameError moduleName name =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.packaging.DuplicateDefinitionNameError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "moduleName"),+ Model.fieldTerm = (Typed.unTypedTerm moduleName)},+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Typed.unTypedTerm name)}]}))++-- | DSL name token for hydra.core.error.packaging.DuplicateDefinitionNameError+duplicateDefinitionNameErrorDuplicateDefinitionNameError :: Typed.TypedName ErrorPackaging.DuplicateDefinitionNameError+duplicateDefinitionNameErrorDuplicateDefinitionNameError =+ Typed.TypedName (Model.Name "hydra.core.error.packaging.DuplicateDefinitionNameError")++-- | DSL accessor for the moduleName field of hydra.core.error.packaging.DuplicateDefinitionNameError+duplicateDefinitionNameErrorModuleName :: Typed.TypedTerm ErrorPackaging.DuplicateDefinitionNameError -> Typed.TypedTerm Packaging.ModuleName+duplicateDefinitionNameErrorModuleName x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.packaging.DuplicateDefinitionNameError"),+ Model.projectionFieldName = (Model.Name "moduleName")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the name field of hydra.core.error.packaging.DuplicateDefinitionNameError+duplicateDefinitionNameErrorName :: Typed.TypedTerm ErrorPackaging.DuplicateDefinitionNameError -> Typed.TypedTerm Model.Name+duplicateDefinitionNameErrorName x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.packaging.DuplicateDefinitionNameError"),+ Model.projectionFieldName = (Model.Name "name")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL updater for the moduleName field of hydra.core.error.packaging.DuplicateDefinitionNameError+duplicateDefinitionNameErrorWithModuleName :: Typed.TypedTerm ErrorPackaging.DuplicateDefinitionNameError -> Typed.TypedTerm Packaging.ModuleName -> Typed.TypedTerm ErrorPackaging.DuplicateDefinitionNameError+duplicateDefinitionNameErrorWithModuleName original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.packaging.DuplicateDefinitionNameError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "moduleName"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.packaging.DuplicateDefinitionNameError"),+ Model.projectionFieldName = (Model.Name "name")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the name field of hydra.core.error.packaging.DuplicateDefinitionNameError+duplicateDefinitionNameErrorWithName :: Typed.TypedTerm ErrorPackaging.DuplicateDefinitionNameError -> Typed.TypedTerm Model.Name -> Typed.TypedTerm ErrorPackaging.DuplicateDefinitionNameError+duplicateDefinitionNameErrorWithName original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.packaging.DuplicateDefinitionNameError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "moduleName"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.packaging.DuplicateDefinitionNameError"),+ Model.projectionFieldName = (Model.Name "moduleName")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL constructor for hydra.core.error.packaging.DuplicateModuleNameError+duplicateModuleNameError :: Typed.TypedTerm Packaging.ModuleName -> Typed.TypedTerm ErrorPackaging.DuplicateModuleNameError+duplicateModuleNameError moduleName =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.packaging.DuplicateModuleNameError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "moduleName"),+ Model.fieldTerm = (Typed.unTypedTerm moduleName)}]}))++-- | DSL name token for hydra.core.error.packaging.DuplicateModuleNameError+duplicateModuleNameErrorDuplicateModuleNameError :: Typed.TypedName ErrorPackaging.DuplicateModuleNameError+duplicateModuleNameErrorDuplicateModuleNameError =+ Typed.TypedName (Model.Name "hydra.core.error.packaging.DuplicateModuleNameError")++-- | DSL accessor for the moduleName field of hydra.core.error.packaging.DuplicateModuleNameError+duplicateModuleNameErrorModuleName :: Typed.TypedTerm ErrorPackaging.DuplicateModuleNameError -> Typed.TypedTerm Packaging.ModuleName+duplicateModuleNameErrorModuleName x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.packaging.DuplicateModuleNameError"),+ Model.projectionFieldName = (Model.Name "moduleName")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL updater for the moduleName field of hydra.core.error.packaging.DuplicateModuleNameError+duplicateModuleNameErrorWithModuleName :: Typed.TypedTerm ErrorPackaging.DuplicateModuleNameError -> Typed.TypedTerm Packaging.ModuleName -> Typed.TypedTerm ErrorPackaging.DuplicateModuleNameError+duplicateModuleNameErrorWithModuleName original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.packaging.DuplicateModuleNameError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "moduleName"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL constructor for hydra.core.error.packaging.InvalidDefinitionNameError+invalidDefinitionNameError :: Typed.TypedTerm Packaging.ModuleName -> Typed.TypedTerm Model.Name -> Typed.TypedTerm Util.CaseConvention -> Typed.TypedTerm ErrorPackaging.InvalidDefinitionNameError+invalidDefinitionNameError moduleName name expectedConvention =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.packaging.InvalidDefinitionNameError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "moduleName"),+ Model.fieldTerm = (Typed.unTypedTerm moduleName)},+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Typed.unTypedTerm name)},+ Model.Field {+ Model.fieldName = (Model.Name "expectedConvention"),+ Model.fieldTerm = (Typed.unTypedTerm expectedConvention)}]}))++-- | DSL accessor for the expectedConvention field of hydra.core.error.packaging.InvalidDefinitionNameError+invalidDefinitionNameErrorExpectedConvention :: Typed.TypedTerm ErrorPackaging.InvalidDefinitionNameError -> Typed.TypedTerm Util.CaseConvention+invalidDefinitionNameErrorExpectedConvention x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.packaging.InvalidDefinitionNameError"),+ Model.projectionFieldName = (Model.Name "expectedConvention")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.error.packaging.InvalidDefinitionNameError+invalidDefinitionNameErrorInvalidDefinitionNameError :: Typed.TypedName ErrorPackaging.InvalidDefinitionNameError+invalidDefinitionNameErrorInvalidDefinitionNameError =+ Typed.TypedName (Model.Name "hydra.core.error.packaging.InvalidDefinitionNameError")++-- | DSL accessor for the moduleName field of hydra.core.error.packaging.InvalidDefinitionNameError+invalidDefinitionNameErrorModuleName :: Typed.TypedTerm ErrorPackaging.InvalidDefinitionNameError -> Typed.TypedTerm Packaging.ModuleName+invalidDefinitionNameErrorModuleName x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.packaging.InvalidDefinitionNameError"),+ Model.projectionFieldName = (Model.Name "moduleName")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the name field of hydra.core.error.packaging.InvalidDefinitionNameError+invalidDefinitionNameErrorName :: Typed.TypedTerm ErrorPackaging.InvalidDefinitionNameError -> Typed.TypedTerm Model.Name+invalidDefinitionNameErrorName x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.packaging.InvalidDefinitionNameError"),+ Model.projectionFieldName = (Model.Name "name")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL updater for the expectedConvention field of hydra.core.error.packaging.InvalidDefinitionNameError+invalidDefinitionNameErrorWithExpectedConvention :: Typed.TypedTerm ErrorPackaging.InvalidDefinitionNameError -> Typed.TypedTerm Util.CaseConvention -> Typed.TypedTerm ErrorPackaging.InvalidDefinitionNameError+invalidDefinitionNameErrorWithExpectedConvention original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.packaging.InvalidDefinitionNameError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "moduleName"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.packaging.InvalidDefinitionNameError"),+ Model.projectionFieldName = (Model.Name "moduleName")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.packaging.InvalidDefinitionNameError"),+ Model.projectionFieldName = (Model.Name "name")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "expectedConvention"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL updater for the moduleName field of hydra.core.error.packaging.InvalidDefinitionNameError+invalidDefinitionNameErrorWithModuleName :: Typed.TypedTerm ErrorPackaging.InvalidDefinitionNameError -> Typed.TypedTerm Packaging.ModuleName -> Typed.TypedTerm ErrorPackaging.InvalidDefinitionNameError+invalidDefinitionNameErrorWithModuleName original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.packaging.InvalidDefinitionNameError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "moduleName"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.packaging.InvalidDefinitionNameError"),+ Model.projectionFieldName = (Model.Name "name")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "expectedConvention"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.packaging.InvalidDefinitionNameError"),+ Model.projectionFieldName = (Model.Name "expectedConvention")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the name field of hydra.core.error.packaging.InvalidDefinitionNameError+invalidDefinitionNameErrorWithName :: Typed.TypedTerm ErrorPackaging.InvalidDefinitionNameError -> Typed.TypedTerm Model.Name -> Typed.TypedTerm ErrorPackaging.InvalidDefinitionNameError+invalidDefinitionNameErrorWithName original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.packaging.InvalidDefinitionNameError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "moduleName"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.packaging.InvalidDefinitionNameError"),+ Model.projectionFieldName = (Model.Name "moduleName")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "expectedConvention"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.packaging.InvalidDefinitionNameError"),+ Model.projectionFieldName = (Model.Name "expectedConvention")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL injection for the conflictingVariantName variant of hydra.core.error.packaging.InvalidModuleError+invalidModuleErrorConflictingVariantName :: Typed.TypedTerm ErrorPackaging.ConflictingVariantNameError -> Typed.TypedTerm ErrorPackaging.InvalidModuleError+invalidModuleErrorConflictingVariantName x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.packaging.InvalidModuleError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "conflictingVariantName"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the definitionNotInModuleName variant of hydra.core.error.packaging.InvalidModuleError+invalidModuleErrorDefinitionNotInModuleName :: Typed.TypedTerm ErrorPackaging.DefinitionNotInModuleNameError -> Typed.TypedTerm ErrorPackaging.InvalidModuleError+invalidModuleErrorDefinitionNotInModuleName x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.packaging.InvalidModuleError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "definitionNotInModuleName"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the definitionsOutOfOrder variant of hydra.core.error.packaging.InvalidModuleError+invalidModuleErrorDefinitionsOutOfOrder :: Typed.TypedTerm ErrorPackaging.DefinitionsOutOfOrderError -> Typed.TypedTerm ErrorPackaging.InvalidModuleError+invalidModuleErrorDefinitionsOutOfOrder x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.packaging.InvalidModuleError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "definitionsOutOfOrder"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the duplicateDefinitionName variant of hydra.core.error.packaging.InvalidModuleError+invalidModuleErrorDuplicateDefinitionName :: Typed.TypedTerm ErrorPackaging.DuplicateDefinitionNameError -> Typed.TypedTerm ErrorPackaging.InvalidModuleError+invalidModuleErrorDuplicateDefinitionName x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.packaging.InvalidModuleError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "duplicateDefinitionName"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the invalidDefinitionName variant of hydra.core.error.packaging.InvalidModuleError+invalidModuleErrorInvalidDefinitionName :: Typed.TypedTerm ErrorPackaging.InvalidDefinitionNameError -> Typed.TypedTerm ErrorPackaging.InvalidModuleError+invalidModuleErrorInvalidDefinitionName x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.packaging.InvalidModuleError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "invalidDefinitionName"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL name token for hydra.core.error.packaging.InvalidModuleError+invalidModuleErrorInvalidModuleError :: Typed.TypedName ErrorPackaging.InvalidModuleError+invalidModuleErrorInvalidModuleError = Typed.TypedName (Model.Name "hydra.core.error.packaging.InvalidModuleError")++-- | DSL injection for the invalidModuleNameConvention variant of hydra.core.error.packaging.InvalidModuleError+invalidModuleErrorInvalidModuleNameConvention :: Typed.TypedTerm ErrorPackaging.InvalidModuleNameConventionError -> Typed.TypedTerm ErrorPackaging.InvalidModuleError+invalidModuleErrorInvalidModuleNameConvention x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.packaging.InvalidModuleError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "invalidModuleNameConvention"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the missingDocumentation variant of hydra.core.error.packaging.InvalidModuleError+invalidModuleErrorMissingDocumentation :: Typed.TypedTerm ErrorPackaging.MissingDocumentationError -> Typed.TypedTerm ErrorPackaging.InvalidModuleError+invalidModuleErrorMissingDocumentation x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.packaging.InvalidModuleError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "missingDocumentation"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL constructor for hydra.core.error.packaging.InvalidModuleNameConventionError+invalidModuleNameConventionError :: Typed.TypedTerm Packaging.ModuleName -> Typed.TypedTerm ErrorPackaging.InvalidModuleNameConventionError+invalidModuleNameConventionError moduleName =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.packaging.InvalidModuleNameConventionError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "moduleName"),+ Model.fieldTerm = (Typed.unTypedTerm moduleName)}]}))++-- | DSL name token for hydra.core.error.packaging.InvalidModuleNameConventionError+invalidModuleNameConventionErrorInvalidModuleNameConventionError :: Typed.TypedName ErrorPackaging.InvalidModuleNameConventionError+invalidModuleNameConventionErrorInvalidModuleNameConventionError =+ Typed.TypedName (Model.Name "hydra.core.error.packaging.InvalidModuleNameConventionError")++-- | DSL accessor for the moduleName field of hydra.core.error.packaging.InvalidModuleNameConventionError+invalidModuleNameConventionErrorModuleName :: Typed.TypedTerm ErrorPackaging.InvalidModuleNameConventionError -> Typed.TypedTerm Packaging.ModuleName+invalidModuleNameConventionErrorModuleName x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.packaging.InvalidModuleNameConventionError"),+ Model.projectionFieldName = (Model.Name "moduleName")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL updater for the moduleName field of hydra.core.error.packaging.InvalidModuleNameConventionError+invalidModuleNameConventionErrorWithModuleName :: Typed.TypedTerm ErrorPackaging.InvalidModuleNameConventionError -> Typed.TypedTerm Packaging.ModuleName -> Typed.TypedTerm ErrorPackaging.InvalidModuleNameConventionError+invalidModuleNameConventionErrorWithModuleName original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.packaging.InvalidModuleNameConventionError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "moduleName"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL injection for the conflictingModuleName variant of hydra.core.error.packaging.InvalidPackageError+invalidPackageErrorConflictingModuleName :: Typed.TypedTerm ErrorPackaging.ConflictingModuleNameError -> Typed.TypedTerm ErrorPackaging.InvalidPackageError+invalidPackageErrorConflictingModuleName x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.packaging.InvalidPackageError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "conflictingModuleName"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the duplicateModuleName variant of hydra.core.error.packaging.InvalidPackageError+invalidPackageErrorDuplicateModuleName :: Typed.TypedTerm ErrorPackaging.DuplicateModuleNameError -> Typed.TypedTerm ErrorPackaging.InvalidPackageError+invalidPackageErrorDuplicateModuleName x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.packaging.InvalidPackageError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "duplicateModuleName"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the invalidModule variant of hydra.core.error.packaging.InvalidPackageError+invalidPackageErrorInvalidModule :: Typed.TypedTerm ErrorPackaging.InvalidModuleError -> Typed.TypedTerm ErrorPackaging.InvalidPackageError+invalidPackageErrorInvalidModule x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.packaging.InvalidPackageError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "invalidModule"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL name token for hydra.core.error.packaging.InvalidPackageError+invalidPackageErrorInvalidPackageError :: Typed.TypedName ErrorPackaging.InvalidPackageError+invalidPackageErrorInvalidPackageError = Typed.TypedName (Model.Name "hydra.core.error.packaging.InvalidPackageError")++-- | DSL injection for the invalidPackageName variant of hydra.core.error.packaging.InvalidPackageError+invalidPackageErrorInvalidPackageName :: Typed.TypedTerm ErrorPackaging.InvalidPackageNameError -> Typed.TypedTerm ErrorPackaging.InvalidPackageError+invalidPackageErrorInvalidPackageName x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.packaging.InvalidPackageError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "invalidPackageName"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the moduleInMultiplePackages variant of hydra.core.error.packaging.InvalidPackageError+invalidPackageErrorModuleInMultiplePackages :: Typed.TypedTerm ErrorPackaging.ModuleInMultiplePackagesError -> Typed.TypedTerm ErrorPackaging.InvalidPackageError+invalidPackageErrorModuleInMultiplePackages x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.packaging.InvalidPackageError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "moduleInMultiplePackages"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the nestedModuleName variant of hydra.core.error.packaging.InvalidPackageError+invalidPackageErrorNestedModuleName :: Typed.TypedTerm ErrorPackaging.NestedModuleNameError -> Typed.TypedTerm ErrorPackaging.InvalidPackageError+invalidPackageErrorNestedModuleName x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.packaging.InvalidPackageError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "nestedModuleName"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the undeclaredDependency variant of hydra.core.error.packaging.InvalidPackageError+invalidPackageErrorUndeclaredDependency :: Typed.TypedTerm ErrorPackaging.UndeclaredDependencyError -> Typed.TypedTerm ErrorPackaging.InvalidPackageError+invalidPackageErrorUndeclaredDependency x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.packaging.InvalidPackageError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "undeclaredDependency"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL constructor for hydra.core.error.packaging.InvalidPackageNameError+invalidPackageNameError :: Typed.TypedTerm Packaging.PackageName -> Typed.TypedTerm ErrorPackaging.InvalidPackageNameError+invalidPackageNameError packageName =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.packaging.InvalidPackageNameError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "packageName"),+ Model.fieldTerm = (Typed.unTypedTerm packageName)}]}))++-- | DSL name token for hydra.core.error.packaging.InvalidPackageNameError+invalidPackageNameErrorInvalidPackageNameError :: Typed.TypedName ErrorPackaging.InvalidPackageNameError+invalidPackageNameErrorInvalidPackageNameError =+ Typed.TypedName (Model.Name "hydra.core.error.packaging.InvalidPackageNameError")++-- | DSL accessor for the packageName field of hydra.core.error.packaging.InvalidPackageNameError+invalidPackageNameErrorPackageName :: Typed.TypedTerm ErrorPackaging.InvalidPackageNameError -> Typed.TypedTerm Packaging.PackageName+invalidPackageNameErrorPackageName x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.packaging.InvalidPackageNameError"),+ Model.projectionFieldName = (Model.Name "packageName")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL updater for the packageName field of hydra.core.error.packaging.InvalidPackageNameError+invalidPackageNameErrorWithPackageName :: Typed.TypedTerm ErrorPackaging.InvalidPackageNameError -> Typed.TypedTerm Packaging.PackageName -> Typed.TypedTerm ErrorPackaging.InvalidPackageNameError+invalidPackageNameErrorWithPackageName original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.packaging.InvalidPackageNameError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "packageName"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL constructor for hydra.core.error.packaging.MissingDocumentationError+missingDocumentationError :: Typed.TypedTerm Packaging.ModuleName -> Typed.TypedTerm Model.Name -> Typed.TypedTerm ErrorPackaging.MissingDocumentationError+missingDocumentationError moduleName name =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.packaging.MissingDocumentationError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "moduleName"),+ Model.fieldTerm = (Typed.unTypedTerm moduleName)},+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Typed.unTypedTerm name)}]}))++-- | DSL name token for hydra.core.error.packaging.MissingDocumentationError+missingDocumentationErrorMissingDocumentationError :: Typed.TypedName ErrorPackaging.MissingDocumentationError+missingDocumentationErrorMissingDocumentationError =+ Typed.TypedName (Model.Name "hydra.core.error.packaging.MissingDocumentationError")++-- | DSL accessor for the moduleName field of hydra.core.error.packaging.MissingDocumentationError+missingDocumentationErrorModuleName :: Typed.TypedTerm ErrorPackaging.MissingDocumentationError -> Typed.TypedTerm Packaging.ModuleName+missingDocumentationErrorModuleName x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.packaging.MissingDocumentationError"),+ Model.projectionFieldName = (Model.Name "moduleName")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the name field of hydra.core.error.packaging.MissingDocumentationError+missingDocumentationErrorName :: Typed.TypedTerm ErrorPackaging.MissingDocumentationError -> Typed.TypedTerm Model.Name+missingDocumentationErrorName x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.packaging.MissingDocumentationError"),+ Model.projectionFieldName = (Model.Name "name")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL updater for the moduleName field of hydra.core.error.packaging.MissingDocumentationError+missingDocumentationErrorWithModuleName :: Typed.TypedTerm ErrorPackaging.MissingDocumentationError -> Typed.TypedTerm Packaging.ModuleName -> Typed.TypedTerm ErrorPackaging.MissingDocumentationError+missingDocumentationErrorWithModuleName original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.packaging.MissingDocumentationError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "moduleName"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.packaging.MissingDocumentationError"),+ Model.projectionFieldName = (Model.Name "name")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the name field of hydra.core.error.packaging.MissingDocumentationError+missingDocumentationErrorWithName :: Typed.TypedTerm ErrorPackaging.MissingDocumentationError -> Typed.TypedTerm Model.Name -> Typed.TypedTerm ErrorPackaging.MissingDocumentationError+missingDocumentationErrorWithName original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.packaging.MissingDocumentationError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "moduleName"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.packaging.MissingDocumentationError"),+ Model.projectionFieldName = (Model.Name "moduleName")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL constructor for hydra.core.error.packaging.ModuleInMultiplePackagesError+moduleInMultiplePackagesError :: Typed.TypedTerm Packaging.ModuleName -> Typed.TypedTerm Packaging.PackageName -> Typed.TypedTerm Packaging.PackageName -> Typed.TypedTerm ErrorPackaging.ModuleInMultiplePackagesError+moduleInMultiplePackagesError moduleName firstPackage secondPackage =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.packaging.ModuleInMultiplePackagesError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "moduleName"),+ Model.fieldTerm = (Typed.unTypedTerm moduleName)},+ Model.Field {+ Model.fieldName = (Model.Name "firstPackage"),+ Model.fieldTerm = (Typed.unTypedTerm firstPackage)},+ Model.Field {+ Model.fieldName = (Model.Name "secondPackage"),+ Model.fieldTerm = (Typed.unTypedTerm secondPackage)}]}))++-- | DSL accessor for the firstPackage field of hydra.core.error.packaging.ModuleInMultiplePackagesError+moduleInMultiplePackagesErrorFirstPackage :: Typed.TypedTerm ErrorPackaging.ModuleInMultiplePackagesError -> Typed.TypedTerm Packaging.PackageName+moduleInMultiplePackagesErrorFirstPackage x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.packaging.ModuleInMultiplePackagesError"),+ Model.projectionFieldName = (Model.Name "firstPackage")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.error.packaging.ModuleInMultiplePackagesError+moduleInMultiplePackagesErrorModuleInMultiplePackagesError :: Typed.TypedName ErrorPackaging.ModuleInMultiplePackagesError+moduleInMultiplePackagesErrorModuleInMultiplePackagesError =+ Typed.TypedName (Model.Name "hydra.core.error.packaging.ModuleInMultiplePackagesError")++-- | DSL accessor for the moduleName field of hydra.core.error.packaging.ModuleInMultiplePackagesError+moduleInMultiplePackagesErrorModuleName :: Typed.TypedTerm ErrorPackaging.ModuleInMultiplePackagesError -> Typed.TypedTerm Packaging.ModuleName+moduleInMultiplePackagesErrorModuleName x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.packaging.ModuleInMultiplePackagesError"),+ Model.projectionFieldName = (Model.Name "moduleName")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the secondPackage field of hydra.core.error.packaging.ModuleInMultiplePackagesError+moduleInMultiplePackagesErrorSecondPackage :: Typed.TypedTerm ErrorPackaging.ModuleInMultiplePackagesError -> Typed.TypedTerm Packaging.PackageName+moduleInMultiplePackagesErrorSecondPackage x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.packaging.ModuleInMultiplePackagesError"),+ Model.projectionFieldName = (Model.Name "secondPackage")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL updater for the firstPackage field of hydra.core.error.packaging.ModuleInMultiplePackagesError+moduleInMultiplePackagesErrorWithFirstPackage :: Typed.TypedTerm ErrorPackaging.ModuleInMultiplePackagesError -> Typed.TypedTerm Packaging.PackageName -> Typed.TypedTerm ErrorPackaging.ModuleInMultiplePackagesError+moduleInMultiplePackagesErrorWithFirstPackage original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.packaging.ModuleInMultiplePackagesError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "moduleName"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.packaging.ModuleInMultiplePackagesError"),+ Model.projectionFieldName = (Model.Name "moduleName")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "firstPackage"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "secondPackage"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.packaging.ModuleInMultiplePackagesError"),+ Model.projectionFieldName = (Model.Name "secondPackage")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the moduleName field of hydra.core.error.packaging.ModuleInMultiplePackagesError+moduleInMultiplePackagesErrorWithModuleName :: Typed.TypedTerm ErrorPackaging.ModuleInMultiplePackagesError -> Typed.TypedTerm Packaging.ModuleName -> Typed.TypedTerm ErrorPackaging.ModuleInMultiplePackagesError+moduleInMultiplePackagesErrorWithModuleName original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.packaging.ModuleInMultiplePackagesError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "moduleName"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "firstPackage"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.packaging.ModuleInMultiplePackagesError"),+ Model.projectionFieldName = (Model.Name "firstPackage")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "secondPackage"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.packaging.ModuleInMultiplePackagesError"),+ Model.projectionFieldName = (Model.Name "secondPackage")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the secondPackage field of hydra.core.error.packaging.ModuleInMultiplePackagesError+moduleInMultiplePackagesErrorWithSecondPackage :: Typed.TypedTerm ErrorPackaging.ModuleInMultiplePackagesError -> Typed.TypedTerm Packaging.PackageName -> Typed.TypedTerm ErrorPackaging.ModuleInMultiplePackagesError+moduleInMultiplePackagesErrorWithSecondPackage original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.packaging.ModuleInMultiplePackagesError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "moduleName"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.packaging.ModuleInMultiplePackagesError"),+ Model.projectionFieldName = (Model.Name "moduleName")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "firstPackage"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.packaging.ModuleInMultiplePackagesError"),+ Model.projectionFieldName = (Model.Name "firstPackage")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "secondPackage"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL constructor for hydra.core.error.packaging.NestedModuleNameError+nestedModuleNameError :: Typed.TypedTerm Packaging.ModuleName -> Typed.TypedTerm Packaging.ModuleName -> Typed.TypedTerm ErrorPackaging.NestedModuleNameError+nestedModuleNameError outer inner =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.packaging.NestedModuleNameError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "outer"),+ Model.fieldTerm = (Typed.unTypedTerm outer)},+ Model.Field {+ Model.fieldName = (Model.Name "inner"),+ Model.fieldTerm = (Typed.unTypedTerm inner)}]}))++-- | DSL accessor for the inner field of hydra.core.error.packaging.NestedModuleNameError+nestedModuleNameErrorInner :: Typed.TypedTerm ErrorPackaging.NestedModuleNameError -> Typed.TypedTerm Packaging.ModuleName+nestedModuleNameErrorInner x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.packaging.NestedModuleNameError"),+ Model.projectionFieldName = (Model.Name "inner")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.error.packaging.NestedModuleNameError+nestedModuleNameErrorNestedModuleNameError :: Typed.TypedName ErrorPackaging.NestedModuleNameError+nestedModuleNameErrorNestedModuleNameError =+ Typed.TypedName (Model.Name "hydra.core.error.packaging.NestedModuleNameError")++-- | DSL accessor for the outer field of hydra.core.error.packaging.NestedModuleNameError+nestedModuleNameErrorOuter :: Typed.TypedTerm ErrorPackaging.NestedModuleNameError -> Typed.TypedTerm Packaging.ModuleName+nestedModuleNameErrorOuter x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.packaging.NestedModuleNameError"),+ Model.projectionFieldName = (Model.Name "outer")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL updater for the inner field of hydra.core.error.packaging.NestedModuleNameError+nestedModuleNameErrorWithInner :: Typed.TypedTerm ErrorPackaging.NestedModuleNameError -> Typed.TypedTerm Packaging.ModuleName -> Typed.TypedTerm ErrorPackaging.NestedModuleNameError+nestedModuleNameErrorWithInner original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.packaging.NestedModuleNameError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "outer"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.packaging.NestedModuleNameError"),+ Model.projectionFieldName = (Model.Name "outer")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "inner"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL updater for the outer field of hydra.core.error.packaging.NestedModuleNameError+nestedModuleNameErrorWithOuter :: Typed.TypedTerm ErrorPackaging.NestedModuleNameError -> Typed.TypedTerm Packaging.ModuleName -> Typed.TypedTerm ErrorPackaging.NestedModuleNameError+nestedModuleNameErrorWithOuter original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.packaging.NestedModuleNameError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "outer"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "inner"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.packaging.NestedModuleNameError"),+ Model.projectionFieldName = (Model.Name "inner")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL constructor for hydra.core.error.packaging.UndeclaredDependencyError+undeclaredDependencyError :: Typed.TypedTerm Packaging.ModuleName -> Typed.TypedTerm Model.Name -> Typed.TypedTerm Packaging.ModuleName -> Typed.TypedTerm ErrorPackaging.UndeclaredDependencyError+undeclaredDependencyError moduleName referencedName owningModuleName =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.packaging.UndeclaredDependencyError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "moduleName"),+ Model.fieldTerm = (Typed.unTypedTerm moduleName)},+ Model.Field {+ Model.fieldName = (Model.Name "referencedName"),+ Model.fieldTerm = (Typed.unTypedTerm referencedName)},+ Model.Field {+ Model.fieldName = (Model.Name "owningModuleName"),+ Model.fieldTerm = (Typed.unTypedTerm owningModuleName)}]}))++-- | DSL accessor for the moduleName field of hydra.core.error.packaging.UndeclaredDependencyError+undeclaredDependencyErrorModuleName :: Typed.TypedTerm ErrorPackaging.UndeclaredDependencyError -> Typed.TypedTerm Packaging.ModuleName+undeclaredDependencyErrorModuleName x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.packaging.UndeclaredDependencyError"),+ Model.projectionFieldName = (Model.Name "moduleName")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the owningModuleName field of hydra.core.error.packaging.UndeclaredDependencyError+undeclaredDependencyErrorOwningModuleName :: Typed.TypedTerm ErrorPackaging.UndeclaredDependencyError -> Typed.TypedTerm Packaging.ModuleName+undeclaredDependencyErrorOwningModuleName x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.packaging.UndeclaredDependencyError"),+ Model.projectionFieldName = (Model.Name "owningModuleName")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the referencedName field of hydra.core.error.packaging.UndeclaredDependencyError+undeclaredDependencyErrorReferencedName :: Typed.TypedTerm ErrorPackaging.UndeclaredDependencyError -> Typed.TypedTerm Model.Name+undeclaredDependencyErrorReferencedName x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.packaging.UndeclaredDependencyError"),+ Model.projectionFieldName = (Model.Name "referencedName")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.error.packaging.UndeclaredDependencyError+undeclaredDependencyErrorUndeclaredDependencyError :: Typed.TypedName ErrorPackaging.UndeclaredDependencyError+undeclaredDependencyErrorUndeclaredDependencyError =+ Typed.TypedName (Model.Name "hydra.core.error.packaging.UndeclaredDependencyError")++-- | DSL updater for the moduleName field of hydra.core.error.packaging.UndeclaredDependencyError+undeclaredDependencyErrorWithModuleName :: Typed.TypedTerm ErrorPackaging.UndeclaredDependencyError -> Typed.TypedTerm Packaging.ModuleName -> Typed.TypedTerm ErrorPackaging.UndeclaredDependencyError+undeclaredDependencyErrorWithModuleName original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.packaging.UndeclaredDependencyError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "moduleName"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "referencedName"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.packaging.UndeclaredDependencyError"),+ Model.projectionFieldName = (Model.Name "referencedName")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "owningModuleName"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.packaging.UndeclaredDependencyError"),+ Model.projectionFieldName = (Model.Name "owningModuleName")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the owningModuleName field of hydra.core.error.packaging.UndeclaredDependencyError+undeclaredDependencyErrorWithOwningModuleName :: Typed.TypedTerm ErrorPackaging.UndeclaredDependencyError -> Typed.TypedTerm Packaging.ModuleName -> Typed.TypedTerm ErrorPackaging.UndeclaredDependencyError+undeclaredDependencyErrorWithOwningModuleName original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.packaging.UndeclaredDependencyError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "moduleName"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.packaging.UndeclaredDependencyError"),+ Model.projectionFieldName = (Model.Name "moduleName")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "referencedName"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.packaging.UndeclaredDependencyError"),+ Model.projectionFieldName = (Model.Name "referencedName")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "owningModuleName"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL updater for the referencedName field of hydra.core.error.packaging.UndeclaredDependencyError+undeclaredDependencyErrorWithReferencedName :: Typed.TypedTerm ErrorPackaging.UndeclaredDependencyError -> Typed.TypedTerm Model.Name -> Typed.TypedTerm ErrorPackaging.UndeclaredDependencyError+undeclaredDependencyErrorWithReferencedName original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.packaging.UndeclaredDependencyError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "moduleName"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.packaging.UndeclaredDependencyError"),+ Model.projectionFieldName = (Model.Name "moduleName")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "referencedName"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "owningModuleName"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.error.packaging.UndeclaredDependencyError"),+ Model.projectionFieldName = (Model.Name "owningModuleName")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))
@@ -0,0 +1,65 @@+-- Note: this is an automatically generated file. Do not edit.++-- | DSL functions for hydra.core.error.system++module Hydra.Core.Dsl.Error.System where++import qualified Hydra.Core.Decode.Error.System as DecodeErrorSystem+import qualified Hydra.Core.Dsl.File as DslFile+import qualified Hydra.Core.Encode.Error.System as EncodeErrorSystem+import qualified Hydra.Core.Error.System as System+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Typed as Typed+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | DSL injection for the commandNotFound variant of hydra.core.error.system.SystemError+systemErrorCommandNotFound :: Typed.TypedTerm File.FilePath -> Typed.TypedTerm System.SystemError+systemErrorCommandNotFound x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.system.SystemError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "commandNotFound"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the interrupted variant of hydra.core.error.system.SystemError+systemErrorInterrupted :: Typed.TypedTerm System.SystemError+systemErrorInterrupted =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.system.SystemError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "interrupted"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL injection for the invalidWorkingDirectory variant of hydra.core.error.system.SystemError+systemErrorInvalidWorkingDirectory :: Typed.TypedTerm File.FilePath -> Typed.TypedTerm System.SystemError+systemErrorInvalidWorkingDirectory x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.system.SystemError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "invalidWorkingDirectory"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the other variant of hydra.core.error.system.SystemError+systemErrorOther :: Typed.TypedTerm String -> Typed.TypedTerm System.SystemError+systemErrorOther x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.system.SystemError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "other"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the permissionDenied variant of hydra.core.error.system.SystemError+systemErrorPermissionDenied :: Typed.TypedTerm File.FilePath -> Typed.TypedTerm System.SystemError+systemErrorPermissionDenied x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.system.SystemError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "permissionDenied"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL name token for hydra.core.error.system.SystemError+systemErrorSystemError :: Typed.TypedName System.SystemError+systemErrorSystemError = Typed.TypedName (Model.Name "hydra.core.error.system.SystemError")
@@ -0,0 +1,857 @@+-- Note: this is an automatically generated file. Do not edit.++-- | DSL functions for hydra.core.errors++module Hydra.Core.Dsl.Errors where++import qualified Hydra.Core.Decode.Errors as DecodeErrors+import qualified Hydra.Core.Dsl.Error.Checking as ErrorChecking+import qualified Hydra.Core.Dsl.Error.Model as DslErrorModel+import qualified Hydra.Core.Dsl.Model as DslModel+import qualified Hydra.Core.Dsl.Paths as DslPaths+import qualified Hydra.Core.Dsl.Typing as DslTyping+import qualified Hydra.Core.Dsl.Variants as DslVariants+import qualified Hydra.Core.Encode.Errors as EncodeErrors+import qualified Hydra.Core.Error.Checking as Checking+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | DSL constructor for the hydra.core.errors.DecodingError wrapper+decodingError :: Typed.TypedTerm String -> Typed.TypedTerm Errors.DecodingError+decodingError x =+ Typed.TypedTerm (Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.Name "hydra.core.errors.DecodingError"),+ Model.wrappedTermBody = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.errors.DecodingError+decodingErrorDecodingError :: Typed.TypedName Errors.DecodingError+decodingErrorDecodingError = Typed.TypedName (Model.Name "hydra.core.errors.DecodingError")++-- | DSL injection for the checking variant of hydra.core.errors.Error+errorChecking :: Typed.TypedTerm Checking.CheckingError -> Typed.TypedTerm Errors.Error+errorChecking x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.errors.Error"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "checking"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the decoding variant of hydra.core.errors.Error+errorDecoding :: Typed.TypedTerm Errors.DecodingError -> Typed.TypedTerm Errors.Error+errorDecoding x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.errors.Error"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "decoding"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the duplicateBinding variant of hydra.core.errors.Error+errorDuplicateBinding :: Typed.TypedTerm ErrorModel.DuplicateBindingError -> Typed.TypedTerm Errors.Error+errorDuplicateBinding x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.errors.Error"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "duplicateBinding"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the duplicateField variant of hydra.core.errors.Error+errorDuplicateField :: Typed.TypedTerm ErrorModel.DuplicateFieldError -> Typed.TypedTerm Errors.Error+errorDuplicateField x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.errors.Error"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "duplicateField"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL name token for hydra.core.errors.Error+errorError :: Typed.TypedName Errors.Error+errorError = Typed.TypedName (Model.Name "hydra.core.errors.Error")++-- | DSL injection for the extraction variant of hydra.core.errors.Error+errorExtraction :: Typed.TypedTerm Errors.ExtractionError -> Typed.TypedTerm Errors.Error+errorExtraction x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.errors.Error"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "extraction"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the inference variant of hydra.core.errors.Error+errorInference :: Typed.TypedTerm Errors.InferenceError -> Typed.TypedTerm Errors.Error+errorInference x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.errors.Error"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "inference"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the invalidLiteral variant of hydra.core.errors.Error+errorInvalidLiteral :: Typed.TypedTerm ErrorModel.InvalidLiteralError -> Typed.TypedTerm Errors.Error+errorInvalidLiteral x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.errors.Error"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "invalidLiteral"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the other variant of hydra.core.errors.Error+errorOther :: Typed.TypedTerm Errors.OtherError -> Typed.TypedTerm Errors.Error+errorOther x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.errors.Error"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "other"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the resolution variant of hydra.core.errors.Error+errorResolution :: Typed.TypedTerm Errors.ResolutionError -> Typed.TypedTerm Errors.Error+errorResolution x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.errors.Error"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "resolution"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the undefinedField variant of hydra.core.errors.Error+errorUndefinedField :: Typed.TypedTerm ErrorModel.UndefinedFieldError -> Typed.TypedTerm Errors.Error+errorUndefinedField x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.errors.Error"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "undefinedField"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the undefinedTermVariable variant of hydra.core.errors.Error+errorUndefinedTermVariable :: Typed.TypedTerm ErrorModel.UndefinedTermVariableError -> Typed.TypedTerm Errors.Error+errorUndefinedTermVariable x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.errors.Error"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "undefinedTermVariable"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the unexpectedTermVariant variant of hydra.core.errors.Error+errorUnexpectedTermVariant :: Typed.TypedTerm ErrorModel.UnexpectedTermVariantError -> Typed.TypedTerm Errors.Error+errorUnexpectedTermVariant x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.errors.Error"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "unexpectedTermVariant"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the unexpectedTypeVariant variant of hydra.core.errors.Error+errorUnexpectedTypeVariant :: Typed.TypedTerm ErrorModel.UnexpectedTypeVariantError -> Typed.TypedTerm Errors.Error+errorUnexpectedTypeVariant x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.errors.Error"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "unexpectedTypeVariant"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the unification variant of hydra.core.errors.Error+errorUnification :: Typed.TypedTerm Errors.UnificationError -> Typed.TypedTerm Errors.Error+errorUnification x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.errors.Error"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "unification"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the untypedTermVariable variant of hydra.core.errors.Error+errorUntypedTermVariable :: Typed.TypedTerm ErrorModel.UntypedTermVariableError -> Typed.TypedTerm Errors.Error+errorUntypedTermVariable x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.errors.Error"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "untypedTermVariable"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the emptyList variant of hydra.core.errors.ExtractionError+extractionErrorEmptyList :: Typed.TypedTerm Errors.EmptyListError -> Typed.TypedTerm Errors.ExtractionError+extractionErrorEmptyList x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.errors.ExtractionError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "emptyList"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL name token for hydra.core.errors.ExtractionError+extractionErrorExtractionError :: Typed.TypedName Errors.ExtractionError+extractionErrorExtractionError = Typed.TypedName (Model.Name "hydra.core.errors.ExtractionError")++-- | DSL injection for the multipleBindings variant of hydra.core.errors.ExtractionError+extractionErrorMultipleBindings :: Typed.TypedTerm Errors.MultipleBindingsError -> Typed.TypedTerm Errors.ExtractionError+extractionErrorMultipleBindings x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.errors.ExtractionError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "multipleBindings"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the multipleFields variant of hydra.core.errors.ExtractionError+extractionErrorMultipleFields :: Typed.TypedTerm Errors.MultipleFieldsError -> Typed.TypedTerm Errors.ExtractionError+extractionErrorMultipleFields x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.errors.ExtractionError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "multipleFields"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the noMatchingField variant of hydra.core.errors.ExtractionError+extractionErrorNoMatchingField :: Typed.TypedTerm Errors.NoMatchingFieldError -> Typed.TypedTerm Errors.ExtractionError+extractionErrorNoMatchingField x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.errors.ExtractionError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "noMatchingField"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the noSuchBinding variant of hydra.core.errors.ExtractionError+extractionErrorNoSuchBinding :: Typed.TypedTerm Errors.NoSuchBindingError -> Typed.TypedTerm Errors.ExtractionError+extractionErrorNoSuchBinding x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.errors.ExtractionError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "noSuchBinding"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the notEnoughCases variant of hydra.core.errors.ExtractionError+extractionErrorNotEnoughCases :: Typed.TypedTerm Errors.NotEnoughCasesError -> Typed.TypedTerm Errors.ExtractionError+extractionErrorNotEnoughCases x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.errors.ExtractionError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "notEnoughCases"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the unexpectedShape variant of hydra.core.errors.ExtractionError+extractionErrorUnexpectedShape :: Typed.TypedTerm Errors.UnexpectedShapeError -> Typed.TypedTerm Errors.ExtractionError+extractionErrorUnexpectedShape x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.errors.ExtractionError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "unexpectedShape"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the checking variant of hydra.core.errors.InferenceError+inferenceErrorChecking :: Typed.TypedTerm Checking.CheckingError -> Typed.TypedTerm Errors.InferenceError+inferenceErrorChecking x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.errors.InferenceError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "checking"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL name token for hydra.core.errors.InferenceError+inferenceErrorInferenceError :: Typed.TypedName Errors.InferenceError+inferenceErrorInferenceError = Typed.TypedName (Model.Name "hydra.core.errors.InferenceError")++-- | DSL injection for the other variant of hydra.core.errors.InferenceError+inferenceErrorOther :: Typed.TypedTerm Errors.OtherInferenceError -> Typed.TypedTerm Errors.InferenceError+inferenceErrorOther x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.errors.InferenceError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "other"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the unification variant of hydra.core.errors.InferenceError+inferenceErrorUnification :: Typed.TypedTerm Errors.UnificationInferenceError -> Typed.TypedTerm Errors.InferenceError+inferenceErrorUnification x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.errors.InferenceError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "unification"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL constructor for hydra.core.errors.MultipleBindingsError+multipleBindingsError :: Typed.TypedTerm Model.Name -> Typed.TypedTerm Errors.MultipleBindingsError+multipleBindingsError name =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.errors.MultipleBindingsError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Typed.unTypedTerm name)}]}))++-- | DSL name token for hydra.core.errors.MultipleBindingsError+multipleBindingsErrorMultipleBindingsError :: Typed.TypedName Errors.MultipleBindingsError+multipleBindingsErrorMultipleBindingsError = Typed.TypedName (Model.Name "hydra.core.errors.MultipleBindingsError")++-- | DSL accessor for the name field of hydra.core.errors.MultipleBindingsError+multipleBindingsErrorName :: Typed.TypedTerm Errors.MultipleBindingsError -> Typed.TypedTerm Model.Name+multipleBindingsErrorName x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.errors.MultipleBindingsError"),+ Model.projectionFieldName = (Model.Name "name")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL updater for the name field of hydra.core.errors.MultipleBindingsError+multipleBindingsErrorWithName :: Typed.TypedTerm Errors.MultipleBindingsError -> Typed.TypedTerm Model.Name -> Typed.TypedTerm Errors.MultipleBindingsError+multipleBindingsErrorWithName original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.errors.MultipleBindingsError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL constructor for hydra.core.errors.MultipleFieldsError+multipleFieldsError :: Typed.TypedTerm Model.Name -> Typed.TypedTerm Errors.MultipleFieldsError+multipleFieldsError fieldName =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.errors.MultipleFieldsError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "fieldName"),+ Model.fieldTerm = (Typed.unTypedTerm fieldName)}]}))++-- | DSL accessor for the fieldName field of hydra.core.errors.MultipleFieldsError+multipleFieldsErrorFieldName :: Typed.TypedTerm Errors.MultipleFieldsError -> Typed.TypedTerm Model.Name+multipleFieldsErrorFieldName x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.errors.MultipleFieldsError"),+ Model.projectionFieldName = (Model.Name "fieldName")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.errors.MultipleFieldsError+multipleFieldsErrorMultipleFieldsError :: Typed.TypedName Errors.MultipleFieldsError+multipleFieldsErrorMultipleFieldsError = Typed.TypedName (Model.Name "hydra.core.errors.MultipleFieldsError")++-- | DSL updater for the fieldName field of hydra.core.errors.MultipleFieldsError+multipleFieldsErrorWithFieldName :: Typed.TypedTerm Errors.MultipleFieldsError -> Typed.TypedTerm Model.Name -> Typed.TypedTerm Errors.MultipleFieldsError+multipleFieldsErrorWithFieldName original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.errors.MultipleFieldsError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "fieldName"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL constructor for hydra.core.errors.NoMatchingFieldError+noMatchingFieldError :: Typed.TypedTerm Model.Name -> Typed.TypedTerm Errors.NoMatchingFieldError+noMatchingFieldError fieldName =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.errors.NoMatchingFieldError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "fieldName"),+ Model.fieldTerm = (Typed.unTypedTerm fieldName)}]}))++-- | DSL accessor for the fieldName field of hydra.core.errors.NoMatchingFieldError+noMatchingFieldErrorFieldName :: Typed.TypedTerm Errors.NoMatchingFieldError -> Typed.TypedTerm Model.Name+noMatchingFieldErrorFieldName x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.errors.NoMatchingFieldError"),+ Model.projectionFieldName = (Model.Name "fieldName")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.errors.NoMatchingFieldError+noMatchingFieldErrorNoMatchingFieldError :: Typed.TypedName Errors.NoMatchingFieldError+noMatchingFieldErrorNoMatchingFieldError = Typed.TypedName (Model.Name "hydra.core.errors.NoMatchingFieldError")++-- | DSL updater for the fieldName field of hydra.core.errors.NoMatchingFieldError+noMatchingFieldErrorWithFieldName :: Typed.TypedTerm Errors.NoMatchingFieldError -> Typed.TypedTerm Model.Name -> Typed.TypedTerm Errors.NoMatchingFieldError+noMatchingFieldErrorWithFieldName original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.errors.NoMatchingFieldError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "fieldName"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL constructor for hydra.core.errors.NoSuchBindingError+noSuchBindingError :: Typed.TypedTerm Model.Name -> Typed.TypedTerm Errors.NoSuchBindingError+noSuchBindingError name =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.errors.NoSuchBindingError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Typed.unTypedTerm name)}]}))++-- | DSL accessor for the name field of hydra.core.errors.NoSuchBindingError+noSuchBindingErrorName :: Typed.TypedTerm Errors.NoSuchBindingError -> Typed.TypedTerm Model.Name+noSuchBindingErrorName x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.errors.NoSuchBindingError"),+ Model.projectionFieldName = (Model.Name "name")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.errors.NoSuchBindingError+noSuchBindingErrorNoSuchBindingError :: Typed.TypedName Errors.NoSuchBindingError+noSuchBindingErrorNoSuchBindingError = Typed.TypedName (Model.Name "hydra.core.errors.NoSuchBindingError")++-- | DSL updater for the name field of hydra.core.errors.NoSuchBindingError+noSuchBindingErrorWithName :: Typed.TypedTerm Errors.NoSuchBindingError -> Typed.TypedTerm Model.Name -> Typed.TypedTerm Errors.NoSuchBindingError+noSuchBindingErrorWithName original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.errors.NoSuchBindingError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL constructor for hydra.core.errors.NoSuchPrimitiveError+noSuchPrimitiveError :: Typed.TypedTerm Model.Name -> Typed.TypedTerm Errors.NoSuchPrimitiveError+noSuchPrimitiveError name =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.errors.NoSuchPrimitiveError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Typed.unTypedTerm name)}]}))++-- | DSL accessor for the name field of hydra.core.errors.NoSuchPrimitiveError+noSuchPrimitiveErrorName :: Typed.TypedTerm Errors.NoSuchPrimitiveError -> Typed.TypedTerm Model.Name+noSuchPrimitiveErrorName x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.errors.NoSuchPrimitiveError"),+ Model.projectionFieldName = (Model.Name "name")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.errors.NoSuchPrimitiveError+noSuchPrimitiveErrorNoSuchPrimitiveError :: Typed.TypedName Errors.NoSuchPrimitiveError+noSuchPrimitiveErrorNoSuchPrimitiveError = Typed.TypedName (Model.Name "hydra.core.errors.NoSuchPrimitiveError")++-- | DSL updater for the name field of hydra.core.errors.NoSuchPrimitiveError+noSuchPrimitiveErrorWithName :: Typed.TypedTerm Errors.NoSuchPrimitiveError -> Typed.TypedTerm Model.Name -> Typed.TypedTerm Errors.NoSuchPrimitiveError+noSuchPrimitiveErrorWithName original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.errors.NoSuchPrimitiveError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL constructor for the hydra.core.errors.OtherError wrapper+otherError :: Typed.TypedTerm String -> Typed.TypedTerm Errors.OtherError+otherError x =+ Typed.TypedTerm (Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.Name "hydra.core.errors.OtherError"),+ Model.wrappedTermBody = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.errors.OtherError+otherErrorOtherError :: Typed.TypedName Errors.OtherError+otherErrorOtherError = Typed.TypedName (Model.Name "hydra.core.errors.OtherError")++-- | DSL constructor for hydra.core.errors.OtherInferenceError+otherInferenceError :: Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm String -> Typed.TypedTerm Errors.OtherInferenceError+otherInferenceError path message =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.errors.OtherInferenceError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "path"),+ Model.fieldTerm = (Typed.unTypedTerm path)},+ Model.Field {+ Model.fieldName = (Model.Name "message"),+ Model.fieldTerm = (Typed.unTypedTerm message)}]}))++-- | DSL accessor for the message field of hydra.core.errors.OtherInferenceError+otherInferenceErrorMessage :: Typed.TypedTerm Errors.OtherInferenceError -> Typed.TypedTerm String+otherInferenceErrorMessage x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.errors.OtherInferenceError"),+ Model.projectionFieldName = (Model.Name "message")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.errors.OtherInferenceError+otherInferenceErrorOtherInferenceError :: Typed.TypedName Errors.OtherInferenceError+otherInferenceErrorOtherInferenceError = Typed.TypedName (Model.Name "hydra.core.errors.OtherInferenceError")++-- | DSL accessor for the path field of hydra.core.errors.OtherInferenceError+otherInferenceErrorPath :: Typed.TypedTerm Errors.OtherInferenceError -> Typed.TypedTerm Paths.SubtermPath+otherInferenceErrorPath x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.errors.OtherInferenceError"),+ Model.projectionFieldName = (Model.Name "path")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL updater for the message field of hydra.core.errors.OtherInferenceError+otherInferenceErrorWithMessage :: Typed.TypedTerm Errors.OtherInferenceError -> Typed.TypedTerm String -> Typed.TypedTerm Errors.OtherInferenceError+otherInferenceErrorWithMessage original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.errors.OtherInferenceError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "path"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.errors.OtherInferenceError"),+ Model.projectionFieldName = (Model.Name "path")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "message"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL updater for the path field of hydra.core.errors.OtherInferenceError+otherInferenceErrorWithPath :: Typed.TypedTerm Errors.OtherInferenceError -> Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm Errors.OtherInferenceError+otherInferenceErrorWithPath original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.errors.OtherInferenceError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "path"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "message"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.errors.OtherInferenceError"),+ Model.projectionFieldName = (Model.Name "message")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL constructor for the hydra.core.errors.OtherResolutionError wrapper+otherResolutionError :: Typed.TypedTerm String -> Typed.TypedTerm Errors.OtherResolutionError+otherResolutionError x =+ Typed.TypedTerm (Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.Name "hydra.core.errors.OtherResolutionError"),+ Model.wrappedTermBody = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.errors.OtherResolutionError+otherResolutionErrorOtherResolutionError :: Typed.TypedName Errors.OtherResolutionError+otherResolutionErrorOtherResolutionError = Typed.TypedName (Model.Name "hydra.core.errors.OtherResolutionError")++-- | DSL injection for the noMatchingField variant of hydra.core.errors.ResolutionError+resolutionErrorNoMatchingField :: Typed.TypedTerm Errors.NoMatchingFieldError -> Typed.TypedTerm Errors.ResolutionError+resolutionErrorNoMatchingField x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.errors.ResolutionError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "noMatchingField"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the noSuchBinding variant of hydra.core.errors.ResolutionError+resolutionErrorNoSuchBinding :: Typed.TypedTerm Errors.NoSuchBindingError -> Typed.TypedTerm Errors.ResolutionError+resolutionErrorNoSuchBinding x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.errors.ResolutionError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "noSuchBinding"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the noSuchPrimitive variant of hydra.core.errors.ResolutionError+resolutionErrorNoSuchPrimitive :: Typed.TypedTerm Errors.NoSuchPrimitiveError -> Typed.TypedTerm Errors.ResolutionError+resolutionErrorNoSuchPrimitive x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.errors.ResolutionError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "noSuchPrimitive"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the other variant of hydra.core.errors.ResolutionError+resolutionErrorOther :: Typed.TypedTerm Errors.OtherResolutionError -> Typed.TypedTerm Errors.ResolutionError+resolutionErrorOther x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.errors.ResolutionError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "other"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL name token for hydra.core.errors.ResolutionError+resolutionErrorResolutionError :: Typed.TypedName Errors.ResolutionError+resolutionErrorResolutionError = Typed.TypedName (Model.Name "hydra.core.errors.ResolutionError")++-- | DSL injection for the unexpectedShape variant of hydra.core.errors.ResolutionError+resolutionErrorUnexpectedShape :: Typed.TypedTerm Errors.UnexpectedShapeError -> Typed.TypedTerm Errors.ResolutionError+resolutionErrorUnexpectedShape x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.errors.ResolutionError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "unexpectedShape"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL accessor for the body of hydra.core.errors.DecodingError+unDecodingError :: Typed.TypedTerm Errors.DecodingError -> Typed.TypedTerm String+unDecodingError x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermUnwrap (Model.Name "hydra.core.errors.DecodingError")),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the body of hydra.core.errors.OtherError+unOtherError :: Typed.TypedTerm Errors.OtherError -> Typed.TypedTerm String+unOtherError x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermUnwrap (Model.Name "hydra.core.errors.OtherError")),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the body of hydra.core.errors.OtherResolutionError+unOtherResolutionError :: Typed.TypedTerm Errors.OtherResolutionError -> Typed.TypedTerm String+unOtherResolutionError x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermUnwrap (Model.Name "hydra.core.errors.OtherResolutionError")),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL constructor for hydra.core.errors.UnexpectedShapeError+unexpectedShapeError :: Typed.TypedTerm String -> Typed.TypedTerm String -> Typed.TypedTerm Errors.UnexpectedShapeError+unexpectedShapeError expected actual =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.errors.UnexpectedShapeError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "expected"),+ Model.fieldTerm = (Typed.unTypedTerm expected)},+ Model.Field {+ Model.fieldName = (Model.Name "actual"),+ Model.fieldTerm = (Typed.unTypedTerm actual)}]}))++-- | DSL accessor for the actual field of hydra.core.errors.UnexpectedShapeError+unexpectedShapeErrorActual :: Typed.TypedTerm Errors.UnexpectedShapeError -> Typed.TypedTerm String+unexpectedShapeErrorActual x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.errors.UnexpectedShapeError"),+ Model.projectionFieldName = (Model.Name "actual")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the expected field of hydra.core.errors.UnexpectedShapeError+unexpectedShapeErrorExpected :: Typed.TypedTerm Errors.UnexpectedShapeError -> Typed.TypedTerm String+unexpectedShapeErrorExpected x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.errors.UnexpectedShapeError"),+ Model.projectionFieldName = (Model.Name "expected")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.errors.UnexpectedShapeError+unexpectedShapeErrorUnexpectedShapeError :: Typed.TypedName Errors.UnexpectedShapeError+unexpectedShapeErrorUnexpectedShapeError = Typed.TypedName (Model.Name "hydra.core.errors.UnexpectedShapeError")++-- | DSL updater for the actual field of hydra.core.errors.UnexpectedShapeError+unexpectedShapeErrorWithActual :: Typed.TypedTerm Errors.UnexpectedShapeError -> Typed.TypedTerm String -> Typed.TypedTerm Errors.UnexpectedShapeError+unexpectedShapeErrorWithActual original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.errors.UnexpectedShapeError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "expected"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.errors.UnexpectedShapeError"),+ Model.projectionFieldName = (Model.Name "expected")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "actual"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL updater for the expected field of hydra.core.errors.UnexpectedShapeError+unexpectedShapeErrorWithExpected :: Typed.TypedTerm Errors.UnexpectedShapeError -> Typed.TypedTerm String -> Typed.TypedTerm Errors.UnexpectedShapeError+unexpectedShapeErrorWithExpected original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.errors.UnexpectedShapeError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "expected"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "actual"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.errors.UnexpectedShapeError"),+ Model.projectionFieldName = (Model.Name "actual")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL constructor for hydra.core.errors.UnificationError+unificationError :: Typed.TypedTerm Model.Type -> Typed.TypedTerm Model.Type -> Typed.TypedTerm String -> Typed.TypedTerm Errors.UnificationError+unificationError leftType rightType message =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.errors.UnificationError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "leftType"),+ Model.fieldTerm = (Typed.unTypedTerm leftType)},+ Model.Field {+ Model.fieldName = (Model.Name "rightType"),+ Model.fieldTerm = (Typed.unTypedTerm rightType)},+ Model.Field {+ Model.fieldName = (Model.Name "message"),+ Model.fieldTerm = (Typed.unTypedTerm message)}]}))++-- | DSL accessor for the leftType field of hydra.core.errors.UnificationError+unificationErrorLeftType :: Typed.TypedTerm Errors.UnificationError -> Typed.TypedTerm Model.Type+unificationErrorLeftType x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.errors.UnificationError"),+ Model.projectionFieldName = (Model.Name "leftType")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the message field of hydra.core.errors.UnificationError+unificationErrorMessage :: Typed.TypedTerm Errors.UnificationError -> Typed.TypedTerm String+unificationErrorMessage x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.errors.UnificationError"),+ Model.projectionFieldName = (Model.Name "message")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the rightType field of hydra.core.errors.UnificationError+unificationErrorRightType :: Typed.TypedTerm Errors.UnificationError -> Typed.TypedTerm Model.Type+unificationErrorRightType x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.errors.UnificationError"),+ Model.projectionFieldName = (Model.Name "rightType")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.errors.UnificationError+unificationErrorUnificationError :: Typed.TypedName Errors.UnificationError+unificationErrorUnificationError = Typed.TypedName (Model.Name "hydra.core.errors.UnificationError")++-- | DSL updater for the leftType field of hydra.core.errors.UnificationError+unificationErrorWithLeftType :: Typed.TypedTerm Errors.UnificationError -> Typed.TypedTerm Model.Type -> Typed.TypedTerm Errors.UnificationError+unificationErrorWithLeftType original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.errors.UnificationError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "leftType"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "rightType"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.errors.UnificationError"),+ Model.projectionFieldName = (Model.Name "rightType")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "message"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.errors.UnificationError"),+ Model.projectionFieldName = (Model.Name "message")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the message field of hydra.core.errors.UnificationError+unificationErrorWithMessage :: Typed.TypedTerm Errors.UnificationError -> Typed.TypedTerm String -> Typed.TypedTerm Errors.UnificationError+unificationErrorWithMessage original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.errors.UnificationError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "leftType"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.errors.UnificationError"),+ Model.projectionFieldName = (Model.Name "leftType")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "rightType"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.errors.UnificationError"),+ Model.projectionFieldName = (Model.Name "rightType")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "message"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL updater for the rightType field of hydra.core.errors.UnificationError+unificationErrorWithRightType :: Typed.TypedTerm Errors.UnificationError -> Typed.TypedTerm Model.Type -> Typed.TypedTerm Errors.UnificationError+unificationErrorWithRightType original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.errors.UnificationError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "leftType"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.errors.UnificationError"),+ Model.projectionFieldName = (Model.Name "leftType")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "rightType"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "message"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.errors.UnificationError"),+ Model.projectionFieldName = (Model.Name "message")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL constructor for hydra.core.errors.UnificationInferenceError+unificationInferenceError :: Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm Errors.UnificationError -> Typed.TypedTerm Errors.UnificationInferenceError+unificationInferenceError path cause =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.errors.UnificationInferenceError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "path"),+ Model.fieldTerm = (Typed.unTypedTerm path)},+ Model.Field {+ Model.fieldName = (Model.Name "cause"),+ Model.fieldTerm = (Typed.unTypedTerm cause)}]}))++-- | DSL accessor for the cause field of hydra.core.errors.UnificationInferenceError+unificationInferenceErrorCause :: Typed.TypedTerm Errors.UnificationInferenceError -> Typed.TypedTerm Errors.UnificationError+unificationInferenceErrorCause x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.errors.UnificationInferenceError"),+ Model.projectionFieldName = (Model.Name "cause")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the path field of hydra.core.errors.UnificationInferenceError+unificationInferenceErrorPath :: Typed.TypedTerm Errors.UnificationInferenceError -> Typed.TypedTerm Paths.SubtermPath+unificationInferenceErrorPath x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.errors.UnificationInferenceError"),+ Model.projectionFieldName = (Model.Name "path")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.errors.UnificationInferenceError+unificationInferenceErrorUnificationInferenceError :: Typed.TypedName Errors.UnificationInferenceError+unificationInferenceErrorUnificationInferenceError =+ Typed.TypedName (Model.Name "hydra.core.errors.UnificationInferenceError")++-- | DSL updater for the cause field of hydra.core.errors.UnificationInferenceError+unificationInferenceErrorWithCause :: Typed.TypedTerm Errors.UnificationInferenceError -> Typed.TypedTerm Errors.UnificationError -> Typed.TypedTerm Errors.UnificationInferenceError+unificationInferenceErrorWithCause original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.errors.UnificationInferenceError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "path"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.errors.UnificationInferenceError"),+ Model.projectionFieldName = (Model.Name "path")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "cause"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL updater for the path field of hydra.core.errors.UnificationInferenceError+unificationInferenceErrorWithPath :: Typed.TypedTerm Errors.UnificationInferenceError -> Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm Errors.UnificationInferenceError+unificationInferenceErrorWithPath original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.errors.UnificationInferenceError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "path"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "cause"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.errors.UnificationInferenceError"),+ Model.projectionFieldName = (Model.Name "cause")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))
@@ -0,0 +1,172 @@+-- Note: this is an automatically generated file. Do not edit.++-- | DSL functions for hydra.core.extract.json++module Hydra.Core.Dsl.Extract.Json where++import qualified Hydra.Core.Ast as Ast+import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Diff as Diff+import qualified Hydra.Core.Docs as Docs+import qualified Hydra.Core.Dsl.Ast as DslAst+import qualified Hydra.Core.Dsl.Coders as DslCoders+import qualified Hydra.Core.Dsl.Diff as DslDiff+import qualified Hydra.Core.Dsl.Docs as DslDocs+import qualified Hydra.Core.Dsl.Error.Checking as ErrorChecking+import qualified Hydra.Core.Dsl.Error.File as DslErrorFile+import qualified Hydra.Core.Dsl.Error.Model as DslErrorModel+import qualified Hydra.Core.Dsl.Error.Packaging as DslErrorPackaging+import qualified Hydra.Core.Dsl.Error.System as DslErrorSystem+import qualified Hydra.Core.Dsl.Errors as DslErrors+import qualified Hydra.Core.Dsl.File as DslFile+import qualified Hydra.Core.Dsl.Graph as DslGraph+import qualified Hydra.Core.Dsl.Json.Model as DslJsonModel+import qualified Hydra.Core.Dsl.Json.Writer as JsonWriter+import qualified Hydra.Core.Dsl.Markdown as DslMarkdown+import qualified Hydra.Core.Dsl.Model as DslModel+import qualified Hydra.Core.Dsl.Packaging as DslPackaging+import qualified Hydra.Core.Dsl.Parsing as DslParsing+import qualified Hydra.Core.Dsl.Paths as DslPaths+import qualified Hydra.Core.Dsl.Query as DslQuery+import qualified Hydra.Core.Dsl.Regex as DslRegex+import qualified Hydra.Core.Dsl.Relational as DslRelational+import qualified Hydra.Core.Dsl.System as DslSystem+import qualified Hydra.Core.Dsl.Tabular as DslTabular+import qualified Hydra.Core.Dsl.Testing as DslTesting+import qualified Hydra.Core.Dsl.Time as DslTime+import qualified Hydra.Core.Dsl.Topology as DslTopology+import qualified Hydra.Core.Dsl.Typing as DslTyping+import qualified Hydra.Core.Dsl.Util as DslUtil+import qualified Hydra.Core.Dsl.Validation as DslValidation+import qualified Hydra.Core.Dsl.Variants as DslVariants+import qualified Hydra.Core.Error.Checking as Checking+import qualified Hydra.Core.Error.File as ErrorFile+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Error.Packaging as ErrorPackaging+import qualified Hydra.Core.Error.System as ErrorSystem+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.Extract.Json as Json+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Json.Model as JsonModel+import qualified Hydra.Core.Json.Writer as Writer+import qualified Hydra.Core.Markdown as Markdown+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Parsing as Parsing+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Query as Query+import qualified Hydra.Core.Regex as Regex+import qualified Hydra.Core.Relational as Relational+import qualified Hydra.Core.System as System+import qualified Hydra.Core.Tabular as Tabular+import qualified Hydra.Core.Testing as Testing+import qualified Hydra.Core.Time as Time+import qualified Hydra.Core.Topology as Topology+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Validation as Validation+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void+import qualified Data.Map as M++-- | DSL reference to hydra.core.extract.json.expectArray+expectArray :: Typed.TypedTerm JsonModel.Value -> Typed.TypedTerm (Either String [JsonModel.Value])+expectArray arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.extract.json.expectArray")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.extract.json.expectNumber+expectNumber :: Typed.TypedTerm JsonModel.Value -> Typed.TypedTerm (Either String Sci.Scientific)+expectNumber arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.extract.json.expectNumber")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.extract.json.expectObject+expectObject :: Typed.TypedTerm JsonModel.Value -> Typed.TypedTerm (Either String (M.Map String JsonModel.Value))+expectObject arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.extract.json.expectObject")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.extract.json.expectString+expectString :: Typed.TypedTerm JsonModel.Value -> Typed.TypedTerm (Either String String)+expectString arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.extract.json.expectString")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.extract.json.opt+opt :: Typed.TypedTerm t0 -> Typed.TypedTerm (M.Map t0 t1) -> Typed.TypedTerm (Maybe t1)+opt arg0 arg1 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.extract.json.opt")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)}))++-- | DSL reference to hydra.core.extract.json.optArray+optArray :: Typed.TypedTerm t0 -> Typed.TypedTerm (M.Map t0 JsonModel.Value) -> Typed.TypedTerm (Either String (Maybe [JsonModel.Value]))+optArray arg0 arg1 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.extract.json.optArray")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)}))++-- | DSL reference to hydra.core.extract.json.optString+optString :: Typed.TypedTerm t0 -> Typed.TypedTerm (M.Map t0 JsonModel.Value) -> Typed.TypedTerm (Either String (Maybe String))+optString arg0 arg1 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.extract.json.optString")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)}))++-- | DSL reference to hydra.core.extract.json.require+require :: Typed.TypedTerm String -> Typed.TypedTerm (M.Map String t0) -> Typed.TypedTerm (Either String t0)+require arg0 arg1 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.extract.json.require")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)}))++-- | DSL reference to hydra.core.extract.json.requireArray+requireArray :: Typed.TypedTerm String -> Typed.TypedTerm (M.Map String JsonModel.Value) -> Typed.TypedTerm (Either String [JsonModel.Value])+requireArray arg0 arg1 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.extract.json.requireArray")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)}))++-- | DSL reference to hydra.core.extract.json.requireNumber+requireNumber :: Typed.TypedTerm String -> Typed.TypedTerm (M.Map String JsonModel.Value) -> Typed.TypedTerm (Either String Sci.Scientific)+requireNumber arg0 arg1 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.extract.json.requireNumber")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)}))++-- | DSL reference to hydra.core.extract.json.requireString+requireString :: Typed.TypedTerm String -> Typed.TypedTerm (M.Map String JsonModel.Value) -> Typed.TypedTerm (Either String String)+requireString arg0 arg1 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.extract.json.requireString")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)}))++-- | DSL reference to hydra.core.extract.json.showValue+showValue :: Typed.TypedTerm JsonModel.Value -> Typed.TypedTerm String+showValue arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.extract.json.showValue")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))
@@ -0,0 +1,382 @@+-- Note: this is an automatically generated file. Do not edit.++-- | DSL functions for hydra.core.file++module Hydra.Core.Dsl.File where++import qualified Hydra.Core.Decode.File as DecodeFile+import qualified Hydra.Core.Dsl.Model as DslModel+import qualified Hydra.Core.Dsl.Time as DslTime+import qualified Hydra.Core.Encode.File as EncodeFile+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Time as Time+import qualified Hydra.Core.Typed as Typed+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void+import qualified Data.Int as I++-- | DSL constructor for the hydra.core.file.FileExtension wrapper+fileExtension :: Typed.TypedTerm String -> Typed.TypedTerm File.FileExtension+fileExtension x =+ Typed.TypedTerm (Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.Name "hydra.core.file.FileExtension"),+ Model.wrappedTermBody = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.file.FileExtension+fileExtensionFileExtension :: Typed.TypedName File.FileExtension+fileExtensionFileExtension = Typed.TypedName (Model.Name "hydra.core.file.FileExtension")++-- | DSL constructor for the hydra.core.file.FilePath wrapper+filePath :: Typed.TypedTerm String -> Typed.TypedTerm File.FilePath+filePath x =+ Typed.TypedTerm (Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.Name "hydra.core.file.FilePath"),+ Model.wrappedTermBody = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.file.FilePath+filePathFilePath :: Typed.TypedName File.FilePath+filePathFilePath = Typed.TypedName (Model.Name "hydra.core.file.FilePath")++-- | DSL constructor for hydra.core.file.FileStatus+fileStatus :: Typed.TypedTerm File.FileType -> Typed.TypedTerm I.Int64 -> Typed.TypedTerm Time.Timespec -> Typed.TypedTerm (Maybe Time.Timespec) -> Typed.TypedTerm (Maybe Time.Timespec) -> Typed.TypedTerm File.FileStatus+fileStatus fileType size modificationTime accessTime statusChangeTime =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.file.FileStatus"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "fileType"),+ Model.fieldTerm = (Typed.unTypedTerm fileType)},+ Model.Field {+ Model.fieldName = (Model.Name "size"),+ Model.fieldTerm = (Typed.unTypedTerm size)},+ Model.Field {+ Model.fieldName = (Model.Name "modificationTime"),+ Model.fieldTerm = (Typed.unTypedTerm modificationTime)},+ Model.Field {+ Model.fieldName = (Model.Name "accessTime"),+ Model.fieldTerm = (Typed.unTypedTerm accessTime)},+ Model.Field {+ Model.fieldName = (Model.Name "statusChangeTime"),+ Model.fieldTerm = (Typed.unTypedTerm statusChangeTime)}]}))++-- | DSL accessor for the accessTime field of hydra.core.file.FileStatus+fileStatusAccessTime :: Typed.TypedTerm File.FileStatus -> Typed.TypedTerm (Maybe Time.Timespec)+fileStatusAccessTime x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.file.FileStatus"),+ Model.projectionFieldName = (Model.Name "accessTime")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.file.FileStatus+fileStatusFileStatus :: Typed.TypedName File.FileStatus+fileStatusFileStatus = Typed.TypedName (Model.Name "hydra.core.file.FileStatus")++-- | DSL accessor for the fileType field of hydra.core.file.FileStatus+fileStatusFileType :: Typed.TypedTerm File.FileStatus -> Typed.TypedTerm File.FileType+fileStatusFileType x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.file.FileStatus"),+ Model.projectionFieldName = (Model.Name "fileType")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the modificationTime field of hydra.core.file.FileStatus+fileStatusModificationTime :: Typed.TypedTerm File.FileStatus -> Typed.TypedTerm Time.Timespec+fileStatusModificationTime x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.file.FileStatus"),+ Model.projectionFieldName = (Model.Name "modificationTime")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the size field of hydra.core.file.FileStatus+fileStatusSize :: Typed.TypedTerm File.FileStatus -> Typed.TypedTerm I.Int64+fileStatusSize x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.file.FileStatus"),+ Model.projectionFieldName = (Model.Name "size")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the statusChangeTime field of hydra.core.file.FileStatus+fileStatusStatusChangeTime :: Typed.TypedTerm File.FileStatus -> Typed.TypedTerm (Maybe Time.Timespec)+fileStatusStatusChangeTime x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.file.FileStatus"),+ Model.projectionFieldName = (Model.Name "statusChangeTime")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL updater for the accessTime field of hydra.core.file.FileStatus+fileStatusWithAccessTime :: Typed.TypedTerm File.FileStatus -> Typed.TypedTerm (Maybe Time.Timespec) -> Typed.TypedTerm File.FileStatus+fileStatusWithAccessTime original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.file.FileStatus"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "fileType"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.file.FileStatus"),+ Model.projectionFieldName = (Model.Name "fileType")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "size"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.file.FileStatus"),+ Model.projectionFieldName = (Model.Name "size")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "modificationTime"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.file.FileStatus"),+ Model.projectionFieldName = (Model.Name "modificationTime")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "accessTime"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "statusChangeTime"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.file.FileStatus"),+ Model.projectionFieldName = (Model.Name "statusChangeTime")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the fileType field of hydra.core.file.FileStatus+fileStatusWithFileType :: Typed.TypedTerm File.FileStatus -> Typed.TypedTerm File.FileType -> Typed.TypedTerm File.FileStatus+fileStatusWithFileType original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.file.FileStatus"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "fileType"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "size"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.file.FileStatus"),+ Model.projectionFieldName = (Model.Name "size")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "modificationTime"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.file.FileStatus"),+ Model.projectionFieldName = (Model.Name "modificationTime")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "accessTime"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.file.FileStatus"),+ Model.projectionFieldName = (Model.Name "accessTime")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "statusChangeTime"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.file.FileStatus"),+ Model.projectionFieldName = (Model.Name "statusChangeTime")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the modificationTime field of hydra.core.file.FileStatus+fileStatusWithModificationTime :: Typed.TypedTerm File.FileStatus -> Typed.TypedTerm Time.Timespec -> Typed.TypedTerm File.FileStatus+fileStatusWithModificationTime original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.file.FileStatus"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "fileType"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.file.FileStatus"),+ Model.projectionFieldName = (Model.Name "fileType")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "size"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.file.FileStatus"),+ Model.projectionFieldName = (Model.Name "size")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "modificationTime"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "accessTime"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.file.FileStatus"),+ Model.projectionFieldName = (Model.Name "accessTime")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "statusChangeTime"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.file.FileStatus"),+ Model.projectionFieldName = (Model.Name "statusChangeTime")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the size field of hydra.core.file.FileStatus+fileStatusWithSize :: Typed.TypedTerm File.FileStatus -> Typed.TypedTerm I.Int64 -> Typed.TypedTerm File.FileStatus+fileStatusWithSize original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.file.FileStatus"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "fileType"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.file.FileStatus"),+ Model.projectionFieldName = (Model.Name "fileType")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "size"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "modificationTime"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.file.FileStatus"),+ Model.projectionFieldName = (Model.Name "modificationTime")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "accessTime"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.file.FileStatus"),+ Model.projectionFieldName = (Model.Name "accessTime")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "statusChangeTime"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.file.FileStatus"),+ Model.projectionFieldName = (Model.Name "statusChangeTime")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the statusChangeTime field of hydra.core.file.FileStatus+fileStatusWithStatusChangeTime :: Typed.TypedTerm File.FileStatus -> Typed.TypedTerm (Maybe Time.Timespec) -> Typed.TypedTerm File.FileStatus+fileStatusWithStatusChangeTime original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.file.FileStatus"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "fileType"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.file.FileStatus"),+ Model.projectionFieldName = (Model.Name "fileType")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "size"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.file.FileStatus"),+ Model.projectionFieldName = (Model.Name "size")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "modificationTime"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.file.FileStatus"),+ Model.projectionFieldName = (Model.Name "modificationTime")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "accessTime"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.file.FileStatus"),+ Model.projectionFieldName = (Model.Name "accessTime")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "statusChangeTime"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL injection for the block variant of hydra.core.file.FileType+fileTypeBlock :: Typed.TypedTerm File.FileType+fileTypeBlock =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.file.FileType"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "block"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL injection for the character variant of hydra.core.file.FileType+fileTypeCharacter :: Typed.TypedTerm File.FileType+fileTypeCharacter =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.file.FileType"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "character"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL injection for the directory variant of hydra.core.file.FileType+fileTypeDirectory :: Typed.TypedTerm File.FileType+fileTypeDirectory =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.file.FileType"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "directory"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL injection for the fifo variant of hydra.core.file.FileType+fileTypeFifo :: Typed.TypedTerm File.FileType+fileTypeFifo =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.file.FileType"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "fifo"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL name token for hydra.core.file.FileType+fileTypeFileType :: Typed.TypedName File.FileType+fileTypeFileType = Typed.TypedName (Model.Name "hydra.core.file.FileType")++-- | DSL injection for the link variant of hydra.core.file.FileType+fileTypeLink :: Typed.TypedTerm File.FileType+fileTypeLink =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.file.FileType"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "link"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL injection for the regular variant of hydra.core.file.FileType+fileTypeRegular :: Typed.TypedTerm File.FileType+fileTypeRegular =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.file.FileType"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "regular"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL injection for the socket variant of hydra.core.file.FileType+fileTypeSocket :: Typed.TypedTerm File.FileType+fileTypeSocket =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.file.FileType"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "socket"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL accessor for the body of hydra.core.file.FileExtension+unFileExtension :: Typed.TypedTerm File.FileExtension -> Typed.TypedTerm String+unFileExtension x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermUnwrap (Model.Name "hydra.core.file.FileExtension")),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the body of hydra.core.file.FilePath+unFilePath :: Typed.TypedTerm File.FilePath -> Typed.TypedTerm String+unFilePath x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermUnwrap (Model.Name "hydra.core.file.FilePath")),+ Model.applicationArgument = (Typed.unTypedTerm x)}))
@@ -0,0 +1,226 @@+-- Note: this is an automatically generated file. Do not edit.++-- | DSL functions for hydra.core.formatting++module Hydra.Core.Dsl.Formatting where++import qualified Hydra.Core.Ast as Ast+import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Diff as Diff+import qualified Hydra.Core.Docs as Docs+import qualified Hydra.Core.Dsl.Ast as DslAst+import qualified Hydra.Core.Dsl.Coders as DslCoders+import qualified Hydra.Core.Dsl.Diff as DslDiff+import qualified Hydra.Core.Dsl.Docs as DslDocs+import qualified Hydra.Core.Dsl.Error.Checking as ErrorChecking+import qualified Hydra.Core.Dsl.Error.File as DslErrorFile+import qualified Hydra.Core.Dsl.Error.Model as DslErrorModel+import qualified Hydra.Core.Dsl.Error.Packaging as DslErrorPackaging+import qualified Hydra.Core.Dsl.Error.System as DslErrorSystem+import qualified Hydra.Core.Dsl.Errors as DslErrors+import qualified Hydra.Core.Dsl.File as DslFile+import qualified Hydra.Core.Dsl.Graph as DslGraph+import qualified Hydra.Core.Dsl.Json.Model as DslJsonModel+import qualified Hydra.Core.Dsl.Markdown as DslMarkdown+import qualified Hydra.Core.Dsl.Model as DslModel+import qualified Hydra.Core.Dsl.Packaging as DslPackaging+import qualified Hydra.Core.Dsl.Parsing as DslParsing+import qualified Hydra.Core.Dsl.Paths as DslPaths+import qualified Hydra.Core.Dsl.Query as DslQuery+import qualified Hydra.Core.Dsl.Regex as DslRegex+import qualified Hydra.Core.Dsl.Relational as DslRelational+import qualified Hydra.Core.Dsl.System as DslSystem+import qualified Hydra.Core.Dsl.Tabular as DslTabular+import qualified Hydra.Core.Dsl.Testing as DslTesting+import qualified Hydra.Core.Dsl.Time as DslTime+import qualified Hydra.Core.Dsl.Topology as DslTopology+import qualified Hydra.Core.Dsl.Typing as DslTyping+import qualified Hydra.Core.Dsl.Util as DslUtil+import qualified Hydra.Core.Dsl.Validation as DslValidation+import qualified Hydra.Core.Dsl.Variants as DslVariants+import qualified Hydra.Core.Error.Checking as Checking+import qualified Hydra.Core.Error.File as ErrorFile+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Error.Packaging as ErrorPackaging+import qualified Hydra.Core.Error.System as ErrorSystem+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Formatting as Formatting+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Json.Model as JsonModel+import qualified Hydra.Core.Markdown as Markdown+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Parsing as Parsing+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Query as Query+import qualified Hydra.Core.Regex as Regex+import qualified Hydra.Core.Relational as Relational+import qualified Hydra.Core.System as System+import qualified Hydra.Core.Tabular as Tabular+import qualified Hydra.Core.Testing as Testing+import qualified Hydra.Core.Time as Time+import qualified Hydra.Core.Topology as Topology+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Validation as Validation+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void+import qualified Data.Set as S++-- | DSL reference to hydra.core.formatting.capitalize+capitalize :: Typed.TypedTerm String -> Typed.TypedTerm String+capitalize arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.formatting.capitalize")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.formatting.convertCase+convertCase :: Typed.TypedTerm Util.CaseConvention -> Typed.TypedTerm Util.CaseConvention -> Typed.TypedTerm String -> Typed.TypedTerm String+convertCase arg0 arg1 arg2 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.formatting.convertCase")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)})),+ Model.applicationArgument = (Typed.unTypedTerm arg2)}))++-- | DSL reference to hydra.core.formatting.convertCaseCamelOrUnderscoreToLowerSnake+convertCaseCamelOrUnderscoreToLowerSnake :: Typed.TypedTerm String -> Typed.TypedTerm String+convertCaseCamelOrUnderscoreToLowerSnake arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.formatting.convertCaseCamelOrUnderscoreToLowerSnake")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.formatting.convertCaseCamelToLowerSnake+convertCaseCamelToLowerSnake :: Typed.TypedTerm String -> Typed.TypedTerm String+convertCaseCamelToLowerSnake arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.formatting.convertCaseCamelToLowerSnake")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.formatting.convertCaseCamelToUpperSnake+convertCaseCamelToUpperSnake :: Typed.TypedTerm String -> Typed.TypedTerm String+convertCaseCamelToUpperSnake arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.formatting.convertCaseCamelToUpperSnake")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.formatting.convertCasePascalToUpperSnake+convertCasePascalToUpperSnake :: Typed.TypedTerm String -> Typed.TypedTerm String+convertCasePascalToUpperSnake arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.formatting.convertCasePascalToUpperSnake")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.formatting.decapitalize+decapitalize :: Typed.TypedTerm String -> Typed.TypedTerm String+decapitalize arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.formatting.decapitalize")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.formatting.escapeWithUnderscore+escapeWithUnderscore :: Typed.TypedTerm (S.Set String) -> Typed.TypedTerm String -> Typed.TypedTerm String+escapeWithUnderscore arg0 arg1 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.formatting.escapeWithUnderscore")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)}))++-- | DSL reference to hydra.core.formatting.indentLines+indentLines :: Typed.TypedTerm String -> Typed.TypedTerm String+indentLines arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.formatting.indentLines")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.formatting.javaStyleComment+javaStyleComment :: Typed.TypedTerm String -> Typed.TypedTerm String+javaStyleComment arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.formatting.javaStyleComment")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.formatting.lines+lines :: Typed.TypedTerm String -> Typed.TypedTerm [String]+lines arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.formatting.lines")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.formatting.mapFirstLetter+mapFirstLetter :: Typed.TypedTerm (String -> String) -> Typed.TypedTerm String -> Typed.TypedTerm String+mapFirstLetter arg0 arg1 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.formatting.mapFirstLetter")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)}))++-- | DSL reference to hydra.core.formatting.nonAlnumToUnderscores+nonAlnumToUnderscores :: Typed.TypedTerm String -> Typed.TypedTerm String+nonAlnumToUnderscores arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.formatting.nonAlnumToUnderscores")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.formatting.normalizeComment+normalizeComment :: Typed.TypedTerm String -> Typed.TypedTerm String+normalizeComment arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.formatting.normalizeComment")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.formatting.sanitizeWithUnderscores+sanitizeWithUnderscores :: Typed.TypedTerm (S.Set String) -> Typed.TypedTerm String -> Typed.TypedTerm String+sanitizeWithUnderscores arg0 arg1 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.formatting.sanitizeWithUnderscores")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)}))++-- | DSL reference to hydra.core.formatting.showList+showList :: Typed.TypedTerm (t0 -> String) -> Typed.TypedTerm [t0] -> Typed.TypedTerm String+showList arg0 arg1 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.formatting.showList")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)}))++-- | DSL reference to hydra.core.formatting.stripLeadingAndTrailingWhitespace+stripLeadingAndTrailingWhitespace :: Typed.TypedTerm String -> Typed.TypedTerm String+stripLeadingAndTrailingWhitespace arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.formatting.stripLeadingAndTrailingWhitespace")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.formatting.unlines+unlines :: Typed.TypedTerm [String] -> Typed.TypedTerm String+unlines arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.formatting.unlines")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.formatting.withCharacterAliases+withCharacterAliases :: Typed.TypedTerm String -> Typed.TypedTerm String+withCharacterAliases arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.formatting.withCharacterAliases")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.formatting.wrapLine+wrapLine :: Typed.TypedTerm Int -> Typed.TypedTerm String -> Typed.TypedTerm String+wrapLine arg0 arg1 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.formatting.wrapLine")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)}))
@@ -0,0 +1,921 @@+-- Note: this is an automatically generated file. Do not edit.++-- | DSL functions for hydra.core.graph++module Hydra.Core.Dsl.Graph where++import qualified Hydra.Core.Dsl.Errors as DslErrors+import qualified Hydra.Core.Dsl.Model as DslModel+import qualified Hydra.Core.Dsl.Packaging as DslPackaging+import qualified Hydra.Core.Dsl.Typing as DslTyping+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void+import qualified Data.Map as M+import qualified Data.Set as S++-- | DSL composition builder for the decoder of hydra.core.graph.TermCoder+decodeTermCoder :: Typed.TypedTerm (Graph.Graph -> Model.Term -> Either Errors.DecodingError a) -> Typed.TypedTerm (Graph.Graph -> Model.Term -> Either Errors.DecodingError (Graph.TermCoder a))+decodeTermCoder a =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.decode.graph.termCoder")),+ Model.applicationArgument = (Typed.unTypedTerm a)}))++-- | DSL composition builder for the encoder of hydra.core.graph.TermCoder+encodeTermCoder :: Typed.TypedTerm (a -> Model.Term) -> Typed.TypedTerm (Graph.TermCoder a -> Model.Term)+encodeTermCoder a =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.encode.graph.termCoder")),+ Model.applicationArgument = (Typed.unTypedTerm a)}))++-- | DSL constructor for hydra.core.graph.Graph+graph :: Typed.TypedTerm (M.Map Model.Name Model.Term) -> Typed.TypedTerm (M.Map Model.Name Model.TypeScheme) -> Typed.TypedTerm (M.Map Model.Name Model.TypeVariableConstraints) -> Typed.TypedTerm (S.Set Model.Name) -> Typed.TypedTerm (M.Map Model.Name Model.Term) -> Typed.TypedTerm (M.Map Model.Name Graph.Primitive) -> Typed.TypedTerm (M.Map Model.Name Model.TypeScheme) -> Typed.TypedTerm (S.Set Model.Name) -> Typed.TypedTerm Graph.Graph+graph boundTerms boundTypes classConstraints lambdaVariables metadata primitives schemaTypes typeVariables =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.graph.Graph"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "boundTerms"),+ Model.fieldTerm = (Typed.unTypedTerm boundTerms)},+ Model.Field {+ Model.fieldName = (Model.Name "boundTypes"),+ Model.fieldTerm = (Typed.unTypedTerm boundTypes)},+ Model.Field {+ Model.fieldName = (Model.Name "classConstraints"),+ Model.fieldTerm = (Typed.unTypedTerm classConstraints)},+ Model.Field {+ Model.fieldName = (Model.Name "lambdaVariables"),+ Model.fieldTerm = (Typed.unTypedTerm lambdaVariables)},+ Model.Field {+ Model.fieldName = (Model.Name "metadata"),+ Model.fieldTerm = (Typed.unTypedTerm metadata)},+ Model.Field {+ Model.fieldName = (Model.Name "primitives"),+ Model.fieldTerm = (Typed.unTypedTerm primitives)},+ Model.Field {+ Model.fieldName = (Model.Name "schemaTypes"),+ Model.fieldTerm = (Typed.unTypedTerm schemaTypes)},+ Model.Field {+ Model.fieldName = (Model.Name "typeVariables"),+ Model.fieldTerm = (Typed.unTypedTerm typeVariables)}]}))++-- | DSL accessor for the boundTerms field of hydra.core.graph.Graph+graphBoundTerms :: Typed.TypedTerm Graph.Graph -> Typed.TypedTerm (M.Map Model.Name Model.Term)+graphBoundTerms x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.graph.Graph"),+ Model.projectionFieldName = (Model.Name "boundTerms")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the boundTypes field of hydra.core.graph.Graph+graphBoundTypes :: Typed.TypedTerm Graph.Graph -> Typed.TypedTerm (M.Map Model.Name Model.TypeScheme)+graphBoundTypes x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.graph.Graph"),+ Model.projectionFieldName = (Model.Name "boundTypes")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the classConstraints field of hydra.core.graph.Graph+graphClassConstraints :: Typed.TypedTerm Graph.Graph -> Typed.TypedTerm (M.Map Model.Name Model.TypeVariableConstraints)+graphClassConstraints x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.graph.Graph"),+ Model.projectionFieldName = (Model.Name "classConstraints")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.graph.Graph+graphGraph :: Typed.TypedName Graph.Graph+graphGraph = Typed.TypedName (Model.Name "hydra.core.graph.Graph")++-- | DSL accessor for the lambdaVariables field of hydra.core.graph.Graph+graphLambdaVariables :: Typed.TypedTerm Graph.Graph -> Typed.TypedTerm (S.Set Model.Name)+graphLambdaVariables x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.graph.Graph"),+ Model.projectionFieldName = (Model.Name "lambdaVariables")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the metadata field of hydra.core.graph.Graph+graphMetadata :: Typed.TypedTerm Graph.Graph -> Typed.TypedTerm (M.Map Model.Name Model.Term)+graphMetadata x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.graph.Graph"),+ Model.projectionFieldName = (Model.Name "metadata")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the primitives field of hydra.core.graph.Graph+graphPrimitives :: Typed.TypedTerm Graph.Graph -> Typed.TypedTerm (M.Map Model.Name Graph.Primitive)+graphPrimitives x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.graph.Graph"),+ Model.projectionFieldName = (Model.Name "primitives")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the schemaTypes field of hydra.core.graph.Graph+graphSchemaTypes :: Typed.TypedTerm Graph.Graph -> Typed.TypedTerm (M.Map Model.Name Model.TypeScheme)+graphSchemaTypes x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.graph.Graph"),+ Model.projectionFieldName = (Model.Name "schemaTypes")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the typeVariables field of hydra.core.graph.Graph+graphTypeVariables :: Typed.TypedTerm Graph.Graph -> Typed.TypedTerm (S.Set Model.Name)+graphTypeVariables x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.graph.Graph"),+ Model.projectionFieldName = (Model.Name "typeVariables")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL updater for the boundTerms field of hydra.core.graph.Graph+graphWithBoundTerms :: Typed.TypedTerm Graph.Graph -> Typed.TypedTerm (M.Map Model.Name Model.Term) -> Typed.TypedTerm Graph.Graph+graphWithBoundTerms original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.graph.Graph"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "boundTerms"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "boundTypes"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.graph.Graph"),+ Model.projectionFieldName = (Model.Name "boundTypes")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "classConstraints"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.graph.Graph"),+ Model.projectionFieldName = (Model.Name "classConstraints")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "lambdaVariables"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.graph.Graph"),+ Model.projectionFieldName = (Model.Name "lambdaVariables")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "metadata"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.graph.Graph"),+ Model.projectionFieldName = (Model.Name "metadata")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "primitives"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.graph.Graph"),+ Model.projectionFieldName = (Model.Name "primitives")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "schemaTypes"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.graph.Graph"),+ Model.projectionFieldName = (Model.Name "schemaTypes")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "typeVariables"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.graph.Graph"),+ Model.projectionFieldName = (Model.Name "typeVariables")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the boundTypes field of hydra.core.graph.Graph+graphWithBoundTypes :: Typed.TypedTerm Graph.Graph -> Typed.TypedTerm (M.Map Model.Name Model.TypeScheme) -> Typed.TypedTerm Graph.Graph+graphWithBoundTypes original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.graph.Graph"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "boundTerms"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.graph.Graph"),+ Model.projectionFieldName = (Model.Name "boundTerms")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "boundTypes"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "classConstraints"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.graph.Graph"),+ Model.projectionFieldName = (Model.Name "classConstraints")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "lambdaVariables"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.graph.Graph"),+ Model.projectionFieldName = (Model.Name "lambdaVariables")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "metadata"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.graph.Graph"),+ Model.projectionFieldName = (Model.Name "metadata")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "primitives"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.graph.Graph"),+ Model.projectionFieldName = (Model.Name "primitives")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "schemaTypes"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.graph.Graph"),+ Model.projectionFieldName = (Model.Name "schemaTypes")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "typeVariables"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.graph.Graph"),+ Model.projectionFieldName = (Model.Name "typeVariables")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the classConstraints field of hydra.core.graph.Graph+graphWithClassConstraints :: Typed.TypedTerm Graph.Graph -> Typed.TypedTerm (M.Map Model.Name Model.TypeVariableConstraints) -> Typed.TypedTerm Graph.Graph+graphWithClassConstraints original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.graph.Graph"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "boundTerms"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.graph.Graph"),+ Model.projectionFieldName = (Model.Name "boundTerms")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "boundTypes"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.graph.Graph"),+ Model.projectionFieldName = (Model.Name "boundTypes")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "classConstraints"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "lambdaVariables"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.graph.Graph"),+ Model.projectionFieldName = (Model.Name "lambdaVariables")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "metadata"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.graph.Graph"),+ Model.projectionFieldName = (Model.Name "metadata")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "primitives"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.graph.Graph"),+ Model.projectionFieldName = (Model.Name "primitives")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "schemaTypes"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.graph.Graph"),+ Model.projectionFieldName = (Model.Name "schemaTypes")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "typeVariables"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.graph.Graph"),+ Model.projectionFieldName = (Model.Name "typeVariables")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the lambdaVariables field of hydra.core.graph.Graph+graphWithLambdaVariables :: Typed.TypedTerm Graph.Graph -> Typed.TypedTerm (S.Set Model.Name) -> Typed.TypedTerm Graph.Graph+graphWithLambdaVariables original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.graph.Graph"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "boundTerms"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.graph.Graph"),+ Model.projectionFieldName = (Model.Name "boundTerms")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "boundTypes"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.graph.Graph"),+ Model.projectionFieldName = (Model.Name "boundTypes")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "classConstraints"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.graph.Graph"),+ Model.projectionFieldName = (Model.Name "classConstraints")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "lambdaVariables"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "metadata"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.graph.Graph"),+ Model.projectionFieldName = (Model.Name "metadata")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "primitives"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.graph.Graph"),+ Model.projectionFieldName = (Model.Name "primitives")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "schemaTypes"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.graph.Graph"),+ Model.projectionFieldName = (Model.Name "schemaTypes")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "typeVariables"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.graph.Graph"),+ Model.projectionFieldName = (Model.Name "typeVariables")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the metadata field of hydra.core.graph.Graph+graphWithMetadata :: Typed.TypedTerm Graph.Graph -> Typed.TypedTerm (M.Map Model.Name Model.Term) -> Typed.TypedTerm Graph.Graph+graphWithMetadata original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.graph.Graph"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "boundTerms"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.graph.Graph"),+ Model.projectionFieldName = (Model.Name "boundTerms")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "boundTypes"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.graph.Graph"),+ Model.projectionFieldName = (Model.Name "boundTypes")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "classConstraints"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.graph.Graph"),+ Model.projectionFieldName = (Model.Name "classConstraints")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "lambdaVariables"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.graph.Graph"),+ Model.projectionFieldName = (Model.Name "lambdaVariables")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "metadata"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "primitives"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.graph.Graph"),+ Model.projectionFieldName = (Model.Name "primitives")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "schemaTypes"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.graph.Graph"),+ Model.projectionFieldName = (Model.Name "schemaTypes")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "typeVariables"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.graph.Graph"),+ Model.projectionFieldName = (Model.Name "typeVariables")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the primitives field of hydra.core.graph.Graph+graphWithPrimitives :: Typed.TypedTerm Graph.Graph -> Typed.TypedTerm (M.Map Model.Name Graph.Primitive) -> Typed.TypedTerm Graph.Graph+graphWithPrimitives original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.graph.Graph"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "boundTerms"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.graph.Graph"),+ Model.projectionFieldName = (Model.Name "boundTerms")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "boundTypes"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.graph.Graph"),+ Model.projectionFieldName = (Model.Name "boundTypes")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "classConstraints"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.graph.Graph"),+ Model.projectionFieldName = (Model.Name "classConstraints")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "lambdaVariables"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.graph.Graph"),+ Model.projectionFieldName = (Model.Name "lambdaVariables")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "metadata"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.graph.Graph"),+ Model.projectionFieldName = (Model.Name "metadata")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "primitives"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "schemaTypes"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.graph.Graph"),+ Model.projectionFieldName = (Model.Name "schemaTypes")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "typeVariables"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.graph.Graph"),+ Model.projectionFieldName = (Model.Name "typeVariables")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the schemaTypes field of hydra.core.graph.Graph+graphWithSchemaTypes :: Typed.TypedTerm Graph.Graph -> Typed.TypedTerm (M.Map Model.Name Model.TypeScheme) -> Typed.TypedTerm Graph.Graph+graphWithSchemaTypes original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.graph.Graph"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "boundTerms"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.graph.Graph"),+ Model.projectionFieldName = (Model.Name "boundTerms")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "boundTypes"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.graph.Graph"),+ Model.projectionFieldName = (Model.Name "boundTypes")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "classConstraints"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.graph.Graph"),+ Model.projectionFieldName = (Model.Name "classConstraints")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "lambdaVariables"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.graph.Graph"),+ Model.projectionFieldName = (Model.Name "lambdaVariables")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "metadata"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.graph.Graph"),+ Model.projectionFieldName = (Model.Name "metadata")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "primitives"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.graph.Graph"),+ Model.projectionFieldName = (Model.Name "primitives")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "schemaTypes"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "typeVariables"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.graph.Graph"),+ Model.projectionFieldName = (Model.Name "typeVariables")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the typeVariables field of hydra.core.graph.Graph+graphWithTypeVariables :: Typed.TypedTerm Graph.Graph -> Typed.TypedTerm (S.Set Model.Name) -> Typed.TypedTerm Graph.Graph+graphWithTypeVariables original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.graph.Graph"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "boundTerms"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.graph.Graph"),+ Model.projectionFieldName = (Model.Name "boundTerms")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "boundTypes"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.graph.Graph"),+ Model.projectionFieldName = (Model.Name "boundTypes")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "classConstraints"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.graph.Graph"),+ Model.projectionFieldName = (Model.Name "classConstraints")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "lambdaVariables"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.graph.Graph"),+ Model.projectionFieldName = (Model.Name "lambdaVariables")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "metadata"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.graph.Graph"),+ Model.projectionFieldName = (Model.Name "metadata")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "primitives"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.graph.Graph"),+ Model.projectionFieldName = (Model.Name "primitives")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "schemaTypes"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.graph.Graph"),+ Model.projectionFieldName = (Model.Name "schemaTypes")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "typeVariables"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL constructor for hydra.core.graph.Library+library :: Typed.TypedTerm Packaging.ModuleName -> Typed.TypedTerm String -> Typed.TypedTerm [Graph.Primitive] -> Typed.TypedTerm Graph.Library+library name prefix primitives =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.graph.Library"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Typed.unTypedTerm name)},+ Model.Field {+ Model.fieldName = (Model.Name "prefix"),+ Model.fieldTerm = (Typed.unTypedTerm prefix)},+ Model.Field {+ Model.fieldName = (Model.Name "primitives"),+ Model.fieldTerm = (Typed.unTypedTerm primitives)}]}))++-- | DSL name token for hydra.core.graph.Library+libraryLibrary :: Typed.TypedName Graph.Library+libraryLibrary = Typed.TypedName (Model.Name "hydra.core.graph.Library")++-- | DSL accessor for the name field of hydra.core.graph.Library+libraryName :: Typed.TypedTerm Graph.Library -> Typed.TypedTerm Packaging.ModuleName+libraryName x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.graph.Library"),+ Model.projectionFieldName = (Model.Name "name")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the prefix field of hydra.core.graph.Library+libraryPrefix :: Typed.TypedTerm Graph.Library -> Typed.TypedTerm String+libraryPrefix x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.graph.Library"),+ Model.projectionFieldName = (Model.Name "prefix")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the primitives field of hydra.core.graph.Library+libraryPrimitives :: Typed.TypedTerm Graph.Library -> Typed.TypedTerm [Graph.Primitive]+libraryPrimitives x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.graph.Library"),+ Model.projectionFieldName = (Model.Name "primitives")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL updater for the name field of hydra.core.graph.Library+libraryWithName :: Typed.TypedTerm Graph.Library -> Typed.TypedTerm Packaging.ModuleName -> Typed.TypedTerm Graph.Library+libraryWithName original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.graph.Library"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "prefix"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.graph.Library"),+ Model.projectionFieldName = (Model.Name "prefix")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "primitives"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.graph.Library"),+ Model.projectionFieldName = (Model.Name "primitives")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the prefix field of hydra.core.graph.Library+libraryWithPrefix :: Typed.TypedTerm Graph.Library -> Typed.TypedTerm String -> Typed.TypedTerm Graph.Library+libraryWithPrefix original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.graph.Library"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.graph.Library"),+ Model.projectionFieldName = (Model.Name "name")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "prefix"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "primitives"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.graph.Library"),+ Model.projectionFieldName = (Model.Name "primitives")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the primitives field of hydra.core.graph.Library+libraryWithPrimitives :: Typed.TypedTerm Graph.Library -> Typed.TypedTerm [Graph.Primitive] -> Typed.TypedTerm Graph.Library+libraryWithPrimitives original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.graph.Library"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.graph.Library"),+ Model.projectionFieldName = (Model.Name "name")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "prefix"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.graph.Library"),+ Model.projectionFieldName = (Model.Name "prefix")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "primitives"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL constructor for hydra.core.graph.Primitive+primitive :: Typed.TypedTerm Packaging.PrimitiveDefinition -> Typed.TypedTerm (Graph.Graph -> [Model.Term] -> Either Errors.Error Model.Term) -> Typed.TypedTerm Graph.Primitive+primitive definition implementation =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.graph.Primitive"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "definition"),+ Model.fieldTerm = (Typed.unTypedTerm definition)},+ Model.Field {+ Model.fieldName = (Model.Name "implementation"),+ Model.fieldTerm = (Typed.unTypedTerm implementation)}]}))++-- | DSL accessor for the definition field of hydra.core.graph.Primitive+primitiveDefinition :: Typed.TypedTerm Graph.Primitive -> Typed.TypedTerm Packaging.PrimitiveDefinition+primitiveDefinition x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.graph.Primitive"),+ Model.projectionFieldName = (Model.Name "definition")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the implementation field of hydra.core.graph.Primitive+primitiveImplementation :: Typed.TypedTerm Graph.Primitive -> Typed.TypedTerm (Graph.Graph -> [Model.Term] -> Either Errors.Error Model.Term)+primitiveImplementation x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.graph.Primitive"),+ Model.projectionFieldName = (Model.Name "implementation")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.graph.Primitive+primitivePrimitive :: Typed.TypedName Graph.Primitive+primitivePrimitive = Typed.TypedName (Model.Name "hydra.core.graph.Primitive")++-- | DSL updater for the definition field of hydra.core.graph.Primitive+primitiveWithDefinition :: Typed.TypedTerm Graph.Primitive -> Typed.TypedTerm Packaging.PrimitiveDefinition -> Typed.TypedTerm Graph.Primitive+primitiveWithDefinition original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.graph.Primitive"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "definition"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "implementation"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.graph.Primitive"),+ Model.projectionFieldName = (Model.Name "implementation")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the implementation field of hydra.core.graph.Primitive+primitiveWithImplementation :: Typed.TypedTerm Graph.Primitive -> Typed.TypedTerm (Graph.Graph -> [Model.Term] -> Either Errors.Error Model.Term) -> Typed.TypedTerm Graph.Primitive+primitiveWithImplementation original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.graph.Primitive"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "definition"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.graph.Primitive"),+ Model.projectionFieldName = (Model.Name "definition")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "implementation"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL constructor for hydra.core.graph.TermCoder+termCoder :: Typed.TypedTerm Model.Type -> Typed.TypedTerm (Typing.InferenceContext -> Graph.Graph -> Model.Term -> Either Errors.Error a) -> Typed.TypedTerm (Typing.InferenceContext -> a -> Either Errors.Error Model.Term) -> Typed.TypedTerm (Graph.TermCoder a)+termCoder type_ encode decode =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.graph.TermCoder"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "type"),+ Model.fieldTerm = (Typed.unTypedTerm type_)},+ Model.Field {+ Model.fieldName = (Model.Name "encode"),+ Model.fieldTerm = (Typed.unTypedTerm encode)},+ Model.Field {+ Model.fieldName = (Model.Name "decode"),+ Model.fieldTerm = (Typed.unTypedTerm decode)}]}))++-- | DSL accessor for the decode field of hydra.core.graph.TermCoder+termCoderDecode :: Typed.TypedTerm (Graph.TermCoder a) -> Typed.TypedTerm (Typing.InferenceContext -> a -> Either Errors.Error Model.Term)+termCoderDecode x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.graph.TermCoder"),+ Model.projectionFieldName = (Model.Name "decode")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the encode field of hydra.core.graph.TermCoder+termCoderEncode :: Typed.TypedTerm (Graph.TermCoder a) -> Typed.TypedTerm (Typing.InferenceContext -> Graph.Graph -> Model.Term -> Either Errors.Error a)+termCoderEncode x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.graph.TermCoder"),+ Model.projectionFieldName = (Model.Name "encode")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.graph.TermCoder+termCoderTermCoder :: Typed.TypedName (Graph.TermCoder a)+termCoderTermCoder = Typed.TypedName (Model.Name "hydra.core.graph.TermCoder")++-- | DSL accessor for the type field of hydra.core.graph.TermCoder+termCoderType :: Typed.TypedTerm (Graph.TermCoder a) -> Typed.TypedTerm Model.Type+termCoderType x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.graph.TermCoder"),+ Model.projectionFieldName = (Model.Name "type")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL updater for the decode field of hydra.core.graph.TermCoder+termCoderWithDecode :: Typed.TypedTerm (Graph.TermCoder a) -> Typed.TypedTerm (Typing.InferenceContext -> a -> Either Errors.Error Model.Term) -> Typed.TypedTerm (Graph.TermCoder a)+termCoderWithDecode original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.graph.TermCoder"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "type"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.graph.TermCoder"),+ Model.projectionFieldName = (Model.Name "type")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "encode"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.graph.TermCoder"),+ Model.projectionFieldName = (Model.Name "encode")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "decode"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL updater for the encode field of hydra.core.graph.TermCoder+termCoderWithEncode :: Typed.TypedTerm (Graph.TermCoder a) -> Typed.TypedTerm (Typing.InferenceContext -> Graph.Graph -> Model.Term -> Either Errors.Error a) -> Typed.TypedTerm (Graph.TermCoder a)+termCoderWithEncode original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.graph.TermCoder"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "type"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.graph.TermCoder"),+ Model.projectionFieldName = (Model.Name "type")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "encode"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "decode"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.graph.TermCoder"),+ Model.projectionFieldName = (Model.Name "decode")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the type field of hydra.core.graph.TermCoder+termCoderWithType :: Typed.TypedTerm (Graph.TermCoder a) -> Typed.TypedTerm Model.Type -> Typed.TypedTerm (Graph.TermCoder a)+termCoderWithType original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.graph.TermCoder"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "type"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "encode"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.graph.TermCoder"),+ Model.projectionFieldName = (Model.Name "encode")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "decode"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.graph.TermCoder"),+ Model.projectionFieldName = (Model.Name "decode")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))
@@ -0,0 +1,38 @@+-- Note: this is an automatically generated file. Do not edit.++-- | DSL functions for hydra.core.json.bootstrap++module Hydra.Core.Dsl.Json.Bootstrap where++import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Dsl.Coders as DslCoders+import qualified Hydra.Core.Dsl.Error.Checking as ErrorChecking+import qualified Hydra.Core.Dsl.Error.Model as DslErrorModel+import qualified Hydra.Core.Dsl.Errors as DslErrors+import qualified Hydra.Core.Dsl.Graph as DslGraph+import qualified Hydra.Core.Dsl.Model as DslModel+import qualified Hydra.Core.Dsl.Packaging as DslPackaging+import qualified Hydra.Core.Dsl.Paths as DslPaths+import qualified Hydra.Core.Dsl.Typing as DslTyping+import qualified Hydra.Core.Dsl.Util as DslUtil+import qualified Hydra.Core.Dsl.Variants as DslVariants+import qualified Hydra.Core.Error.Checking as Checking+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Json.Bootstrap as Bootstrap+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void+import qualified Data.Map as M++-- | DSL reference to hydra.core.json.bootstrap.typesByName+typesByName :: Typed.TypedTerm (M.Map Model.Name Model.Type)+typesByName = Typed.TypedTerm (Model.TermVariable (Model.Name "hydra.core.json.bootstrap.typesByName"))
@@ -0,0 +1,164 @@+-- Note: this is an automatically generated file. Do not edit.++-- | DSL functions for hydra.core.json.decode++module Hydra.Core.Dsl.Json.Decode where++import qualified Hydra.Core.Ast as Ast+import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Diff as Diff+import qualified Hydra.Core.Docs as Docs+import qualified Hydra.Core.Dsl.Ast as DslAst+import qualified Hydra.Core.Dsl.Coders as DslCoders+import qualified Hydra.Core.Dsl.Diff as DslDiff+import qualified Hydra.Core.Dsl.Docs as DslDocs+import qualified Hydra.Core.Dsl.Error.Checking as ErrorChecking+import qualified Hydra.Core.Dsl.Error.File as DslErrorFile+import qualified Hydra.Core.Dsl.Error.Model as DslErrorModel+import qualified Hydra.Core.Dsl.Error.Packaging as DslErrorPackaging+import qualified Hydra.Core.Dsl.Error.System as DslErrorSystem+import qualified Hydra.Core.Dsl.Errors as DslErrors+import qualified Hydra.Core.Dsl.File as DslFile+import qualified Hydra.Core.Dsl.Graph as DslGraph+import qualified Hydra.Core.Dsl.Json.Model as DslJsonModel+import qualified Hydra.Core.Dsl.Markdown as DslMarkdown+import qualified Hydra.Core.Dsl.Model as DslModel+import qualified Hydra.Core.Dsl.Packaging as DslPackaging+import qualified Hydra.Core.Dsl.Parsing as DslParsing+import qualified Hydra.Core.Dsl.Paths as DslPaths+import qualified Hydra.Core.Dsl.Query as DslQuery+import qualified Hydra.Core.Dsl.Regex as DslRegex+import qualified Hydra.Core.Dsl.Relational as DslRelational+import qualified Hydra.Core.Dsl.Resolution as DslResolution+import qualified Hydra.Core.Dsl.Strip as DslStrip+import qualified Hydra.Core.Dsl.System as DslSystem+import qualified Hydra.Core.Dsl.Tabular as DslTabular+import qualified Hydra.Core.Dsl.Testing as DslTesting+import qualified Hydra.Core.Dsl.Time as DslTime+import qualified Hydra.Core.Dsl.Topology as DslTopology+import qualified Hydra.Core.Dsl.Typing as DslTyping+import qualified Hydra.Core.Dsl.Util as DslUtil+import qualified Hydra.Core.Dsl.Validation as DslValidation+import qualified Hydra.Core.Dsl.Variants as DslVariants+import qualified Hydra.Core.Error.Checking as Checking+import qualified Hydra.Core.Error.File as ErrorFile+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Error.Packaging as ErrorPackaging+import qualified Hydra.Core.Error.System as ErrorSystem+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.Extract.Model as ExtractModel+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Json.Decode as Decode+import qualified Hydra.Core.Json.Model as JsonModel+import qualified Hydra.Core.Literals as Literals+import qualified Hydra.Core.Markdown as Markdown+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Parsing as Parsing+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Print.Model as PrintModel+import qualified Hydra.Core.Query as Query+import qualified Hydra.Core.Regex as Regex+import qualified Hydra.Core.Relational as Relational+import qualified Hydra.Core.Resolution as Resolution+import qualified Hydra.Core.Strip as Strip+import qualified Hydra.Core.Substitution as Substitution+import qualified Hydra.Core.System as System+import qualified Hydra.Core.Tabular as Tabular+import qualified Hydra.Core.Testing as Testing+import qualified Hydra.Core.Time as Time+import qualified Hydra.Core.Topology as Topology+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Validation as Validation+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void+import qualified Data.Map as M++-- | DSL reference to hydra.core.json.decode.decodeFloat+decodeFloat :: Typed.TypedTerm Model.FloatType -> Typed.TypedTerm JsonModel.Value -> Typed.TypedTerm (Either String Model.Term)+decodeFloat arg0 arg1 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.json.decode.decodeFloat")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)}))++-- | DSL reference to hydra.core.json.decode.decodeInteger+decodeInteger :: Typed.TypedTerm Model.IntegerType -> Typed.TypedTerm JsonModel.Value -> Typed.TypedTerm (Either String Model.Term)+decodeInteger arg0 arg1 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.json.decode.decodeInteger")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)}))++-- | DSL reference to hydra.core.json.decode.decodeLiteral+decodeLiteral :: Typed.TypedTerm Model.LiteralType -> Typed.TypedTerm JsonModel.Value -> Typed.TypedTerm (Either String Model.Term)+decodeLiteral arg0 arg1 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.json.decode.decodeLiteral")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)}))++-- | DSL reference to hydra.core.json.decode.expectArray+expectArray :: Typed.TypedTerm JsonModel.Value -> Typed.TypedTerm (Either String [JsonModel.Value])+expectArray arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.json.decode.expectArray")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.json.decode.expectNumber+expectNumber :: Typed.TypedTerm JsonModel.Value -> Typed.TypedTerm (Either String Sci.Scientific)+expectNumber arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.json.decode.expectNumber")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.json.decode.expectObject+expectObject :: Typed.TypedTerm JsonModel.Value -> Typed.TypedTerm (Either String (M.Map String JsonModel.Value))+expectObject arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.json.decode.expectObject")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.json.decode.expectString+expectString :: Typed.TypedTerm JsonModel.Value -> Typed.TypedTerm (Either String String)+expectString arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.json.decode.expectString")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.json.decode.fromJson+fromJson :: Typed.TypedTerm (M.Map Model.Name Model.Type) -> Typed.TypedTerm Bool -> Typed.TypedTerm Model.Name -> Typed.TypedTerm Model.Type -> Typed.TypedTerm JsonModel.Value -> Typed.TypedTerm (Either String Model.Term)+fromJson arg0 arg1 arg2 arg3 arg4 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.json.decode.fromJson")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)})),+ Model.applicationArgument = (Typed.unTypedTerm arg2)})),+ Model.applicationArgument = (Typed.unTypedTerm arg3)})),+ Model.applicationArgument = (Typed.unTypedTerm arg4)}))++-- | DSL reference to hydra.core.json.decode.parseSpecialFloat+parseSpecialFloat :: Typed.TypedTerm String -> Typed.TypedTerm (Maybe Double)+parseSpecialFloat arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.json.decode.parseSpecialFloat")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.json.decode.parseSpecialFloat32+parseSpecialFloat32 :: Typed.TypedTerm String -> Typed.TypedTerm (Maybe Float)+parseSpecialFloat32 arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.json.decode.parseSpecialFloat32")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))
@@ -0,0 +1,124 @@+-- Note: this is an automatically generated file. Do not edit.++-- | DSL functions for hydra.core.json.decoding++module Hydra.Core.Dsl.Json.Decoding where++import qualified Hydra.Core.Ast as Ast+import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Diff as Diff+import qualified Hydra.Core.Docs as Docs+import qualified Hydra.Core.Dsl.Ast as DslAst+import qualified Hydra.Core.Dsl.Coders as DslCoders+import qualified Hydra.Core.Dsl.Diff as DslDiff+import qualified Hydra.Core.Dsl.Docs as DslDocs+import qualified Hydra.Core.Dsl.Error.Checking as ErrorChecking+import qualified Hydra.Core.Dsl.Error.File as DslErrorFile+import qualified Hydra.Core.Dsl.Error.Model as DslErrorModel+import qualified Hydra.Core.Dsl.Error.Packaging as DslErrorPackaging+import qualified Hydra.Core.Dsl.Error.System as DslErrorSystem+import qualified Hydra.Core.Dsl.Errors as DslErrors+import qualified Hydra.Core.Dsl.File as DslFile+import qualified Hydra.Core.Dsl.Graph as DslGraph+import qualified Hydra.Core.Dsl.Json.Model as DslJsonModel+import qualified Hydra.Core.Dsl.Markdown as DslMarkdown+import qualified Hydra.Core.Dsl.Model as DslModel+import qualified Hydra.Core.Dsl.Packaging as DslPackaging+import qualified Hydra.Core.Dsl.Parsing as DslParsing+import qualified Hydra.Core.Dsl.Paths as DslPaths+import qualified Hydra.Core.Dsl.Query as DslQuery+import qualified Hydra.Core.Dsl.Regex as DslRegex+import qualified Hydra.Core.Dsl.Relational as DslRelational+import qualified Hydra.Core.Dsl.System as DslSystem+import qualified Hydra.Core.Dsl.Tabular as DslTabular+import qualified Hydra.Core.Dsl.Testing as DslTesting+import qualified Hydra.Core.Dsl.Time as DslTime+import qualified Hydra.Core.Dsl.Topology as DslTopology+import qualified Hydra.Core.Dsl.Typing as DslTyping+import qualified Hydra.Core.Dsl.Util as DslUtil+import qualified Hydra.Core.Dsl.Validation as DslValidation+import qualified Hydra.Core.Dsl.Variants as DslVariants+import qualified Hydra.Core.Error.Checking as Checking+import qualified Hydra.Core.Error.File as ErrorFile+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Error.Packaging as ErrorPackaging+import qualified Hydra.Core.Error.System as ErrorSystem+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Json.Decoding as Decoding+import qualified Hydra.Core.Json.Model as JsonModel+import qualified Hydra.Core.Markdown as Markdown+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Parsing as Parsing+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Query as Query+import qualified Hydra.Core.Regex as Regex+import qualified Hydra.Core.Relational as Relational+import qualified Hydra.Core.System as System+import qualified Hydra.Core.Tabular as Tabular+import qualified Hydra.Core.Testing as Testing+import qualified Hydra.Core.Time as Time+import qualified Hydra.Core.Topology as Topology+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Validation as Validation+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void+import qualified Data.Map as M++-- | DSL reference to hydra.core.json.decoding.decodeArray+decodeArray :: Typed.TypedTerm (JsonModel.Value -> Either String t0) -> Typed.TypedTerm JsonModel.Value -> Typed.TypedTerm (Either String [t0])+decodeArray arg0 arg1 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.json.decoding.decodeArray")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)}))++-- | DSL reference to hydra.core.json.decoding.decodeBoolean+decodeBoolean :: Typed.TypedTerm JsonModel.Value -> Typed.TypedTerm (Either String Bool)+decodeBoolean arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.json.decoding.decodeBoolean")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.json.decoding.decodeField+decodeField :: Typed.TypedTerm (t0 -> Either String t1) -> Typed.TypedTerm String -> Typed.TypedTerm (M.Map String t0) -> Typed.TypedTerm (Either String t1)+decodeField arg0 arg1 arg2 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.json.decoding.decodeField")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)})),+ Model.applicationArgument = (Typed.unTypedTerm arg2)}))++-- | DSL reference to hydra.core.json.decoding.decodeObject+decodeObject :: Typed.TypedTerm JsonModel.Value -> Typed.TypedTerm (Either String (M.Map String JsonModel.Value))+decodeObject arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.json.decoding.decodeObject")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.json.decoding.decodeOptionalField+decodeOptionalField :: Typed.TypedTerm (t0 -> Either t1 t2) -> Typed.TypedTerm t3 -> Typed.TypedTerm (M.Map t3 t0) -> Typed.TypedTerm (Either t1 (Maybe t2))+decodeOptionalField arg0 arg1 arg2 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.json.decoding.decodeOptionalField")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)})),+ Model.applicationArgument = (Typed.unTypedTerm arg2)}))++-- | DSL reference to hydra.core.json.decoding.decodeString+decodeString :: Typed.TypedTerm JsonModel.Value -> Typed.TypedTerm (Either String String)+decodeString arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.json.decoding.decodeString")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))
@@ -0,0 +1,130 @@+-- Note: this is an automatically generated file. Do not edit.++-- | DSL functions for hydra.core.json.encode++module Hydra.Core.Dsl.Json.Encode where++import qualified Hydra.Core.Ast as Ast+import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Diff as Diff+import qualified Hydra.Core.Docs as Docs+import qualified Hydra.Core.Dsl.Ast as DslAst+import qualified Hydra.Core.Dsl.Coders as DslCoders+import qualified Hydra.Core.Dsl.Diff as DslDiff+import qualified Hydra.Core.Dsl.Docs as DslDocs+import qualified Hydra.Core.Dsl.Error.Checking as ErrorChecking+import qualified Hydra.Core.Dsl.Error.File as DslErrorFile+import qualified Hydra.Core.Dsl.Error.Model as DslErrorModel+import qualified Hydra.Core.Dsl.Error.Packaging as DslErrorPackaging+import qualified Hydra.Core.Dsl.Error.System as DslErrorSystem+import qualified Hydra.Core.Dsl.Errors as DslErrors+import qualified Hydra.Core.Dsl.File as DslFile+import qualified Hydra.Core.Dsl.Graph as DslGraph+import qualified Hydra.Core.Dsl.Json.Model as DslJsonModel+import qualified Hydra.Core.Dsl.Markdown as DslMarkdown+import qualified Hydra.Core.Dsl.Model as DslModel+import qualified Hydra.Core.Dsl.Packaging as DslPackaging+import qualified Hydra.Core.Dsl.Parsing as DslParsing+import qualified Hydra.Core.Dsl.Paths as DslPaths+import qualified Hydra.Core.Dsl.Query as DslQuery+import qualified Hydra.Core.Dsl.Regex as DslRegex+import qualified Hydra.Core.Dsl.Relational as DslRelational+import qualified Hydra.Core.Dsl.Resolution as DslResolution+import qualified Hydra.Core.Dsl.Strip as DslStrip+import qualified Hydra.Core.Dsl.System as DslSystem+import qualified Hydra.Core.Dsl.Tabular as DslTabular+import qualified Hydra.Core.Dsl.Testing as DslTesting+import qualified Hydra.Core.Dsl.Time as DslTime+import qualified Hydra.Core.Dsl.Topology as DslTopology+import qualified Hydra.Core.Dsl.Typing as DslTyping+import qualified Hydra.Core.Dsl.Util as DslUtil+import qualified Hydra.Core.Dsl.Validation as DslValidation+import qualified Hydra.Core.Dsl.Variants as DslVariants+import qualified Hydra.Core.Error.Checking as Checking+import qualified Hydra.Core.Error.File as ErrorFile+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Error.Packaging as ErrorPackaging+import qualified Hydra.Core.Error.System as ErrorSystem+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.Extract.Model as ExtractModel+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Json.Encode as Encode+import qualified Hydra.Core.Json.Model as JsonModel+import qualified Hydra.Core.Literals as Literals+import qualified Hydra.Core.Markdown as Markdown+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Parsing as Parsing+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Print.Model as PrintModel+import qualified Hydra.Core.Query as Query+import qualified Hydra.Core.Regex as Regex+import qualified Hydra.Core.Relational as Relational+import qualified Hydra.Core.Resolution as Resolution+import qualified Hydra.Core.Strip as Strip+import qualified Hydra.Core.Substitution as Substitution+import qualified Hydra.Core.System as System+import qualified Hydra.Core.Tabular as Tabular+import qualified Hydra.Core.Testing as Testing+import qualified Hydra.Core.Time as Time+import qualified Hydra.Core.Topology as Topology+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Validation as Validation+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void+import qualified Data.Map as M++-- | DSL reference to hydra.core.json.encode.encodeFloat+encodeFloat :: Typed.TypedTerm Model.FloatValue -> Typed.TypedTerm (Either t0 JsonModel.Value)+encodeFloat arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.json.encode.encodeFloat")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.json.encode.encodeInteger+encodeInteger :: Typed.TypedTerm Model.IntegerValue -> Typed.TypedTerm (Either t0 JsonModel.Value)+encodeInteger arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.json.encode.encodeInteger")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.json.encode.encodeLiteral+encodeLiteral :: Typed.TypedTerm Model.Literal -> Typed.TypedTerm (Either t0 JsonModel.Value)+encodeLiteral arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.json.encode.encodeLiteral")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.json.encode.requiresJsonStringSentinel+requiresJsonStringSentinel :: Typed.TypedTerm String -> Typed.TypedTerm Bool+requiresJsonStringSentinel arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.json.encode.requiresJsonStringSentinel")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.json.encode.toJson+toJson :: Typed.TypedTerm (M.Map Model.Name Model.Type) -> Typed.TypedTerm Bool -> Typed.TypedTerm Model.Name -> Typed.TypedTerm Model.Type -> Typed.TypedTerm Model.Term -> Typed.TypedTerm (Either String JsonModel.Value)+toJson arg0 arg1 arg2 arg3 arg4 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.json.encode.toJson")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)})),+ Model.applicationArgument = (Typed.unTypedTerm arg2)})),+ Model.applicationArgument = (Typed.unTypedTerm arg3)})),+ Model.applicationArgument = (Typed.unTypedTerm arg4)}))++-- | DSL reference to hydra.core.json.encode.toJsonUntyped+toJsonUntyped :: Typed.TypedTerm Model.Term -> Typed.TypedTerm (Either String JsonModel.Value)+toJsonUntyped arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.json.encode.toJsonUntyped")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))
@@ -0,0 +1,73 @@+-- Note: this is an automatically generated file. Do not edit.++-- | DSL functions for hydra.core.json.model++module Hydra.Core.Dsl.Json.Model where++import qualified Hydra.Core.Decode.Json.Model as DecodeJsonModel+import qualified Hydra.Core.Dsl.Model as DslModel+import qualified Hydra.Core.Encode.Json.Model as EncodeJsonModel+import qualified Hydra.Core.Json.Model as JsonModel+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Typed as Typed+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | DSL injection for the array variant of hydra.core.json.model.Value+valueArray :: Typed.TypedTerm [JsonModel.Value] -> Typed.TypedTerm JsonModel.Value+valueArray x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.json.model.Value"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "array"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the boolean variant of hydra.core.json.model.Value+valueBoolean :: Typed.TypedTerm Bool -> Typed.TypedTerm JsonModel.Value+valueBoolean x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.json.model.Value"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "boolean"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the null variant of hydra.core.json.model.Value+valueNull :: Typed.TypedTerm JsonModel.Value+valueNull =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.json.model.Value"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "null"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL injection for the number variant of hydra.core.json.model.Value+valueNumber :: Typed.TypedTerm Sci.Scientific -> Typed.TypedTerm JsonModel.Value+valueNumber x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.json.model.Value"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "number"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the object variant of hydra.core.json.model.Value+valueObject :: Typed.TypedTerm [(String, JsonModel.Value)] -> Typed.TypedTerm JsonModel.Value+valueObject x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.json.model.Value"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "object"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the string variant of hydra.core.json.model.Value+valueString :: Typed.TypedTerm String -> Typed.TypedTerm JsonModel.Value+valueString x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.json.model.Value"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "string"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL name token for hydra.core.json.model.Value+valueValue :: Typed.TypedName JsonModel.Value+valueValue = Typed.TypedName (Model.Name "hydra.core.json.model.Value")
@@ -0,0 +1,150 @@+-- Note: this is an automatically generated file. Do not edit.++-- | DSL functions for hydra.core.json.parser++module Hydra.Core.Dsl.Json.Parser where++import qualified Hydra.Core.Ast as Ast+import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Diff as Diff+import qualified Hydra.Core.Docs as Docs+import qualified Hydra.Core.Dsl.Ast as DslAst+import qualified Hydra.Core.Dsl.Coders as DslCoders+import qualified Hydra.Core.Dsl.Diff as DslDiff+import qualified Hydra.Core.Dsl.Docs as DslDocs+import qualified Hydra.Core.Dsl.Error.Checking as ErrorChecking+import qualified Hydra.Core.Dsl.Error.File as DslErrorFile+import qualified Hydra.Core.Dsl.Error.Model as DslErrorModel+import qualified Hydra.Core.Dsl.Error.Packaging as DslErrorPackaging+import qualified Hydra.Core.Dsl.Error.System as DslErrorSystem+import qualified Hydra.Core.Dsl.Errors as DslErrors+import qualified Hydra.Core.Dsl.File as DslFile+import qualified Hydra.Core.Dsl.Graph as DslGraph+import qualified Hydra.Core.Dsl.Json.Model as DslJsonModel+import qualified Hydra.Core.Dsl.Markdown as DslMarkdown+import qualified Hydra.Core.Dsl.Model as DslModel+import qualified Hydra.Core.Dsl.Packaging as DslPackaging+import qualified Hydra.Core.Dsl.Parsing as DslParsing+import qualified Hydra.Core.Dsl.Paths as DslPaths+import qualified Hydra.Core.Dsl.Query as DslQuery+import qualified Hydra.Core.Dsl.Regex as DslRegex+import qualified Hydra.Core.Dsl.Relational as DslRelational+import qualified Hydra.Core.Dsl.System as DslSystem+import qualified Hydra.Core.Dsl.Tabular as DslTabular+import qualified Hydra.Core.Dsl.Testing as DslTesting+import qualified Hydra.Core.Dsl.Time as DslTime+import qualified Hydra.Core.Dsl.Topology as DslTopology+import qualified Hydra.Core.Dsl.Typing as DslTyping+import qualified Hydra.Core.Dsl.Util as DslUtil+import qualified Hydra.Core.Dsl.Validation as DslValidation+import qualified Hydra.Core.Dsl.Variants as DslVariants+import qualified Hydra.Core.Error.Checking as Checking+import qualified Hydra.Core.Error.File as ErrorFile+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Error.Packaging as ErrorPackaging+import qualified Hydra.Core.Error.System as ErrorSystem+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Json.Model as JsonModel+import qualified Hydra.Core.Json.Parser as Parser+import qualified Hydra.Core.Markdown as Markdown+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Parsers as Parsers+import qualified Hydra.Core.Parsing as Parsing+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Query as Query+import qualified Hydra.Core.Regex as Regex+import qualified Hydra.Core.Relational as Relational+import qualified Hydra.Core.System as System+import qualified Hydra.Core.Tabular as Tabular+import qualified Hydra.Core.Testing as Testing+import qualified Hydra.Core.Time as Time+import qualified Hydra.Core.Topology as Topology+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Validation as Validation+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | DSL reference to hydra.core.json.parser.digit+digit :: Typed.TypedTerm (Parsing.Parser Int)+digit = Typed.TypedTerm (Model.TermVariable (Model.Name "hydra.core.json.parser.digit"))++-- | DSL reference to hydra.core.json.parser.digits+digits :: Typed.TypedTerm (Parsing.Parser String)+digits = Typed.TypedTerm (Model.TermVariable (Model.Name "hydra.core.json.parser.digits"))++-- | DSL reference to hydra.core.json.parser.jsonArray+jsonArray :: Typed.TypedTerm (Parsing.Parser JsonModel.Value)+jsonArray = Typed.TypedTerm (Model.TermVariable (Model.Name "hydra.core.json.parser.jsonArray"))++-- | DSL reference to hydra.core.json.parser.jsonBool+jsonBool :: Typed.TypedTerm (Parsing.Parser JsonModel.Value)+jsonBool = Typed.TypedTerm (Model.TermVariable (Model.Name "hydra.core.json.parser.jsonBool"))++-- | DSL reference to hydra.core.json.parser.jsonEscapeChar+jsonEscapeChar :: Typed.TypedTerm (Parsing.Parser Int)+jsonEscapeChar = Typed.TypedTerm (Model.TermVariable (Model.Name "hydra.core.json.parser.jsonEscapeChar"))++-- | DSL reference to hydra.core.json.parser.jsonExponentPart+jsonExponentPart :: Typed.TypedTerm (Parsing.Parser (Maybe String))+jsonExponentPart = Typed.TypedTerm (Model.TermVariable (Model.Name "hydra.core.json.parser.jsonExponentPart"))++-- | DSL reference to hydra.core.json.parser.jsonFractionPart+jsonFractionPart :: Typed.TypedTerm (Parsing.Parser (Maybe String))+jsonFractionPart = Typed.TypedTerm (Model.TermVariable (Model.Name "hydra.core.json.parser.jsonFractionPart"))++-- | DSL reference to hydra.core.json.parser.jsonIntegerPart+jsonIntegerPart :: Typed.TypedTerm (Parsing.Parser String)+jsonIntegerPart = Typed.TypedTerm (Model.TermVariable (Model.Name "hydra.core.json.parser.jsonIntegerPart"))++-- | DSL reference to hydra.core.json.parser.jsonKeyValue+jsonKeyValue :: Typed.TypedTerm (Parsing.Parser (String, JsonModel.Value))+jsonKeyValue = Typed.TypedTerm (Model.TermVariable (Model.Name "hydra.core.json.parser.jsonKeyValue"))++-- | DSL reference to hydra.core.json.parser.jsonNull+jsonNull :: Typed.TypedTerm (Parsing.Parser JsonModel.Value)+jsonNull = Typed.TypedTerm (Model.TermVariable (Model.Name "hydra.core.json.parser.jsonNull"))++-- | DSL reference to hydra.core.json.parser.jsonNumber+jsonNumber :: Typed.TypedTerm (Parsing.Parser JsonModel.Value)+jsonNumber = Typed.TypedTerm (Model.TermVariable (Model.Name "hydra.core.json.parser.jsonNumber"))++-- | DSL reference to hydra.core.json.parser.jsonObject+jsonObject :: Typed.TypedTerm (Parsing.Parser JsonModel.Value)+jsonObject = Typed.TypedTerm (Model.TermVariable (Model.Name "hydra.core.json.parser.jsonObject"))++-- | DSL reference to hydra.core.json.parser.jsonString+jsonString :: Typed.TypedTerm (Parsing.Parser JsonModel.Value)+jsonString = Typed.TypedTerm (Model.TermVariable (Model.Name "hydra.core.json.parser.jsonString"))++-- | DSL reference to hydra.core.json.parser.jsonStringChar+jsonStringChar :: Typed.TypedTerm (Parsing.Parser Int)+jsonStringChar = Typed.TypedTerm (Model.TermVariable (Model.Name "hydra.core.json.parser.jsonStringChar"))++-- | DSL reference to hydra.core.json.parser.jsonValue+jsonValue :: Typed.TypedTerm (Parsing.Parser JsonModel.Value)+jsonValue = Typed.TypedTerm (Model.TermVariable (Model.Name "hydra.core.json.parser.jsonValue"))++-- | DSL reference to hydra.core.json.parser.parseJson+parseJson :: Typed.TypedTerm String -> Typed.TypedTerm (Parsing.ParseResult JsonModel.Value)+parseJson arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.json.parser.parseJson")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.json.parser.token+token :: Typed.TypedTerm (Parsing.Parser t0) -> Typed.TypedTerm (Parsing.Parser t0)+token arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.json.parser.token")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.json.parser.whitespace+whitespace :: Typed.TypedTerm (Parsing.Parser ())+whitespace = Typed.TypedTerm (Model.TermVariable (Model.Name "hydra.core.json.parser.whitespace"))
@@ -0,0 +1,112 @@+-- Note: this is an automatically generated file. Do not edit.++-- | DSL functions for hydra.core.json.writer++module Hydra.Core.Dsl.Json.Writer where++import qualified Hydra.Core.Ast as Ast+import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Diff as Diff+import qualified Hydra.Core.Docs as Docs+import qualified Hydra.Core.Dsl.Ast as DslAst+import qualified Hydra.Core.Dsl.Coders as DslCoders+import qualified Hydra.Core.Dsl.Diff as DslDiff+import qualified Hydra.Core.Dsl.Docs as DslDocs+import qualified Hydra.Core.Dsl.Error.Checking as ErrorChecking+import qualified Hydra.Core.Dsl.Error.File as DslErrorFile+import qualified Hydra.Core.Dsl.Error.Model as DslErrorModel+import qualified Hydra.Core.Dsl.Error.Packaging as DslErrorPackaging+import qualified Hydra.Core.Dsl.Error.System as DslErrorSystem+import qualified Hydra.Core.Dsl.Errors as DslErrors+import qualified Hydra.Core.Dsl.File as DslFile+import qualified Hydra.Core.Dsl.Graph as DslGraph+import qualified Hydra.Core.Dsl.Json.Model as DslJsonModel+import qualified Hydra.Core.Dsl.Markdown as DslMarkdown+import qualified Hydra.Core.Dsl.Model as DslModel+import qualified Hydra.Core.Dsl.Packaging as DslPackaging+import qualified Hydra.Core.Dsl.Parsing as DslParsing+import qualified Hydra.Core.Dsl.Paths as DslPaths+import qualified Hydra.Core.Dsl.Query as DslQuery+import qualified Hydra.Core.Dsl.Regex as DslRegex+import qualified Hydra.Core.Dsl.Relational as DslRelational+import qualified Hydra.Core.Dsl.Serialization as DslSerialization+import qualified Hydra.Core.Dsl.System as DslSystem+import qualified Hydra.Core.Dsl.Tabular as DslTabular+import qualified Hydra.Core.Dsl.Testing as DslTesting+import qualified Hydra.Core.Dsl.Time as DslTime+import qualified Hydra.Core.Dsl.Topology as DslTopology+import qualified Hydra.Core.Dsl.Typing as DslTyping+import qualified Hydra.Core.Dsl.Util as DslUtil+import qualified Hydra.Core.Dsl.Validation as DslValidation+import qualified Hydra.Core.Dsl.Variants as DslVariants+import qualified Hydra.Core.Error.Checking as Checking+import qualified Hydra.Core.Error.File as ErrorFile+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Error.Packaging as ErrorPackaging+import qualified Hydra.Core.Error.System as ErrorSystem+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Json.Model as JsonModel+import qualified Hydra.Core.Json.Writer as Writer+import qualified Hydra.Core.Markdown as Markdown+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Parsing as Parsing+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Query as Query+import qualified Hydra.Core.Regex as Regex+import qualified Hydra.Core.Relational as Relational+import qualified Hydra.Core.Serialization as Serialization+import qualified Hydra.Core.System as System+import qualified Hydra.Core.Tabular as Tabular+import qualified Hydra.Core.Testing as Testing+import qualified Hydra.Core.Time as Time+import qualified Hydra.Core.Topology as Topology+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Validation as Validation+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | DSL reference to hydra.core.json.writer.colonOp+colonOp :: Typed.TypedTerm Ast.Op+colonOp = Typed.TypedTerm (Model.TermVariable (Model.Name "hydra.core.json.writer.colonOp"))++-- | DSL reference to hydra.core.json.writer.hexByte+hexByte :: Typed.TypedTerm Int -> Typed.TypedTerm String+hexByte arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.json.writer.hexByte")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.json.writer.jsonString+jsonString :: Typed.TypedTerm String -> Typed.TypedTerm String+jsonString arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.json.writer.jsonString")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.json.writer.keyValueToExpr+keyValueToExpr :: Typed.TypedTerm (String, JsonModel.Value) -> Typed.TypedTerm Ast.Expr+keyValueToExpr arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.json.writer.keyValueToExpr")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.json.writer.printJson+printJson :: Typed.TypedTerm JsonModel.Value -> Typed.TypedTerm String+printJson arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.json.writer.printJson")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.json.writer.valueToExpr+valueToExpr :: Typed.TypedTerm JsonModel.Value -> Typed.TypedTerm Ast.Expr+valueToExpr arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.json.writer.valueToExpr")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))
@@ -0,0 +1,96 @@+-- Note: this is an automatically generated file. Do not edit.++-- | DSL functions for hydra.core.json.yaml.decode++module Hydra.Core.Dsl.Json.Yaml.Decode where++import qualified Hydra.Core.Ast as Ast+import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Diff as Diff+import qualified Hydra.Core.Docs as Docs+import qualified Hydra.Core.Dsl.Ast as DslAst+import qualified Hydra.Core.Dsl.Coders as DslCoders+import qualified Hydra.Core.Dsl.Diff as DslDiff+import qualified Hydra.Core.Dsl.Docs as DslDocs+import qualified Hydra.Core.Dsl.Error.Checking as ErrorChecking+import qualified Hydra.Core.Dsl.Error.File as DslErrorFile+import qualified Hydra.Core.Dsl.Error.Model as DslErrorModel+import qualified Hydra.Core.Dsl.Error.Packaging as DslErrorPackaging+import qualified Hydra.Core.Dsl.Error.System as DslErrorSystem+import qualified Hydra.Core.Dsl.Errors as DslErrors+import qualified Hydra.Core.Dsl.File as DslFile+import qualified Hydra.Core.Dsl.Graph as DslGraph+import qualified Hydra.Core.Dsl.Json.Decode as JsonDecode+import qualified Hydra.Core.Dsl.Json.Model as DslJsonModel+import qualified Hydra.Core.Dsl.Markdown as DslMarkdown+import qualified Hydra.Core.Dsl.Model as DslModel+import qualified Hydra.Core.Dsl.Packaging as DslPackaging+import qualified Hydra.Core.Dsl.Parsing as DslParsing+import qualified Hydra.Core.Dsl.Paths as DslPaths+import qualified Hydra.Core.Dsl.Query as DslQuery+import qualified Hydra.Core.Dsl.Regex as DslRegex+import qualified Hydra.Core.Dsl.Relational as DslRelational+import qualified Hydra.Core.Dsl.System as DslSystem+import qualified Hydra.Core.Dsl.Tabular as DslTabular+import qualified Hydra.Core.Dsl.Testing as DslTesting+import qualified Hydra.Core.Dsl.Time as DslTime+import qualified Hydra.Core.Dsl.Topology as DslTopology+import qualified Hydra.Core.Dsl.Typing as DslTyping+import qualified Hydra.Core.Dsl.Util as DslUtil+import qualified Hydra.Core.Dsl.Validation as DslValidation+import qualified Hydra.Core.Dsl.Variants as DslVariants+import qualified Hydra.Core.Dsl.Yaml.Model as DslYamlModel+import qualified Hydra.Core.Error.Checking as Checking+import qualified Hydra.Core.Error.File as ErrorFile+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Error.Packaging as ErrorPackaging+import qualified Hydra.Core.Error.System as ErrorSystem+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Json.Decode as Decode+import qualified Hydra.Core.Json.Model as JsonModel+import qualified Hydra.Core.Json.Yaml.Decode as YamlDecode+import qualified Hydra.Core.Markdown as Markdown+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Parsing as Parsing+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Query as Query+import qualified Hydra.Core.Regex as Regex+import qualified Hydra.Core.Relational as Relational+import qualified Hydra.Core.System as System+import qualified Hydra.Core.Tabular as Tabular+import qualified Hydra.Core.Testing as Testing+import qualified Hydra.Core.Time as Time+import qualified Hydra.Core.Topology as Topology+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Validation as Validation+import qualified Hydra.Core.Variants as Variants+import qualified Hydra.Core.Yaml.Model as YamlModel+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void+import qualified Data.Map as M++-- | DSL reference to hydra.core.json.yaml.decode.fromYaml+fromYaml :: Typed.TypedTerm (M.Map Model.Name Model.Type) -> Typed.TypedTerm Model.Name -> Typed.TypedTerm Model.Type -> Typed.TypedTerm YamlModel.Node -> Typed.TypedTerm (Either String Model.Term)+fromYaml arg0 arg1 arg2 arg3 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.json.yaml.decode.fromYaml")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)})),+ Model.applicationArgument = (Typed.unTypedTerm arg2)})),+ Model.applicationArgument = (Typed.unTypedTerm arg3)}))++-- | DSL reference to hydra.core.json.yaml.decode.yamlToJson+yamlToJson :: Typed.TypedTerm YamlModel.Node -> Typed.TypedTerm (Either String JsonModel.Value)+yamlToJson arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.json.yaml.decode.yamlToJson")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))
@@ -0,0 +1,96 @@+-- Note: this is an automatically generated file. Do not edit.++-- | DSL functions for hydra.core.json.yaml.encode++module Hydra.Core.Dsl.Json.Yaml.Encode where++import qualified Hydra.Core.Ast as Ast+import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Diff as Diff+import qualified Hydra.Core.Docs as Docs+import qualified Hydra.Core.Dsl.Ast as DslAst+import qualified Hydra.Core.Dsl.Coders as DslCoders+import qualified Hydra.Core.Dsl.Diff as DslDiff+import qualified Hydra.Core.Dsl.Docs as DslDocs+import qualified Hydra.Core.Dsl.Error.Checking as ErrorChecking+import qualified Hydra.Core.Dsl.Error.File as DslErrorFile+import qualified Hydra.Core.Dsl.Error.Model as DslErrorModel+import qualified Hydra.Core.Dsl.Error.Packaging as DslErrorPackaging+import qualified Hydra.Core.Dsl.Error.System as DslErrorSystem+import qualified Hydra.Core.Dsl.Errors as DslErrors+import qualified Hydra.Core.Dsl.File as DslFile+import qualified Hydra.Core.Dsl.Graph as DslGraph+import qualified Hydra.Core.Dsl.Json.Encode as JsonEncode+import qualified Hydra.Core.Dsl.Json.Model as DslJsonModel+import qualified Hydra.Core.Dsl.Markdown as DslMarkdown+import qualified Hydra.Core.Dsl.Model as DslModel+import qualified Hydra.Core.Dsl.Packaging as DslPackaging+import qualified Hydra.Core.Dsl.Parsing as DslParsing+import qualified Hydra.Core.Dsl.Paths as DslPaths+import qualified Hydra.Core.Dsl.Query as DslQuery+import qualified Hydra.Core.Dsl.Regex as DslRegex+import qualified Hydra.Core.Dsl.Relational as DslRelational+import qualified Hydra.Core.Dsl.System as DslSystem+import qualified Hydra.Core.Dsl.Tabular as DslTabular+import qualified Hydra.Core.Dsl.Testing as DslTesting+import qualified Hydra.Core.Dsl.Time as DslTime+import qualified Hydra.Core.Dsl.Topology as DslTopology+import qualified Hydra.Core.Dsl.Typing as DslTyping+import qualified Hydra.Core.Dsl.Util as DslUtil+import qualified Hydra.Core.Dsl.Validation as DslValidation+import qualified Hydra.Core.Dsl.Variants as DslVariants+import qualified Hydra.Core.Dsl.Yaml.Model as DslYamlModel+import qualified Hydra.Core.Error.Checking as Checking+import qualified Hydra.Core.Error.File as ErrorFile+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Error.Packaging as ErrorPackaging+import qualified Hydra.Core.Error.System as ErrorSystem+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Json.Encode as Encode+import qualified Hydra.Core.Json.Model as JsonModel+import qualified Hydra.Core.Json.Yaml.Encode as YamlEncode+import qualified Hydra.Core.Markdown as Markdown+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Parsing as Parsing+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Query as Query+import qualified Hydra.Core.Regex as Regex+import qualified Hydra.Core.Relational as Relational+import qualified Hydra.Core.System as System+import qualified Hydra.Core.Tabular as Tabular+import qualified Hydra.Core.Testing as Testing+import qualified Hydra.Core.Time as Time+import qualified Hydra.Core.Topology as Topology+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Validation as Validation+import qualified Hydra.Core.Variants as Variants+import qualified Hydra.Core.Yaml.Model as YamlModel+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void+import qualified Data.Map as M++-- | DSL reference to hydra.core.json.yaml.encode.jsonToYaml+jsonToYaml :: Typed.TypedTerm JsonModel.Value -> Typed.TypedTerm YamlModel.Node+jsonToYaml arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.json.yaml.encode.jsonToYaml")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.json.yaml.encode.toYaml+toYaml :: Typed.TypedTerm (M.Map Model.Name Model.Type) -> Typed.TypedTerm Model.Name -> Typed.TypedTerm Model.Type -> Typed.TypedTerm Model.Term -> Typed.TypedTerm (Either String YamlModel.Node)+toYaml arg0 arg1 arg2 arg3 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.json.yaml.encode.toYaml")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)})),+ Model.applicationArgument = (Typed.unTypedTerm arg2)})),+ Model.applicationArgument = (Typed.unTypedTerm arg3)}))
@@ -0,0 +1,306 @@+-- Note: this is an automatically generated file. Do not edit.++-- | DSL functions for hydra.core.lexical++module Hydra.Core.Dsl.Lexical where++import qualified Hydra.Core.Ast as Ast+import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Diff as Diff+import qualified Hydra.Core.Docs as Docs+import qualified Hydra.Core.Dsl.Ast as DslAst+import qualified Hydra.Core.Dsl.Coders as DslCoders+import qualified Hydra.Core.Dsl.Diff as DslDiff+import qualified Hydra.Core.Dsl.Docs as DslDocs+import qualified Hydra.Core.Dsl.Error.Checking as ErrorChecking+import qualified Hydra.Core.Dsl.Error.File as DslErrorFile+import qualified Hydra.Core.Dsl.Error.Model as DslErrorModel+import qualified Hydra.Core.Dsl.Error.Packaging as DslErrorPackaging+import qualified Hydra.Core.Dsl.Error.System as DslErrorSystem+import qualified Hydra.Core.Dsl.Errors as DslErrors+import qualified Hydra.Core.Dsl.File as DslFile+import qualified Hydra.Core.Dsl.Graph as DslGraph+import qualified Hydra.Core.Dsl.Json.Model as DslJsonModel+import qualified Hydra.Core.Dsl.Markdown as DslMarkdown+import qualified Hydra.Core.Dsl.Model as DslModel+import qualified Hydra.Core.Dsl.Packaging as DslPackaging+import qualified Hydra.Core.Dsl.Parsing as DslParsing+import qualified Hydra.Core.Dsl.Paths as DslPaths+import qualified Hydra.Core.Dsl.Query as DslQuery+import qualified Hydra.Core.Dsl.Regex as DslRegex+import qualified Hydra.Core.Dsl.Relational as DslRelational+import qualified Hydra.Core.Dsl.Scoping as DslScoping+import qualified Hydra.Core.Dsl.Strip as DslStrip+import qualified Hydra.Core.Dsl.System as DslSystem+import qualified Hydra.Core.Dsl.Tabular as DslTabular+import qualified Hydra.Core.Dsl.Testing as DslTesting+import qualified Hydra.Core.Dsl.Time as DslTime+import qualified Hydra.Core.Dsl.Topology as DslTopology+import qualified Hydra.Core.Dsl.Typing as DslTyping+import qualified Hydra.Core.Dsl.Util as DslUtil+import qualified Hydra.Core.Dsl.Validation as DslValidation+import qualified Hydra.Core.Dsl.Variants as DslVariants+import qualified Hydra.Core.Error.Checking as Checking+import qualified Hydra.Core.Error.File as ErrorFile+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Error.Packaging as ErrorPackaging+import qualified Hydra.Core.Error.System as ErrorSystem+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Json.Model as JsonModel+import qualified Hydra.Core.Lexical as Lexical+import qualified Hydra.Core.Markdown as Markdown+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Parsing as Parsing+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Print.Errors as PrintErrors+import qualified Hydra.Core.Print.Model as PrintModel+import qualified Hydra.Core.Query as Query+import qualified Hydra.Core.Regex as Regex+import qualified Hydra.Core.Relational as Relational+import qualified Hydra.Core.Scoping as Scoping+import qualified Hydra.Core.Strip as Strip+import qualified Hydra.Core.System as System+import qualified Hydra.Core.Tabular as Tabular+import qualified Hydra.Core.Testing as Testing+import qualified Hydra.Core.Time as Time+import qualified Hydra.Core.Topology as Topology+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Validation as Validation+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void+import qualified Data.Map as M+import qualified Data.Set as S++-- | DSL reference to hydra.core.lexical.buildGraph+buildGraph :: Typed.TypedTerm [Model.Binding] -> Typed.TypedTerm (M.Map Model.Name (Maybe Model.Term)) -> Typed.TypedTerm (M.Map Model.Name Graph.Primitive) -> Typed.TypedTerm Graph.Graph+buildGraph arg0 arg1 arg2 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lexical.buildGraph")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)})),+ Model.applicationArgument = (Typed.unTypedTerm arg2)}))++-- | DSL reference to hydra.core.lexical.chooseUniqueName+chooseUniqueName :: Typed.TypedTerm (S.Set Model.Name) -> Typed.TypedTerm Model.Name -> Typed.TypedTerm Model.Name+chooseUniqueName arg0 arg1 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lexical.chooseUniqueName")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)}))++-- | DSL reference to hydra.core.lexical.dereferenceSchemaType+dereferenceSchemaType :: Typed.TypedTerm Model.Name -> Typed.TypedTerm (M.Map Model.Name Model.TypeScheme) -> Typed.TypedTerm (Maybe Model.TypeScheme)+dereferenceSchemaType arg0 arg1 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lexical.dereferenceSchemaType")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)}))++-- | DSL reference to hydra.core.lexical.dereferenceVariable+dereferenceVariable :: Typed.TypedTerm Graph.Graph -> Typed.TypedTerm Model.Name -> Typed.TypedTerm (Either Errors.Error Model.Binding)+dereferenceVariable arg0 arg1 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lexical.dereferenceVariable")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)}))++-- | DSL reference to hydra.core.lexical.elementsToGraph+elementsToGraph :: Typed.TypedTerm Graph.Graph -> Typed.TypedTerm (M.Map Model.Name Model.TypeScheme) -> Typed.TypedTerm [Model.Binding] -> Typed.TypedTerm Graph.Graph+elementsToGraph arg0 arg1 arg2 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lexical.elementsToGraph")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)})),+ Model.applicationArgument = (Typed.unTypedTerm arg2)}))++-- | DSL reference to hydra.core.lexical.emptyGraph+emptyGraph :: Typed.TypedTerm Graph.Graph+emptyGraph = Typed.TypedTerm (Model.TermVariable (Model.Name "hydra.core.lexical.emptyGraph"))++-- | DSL reference to hydra.core.lexical.emptyInferenceContext+emptyInferenceContext :: Typed.TypedTerm Typing.InferenceContext+emptyInferenceContext = Typed.TypedTerm (Model.TermVariable (Model.Name "hydra.core.lexical.emptyInferenceContext"))++-- | DSL reference to hydra.core.lexical.fieldsOf+fieldsOf :: Typed.TypedTerm Model.Type -> Typed.TypedTerm [Model.FieldType]+fieldsOf arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lexical.fieldsOf")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.lexical.getField+getField :: Typed.TypedTerm (M.Map Model.Name t0) -> Typed.TypedTerm Model.Name -> Typed.TypedTerm (t0 -> Either Errors.Error t1) -> Typed.TypedTerm (Either Errors.Error t1)+getField arg0 arg1 arg2 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lexical.getField")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)})),+ Model.applicationArgument = (Typed.unTypedTerm arg2)}))++-- | DSL reference to hydra.core.lexical.graphToBindings+graphToBindings :: Typed.TypedTerm Graph.Graph -> Typed.TypedTerm [Model.Binding]+graphToBindings arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lexical.graphToBindings")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.lexical.graphWithPrimitives+graphWithPrimitives :: Typed.TypedTerm [Graph.Primitive] -> Typed.TypedTerm [Graph.Primitive] -> Typed.TypedTerm Graph.Graph+graphWithPrimitives arg0 arg1 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lexical.graphWithPrimitives")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)}))++-- | DSL reference to hydra.core.lexical.lookupBinding+lookupBinding :: Typed.TypedTerm Graph.Graph -> Typed.TypedTerm Model.Name -> Typed.TypedTerm (Maybe Model.Binding)+lookupBinding arg0 arg1 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lexical.lookupBinding")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)}))++-- | DSL reference to hydra.core.lexical.lookupPrimitive+lookupPrimitive :: Typed.TypedTerm Graph.Graph -> Typed.TypedTerm Model.Name -> Typed.TypedTerm (Maybe Graph.Primitive)+lookupPrimitive arg0 arg1 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lexical.lookupPrimitive")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)}))++-- | DSL reference to hydra.core.lexical.lookupTerm+lookupTerm :: Typed.TypedTerm Graph.Graph -> Typed.TypedTerm Model.Name -> Typed.TypedTerm (Maybe Model.Term)+lookupTerm arg0 arg1 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lexical.lookupTerm")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)}))++-- | DSL reference to hydra.core.lexical.matchEnum+matchEnum :: Typed.TypedTerm Graph.Graph -> Typed.TypedTerm Model.Name -> Typed.TypedTerm [(Model.Name, t0)] -> Typed.TypedTerm Model.Term -> Typed.TypedTerm (Either Errors.Error t0)+matchEnum arg0 arg1 arg2 arg3 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lexical.matchEnum")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)})),+ Model.applicationArgument = (Typed.unTypedTerm arg2)})),+ Model.applicationArgument = (Typed.unTypedTerm arg3)}))++-- | DSL reference to hydra.core.lexical.matchRecord+matchRecord :: Typed.TypedTerm t0 -> Typed.TypedTerm (M.Map Model.Name Model.Term -> Either Errors.Error t1) -> Typed.TypedTerm Model.Term -> Typed.TypedTerm (Either Errors.Error t1)+matchRecord arg0 arg1 arg2 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lexical.matchRecord")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)})),+ Model.applicationArgument = (Typed.unTypedTerm arg2)}))++-- | DSL reference to hydra.core.lexical.matchUnion+matchUnion :: Typed.TypedTerm Graph.Graph -> Typed.TypedTerm Model.Name -> Typed.TypedTerm [(Model.Name, (Model.Term -> Either Errors.Error t0))] -> Typed.TypedTerm Model.Term -> Typed.TypedTerm (Either Errors.Error t0)+matchUnion arg0 arg1 arg2 arg3 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lexical.matchUnion")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)})),+ Model.applicationArgument = (Typed.unTypedTerm arg2)})),+ Model.applicationArgument = (Typed.unTypedTerm arg3)}))++-- | DSL reference to hydra.core.lexical.matchUnitField+matchUnitField :: Typed.TypedTerm t0 -> Typed.TypedTerm t1 -> Typed.TypedTerm (t0, (t2 -> Either t3 t1))+matchUnitField arg0 arg1 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lexical.matchUnitField")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)}))++-- | DSL reference to hydra.core.lexical.requireBinding+requireBinding :: Typed.TypedTerm Graph.Graph -> Typed.TypedTerm Model.Name -> Typed.TypedTerm (Either Errors.Error Model.Binding)+requireBinding arg0 arg1 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lexical.requireBinding")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)}))++-- | DSL reference to hydra.core.lexical.requirePrimitive+requirePrimitive :: Typed.TypedTerm Graph.Graph -> Typed.TypedTerm Model.Name -> Typed.TypedTerm (Either Errors.Error Graph.Primitive)+requirePrimitive arg0 arg1 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lexical.requirePrimitive")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)}))++-- | DSL reference to hydra.core.lexical.requirePrimitiveType+requirePrimitiveType :: Typed.TypedTerm Graph.Graph -> Typed.TypedTerm Model.Name -> Typed.TypedTerm (Either Errors.Error Model.TypeScheme)+requirePrimitiveType arg0 arg1 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lexical.requirePrimitiveType")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)}))++-- | DSL reference to hydra.core.lexical.requireTerm+requireTerm :: Typed.TypedTerm Graph.Graph -> Typed.TypedTerm Model.Name -> Typed.TypedTerm (Either Errors.Error Model.Term)+requireTerm arg0 arg1 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lexical.requireTerm")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)}))++-- | DSL reference to hydra.core.lexical.resolveTerm+resolveTerm :: Typed.TypedTerm Graph.Graph -> Typed.TypedTerm Model.Name -> Typed.TypedTerm (Maybe Model.Term)+resolveTerm arg0 arg1 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lexical.resolveTerm")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)}))++-- | DSL reference to hydra.core.lexical.stripAndDereferenceTerm+stripAndDereferenceTerm :: Typed.TypedTerm Graph.Graph -> Typed.TypedTerm Model.Term -> Typed.TypedTerm (Either Errors.Error Model.Term)+stripAndDereferenceTerm arg0 arg1 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lexical.stripAndDereferenceTerm")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)}))++-- | DSL reference to hydra.core.lexical.stripAndDereferenceTermEither+stripAndDereferenceTermEither :: Typed.TypedTerm Graph.Graph -> Typed.TypedTerm Model.Term -> Typed.TypedTerm (Either Errors.Error Model.Term)+stripAndDereferenceTermEither arg0 arg1 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lexical.stripAndDereferenceTermEither")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)}))
@@ -0,0 +1,126 @@+-- Note: this is an automatically generated file. Do not edit.++-- | DSL functions for hydra.core.lib.chars++module Hydra.Core.Dsl.Lib.Chars where++import qualified Hydra.Core.Ast as Ast+import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Diff as Diff+import qualified Hydra.Core.Docs as Docs+import qualified Hydra.Core.Dsl.Ast as DslAst+import qualified Hydra.Core.Dsl.Coders as DslCoders+import qualified Hydra.Core.Dsl.Diff as DslDiff+import qualified Hydra.Core.Dsl.Docs as DslDocs+import qualified Hydra.Core.Dsl.Error.Checking as ErrorChecking+import qualified Hydra.Core.Dsl.Error.File as DslErrorFile+import qualified Hydra.Core.Dsl.Error.Model as DslErrorModel+import qualified Hydra.Core.Dsl.Error.Packaging as DslErrorPackaging+import qualified Hydra.Core.Dsl.Error.System as DslErrorSystem+import qualified Hydra.Core.Dsl.Errors as DslErrors+import qualified Hydra.Core.Dsl.File as DslFile+import qualified Hydra.Core.Dsl.Graph as DslGraph+import qualified Hydra.Core.Dsl.Json.Model as DslJsonModel+import qualified Hydra.Core.Dsl.Markdown as DslMarkdown+import qualified Hydra.Core.Dsl.Model as DslModel+import qualified Hydra.Core.Dsl.Packaging as DslPackaging+import qualified Hydra.Core.Dsl.Parsing as DslParsing+import qualified Hydra.Core.Dsl.Paths as DslPaths+import qualified Hydra.Core.Dsl.Query as DslQuery+import qualified Hydra.Core.Dsl.Regex as DslRegex+import qualified Hydra.Core.Dsl.Relational as DslRelational+import qualified Hydra.Core.Dsl.System as DslSystem+import qualified Hydra.Core.Dsl.Tabular as DslTabular+import qualified Hydra.Core.Dsl.Testing as DslTesting+import qualified Hydra.Core.Dsl.Time as DslTime+import qualified Hydra.Core.Dsl.Topology as DslTopology+import qualified Hydra.Core.Dsl.Typing as DslTyping+import qualified Hydra.Core.Dsl.Util as DslUtil+import qualified Hydra.Core.Dsl.Validation as DslValidation+import qualified Hydra.Core.Dsl.Variants as DslVariants+import qualified Hydra.Core.Error.Checking as Checking+import qualified Hydra.Core.Error.File as ErrorFile+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Error.Packaging as ErrorPackaging+import qualified Hydra.Core.Error.System as ErrorSystem+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Json.Model as JsonModel+import qualified Hydra.Core.Markdown as Markdown+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Parsing as Parsing+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Query as Query+import qualified Hydra.Core.Regex as Regex+import qualified Hydra.Core.Relational as Relational+import qualified Hydra.Core.System as System+import qualified Hydra.Core.Tabular as Tabular+import qualified Hydra.Core.Testing as Testing+import qualified Hydra.Core.Time as Time+import qualified Hydra.Core.Topology as Topology+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Validation as Validation+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | DSL reference to hydra.core.lib.chars.isAlpha+isAlpha :: Typed.TypedTerm Int -> Typed.TypedTerm Bool+isAlpha char =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.chars.isAlpha")),+ Model.applicationArgument = (Typed.unTypedTerm char)}))++-- | DSL reference to hydra.core.lib.chars.isAlphaNum+isAlphaNum :: Typed.TypedTerm Int -> Typed.TypedTerm Bool+isAlphaNum char =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.chars.isAlphaNum")),+ Model.applicationArgument = (Typed.unTypedTerm char)}))++-- | DSL reference to hydra.core.lib.chars.isDigit+isDigit :: Typed.TypedTerm Int -> Typed.TypedTerm Bool+isDigit char =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.chars.isDigit")),+ Model.applicationArgument = (Typed.unTypedTerm char)}))++-- | DSL reference to hydra.core.lib.chars.isLower+isLower :: Typed.TypedTerm Int -> Typed.TypedTerm Bool+isLower char =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.chars.isLower")),+ Model.applicationArgument = (Typed.unTypedTerm char)}))++-- | DSL reference to hydra.core.lib.chars.isSpace+isSpace :: Typed.TypedTerm Int -> Typed.TypedTerm Bool+isSpace char =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.chars.isSpace")),+ Model.applicationArgument = (Typed.unTypedTerm char)}))++-- | DSL reference to hydra.core.lib.chars.isUpper+isUpper :: Typed.TypedTerm Int -> Typed.TypedTerm Bool+isUpper char =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.chars.isUpper")),+ Model.applicationArgument = (Typed.unTypedTerm char)}))++-- | DSL reference to hydra.core.lib.chars.toLower+toLower :: Typed.TypedTerm Int -> Typed.TypedTerm Int+toLower char =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.chars.toLower")),+ Model.applicationArgument = (Typed.unTypedTerm char)}))++-- | DSL reference to hydra.core.lib.chars.toUpper+toUpper :: Typed.TypedTerm Int -> Typed.TypedTerm Int+toUpper char =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.chars.toUpper")),+ Model.applicationArgument = (Typed.unTypedTerm char)}))
@@ -0,0 +1,28 @@+-- Note: this is an automatically generated file. Do not edit.++-- | DSL functions for hydra.core.lib.defaults++module Hydra.Core.Dsl.Lib.Defaults where++import qualified Hydra.Core.Dsl.Lib.Eithers as Eithers+import qualified Hydra.Core.Dsl.Lib.Equality as Equality+import qualified Hydra.Core.Dsl.Lib.Functions as Functions+import qualified Hydra.Core.Dsl.Lib.Lists as Lists+import qualified Hydra.Core.Dsl.Lib.Logic as Logic+import qualified Hydra.Core.Dsl.Lib.Maps as Maps+import qualified Hydra.Core.Dsl.Lib.Math as Math+import qualified Hydra.Core.Dsl.Lib.Optionals as Optionals+import qualified Hydra.Core.Dsl.Lib.Pairs as Pairs+import qualified Hydra.Core.Dsl.Lib.Sets as Sets+import qualified Hydra.Core.Dsl.Model as DslModel+import qualified Hydra.Core.Lib.Defaults as Defaults+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Typed as Typed+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void+import qualified Data.Map as M++-- | DSL reference to hydra.core.lib.defaults.defaultImplementations+defaultImplementations :: Typed.TypedTerm (M.Map Model.Name Model.Term)+defaultImplementations = Typed.TypedTerm (Model.TermVariable (Model.Name "hydra.core.lib.defaults.defaultImplementations"))
@@ -0,0 +1,154 @@+-- Note: this is an automatically generated file. Do not edit.++-- | DSL functions for hydra.core.lib.effects++module Hydra.Core.Dsl.Lib.Effects where++import qualified Hydra.Core.Ast as Ast+import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Diff as Diff+import qualified Hydra.Core.Docs as Docs+import qualified Hydra.Core.Dsl.Ast as DslAst+import qualified Hydra.Core.Dsl.Coders as DslCoders+import qualified Hydra.Core.Dsl.Diff as DslDiff+import qualified Hydra.Core.Dsl.Docs as DslDocs+import qualified Hydra.Core.Dsl.Error.Checking as ErrorChecking+import qualified Hydra.Core.Dsl.Error.File as DslErrorFile+import qualified Hydra.Core.Dsl.Error.Model as DslErrorModel+import qualified Hydra.Core.Dsl.Error.Packaging as DslErrorPackaging+import qualified Hydra.Core.Dsl.Error.System as DslErrorSystem+import qualified Hydra.Core.Dsl.Errors as DslErrors+import qualified Hydra.Core.Dsl.File as DslFile+import qualified Hydra.Core.Dsl.Graph as DslGraph+import qualified Hydra.Core.Dsl.Json.Model as DslJsonModel+import qualified Hydra.Core.Dsl.Markdown as DslMarkdown+import qualified Hydra.Core.Dsl.Model as DslModel+import qualified Hydra.Core.Dsl.Packaging as DslPackaging+import qualified Hydra.Core.Dsl.Parsing as DslParsing+import qualified Hydra.Core.Dsl.Paths as DslPaths+import qualified Hydra.Core.Dsl.Query as DslQuery+import qualified Hydra.Core.Dsl.Regex as DslRegex+import qualified Hydra.Core.Dsl.Relational as DslRelational+import qualified Hydra.Core.Dsl.System as DslSystem+import qualified Hydra.Core.Dsl.Tabular as DslTabular+import qualified Hydra.Core.Dsl.Testing as DslTesting+import qualified Hydra.Core.Dsl.Time as DslTime+import qualified Hydra.Core.Dsl.Topology as DslTopology+import qualified Hydra.Core.Dsl.Typing as DslTyping+import qualified Hydra.Core.Dsl.Util as DslUtil+import qualified Hydra.Core.Dsl.Validation as DslValidation+import qualified Hydra.Core.Dsl.Variants as DslVariants+import qualified Hydra.Core.Error.Checking as Checking+import qualified Hydra.Core.Error.File as ErrorFile+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Error.Packaging as ErrorPackaging+import qualified Hydra.Core.Error.System as ErrorSystem+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Json.Model as JsonModel+import qualified Hydra.Core.Markdown as Markdown+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Parsing as Parsing+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Query as Query+import qualified Hydra.Core.Regex as Regex+import qualified Hydra.Core.Relational as Relational+import qualified Hydra.Core.System as System+import qualified Hydra.Core.Tabular as Tabular+import qualified Hydra.Core.Testing as Testing+import qualified Hydra.Core.Time as Time+import qualified Hydra.Core.Topology as Topology+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Validation as Validation+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void+import qualified Data.Set as S++-- | DSL reference to hydra.core.lib.effects.apply+apply :: Typed.TypedTerm (IO (x -> y)) -> Typed.TypedTerm (IO x) -> Typed.TypedTerm (IO y)+apply ef ex =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.effects.apply")),+ Model.applicationArgument = (Typed.unTypedTerm ef)})),+ Model.applicationArgument = (Typed.unTypedTerm ex)}))++-- | DSL reference to hydra.core.lib.effects.bind+bind :: Typed.TypedTerm (IO x) -> Typed.TypedTerm (x -> IO y) -> Typed.TypedTerm (IO y)+bind e f =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.effects.bind")),+ Model.applicationArgument = (Typed.unTypedTerm e)})),+ Model.applicationArgument = (Typed.unTypedTerm f)}))++-- | DSL reference to hydra.core.lib.effects.compose+compose :: Typed.TypedTerm (x -> IO y) -> Typed.TypedTerm (y -> IO z) -> Typed.TypedTerm x -> Typed.TypedTerm (IO z)+compose f g x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.effects.compose")),+ Model.applicationArgument = (Typed.unTypedTerm f)})),+ Model.applicationArgument = (Typed.unTypedTerm g)})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL reference to hydra.core.lib.effects.foldList+foldList :: Typed.TypedTerm (x -> y -> IO x) -> Typed.TypedTerm x -> Typed.TypedTerm [y] -> Typed.TypedTerm (IO x)+foldList f acc0 xs =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.effects.foldList")),+ Model.applicationArgument = (Typed.unTypedTerm f)})),+ Model.applicationArgument = (Typed.unTypedTerm acc0)})),+ Model.applicationArgument = (Typed.unTypedTerm xs)}))++-- | DSL reference to hydra.core.lib.effects.map+map :: Typed.TypedTerm (x -> y) -> Typed.TypedTerm (IO x) -> Typed.TypedTerm (IO y)+map f e =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.effects.map")),+ Model.applicationArgument = (Typed.unTypedTerm f)})),+ Model.applicationArgument = (Typed.unTypedTerm e)}))++-- | DSL reference to hydra.core.lib.effects.mapList+mapList :: Typed.TypedTerm (x -> IO y) -> Typed.TypedTerm [x] -> Typed.TypedTerm (IO [y])+mapList f xs =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.effects.mapList")),+ Model.applicationArgument = (Typed.unTypedTerm f)})),+ Model.applicationArgument = (Typed.unTypedTerm xs)}))++-- | DSL reference to hydra.core.lib.effects.mapOptional+mapOptional :: Typed.TypedTerm (x -> IO y) -> Typed.TypedTerm (Maybe x) -> Typed.TypedTerm (IO (Maybe y))+mapOptional f m =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.effects.mapOptional")),+ Model.applicationArgument = (Typed.unTypedTerm f)})),+ Model.applicationArgument = (Typed.unTypedTerm m)}))++-- | DSL reference to hydra.core.lib.effects.mapSet+mapSet :: Typed.TypedTerm (x -> IO y) -> Typed.TypedTerm (S.Set x) -> Typed.TypedTerm (IO (S.Set y))+mapSet f s =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.effects.mapSet")),+ Model.applicationArgument = (Typed.unTypedTerm f)})),+ Model.applicationArgument = (Typed.unTypedTerm s)}))++-- | DSL reference to hydra.core.lib.effects.pure+pure :: Typed.TypedTerm x -> Typed.TypedTerm (IO x)+pure x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.effects.pure")),+ Model.applicationArgument = (Typed.unTypedTerm x)}))
@@ -0,0 +1,218 @@+-- Note: this is an automatically generated file. Do not edit.++-- | DSL functions for hydra.core.lib.eithers++module Hydra.Core.Dsl.Lib.Eithers where++import qualified Hydra.Core.Ast as Ast+import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Diff as Diff+import qualified Hydra.Core.Docs as Docs+import qualified Hydra.Core.Dsl.Ast as DslAst+import qualified Hydra.Core.Dsl.Coders as DslCoders+import qualified Hydra.Core.Dsl.Diff as DslDiff+import qualified Hydra.Core.Dsl.Docs as DslDocs+import qualified Hydra.Core.Dsl.Error.Checking as ErrorChecking+import qualified Hydra.Core.Dsl.Error.File as DslErrorFile+import qualified Hydra.Core.Dsl.Error.Model as DslErrorModel+import qualified Hydra.Core.Dsl.Error.Packaging as DslErrorPackaging+import qualified Hydra.Core.Dsl.Error.System as DslErrorSystem+import qualified Hydra.Core.Dsl.Errors as DslErrors+import qualified Hydra.Core.Dsl.File as DslFile+import qualified Hydra.Core.Dsl.Graph as DslGraph+import qualified Hydra.Core.Dsl.Json.Model as DslJsonModel+import qualified Hydra.Core.Dsl.Markdown as DslMarkdown+import qualified Hydra.Core.Dsl.Model as DslModel+import qualified Hydra.Core.Dsl.Packaging as DslPackaging+import qualified Hydra.Core.Dsl.Parsing as DslParsing+import qualified Hydra.Core.Dsl.Paths as DslPaths+import qualified Hydra.Core.Dsl.Query as DslQuery+import qualified Hydra.Core.Dsl.Regex as DslRegex+import qualified Hydra.Core.Dsl.Relational as DslRelational+import qualified Hydra.Core.Dsl.System as DslSystem+import qualified Hydra.Core.Dsl.Tabular as DslTabular+import qualified Hydra.Core.Dsl.Testing as DslTesting+import qualified Hydra.Core.Dsl.Time as DslTime+import qualified Hydra.Core.Dsl.Topology as DslTopology+import qualified Hydra.Core.Dsl.Typing as DslTyping+import qualified Hydra.Core.Dsl.Util as DslUtil+import qualified Hydra.Core.Dsl.Validation as DslValidation+import qualified Hydra.Core.Dsl.Variants as DslVariants+import qualified Hydra.Core.Error.Checking as Checking+import qualified Hydra.Core.Error.File as ErrorFile+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Error.Packaging as ErrorPackaging+import qualified Hydra.Core.Error.System as ErrorSystem+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Json.Model as JsonModel+import qualified Hydra.Core.Markdown as Markdown+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Parsing as Parsing+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Query as Query+import qualified Hydra.Core.Regex as Regex+import qualified Hydra.Core.Relational as Relational+import qualified Hydra.Core.System as System+import qualified Hydra.Core.Tabular as Tabular+import qualified Hydra.Core.Testing as Testing+import qualified Hydra.Core.Time as Time+import qualified Hydra.Core.Topology as Topology+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Validation as Validation+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void+import qualified Data.Set as S++-- | DSL reference to hydra.core.lib.eithers.apply+apply :: Typed.TypedTerm (Either x (y -> z)) -> Typed.TypedTerm (Either x y) -> Typed.TypedTerm (Either x z)+apply ef ex =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.eithers.apply")),+ Model.applicationArgument = (Typed.unTypedTerm ef)})),+ Model.applicationArgument = (Typed.unTypedTerm ex)}))++-- | DSL reference to hydra.core.lib.eithers.bimap+bimap :: Typed.TypedTerm (x -> z) -> Typed.TypedTerm (y -> w) -> Typed.TypedTerm (Either x y) -> Typed.TypedTerm (Either z w)+bimap f g e =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.eithers.bimap")),+ Model.applicationArgument = (Typed.unTypedTerm f)})),+ Model.applicationArgument = (Typed.unTypedTerm g)})),+ Model.applicationArgument = (Typed.unTypedTerm e)}))++-- | DSL reference to hydra.core.lib.eithers.bind+bind :: Typed.TypedTerm (Either x y) -> Typed.TypedTerm (y -> Either x z) -> Typed.TypedTerm (Either x z)+bind e f =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.eithers.bind")),+ Model.applicationArgument = (Typed.unTypedTerm e)})),+ Model.applicationArgument = (Typed.unTypedTerm f)}))++-- | DSL reference to hydra.core.lib.eithers.compose+compose :: Typed.TypedTerm (x -> Either w y) -> Typed.TypedTerm (y -> Either w z) -> Typed.TypedTerm x -> Typed.TypedTerm (Either w z)+compose f g x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.eithers.compose")),+ Model.applicationArgument = (Typed.unTypedTerm f)})),+ Model.applicationArgument = (Typed.unTypedTerm g)})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL reference to hydra.core.lib.eithers.either+either :: Typed.TypedTerm (x -> z) -> Typed.TypedTerm (y -> z) -> Typed.TypedTerm (Either x y) -> Typed.TypedTerm z+either f g e =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.eithers.either")),+ Model.applicationArgument = (Typed.unTypedTerm f)})),+ Model.applicationArgument = (Typed.unTypedTerm g)})),+ Model.applicationArgument = (Typed.unTypedTerm e)}))++-- | DSL reference to hydra.core.lib.eithers.foldList+foldList :: Typed.TypedTerm (x -> y -> Either z x) -> Typed.TypedTerm x -> Typed.TypedTerm [y] -> Typed.TypedTerm (Either z x)+foldList f acc0 xs =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.eithers.foldList")),+ Model.applicationArgument = (Typed.unTypedTerm f)})),+ Model.applicationArgument = (Typed.unTypedTerm acc0)})),+ Model.applicationArgument = (Typed.unTypedTerm xs)}))++-- | DSL reference to hydra.core.lib.eithers.isLeft+isLeft :: Typed.TypedTerm (Either x y) -> Typed.TypedTerm Bool+isLeft e =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.eithers.isLeft")),+ Model.applicationArgument = (Typed.unTypedTerm e)}))++-- | DSL reference to hydra.core.lib.eithers.isRight+isRight :: Typed.TypedTerm (Either x y) -> Typed.TypedTerm Bool+isRight e =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.eithers.isRight")),+ Model.applicationArgument = (Typed.unTypedTerm e)}))++-- | DSL reference to hydra.core.lib.eithers.left+left :: Typed.TypedTerm x -> Typed.TypedTerm (Either x y)+left x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.eithers.left")),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL reference to hydra.core.lib.eithers.lefts+lefts :: Typed.TypedTerm [Either x y] -> Typed.TypedTerm [x]+lefts xs =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.eithers.lefts")),+ Model.applicationArgument = (Typed.unTypedTerm xs)}))++-- | DSL reference to hydra.core.lib.eithers.map+map :: Typed.TypedTerm (x -> y) -> Typed.TypedTerm (Either z x) -> Typed.TypedTerm (Either z y)+map f e =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.eithers.map")),+ Model.applicationArgument = (Typed.unTypedTerm f)})),+ Model.applicationArgument = (Typed.unTypedTerm e)}))++-- | DSL reference to hydra.core.lib.eithers.mapList+mapList :: Typed.TypedTerm (x -> Either z y) -> Typed.TypedTerm [x] -> Typed.TypedTerm (Either z [y])+mapList f xs =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.eithers.mapList")),+ Model.applicationArgument = (Typed.unTypedTerm f)})),+ Model.applicationArgument = (Typed.unTypedTerm xs)}))++-- | DSL reference to hydra.core.lib.eithers.mapOptional+mapOptional :: Typed.TypedTerm (x -> Either z y) -> Typed.TypedTerm (Maybe x) -> Typed.TypedTerm (Either z (Maybe y))+mapOptional f m =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.eithers.mapOptional")),+ Model.applicationArgument = (Typed.unTypedTerm f)})),+ Model.applicationArgument = (Typed.unTypedTerm m)}))++-- | DSL reference to hydra.core.lib.eithers.mapSet+mapSet :: Typed.TypedTerm (x -> Either z y) -> Typed.TypedTerm (S.Set x) -> Typed.TypedTerm (Either z (S.Set y))+mapSet f s =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.eithers.mapSet")),+ Model.applicationArgument = (Typed.unTypedTerm f)})),+ Model.applicationArgument = (Typed.unTypedTerm s)}))++-- | DSL reference to hydra.core.lib.eithers.partition+partition :: Typed.TypedTerm [Either x y] -> Typed.TypedTerm ([x], [y])+partition xs =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.eithers.partition")),+ Model.applicationArgument = (Typed.unTypedTerm xs)}))++-- | DSL reference to hydra.core.lib.eithers.right+right :: Typed.TypedTerm y -> Typed.TypedTerm (Either x y)+right x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.eithers.right")),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL reference to hydra.core.lib.eithers.rights+rights :: Typed.TypedTerm [Either x y] -> Typed.TypedTerm [y]+rights xs =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.eithers.rights")),+ Model.applicationArgument = (Typed.unTypedTerm xs)}))
@@ -0,0 +1,88 @@+-- Note: this is an automatically generated file. Do not edit.++-- | DSL functions for hydra.core.lib.equality++module Hydra.Core.Dsl.Lib.Equality where++import qualified Hydra.Core.Ast as Ast+import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Diff as Diff+import qualified Hydra.Core.Docs as Docs+import qualified Hydra.Core.Dsl.Ast as DslAst+import qualified Hydra.Core.Dsl.Coders as DslCoders+import qualified Hydra.Core.Dsl.Diff as DslDiff+import qualified Hydra.Core.Dsl.Docs as DslDocs+import qualified Hydra.Core.Dsl.Error.Checking as ErrorChecking+import qualified Hydra.Core.Dsl.Error.File as DslErrorFile+import qualified Hydra.Core.Dsl.Error.Model as DslErrorModel+import qualified Hydra.Core.Dsl.Error.Packaging as DslErrorPackaging+import qualified Hydra.Core.Dsl.Error.System as DslErrorSystem+import qualified Hydra.Core.Dsl.Errors as DslErrors+import qualified Hydra.Core.Dsl.File as DslFile+import qualified Hydra.Core.Dsl.Graph as DslGraph+import qualified Hydra.Core.Dsl.Json.Model as DslJsonModel+import qualified Hydra.Core.Dsl.Markdown as DslMarkdown+import qualified Hydra.Core.Dsl.Model as DslModel+import qualified Hydra.Core.Dsl.Packaging as DslPackaging+import qualified Hydra.Core.Dsl.Parsing as DslParsing+import qualified Hydra.Core.Dsl.Paths as DslPaths+import qualified Hydra.Core.Dsl.Query as DslQuery+import qualified Hydra.Core.Dsl.Regex as DslRegex+import qualified Hydra.Core.Dsl.Relational as DslRelational+import qualified Hydra.Core.Dsl.System as DslSystem+import qualified Hydra.Core.Dsl.Tabular as DslTabular+import qualified Hydra.Core.Dsl.Testing as DslTesting+import qualified Hydra.Core.Dsl.Time as DslTime+import qualified Hydra.Core.Dsl.Topology as DslTopology+import qualified Hydra.Core.Dsl.Typing as DslTyping+import qualified Hydra.Core.Dsl.Util as DslUtil+import qualified Hydra.Core.Dsl.Validation as DslValidation+import qualified Hydra.Core.Dsl.Variants as DslVariants+import qualified Hydra.Core.Error.Checking as Checking+import qualified Hydra.Core.Error.File as ErrorFile+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Error.Packaging as ErrorPackaging+import qualified Hydra.Core.Error.System as ErrorSystem+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Json.Model as JsonModel+import qualified Hydra.Core.Markdown as Markdown+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Parsing as Parsing+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Query as Query+import qualified Hydra.Core.Regex as Regex+import qualified Hydra.Core.Relational as Relational+import qualified Hydra.Core.System as System+import qualified Hydra.Core.Tabular as Tabular+import qualified Hydra.Core.Testing as Testing+import qualified Hydra.Core.Time as Time+import qualified Hydra.Core.Topology as Topology+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Validation as Validation+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | DSL reference to hydra.core.lib.equality.equal+equal :: Typed.TypedTerm x -> Typed.TypedTerm x -> Typed.TypedTerm Bool+equal x y =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.equality.equal")),+ Model.applicationArgument = (Typed.unTypedTerm x)})),+ Model.applicationArgument = (Typed.unTypedTerm y)}))++-- | DSL reference to hydra.core.lib.equality.notEqual+notEqual :: Typed.TypedTerm x -> Typed.TypedTerm x -> Typed.TypedTerm Bool+notEqual x y =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.equality.notEqual")),+ Model.applicationArgument = (Typed.unTypedTerm x)})),+ Model.applicationArgument = (Typed.unTypedTerm y)}))
@@ -0,0 +1,180 @@+-- Note: this is an automatically generated file. Do not edit.++-- | DSL functions for hydra.core.lib.files++module Hydra.Core.Dsl.Lib.Files where++import qualified Hydra.Core.Ast as Ast+import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Diff as Diff+import qualified Hydra.Core.Docs as Docs+import qualified Hydra.Core.Dsl.Ast as DslAst+import qualified Hydra.Core.Dsl.Coders as DslCoders+import qualified Hydra.Core.Dsl.Diff as DslDiff+import qualified Hydra.Core.Dsl.Docs as DslDocs+import qualified Hydra.Core.Dsl.Error.Checking as ErrorChecking+import qualified Hydra.Core.Dsl.Error.File as DslErrorFile+import qualified Hydra.Core.Dsl.Error.Model as DslErrorModel+import qualified Hydra.Core.Dsl.Error.Packaging as DslErrorPackaging+import qualified Hydra.Core.Dsl.Error.System as DslErrorSystem+import qualified Hydra.Core.Dsl.Errors as DslErrors+import qualified Hydra.Core.Dsl.File as DslFile+import qualified Hydra.Core.Dsl.Graph as DslGraph+import qualified Hydra.Core.Dsl.Json.Model as DslJsonModel+import qualified Hydra.Core.Dsl.Markdown as DslMarkdown+import qualified Hydra.Core.Dsl.Model as DslModel+import qualified Hydra.Core.Dsl.Packaging as DslPackaging+import qualified Hydra.Core.Dsl.Parsing as DslParsing+import qualified Hydra.Core.Dsl.Paths as DslPaths+import qualified Hydra.Core.Dsl.Query as DslQuery+import qualified Hydra.Core.Dsl.Regex as DslRegex+import qualified Hydra.Core.Dsl.Relational as DslRelational+import qualified Hydra.Core.Dsl.System as DslSystem+import qualified Hydra.Core.Dsl.Tabular as DslTabular+import qualified Hydra.Core.Dsl.Testing as DslTesting+import qualified Hydra.Core.Dsl.Time as DslTime+import qualified Hydra.Core.Dsl.Topology as DslTopology+import qualified Hydra.Core.Dsl.Typing as DslTyping+import qualified Hydra.Core.Dsl.Util as DslUtil+import qualified Hydra.Core.Dsl.Validation as DslValidation+import qualified Hydra.Core.Dsl.Variants as DslVariants+import qualified Hydra.Core.Error.Checking as Checking+import qualified Hydra.Core.Error.File as ErrorFile+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Error.Packaging as ErrorPackaging+import qualified Hydra.Core.Error.System as ErrorSystem+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Json.Model as JsonModel+import qualified Hydra.Core.Markdown as Markdown+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Parsing as Parsing+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Query as Query+import qualified Hydra.Core.Regex as Regex+import qualified Hydra.Core.Relational as Relational+import qualified Hydra.Core.System as System+import qualified Hydra.Core.Tabular as Tabular+import qualified Hydra.Core.Testing as Testing+import qualified Hydra.Core.Time as Time+import qualified Hydra.Core.Topology as Topology+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Validation as Validation+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void+import qualified Data.ByteString as B++-- | DSL reference to hydra.core.lib.files.appendFile+appendFile :: Typed.TypedTerm File.FilePath -> Typed.TypedTerm B.ByteString -> Typed.TypedTerm (IO (Either ErrorFile.FileError ()))+appendFile path contents =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.files.appendFile")),+ Model.applicationArgument = (Typed.unTypedTerm path)})),+ Model.applicationArgument = (Typed.unTypedTerm contents)}))++-- | DSL reference to hydra.core.lib.files.copy+copy :: Typed.TypedTerm Bool -> Typed.TypedTerm File.FilePath -> Typed.TypedTerm File.FilePath -> Typed.TypedTerm (IO (Either ErrorFile.FileError ()))+copy recursive source destination =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.files.copy")),+ Model.applicationArgument = (Typed.unTypedTerm recursive)})),+ Model.applicationArgument = (Typed.unTypedTerm source)})),+ Model.applicationArgument = (Typed.unTypedTerm destination)}))++-- | DSL reference to hydra.core.lib.files.createDirectory+createDirectory :: Typed.TypedTerm Bool -> Typed.TypedTerm File.FilePath -> Typed.TypedTerm (IO (Either ErrorFile.FileError ()))+createDirectory recursive path =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.files.createDirectory")),+ Model.applicationArgument = (Typed.unTypedTerm recursive)})),+ Model.applicationArgument = (Typed.unTypedTerm path)}))++-- | DSL reference to hydra.core.lib.files.createSymlink+createSymlink :: Typed.TypedTerm File.FilePath -> Typed.TypedTerm File.FilePath -> Typed.TypedTerm (IO (Either ErrorFile.FileError ()))+createSymlink target link =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.files.createSymlink")),+ Model.applicationArgument = (Typed.unTypedTerm target)})),+ Model.applicationArgument = (Typed.unTypedTerm link)}))++-- | DSL reference to hydra.core.lib.files.exists+exists :: Typed.TypedTerm File.FilePath -> Typed.TypedTerm (IO (Either ErrorFile.FileError Bool))+exists path =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.files.exists")),+ Model.applicationArgument = (Typed.unTypedTerm path)}))++-- | DSL reference to hydra.core.lib.files.listDirectory+listDirectory :: Typed.TypedTerm File.FilePath -> Typed.TypedTerm (IO (Either ErrorFile.FileError [File.FilePath]))+listDirectory path =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.files.listDirectory")),+ Model.applicationArgument = (Typed.unTypedTerm path)}))++-- | DSL reference to hydra.core.lib.files.readFile+readFile :: Typed.TypedTerm File.FilePath -> Typed.TypedTerm (IO (Either ErrorFile.FileError B.ByteString))+readFile path =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.files.readFile")),+ Model.applicationArgument = (Typed.unTypedTerm path)}))++-- | DSL reference to hydra.core.lib.files.readSymlink+readSymlink :: Typed.TypedTerm File.FilePath -> Typed.TypedTerm (IO (Either ErrorFile.FileError File.FilePath))+readSymlink path =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.files.readSymlink")),+ Model.applicationArgument = (Typed.unTypedTerm path)}))++-- | DSL reference to hydra.core.lib.files.removeDirectory+removeDirectory :: Typed.TypedTerm Bool -> Typed.TypedTerm File.FilePath -> Typed.TypedTerm (IO (Either ErrorFile.FileError ()))+removeDirectory recursive path =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.files.removeDirectory")),+ Model.applicationArgument = (Typed.unTypedTerm recursive)})),+ Model.applicationArgument = (Typed.unTypedTerm path)}))++-- | DSL reference to hydra.core.lib.files.removeFile+removeFile :: Typed.TypedTerm File.FilePath -> Typed.TypedTerm (IO (Either ErrorFile.FileError ()))+removeFile path =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.files.removeFile")),+ Model.applicationArgument = (Typed.unTypedTerm path)}))++-- | DSL reference to hydra.core.lib.files.rename+rename :: Typed.TypedTerm File.FilePath -> Typed.TypedTerm File.FilePath -> Typed.TypedTerm (IO (Either ErrorFile.FileError ()))+rename source destination =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.files.rename")),+ Model.applicationArgument = (Typed.unTypedTerm source)})),+ Model.applicationArgument = (Typed.unTypedTerm destination)}))++-- | DSL reference to hydra.core.lib.files.status+status :: Typed.TypedTerm Bool -> Typed.TypedTerm File.FilePath -> Typed.TypedTerm (IO (Either ErrorFile.FileError File.FileStatus))+status followLinks path =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.files.status")),+ Model.applicationArgument = (Typed.unTypedTerm followLinks)})),+ Model.applicationArgument = (Typed.unTypedTerm path)}))++-- | DSL reference to hydra.core.lib.files.writeFile+writeFile :: Typed.TypedTerm File.FilePath -> Typed.TypedTerm B.ByteString -> Typed.TypedTerm (IO (Either ErrorFile.FileError ()))+writeFile path contents =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.files.writeFile")),+ Model.applicationArgument = (Typed.unTypedTerm path)})),+ Model.applicationArgument = (Typed.unTypedTerm contents)}))
@@ -0,0 +1,108 @@+-- Note: this is an automatically generated file. Do not edit.++-- | DSL functions for hydra.core.lib.functions++module Hydra.Core.Dsl.Lib.Functions where++import qualified Hydra.Core.Ast as Ast+import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Diff as Diff+import qualified Hydra.Core.Docs as Docs+import qualified Hydra.Core.Dsl.Ast as DslAst+import qualified Hydra.Core.Dsl.Coders as DslCoders+import qualified Hydra.Core.Dsl.Diff as DslDiff+import qualified Hydra.Core.Dsl.Docs as DslDocs+import qualified Hydra.Core.Dsl.Error.Checking as ErrorChecking+import qualified Hydra.Core.Dsl.Error.File as DslErrorFile+import qualified Hydra.Core.Dsl.Error.Model as DslErrorModel+import qualified Hydra.Core.Dsl.Error.Packaging as DslErrorPackaging+import qualified Hydra.Core.Dsl.Error.System as DslErrorSystem+import qualified Hydra.Core.Dsl.Errors as DslErrors+import qualified Hydra.Core.Dsl.File as DslFile+import qualified Hydra.Core.Dsl.Graph as DslGraph+import qualified Hydra.Core.Dsl.Json.Model as DslJsonModel+import qualified Hydra.Core.Dsl.Markdown as DslMarkdown+import qualified Hydra.Core.Dsl.Model as DslModel+import qualified Hydra.Core.Dsl.Packaging as DslPackaging+import qualified Hydra.Core.Dsl.Parsing as DslParsing+import qualified Hydra.Core.Dsl.Paths as DslPaths+import qualified Hydra.Core.Dsl.Query as DslQuery+import qualified Hydra.Core.Dsl.Regex as DslRegex+import qualified Hydra.Core.Dsl.Relational as DslRelational+import qualified Hydra.Core.Dsl.System as DslSystem+import qualified Hydra.Core.Dsl.Tabular as DslTabular+import qualified Hydra.Core.Dsl.Testing as DslTesting+import qualified Hydra.Core.Dsl.Time as DslTime+import qualified Hydra.Core.Dsl.Topology as DslTopology+import qualified Hydra.Core.Dsl.Typing as DslTyping+import qualified Hydra.Core.Dsl.Util as DslUtil+import qualified Hydra.Core.Dsl.Validation as DslValidation+import qualified Hydra.Core.Dsl.Variants as DslVariants+import qualified Hydra.Core.Error.Checking as Checking+import qualified Hydra.Core.Error.File as ErrorFile+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Error.Packaging as ErrorPackaging+import qualified Hydra.Core.Error.System as ErrorSystem+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Json.Model as JsonModel+import qualified Hydra.Core.Markdown as Markdown+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Parsing as Parsing+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Query as Query+import qualified Hydra.Core.Regex as Regex+import qualified Hydra.Core.Relational as Relational+import qualified Hydra.Core.System as System+import qualified Hydra.Core.Tabular as Tabular+import qualified Hydra.Core.Testing as Testing+import qualified Hydra.Core.Time as Time+import qualified Hydra.Core.Topology as Topology+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Validation as Validation+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | DSL reference to hydra.core.lib.functions.compose+compose :: Typed.TypedTerm (t2 -> t3) -> Typed.TypedTerm (t1 -> t2) -> Typed.TypedTerm t1 -> Typed.TypedTerm t3+compose g f x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.functions.compose")),+ Model.applicationArgument = (Typed.unTypedTerm g)})),+ Model.applicationArgument = (Typed.unTypedTerm f)})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL reference to hydra.core.lib.functions.const+const :: Typed.TypedTerm t1 -> Typed.TypedTerm t2 -> Typed.TypedTerm t1+const x y =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.functions.const")),+ Model.applicationArgument = (Typed.unTypedTerm x)})),+ Model.applicationArgument = (Typed.unTypedTerm y)}))++-- | DSL reference to hydra.core.lib.functions.flip+flip :: Typed.TypedTerm (t1 -> t2 -> t3) -> Typed.TypedTerm t2 -> Typed.TypedTerm t1 -> Typed.TypedTerm t3+flip f x y =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.functions.flip")),+ Model.applicationArgument = (Typed.unTypedTerm f)})),+ Model.applicationArgument = (Typed.unTypedTerm x)})),+ Model.applicationArgument = (Typed.unTypedTerm y)}))++-- | DSL reference to hydra.core.lib.functions.identity+identity :: Typed.TypedTerm t1 -> Typed.TypedTerm t1+identity x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.functions.identity")),+ Model.applicationArgument = (Typed.unTypedTerm x)}))
@@ -0,0 +1,431 @@+-- Note: this is an automatically generated file. Do not edit.++-- | DSL functions for hydra.core.lib.lists++module Hydra.Core.Dsl.Lib.Lists where++import qualified Hydra.Core.Ast as Ast+import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Diff as Diff+import qualified Hydra.Core.Docs as Docs+import qualified Hydra.Core.Dsl.Ast as DslAst+import qualified Hydra.Core.Dsl.Coders as DslCoders+import qualified Hydra.Core.Dsl.Diff as DslDiff+import qualified Hydra.Core.Dsl.Docs as DslDocs+import qualified Hydra.Core.Dsl.Error.Checking as ErrorChecking+import qualified Hydra.Core.Dsl.Error.File as DslErrorFile+import qualified Hydra.Core.Dsl.Error.Model as DslErrorModel+import qualified Hydra.Core.Dsl.Error.Packaging as DslErrorPackaging+import qualified Hydra.Core.Dsl.Error.System as DslErrorSystem+import qualified Hydra.Core.Dsl.Errors as DslErrors+import qualified Hydra.Core.Dsl.File as DslFile+import qualified Hydra.Core.Dsl.Graph as DslGraph+import qualified Hydra.Core.Dsl.Json.Model as DslJsonModel+import qualified Hydra.Core.Dsl.Markdown as DslMarkdown+import qualified Hydra.Core.Dsl.Model as DslModel+import qualified Hydra.Core.Dsl.Packaging as DslPackaging+import qualified Hydra.Core.Dsl.Parsing as DslParsing+import qualified Hydra.Core.Dsl.Paths as DslPaths+import qualified Hydra.Core.Dsl.Query as DslQuery+import qualified Hydra.Core.Dsl.Regex as DslRegex+import qualified Hydra.Core.Dsl.Relational as DslRelational+import qualified Hydra.Core.Dsl.System as DslSystem+import qualified Hydra.Core.Dsl.Tabular as DslTabular+import qualified Hydra.Core.Dsl.Testing as DslTesting+import qualified Hydra.Core.Dsl.Time as DslTime+import qualified Hydra.Core.Dsl.Topology as DslTopology+import qualified Hydra.Core.Dsl.Typing as DslTyping+import qualified Hydra.Core.Dsl.Util as DslUtil+import qualified Hydra.Core.Dsl.Validation as DslValidation+import qualified Hydra.Core.Dsl.Variants as DslVariants+import qualified Hydra.Core.Error.Checking as Checking+import qualified Hydra.Core.Error.File as ErrorFile+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Error.Packaging as ErrorPackaging+import qualified Hydra.Core.Error.System as ErrorSystem+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Json.Model as JsonModel+import qualified Hydra.Core.Markdown as Markdown+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Parsing as Parsing+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Query as Query+import qualified Hydra.Core.Regex as Regex+import qualified Hydra.Core.Relational as Relational+import qualified Hydra.Core.System as System+import qualified Hydra.Core.Tabular as Tabular+import qualified Hydra.Core.Testing as Testing+import qualified Hydra.Core.Time as Time+import qualified Hydra.Core.Topology as Topology+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Validation as Validation+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void+import qualified Data.Set as S++-- | DSL reference to hydra.core.lib.lists.apply+apply :: Typed.TypedTerm [x -> y] -> Typed.TypedTerm [x] -> Typed.TypedTerm [y]+apply fs xs =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.lists.apply")),+ Model.applicationArgument = (Typed.unTypedTerm fs)})),+ Model.applicationArgument = (Typed.unTypedTerm xs)}))++-- | DSL reference to hydra.core.lib.lists.at+at :: Typed.TypedTerm Int -> Typed.TypedTerm [x] -> Typed.TypedTerm (Maybe x)+at i xs =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.lists.at")),+ Model.applicationArgument = (Typed.unTypedTerm i)})),+ Model.applicationArgument = (Typed.unTypedTerm xs)}))++-- | DSL reference to hydra.core.lib.lists.bind+bind :: Typed.TypedTerm [x] -> Typed.TypedTerm (x -> [y]) -> Typed.TypedTerm [y]+bind xs f =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.lists.bind")),+ Model.applicationArgument = (Typed.unTypedTerm xs)})),+ Model.applicationArgument = (Typed.unTypedTerm f)}))++-- | DSL reference to hydra.core.lib.lists.compose+compose :: Typed.TypedTerm (x -> [y]) -> Typed.TypedTerm (y -> [z]) -> Typed.TypedTerm x -> Typed.TypedTerm [z]+compose f g x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.lists.compose")),+ Model.applicationArgument = (Typed.unTypedTerm f)})),+ Model.applicationArgument = (Typed.unTypedTerm g)})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL reference to hydra.core.lib.lists.concat+concat :: Typed.TypedTerm [[x]] -> Typed.TypedTerm [x]+concat xss =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.lists.concat")),+ Model.applicationArgument = (Typed.unTypedTerm xss)}))++-- | DSL reference to hydra.core.lib.lists.concat2+concat2 :: Typed.TypedTerm [x] -> Typed.TypedTerm [x] -> Typed.TypedTerm [x]+concat2 xs ys =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.lists.concat2")),+ Model.applicationArgument = (Typed.unTypedTerm xs)})),+ Model.applicationArgument = (Typed.unTypedTerm ys)}))++-- | DSL reference to hydra.core.lib.lists.cons+cons :: Typed.TypedTerm x -> Typed.TypedTerm [x] -> Typed.TypedTerm [x]+cons x xs =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.lists.cons")),+ Model.applicationArgument = (Typed.unTypedTerm x)})),+ Model.applicationArgument = (Typed.unTypedTerm xs)}))++-- | DSL reference to hydra.core.lib.lists.distinct+distinct :: Typed.TypedTerm [x] -> Typed.TypedTerm [x]+distinct xs =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.lists.distinct")),+ Model.applicationArgument = (Typed.unTypedTerm xs)}))++-- | DSL reference to hydra.core.lib.lists.drop+drop :: Typed.TypedTerm Int -> Typed.TypedTerm [x] -> Typed.TypedTerm [x]+drop n xs =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.lists.drop")),+ Model.applicationArgument = (Typed.unTypedTerm n)})),+ Model.applicationArgument = (Typed.unTypedTerm xs)}))++-- | DSL reference to hydra.core.lib.lists.dropWhile+dropWhile :: Typed.TypedTerm (x -> Bool) -> Typed.TypedTerm [x] -> Typed.TypedTerm [x]+dropWhile p xs =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.lists.dropWhile")),+ Model.applicationArgument = (Typed.unTypedTerm p)})),+ Model.applicationArgument = (Typed.unTypedTerm xs)}))++-- | DSL reference to hydra.core.lib.lists.filter+filter :: Typed.TypedTerm (x -> Bool) -> Typed.TypedTerm [x] -> Typed.TypedTerm [x]+filter p xs =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.lists.filter")),+ Model.applicationArgument = (Typed.unTypedTerm p)})),+ Model.applicationArgument = (Typed.unTypedTerm xs)}))++-- | DSL reference to hydra.core.lib.lists.find+find :: Typed.TypedTerm (x -> Bool) -> Typed.TypedTerm [x] -> Typed.TypedTerm (Maybe x)+find p xs =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.lists.find")),+ Model.applicationArgument = (Typed.unTypedTerm p)})),+ Model.applicationArgument = (Typed.unTypedTerm xs)}))++-- | DSL reference to hydra.core.lib.lists.foldList+foldList :: Typed.TypedTerm (x -> y -> [x]) -> Typed.TypedTerm x -> Typed.TypedTerm [y] -> Typed.TypedTerm [x]+foldList f acc0 xs =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.lists.foldList")),+ Model.applicationArgument = (Typed.unTypedTerm f)})),+ Model.applicationArgument = (Typed.unTypedTerm acc0)})),+ Model.applicationArgument = (Typed.unTypedTerm xs)}))++-- | DSL reference to hydra.core.lib.lists.foldl+foldl :: Typed.TypedTerm (y -> x -> y) -> Typed.TypedTerm y -> Typed.TypedTerm [x] -> Typed.TypedTerm y+foldl f acc0 xs =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.lists.foldl")),+ Model.applicationArgument = (Typed.unTypedTerm f)})),+ Model.applicationArgument = (Typed.unTypedTerm acc0)})),+ Model.applicationArgument = (Typed.unTypedTerm xs)}))++-- | DSL reference to hydra.core.lib.lists.foldr+foldr :: Typed.TypedTerm (x -> y -> y) -> Typed.TypedTerm y -> Typed.TypedTerm [x] -> Typed.TypedTerm y+foldr f acc0 xs =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.lists.foldr")),+ Model.applicationArgument = (Typed.unTypedTerm f)})),+ Model.applicationArgument = (Typed.unTypedTerm acc0)})),+ Model.applicationArgument = (Typed.unTypedTerm xs)}))++-- | DSL reference to hydra.core.lib.lists.group+group :: Typed.TypedTerm [x] -> Typed.TypedTerm [[x]]+group xs =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.lists.group")),+ Model.applicationArgument = (Typed.unTypedTerm xs)}))++-- | DSL reference to hydra.core.lib.lists.head+head :: Typed.TypedTerm [x] -> Typed.TypedTerm (Maybe x)+head xs =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.lists.head")),+ Model.applicationArgument = (Typed.unTypedTerm xs)}))++-- | DSL reference to hydra.core.lib.lists.init+init :: Typed.TypedTerm [x] -> Typed.TypedTerm (Maybe [x])+init xs =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.lists.init")),+ Model.applicationArgument = (Typed.unTypedTerm xs)}))++-- | DSL reference to hydra.core.lib.lists.intersperse+intersperse :: Typed.TypedTerm x -> Typed.TypedTerm [x] -> Typed.TypedTerm [x]+intersperse sep xs =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.lists.intersperse")),+ Model.applicationArgument = (Typed.unTypedTerm sep)})),+ Model.applicationArgument = (Typed.unTypedTerm xs)}))++-- | DSL reference to hydra.core.lib.lists.isEmpty+isEmpty :: Typed.TypedTerm [x] -> Typed.TypedTerm Bool+isEmpty xs =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.lists.isEmpty")),+ Model.applicationArgument = (Typed.unTypedTerm xs)}))++-- | DSL reference to hydra.core.lib.lists.join+join :: Typed.TypedTerm [x] -> Typed.TypedTerm [[x]] -> Typed.TypedTerm [x]+join sep xss =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.lists.join")),+ Model.applicationArgument = (Typed.unTypedTerm sep)})),+ Model.applicationArgument = (Typed.unTypedTerm xss)}))++-- | DSL reference to hydra.core.lib.lists.last+last :: Typed.TypedTerm [x] -> Typed.TypedTerm (Maybe x)+last xs =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.lists.last")),+ Model.applicationArgument = (Typed.unTypedTerm xs)}))++-- | DSL reference to hydra.core.lib.lists.length+length :: Typed.TypedTerm [x] -> Typed.TypedTerm Int+length xs =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.lists.length")),+ Model.applicationArgument = (Typed.unTypedTerm xs)}))++-- | DSL reference to hydra.core.lib.lists.map+map :: Typed.TypedTerm (x -> y) -> Typed.TypedTerm [x] -> Typed.TypedTerm [y]+map f xs =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.lists.map")),+ Model.applicationArgument = (Typed.unTypedTerm f)})),+ Model.applicationArgument = (Typed.unTypedTerm xs)}))++-- | DSL reference to hydra.core.lib.lists.mapList+mapList :: Typed.TypedTerm (x -> [y]) -> Typed.TypedTerm [x] -> Typed.TypedTerm [[y]]+mapList f xs =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.lists.mapList")),+ Model.applicationArgument = (Typed.unTypedTerm f)})),+ Model.applicationArgument = (Typed.unTypedTerm xs)}))++-- | DSL reference to hydra.core.lib.lists.mapOptional+mapOptional :: Typed.TypedTerm (x -> [y]) -> Typed.TypedTerm (Maybe x) -> Typed.TypedTerm [Maybe y]+mapOptional f m =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.lists.mapOptional")),+ Model.applicationArgument = (Typed.unTypedTerm f)})),+ Model.applicationArgument = (Typed.unTypedTerm m)}))++-- | DSL reference to hydra.core.lib.lists.mapSet+mapSet :: Typed.TypedTerm (x -> [y]) -> Typed.TypedTerm (S.Set x) -> Typed.TypedTerm [S.Set y]+mapSet f s =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.lists.mapSet")),+ Model.applicationArgument = (Typed.unTypedTerm f)})),+ Model.applicationArgument = (Typed.unTypedTerm s)}))++-- | DSL reference to hydra.core.lib.lists.member+member :: Typed.TypedTerm x -> Typed.TypedTerm [x] -> Typed.TypedTerm Bool+member x xs =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.lists.member")),+ Model.applicationArgument = (Typed.unTypedTerm x)})),+ Model.applicationArgument = (Typed.unTypedTerm xs)}))++-- | DSL reference to hydra.core.lib.lists.partition+partition :: Typed.TypedTerm (x -> Bool) -> Typed.TypedTerm [x] -> Typed.TypedTerm ([x], [x])+partition p xs =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.lists.partition")),+ Model.applicationArgument = (Typed.unTypedTerm p)})),+ Model.applicationArgument = (Typed.unTypedTerm xs)}))++-- | DSL reference to hydra.core.lib.lists.replicate+replicate :: Typed.TypedTerm Int -> Typed.TypedTerm x -> Typed.TypedTerm [x]+replicate n x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.lists.replicate")),+ Model.applicationArgument = (Typed.unTypedTerm n)})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL reference to hydra.core.lib.lists.reverse+reverse :: Typed.TypedTerm [x] -> Typed.TypedTerm [x]+reverse xs =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.lists.reverse")),+ Model.applicationArgument = (Typed.unTypedTerm xs)}))++-- | DSL reference to hydra.core.lib.lists.singleton+singleton :: Typed.TypedTerm x -> Typed.TypedTerm [x]+singleton x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.lists.singleton")),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL reference to hydra.core.lib.lists.sort+sort :: Typed.TypedTerm [x] -> Typed.TypedTerm [x]+sort xs =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.lists.sort")),+ Model.applicationArgument = (Typed.unTypedTerm xs)}))++-- | DSL reference to hydra.core.lib.lists.sortBy+sortBy :: Typed.TypedTerm (x -> y) -> Typed.TypedTerm [x] -> Typed.TypedTerm [x]+sortBy f xs =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.lists.sortBy")),+ Model.applicationArgument = (Typed.unTypedTerm f)})),+ Model.applicationArgument = (Typed.unTypedTerm xs)}))++-- | DSL reference to hydra.core.lib.lists.span+span :: Typed.TypedTerm (x -> Bool) -> Typed.TypedTerm [x] -> Typed.TypedTerm ([x], [x])+span p xs =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.lists.span")),+ Model.applicationArgument = (Typed.unTypedTerm p)})),+ Model.applicationArgument = (Typed.unTypedTerm xs)}))++-- | DSL reference to hydra.core.lib.lists.tail+tail :: Typed.TypedTerm [x] -> Typed.TypedTerm (Maybe [x])+tail xs =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.lists.tail")),+ Model.applicationArgument = (Typed.unTypedTerm xs)}))++-- | DSL reference to hydra.core.lib.lists.take+take :: Typed.TypedTerm Int -> Typed.TypedTerm [x] -> Typed.TypedTerm [x]+take n xs =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.lists.take")),+ Model.applicationArgument = (Typed.unTypedTerm n)})),+ Model.applicationArgument = (Typed.unTypedTerm xs)}))++-- | DSL reference to hydra.core.lib.lists.takeWhile+takeWhile :: Typed.TypedTerm (x -> Bool) -> Typed.TypedTerm [x] -> Typed.TypedTerm [x]+takeWhile p xs =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.lists.takeWhile")),+ Model.applicationArgument = (Typed.unTypedTerm p)})),+ Model.applicationArgument = (Typed.unTypedTerm xs)}))++-- | DSL reference to hydra.core.lib.lists.transpose+transpose :: Typed.TypedTerm [[x]] -> Typed.TypedTerm [[x]]+transpose xss =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.lists.transpose")),+ Model.applicationArgument = (Typed.unTypedTerm xss)}))++-- | DSL reference to hydra.core.lib.lists.uncons+uncons :: Typed.TypedTerm [x] -> Typed.TypedTerm (Maybe (x, [x]))+uncons xs =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.lists.uncons")),+ Model.applicationArgument = (Typed.unTypedTerm xs)}))++-- | DSL reference to hydra.core.lib.lists.zip+zip :: Typed.TypedTerm [x] -> Typed.TypedTerm [y] -> Typed.TypedTerm [(x, y)]+zip xs ys =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.lists.zip")),+ Model.applicationArgument = (Typed.unTypedTerm xs)})),+ Model.applicationArgument = (Typed.unTypedTerm ys)}))++-- | DSL reference to hydra.core.lib.lists.zipWith+zipWith :: Typed.TypedTerm (x -> y -> z) -> Typed.TypedTerm [x] -> Typed.TypedTerm [y] -> Typed.TypedTerm [z]+zipWith f xs ys =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.lists.zipWith")),+ Model.applicationArgument = (Typed.unTypedTerm f)})),+ Model.applicationArgument = (Typed.unTypedTerm xs)})),+ Model.applicationArgument = (Typed.unTypedTerm ys)}))
@@ -0,0 +1,457 @@+-- Note: this is an automatically generated file. Do not edit.++-- | DSL functions for hydra.core.lib.literals++module Hydra.Core.Dsl.Lib.Literals where++import qualified Hydra.Core.Ast as Ast+import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Diff as Diff+import qualified Hydra.Core.Docs as Docs+import qualified Hydra.Core.Dsl.Ast as DslAst+import qualified Hydra.Core.Dsl.Coders as DslCoders+import qualified Hydra.Core.Dsl.Diff as DslDiff+import qualified Hydra.Core.Dsl.Docs as DslDocs+import qualified Hydra.Core.Dsl.Error.Checking as ErrorChecking+import qualified Hydra.Core.Dsl.Error.File as DslErrorFile+import qualified Hydra.Core.Dsl.Error.Model as DslErrorModel+import qualified Hydra.Core.Dsl.Error.Packaging as DslErrorPackaging+import qualified Hydra.Core.Dsl.Error.System as DslErrorSystem+import qualified Hydra.Core.Dsl.Errors as DslErrors+import qualified Hydra.Core.Dsl.File as DslFile+import qualified Hydra.Core.Dsl.Graph as DslGraph+import qualified Hydra.Core.Dsl.Json.Model as DslJsonModel+import qualified Hydra.Core.Dsl.Markdown as DslMarkdown+import qualified Hydra.Core.Dsl.Model as DslModel+import qualified Hydra.Core.Dsl.Packaging as DslPackaging+import qualified Hydra.Core.Dsl.Parsing as DslParsing+import qualified Hydra.Core.Dsl.Paths as DslPaths+import qualified Hydra.Core.Dsl.Query as DslQuery+import qualified Hydra.Core.Dsl.Regex as DslRegex+import qualified Hydra.Core.Dsl.Relational as DslRelational+import qualified Hydra.Core.Dsl.System as DslSystem+import qualified Hydra.Core.Dsl.Tabular as DslTabular+import qualified Hydra.Core.Dsl.Testing as DslTesting+import qualified Hydra.Core.Dsl.Time as DslTime+import qualified Hydra.Core.Dsl.Topology as DslTopology+import qualified Hydra.Core.Dsl.Typing as DslTyping+import qualified Hydra.Core.Dsl.Util as DslUtil+import qualified Hydra.Core.Dsl.Validation as DslValidation+import qualified Hydra.Core.Dsl.Variants as DslVariants+import qualified Hydra.Core.Error.Checking as Checking+import qualified Hydra.Core.Error.File as ErrorFile+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Error.Packaging as ErrorPackaging+import qualified Hydra.Core.Error.System as ErrorSystem+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Json.Model as JsonModel+import qualified Hydra.Core.Markdown as Markdown+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Parsing as Parsing+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Query as Query+import qualified Hydra.Core.Regex as Regex+import qualified Hydra.Core.Relational as Relational+import qualified Hydra.Core.System as System+import qualified Hydra.Core.Tabular as Tabular+import qualified Hydra.Core.Testing as Testing+import qualified Hydra.Core.Time as Time+import qualified Hydra.Core.Topology as Topology+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Validation as Validation+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void+import qualified Data.ByteString as B+import qualified Data.Int as I++-- | DSL reference to hydra.core.lib.literals.base64ToBinary+base64ToBinary :: Typed.TypedTerm String -> Typed.TypedTerm B.ByteString+base64ToBinary s =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.literals.base64ToBinary")),+ Model.applicationArgument = (Typed.unTypedTerm s)}))++-- | DSL reference to hydra.core.lib.literals.bigintToDecimal+bigintToDecimal :: Typed.TypedTerm Integer -> Typed.TypedTerm Sci.Scientific+bigintToDecimal x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.literals.bigintToDecimal")),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL reference to hydra.core.lib.literals.bigintToInt16+bigintToInt16 :: Typed.TypedTerm Integer -> Typed.TypedTerm I.Int16+bigintToInt16 x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.literals.bigintToInt16")),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL reference to hydra.core.lib.literals.bigintToInt32+bigintToInt32 :: Typed.TypedTerm Integer -> Typed.TypedTerm Int+bigintToInt32 x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.literals.bigintToInt32")),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL reference to hydra.core.lib.literals.bigintToInt64+bigintToInt64 :: Typed.TypedTerm Integer -> Typed.TypedTerm I.Int64+bigintToInt64 x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.literals.bigintToInt64")),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL reference to hydra.core.lib.literals.bigintToInt8+bigintToInt8 :: Typed.TypedTerm Integer -> Typed.TypedTerm I.Int8+bigintToInt8 x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.literals.bigintToInt8")),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL reference to hydra.core.lib.literals.bigintToUint16+bigintToUint16 :: Typed.TypedTerm Integer -> Typed.TypedTerm Int+bigintToUint16 x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.literals.bigintToUint16")),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL reference to hydra.core.lib.literals.bigintToUint32+bigintToUint32 :: Typed.TypedTerm Integer -> Typed.TypedTerm I.Int64+bigintToUint32 x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.literals.bigintToUint32")),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL reference to hydra.core.lib.literals.bigintToUint64+bigintToUint64 :: Typed.TypedTerm Integer -> Typed.TypedTerm Integer+bigintToUint64 x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.literals.bigintToUint64")),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL reference to hydra.core.lib.literals.bigintToUint8+bigintToUint8 :: Typed.TypedTerm Integer -> Typed.TypedTerm I.Int16+bigintToUint8 x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.literals.bigintToUint8")),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL reference to hydra.core.lib.literals.binaryToBase64+binaryToBase64 :: Typed.TypedTerm B.ByteString -> Typed.TypedTerm String+binaryToBase64 b =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.literals.binaryToBase64")),+ Model.applicationArgument = (Typed.unTypedTerm b)}))++-- | DSL reference to hydra.core.lib.literals.binaryToBytes+binaryToBytes :: Typed.TypedTerm B.ByteString -> Typed.TypedTerm [Int]+binaryToBytes b =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.literals.binaryToBytes")),+ Model.applicationArgument = (Typed.unTypedTerm b)}))++-- | DSL reference to hydra.core.lib.literals.decimalToBigint+decimalToBigint :: Typed.TypedTerm Sci.Scientific -> Typed.TypedTerm Integer+decimalToBigint x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.literals.decimalToBigint")),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL reference to hydra.core.lib.literals.decimalToFloat32+decimalToFloat32 :: Typed.TypedTerm Sci.Scientific -> Typed.TypedTerm Float+decimalToFloat32 x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.literals.decimalToFloat32")),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL reference to hydra.core.lib.literals.decimalToFloat64+decimalToFloat64 :: Typed.TypedTerm Sci.Scientific -> Typed.TypedTerm Double+decimalToFloat64 x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.literals.decimalToFloat64")),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL reference to hydra.core.lib.literals.float32ToDecimal+float32ToDecimal :: Typed.TypedTerm Float -> Typed.TypedTerm Sci.Scientific+float32ToDecimal x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.literals.float32ToDecimal")),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL reference to hydra.core.lib.literals.float32ToFloat64+float32ToFloat64 :: Typed.TypedTerm Float -> Typed.TypedTerm Double+float32ToFloat64 x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.literals.float32ToFloat64")),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL reference to hydra.core.lib.literals.float64ToDecimal+float64ToDecimal :: Typed.TypedTerm Double -> Typed.TypedTerm Sci.Scientific+float64ToDecimal x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.literals.float64ToDecimal")),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL reference to hydra.core.lib.literals.float64ToFloat32+float64ToFloat32 :: Typed.TypedTerm Double -> Typed.TypedTerm Float+float64ToFloat32 x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.literals.float64ToFloat32")),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL reference to hydra.core.lib.literals.int16ToBigint+int16ToBigint :: Typed.TypedTerm I.Int16 -> Typed.TypedTerm Integer+int16ToBigint x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.literals.int16ToBigint")),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL reference to hydra.core.lib.literals.int32ToBigint+int32ToBigint :: Typed.TypedTerm Int -> Typed.TypedTerm Integer+int32ToBigint x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.literals.int32ToBigint")),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL reference to hydra.core.lib.literals.int64ToBigint+int64ToBigint :: Typed.TypedTerm I.Int64 -> Typed.TypedTerm Integer+int64ToBigint x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.literals.int64ToBigint")),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL reference to hydra.core.lib.literals.int8ToBigint+int8ToBigint :: Typed.TypedTerm I.Int8 -> Typed.TypedTerm Integer+int8ToBigint x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.literals.int8ToBigint")),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL reference to hydra.core.lib.literals.parseBigint+parseBigint :: Typed.TypedTerm String -> Typed.TypedTerm (Maybe Integer)+parseBigint s =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.literals.parseBigint")),+ Model.applicationArgument = (Typed.unTypedTerm s)}))++-- | DSL reference to hydra.core.lib.literals.parseBoolean+parseBoolean :: Typed.TypedTerm String -> Typed.TypedTerm (Maybe Bool)+parseBoolean s =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.literals.parseBoolean")),+ Model.applicationArgument = (Typed.unTypedTerm s)}))++-- | DSL reference to hydra.core.lib.literals.parseDecimal+parseDecimal :: Typed.TypedTerm String -> Typed.TypedTerm (Maybe Sci.Scientific)+parseDecimal s =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.literals.parseDecimal")),+ Model.applicationArgument = (Typed.unTypedTerm s)}))++-- | DSL reference to hydra.core.lib.literals.parseFloat32+parseFloat32 :: Typed.TypedTerm String -> Typed.TypedTerm (Maybe Float)+parseFloat32 s =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.literals.parseFloat32")),+ Model.applicationArgument = (Typed.unTypedTerm s)}))++-- | DSL reference to hydra.core.lib.literals.parseFloat64+parseFloat64 :: Typed.TypedTerm String -> Typed.TypedTerm (Maybe Double)+parseFloat64 s =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.literals.parseFloat64")),+ Model.applicationArgument = (Typed.unTypedTerm s)}))++-- | DSL reference to hydra.core.lib.literals.parseInt16+parseInt16 :: Typed.TypedTerm String -> Typed.TypedTerm (Maybe I.Int16)+parseInt16 s =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.literals.parseInt16")),+ Model.applicationArgument = (Typed.unTypedTerm s)}))++-- | DSL reference to hydra.core.lib.literals.parseInt32+parseInt32 :: Typed.TypedTerm String -> Typed.TypedTerm (Maybe Int)+parseInt32 s =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.literals.parseInt32")),+ Model.applicationArgument = (Typed.unTypedTerm s)}))++-- | DSL reference to hydra.core.lib.literals.parseInt64+parseInt64 :: Typed.TypedTerm String -> Typed.TypedTerm (Maybe I.Int64)+parseInt64 s =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.literals.parseInt64")),+ Model.applicationArgument = (Typed.unTypedTerm s)}))++-- | DSL reference to hydra.core.lib.literals.parseInt8+parseInt8 :: Typed.TypedTerm String -> Typed.TypedTerm (Maybe I.Int8)+parseInt8 s =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.literals.parseInt8")),+ Model.applicationArgument = (Typed.unTypedTerm s)}))++-- | DSL reference to hydra.core.lib.literals.parseString+parseString :: Typed.TypedTerm String -> Typed.TypedTerm (Maybe String)+parseString s =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.literals.parseString")),+ Model.applicationArgument = (Typed.unTypedTerm s)}))++-- | DSL reference to hydra.core.lib.literals.parseUint16+parseUint16 :: Typed.TypedTerm String -> Typed.TypedTerm (Maybe Int)+parseUint16 s =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.literals.parseUint16")),+ Model.applicationArgument = (Typed.unTypedTerm s)}))++-- | DSL reference to hydra.core.lib.literals.parseUint32+parseUint32 :: Typed.TypedTerm String -> Typed.TypedTerm (Maybe I.Int64)+parseUint32 s =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.literals.parseUint32")),+ Model.applicationArgument = (Typed.unTypedTerm s)}))++-- | DSL reference to hydra.core.lib.literals.parseUint64+parseUint64 :: Typed.TypedTerm String -> Typed.TypedTerm (Maybe Integer)+parseUint64 s =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.literals.parseUint64")),+ Model.applicationArgument = (Typed.unTypedTerm s)}))++-- | DSL reference to hydra.core.lib.literals.parseUint8+parseUint8 :: Typed.TypedTerm String -> Typed.TypedTerm (Maybe I.Int16)+parseUint8 s =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.literals.parseUint8")),+ Model.applicationArgument = (Typed.unTypedTerm s)}))++-- | DSL reference to hydra.core.lib.literals.printBigint+printBigint :: Typed.TypedTerm Integer -> Typed.TypedTerm String+printBigint x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.literals.printBigint")),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL reference to hydra.core.lib.literals.printBoolean+printBoolean :: Typed.TypedTerm Bool -> Typed.TypedTerm String+printBoolean b =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.literals.printBoolean")),+ Model.applicationArgument = (Typed.unTypedTerm b)}))++-- | DSL reference to hydra.core.lib.literals.printDecimal+printDecimal :: Typed.TypedTerm Sci.Scientific -> Typed.TypedTerm String+printDecimal x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.literals.printDecimal")),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL reference to hydra.core.lib.literals.printFloat32+printFloat32 :: Typed.TypedTerm Float -> Typed.TypedTerm String+printFloat32 x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.literals.printFloat32")),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL reference to hydra.core.lib.literals.printFloat64+printFloat64 :: Typed.TypedTerm Double -> Typed.TypedTerm String+printFloat64 x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.literals.printFloat64")),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL reference to hydra.core.lib.literals.printInt16+printInt16 :: Typed.TypedTerm I.Int16 -> Typed.TypedTerm String+printInt16 x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.literals.printInt16")),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL reference to hydra.core.lib.literals.printInt32+printInt32 :: Typed.TypedTerm Int -> Typed.TypedTerm String+printInt32 x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.literals.printInt32")),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL reference to hydra.core.lib.literals.printInt64+printInt64 :: Typed.TypedTerm I.Int64 -> Typed.TypedTerm String+printInt64 x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.literals.printInt64")),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL reference to hydra.core.lib.literals.printInt8+printInt8 :: Typed.TypedTerm I.Int8 -> Typed.TypedTerm String+printInt8 x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.literals.printInt8")),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL reference to hydra.core.lib.literals.printString+printString :: Typed.TypedTerm String -> Typed.TypedTerm String+printString s =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.literals.printString")),+ Model.applicationArgument = (Typed.unTypedTerm s)}))++-- | DSL reference to hydra.core.lib.literals.printUint16+printUint16 :: Typed.TypedTerm Int -> Typed.TypedTerm String+printUint16 x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.literals.printUint16")),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL reference to hydra.core.lib.literals.printUint32+printUint32 :: Typed.TypedTerm I.Int64 -> Typed.TypedTerm String+printUint32 x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.literals.printUint32")),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL reference to hydra.core.lib.literals.printUint64+printUint64 :: Typed.TypedTerm Integer -> Typed.TypedTerm String+printUint64 x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.literals.printUint64")),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL reference to hydra.core.lib.literals.printUint8+printUint8 :: Typed.TypedTerm I.Int16 -> Typed.TypedTerm String+printUint8 x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.literals.printUint8")),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL reference to hydra.core.lib.literals.uint16ToBigint+uint16ToBigint :: Typed.TypedTerm Int -> Typed.TypedTerm Integer+uint16ToBigint x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.literals.uint16ToBigint")),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL reference to hydra.core.lib.literals.uint32ToBigint+uint32ToBigint :: Typed.TypedTerm I.Int64 -> Typed.TypedTerm Integer+uint32ToBigint x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.literals.uint32ToBigint")),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL reference to hydra.core.lib.literals.uint64ToBigint+uint64ToBigint :: Typed.TypedTerm Integer -> Typed.TypedTerm Integer+uint64ToBigint x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.literals.uint64ToBigint")),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL reference to hydra.core.lib.literals.uint8ToBigint+uint8ToBigint :: Typed.TypedTerm I.Int16 -> Typed.TypedTerm Integer+uint8ToBigint x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.literals.uint8ToBigint")),+ Model.applicationArgument = (Typed.unTypedTerm x)}))
@@ -0,0 +1,106 @@+-- Note: this is an automatically generated file. Do not edit.++-- | DSL functions for hydra.core.lib.logic++module Hydra.Core.Dsl.Lib.Logic where++import qualified Hydra.Core.Ast as Ast+import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Diff as Diff+import qualified Hydra.Core.Docs as Docs+import qualified Hydra.Core.Dsl.Ast as DslAst+import qualified Hydra.Core.Dsl.Coders as DslCoders+import qualified Hydra.Core.Dsl.Diff as DslDiff+import qualified Hydra.Core.Dsl.Docs as DslDocs+import qualified Hydra.Core.Dsl.Error.Checking as ErrorChecking+import qualified Hydra.Core.Dsl.Error.File as DslErrorFile+import qualified Hydra.Core.Dsl.Error.Model as DslErrorModel+import qualified Hydra.Core.Dsl.Error.Packaging as DslErrorPackaging+import qualified Hydra.Core.Dsl.Error.System as DslErrorSystem+import qualified Hydra.Core.Dsl.Errors as DslErrors+import qualified Hydra.Core.Dsl.File as DslFile+import qualified Hydra.Core.Dsl.Graph as DslGraph+import qualified Hydra.Core.Dsl.Json.Model as DslJsonModel+import qualified Hydra.Core.Dsl.Markdown as DslMarkdown+import qualified Hydra.Core.Dsl.Model as DslModel+import qualified Hydra.Core.Dsl.Packaging as DslPackaging+import qualified Hydra.Core.Dsl.Parsing as DslParsing+import qualified Hydra.Core.Dsl.Paths as DslPaths+import qualified Hydra.Core.Dsl.Query as DslQuery+import qualified Hydra.Core.Dsl.Regex as DslRegex+import qualified Hydra.Core.Dsl.Relational as DslRelational+import qualified Hydra.Core.Dsl.System as DslSystem+import qualified Hydra.Core.Dsl.Tabular as DslTabular+import qualified Hydra.Core.Dsl.Testing as DslTesting+import qualified Hydra.Core.Dsl.Time as DslTime+import qualified Hydra.Core.Dsl.Topology as DslTopology+import qualified Hydra.Core.Dsl.Typing as DslTyping+import qualified Hydra.Core.Dsl.Util as DslUtil+import qualified Hydra.Core.Dsl.Validation as DslValidation+import qualified Hydra.Core.Dsl.Variants as DslVariants+import qualified Hydra.Core.Error.Checking as Checking+import qualified Hydra.Core.Error.File as ErrorFile+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Error.Packaging as ErrorPackaging+import qualified Hydra.Core.Error.System as ErrorSystem+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Json.Model as JsonModel+import qualified Hydra.Core.Markdown as Markdown+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Parsing as Parsing+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Query as Query+import qualified Hydra.Core.Regex as Regex+import qualified Hydra.Core.Relational as Relational+import qualified Hydra.Core.System as System+import qualified Hydra.Core.Tabular as Tabular+import qualified Hydra.Core.Testing as Testing+import qualified Hydra.Core.Time as Time+import qualified Hydra.Core.Topology as Topology+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Validation as Validation+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | DSL reference to hydra.core.lib.logic.and+and :: Typed.TypedTerm Bool -> Typed.TypedTerm Bool -> Typed.TypedTerm Bool+and p q =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.logic.and")),+ Model.applicationArgument = (Typed.unTypedTerm p)})),+ Model.applicationArgument = (Typed.unTypedTerm q)}))++-- | DSL reference to hydra.core.lib.logic.ifElse+ifElse :: Typed.TypedTerm Bool -> Typed.TypedTerm x -> Typed.TypedTerm x -> Typed.TypedTerm x+ifElse p t f =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.logic.ifElse")),+ Model.applicationArgument = (Typed.unTypedTerm p)})),+ Model.applicationArgument = (Typed.unTypedTerm t)})),+ Model.applicationArgument = (Typed.unTypedTerm f)}))++-- | DSL reference to hydra.core.lib.logic.not+not :: Typed.TypedTerm Bool -> Typed.TypedTerm Bool+not p =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.logic.not")),+ Model.applicationArgument = (Typed.unTypedTerm p)}))++-- | DSL reference to hydra.core.lib.logic.or+or :: Typed.TypedTerm Bool -> Typed.TypedTerm Bool -> Typed.TypedTerm Bool+or p q =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.logic.or")),+ Model.applicationArgument = (Typed.unTypedTerm p)})),+ Model.applicationArgument = (Typed.unTypedTerm q)}))
@@ -0,0 +1,267 @@+-- Note: this is an automatically generated file. Do not edit.++-- | DSL functions for hydra.core.lib.maps++module Hydra.Core.Dsl.Lib.Maps where++import qualified Hydra.Core.Ast as Ast+import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Diff as Diff+import qualified Hydra.Core.Docs as Docs+import qualified Hydra.Core.Dsl.Ast as DslAst+import qualified Hydra.Core.Dsl.Coders as DslCoders+import qualified Hydra.Core.Dsl.Diff as DslDiff+import qualified Hydra.Core.Dsl.Docs as DslDocs+import qualified Hydra.Core.Dsl.Error.Checking as ErrorChecking+import qualified Hydra.Core.Dsl.Error.File as DslErrorFile+import qualified Hydra.Core.Dsl.Error.Model as DslErrorModel+import qualified Hydra.Core.Dsl.Error.Packaging as DslErrorPackaging+import qualified Hydra.Core.Dsl.Error.System as DslErrorSystem+import qualified Hydra.Core.Dsl.Errors as DslErrors+import qualified Hydra.Core.Dsl.File as DslFile+import qualified Hydra.Core.Dsl.Graph as DslGraph+import qualified Hydra.Core.Dsl.Json.Model as DslJsonModel+import qualified Hydra.Core.Dsl.Markdown as DslMarkdown+import qualified Hydra.Core.Dsl.Model as DslModel+import qualified Hydra.Core.Dsl.Packaging as DslPackaging+import qualified Hydra.Core.Dsl.Parsing as DslParsing+import qualified Hydra.Core.Dsl.Paths as DslPaths+import qualified Hydra.Core.Dsl.Query as DslQuery+import qualified Hydra.Core.Dsl.Regex as DslRegex+import qualified Hydra.Core.Dsl.Relational as DslRelational+import qualified Hydra.Core.Dsl.System as DslSystem+import qualified Hydra.Core.Dsl.Tabular as DslTabular+import qualified Hydra.Core.Dsl.Testing as DslTesting+import qualified Hydra.Core.Dsl.Time as DslTime+import qualified Hydra.Core.Dsl.Topology as DslTopology+import qualified Hydra.Core.Dsl.Typing as DslTyping+import qualified Hydra.Core.Dsl.Util as DslUtil+import qualified Hydra.Core.Dsl.Validation as DslValidation+import qualified Hydra.Core.Dsl.Variants as DslVariants+import qualified Hydra.Core.Error.Checking as Checking+import qualified Hydra.Core.Error.File as ErrorFile+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Error.Packaging as ErrorPackaging+import qualified Hydra.Core.Error.System as ErrorSystem+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Json.Model as JsonModel+import qualified Hydra.Core.Markdown as Markdown+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Parsing as Parsing+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Query as Query+import qualified Hydra.Core.Regex as Regex+import qualified Hydra.Core.Relational as Relational+import qualified Hydra.Core.System as System+import qualified Hydra.Core.Tabular as Tabular+import qualified Hydra.Core.Testing as Testing+import qualified Hydra.Core.Time as Time+import qualified Hydra.Core.Topology as Topology+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Validation as Validation+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void+import qualified Data.Map as M++-- | DSL reference to hydra.core.lib.maps.alter+alter :: Typed.TypedTerm (Maybe v -> Maybe v) -> Typed.TypedTerm k -> Typed.TypedTerm (M.Map k v) -> Typed.TypedTerm (M.Map k v)+alter f k m =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.maps.alter")),+ Model.applicationArgument = (Typed.unTypedTerm f)})),+ Model.applicationArgument = (Typed.unTypedTerm k)})),+ Model.applicationArgument = (Typed.unTypedTerm m)}))++-- | DSL reference to hydra.core.lib.maps.bimap+bimap :: Typed.TypedTerm (k1 -> k2) -> Typed.TypedTerm (v1 -> v2) -> Typed.TypedTerm (M.Map k1 v1) -> Typed.TypedTerm (M.Map k2 v2)+bimap fk fv m =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.maps.bimap")),+ Model.applicationArgument = (Typed.unTypedTerm fk)})),+ Model.applicationArgument = (Typed.unTypedTerm fv)})),+ Model.applicationArgument = (Typed.unTypedTerm m)}))++-- | DSL reference to hydra.core.lib.maps.delete+delete :: Typed.TypedTerm k -> Typed.TypedTerm (M.Map k v) -> Typed.TypedTerm (M.Map k v)+delete k m =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.maps.delete")),+ Model.applicationArgument = (Typed.unTypedTerm k)})),+ Model.applicationArgument = (Typed.unTypedTerm m)}))++-- | DSL reference to hydra.core.lib.maps.difference+difference :: Typed.TypedTerm (M.Map k v) -> Typed.TypedTerm (M.Map k v) -> Typed.TypedTerm (M.Map k v)+difference m1 m2 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.maps.difference")),+ Model.applicationArgument = (Typed.unTypedTerm m1)})),+ Model.applicationArgument = (Typed.unTypedTerm m2)}))++-- | DSL reference to hydra.core.lib.maps.elems+elems :: Typed.TypedTerm (M.Map k v) -> Typed.TypedTerm [v]+elems m =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.maps.elems")),+ Model.applicationArgument = (Typed.unTypedTerm m)}))++-- | DSL reference to hydra.core.lib.maps.empty+empty :: Typed.TypedTerm (M.Map k v)+empty = Typed.TypedTerm (Model.TermVariable (Model.Name "hydra.core.lib.maps.empty"))++-- | DSL reference to hydra.core.lib.maps.filter+filter :: Typed.TypedTerm (v -> Bool) -> Typed.TypedTerm (M.Map k v) -> Typed.TypedTerm (M.Map k v)+filter p m =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.maps.filter")),+ Model.applicationArgument = (Typed.unTypedTerm p)})),+ Model.applicationArgument = (Typed.unTypedTerm m)}))++-- | DSL reference to hydra.core.lib.maps.filterWithKey+filterWithKey :: Typed.TypedTerm (k -> v -> Bool) -> Typed.TypedTerm (M.Map k v) -> Typed.TypedTerm (M.Map k v)+filterWithKey p m =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.maps.filterWithKey")),+ Model.applicationArgument = (Typed.unTypedTerm p)})),+ Model.applicationArgument = (Typed.unTypedTerm m)}))++-- | DSL reference to hydra.core.lib.maps.findWithDefault+findWithDefault :: Typed.TypedTerm v -> Typed.TypedTerm k -> Typed.TypedTerm (M.Map k v) -> Typed.TypedTerm v+findWithDefault def k m =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.maps.findWithDefault")),+ Model.applicationArgument = (Typed.unTypedTerm def)})),+ Model.applicationArgument = (Typed.unTypedTerm k)})),+ Model.applicationArgument = (Typed.unTypedTerm m)}))++-- | DSL reference to hydra.core.lib.maps.fromList+fromList :: Typed.TypedTerm [(k, v)] -> Typed.TypedTerm (M.Map k v)+fromList xs =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.maps.fromList")),+ Model.applicationArgument = (Typed.unTypedTerm xs)}))++-- | DSL reference to hydra.core.lib.maps.insert+insert :: Typed.TypedTerm k -> Typed.TypedTerm v -> Typed.TypedTerm (M.Map k v) -> Typed.TypedTerm (M.Map k v)+insert k v m =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.maps.insert")),+ Model.applicationArgument = (Typed.unTypedTerm k)})),+ Model.applicationArgument = (Typed.unTypedTerm v)})),+ Model.applicationArgument = (Typed.unTypedTerm m)}))++-- | DSL reference to hydra.core.lib.maps.intersection+intersection :: Typed.TypedTerm (M.Map k v) -> Typed.TypedTerm (M.Map k v) -> Typed.TypedTerm (M.Map k v)+intersection m1 m2 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.maps.intersection")),+ Model.applicationArgument = (Typed.unTypedTerm m1)})),+ Model.applicationArgument = (Typed.unTypedTerm m2)}))++-- | DSL reference to hydra.core.lib.maps.isEmpty+isEmpty :: Typed.TypedTerm (M.Map k v) -> Typed.TypedTerm Bool+isEmpty m =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.maps.isEmpty")),+ Model.applicationArgument = (Typed.unTypedTerm m)}))++-- | DSL reference to hydra.core.lib.maps.keys+keys :: Typed.TypedTerm (M.Map k v) -> Typed.TypedTerm [k]+keys m =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.maps.keys")),+ Model.applicationArgument = (Typed.unTypedTerm m)}))++-- | DSL reference to hydra.core.lib.maps.lookup+lookup :: Typed.TypedTerm k -> Typed.TypedTerm (M.Map k v) -> Typed.TypedTerm (Maybe v)+lookup k m =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.maps.lookup")),+ Model.applicationArgument = (Typed.unTypedTerm k)})),+ Model.applicationArgument = (Typed.unTypedTerm m)}))++-- | DSL reference to hydra.core.lib.maps.map+map :: Typed.TypedTerm (v1 -> v2) -> Typed.TypedTerm (M.Map k v1) -> Typed.TypedTerm (M.Map k v2)+map f m =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.maps.map")),+ Model.applicationArgument = (Typed.unTypedTerm f)})),+ Model.applicationArgument = (Typed.unTypedTerm m)}))++-- | DSL reference to hydra.core.lib.maps.mapKeys+mapKeys :: Typed.TypedTerm (k1 -> k2) -> Typed.TypedTerm (M.Map k1 v) -> Typed.TypedTerm (M.Map k2 v)+mapKeys f m =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.maps.mapKeys")),+ Model.applicationArgument = (Typed.unTypedTerm f)})),+ Model.applicationArgument = (Typed.unTypedTerm m)}))++-- | DSL reference to hydra.core.lib.maps.member+member :: Typed.TypedTerm k -> Typed.TypedTerm (M.Map k v) -> Typed.TypedTerm Bool+member k m =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.maps.member")),+ Model.applicationArgument = (Typed.unTypedTerm k)})),+ Model.applicationArgument = (Typed.unTypedTerm m)}))++-- | DSL reference to hydra.core.lib.maps.singleton+singleton :: Typed.TypedTerm k -> Typed.TypedTerm v -> Typed.TypedTerm (M.Map k v)+singleton k v =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.maps.singleton")),+ Model.applicationArgument = (Typed.unTypedTerm k)})),+ Model.applicationArgument = (Typed.unTypedTerm v)}))++-- | DSL reference to hydra.core.lib.maps.size+size :: Typed.TypedTerm (M.Map k v) -> Typed.TypedTerm Int+size m =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.maps.size")),+ Model.applicationArgument = (Typed.unTypedTerm m)}))++-- | DSL reference to hydra.core.lib.maps.toList+toList :: Typed.TypedTerm (M.Map k v) -> Typed.TypedTerm [(k, v)]+toList m =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.maps.toList")),+ Model.applicationArgument = (Typed.unTypedTerm m)}))++-- | DSL reference to hydra.core.lib.maps.union+union :: Typed.TypedTerm (M.Map k v) -> Typed.TypedTerm (M.Map k v) -> Typed.TypedTerm (M.Map k v)+union m1 m2 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.maps.union")),+ Model.applicationArgument = (Typed.unTypedTerm m1)})),+ Model.applicationArgument = (Typed.unTypedTerm m2)}))++-- | DSL reference to hydra.core.lib.maps.unions+unions :: Typed.TypedTerm [M.Map k v] -> Typed.TypedTerm (M.Map k v)+unions ms =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.maps.unions")),+ Model.applicationArgument = (Typed.unTypedTerm ms)}))
@@ -0,0 +1,397 @@+-- Note: this is an automatically generated file. Do not edit.++-- | DSL functions for hydra.core.lib.math++module Hydra.Core.Dsl.Lib.Math where++import qualified Hydra.Core.Ast as Ast+import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Diff as Diff+import qualified Hydra.Core.Docs as Docs+import qualified Hydra.Core.Dsl.Ast as DslAst+import qualified Hydra.Core.Dsl.Coders as DslCoders+import qualified Hydra.Core.Dsl.Diff as DslDiff+import qualified Hydra.Core.Dsl.Docs as DslDocs+import qualified Hydra.Core.Dsl.Error.Checking as ErrorChecking+import qualified Hydra.Core.Dsl.Error.File as DslErrorFile+import qualified Hydra.Core.Dsl.Error.Model as DslErrorModel+import qualified Hydra.Core.Dsl.Error.Packaging as DslErrorPackaging+import qualified Hydra.Core.Dsl.Error.System as DslErrorSystem+import qualified Hydra.Core.Dsl.Errors as DslErrors+import qualified Hydra.Core.Dsl.File as DslFile+import qualified Hydra.Core.Dsl.Graph as DslGraph+import qualified Hydra.Core.Dsl.Json.Model as DslJsonModel+import qualified Hydra.Core.Dsl.Markdown as DslMarkdown+import qualified Hydra.Core.Dsl.Model as DslModel+import qualified Hydra.Core.Dsl.Packaging as DslPackaging+import qualified Hydra.Core.Dsl.Parsing as DslParsing+import qualified Hydra.Core.Dsl.Paths as DslPaths+import qualified Hydra.Core.Dsl.Query as DslQuery+import qualified Hydra.Core.Dsl.Regex as DslRegex+import qualified Hydra.Core.Dsl.Relational as DslRelational+import qualified Hydra.Core.Dsl.System as DslSystem+import qualified Hydra.Core.Dsl.Tabular as DslTabular+import qualified Hydra.Core.Dsl.Testing as DslTesting+import qualified Hydra.Core.Dsl.Time as DslTime+import qualified Hydra.Core.Dsl.Topology as DslTopology+import qualified Hydra.Core.Dsl.Typing as DslTyping+import qualified Hydra.Core.Dsl.Util as DslUtil+import qualified Hydra.Core.Dsl.Validation as DslValidation+import qualified Hydra.Core.Dsl.Variants as DslVariants+import qualified Hydra.Core.Error.Checking as Checking+import qualified Hydra.Core.Error.File as ErrorFile+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Error.Packaging as ErrorPackaging+import qualified Hydra.Core.Error.System as ErrorSystem+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Json.Model as JsonModel+import qualified Hydra.Core.Markdown as Markdown+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Parsing as Parsing+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Query as Query+import qualified Hydra.Core.Regex as Regex+import qualified Hydra.Core.Relational as Relational+import qualified Hydra.Core.System as System+import qualified Hydra.Core.Tabular as Tabular+import qualified Hydra.Core.Testing as Testing+import qualified Hydra.Core.Time as Time+import qualified Hydra.Core.Topology as Topology+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Validation as Validation+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | DSL reference to hydra.core.lib.math.abs+abs :: Typed.TypedTerm x -> Typed.TypedTerm x+abs arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.math.abs")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.lib.math.acos+acos :: Typed.TypedTerm Double -> Typed.TypedTerm Double+acos x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.math.acos")),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL reference to hydra.core.lib.math.acosh+acosh :: Typed.TypedTerm Double -> Typed.TypedTerm Double+acosh x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.math.acosh")),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL reference to hydra.core.lib.math.add+add :: Typed.TypedTerm x -> Typed.TypedTerm x -> Typed.TypedTerm x+add arg0 arg1 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.math.add")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)}))++-- | DSL reference to hydra.core.lib.math.addFloat64+addFloat64 :: Typed.TypedTerm Double -> Typed.TypedTerm Double -> Typed.TypedTerm Double+addFloat64 x y =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.math.addFloat64")),+ Model.applicationArgument = (Typed.unTypedTerm x)})),+ Model.applicationArgument = (Typed.unTypedTerm y)}))++-- | DSL reference to hydra.core.lib.math.asin+asin :: Typed.TypedTerm Double -> Typed.TypedTerm Double+asin x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.math.asin")),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL reference to hydra.core.lib.math.asinh+asinh :: Typed.TypedTerm Double -> Typed.TypedTerm Double+asinh x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.math.asinh")),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL reference to hydra.core.lib.math.atan+atan :: Typed.TypedTerm Double -> Typed.TypedTerm Double+atan x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.math.atan")),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL reference to hydra.core.lib.math.atan2+atan2 :: Typed.TypedTerm Double -> Typed.TypedTerm Double -> Typed.TypedTerm Double+atan2 y x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.math.atan2")),+ Model.applicationArgument = (Typed.unTypedTerm y)})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL reference to hydra.core.lib.math.atanh+atanh :: Typed.TypedTerm Double -> Typed.TypedTerm Double+atanh x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.math.atanh")),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL reference to hydra.core.lib.math.ceiling+ceiling :: Typed.TypedTerm Double -> Typed.TypedTerm Double+ceiling x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.math.ceiling")),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL reference to hydra.core.lib.math.cos+cos :: Typed.TypedTerm Double -> Typed.TypedTerm Double+cos x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.math.cos")),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL reference to hydra.core.lib.math.cosh+cosh :: Typed.TypedTerm Double -> Typed.TypedTerm Double+cosh x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.math.cosh")),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL reference to hydra.core.lib.math.div+div :: Typed.TypedTerm x -> Typed.TypedTerm x -> Typed.TypedTerm (Maybe x)+div x y =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.math.div")),+ Model.applicationArgument = (Typed.unTypedTerm x)})),+ Model.applicationArgument = (Typed.unTypedTerm y)}))++-- | DSL reference to hydra.core.lib.math.divide+divide :: Typed.TypedTerm x -> Typed.TypedTerm x -> Typed.TypedTerm x+divide arg0 arg1 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.math.divide")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)}))++-- | DSL reference to hydra.core.lib.math.e+e :: Typed.TypedTerm Double+e = Typed.TypedTerm (Model.TermVariable (Model.Name "hydra.core.lib.math.e"))++-- | DSL reference to hydra.core.lib.math.even+even :: Typed.TypedTerm x -> Typed.TypedTerm Bool+even x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.math.even")),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL reference to hydra.core.lib.math.exp+exp :: Typed.TypedTerm Double -> Typed.TypedTerm Double+exp x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.math.exp")),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL reference to hydra.core.lib.math.floor+floor :: Typed.TypedTerm Double -> Typed.TypedTerm Double+floor x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.math.floor")),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL reference to hydra.core.lib.math.log+log :: Typed.TypedTerm Double -> Typed.TypedTerm Double+log x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.math.log")),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL reference to hydra.core.lib.math.logBase+logBase :: Typed.TypedTerm Double -> Typed.TypedTerm Double -> Typed.TypedTerm Double+logBase b x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.math.logBase")),+ Model.applicationArgument = (Typed.unTypedTerm b)})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL reference to hydra.core.lib.math.mod+mod :: Typed.TypedTerm x -> Typed.TypedTerm x -> Typed.TypedTerm (Maybe x)+mod x y =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.math.mod")),+ Model.applicationArgument = (Typed.unTypedTerm x)})),+ Model.applicationArgument = (Typed.unTypedTerm y)}))++-- | DSL reference to hydra.core.lib.math.mul+mul :: Typed.TypedTerm x -> Typed.TypedTerm x -> Typed.TypedTerm x+mul arg0 arg1 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.math.mul")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)}))++-- | DSL reference to hydra.core.lib.math.mulFloat64+mulFloat64 :: Typed.TypedTerm Double -> Typed.TypedTerm Double -> Typed.TypedTerm Double+mulFloat64 x y =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.math.mulFloat64")),+ Model.applicationArgument = (Typed.unTypedTerm x)})),+ Model.applicationArgument = (Typed.unTypedTerm y)}))++-- | DSL reference to hydra.core.lib.math.negate+negate :: Typed.TypedTerm x -> Typed.TypedTerm x+negate arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.math.negate")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.lib.math.negateFloat64+negateFloat64 :: Typed.TypedTerm Double -> Typed.TypedTerm Double+negateFloat64 x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.math.negateFloat64")),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL reference to hydra.core.lib.math.odd+odd :: Typed.TypedTerm x -> Typed.TypedTerm Bool+odd x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.math.odd")),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL reference to hydra.core.lib.math.pi+pi :: Typed.TypedTerm Double+pi = Typed.TypedTerm (Model.TermVariable (Model.Name "hydra.core.lib.math.pi"))++-- | DSL reference to hydra.core.lib.math.pow+pow :: Typed.TypedTerm Double -> Typed.TypedTerm Double -> Typed.TypedTerm Double+pow x y =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.math.pow")),+ Model.applicationArgument = (Typed.unTypedTerm x)})),+ Model.applicationArgument = (Typed.unTypedTerm y)}))++-- | DSL reference to hydra.core.lib.math.range+range :: Typed.TypedTerm Int -> Typed.TypedTerm Int -> Typed.TypedTerm [Int]+range a b =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.math.range")),+ Model.applicationArgument = (Typed.unTypedTerm a)})),+ Model.applicationArgument = (Typed.unTypedTerm b)}))++-- | DSL reference to hydra.core.lib.math.rem+rem :: Typed.TypedTerm x -> Typed.TypedTerm x -> Typed.TypedTerm (Maybe x)+rem x y =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.math.rem")),+ Model.applicationArgument = (Typed.unTypedTerm x)})),+ Model.applicationArgument = (Typed.unTypedTerm y)}))++-- | DSL reference to hydra.core.lib.math.round+round :: Typed.TypedTerm Double -> Typed.TypedTerm Double+round x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.math.round")),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL reference to hydra.core.lib.math.roundFloat32+roundFloat32 :: Typed.TypedTerm Int -> Typed.TypedTerm Float -> Typed.TypedTerm Float+roundFloat32 n x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.math.roundFloat32")),+ Model.applicationArgument = (Typed.unTypedTerm n)})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL reference to hydra.core.lib.math.roundFloat64+roundFloat64 :: Typed.TypedTerm Int -> Typed.TypedTerm Double -> Typed.TypedTerm Double+roundFloat64 n x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.math.roundFloat64")),+ Model.applicationArgument = (Typed.unTypedTerm n)})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL reference to hydra.core.lib.math.signum+signum :: Typed.TypedTerm x -> Typed.TypedTerm x+signum arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.math.signum")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.lib.math.sin+sin :: Typed.TypedTerm Double -> Typed.TypedTerm Double+sin x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.math.sin")),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL reference to hydra.core.lib.math.sinh+sinh :: Typed.TypedTerm Double -> Typed.TypedTerm Double+sinh x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.math.sinh")),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL reference to hydra.core.lib.math.sqrt+sqrt :: Typed.TypedTerm Double -> Typed.TypedTerm Double+sqrt x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.math.sqrt")),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL reference to hydra.core.lib.math.sub+sub :: Typed.TypedTerm x -> Typed.TypedTerm x -> Typed.TypedTerm x+sub arg0 arg1 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.math.sub")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)}))++-- | DSL reference to hydra.core.lib.math.subFloat64+subFloat64 :: Typed.TypedTerm Double -> Typed.TypedTerm Double -> Typed.TypedTerm Double+subFloat64 x y =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.math.subFloat64")),+ Model.applicationArgument = (Typed.unTypedTerm x)})),+ Model.applicationArgument = (Typed.unTypedTerm y)}))++-- | DSL reference to hydra.core.lib.math.tan+tan :: Typed.TypedTerm Double -> Typed.TypedTerm Double+tan x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.math.tan")),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL reference to hydra.core.lib.math.tanh+tanh :: Typed.TypedTerm Double -> Typed.TypedTerm Double+tanh x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.math.tanh")),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL reference to hydra.core.lib.math.truncate+truncate :: Typed.TypedTerm Double -> Typed.TypedTerm Double+truncate x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.math.truncate")),+ Model.applicationArgument = (Typed.unTypedTerm x)}))
@@ -0,0 +1,202 @@+-- Note: this is an automatically generated file. Do not edit.++-- | DSL functions for hydra.core.lib.optionals++module Hydra.Core.Dsl.Lib.Optionals where++import qualified Hydra.Core.Ast as Ast+import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Diff as Diff+import qualified Hydra.Core.Docs as Docs+import qualified Hydra.Core.Dsl.Ast as DslAst+import qualified Hydra.Core.Dsl.Coders as DslCoders+import qualified Hydra.Core.Dsl.Diff as DslDiff+import qualified Hydra.Core.Dsl.Docs as DslDocs+import qualified Hydra.Core.Dsl.Error.Checking as ErrorChecking+import qualified Hydra.Core.Dsl.Error.File as DslErrorFile+import qualified Hydra.Core.Dsl.Error.Model as DslErrorModel+import qualified Hydra.Core.Dsl.Error.Packaging as DslErrorPackaging+import qualified Hydra.Core.Dsl.Error.System as DslErrorSystem+import qualified Hydra.Core.Dsl.Errors as DslErrors+import qualified Hydra.Core.Dsl.File as DslFile+import qualified Hydra.Core.Dsl.Graph as DslGraph+import qualified Hydra.Core.Dsl.Json.Model as DslJsonModel+import qualified Hydra.Core.Dsl.Markdown as DslMarkdown+import qualified Hydra.Core.Dsl.Model as DslModel+import qualified Hydra.Core.Dsl.Packaging as DslPackaging+import qualified Hydra.Core.Dsl.Parsing as DslParsing+import qualified Hydra.Core.Dsl.Paths as DslPaths+import qualified Hydra.Core.Dsl.Query as DslQuery+import qualified Hydra.Core.Dsl.Regex as DslRegex+import qualified Hydra.Core.Dsl.Relational as DslRelational+import qualified Hydra.Core.Dsl.System as DslSystem+import qualified Hydra.Core.Dsl.Tabular as DslTabular+import qualified Hydra.Core.Dsl.Testing as DslTesting+import qualified Hydra.Core.Dsl.Time as DslTime+import qualified Hydra.Core.Dsl.Topology as DslTopology+import qualified Hydra.Core.Dsl.Typing as DslTyping+import qualified Hydra.Core.Dsl.Util as DslUtil+import qualified Hydra.Core.Dsl.Validation as DslValidation+import qualified Hydra.Core.Dsl.Variants as DslVariants+import qualified Hydra.Core.Error.Checking as Checking+import qualified Hydra.Core.Error.File as ErrorFile+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Error.Packaging as ErrorPackaging+import qualified Hydra.Core.Error.System as ErrorSystem+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Json.Model as JsonModel+import qualified Hydra.Core.Markdown as Markdown+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Parsing as Parsing+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Query as Query+import qualified Hydra.Core.Regex as Regex+import qualified Hydra.Core.Relational as Relational+import qualified Hydra.Core.System as System+import qualified Hydra.Core.Tabular as Tabular+import qualified Hydra.Core.Testing as Testing+import qualified Hydra.Core.Time as Time+import qualified Hydra.Core.Topology as Topology+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Validation as Validation+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void+import qualified Data.Set as S++-- | DSL reference to hydra.core.lib.optionals.apply+apply :: Typed.TypedTerm (Maybe (x -> y)) -> Typed.TypedTerm (Maybe x) -> Typed.TypedTerm (Maybe y)+apply mf mx =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.optionals.apply")),+ Model.applicationArgument = (Typed.unTypedTerm mf)})),+ Model.applicationArgument = (Typed.unTypedTerm mx)}))++-- | DSL reference to hydra.core.lib.optionals.bind+bind :: Typed.TypedTerm (Maybe x) -> Typed.TypedTerm (x -> Maybe y) -> Typed.TypedTerm (Maybe y)+bind m f =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.optionals.bind")),+ Model.applicationArgument = (Typed.unTypedTerm m)})),+ Model.applicationArgument = (Typed.unTypedTerm f)}))++-- | DSL reference to hydra.core.lib.optionals.compose+compose :: Typed.TypedTerm (x -> Maybe y) -> Typed.TypedTerm (y -> Maybe z) -> Typed.TypedTerm x -> Typed.TypedTerm (Maybe z)+compose f g x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.optionals.compose")),+ Model.applicationArgument = (Typed.unTypedTerm f)})),+ Model.applicationArgument = (Typed.unTypedTerm g)})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL reference to hydra.core.lib.optionals.foldList+foldList :: Typed.TypedTerm (x -> y -> Maybe x) -> Typed.TypedTerm x -> Typed.TypedTerm [y] -> Typed.TypedTerm (Maybe x)+foldList f acc xs =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.optionals.foldList")),+ Model.applicationArgument = (Typed.unTypedTerm f)})),+ Model.applicationArgument = (Typed.unTypedTerm acc)})),+ Model.applicationArgument = (Typed.unTypedTerm xs)}))++-- | DSL reference to hydra.core.lib.optionals.given+given :: Typed.TypedTerm x -> Typed.TypedTerm (Maybe x)+given x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.optionals.given")),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL reference to hydra.core.lib.optionals.givens+givens :: Typed.TypedTerm [Maybe x] -> Typed.TypedTerm [x]+givens xs =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.optionals.givens")),+ Model.applicationArgument = (Typed.unTypedTerm xs)}))++-- | DSL reference to hydra.core.lib.optionals.isGiven+isGiven :: Typed.TypedTerm (Maybe x) -> Typed.TypedTerm Bool+isGiven m =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.optionals.isGiven")),+ Model.applicationArgument = (Typed.unTypedTerm m)}))++-- | DSL reference to hydra.core.lib.optionals.isNone+isNone :: Typed.TypedTerm (Maybe x) -> Typed.TypedTerm Bool+isNone m =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.optionals.isNone")),+ Model.applicationArgument = (Typed.unTypedTerm m)}))++-- | DSL reference to hydra.core.lib.optionals.map+map :: Typed.TypedTerm (x -> y) -> Typed.TypedTerm (Maybe x) -> Typed.TypedTerm (Maybe y)+map f m =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.optionals.map")),+ Model.applicationArgument = (Typed.unTypedTerm f)})),+ Model.applicationArgument = (Typed.unTypedTerm m)}))++-- | DSL reference to hydra.core.lib.optionals.mapList+mapList :: Typed.TypedTerm (x -> Maybe y) -> Typed.TypedTerm [x] -> Typed.TypedTerm (Maybe [y])+mapList f xs =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.optionals.mapList")),+ Model.applicationArgument = (Typed.unTypedTerm f)})),+ Model.applicationArgument = (Typed.unTypedTerm xs)}))++-- | DSL reference to hydra.core.lib.optionals.mapOptional+mapOptional :: Typed.TypedTerm (x -> Maybe y) -> Typed.TypedTerm [x] -> Typed.TypedTerm [y]+mapOptional f xs =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.optionals.mapOptional")),+ Model.applicationArgument = (Typed.unTypedTerm f)})),+ Model.applicationArgument = (Typed.unTypedTerm xs)}))++-- | DSL reference to hydra.core.lib.optionals.mapSet+mapSet :: Typed.TypedTerm (x -> Maybe y) -> Typed.TypedTerm (S.Set x) -> Typed.TypedTerm (Maybe (S.Set y))+mapSet f s =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.optionals.mapSet")),+ Model.applicationArgument = (Typed.unTypedTerm f)})),+ Model.applicationArgument = (Typed.unTypedTerm s)}))++-- | DSL reference to hydra.core.lib.optionals.match+match :: Typed.TypedTerm (Maybe x) -> Typed.TypedTerm y -> Typed.TypedTerm (x -> y) -> Typed.TypedTerm y+match m def f =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.optionals.match")),+ Model.applicationArgument = (Typed.unTypedTerm m)})),+ Model.applicationArgument = (Typed.unTypedTerm def)})),+ Model.applicationArgument = (Typed.unTypedTerm f)}))++-- | DSL reference to hydra.core.lib.optionals.toList+toList :: Typed.TypedTerm (Maybe x) -> Typed.TypedTerm [x]+toList m =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.optionals.toList")),+ Model.applicationArgument = (Typed.unTypedTerm m)}))++-- | DSL reference to hydra.core.lib.optionals.withDefault+withDefault :: Typed.TypedTerm x -> Typed.TypedTerm (Maybe x) -> Typed.TypedTerm x+withDefault def m =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.optionals.withDefault")),+ Model.applicationArgument = (Typed.unTypedTerm def)})),+ Model.applicationArgument = (Typed.unTypedTerm m)}))
@@ -0,0 +1,133 @@+-- Note: this is an automatically generated file. Do not edit.++-- | DSL functions for hydra.core.lib.ordering++module Hydra.Core.Dsl.Lib.Ordering where++import qualified Hydra.Core.Ast as Ast+import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Diff as Diff+import qualified Hydra.Core.Docs as Docs+import qualified Hydra.Core.Dsl.Ast as DslAst+import qualified Hydra.Core.Dsl.Coders as DslCoders+import qualified Hydra.Core.Dsl.Diff as DslDiff+import qualified Hydra.Core.Dsl.Docs as DslDocs+import qualified Hydra.Core.Dsl.Error.Checking as ErrorChecking+import qualified Hydra.Core.Dsl.Error.File as DslErrorFile+import qualified Hydra.Core.Dsl.Error.Model as DslErrorModel+import qualified Hydra.Core.Dsl.Error.Packaging as DslErrorPackaging+import qualified Hydra.Core.Dsl.Error.System as DslErrorSystem+import qualified Hydra.Core.Dsl.Errors as DslErrors+import qualified Hydra.Core.Dsl.File as DslFile+import qualified Hydra.Core.Dsl.Graph as DslGraph+import qualified Hydra.Core.Dsl.Json.Model as DslJsonModel+import qualified Hydra.Core.Dsl.Markdown as DslMarkdown+import qualified Hydra.Core.Dsl.Model as DslModel+import qualified Hydra.Core.Dsl.Packaging as DslPackaging+import qualified Hydra.Core.Dsl.Parsing as DslParsing+import qualified Hydra.Core.Dsl.Paths as DslPaths+import qualified Hydra.Core.Dsl.Query as DslQuery+import qualified Hydra.Core.Dsl.Regex as DslRegex+import qualified Hydra.Core.Dsl.Relational as DslRelational+import qualified Hydra.Core.Dsl.System as DslSystem+import qualified Hydra.Core.Dsl.Tabular as DslTabular+import qualified Hydra.Core.Dsl.Testing as DslTesting+import qualified Hydra.Core.Dsl.Time as DslTime+import qualified Hydra.Core.Dsl.Topology as DslTopology+import qualified Hydra.Core.Dsl.Typing as DslTyping+import qualified Hydra.Core.Dsl.Util as DslUtil+import qualified Hydra.Core.Dsl.Validation as DslValidation+import qualified Hydra.Core.Dsl.Variants as DslVariants+import qualified Hydra.Core.Error.Checking as Checking+import qualified Hydra.Core.Error.File as ErrorFile+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Error.Packaging as ErrorPackaging+import qualified Hydra.Core.Error.System as ErrorSystem+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Json.Model as JsonModel+import qualified Hydra.Core.Markdown as Markdown+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Parsing as Parsing+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Query as Query+import qualified Hydra.Core.Regex as Regex+import qualified Hydra.Core.Relational as Relational+import qualified Hydra.Core.System as System+import qualified Hydra.Core.Tabular as Tabular+import qualified Hydra.Core.Testing as Testing+import qualified Hydra.Core.Time as Time+import qualified Hydra.Core.Topology as Topology+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Validation as Validation+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | DSL reference to hydra.core.lib.ordering.compare+compare :: Typed.TypedTerm x -> Typed.TypedTerm x -> Typed.TypedTerm Util.Comparison+compare x y =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.ordering.compare")),+ Model.applicationArgument = (Typed.unTypedTerm x)})),+ Model.applicationArgument = (Typed.unTypedTerm y)}))++-- | DSL reference to hydra.core.lib.ordering.gt+gt :: Typed.TypedTerm x -> Typed.TypedTerm x -> Typed.TypedTerm Bool+gt x y =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.ordering.gt")),+ Model.applicationArgument = (Typed.unTypedTerm x)})),+ Model.applicationArgument = (Typed.unTypedTerm y)}))++-- | DSL reference to hydra.core.lib.ordering.gte+gte :: Typed.TypedTerm x -> Typed.TypedTerm x -> Typed.TypedTerm Bool+gte x y =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.ordering.gte")),+ Model.applicationArgument = (Typed.unTypedTerm x)})),+ Model.applicationArgument = (Typed.unTypedTerm y)}))++-- | DSL reference to hydra.core.lib.ordering.lt+lt :: Typed.TypedTerm x -> Typed.TypedTerm x -> Typed.TypedTerm Bool+lt x y =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.ordering.lt")),+ Model.applicationArgument = (Typed.unTypedTerm x)})),+ Model.applicationArgument = (Typed.unTypedTerm y)}))++-- | DSL reference to hydra.core.lib.ordering.lte+lte :: Typed.TypedTerm x -> Typed.TypedTerm x -> Typed.TypedTerm Bool+lte x y =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.ordering.lte")),+ Model.applicationArgument = (Typed.unTypedTerm x)})),+ Model.applicationArgument = (Typed.unTypedTerm y)}))++-- | DSL reference to hydra.core.lib.ordering.max+max :: Typed.TypedTerm x -> Typed.TypedTerm x -> Typed.TypedTerm x+max x y =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.ordering.max")),+ Model.applicationArgument = (Typed.unTypedTerm x)})),+ Model.applicationArgument = (Typed.unTypedTerm y)}))++-- | DSL reference to hydra.core.lib.ordering.min+min :: Typed.TypedTerm x -> Typed.TypedTerm x -> Typed.TypedTerm x+min x y =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.ordering.min")),+ Model.applicationArgument = (Typed.unTypedTerm x)})),+ Model.applicationArgument = (Typed.unTypedTerm y)}))
@@ -0,0 +1,104 @@+-- Note: this is an automatically generated file. Do not edit.++-- | DSL functions for hydra.core.lib.pairs++module Hydra.Core.Dsl.Lib.Pairs where++import qualified Hydra.Core.Ast as Ast+import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Diff as Diff+import qualified Hydra.Core.Docs as Docs+import qualified Hydra.Core.Dsl.Ast as DslAst+import qualified Hydra.Core.Dsl.Coders as DslCoders+import qualified Hydra.Core.Dsl.Diff as DslDiff+import qualified Hydra.Core.Dsl.Docs as DslDocs+import qualified Hydra.Core.Dsl.Error.Checking as ErrorChecking+import qualified Hydra.Core.Dsl.Error.File as DslErrorFile+import qualified Hydra.Core.Dsl.Error.Model as DslErrorModel+import qualified Hydra.Core.Dsl.Error.Packaging as DslErrorPackaging+import qualified Hydra.Core.Dsl.Error.System as DslErrorSystem+import qualified Hydra.Core.Dsl.Errors as DslErrors+import qualified Hydra.Core.Dsl.File as DslFile+import qualified Hydra.Core.Dsl.Graph as DslGraph+import qualified Hydra.Core.Dsl.Json.Model as DslJsonModel+import qualified Hydra.Core.Dsl.Markdown as DslMarkdown+import qualified Hydra.Core.Dsl.Model as DslModel+import qualified Hydra.Core.Dsl.Packaging as DslPackaging+import qualified Hydra.Core.Dsl.Parsing as DslParsing+import qualified Hydra.Core.Dsl.Paths as DslPaths+import qualified Hydra.Core.Dsl.Query as DslQuery+import qualified Hydra.Core.Dsl.Regex as DslRegex+import qualified Hydra.Core.Dsl.Relational as DslRelational+import qualified Hydra.Core.Dsl.System as DslSystem+import qualified Hydra.Core.Dsl.Tabular as DslTabular+import qualified Hydra.Core.Dsl.Testing as DslTesting+import qualified Hydra.Core.Dsl.Time as DslTime+import qualified Hydra.Core.Dsl.Topology as DslTopology+import qualified Hydra.Core.Dsl.Typing as DslTyping+import qualified Hydra.Core.Dsl.Util as DslUtil+import qualified Hydra.Core.Dsl.Validation as DslValidation+import qualified Hydra.Core.Dsl.Variants as DslVariants+import qualified Hydra.Core.Error.Checking as Checking+import qualified Hydra.Core.Error.File as ErrorFile+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Error.Packaging as ErrorPackaging+import qualified Hydra.Core.Error.System as ErrorSystem+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Json.Model as JsonModel+import qualified Hydra.Core.Markdown as Markdown+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Parsing as Parsing+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Query as Query+import qualified Hydra.Core.Regex as Regex+import qualified Hydra.Core.Relational as Relational+import qualified Hydra.Core.System as System+import qualified Hydra.Core.Tabular as Tabular+import qualified Hydra.Core.Testing as Testing+import qualified Hydra.Core.Time as Time+import qualified Hydra.Core.Topology as Topology+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Validation as Validation+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | DSL reference to hydra.core.lib.pairs.bimap+bimap :: Typed.TypedTerm (a -> c) -> Typed.TypedTerm (b -> d) -> Typed.TypedTerm (a, b) -> Typed.TypedTerm (c, d)+bimap f g p =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.pairs.bimap")),+ Model.applicationArgument = (Typed.unTypedTerm f)})),+ Model.applicationArgument = (Typed.unTypedTerm g)})),+ Model.applicationArgument = (Typed.unTypedTerm p)}))++-- | DSL reference to hydra.core.lib.pairs.first+first :: Typed.TypedTerm (a, b) -> Typed.TypedTerm a+first p =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.pairs.first")),+ Model.applicationArgument = (Typed.unTypedTerm p)}))++-- | DSL reference to hydra.core.lib.pairs.pair+pair :: Typed.TypedTerm a -> Typed.TypedTerm b -> Typed.TypedTerm (a, b)+pair x y =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.pairs.pair")),+ Model.applicationArgument = (Typed.unTypedTerm x)})),+ Model.applicationArgument = (Typed.unTypedTerm y)}))++-- | DSL reference to hydra.core.lib.pairs.second+second :: Typed.TypedTerm (a, b) -> Typed.TypedTerm b+second p =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.pairs.second")),+ Model.applicationArgument = (Typed.unTypedTerm p)}))
@@ -0,0 +1,128 @@+-- Note: this is an automatically generated file. Do not edit.++-- | DSL functions for hydra.core.lib.regex++module Hydra.Core.Dsl.Lib.Regex where++import qualified Hydra.Core.Ast as Ast+import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Diff as Diff+import qualified Hydra.Core.Docs as Docs+import qualified Hydra.Core.Dsl.Ast as DslAst+import qualified Hydra.Core.Dsl.Coders as DslCoders+import qualified Hydra.Core.Dsl.Diff as DslDiff+import qualified Hydra.Core.Dsl.Docs as DslDocs+import qualified Hydra.Core.Dsl.Error.Checking as ErrorChecking+import qualified Hydra.Core.Dsl.Error.File as DslErrorFile+import qualified Hydra.Core.Dsl.Error.Model as DslErrorModel+import qualified Hydra.Core.Dsl.Error.Packaging as DslErrorPackaging+import qualified Hydra.Core.Dsl.Error.System as DslErrorSystem+import qualified Hydra.Core.Dsl.Errors as DslErrors+import qualified Hydra.Core.Dsl.File as DslFile+import qualified Hydra.Core.Dsl.Graph as DslGraph+import qualified Hydra.Core.Dsl.Json.Model as DslJsonModel+import qualified Hydra.Core.Dsl.Markdown as DslMarkdown+import qualified Hydra.Core.Dsl.Model as DslModel+import qualified Hydra.Core.Dsl.Packaging as DslPackaging+import qualified Hydra.Core.Dsl.Parsing as DslParsing+import qualified Hydra.Core.Dsl.Paths as DslPaths+import qualified Hydra.Core.Dsl.Query as DslQuery+import qualified Hydra.Core.Dsl.Regex as DslRegex+import qualified Hydra.Core.Dsl.Relational as DslRelational+import qualified Hydra.Core.Dsl.System as DslSystem+import qualified Hydra.Core.Dsl.Tabular as DslTabular+import qualified Hydra.Core.Dsl.Testing as DslTesting+import qualified Hydra.Core.Dsl.Time as DslTime+import qualified Hydra.Core.Dsl.Topology as DslTopology+import qualified Hydra.Core.Dsl.Typing as DslTyping+import qualified Hydra.Core.Dsl.Util as DslUtil+import qualified Hydra.Core.Dsl.Validation as DslValidation+import qualified Hydra.Core.Dsl.Variants as DslVariants+import qualified Hydra.Core.Error.Checking as Checking+import qualified Hydra.Core.Error.File as ErrorFile+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Error.Packaging as ErrorPackaging+import qualified Hydra.Core.Error.System as ErrorSystem+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Json.Model as JsonModel+import qualified Hydra.Core.Markdown as Markdown+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Parsing as Parsing+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Query as Query+import qualified Hydra.Core.Regex as Regex+import qualified Hydra.Core.Relational as Relational+import qualified Hydra.Core.System as System+import qualified Hydra.Core.Tabular as Tabular+import qualified Hydra.Core.Testing as Testing+import qualified Hydra.Core.Time as Time+import qualified Hydra.Core.Topology as Topology+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Validation as Validation+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | DSL reference to hydra.core.lib.regex.find+find :: Typed.TypedTerm String -> Typed.TypedTerm String -> Typed.TypedTerm (Maybe String)+find pat s =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.regex.find")),+ Model.applicationArgument = (Typed.unTypedTerm pat)})),+ Model.applicationArgument = (Typed.unTypedTerm s)}))++-- | DSL reference to hydra.core.lib.regex.findAll+findAll :: Typed.TypedTerm String -> Typed.TypedTerm String -> Typed.TypedTerm [String]+findAll pat s =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.regex.findAll")),+ Model.applicationArgument = (Typed.unTypedTerm pat)})),+ Model.applicationArgument = (Typed.unTypedTerm s)}))++-- | DSL reference to hydra.core.lib.regex.matches+matches :: Typed.TypedTerm String -> Typed.TypedTerm String -> Typed.TypedTerm Bool+matches pat s =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.regex.matches")),+ Model.applicationArgument = (Typed.unTypedTerm pat)})),+ Model.applicationArgument = (Typed.unTypedTerm s)}))++-- | DSL reference to hydra.core.lib.regex.replace+replace :: Typed.TypedTerm String -> Typed.TypedTerm String -> Typed.TypedTerm String -> Typed.TypedTerm String+replace pat repl s =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.regex.replace")),+ Model.applicationArgument = (Typed.unTypedTerm pat)})),+ Model.applicationArgument = (Typed.unTypedTerm repl)})),+ Model.applicationArgument = (Typed.unTypedTerm s)}))++-- | DSL reference to hydra.core.lib.regex.replaceAll+replaceAll :: Typed.TypedTerm String -> Typed.TypedTerm String -> Typed.TypedTerm String -> Typed.TypedTerm String+replaceAll pat repl s =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.regex.replaceAll")),+ Model.applicationArgument = (Typed.unTypedTerm pat)})),+ Model.applicationArgument = (Typed.unTypedTerm repl)})),+ Model.applicationArgument = (Typed.unTypedTerm s)}))++-- | DSL reference to hydra.core.lib.regex.split+split :: Typed.TypedTerm String -> Typed.TypedTerm String -> Typed.TypedTerm [String]+split pat s =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.regex.split")),+ Model.applicationArgument = (Typed.unTypedTerm pat)})),+ Model.applicationArgument = (Typed.unTypedTerm s)}))
@@ -0,0 +1,189 @@+-- Note: this is an automatically generated file. Do not edit.++-- | DSL functions for hydra.core.lib.sets++module Hydra.Core.Dsl.Lib.Sets where++import qualified Hydra.Core.Ast as Ast+import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Diff as Diff+import qualified Hydra.Core.Docs as Docs+import qualified Hydra.Core.Dsl.Ast as DslAst+import qualified Hydra.Core.Dsl.Coders as DslCoders+import qualified Hydra.Core.Dsl.Diff as DslDiff+import qualified Hydra.Core.Dsl.Docs as DslDocs+import qualified Hydra.Core.Dsl.Error.Checking as ErrorChecking+import qualified Hydra.Core.Dsl.Error.File as DslErrorFile+import qualified Hydra.Core.Dsl.Error.Model as DslErrorModel+import qualified Hydra.Core.Dsl.Error.Packaging as DslErrorPackaging+import qualified Hydra.Core.Dsl.Error.System as DslErrorSystem+import qualified Hydra.Core.Dsl.Errors as DslErrors+import qualified Hydra.Core.Dsl.File as DslFile+import qualified Hydra.Core.Dsl.Graph as DslGraph+import qualified Hydra.Core.Dsl.Json.Model as DslJsonModel+import qualified Hydra.Core.Dsl.Markdown as DslMarkdown+import qualified Hydra.Core.Dsl.Model as DslModel+import qualified Hydra.Core.Dsl.Packaging as DslPackaging+import qualified Hydra.Core.Dsl.Parsing as DslParsing+import qualified Hydra.Core.Dsl.Paths as DslPaths+import qualified Hydra.Core.Dsl.Query as DslQuery+import qualified Hydra.Core.Dsl.Regex as DslRegex+import qualified Hydra.Core.Dsl.Relational as DslRelational+import qualified Hydra.Core.Dsl.System as DslSystem+import qualified Hydra.Core.Dsl.Tabular as DslTabular+import qualified Hydra.Core.Dsl.Testing as DslTesting+import qualified Hydra.Core.Dsl.Time as DslTime+import qualified Hydra.Core.Dsl.Topology as DslTopology+import qualified Hydra.Core.Dsl.Typing as DslTyping+import qualified Hydra.Core.Dsl.Util as DslUtil+import qualified Hydra.Core.Dsl.Validation as DslValidation+import qualified Hydra.Core.Dsl.Variants as DslVariants+import qualified Hydra.Core.Error.Checking as Checking+import qualified Hydra.Core.Error.File as ErrorFile+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Error.Packaging as ErrorPackaging+import qualified Hydra.Core.Error.System as ErrorSystem+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Json.Model as JsonModel+import qualified Hydra.Core.Markdown as Markdown+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Parsing as Parsing+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Query as Query+import qualified Hydra.Core.Regex as Regex+import qualified Hydra.Core.Relational as Relational+import qualified Hydra.Core.System as System+import qualified Hydra.Core.Tabular as Tabular+import qualified Hydra.Core.Testing as Testing+import qualified Hydra.Core.Time as Time+import qualified Hydra.Core.Topology as Topology+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Validation as Validation+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void+import qualified Data.Set as S++-- | DSL reference to hydra.core.lib.sets.delete+delete :: Typed.TypedTerm x -> Typed.TypedTerm (S.Set x) -> Typed.TypedTerm (S.Set x)+delete x s =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.sets.delete")),+ Model.applicationArgument = (Typed.unTypedTerm x)})),+ Model.applicationArgument = (Typed.unTypedTerm s)}))++-- | DSL reference to hydra.core.lib.sets.difference+difference :: Typed.TypedTerm (S.Set x) -> Typed.TypedTerm (S.Set x) -> Typed.TypedTerm (S.Set x)+difference s1 s2 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.sets.difference")),+ Model.applicationArgument = (Typed.unTypedTerm s1)})),+ Model.applicationArgument = (Typed.unTypedTerm s2)}))++-- | DSL reference to hydra.core.lib.sets.empty+empty :: Typed.TypedTerm (S.Set x)+empty = Typed.TypedTerm (Model.TermVariable (Model.Name "hydra.core.lib.sets.empty"))++-- | DSL reference to hydra.core.lib.sets.filter+filter :: Typed.TypedTerm (x -> Bool) -> Typed.TypedTerm (S.Set x) -> Typed.TypedTerm (S.Set x)+filter predicate s =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.sets.filter")),+ Model.applicationArgument = (Typed.unTypedTerm predicate)})),+ Model.applicationArgument = (Typed.unTypedTerm s)}))++-- | DSL reference to hydra.core.lib.sets.fromList+fromList :: Typed.TypedTerm [x] -> Typed.TypedTerm (S.Set x)+fromList xs =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.sets.fromList")),+ Model.applicationArgument = (Typed.unTypedTerm xs)}))++-- | DSL reference to hydra.core.lib.sets.insert+insert :: Typed.TypedTerm x -> Typed.TypedTerm (S.Set x) -> Typed.TypedTerm (S.Set x)+insert x s =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.sets.insert")),+ Model.applicationArgument = (Typed.unTypedTerm x)})),+ Model.applicationArgument = (Typed.unTypedTerm s)}))++-- | DSL reference to hydra.core.lib.sets.intersection+intersection :: Typed.TypedTerm (S.Set x) -> Typed.TypedTerm (S.Set x) -> Typed.TypedTerm (S.Set x)+intersection s1 s2 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.sets.intersection")),+ Model.applicationArgument = (Typed.unTypedTerm s1)})),+ Model.applicationArgument = (Typed.unTypedTerm s2)}))++-- | DSL reference to hydra.core.lib.sets.isEmpty+isEmpty :: Typed.TypedTerm (S.Set x) -> Typed.TypedTerm Bool+isEmpty s =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.sets.isEmpty")),+ Model.applicationArgument = (Typed.unTypedTerm s)}))++-- | DSL reference to hydra.core.lib.sets.map+map :: Typed.TypedTerm (x -> y) -> Typed.TypedTerm (S.Set x) -> Typed.TypedTerm (S.Set y)+map f s =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.sets.map")),+ Model.applicationArgument = (Typed.unTypedTerm f)})),+ Model.applicationArgument = (Typed.unTypedTerm s)}))++-- | DSL reference to hydra.core.lib.sets.member+member :: Typed.TypedTerm x -> Typed.TypedTerm (S.Set x) -> Typed.TypedTerm Bool+member x s =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.sets.member")),+ Model.applicationArgument = (Typed.unTypedTerm x)})),+ Model.applicationArgument = (Typed.unTypedTerm s)}))++-- | DSL reference to hydra.core.lib.sets.singleton+singleton :: Typed.TypedTerm x -> Typed.TypedTerm (S.Set x)+singleton x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.sets.singleton")),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL reference to hydra.core.lib.sets.size+size :: Typed.TypedTerm (S.Set x) -> Typed.TypedTerm Int+size s =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.sets.size")),+ Model.applicationArgument = (Typed.unTypedTerm s)}))++-- | DSL reference to hydra.core.lib.sets.toList+toList :: Typed.TypedTerm (S.Set x) -> Typed.TypedTerm [x]+toList s =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.sets.toList")),+ Model.applicationArgument = (Typed.unTypedTerm s)}))++-- | DSL reference to hydra.core.lib.sets.union+union :: Typed.TypedTerm (S.Set x) -> Typed.TypedTerm (S.Set x) -> Typed.TypedTerm (S.Set x)+union s1 s2 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.sets.union")),+ Model.applicationArgument = (Typed.unTypedTerm s1)})),+ Model.applicationArgument = (Typed.unTypedTerm s2)}))++-- | DSL reference to hydra.core.lib.sets.unions+unions :: Typed.TypedTerm [S.Set x] -> Typed.TypedTerm (S.Set x)+unions ss =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.sets.unions")),+ Model.applicationArgument = (Typed.unTypedTerm ss)}))
@@ -0,0 +1,155 @@+-- Note: this is an automatically generated file. Do not edit.++-- | DSL functions for hydra.core.lib.strings++module Hydra.Core.Dsl.Lib.Strings where++import qualified Hydra.Core.Ast as Ast+import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Diff as Diff+import qualified Hydra.Core.Docs as Docs+import qualified Hydra.Core.Dsl.Ast as DslAst+import qualified Hydra.Core.Dsl.Coders as DslCoders+import qualified Hydra.Core.Dsl.Diff as DslDiff+import qualified Hydra.Core.Dsl.Docs as DslDocs+import qualified Hydra.Core.Dsl.Error.Checking as ErrorChecking+import qualified Hydra.Core.Dsl.Error.File as DslErrorFile+import qualified Hydra.Core.Dsl.Error.Model as DslErrorModel+import qualified Hydra.Core.Dsl.Error.Packaging as DslErrorPackaging+import qualified Hydra.Core.Dsl.Error.System as DslErrorSystem+import qualified Hydra.Core.Dsl.Errors as DslErrors+import qualified Hydra.Core.Dsl.File as DslFile+import qualified Hydra.Core.Dsl.Graph as DslGraph+import qualified Hydra.Core.Dsl.Json.Model as DslJsonModel+import qualified Hydra.Core.Dsl.Markdown as DslMarkdown+import qualified Hydra.Core.Dsl.Model as DslModel+import qualified Hydra.Core.Dsl.Packaging as DslPackaging+import qualified Hydra.Core.Dsl.Parsing as DslParsing+import qualified Hydra.Core.Dsl.Paths as DslPaths+import qualified Hydra.Core.Dsl.Query as DslQuery+import qualified Hydra.Core.Dsl.Regex as DslRegex+import qualified Hydra.Core.Dsl.Relational as DslRelational+import qualified Hydra.Core.Dsl.System as DslSystem+import qualified Hydra.Core.Dsl.Tabular as DslTabular+import qualified Hydra.Core.Dsl.Testing as DslTesting+import qualified Hydra.Core.Dsl.Time as DslTime+import qualified Hydra.Core.Dsl.Topology as DslTopology+import qualified Hydra.Core.Dsl.Typing as DslTyping+import qualified Hydra.Core.Dsl.Util as DslUtil+import qualified Hydra.Core.Dsl.Validation as DslValidation+import qualified Hydra.Core.Dsl.Variants as DslVariants+import qualified Hydra.Core.Error.Checking as Checking+import qualified Hydra.Core.Error.File as ErrorFile+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Error.Packaging as ErrorPackaging+import qualified Hydra.Core.Error.System as ErrorSystem+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Json.Model as JsonModel+import qualified Hydra.Core.Markdown as Markdown+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Parsing as Parsing+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Query as Query+import qualified Hydra.Core.Regex as Regex+import qualified Hydra.Core.Relational as Relational+import qualified Hydra.Core.System as System+import qualified Hydra.Core.Tabular as Tabular+import qualified Hydra.Core.Testing as Testing+import qualified Hydra.Core.Time as Time+import qualified Hydra.Core.Topology as Topology+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Validation as Validation+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | DSL reference to hydra.core.lib.strings.charAt+charAt :: Typed.TypedTerm Int -> Typed.TypedTerm String -> Typed.TypedTerm (Maybe Int)+charAt i s =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.strings.charAt")),+ Model.applicationArgument = (Typed.unTypedTerm i)})),+ Model.applicationArgument = (Typed.unTypedTerm s)}))++-- | DSL reference to hydra.core.lib.strings.concat+concat :: Typed.TypedTerm [String] -> Typed.TypedTerm String+concat xs =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.strings.concat")),+ Model.applicationArgument = (Typed.unTypedTerm xs)}))++-- | DSL reference to hydra.core.lib.strings.concat2+concat2 :: Typed.TypedTerm String -> Typed.TypedTerm String -> Typed.TypedTerm String+concat2 s t =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.strings.concat2")),+ Model.applicationArgument = (Typed.unTypedTerm s)})),+ Model.applicationArgument = (Typed.unTypedTerm t)}))++-- | DSL reference to hydra.core.lib.strings.fromList+fromList :: Typed.TypedTerm [Int] -> Typed.TypedTerm String+fromList cs =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.strings.fromList")),+ Model.applicationArgument = (Typed.unTypedTerm cs)}))++-- | DSL reference to hydra.core.lib.strings.isEmpty+isEmpty :: Typed.TypedTerm String -> Typed.TypedTerm Bool+isEmpty s =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.strings.isEmpty")),+ Model.applicationArgument = (Typed.unTypedTerm s)}))++-- | DSL reference to hydra.core.lib.strings.join+join :: Typed.TypedTerm String -> Typed.TypedTerm [String] -> Typed.TypedTerm String+join sep xs =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.strings.join")),+ Model.applicationArgument = (Typed.unTypedTerm sep)})),+ Model.applicationArgument = (Typed.unTypedTerm xs)}))++-- | DSL reference to hydra.core.lib.strings.length+length :: Typed.TypedTerm String -> Typed.TypedTerm Int+length s =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.strings.length")),+ Model.applicationArgument = (Typed.unTypedTerm s)}))++-- | DSL reference to hydra.core.lib.strings.splitOn+splitOn :: Typed.TypedTerm String -> Typed.TypedTerm String -> Typed.TypedTerm [String]+splitOn sep s =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.strings.splitOn")),+ Model.applicationArgument = (Typed.unTypedTerm sep)})),+ Model.applicationArgument = (Typed.unTypedTerm s)}))++-- | DSL reference to hydra.core.lib.strings.toList+toList :: Typed.TypedTerm String -> Typed.TypedTerm [Int]+toList s =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.strings.toList")),+ Model.applicationArgument = (Typed.unTypedTerm s)}))++-- | DSL reference to hydra.core.lib.strings.toLower+toLower :: Typed.TypedTerm String -> Typed.TypedTerm String+toLower s =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.strings.toLower")),+ Model.applicationArgument = (Typed.unTypedTerm s)}))++-- | DSL reference to hydra.core.lib.strings.toUpper+toUpper :: Typed.TypedTerm String -> Typed.TypedTerm String+toUpper s =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.strings.toUpper")),+ Model.applicationArgument = (Typed.unTypedTerm s)}))
@@ -0,0 +1,123 @@+-- Note: this is an automatically generated file. Do not edit.++-- | DSL functions for hydra.core.lib.system++module Hydra.Core.Dsl.Lib.System where++import qualified Hydra.Core.Ast as Ast+import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Diff as Diff+import qualified Hydra.Core.Docs as Docs+import qualified Hydra.Core.Dsl.Ast as DslAst+import qualified Hydra.Core.Dsl.Coders as DslCoders+import qualified Hydra.Core.Dsl.Diff as DslDiff+import qualified Hydra.Core.Dsl.Docs as DslDocs+import qualified Hydra.Core.Dsl.Error.Checking as ErrorChecking+import qualified Hydra.Core.Dsl.Error.File as DslErrorFile+import qualified Hydra.Core.Dsl.Error.Model as DslErrorModel+import qualified Hydra.Core.Dsl.Error.Packaging as DslErrorPackaging+import qualified Hydra.Core.Dsl.Error.System as DslErrorSystem+import qualified Hydra.Core.Dsl.Errors as DslErrors+import qualified Hydra.Core.Dsl.File as DslFile+import qualified Hydra.Core.Dsl.Graph as DslGraph+import qualified Hydra.Core.Dsl.Json.Model as DslJsonModel+import qualified Hydra.Core.Dsl.Markdown as DslMarkdown+import qualified Hydra.Core.Dsl.Model as DslModel+import qualified Hydra.Core.Dsl.Packaging as DslPackaging+import qualified Hydra.Core.Dsl.Parsing as DslParsing+import qualified Hydra.Core.Dsl.Paths as DslPaths+import qualified Hydra.Core.Dsl.Query as DslQuery+import qualified Hydra.Core.Dsl.Regex as DslRegex+import qualified Hydra.Core.Dsl.Relational as DslRelational+import qualified Hydra.Core.Dsl.System as DslSystem+import qualified Hydra.Core.Dsl.Tabular as DslTabular+import qualified Hydra.Core.Dsl.Testing as DslTesting+import qualified Hydra.Core.Dsl.Time as DslTime+import qualified Hydra.Core.Dsl.Topology as DslTopology+import qualified Hydra.Core.Dsl.Typing as DslTyping+import qualified Hydra.Core.Dsl.Util as DslUtil+import qualified Hydra.Core.Dsl.Validation as DslValidation+import qualified Hydra.Core.Dsl.Variants as DslVariants+import qualified Hydra.Core.Error.Checking as Checking+import qualified Hydra.Core.Error.File as ErrorFile+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Error.Packaging as ErrorPackaging+import qualified Hydra.Core.Error.System as ErrorSystem+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Json.Model as JsonModel+import qualified Hydra.Core.Markdown as Markdown+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Parsing as Parsing+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Query as Query+import qualified Hydra.Core.Regex as Regex+import qualified Hydra.Core.Relational as Relational+import qualified Hydra.Core.System as System+import qualified Hydra.Core.Tabular as Tabular+import qualified Hydra.Core.Testing as Testing+import qualified Hydra.Core.Time as Time+import qualified Hydra.Core.Topology as Topology+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Validation as Validation+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void+import qualified Data.ByteString as B+import qualified Data.Map as M++-- | DSL reference to hydra.core.lib.system.execute+execute :: Typed.TypedTerm System.Command -> Typed.TypedTerm (IO (Either ErrorSystem.SystemError System.ProcessResult))+execute command =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.system.execute")),+ Model.applicationArgument = (Typed.unTypedTerm command)}))++-- | DSL reference to hydra.core.lib.system.exit+exit :: Typed.TypedTerm System.StatusCode -> Typed.TypedTerm (IO ())+exit code =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.system.exit")),+ Model.applicationArgument = (Typed.unTypedTerm code)}))++-- | DSL reference to hydra.core.lib.system.getEnvironment+getEnvironment :: Typed.TypedTerm (IO (M.Map System.EnvironmentVariable String))+getEnvironment = Typed.TypedTerm (Model.TermVariable (Model.Name "hydra.core.lib.system.getEnvironment"))++-- | DSL reference to hydra.core.lib.system.getEnvironmentVariable+getEnvironmentVariable :: Typed.TypedTerm System.EnvironmentVariable -> Typed.TypedTerm (IO (Maybe String))+getEnvironmentVariable name =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.system.getEnvironmentVariable")),+ Model.applicationArgument = (Typed.unTypedTerm name)}))++-- | DSL reference to hydra.core.lib.system.getTime+getTime :: Typed.TypedTerm (IO Time.Timespec)+getTime = Typed.TypedTerm (Model.TermVariable (Model.Name "hydra.core.lib.system.getTime"))++-- | DSL reference to hydra.core.lib.system.getWorkingDirectory+getWorkingDirectory :: Typed.TypedTerm (IO (Either ErrorSystem.SystemError File.FilePath))+getWorkingDirectory = Typed.TypedTerm (Model.TermVariable (Model.Name "hydra.core.lib.system.getWorkingDirectory"))++-- | DSL reference to hydra.core.lib.system.readStdin+readStdin :: Typed.TypedTerm (IO (Either ErrorSystem.SystemError B.ByteString))+readStdin = Typed.TypedTerm (Model.TermVariable (Model.Name "hydra.core.lib.system.readStdin"))++-- | DSL reference to hydra.core.lib.system.writeStderr+writeStderr :: Typed.TypedTerm B.ByteString -> Typed.TypedTerm (IO (Either ErrorSystem.SystemError ()))+writeStderr bytes =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.system.writeStderr")),+ Model.applicationArgument = (Typed.unTypedTerm bytes)}))++-- | DSL reference to hydra.core.lib.system.writeStdout+writeStdout :: Typed.TypedTerm B.ByteString -> Typed.TypedTerm (IO (Either ErrorSystem.SystemError ()))+writeStdout bytes =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.system.writeStdout")),+ Model.applicationArgument = (Typed.unTypedTerm bytes)}))
@@ -0,0 +1,85 @@+-- Note: this is an automatically generated file. Do not edit.++-- | DSL functions for hydra.core.lib.text++module Hydra.Core.Dsl.Lib.Text where++import qualified Hydra.Core.Ast as Ast+import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Diff as Diff+import qualified Hydra.Core.Docs as Docs+import qualified Hydra.Core.Dsl.Ast as DslAst+import qualified Hydra.Core.Dsl.Coders as DslCoders+import qualified Hydra.Core.Dsl.Diff as DslDiff+import qualified Hydra.Core.Dsl.Docs as DslDocs+import qualified Hydra.Core.Dsl.Error.Checking as ErrorChecking+import qualified Hydra.Core.Dsl.Error.File as DslErrorFile+import qualified Hydra.Core.Dsl.Error.Model as DslErrorModel+import qualified Hydra.Core.Dsl.Error.Packaging as DslErrorPackaging+import qualified Hydra.Core.Dsl.Error.System as DslErrorSystem+import qualified Hydra.Core.Dsl.Errors as DslErrors+import qualified Hydra.Core.Dsl.File as DslFile+import qualified Hydra.Core.Dsl.Graph as DslGraph+import qualified Hydra.Core.Dsl.Json.Model as DslJsonModel+import qualified Hydra.Core.Dsl.Markdown as DslMarkdown+import qualified Hydra.Core.Dsl.Model as DslModel+import qualified Hydra.Core.Dsl.Packaging as DslPackaging+import qualified Hydra.Core.Dsl.Parsing as DslParsing+import qualified Hydra.Core.Dsl.Paths as DslPaths+import qualified Hydra.Core.Dsl.Query as DslQuery+import qualified Hydra.Core.Dsl.Regex as DslRegex+import qualified Hydra.Core.Dsl.Relational as DslRelational+import qualified Hydra.Core.Dsl.System as DslSystem+import qualified Hydra.Core.Dsl.Tabular as DslTabular+import qualified Hydra.Core.Dsl.Testing as DslTesting+import qualified Hydra.Core.Dsl.Time as DslTime+import qualified Hydra.Core.Dsl.Topology as DslTopology+import qualified Hydra.Core.Dsl.Typing as DslTyping+import qualified Hydra.Core.Dsl.Util as DslUtil+import qualified Hydra.Core.Dsl.Validation as DslValidation+import qualified Hydra.Core.Dsl.Variants as DslVariants+import qualified Hydra.Core.Error.Checking as Checking+import qualified Hydra.Core.Error.File as ErrorFile+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Error.Packaging as ErrorPackaging+import qualified Hydra.Core.Error.System as ErrorSystem+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Json.Model as JsonModel+import qualified Hydra.Core.Markdown as Markdown+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Parsing as Parsing+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Query as Query+import qualified Hydra.Core.Regex as Regex+import qualified Hydra.Core.Relational as Relational+import qualified Hydra.Core.System as System+import qualified Hydra.Core.Tabular as Tabular+import qualified Hydra.Core.Testing as Testing+import qualified Hydra.Core.Time as Time+import qualified Hydra.Core.Topology as Topology+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Validation as Validation+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void+import qualified Data.ByteString as B++-- | DSL reference to hydra.core.lib.text.decodeUtf8+decodeUtf8 :: Typed.TypedTerm B.ByteString -> Typed.TypedTerm (Either String String)+decodeUtf8 bytes =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.text.decodeUtf8")),+ Model.applicationArgument = (Typed.unTypedTerm bytes)}))++-- | DSL reference to hydra.core.lib.text.encodeUtf8+encodeUtf8 :: Typed.TypedTerm String -> Typed.TypedTerm B.ByteString+encodeUtf8 text =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.text.encodeUtf8")),+ Model.applicationArgument = (Typed.unTypedTerm text)}))
@@ -0,0 +1,827 @@+-- Note: this is an automatically generated file. Do not edit.++-- | DSL functions for hydra.core.markdown++module Hydra.Core.Dsl.Markdown where++import qualified Hydra.Core.Decode.Markdown as DecodeMarkdown+import qualified Hydra.Core.Encode.Markdown as EncodeMarkdown+import qualified Hydra.Core.Markdown as Markdown+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Typed as Typed+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | DSL name token for hydra.core.markdown.Block+blockBlock :: Typed.TypedName Markdown.Block+blockBlock = Typed.TypedName (Model.Name "hydra.core.markdown.Block")++-- | DSL injection for the codeBlock variant of hydra.core.markdown.Block+blockCodeBlock :: Typed.TypedTerm Markdown.CodeBlock -> Typed.TypedTerm Markdown.Block+blockCodeBlock x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.markdown.Block"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "codeBlock"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the list variant of hydra.core.markdown.Block+blockList :: Typed.TypedTerm Markdown.List -> Typed.TypedTerm Markdown.Block+blockList x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.markdown.Block"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "list"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the paragraph variant of hydra.core.markdown.Block+blockParagraph :: Typed.TypedTerm Markdown.Paragraph -> Typed.TypedTerm Markdown.Block+blockParagraph x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.markdown.Block"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "paragraph"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the raw variant of hydra.core.markdown.Block+blockRaw :: Typed.TypedTerm String -> Typed.TypedTerm Markdown.Block+blockRaw x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.markdown.Block"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "raw"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the section variant of hydra.core.markdown.Block+blockSection :: Typed.TypedTerm Markdown.Section -> Typed.TypedTerm Markdown.Block+blockSection x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.markdown.Block"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "section"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the table variant of hydra.core.markdown.Block+blockTable :: Typed.TypedTerm Markdown.Table -> Typed.TypedTerm Markdown.Block+blockTable x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.markdown.Block"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "table"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL constructor for hydra.core.markdown.CodeBlock+codeBlock :: Typed.TypedTerm (Maybe String) -> Typed.TypedTerm String -> Typed.TypedTerm Markdown.CodeBlock+codeBlock language content =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.markdown.CodeBlock"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "language"),+ Model.fieldTerm = (Typed.unTypedTerm language)},+ Model.Field {+ Model.fieldName = (Model.Name "content"),+ Model.fieldTerm = (Typed.unTypedTerm content)}]}))++-- | DSL name token for hydra.core.markdown.CodeBlock+codeBlockCodeBlock :: Typed.TypedName Markdown.CodeBlock+codeBlockCodeBlock = Typed.TypedName (Model.Name "hydra.core.markdown.CodeBlock")++-- | DSL accessor for the content field of hydra.core.markdown.CodeBlock+codeBlockContent :: Typed.TypedTerm Markdown.CodeBlock -> Typed.TypedTerm String+codeBlockContent x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.markdown.CodeBlock"),+ Model.projectionFieldName = (Model.Name "content")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the language field of hydra.core.markdown.CodeBlock+codeBlockLanguage :: Typed.TypedTerm Markdown.CodeBlock -> Typed.TypedTerm (Maybe String)+codeBlockLanguage x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.markdown.CodeBlock"),+ Model.projectionFieldName = (Model.Name "language")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL updater for the content field of hydra.core.markdown.CodeBlock+codeBlockWithContent :: Typed.TypedTerm Markdown.CodeBlock -> Typed.TypedTerm String -> Typed.TypedTerm Markdown.CodeBlock+codeBlockWithContent original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.markdown.CodeBlock"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "language"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.markdown.CodeBlock"),+ Model.projectionFieldName = (Model.Name "language")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "content"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL updater for the language field of hydra.core.markdown.CodeBlock+codeBlockWithLanguage :: Typed.TypedTerm Markdown.CodeBlock -> Typed.TypedTerm (Maybe String) -> Typed.TypedTerm Markdown.CodeBlock+codeBlockWithLanguage original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.markdown.CodeBlock"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "language"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "content"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.markdown.CodeBlock"),+ Model.projectionFieldName = (Model.Name "content")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL constructor for hydra.core.markdown.Document+document :: Typed.TypedTerm String -> Typed.TypedTerm [Markdown.Block] -> Typed.TypedTerm Markdown.Document+document title content =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.markdown.Document"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "title"),+ Model.fieldTerm = (Typed.unTypedTerm title)},+ Model.Field {+ Model.fieldName = (Model.Name "content"),+ Model.fieldTerm = (Typed.unTypedTerm content)}]}))++-- | DSL accessor for the content field of hydra.core.markdown.Document+documentContent :: Typed.TypedTerm Markdown.Document -> Typed.TypedTerm [Markdown.Block]+documentContent x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.markdown.Document"),+ Model.projectionFieldName = (Model.Name "content")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.markdown.Document+documentDocument :: Typed.TypedName Markdown.Document+documentDocument = Typed.TypedName (Model.Name "hydra.core.markdown.Document")++-- | DSL accessor for the title field of hydra.core.markdown.Document+documentTitle :: Typed.TypedTerm Markdown.Document -> Typed.TypedTerm String+documentTitle x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.markdown.Document"),+ Model.projectionFieldName = (Model.Name "title")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL updater for the content field of hydra.core.markdown.Document+documentWithContent :: Typed.TypedTerm Markdown.Document -> Typed.TypedTerm [Markdown.Block] -> Typed.TypedTerm Markdown.Document+documentWithContent original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.markdown.Document"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "title"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.markdown.Document"),+ Model.projectionFieldName = (Model.Name "title")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "content"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL updater for the title field of hydra.core.markdown.Document+documentWithTitle :: Typed.TypedTerm Markdown.Document -> Typed.TypedTerm String -> Typed.TypedTerm Markdown.Document+documentWithTitle original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.markdown.Document"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "title"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "content"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.markdown.Document"),+ Model.projectionFieldName = (Model.Name "content")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL constructor for hydra.core.markdown.Heading+heading :: Typed.TypedTerm Int -> Typed.TypedTerm [Markdown.Inline] -> Typed.TypedTerm (Maybe String) -> Typed.TypedTerm Markdown.Heading+heading level content anchor =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.markdown.Heading"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "level"),+ Model.fieldTerm = (Typed.unTypedTerm level)},+ Model.Field {+ Model.fieldName = (Model.Name "content"),+ Model.fieldTerm = (Typed.unTypedTerm content)},+ Model.Field {+ Model.fieldName = (Model.Name "anchor"),+ Model.fieldTerm = (Typed.unTypedTerm anchor)}]}))++-- | DSL accessor for the anchor field of hydra.core.markdown.Heading+headingAnchor :: Typed.TypedTerm Markdown.Heading -> Typed.TypedTerm (Maybe String)+headingAnchor x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.markdown.Heading"),+ Model.projectionFieldName = (Model.Name "anchor")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the content field of hydra.core.markdown.Heading+headingContent :: Typed.TypedTerm Markdown.Heading -> Typed.TypedTerm [Markdown.Inline]+headingContent x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.markdown.Heading"),+ Model.projectionFieldName = (Model.Name "content")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.markdown.Heading+headingHeading :: Typed.TypedName Markdown.Heading+headingHeading = Typed.TypedName (Model.Name "hydra.core.markdown.Heading")++-- | DSL accessor for the level field of hydra.core.markdown.Heading+headingLevel :: Typed.TypedTerm Markdown.Heading -> Typed.TypedTerm Int+headingLevel x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.markdown.Heading"),+ Model.projectionFieldName = (Model.Name "level")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL updater for the anchor field of hydra.core.markdown.Heading+headingWithAnchor :: Typed.TypedTerm Markdown.Heading -> Typed.TypedTerm (Maybe String) -> Typed.TypedTerm Markdown.Heading+headingWithAnchor original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.markdown.Heading"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "level"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.markdown.Heading"),+ Model.projectionFieldName = (Model.Name "level")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "content"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.markdown.Heading"),+ Model.projectionFieldName = (Model.Name "content")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "anchor"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL updater for the content field of hydra.core.markdown.Heading+headingWithContent :: Typed.TypedTerm Markdown.Heading -> Typed.TypedTerm [Markdown.Inline] -> Typed.TypedTerm Markdown.Heading+headingWithContent original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.markdown.Heading"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "level"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.markdown.Heading"),+ Model.projectionFieldName = (Model.Name "level")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "content"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "anchor"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.markdown.Heading"),+ Model.projectionFieldName = (Model.Name "anchor")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the level field of hydra.core.markdown.Heading+headingWithLevel :: Typed.TypedTerm Markdown.Heading -> Typed.TypedTerm Int -> Typed.TypedTerm Markdown.Heading+headingWithLevel original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.markdown.Heading"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "level"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "content"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.markdown.Heading"),+ Model.projectionFieldName = (Model.Name "content")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "anchor"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.markdown.Heading"),+ Model.projectionFieldName = (Model.Name "anchor")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL injection for the code variant of hydra.core.markdown.Inline+inlineCode :: Typed.TypedTerm String -> Typed.TypedTerm Markdown.Inline+inlineCode x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.markdown.Inline"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "code"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the emphasis variant of hydra.core.markdown.Inline+inlineEmphasis :: Typed.TypedTerm [Markdown.Inline] -> Typed.TypedTerm Markdown.Inline+inlineEmphasis x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.markdown.Inline"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "emphasis"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL name token for hydra.core.markdown.Inline+inlineInline :: Typed.TypedName Markdown.Inline+inlineInline = Typed.TypedName (Model.Name "hydra.core.markdown.Inline")++-- | DSL injection for the link variant of hydra.core.markdown.Inline+inlineLink :: Typed.TypedTerm Markdown.Link -> Typed.TypedTerm Markdown.Inline+inlineLink x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.markdown.Inline"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "link"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the strong variant of hydra.core.markdown.Inline+inlineStrong :: Typed.TypedTerm [Markdown.Inline] -> Typed.TypedTerm Markdown.Inline+inlineStrong x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.markdown.Inline"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "strong"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the text variant of hydra.core.markdown.Inline+inlineText :: Typed.TypedTerm String -> Typed.TypedTerm Markdown.Inline+inlineText x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.markdown.Inline"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "text"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL constructor for hydra.core.markdown.Link+link :: Typed.TypedTerm [Markdown.Inline] -> Typed.TypedTerm String -> Typed.TypedTerm Markdown.Link+link text target =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.markdown.Link"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "text"),+ Model.fieldTerm = (Typed.unTypedTerm text)},+ Model.Field {+ Model.fieldName = (Model.Name "target"),+ Model.fieldTerm = (Typed.unTypedTerm target)}]}))++-- | DSL name token for hydra.core.markdown.Link+linkLink :: Typed.TypedName Markdown.Link+linkLink = Typed.TypedName (Model.Name "hydra.core.markdown.Link")++-- | DSL accessor for the target field of hydra.core.markdown.Link+linkTarget :: Typed.TypedTerm Markdown.Link -> Typed.TypedTerm String+linkTarget x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.markdown.Link"),+ Model.projectionFieldName = (Model.Name "target")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the text field of hydra.core.markdown.Link+linkText :: Typed.TypedTerm Markdown.Link -> Typed.TypedTerm [Markdown.Inline]+linkText x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.markdown.Link"),+ Model.projectionFieldName = (Model.Name "text")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL updater for the target field of hydra.core.markdown.Link+linkWithTarget :: Typed.TypedTerm Markdown.Link -> Typed.TypedTerm String -> Typed.TypedTerm Markdown.Link+linkWithTarget original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.markdown.Link"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "text"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.markdown.Link"),+ Model.projectionFieldName = (Model.Name "text")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "target"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL updater for the text field of hydra.core.markdown.Link+linkWithText :: Typed.TypedTerm Markdown.Link -> Typed.TypedTerm [Markdown.Inline] -> Typed.TypedTerm Markdown.Link+linkWithText original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.markdown.Link"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "text"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "target"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.markdown.Link"),+ Model.projectionFieldName = (Model.Name "target")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL constructor for hydra.core.markdown.List+list :: Typed.TypedTerm Bool -> Typed.TypedTerm [Markdown.ListItem] -> Typed.TypedTerm Markdown.List+list ordered items =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.markdown.List"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "ordered"),+ Model.fieldTerm = (Typed.unTypedTerm ordered)},+ Model.Field {+ Model.fieldName = (Model.Name "items"),+ Model.fieldTerm = (Typed.unTypedTerm items)}]}))++-- | DSL constructor for the hydra.core.markdown.ListItem wrapper+listItem :: Typed.TypedTerm [Markdown.Block] -> Typed.TypedTerm Markdown.ListItem+listItem x =+ Typed.TypedTerm (Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.Name "hydra.core.markdown.ListItem"),+ Model.wrappedTermBody = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.markdown.ListItem+listItemListItem :: Typed.TypedName Markdown.ListItem+listItemListItem = Typed.TypedName (Model.Name "hydra.core.markdown.ListItem")++-- | DSL accessor for the items field of hydra.core.markdown.List+listItems :: Typed.TypedTerm Markdown.List -> Typed.TypedTerm [Markdown.ListItem]+listItems x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.markdown.List"),+ Model.projectionFieldName = (Model.Name "items")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.markdown.List+listList :: Typed.TypedName Markdown.List+listList = Typed.TypedName (Model.Name "hydra.core.markdown.List")++-- | DSL accessor for the ordered field of hydra.core.markdown.List+listOrdered :: Typed.TypedTerm Markdown.List -> Typed.TypedTerm Bool+listOrdered x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.markdown.List"),+ Model.projectionFieldName = (Model.Name "ordered")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL updater for the items field of hydra.core.markdown.List+listWithItems :: Typed.TypedTerm Markdown.List -> Typed.TypedTerm [Markdown.ListItem] -> Typed.TypedTerm Markdown.List+listWithItems original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.markdown.List"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "ordered"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.markdown.List"),+ Model.projectionFieldName = (Model.Name "ordered")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "items"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL updater for the ordered field of hydra.core.markdown.List+listWithOrdered :: Typed.TypedTerm Markdown.List -> Typed.TypedTerm Bool -> Typed.TypedTerm Markdown.List+listWithOrdered original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.markdown.List"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "ordered"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "items"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.markdown.List"),+ Model.projectionFieldName = (Model.Name "items")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL constructor for hydra.core.markdown.Paragraph+paragraph :: Typed.TypedTerm [Markdown.Inline] -> Typed.TypedTerm (Maybe String) -> Typed.TypedTerm Markdown.Paragraph+paragraph content anchor =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.markdown.Paragraph"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "content"),+ Model.fieldTerm = (Typed.unTypedTerm content)},+ Model.Field {+ Model.fieldName = (Model.Name "anchor"),+ Model.fieldTerm = (Typed.unTypedTerm anchor)}]}))++-- | DSL accessor for the anchor field of hydra.core.markdown.Paragraph+paragraphAnchor :: Typed.TypedTerm Markdown.Paragraph -> Typed.TypedTerm (Maybe String)+paragraphAnchor x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.markdown.Paragraph"),+ Model.projectionFieldName = (Model.Name "anchor")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the content field of hydra.core.markdown.Paragraph+paragraphContent :: Typed.TypedTerm Markdown.Paragraph -> Typed.TypedTerm [Markdown.Inline]+paragraphContent x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.markdown.Paragraph"),+ Model.projectionFieldName = (Model.Name "content")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.markdown.Paragraph+paragraphParagraph :: Typed.TypedName Markdown.Paragraph+paragraphParagraph = Typed.TypedName (Model.Name "hydra.core.markdown.Paragraph")++-- | DSL updater for the anchor field of hydra.core.markdown.Paragraph+paragraphWithAnchor :: Typed.TypedTerm Markdown.Paragraph -> Typed.TypedTerm (Maybe String) -> Typed.TypedTerm Markdown.Paragraph+paragraphWithAnchor original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.markdown.Paragraph"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "content"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.markdown.Paragraph"),+ Model.projectionFieldName = (Model.Name "content")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "anchor"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL updater for the content field of hydra.core.markdown.Paragraph+paragraphWithContent :: Typed.TypedTerm Markdown.Paragraph -> Typed.TypedTerm [Markdown.Inline] -> Typed.TypedTerm Markdown.Paragraph+paragraphWithContent original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.markdown.Paragraph"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "content"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "anchor"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.markdown.Paragraph"),+ Model.projectionFieldName = (Model.Name "anchor")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL constructor for hydra.core.markdown.Section+section :: Typed.TypedTerm Markdown.Heading -> Typed.TypedTerm [Markdown.Block] -> Typed.TypedTerm (Maybe String) -> Typed.TypedTerm Markdown.Section+section heading content anchor =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.markdown.Section"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "heading"),+ Model.fieldTerm = (Typed.unTypedTerm heading)},+ Model.Field {+ Model.fieldName = (Model.Name "content"),+ Model.fieldTerm = (Typed.unTypedTerm content)},+ Model.Field {+ Model.fieldName = (Model.Name "anchor"),+ Model.fieldTerm = (Typed.unTypedTerm anchor)}]}))++-- | DSL accessor for the anchor field of hydra.core.markdown.Section+sectionAnchor :: Typed.TypedTerm Markdown.Section -> Typed.TypedTerm (Maybe String)+sectionAnchor x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.markdown.Section"),+ Model.projectionFieldName = (Model.Name "anchor")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the content field of hydra.core.markdown.Section+sectionContent :: Typed.TypedTerm Markdown.Section -> Typed.TypedTerm [Markdown.Block]+sectionContent x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.markdown.Section"),+ Model.projectionFieldName = (Model.Name "content")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the heading field of hydra.core.markdown.Section+sectionHeading :: Typed.TypedTerm Markdown.Section -> Typed.TypedTerm Markdown.Heading+sectionHeading x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.markdown.Section"),+ Model.projectionFieldName = (Model.Name "heading")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.markdown.Section+sectionSection :: Typed.TypedName Markdown.Section+sectionSection = Typed.TypedName (Model.Name "hydra.core.markdown.Section")++-- | DSL updater for the anchor field of hydra.core.markdown.Section+sectionWithAnchor :: Typed.TypedTerm Markdown.Section -> Typed.TypedTerm (Maybe String) -> Typed.TypedTerm Markdown.Section+sectionWithAnchor original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.markdown.Section"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "heading"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.markdown.Section"),+ Model.projectionFieldName = (Model.Name "heading")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "content"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.markdown.Section"),+ Model.projectionFieldName = (Model.Name "content")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "anchor"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL updater for the content field of hydra.core.markdown.Section+sectionWithContent :: Typed.TypedTerm Markdown.Section -> Typed.TypedTerm [Markdown.Block] -> Typed.TypedTerm Markdown.Section+sectionWithContent original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.markdown.Section"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "heading"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.markdown.Section"),+ Model.projectionFieldName = (Model.Name "heading")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "content"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "anchor"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.markdown.Section"),+ Model.projectionFieldName = (Model.Name "anchor")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the heading field of hydra.core.markdown.Section+sectionWithHeading :: Typed.TypedTerm Markdown.Section -> Typed.TypedTerm Markdown.Heading -> Typed.TypedTerm Markdown.Section+sectionWithHeading original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.markdown.Section"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "heading"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "content"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.markdown.Section"),+ Model.projectionFieldName = (Model.Name "content")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "anchor"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.markdown.Section"),+ Model.projectionFieldName = (Model.Name "anchor")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL constructor for hydra.core.markdown.Table+table :: Typed.TypedTerm Markdown.TableRow -> Typed.TypedTerm [Markdown.TableRow] -> Typed.TypedTerm Markdown.Table+table header rows =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.markdown.Table"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "header"),+ Model.fieldTerm = (Typed.unTypedTerm header)},+ Model.Field {+ Model.fieldName = (Model.Name "rows"),+ Model.fieldTerm = (Typed.unTypedTerm rows)}]}))++-- | DSL constructor for the hydra.core.markdown.TableCell wrapper+tableCell :: Typed.TypedTerm [Markdown.Inline] -> Typed.TypedTerm Markdown.TableCell+tableCell x =+ Typed.TypedTerm (Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.Name "hydra.core.markdown.TableCell"),+ Model.wrappedTermBody = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.markdown.TableCell+tableCellTableCell :: Typed.TypedName Markdown.TableCell+tableCellTableCell = Typed.TypedName (Model.Name "hydra.core.markdown.TableCell")++-- | DSL accessor for the header field of hydra.core.markdown.Table+tableHeader :: Typed.TypedTerm Markdown.Table -> Typed.TypedTerm Markdown.TableRow+tableHeader x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.markdown.Table"),+ Model.projectionFieldName = (Model.Name "header")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL constructor for the hydra.core.markdown.TableRow wrapper+tableRow :: Typed.TypedTerm [Markdown.TableCell] -> Typed.TypedTerm Markdown.TableRow+tableRow x =+ Typed.TypedTerm (Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.Name "hydra.core.markdown.TableRow"),+ Model.wrappedTermBody = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.markdown.TableRow+tableRowTableRow :: Typed.TypedName Markdown.TableRow+tableRowTableRow = Typed.TypedName (Model.Name "hydra.core.markdown.TableRow")++-- | DSL accessor for the rows field of hydra.core.markdown.Table+tableRows :: Typed.TypedTerm Markdown.Table -> Typed.TypedTerm [Markdown.TableRow]+tableRows x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.markdown.Table"),+ Model.projectionFieldName = (Model.Name "rows")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.markdown.Table+tableTable :: Typed.TypedName Markdown.Table+tableTable = Typed.TypedName (Model.Name "hydra.core.markdown.Table")++-- | DSL updater for the header field of hydra.core.markdown.Table+tableWithHeader :: Typed.TypedTerm Markdown.Table -> Typed.TypedTerm Markdown.TableRow -> Typed.TypedTerm Markdown.Table+tableWithHeader original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.markdown.Table"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "header"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "rows"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.markdown.Table"),+ Model.projectionFieldName = (Model.Name "rows")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the rows field of hydra.core.markdown.Table+tableWithRows :: Typed.TypedTerm Markdown.Table -> Typed.TypedTerm [Markdown.TableRow] -> Typed.TypedTerm Markdown.Table+tableWithRows original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.markdown.Table"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "header"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.markdown.Table"),+ Model.projectionFieldName = (Model.Name "header")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "rows"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL accessor for the body of hydra.core.markdown.ListItem+unListItem :: Typed.TypedTerm Markdown.ListItem -> Typed.TypedTerm [Markdown.Block]+unListItem x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermUnwrap (Model.Name "hydra.core.markdown.ListItem")),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the body of hydra.core.markdown.TableCell+unTableCell :: Typed.TypedTerm Markdown.TableCell -> Typed.TypedTerm [Markdown.Inline]+unTableCell x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermUnwrap (Model.Name "hydra.core.markdown.TableCell")),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the body of hydra.core.markdown.TableRow+unTableRow :: Typed.TypedTerm Markdown.TableRow -> Typed.TypedTerm [Markdown.TableCell]+unTableRow x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermUnwrap (Model.Name "hydra.core.markdown.TableRow")),+ Model.applicationArgument = (Typed.unTypedTerm x)}))
@@ -0,0 +1,2557 @@+-- Note: this is an automatically generated file. Do not edit.++-- | DSL functions for hydra.core.model++module Hydra.Core.Dsl.Model where++import qualified Hydra.Core.Decode.Model as DecodeModel+import qualified Hydra.Core.Encode.Model as EncodeModel+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Typed as Typed+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void+import qualified Data.ByteString as B+import qualified Data.Int as I+import qualified Data.Map as M+import qualified Data.Set as S++-- | DSL constructor for hydra.core.model.AnnotatedTerm+annotatedTerm :: Typed.TypedTerm Model.Term -> Typed.TypedTerm Model.Term -> Typed.TypedTerm Model.AnnotatedTerm+annotatedTerm body annotation =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.model.AnnotatedTerm"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "body"),+ Model.fieldTerm = (Typed.unTypedTerm body)},+ Model.Field {+ Model.fieldName = (Model.Name "annotation"),+ Model.fieldTerm = (Typed.unTypedTerm annotation)}]}))++-- | DSL name token for hydra.core.model.AnnotatedTerm+annotatedTermAnnotatedTerm :: Typed.TypedName Model.AnnotatedTerm+annotatedTermAnnotatedTerm = Typed.TypedName (Model.Name "hydra.core.model.AnnotatedTerm")++-- | DSL accessor for the annotation field of hydra.core.model.AnnotatedTerm+annotatedTermAnnotation :: Typed.TypedTerm Model.AnnotatedTerm -> Typed.TypedTerm Model.Term+annotatedTermAnnotation x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.model.AnnotatedTerm"),+ Model.projectionFieldName = (Model.Name "annotation")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the body field of hydra.core.model.AnnotatedTerm+annotatedTermBody :: Typed.TypedTerm Model.AnnotatedTerm -> Typed.TypedTerm Model.Term+annotatedTermBody x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.model.AnnotatedTerm"),+ Model.projectionFieldName = (Model.Name "body")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL updater for the annotation field of hydra.core.model.AnnotatedTerm+annotatedTermWithAnnotation :: Typed.TypedTerm Model.AnnotatedTerm -> Typed.TypedTerm Model.Term -> Typed.TypedTerm Model.AnnotatedTerm+annotatedTermWithAnnotation original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.model.AnnotatedTerm"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "body"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.model.AnnotatedTerm"),+ Model.projectionFieldName = (Model.Name "body")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "annotation"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL updater for the body field of hydra.core.model.AnnotatedTerm+annotatedTermWithBody :: Typed.TypedTerm Model.AnnotatedTerm -> Typed.TypedTerm Model.Term -> Typed.TypedTerm Model.AnnotatedTerm+annotatedTermWithBody original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.model.AnnotatedTerm"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "body"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "annotation"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.model.AnnotatedTerm"),+ Model.projectionFieldName = (Model.Name "annotation")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL constructor for hydra.core.model.AnnotatedType+annotatedType :: Typed.TypedTerm Model.Type -> Typed.TypedTerm Model.Term -> Typed.TypedTerm Model.AnnotatedType+annotatedType body annotation =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.model.AnnotatedType"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "body"),+ Model.fieldTerm = (Typed.unTypedTerm body)},+ Model.Field {+ Model.fieldName = (Model.Name "annotation"),+ Model.fieldTerm = (Typed.unTypedTerm annotation)}]}))++-- | DSL name token for hydra.core.model.AnnotatedType+annotatedTypeAnnotatedType :: Typed.TypedName Model.AnnotatedType+annotatedTypeAnnotatedType = Typed.TypedName (Model.Name "hydra.core.model.AnnotatedType")++-- | DSL accessor for the annotation field of hydra.core.model.AnnotatedType+annotatedTypeAnnotation :: Typed.TypedTerm Model.AnnotatedType -> Typed.TypedTerm Model.Term+annotatedTypeAnnotation x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.model.AnnotatedType"),+ Model.projectionFieldName = (Model.Name "annotation")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the body field of hydra.core.model.AnnotatedType+annotatedTypeBody :: Typed.TypedTerm Model.AnnotatedType -> Typed.TypedTerm Model.Type+annotatedTypeBody x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.model.AnnotatedType"),+ Model.projectionFieldName = (Model.Name "body")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL updater for the annotation field of hydra.core.model.AnnotatedType+annotatedTypeWithAnnotation :: Typed.TypedTerm Model.AnnotatedType -> Typed.TypedTerm Model.Term -> Typed.TypedTerm Model.AnnotatedType+annotatedTypeWithAnnotation original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.model.AnnotatedType"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "body"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.model.AnnotatedType"),+ Model.projectionFieldName = (Model.Name "body")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "annotation"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL updater for the body field of hydra.core.model.AnnotatedType+annotatedTypeWithBody :: Typed.TypedTerm Model.AnnotatedType -> Typed.TypedTerm Model.Type -> Typed.TypedTerm Model.AnnotatedType+annotatedTypeWithBody original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.model.AnnotatedType"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "body"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "annotation"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.model.AnnotatedType"),+ Model.projectionFieldName = (Model.Name "annotation")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL constructor for hydra.core.model.Application+application :: Typed.TypedTerm Model.Term -> Typed.TypedTerm Model.Term -> Typed.TypedTerm Model.Application+application function argument =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.model.Application"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "function"),+ Model.fieldTerm = (Typed.unTypedTerm function)},+ Model.Field {+ Model.fieldName = (Model.Name "argument"),+ Model.fieldTerm = (Typed.unTypedTerm argument)}]}))++-- | DSL name token for hydra.core.model.Application+applicationApplication :: Typed.TypedName Model.Application+applicationApplication = Typed.TypedName (Model.Name "hydra.core.model.Application")++-- | DSL accessor for the argument field of hydra.core.model.Application+applicationArgument :: Typed.TypedTerm Model.Application -> Typed.TypedTerm Model.Term+applicationArgument x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.model.Application"),+ Model.projectionFieldName = (Model.Name "argument")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the function field of hydra.core.model.Application+applicationFunction :: Typed.TypedTerm Model.Application -> Typed.TypedTerm Model.Term+applicationFunction x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.model.Application"),+ Model.projectionFieldName = (Model.Name "function")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL constructor for hydra.core.model.ApplicationType+applicationType :: Typed.TypedTerm Model.Type -> Typed.TypedTerm Model.Type -> Typed.TypedTerm Model.ApplicationType+applicationType function argument =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.model.ApplicationType"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "function"),+ Model.fieldTerm = (Typed.unTypedTerm function)},+ Model.Field {+ Model.fieldName = (Model.Name "argument"),+ Model.fieldTerm = (Typed.unTypedTerm argument)}]}))++-- | DSL name token for hydra.core.model.ApplicationType+applicationTypeApplicationType :: Typed.TypedName Model.ApplicationType+applicationTypeApplicationType = Typed.TypedName (Model.Name "hydra.core.model.ApplicationType")++-- | DSL accessor for the argument field of hydra.core.model.ApplicationType+applicationTypeArgument :: Typed.TypedTerm Model.ApplicationType -> Typed.TypedTerm Model.Type+applicationTypeArgument x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.model.ApplicationType"),+ Model.projectionFieldName = (Model.Name "argument")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the function field of hydra.core.model.ApplicationType+applicationTypeFunction :: Typed.TypedTerm Model.ApplicationType -> Typed.TypedTerm Model.Type+applicationTypeFunction x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.model.ApplicationType"),+ Model.projectionFieldName = (Model.Name "function")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL updater for the argument field of hydra.core.model.ApplicationType+applicationTypeWithArgument :: Typed.TypedTerm Model.ApplicationType -> Typed.TypedTerm Model.Type -> Typed.TypedTerm Model.ApplicationType+applicationTypeWithArgument original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.model.ApplicationType"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "function"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.model.ApplicationType"),+ Model.projectionFieldName = (Model.Name "function")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "argument"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL updater for the function field of hydra.core.model.ApplicationType+applicationTypeWithFunction :: Typed.TypedTerm Model.ApplicationType -> Typed.TypedTerm Model.Type -> Typed.TypedTerm Model.ApplicationType+applicationTypeWithFunction original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.model.ApplicationType"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "function"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "argument"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.model.ApplicationType"),+ Model.projectionFieldName = (Model.Name "argument")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the argument field of hydra.core.model.Application+applicationWithArgument :: Typed.TypedTerm Model.Application -> Typed.TypedTerm Model.Term -> Typed.TypedTerm Model.Application+applicationWithArgument original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.model.Application"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "function"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.model.Application"),+ Model.projectionFieldName = (Model.Name "function")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "argument"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL updater for the function field of hydra.core.model.Application+applicationWithFunction :: Typed.TypedTerm Model.Application -> Typed.TypedTerm Model.Term -> Typed.TypedTerm Model.Application+applicationWithFunction original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.model.Application"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "function"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "argument"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.model.Application"),+ Model.projectionFieldName = (Model.Name "argument")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL constructor for hydra.core.model.Binding+binding :: Typed.TypedTerm Model.Name -> Typed.TypedTerm Model.Term -> Typed.TypedTerm (Maybe Model.TypeScheme) -> Typed.TypedTerm Model.Binding+binding name term typeScheme =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.model.Binding"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Typed.unTypedTerm name)},+ Model.Field {+ Model.fieldName = (Model.Name "term"),+ Model.fieldTerm = (Typed.unTypedTerm term)},+ Model.Field {+ Model.fieldName = (Model.Name "typeScheme"),+ Model.fieldTerm = (Typed.unTypedTerm typeScheme)}]}))++-- | DSL name token for hydra.core.model.Binding+bindingBinding :: Typed.TypedName Model.Binding+bindingBinding = Typed.TypedName (Model.Name "hydra.core.model.Binding")++-- | DSL accessor for the name field of hydra.core.model.Binding+bindingName :: Typed.TypedTerm Model.Binding -> Typed.TypedTerm Model.Name+bindingName x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.model.Binding"),+ Model.projectionFieldName = (Model.Name "name")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the term field of hydra.core.model.Binding+bindingTerm :: Typed.TypedTerm Model.Binding -> Typed.TypedTerm Model.Term+bindingTerm x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.model.Binding"),+ Model.projectionFieldName = (Model.Name "term")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the typeScheme field of hydra.core.model.Binding+bindingTypeScheme :: Typed.TypedTerm Model.Binding -> Typed.TypedTerm (Maybe Model.TypeScheme)+bindingTypeScheme x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.model.Binding"),+ Model.projectionFieldName = (Model.Name "typeScheme")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL updater for the name field of hydra.core.model.Binding+bindingWithName :: Typed.TypedTerm Model.Binding -> Typed.TypedTerm Model.Name -> Typed.TypedTerm Model.Binding+bindingWithName original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.model.Binding"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "term"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.model.Binding"),+ Model.projectionFieldName = (Model.Name "term")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "typeScheme"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.model.Binding"),+ Model.projectionFieldName = (Model.Name "typeScheme")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the term field of hydra.core.model.Binding+bindingWithTerm :: Typed.TypedTerm Model.Binding -> Typed.TypedTerm Model.Term -> Typed.TypedTerm Model.Binding+bindingWithTerm original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.model.Binding"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.model.Binding"),+ Model.projectionFieldName = (Model.Name "name")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "term"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "typeScheme"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.model.Binding"),+ Model.projectionFieldName = (Model.Name "typeScheme")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the typeScheme field of hydra.core.model.Binding+bindingWithTypeScheme :: Typed.TypedTerm Model.Binding -> Typed.TypedTerm (Maybe Model.TypeScheme) -> Typed.TypedTerm Model.Binding+bindingWithTypeScheme original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.model.Binding"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.model.Binding"),+ Model.projectionFieldName = (Model.Name "name")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "term"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.model.Binding"),+ Model.projectionFieldName = (Model.Name "term")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "typeScheme"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL constructor for hydra.core.model.CaseAlternative+caseAlternative :: Typed.TypedTerm Model.Name -> Typed.TypedTerm Model.Term -> Typed.TypedTerm Model.CaseAlternative+caseAlternative name handler =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.model.CaseAlternative"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Typed.unTypedTerm name)},+ Model.Field {+ Model.fieldName = (Model.Name "handler"),+ Model.fieldTerm = (Typed.unTypedTerm handler)}]}))++-- | DSL name token for hydra.core.model.CaseAlternative+caseAlternativeCaseAlternative :: Typed.TypedName Model.CaseAlternative+caseAlternativeCaseAlternative = Typed.TypedName (Model.Name "hydra.core.model.CaseAlternative")++-- | DSL accessor for the handler field of hydra.core.model.CaseAlternative+caseAlternativeHandler :: Typed.TypedTerm Model.CaseAlternative -> Typed.TypedTerm Model.Term+caseAlternativeHandler x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.model.CaseAlternative"),+ Model.projectionFieldName = (Model.Name "handler")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the name field of hydra.core.model.CaseAlternative+caseAlternativeName :: Typed.TypedTerm Model.CaseAlternative -> Typed.TypedTerm Model.Name+caseAlternativeName x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.model.CaseAlternative"),+ Model.projectionFieldName = (Model.Name "name")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL updater for the handler field of hydra.core.model.CaseAlternative+caseAlternativeWithHandler :: Typed.TypedTerm Model.CaseAlternative -> Typed.TypedTerm Model.Term -> Typed.TypedTerm Model.CaseAlternative+caseAlternativeWithHandler original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.model.CaseAlternative"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.model.CaseAlternative"),+ Model.projectionFieldName = (Model.Name "name")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "handler"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL updater for the name field of hydra.core.model.CaseAlternative+caseAlternativeWithName :: Typed.TypedTerm Model.CaseAlternative -> Typed.TypedTerm Model.Name -> Typed.TypedTerm Model.CaseAlternative+caseAlternativeWithName original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.model.CaseAlternative"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "handler"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.model.CaseAlternative"),+ Model.projectionFieldName = (Model.Name "handler")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL constructor for hydra.core.model.CaseStatement+caseStatement :: Typed.TypedTerm Model.Name -> Typed.TypedTerm (Maybe Model.Term) -> Typed.TypedTerm [Model.CaseAlternative] -> Typed.TypedTerm Model.CaseStatement+caseStatement typeName default_ cases =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.model.CaseStatement"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "typeName"),+ Model.fieldTerm = (Typed.unTypedTerm typeName)},+ Model.Field {+ Model.fieldName = (Model.Name "default"),+ Model.fieldTerm = (Typed.unTypedTerm default_)},+ Model.Field {+ Model.fieldName = (Model.Name "cases"),+ Model.fieldTerm = (Typed.unTypedTerm cases)}]}))++-- | DSL name token for hydra.core.model.CaseStatement+caseStatementCaseStatement :: Typed.TypedName Model.CaseStatement+caseStatementCaseStatement = Typed.TypedName (Model.Name "hydra.core.model.CaseStatement")++-- | DSL accessor for the cases field of hydra.core.model.CaseStatement+caseStatementCases :: Typed.TypedTerm Model.CaseStatement -> Typed.TypedTerm [Model.CaseAlternative]+caseStatementCases x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.model.CaseStatement"),+ Model.projectionFieldName = (Model.Name "cases")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the default field of hydra.core.model.CaseStatement+caseStatementDefault :: Typed.TypedTerm Model.CaseStatement -> Typed.TypedTerm (Maybe Model.Term)+caseStatementDefault x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.model.CaseStatement"),+ Model.projectionFieldName = (Model.Name "default")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the typeName field of hydra.core.model.CaseStatement+caseStatementTypeName :: Typed.TypedTerm Model.CaseStatement -> Typed.TypedTerm Model.Name+caseStatementTypeName x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.model.CaseStatement"),+ Model.projectionFieldName = (Model.Name "typeName")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL updater for the cases field of hydra.core.model.CaseStatement+caseStatementWithCases :: Typed.TypedTerm Model.CaseStatement -> Typed.TypedTerm [Model.CaseAlternative] -> Typed.TypedTerm Model.CaseStatement+caseStatementWithCases original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.model.CaseStatement"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "typeName"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.model.CaseStatement"),+ Model.projectionFieldName = (Model.Name "typeName")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "default"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.model.CaseStatement"),+ Model.projectionFieldName = (Model.Name "default")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "cases"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL updater for the default field of hydra.core.model.CaseStatement+caseStatementWithDefault :: Typed.TypedTerm Model.CaseStatement -> Typed.TypedTerm (Maybe Model.Term) -> Typed.TypedTerm Model.CaseStatement+caseStatementWithDefault original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.model.CaseStatement"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "typeName"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.model.CaseStatement"),+ Model.projectionFieldName = (Model.Name "typeName")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "default"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "cases"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.model.CaseStatement"),+ Model.projectionFieldName = (Model.Name "cases")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the typeName field of hydra.core.model.CaseStatement+caseStatementWithTypeName :: Typed.TypedTerm Model.CaseStatement -> Typed.TypedTerm Model.Name -> Typed.TypedTerm Model.CaseStatement+caseStatementWithTypeName original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.model.CaseStatement"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "typeName"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "default"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.model.CaseStatement"),+ Model.projectionFieldName = (Model.Name "default")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "cases"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.model.CaseStatement"),+ Model.projectionFieldName = (Model.Name "cases")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL constructor for hydra.core.model.EitherType+eitherType :: Typed.TypedTerm Model.Type -> Typed.TypedTerm Model.Type -> Typed.TypedTerm Model.EitherType+eitherType left right =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.model.EitherType"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "left"),+ Model.fieldTerm = (Typed.unTypedTerm left)},+ Model.Field {+ Model.fieldName = (Model.Name "right"),+ Model.fieldTerm = (Typed.unTypedTerm right)}]}))++-- | DSL name token for hydra.core.model.EitherType+eitherTypeEitherType :: Typed.TypedName Model.EitherType+eitherTypeEitherType = Typed.TypedName (Model.Name "hydra.core.model.EitherType")++-- | DSL accessor for the left field of hydra.core.model.EitherType+eitherTypeLeft :: Typed.TypedTerm Model.EitherType -> Typed.TypedTerm Model.Type+eitherTypeLeft x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.model.EitherType"),+ Model.projectionFieldName = (Model.Name "left")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the right field of hydra.core.model.EitherType+eitherTypeRight :: Typed.TypedTerm Model.EitherType -> Typed.TypedTerm Model.Type+eitherTypeRight x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.model.EitherType"),+ Model.projectionFieldName = (Model.Name "right")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL updater for the left field of hydra.core.model.EitherType+eitherTypeWithLeft :: Typed.TypedTerm Model.EitherType -> Typed.TypedTerm Model.Type -> Typed.TypedTerm Model.EitherType+eitherTypeWithLeft original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.model.EitherType"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "left"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "right"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.model.EitherType"),+ Model.projectionFieldName = (Model.Name "right")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the right field of hydra.core.model.EitherType+eitherTypeWithRight :: Typed.TypedTerm Model.EitherType -> Typed.TypedTerm Model.Type -> Typed.TypedTerm Model.EitherType+eitherTypeWithRight original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.model.EitherType"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "left"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.model.EitherType"),+ Model.projectionFieldName = (Model.Name "left")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "right"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL constructor for hydra.core.model.Field+field :: Typed.TypedTerm Model.Name -> Typed.TypedTerm Model.Term -> Typed.TypedTerm Model.Field+field name term =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.model.Field"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Typed.unTypedTerm name)},+ Model.Field {+ Model.fieldName = (Model.Name "term"),+ Model.fieldTerm = (Typed.unTypedTerm term)}]}))++-- | DSL name token for hydra.core.model.Field+fieldField :: Typed.TypedName Model.Field+fieldField = Typed.TypedName (Model.Name "hydra.core.model.Field")++-- | DSL accessor for the name field of hydra.core.model.Field+fieldName :: Typed.TypedTerm Model.Field -> Typed.TypedTerm Model.Name+fieldName x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.model.Field"),+ Model.projectionFieldName = (Model.Name "name")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the term field of hydra.core.model.Field+fieldTerm :: Typed.TypedTerm Model.Field -> Typed.TypedTerm Model.Term+fieldTerm x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.model.Field"),+ Model.projectionFieldName = (Model.Name "term")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL constructor for hydra.core.model.FieldType+fieldType :: Typed.TypedTerm Model.Name -> Typed.TypedTerm Model.Type -> Typed.TypedTerm Model.FieldType+fieldType name type_ =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.model.FieldType"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Typed.unTypedTerm name)},+ Model.Field {+ Model.fieldName = (Model.Name "type"),+ Model.fieldTerm = (Typed.unTypedTerm type_)}]}))++-- | DSL name token for hydra.core.model.FieldType+fieldTypeFieldType :: Typed.TypedName Model.FieldType+fieldTypeFieldType = Typed.TypedName (Model.Name "hydra.core.model.FieldType")++-- | DSL accessor for the name field of hydra.core.model.FieldType+fieldTypeName :: Typed.TypedTerm Model.FieldType -> Typed.TypedTerm Model.Name+fieldTypeName x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.model.FieldType"),+ Model.projectionFieldName = (Model.Name "name")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the type field of hydra.core.model.FieldType+fieldTypeType :: Typed.TypedTerm Model.FieldType -> Typed.TypedTerm Model.Type+fieldTypeType x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.model.FieldType"),+ Model.projectionFieldName = (Model.Name "type")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL updater for the name field of hydra.core.model.FieldType+fieldTypeWithName :: Typed.TypedTerm Model.FieldType -> Typed.TypedTerm Model.Name -> Typed.TypedTerm Model.FieldType+fieldTypeWithName original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.model.FieldType"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "type"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.model.FieldType"),+ Model.projectionFieldName = (Model.Name "type")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the type field of hydra.core.model.FieldType+fieldTypeWithType :: Typed.TypedTerm Model.FieldType -> Typed.TypedTerm Model.Type -> Typed.TypedTerm Model.FieldType+fieldTypeWithType original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.model.FieldType"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.model.FieldType"),+ Model.projectionFieldName = (Model.Name "name")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "type"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL updater for the name field of hydra.core.model.Field+fieldWithName :: Typed.TypedTerm Model.Field -> Typed.TypedTerm Model.Name -> Typed.TypedTerm Model.Field+fieldWithName original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.model.Field"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "term"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.model.Field"),+ Model.projectionFieldName = (Model.Name "term")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the term field of hydra.core.model.Field+fieldWithTerm :: Typed.TypedTerm Model.Field -> Typed.TypedTerm Model.Term -> Typed.TypedTerm Model.Field+fieldWithTerm original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.model.Field"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.model.Field"),+ Model.projectionFieldName = (Model.Name "name")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "term"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL injection for the float32 variant of hydra.core.model.FloatType+floatTypeFloat32 :: Typed.TypedTerm Model.FloatType+floatTypeFloat32 =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.FloatType"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "float32"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL injection for the float64 variant of hydra.core.model.FloatType+floatTypeFloat64 :: Typed.TypedTerm Model.FloatType+floatTypeFloat64 =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.FloatType"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "float64"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL name token for hydra.core.model.FloatType+floatTypeFloatType :: Typed.TypedName Model.FloatType+floatTypeFloatType = Typed.TypedName (Model.Name "hydra.core.model.FloatType")++-- | DSL injection for the float32 variant of hydra.core.model.FloatValue+floatValueFloat32 :: Typed.TypedTerm Float -> Typed.TypedTerm Model.FloatValue+floatValueFloat32 x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.FloatValue"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "float32"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the float64 variant of hydra.core.model.FloatValue+floatValueFloat64 :: Typed.TypedTerm Double -> Typed.TypedTerm Model.FloatValue+floatValueFloat64 x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.FloatValue"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "float64"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL name token for hydra.core.model.FloatValue+floatValueFloatValue :: Typed.TypedName Model.FloatValue+floatValueFloatValue = Typed.TypedName (Model.Name "hydra.core.model.FloatValue")++-- | DSL constructor for hydra.core.model.ForallType+forallType :: Typed.TypedTerm Model.Name -> Typed.TypedTerm Model.Type -> Typed.TypedTerm Model.ForallType+forallType parameter body =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.model.ForallType"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "parameter"),+ Model.fieldTerm = (Typed.unTypedTerm parameter)},+ Model.Field {+ Model.fieldName = (Model.Name "body"),+ Model.fieldTerm = (Typed.unTypedTerm body)}]}))++-- | DSL accessor for the body field of hydra.core.model.ForallType+forallTypeBody :: Typed.TypedTerm Model.ForallType -> Typed.TypedTerm Model.Type+forallTypeBody x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.model.ForallType"),+ Model.projectionFieldName = (Model.Name "body")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.model.ForallType+forallTypeForallType :: Typed.TypedName Model.ForallType+forallTypeForallType = Typed.TypedName (Model.Name "hydra.core.model.ForallType")++-- | DSL accessor for the parameter field of hydra.core.model.ForallType+forallTypeParameter :: Typed.TypedTerm Model.ForallType -> Typed.TypedTerm Model.Name+forallTypeParameter x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.model.ForallType"),+ Model.projectionFieldName = (Model.Name "parameter")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL updater for the body field of hydra.core.model.ForallType+forallTypeWithBody :: Typed.TypedTerm Model.ForallType -> Typed.TypedTerm Model.Type -> Typed.TypedTerm Model.ForallType+forallTypeWithBody original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.model.ForallType"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "parameter"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.model.ForallType"),+ Model.projectionFieldName = (Model.Name "parameter")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "body"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL updater for the parameter field of hydra.core.model.ForallType+forallTypeWithParameter :: Typed.TypedTerm Model.ForallType -> Typed.TypedTerm Model.Name -> Typed.TypedTerm Model.ForallType+forallTypeWithParameter original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.model.ForallType"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "parameter"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "body"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.model.ForallType"),+ Model.projectionFieldName = (Model.Name "body")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL constructor for hydra.core.model.FunctionType+functionType :: Typed.TypedTerm Model.Type -> Typed.TypedTerm Model.Type -> Typed.TypedTerm Model.FunctionType+functionType domain codomain =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.model.FunctionType"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "domain"),+ Model.fieldTerm = (Typed.unTypedTerm domain)},+ Model.Field {+ Model.fieldName = (Model.Name "codomain"),+ Model.fieldTerm = (Typed.unTypedTerm codomain)}]}))++-- | DSL accessor for the codomain field of hydra.core.model.FunctionType+functionTypeCodomain :: Typed.TypedTerm Model.FunctionType -> Typed.TypedTerm Model.Type+functionTypeCodomain x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.model.FunctionType"),+ Model.projectionFieldName = (Model.Name "codomain")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the domain field of hydra.core.model.FunctionType+functionTypeDomain :: Typed.TypedTerm Model.FunctionType -> Typed.TypedTerm Model.Type+functionTypeDomain x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.model.FunctionType"),+ Model.projectionFieldName = (Model.Name "domain")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.model.FunctionType+functionTypeFunctionType :: Typed.TypedName Model.FunctionType+functionTypeFunctionType = Typed.TypedName (Model.Name "hydra.core.model.FunctionType")++-- | DSL updater for the codomain field of hydra.core.model.FunctionType+functionTypeWithCodomain :: Typed.TypedTerm Model.FunctionType -> Typed.TypedTerm Model.Type -> Typed.TypedTerm Model.FunctionType+functionTypeWithCodomain original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.model.FunctionType"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "domain"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.model.FunctionType"),+ Model.projectionFieldName = (Model.Name "domain")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "codomain"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL updater for the domain field of hydra.core.model.FunctionType+functionTypeWithDomain :: Typed.TypedTerm Model.FunctionType -> Typed.TypedTerm Model.Type -> Typed.TypedTerm Model.FunctionType+functionTypeWithDomain original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.model.FunctionType"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "domain"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "codomain"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.model.FunctionType"),+ Model.projectionFieldName = (Model.Name "codomain")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL constructor for hydra.core.model.Injection+injection :: Typed.TypedTerm Model.Name -> Typed.TypedTerm Model.Field -> Typed.TypedTerm Model.Injection+injection typeName field =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.model.Injection"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "typeName"),+ Model.fieldTerm = (Typed.unTypedTerm typeName)},+ Model.Field {+ Model.fieldName = (Model.Name "field"),+ Model.fieldTerm = (Typed.unTypedTerm field)}]}))++-- | DSL accessor for the field field of hydra.core.model.Injection+injectionField :: Typed.TypedTerm Model.Injection -> Typed.TypedTerm Model.Field+injectionField x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.model.Injection"),+ Model.projectionFieldName = (Model.Name "field")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.model.Injection+injectionInjection :: Typed.TypedName Model.Injection+injectionInjection = Typed.TypedName (Model.Name "hydra.core.model.Injection")++-- | DSL accessor for the typeName field of hydra.core.model.Injection+injectionTypeName :: Typed.TypedTerm Model.Injection -> Typed.TypedTerm Model.Name+injectionTypeName x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.model.Injection"),+ Model.projectionFieldName = (Model.Name "typeName")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL updater for the field field of hydra.core.model.Injection+injectionWithField :: Typed.TypedTerm Model.Injection -> Typed.TypedTerm Model.Field -> Typed.TypedTerm Model.Injection+injectionWithField original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.model.Injection"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "typeName"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.model.Injection"),+ Model.projectionFieldName = (Model.Name "typeName")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "field"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL updater for the typeName field of hydra.core.model.Injection+injectionWithTypeName :: Typed.TypedTerm Model.Injection -> Typed.TypedTerm Model.Name -> Typed.TypedTerm Model.Injection+injectionWithTypeName original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.model.Injection"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "typeName"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "field"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.model.Injection"),+ Model.projectionFieldName = (Model.Name "field")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL injection for the bigint variant of hydra.core.model.IntegerType+integerTypeBigint :: Typed.TypedTerm Model.IntegerType+integerTypeBigint =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.IntegerType"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "bigint"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL injection for the int16 variant of hydra.core.model.IntegerType+integerTypeInt16 :: Typed.TypedTerm Model.IntegerType+integerTypeInt16 =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.IntegerType"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "int16"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL injection for the int32 variant of hydra.core.model.IntegerType+integerTypeInt32 :: Typed.TypedTerm Model.IntegerType+integerTypeInt32 =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.IntegerType"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "int32"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL injection for the int64 variant of hydra.core.model.IntegerType+integerTypeInt64 :: Typed.TypedTerm Model.IntegerType+integerTypeInt64 =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.IntegerType"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "int64"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL injection for the int8 variant of hydra.core.model.IntegerType+integerTypeInt8 :: Typed.TypedTerm Model.IntegerType+integerTypeInt8 =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.IntegerType"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "int8"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL name token for hydra.core.model.IntegerType+integerTypeIntegerType :: Typed.TypedName Model.IntegerType+integerTypeIntegerType = Typed.TypedName (Model.Name "hydra.core.model.IntegerType")++-- | DSL injection for the uint16 variant of hydra.core.model.IntegerType+integerTypeUint16 :: Typed.TypedTerm Model.IntegerType+integerTypeUint16 =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.IntegerType"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "uint16"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL injection for the uint32 variant of hydra.core.model.IntegerType+integerTypeUint32 :: Typed.TypedTerm Model.IntegerType+integerTypeUint32 =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.IntegerType"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "uint32"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL injection for the uint64 variant of hydra.core.model.IntegerType+integerTypeUint64 :: Typed.TypedTerm Model.IntegerType+integerTypeUint64 =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.IntegerType"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "uint64"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL injection for the uint8 variant of hydra.core.model.IntegerType+integerTypeUint8 :: Typed.TypedTerm Model.IntegerType+integerTypeUint8 =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.IntegerType"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "uint8"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL injection for the bigint variant of hydra.core.model.IntegerValue+integerValueBigint :: Typed.TypedTerm Integer -> Typed.TypedTerm Model.IntegerValue+integerValueBigint x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.IntegerValue"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "bigint"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the int16 variant of hydra.core.model.IntegerValue+integerValueInt16 :: Typed.TypedTerm I.Int16 -> Typed.TypedTerm Model.IntegerValue+integerValueInt16 x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.IntegerValue"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "int16"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the int32 variant of hydra.core.model.IntegerValue+integerValueInt32 :: Typed.TypedTerm Int -> Typed.TypedTerm Model.IntegerValue+integerValueInt32 x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.IntegerValue"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "int32"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the int64 variant of hydra.core.model.IntegerValue+integerValueInt64 :: Typed.TypedTerm I.Int64 -> Typed.TypedTerm Model.IntegerValue+integerValueInt64 x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.IntegerValue"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "int64"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the int8 variant of hydra.core.model.IntegerValue+integerValueInt8 :: Typed.TypedTerm I.Int8 -> Typed.TypedTerm Model.IntegerValue+integerValueInt8 x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.IntegerValue"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "int8"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL name token for hydra.core.model.IntegerValue+integerValueIntegerValue :: Typed.TypedName Model.IntegerValue+integerValueIntegerValue = Typed.TypedName (Model.Name "hydra.core.model.IntegerValue")++-- | DSL injection for the uint16 variant of hydra.core.model.IntegerValue+integerValueUint16 :: Typed.TypedTerm Int -> Typed.TypedTerm Model.IntegerValue+integerValueUint16 x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.IntegerValue"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "uint16"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the uint32 variant of hydra.core.model.IntegerValue+integerValueUint32 :: Typed.TypedTerm I.Int64 -> Typed.TypedTerm Model.IntegerValue+integerValueUint32 x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.IntegerValue"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "uint32"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the uint64 variant of hydra.core.model.IntegerValue+integerValueUint64 :: Typed.TypedTerm Integer -> Typed.TypedTerm Model.IntegerValue+integerValueUint64 x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.IntegerValue"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "uint64"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the uint8 variant of hydra.core.model.IntegerValue+integerValueUint8 :: Typed.TypedTerm I.Int16 -> Typed.TypedTerm Model.IntegerValue+integerValueUint8 x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.IntegerValue"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "uint8"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL constructor for hydra.core.model.Lambda+lambda :: Typed.TypedTerm Model.Name -> Typed.TypedTerm (Maybe Model.Type) -> Typed.TypedTerm Model.Term -> Typed.TypedTerm Model.Lambda+lambda parameter domain body =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.model.Lambda"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "parameter"),+ Model.fieldTerm = (Typed.unTypedTerm parameter)},+ Model.Field {+ Model.fieldName = (Model.Name "domain"),+ Model.fieldTerm = (Typed.unTypedTerm domain)},+ Model.Field {+ Model.fieldName = (Model.Name "body"),+ Model.fieldTerm = (Typed.unTypedTerm body)}]}))++-- | DSL accessor for the body field of hydra.core.model.Lambda+lambdaBody :: Typed.TypedTerm Model.Lambda -> Typed.TypedTerm Model.Term+lambdaBody x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.model.Lambda"),+ Model.projectionFieldName = (Model.Name "body")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the domain field of hydra.core.model.Lambda+lambdaDomain :: Typed.TypedTerm Model.Lambda -> Typed.TypedTerm (Maybe Model.Type)+lambdaDomain x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.model.Lambda"),+ Model.projectionFieldName = (Model.Name "domain")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.model.Lambda+lambdaLambda :: Typed.TypedName Model.Lambda+lambdaLambda = Typed.TypedName (Model.Name "hydra.core.model.Lambda")++-- | DSL accessor for the parameter field of hydra.core.model.Lambda+lambdaParameter :: Typed.TypedTerm Model.Lambda -> Typed.TypedTerm Model.Name+lambdaParameter x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.model.Lambda"),+ Model.projectionFieldName = (Model.Name "parameter")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL updater for the body field of hydra.core.model.Lambda+lambdaWithBody :: Typed.TypedTerm Model.Lambda -> Typed.TypedTerm Model.Term -> Typed.TypedTerm Model.Lambda+lambdaWithBody original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.model.Lambda"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "parameter"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.model.Lambda"),+ Model.projectionFieldName = (Model.Name "parameter")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "domain"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.model.Lambda"),+ Model.projectionFieldName = (Model.Name "domain")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "body"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL updater for the domain field of hydra.core.model.Lambda+lambdaWithDomain :: Typed.TypedTerm Model.Lambda -> Typed.TypedTerm (Maybe Model.Type) -> Typed.TypedTerm Model.Lambda+lambdaWithDomain original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.model.Lambda"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "parameter"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.model.Lambda"),+ Model.projectionFieldName = (Model.Name "parameter")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "domain"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "body"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.model.Lambda"),+ Model.projectionFieldName = (Model.Name "body")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the parameter field of hydra.core.model.Lambda+lambdaWithParameter :: Typed.TypedTerm Model.Lambda -> Typed.TypedTerm Model.Name -> Typed.TypedTerm Model.Lambda+lambdaWithParameter original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.model.Lambda"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "parameter"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "domain"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.model.Lambda"),+ Model.projectionFieldName = (Model.Name "domain")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "body"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.model.Lambda"),+ Model.projectionFieldName = (Model.Name "body")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL constructor for hydra.core.model.Let+let_ :: Typed.TypedTerm [Model.Binding] -> Typed.TypedTerm Model.Term -> Typed.TypedTerm Model.Let+let_ bindings body =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.model.Let"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "bindings"),+ Model.fieldTerm = (Typed.unTypedTerm bindings)},+ Model.Field {+ Model.fieldName = (Model.Name "body"),+ Model.fieldTerm = (Typed.unTypedTerm body)}]}))++-- | DSL accessor for the bindings field of hydra.core.model.Let+letBindings :: Typed.TypedTerm Model.Let -> Typed.TypedTerm [Model.Binding]+letBindings x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.model.Let"),+ Model.projectionFieldName = (Model.Name "bindings")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the body field of hydra.core.model.Let+letBody :: Typed.TypedTerm Model.Let -> Typed.TypedTerm Model.Term+letBody x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.model.Let"),+ Model.projectionFieldName = (Model.Name "body")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.model.Let+letLet :: Typed.TypedName Model.Let+letLet = Typed.TypedName (Model.Name "hydra.core.model.Let")++-- | DSL updater for the bindings field of hydra.core.model.Let+letWithBindings :: Typed.TypedTerm Model.Let -> Typed.TypedTerm [Model.Binding] -> Typed.TypedTerm Model.Let+letWithBindings original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.model.Let"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "bindings"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "body"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.model.Let"),+ Model.projectionFieldName = (Model.Name "body")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the body field of hydra.core.model.Let+letWithBody :: Typed.TypedTerm Model.Let -> Typed.TypedTerm Model.Term -> Typed.TypedTerm Model.Let+letWithBody original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.model.Let"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "bindings"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.model.Let"),+ Model.projectionFieldName = (Model.Name "bindings")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "body"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL injection for the binary variant of hydra.core.model.Literal+literalBinary :: Typed.TypedTerm B.ByteString -> Typed.TypedTerm Model.Literal+literalBinary x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.Literal"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "binary"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the boolean variant of hydra.core.model.Literal+literalBoolean :: Typed.TypedTerm Bool -> Typed.TypedTerm Model.Literal+literalBoolean x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.Literal"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "boolean"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the decimal variant of hydra.core.model.Literal+literalDecimal :: Typed.TypedTerm Sci.Scientific -> Typed.TypedTerm Model.Literal+literalDecimal x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.Literal"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "decimal"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the float variant of hydra.core.model.Literal+literalFloat :: Typed.TypedTerm Model.FloatValue -> Typed.TypedTerm Model.Literal+literalFloat x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.Literal"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "float"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the integer variant of hydra.core.model.Literal+literalInteger :: Typed.TypedTerm Model.IntegerValue -> Typed.TypedTerm Model.Literal+literalInteger x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.Literal"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "integer"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL name token for hydra.core.model.Literal+literalLiteral :: Typed.TypedName Model.Literal+literalLiteral = Typed.TypedName (Model.Name "hydra.core.model.Literal")++-- | DSL injection for the string variant of hydra.core.model.Literal+literalString :: Typed.TypedTerm String -> Typed.TypedTerm Model.Literal+literalString x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.Literal"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "string"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the binary variant of hydra.core.model.LiteralType+literalTypeBinary :: Typed.TypedTerm Model.LiteralType+literalTypeBinary =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.LiteralType"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "binary"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL injection for the boolean variant of hydra.core.model.LiteralType+literalTypeBoolean :: Typed.TypedTerm Model.LiteralType+literalTypeBoolean =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.LiteralType"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "boolean"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL injection for the decimal variant of hydra.core.model.LiteralType+literalTypeDecimal :: Typed.TypedTerm Model.LiteralType+literalTypeDecimal =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.LiteralType"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "decimal"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL injection for the float variant of hydra.core.model.LiteralType+literalTypeFloat :: Typed.TypedTerm Model.FloatType -> Typed.TypedTerm Model.LiteralType+literalTypeFloat x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.LiteralType"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "float"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the integer variant of hydra.core.model.LiteralType+literalTypeInteger :: Typed.TypedTerm Model.IntegerType -> Typed.TypedTerm Model.LiteralType+literalTypeInteger x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.LiteralType"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "integer"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL name token for hydra.core.model.LiteralType+literalTypeLiteralType :: Typed.TypedName Model.LiteralType+literalTypeLiteralType = Typed.TypedName (Model.Name "hydra.core.model.LiteralType")++-- | DSL injection for the string variant of hydra.core.model.LiteralType+literalTypeString :: Typed.TypedTerm Model.LiteralType+literalTypeString =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.LiteralType"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "string"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL constructor for hydra.core.model.MapType+mapType :: Typed.TypedTerm Model.Type -> Typed.TypedTerm Model.Type -> Typed.TypedTerm Model.MapType+mapType keys values =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.model.MapType"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "keys"),+ Model.fieldTerm = (Typed.unTypedTerm keys)},+ Model.Field {+ Model.fieldName = (Model.Name "values"),+ Model.fieldTerm = (Typed.unTypedTerm values)}]}))++-- | DSL accessor for the keys field of hydra.core.model.MapType+mapTypeKeys :: Typed.TypedTerm Model.MapType -> Typed.TypedTerm Model.Type+mapTypeKeys x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.model.MapType"),+ Model.projectionFieldName = (Model.Name "keys")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.model.MapType+mapTypeMapType :: Typed.TypedName Model.MapType+mapTypeMapType = Typed.TypedName (Model.Name "hydra.core.model.MapType")++-- | DSL accessor for the values field of hydra.core.model.MapType+mapTypeValues :: Typed.TypedTerm Model.MapType -> Typed.TypedTerm Model.Type+mapTypeValues x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.model.MapType"),+ Model.projectionFieldName = (Model.Name "values")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL updater for the keys field of hydra.core.model.MapType+mapTypeWithKeys :: Typed.TypedTerm Model.MapType -> Typed.TypedTerm Model.Type -> Typed.TypedTerm Model.MapType+mapTypeWithKeys original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.model.MapType"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "keys"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "values"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.model.MapType"),+ Model.projectionFieldName = (Model.Name "values")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the values field of hydra.core.model.MapType+mapTypeWithValues :: Typed.TypedTerm Model.MapType -> Typed.TypedTerm Model.Type -> Typed.TypedTerm Model.MapType+mapTypeWithValues original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.model.MapType"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "keys"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.model.MapType"),+ Model.projectionFieldName = (Model.Name "keys")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "values"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL constructor for the hydra.core.model.Name wrapper+name :: Typed.TypedTerm String -> Typed.TypedTerm Model.Name+name x =+ Typed.TypedTerm (Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.Name "hydra.core.model.Name"),+ Model.wrappedTermBody = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.model.Name+nameName :: Typed.TypedName Model.Name+nameName = Typed.TypedName (Model.Name "hydra.core.model.Name")++-- | DSL constructor for hydra.core.model.PairType+pairType :: Typed.TypedTerm Model.Type -> Typed.TypedTerm Model.Type -> Typed.TypedTerm Model.PairType+pairType first second =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.model.PairType"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "first"),+ Model.fieldTerm = (Typed.unTypedTerm first)},+ Model.Field {+ Model.fieldName = (Model.Name "second"),+ Model.fieldTerm = (Typed.unTypedTerm second)}]}))++-- | DSL accessor for the first field of hydra.core.model.PairType+pairTypeFirst :: Typed.TypedTerm Model.PairType -> Typed.TypedTerm Model.Type+pairTypeFirst x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.model.PairType"),+ Model.projectionFieldName = (Model.Name "first")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.model.PairType+pairTypePairType :: Typed.TypedName Model.PairType+pairTypePairType = Typed.TypedName (Model.Name "hydra.core.model.PairType")++-- | DSL accessor for the second field of hydra.core.model.PairType+pairTypeSecond :: Typed.TypedTerm Model.PairType -> Typed.TypedTerm Model.Type+pairTypeSecond x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.model.PairType"),+ Model.projectionFieldName = (Model.Name "second")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL updater for the first field of hydra.core.model.PairType+pairTypeWithFirst :: Typed.TypedTerm Model.PairType -> Typed.TypedTerm Model.Type -> Typed.TypedTerm Model.PairType+pairTypeWithFirst original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.model.PairType"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "first"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "second"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.model.PairType"),+ Model.projectionFieldName = (Model.Name "second")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the second field of hydra.core.model.PairType+pairTypeWithSecond :: Typed.TypedTerm Model.PairType -> Typed.TypedTerm Model.Type -> Typed.TypedTerm Model.PairType+pairTypeWithSecond original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.model.PairType"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "first"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.model.PairType"),+ Model.projectionFieldName = (Model.Name "first")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "second"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL constructor for hydra.core.model.Projection+projection :: Typed.TypedTerm Model.Name -> Typed.TypedTerm Model.Name -> Typed.TypedTerm Model.Projection+projection typeName fieldName =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.model.Projection"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "typeName"),+ Model.fieldTerm = (Typed.unTypedTerm typeName)},+ Model.Field {+ Model.fieldName = (Model.Name "fieldName"),+ Model.fieldTerm = (Typed.unTypedTerm fieldName)}]}))++-- | DSL accessor for the fieldName field of hydra.core.model.Projection+projectionFieldName :: Typed.TypedTerm Model.Projection -> Typed.TypedTerm Model.Name+projectionFieldName x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.model.Projection"),+ Model.projectionFieldName = (Model.Name "fieldName")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.model.Projection+projectionProjection :: Typed.TypedName Model.Projection+projectionProjection = Typed.TypedName (Model.Name "hydra.core.model.Projection")++-- | DSL accessor for the typeName field of hydra.core.model.Projection+projectionTypeName :: Typed.TypedTerm Model.Projection -> Typed.TypedTerm Model.Name+projectionTypeName x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.model.Projection"),+ Model.projectionFieldName = (Model.Name "typeName")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL updater for the fieldName field of hydra.core.model.Projection+projectionWithFieldName :: Typed.TypedTerm Model.Projection -> Typed.TypedTerm Model.Name -> Typed.TypedTerm Model.Projection+projectionWithFieldName original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.model.Projection"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "typeName"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.model.Projection"),+ Model.projectionFieldName = (Model.Name "typeName")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "fieldName"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL updater for the typeName field of hydra.core.model.Projection+projectionWithTypeName :: Typed.TypedTerm Model.Projection -> Typed.TypedTerm Model.Name -> Typed.TypedTerm Model.Projection+projectionWithTypeName original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.model.Projection"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "typeName"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "fieldName"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.model.Projection"),+ Model.projectionFieldName = (Model.Name "fieldName")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL constructor for hydra.core.model.Record+record :: Typed.TypedTerm Model.Name -> Typed.TypedTerm [Model.Field] -> Typed.TypedTerm Model.Record+record typeName fields =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.model.Record"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "typeName"),+ Model.fieldTerm = (Typed.unTypedTerm typeName)},+ Model.Field {+ Model.fieldName = (Model.Name "fields"),+ Model.fieldTerm = (Typed.unTypedTerm fields)}]}))++-- | DSL accessor for the fields field of hydra.core.model.Record+recordFields :: Typed.TypedTerm Model.Record -> Typed.TypedTerm [Model.Field]+recordFields x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.model.Record"),+ Model.projectionFieldName = (Model.Name "fields")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.model.Record+recordRecord :: Typed.TypedName Model.Record+recordRecord = Typed.TypedName (Model.Name "hydra.core.model.Record")++-- | DSL accessor for the typeName field of hydra.core.model.Record+recordTypeName :: Typed.TypedTerm Model.Record -> Typed.TypedTerm Model.Name+recordTypeName x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.model.Record"),+ Model.projectionFieldName = (Model.Name "typeName")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL updater for the fields field of hydra.core.model.Record+recordWithFields :: Typed.TypedTerm Model.Record -> Typed.TypedTerm [Model.Field] -> Typed.TypedTerm Model.Record+recordWithFields original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.model.Record"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "typeName"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.model.Record"),+ Model.projectionFieldName = (Model.Name "typeName")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "fields"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL updater for the typeName field of hydra.core.model.Record+recordWithTypeName :: Typed.TypedTerm Model.Record -> Typed.TypedTerm Model.Name -> Typed.TypedTerm Model.Record+recordWithTypeName original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.model.Record"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "typeName"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "fields"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.model.Record"),+ Model.projectionFieldName = (Model.Name "fields")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL injection for the annotated variant of hydra.core.model.Term+termAnnotated :: Typed.TypedTerm Model.AnnotatedTerm -> Typed.TypedTerm Model.Term+termAnnotated x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.Term"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "annotated"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the application variant of hydra.core.model.Term+termApplication :: Typed.TypedTerm Model.Application -> Typed.TypedTerm Model.Term+termApplication x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.Term"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "application"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the cases variant of hydra.core.model.Term+termCases :: Typed.TypedTerm Model.CaseStatement -> Typed.TypedTerm Model.Term+termCases x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.Term"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "cases"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the either variant of hydra.core.model.Term+termEither :: Typed.TypedTerm (Either Model.Term Model.Term) -> Typed.TypedTerm Model.Term+termEither x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.Term"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "either"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the inject variant of hydra.core.model.Term+termInject :: Typed.TypedTerm Model.Injection -> Typed.TypedTerm Model.Term+termInject x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.Term"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "inject"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the lambda variant of hydra.core.model.Term+termLambda :: Typed.TypedTerm Model.Lambda -> Typed.TypedTerm Model.Term+termLambda x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.Term"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "lambda"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the let variant of hydra.core.model.Term+termLet :: Typed.TypedTerm Model.Let -> Typed.TypedTerm Model.Term+termLet x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.Term"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "let"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the list variant of hydra.core.model.Term+termList :: Typed.TypedTerm [Model.Term] -> Typed.TypedTerm Model.Term+termList x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.Term"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "list"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the literal variant of hydra.core.model.Term+termLiteral :: Typed.TypedTerm Model.Literal -> Typed.TypedTerm Model.Term+termLiteral x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.Term"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "literal"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the map variant of hydra.core.model.Term+termMap :: Typed.TypedTerm (M.Map Model.Term Model.Term) -> Typed.TypedTerm Model.Term+termMap x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.Term"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "map"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the optional variant of hydra.core.model.Term+termOptional :: Typed.TypedTerm (Maybe Model.Term) -> Typed.TypedTerm Model.Term+termOptional x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.Term"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "optional"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the pair variant of hydra.core.model.Term+termPair :: Typed.TypedTerm (Model.Term, Model.Term) -> Typed.TypedTerm Model.Term+termPair x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.Term"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "pair"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the project variant of hydra.core.model.Term+termProject :: Typed.TypedTerm Model.Projection -> Typed.TypedTerm Model.Term+termProject x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.Term"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "project"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the record variant of hydra.core.model.Term+termRecord :: Typed.TypedTerm Model.Record -> Typed.TypedTerm Model.Term+termRecord x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.Term"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "record"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the set variant of hydra.core.model.Term+termSet :: Typed.TypedTerm (S.Set Model.Term) -> Typed.TypedTerm Model.Term+termSet x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.Term"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "set"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL name token for hydra.core.model.Term+termTerm :: Typed.TypedName Model.Term+termTerm = Typed.TypedName (Model.Name "hydra.core.model.Term")++-- | DSL injection for the typeApplication variant of hydra.core.model.Term+termTypeApplication :: Typed.TypedTerm Model.TypeApplicationTerm -> Typed.TypedTerm Model.Term+termTypeApplication x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.Term"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "typeApplication"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the typeLambda variant of hydra.core.model.Term+termTypeLambda :: Typed.TypedTerm Model.TypeLambda -> Typed.TypedTerm Model.Term+termTypeLambda x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.Term"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "typeLambda"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the unit variant of hydra.core.model.Term+termUnit :: Typed.TypedTerm Model.Term+termUnit =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.Term"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "unit"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL injection for the unwrap variant of hydra.core.model.Term+termUnwrap :: Typed.TypedTerm Model.Name -> Typed.TypedTerm Model.Term+termUnwrap x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.Term"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "unwrap"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the variable variant of hydra.core.model.Term+termVariable :: Typed.TypedTerm Model.Name -> Typed.TypedTerm Model.Term+termVariable x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.Term"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "variable"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the wrap variant of hydra.core.model.Term+termWrap :: Typed.TypedTerm Model.WrappedTerm -> Typed.TypedTerm Model.Term+termWrap x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.Term"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "wrap"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the annotated variant of hydra.core.model.Type+typeAnnotated :: Typed.TypedTerm Model.AnnotatedType -> Typed.TypedTerm Model.Type+typeAnnotated x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.Type"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "annotated"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the application variant of hydra.core.model.Type+typeApplication :: Typed.TypedTerm Model.ApplicationType -> Typed.TypedTerm Model.Type+typeApplication x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.Type"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "application"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL constructor for hydra.core.model.TypeApplicationTerm+typeApplicationTerm :: Typed.TypedTerm Model.Term -> Typed.TypedTerm Model.Type -> Typed.TypedTerm Model.TypeApplicationTerm+typeApplicationTerm body type_ =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.model.TypeApplicationTerm"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "body"),+ Model.fieldTerm = (Typed.unTypedTerm body)},+ Model.Field {+ Model.fieldName = (Model.Name "type"),+ Model.fieldTerm = (Typed.unTypedTerm type_)}]}))++-- | DSL accessor for the body field of hydra.core.model.TypeApplicationTerm+typeApplicationTermBody :: Typed.TypedTerm Model.TypeApplicationTerm -> Typed.TypedTerm Model.Term+typeApplicationTermBody x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.model.TypeApplicationTerm"),+ Model.projectionFieldName = (Model.Name "body")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the type field of hydra.core.model.TypeApplicationTerm+typeApplicationTermType :: Typed.TypedTerm Model.TypeApplicationTerm -> Typed.TypedTerm Model.Type+typeApplicationTermType x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.model.TypeApplicationTerm"),+ Model.projectionFieldName = (Model.Name "type")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.model.TypeApplicationTerm+typeApplicationTermTypeApplicationTerm :: Typed.TypedName Model.TypeApplicationTerm+typeApplicationTermTypeApplicationTerm = Typed.TypedName (Model.Name "hydra.core.model.TypeApplicationTerm")++-- | DSL updater for the body field of hydra.core.model.TypeApplicationTerm+typeApplicationTermWithBody :: Typed.TypedTerm Model.TypeApplicationTerm -> Typed.TypedTerm Model.Term -> Typed.TypedTerm Model.TypeApplicationTerm+typeApplicationTermWithBody original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.model.TypeApplicationTerm"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "body"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "type"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.model.TypeApplicationTerm"),+ Model.projectionFieldName = (Model.Name "type")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the type field of hydra.core.model.TypeApplicationTerm+typeApplicationTermWithType :: Typed.TypedTerm Model.TypeApplicationTerm -> Typed.TypedTerm Model.Type -> Typed.TypedTerm Model.TypeApplicationTerm+typeApplicationTermWithType original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.model.TypeApplicationTerm"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "body"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.model.TypeApplicationTerm"),+ Model.projectionFieldName = (Model.Name "body")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "type"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL injection for the simple variant of hydra.core.model.TypeClassConstraint+typeClassConstraintSimple :: Typed.TypedTerm Model.Name -> Typed.TypedTerm Model.TypeClassConstraint+typeClassConstraintSimple x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.TypeClassConstraint"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "simple"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL name token for hydra.core.model.TypeClassConstraint+typeClassConstraintTypeClassConstraint :: Typed.TypedName Model.TypeClassConstraint+typeClassConstraintTypeClassConstraint = Typed.TypedName (Model.Name "hydra.core.model.TypeClassConstraint")++-- | DSL injection for the effect variant of hydra.core.model.Type+typeEffect :: Typed.TypedTerm Model.Type -> Typed.TypedTerm Model.Type+typeEffect x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.Type"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "effect"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the either variant of hydra.core.model.Type+typeEither :: Typed.TypedTerm Model.EitherType -> Typed.TypedTerm Model.Type+typeEither x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.Type"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "either"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the forall variant of hydra.core.model.Type+typeForall :: Typed.TypedTerm Model.ForallType -> Typed.TypedTerm Model.Type+typeForall x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.Type"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "forall"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the function variant of hydra.core.model.Type+typeFunction :: Typed.TypedTerm Model.FunctionType -> Typed.TypedTerm Model.Type+typeFunction x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.Type"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "function"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL constructor for hydra.core.model.TypeLambda+typeLambda :: Typed.TypedTerm Model.Name -> Typed.TypedTerm Model.Term -> Typed.TypedTerm Model.TypeLambda+typeLambda parameter body =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.model.TypeLambda"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "parameter"),+ Model.fieldTerm = (Typed.unTypedTerm parameter)},+ Model.Field {+ Model.fieldName = (Model.Name "body"),+ Model.fieldTerm = (Typed.unTypedTerm body)}]}))++-- | DSL accessor for the body field of hydra.core.model.TypeLambda+typeLambdaBody :: Typed.TypedTerm Model.TypeLambda -> Typed.TypedTerm Model.Term+typeLambdaBody x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.model.TypeLambda"),+ Model.projectionFieldName = (Model.Name "body")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the parameter field of hydra.core.model.TypeLambda+typeLambdaParameter :: Typed.TypedTerm Model.TypeLambda -> Typed.TypedTerm Model.Name+typeLambdaParameter x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.model.TypeLambda"),+ Model.projectionFieldName = (Model.Name "parameter")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.model.TypeLambda+typeLambdaTypeLambda :: Typed.TypedName Model.TypeLambda+typeLambdaTypeLambda = Typed.TypedName (Model.Name "hydra.core.model.TypeLambda")++-- | DSL updater for the body field of hydra.core.model.TypeLambda+typeLambdaWithBody :: Typed.TypedTerm Model.TypeLambda -> Typed.TypedTerm Model.Term -> Typed.TypedTerm Model.TypeLambda+typeLambdaWithBody original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.model.TypeLambda"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "parameter"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.model.TypeLambda"),+ Model.projectionFieldName = (Model.Name "parameter")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "body"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL updater for the parameter field of hydra.core.model.TypeLambda+typeLambdaWithParameter :: Typed.TypedTerm Model.TypeLambda -> Typed.TypedTerm Model.Name -> Typed.TypedTerm Model.TypeLambda+typeLambdaWithParameter original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.model.TypeLambda"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "parameter"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "body"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.model.TypeLambda"),+ Model.projectionFieldName = (Model.Name "body")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL injection for the list variant of hydra.core.model.Type+typeList :: Typed.TypedTerm Model.Type -> Typed.TypedTerm Model.Type+typeList x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.Type"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "list"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the literal variant of hydra.core.model.Type+typeLiteral :: Typed.TypedTerm Model.LiteralType -> Typed.TypedTerm Model.Type+typeLiteral x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.Type"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "literal"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the map variant of hydra.core.model.Type+typeMap :: Typed.TypedTerm Model.MapType -> Typed.TypedTerm Model.Type+typeMap x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.Type"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "map"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the optional variant of hydra.core.model.Type+typeOptional :: Typed.TypedTerm Model.Type -> Typed.TypedTerm Model.Type+typeOptional x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.Type"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "optional"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the pair variant of hydra.core.model.Type+typePair :: Typed.TypedTerm Model.PairType -> Typed.TypedTerm Model.Type+typePair x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.Type"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "pair"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the record variant of hydra.core.model.Type+typeRecord :: Typed.TypedTerm [Model.FieldType] -> Typed.TypedTerm Model.Type+typeRecord x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.Type"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "record"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL constructor for hydra.core.model.TypeScheme+typeScheme :: Typed.TypedTerm [Model.Name] -> Typed.TypedTerm Model.Type -> Typed.TypedTerm (M.Map Model.Name Model.TypeVariableConstraints) -> Typed.TypedTerm Model.TypeScheme+typeScheme variables body constraints =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.model.TypeScheme"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "variables"),+ Model.fieldTerm = (Typed.unTypedTerm variables)},+ Model.Field {+ Model.fieldName = (Model.Name "body"),+ Model.fieldTerm = (Typed.unTypedTerm body)},+ Model.Field {+ Model.fieldName = (Model.Name "constraints"),+ Model.fieldTerm = (Typed.unTypedTerm constraints)}]}))++-- | DSL accessor for the body field of hydra.core.model.TypeScheme+typeSchemeBody :: Typed.TypedTerm Model.TypeScheme -> Typed.TypedTerm Model.Type+typeSchemeBody x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.model.TypeScheme"),+ Model.projectionFieldName = (Model.Name "body")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the constraints field of hydra.core.model.TypeScheme+typeSchemeConstraints :: Typed.TypedTerm Model.TypeScheme -> Typed.TypedTerm (M.Map Model.Name Model.TypeVariableConstraints)+typeSchemeConstraints x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.model.TypeScheme"),+ Model.projectionFieldName = (Model.Name "constraints")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.model.TypeScheme+typeSchemeTypeScheme :: Typed.TypedName Model.TypeScheme+typeSchemeTypeScheme = Typed.TypedName (Model.Name "hydra.core.model.TypeScheme")++-- | DSL accessor for the variables field of hydra.core.model.TypeScheme+typeSchemeVariables :: Typed.TypedTerm Model.TypeScheme -> Typed.TypedTerm [Model.Name]+typeSchemeVariables x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.model.TypeScheme"),+ Model.projectionFieldName = (Model.Name "variables")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL updater for the body field of hydra.core.model.TypeScheme+typeSchemeWithBody :: Typed.TypedTerm Model.TypeScheme -> Typed.TypedTerm Model.Type -> Typed.TypedTerm Model.TypeScheme+typeSchemeWithBody original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.model.TypeScheme"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "variables"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.model.TypeScheme"),+ Model.projectionFieldName = (Model.Name "variables")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "body"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "constraints"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.model.TypeScheme"),+ Model.projectionFieldName = (Model.Name "constraints")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the constraints field of hydra.core.model.TypeScheme+typeSchemeWithConstraints :: Typed.TypedTerm Model.TypeScheme -> Typed.TypedTerm (M.Map Model.Name Model.TypeVariableConstraints) -> Typed.TypedTerm Model.TypeScheme+typeSchemeWithConstraints original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.model.TypeScheme"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "variables"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.model.TypeScheme"),+ Model.projectionFieldName = (Model.Name "variables")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "body"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.model.TypeScheme"),+ Model.projectionFieldName = (Model.Name "body")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "constraints"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL updater for the variables field of hydra.core.model.TypeScheme+typeSchemeWithVariables :: Typed.TypedTerm Model.TypeScheme -> Typed.TypedTerm [Model.Name] -> Typed.TypedTerm Model.TypeScheme+typeSchemeWithVariables original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.model.TypeScheme"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "variables"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "body"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.model.TypeScheme"),+ Model.projectionFieldName = (Model.Name "body")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "constraints"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.model.TypeScheme"),+ Model.projectionFieldName = (Model.Name "constraints")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL injection for the set variant of hydra.core.model.Type+typeSet :: Typed.TypedTerm Model.Type -> Typed.TypedTerm Model.Type+typeSet x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.Type"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "set"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL name token for hydra.core.model.Type+typeType :: Typed.TypedName Model.Type+typeType = Typed.TypedName (Model.Name "hydra.core.model.Type")++-- | DSL injection for the union variant of hydra.core.model.Type+typeUnion :: Typed.TypedTerm [Model.FieldType] -> Typed.TypedTerm Model.Type+typeUnion x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.Type"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "union"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the unit variant of hydra.core.model.Type+typeUnit :: Typed.TypedTerm Model.Type+typeUnit =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.Type"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "unit"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL injection for the variable variant of hydra.core.model.Type+typeVariable :: Typed.TypedTerm Model.Name -> Typed.TypedTerm Model.Type+typeVariable x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.Type"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "variable"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL constructor for hydra.core.model.TypeVariableConstraints+typeVariableConstraints :: Typed.TypedTerm (S.Set Model.TypeClassConstraint) -> Typed.TypedTerm Model.TypeVariableConstraints+typeVariableConstraints classes =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.model.TypeVariableConstraints"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "classes"),+ Model.fieldTerm = (Typed.unTypedTerm classes)}]}))++-- | DSL accessor for the classes field of hydra.core.model.TypeVariableConstraints+typeVariableConstraintsClasses :: Typed.TypedTerm Model.TypeVariableConstraints -> Typed.TypedTerm (S.Set Model.TypeClassConstraint)+typeVariableConstraintsClasses x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.model.TypeVariableConstraints"),+ Model.projectionFieldName = (Model.Name "classes")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.model.TypeVariableConstraints+typeVariableConstraintsTypeVariableConstraints :: Typed.TypedName Model.TypeVariableConstraints+typeVariableConstraintsTypeVariableConstraints = Typed.TypedName (Model.Name "hydra.core.model.TypeVariableConstraints")++-- | DSL updater for the classes field of hydra.core.model.TypeVariableConstraints+typeVariableConstraintsWithClasses :: Typed.TypedTerm Model.TypeVariableConstraints -> Typed.TypedTerm (S.Set Model.TypeClassConstraint) -> Typed.TypedTerm Model.TypeVariableConstraints+typeVariableConstraintsWithClasses original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.model.TypeVariableConstraints"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "classes"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL injection for the void variant of hydra.core.model.Type+typeVoid :: Typed.TypedTerm Model.Type+typeVoid =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.Type"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "void"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL injection for the wrap variant of hydra.core.model.Type+typeWrap :: Typed.TypedTerm Model.Type -> Typed.TypedTerm Model.Type+typeWrap x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.Type"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "wrap"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL accessor for the body of hydra.core.model.Name+unName :: Typed.TypedTerm Model.Name -> Typed.TypedTerm String+unName x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermUnwrap (Model.Name "hydra.core.model.Name")),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL constructor for hydra.core.model.WrappedTerm+wrappedTerm :: Typed.TypedTerm Model.Name -> Typed.TypedTerm Model.Term -> Typed.TypedTerm Model.WrappedTerm+wrappedTerm typeName body =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.model.WrappedTerm"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "typeName"),+ Model.fieldTerm = (Typed.unTypedTerm typeName)},+ Model.Field {+ Model.fieldName = (Model.Name "body"),+ Model.fieldTerm = (Typed.unTypedTerm body)}]}))++-- | DSL accessor for the body field of hydra.core.model.WrappedTerm+wrappedTermBody :: Typed.TypedTerm Model.WrappedTerm -> Typed.TypedTerm Model.Term+wrappedTermBody x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.model.WrappedTerm"),+ Model.projectionFieldName = (Model.Name "body")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the typeName field of hydra.core.model.WrappedTerm+wrappedTermTypeName :: Typed.TypedTerm Model.WrappedTerm -> Typed.TypedTerm Model.Name+wrappedTermTypeName x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.model.WrappedTerm"),+ Model.projectionFieldName = (Model.Name "typeName")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL updater for the body field of hydra.core.model.WrappedTerm+wrappedTermWithBody :: Typed.TypedTerm Model.WrappedTerm -> Typed.TypedTerm Model.Term -> Typed.TypedTerm Model.WrappedTerm+wrappedTermWithBody original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.model.WrappedTerm"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "typeName"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.model.WrappedTerm"),+ Model.projectionFieldName = (Model.Name "typeName")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "body"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL updater for the typeName field of hydra.core.model.WrappedTerm+wrappedTermWithTypeName :: Typed.TypedTerm Model.WrappedTerm -> Typed.TypedTerm Model.Name -> Typed.TypedTerm Model.WrappedTerm+wrappedTermWithTypeName original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.model.WrappedTerm"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "typeName"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "body"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.model.WrappedTerm"),+ Model.projectionFieldName = (Model.Name "body")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL name token for hydra.core.model.WrappedTerm+wrappedTermWrappedTerm :: Typed.TypedName Model.WrappedTerm+wrappedTermWrappedTerm = Typed.TypedName (Model.Name "hydra.core.model.WrappedTerm")
@@ -0,0 +1,252 @@+-- Note: this is an automatically generated file. Do not edit.++-- | DSL functions for hydra.core.names++module Hydra.Core.Dsl.Names where++import qualified Hydra.Core.Annotations as Annotations+import qualified Hydra.Core.Ast as Ast+import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Constants as Constants+import qualified Hydra.Core.Diff as Diff+import qualified Hydra.Core.Docs as Docs+import qualified Hydra.Core.Dsl.Annotations as DslAnnotations+import qualified Hydra.Core.Dsl.Ast as DslAst+import qualified Hydra.Core.Dsl.Coders as DslCoders+import qualified Hydra.Core.Dsl.Constants as DslConstants+import qualified Hydra.Core.Dsl.Diff as DslDiff+import qualified Hydra.Core.Dsl.Docs as DslDocs+import qualified Hydra.Core.Dsl.Error.Checking as ErrorChecking+import qualified Hydra.Core.Dsl.Error.File as DslErrorFile+import qualified Hydra.Core.Dsl.Error.Model as DslErrorModel+import qualified Hydra.Core.Dsl.Error.Packaging as DslErrorPackaging+import qualified Hydra.Core.Dsl.Error.System as DslErrorSystem+import qualified Hydra.Core.Dsl.Errors as DslErrors+import qualified Hydra.Core.Dsl.File as DslFile+import qualified Hydra.Core.Dsl.Formatting as DslFormatting+import qualified Hydra.Core.Dsl.Graph as DslGraph+import qualified Hydra.Core.Dsl.Json.Model as DslJsonModel+import qualified Hydra.Core.Dsl.Markdown as DslMarkdown+import qualified Hydra.Core.Dsl.Model as DslModel+import qualified Hydra.Core.Dsl.Packaging as DslPackaging+import qualified Hydra.Core.Dsl.Parsing as DslParsing+import qualified Hydra.Core.Dsl.Paths as DslPaths+import qualified Hydra.Core.Dsl.Query as DslQuery+import qualified Hydra.Core.Dsl.Regex as DslRegex+import qualified Hydra.Core.Dsl.Relational as DslRelational+import qualified Hydra.Core.Dsl.System as DslSystem+import qualified Hydra.Core.Dsl.Tabular as DslTabular+import qualified Hydra.Core.Dsl.Testing as DslTesting+import qualified Hydra.Core.Dsl.Time as DslTime+import qualified Hydra.Core.Dsl.Topology as DslTopology+import qualified Hydra.Core.Dsl.Typing as DslTyping+import qualified Hydra.Core.Dsl.Util as DslUtil+import qualified Hydra.Core.Dsl.Validation as DslValidation+import qualified Hydra.Core.Dsl.Variants as DslVariants+import qualified Hydra.Core.Error.Checking as Checking+import qualified Hydra.Core.Error.File as ErrorFile+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Error.Packaging as ErrorPackaging+import qualified Hydra.Core.Error.System as ErrorSystem+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Formatting as Formatting+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Json.Model as JsonModel+import qualified Hydra.Core.Markdown as Markdown+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Names as Names+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Parsing as Parsing+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Query as Query+import qualified Hydra.Core.Regex as Regex+import qualified Hydra.Core.Relational as Relational+import qualified Hydra.Core.System as System+import qualified Hydra.Core.Tabular as Tabular+import qualified Hydra.Core.Testing as Testing+import qualified Hydra.Core.Time as Time+import qualified Hydra.Core.Topology as Topology+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Validation as Validation+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void+import qualified Data.Map as M+import qualified Data.Set as S++-- | DSL reference to hydra.core.names.chooseUniqueLabel+chooseUniqueLabel :: Typed.TypedTerm (S.Set String) -> Typed.TypedTerm String -> Typed.TypedTerm String+chooseUniqueLabel arg0 arg1 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.names.chooseUniqueLabel")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)}))++-- | DSL reference to hydra.core.names.compactName+compactName :: Typed.TypedTerm (M.Map Packaging.ModuleName String) -> Typed.TypedTerm Model.Name -> Typed.TypedTerm String+compactName arg0 arg1 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.names.compactName")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)}))++-- | DSL reference to hydra.core.names.composeProvisionName+composeProvisionName :: Typed.TypedTerm Model.Name -> Typed.TypedTerm String -> Typed.TypedTerm Model.Name+composeProvisionName arg0 arg1 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.names.composeProvisionName")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)}))++-- | DSL reference to hydra.core.names.derivedBindingName+derivedBindingName :: Typed.TypedTerm [String] -> Typed.TypedTerm t0 -> Typed.TypedTerm Model.Name -> Typed.TypedTerm Model.Name+derivedBindingName arg0 arg1 arg2 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.names.derivedBindingName")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)})),+ Model.applicationArgument = (Typed.unTypedTerm arg2)}))++-- | DSL reference to hydra.core.names.derivedDefinitionName+derivedDefinitionName :: Typed.TypedTerm [String] -> Typed.TypedTerm t0 -> Typed.TypedTerm Bool -> Typed.TypedTerm Model.Name -> Typed.TypedTerm String -> Typed.TypedTerm Model.Name+derivedDefinitionName arg0 arg1 arg2 arg3 arg4 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.names.derivedDefinitionName")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)})),+ Model.applicationArgument = (Typed.unTypedTerm arg2)})),+ Model.applicationArgument = (Typed.unTypedTerm arg3)})),+ Model.applicationArgument = (Typed.unTypedTerm arg4)}))++-- | DSL reference to hydra.core.names.derivedModuleName+derivedModuleName :: Typed.TypedTerm [String] -> Typed.TypedTerm t0 -> Typed.TypedTerm Packaging.ModuleName -> Typed.TypedTerm Packaging.ModuleName+derivedModuleName arg0 arg1 arg2 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.names.derivedModuleName")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)})),+ Model.applicationArgument = (Typed.unTypedTerm arg2)}))++-- | DSL reference to hydra.core.names.freshName+freshName :: Typed.TypedTerm Typing.InferenceContext -> Typed.TypedTerm (Model.Name, Typing.InferenceContext)+freshName arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.names.freshName")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.names.freshNames+freshNames :: Typed.TypedTerm Int -> Typed.TypedTerm Typing.InferenceContext -> Typed.TypedTerm ([Model.Name], Typing.InferenceContext)+freshNames arg0 arg1 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.names.freshNames")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)}))++-- | DSL reference to hydra.core.names.localNameOf+localNameOf :: Typed.TypedTerm Model.Name -> Typed.TypedTerm String+localNameOf arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.names.localNameOf")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.names.moduleNameOf+moduleNameOf :: Typed.TypedTerm Model.Name -> Typed.TypedTerm (Maybe Packaging.ModuleName)+moduleNameOf arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.names.moduleNameOf")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.names.moduleNameToFilePath+moduleNameToFilePath :: Typed.TypedTerm Util.CaseConvention -> Typed.TypedTerm File.FileExtension -> Typed.TypedTerm Packaging.ModuleName -> Typed.TypedTerm String+moduleNameToFilePath arg0 arg1 arg2 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.names.moduleNameToFilePath")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)})),+ Model.applicationArgument = (Typed.unTypedTerm arg2)}))++-- | DSL reference to hydra.core.names.nameToFilePath+nameToFilePath :: Typed.TypedTerm Util.CaseConvention -> Typed.TypedTerm Util.CaseConvention -> Typed.TypedTerm File.FileExtension -> Typed.TypedTerm Model.Name -> Typed.TypedTerm String+nameToFilePath arg0 arg1 arg2 arg3 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.names.nameToFilePath")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)})),+ Model.applicationArgument = (Typed.unTypedTerm arg2)})),+ Model.applicationArgument = (Typed.unTypedTerm arg3)}))++-- | DSL reference to hydra.core.names.nameToUpperDashed+nameToUpperDashed :: Typed.TypedTerm Model.Name -> Typed.TypedTerm String+nameToUpperDashed arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.names.nameToUpperDashed")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.names.normalTypeVariable+normalTypeVariable :: Typed.TypedTerm Int -> Typed.TypedTerm Model.Name+normalTypeVariable arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.names.normalTypeVariable")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.names.pushSubtermStep+pushSubtermStep :: Typed.TypedTerm Paths.SubtermStep -> Typed.TypedTerm Typing.InferenceContext -> Typed.TypedTerm Typing.InferenceContext+pushSubtermStep arg0 arg1 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.names.pushSubtermStep")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)}))++-- | DSL reference to hydra.core.names.qname+qname :: Typed.TypedTerm Packaging.ModuleName -> Typed.TypedTerm String -> Typed.TypedTerm Model.Name+qname arg0 arg1 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.names.qname")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)}))++-- | DSL reference to hydra.core.names.qualifyName+qualifyName :: Typed.TypedTerm Model.Name -> Typed.TypedTerm Util.QualifiedName+qualifyName arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.names.qualifyName")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.names.restoreTrace+restoreTrace :: Typed.TypedTerm Typing.InferenceContext -> Typed.TypedTerm Typing.InferenceContext -> Typed.TypedTerm Typing.InferenceContext+restoreTrace arg0 arg1 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.names.restoreTrace")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)}))++-- | DSL reference to hydra.core.names.unqualifyName+unqualifyName :: Typed.TypedTerm Util.QualifiedName -> Typed.TypedTerm Model.Name+unqualifyName arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.names.unqualifyName")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))
@@ -0,0 +1,2011 @@+-- Note: this is an automatically generated file. Do not edit.++-- | DSL functions for hydra.core.packaging++module Hydra.Core.Dsl.Packaging where++import qualified Hydra.Core.Decode.Packaging as DecodePackaging+import qualified Hydra.Core.Dsl.Model as DslModel+import qualified Hydra.Core.Dsl.Typing as DslTyping+import qualified Hydra.Core.Encode.Packaging as EncodePackaging+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | DSL name token for hydra.core.packaging.Definition+definitionDefinition :: Typed.TypedName Packaging.Definition+definitionDefinition = Typed.TypedName (Model.Name "hydra.core.packaging.Definition")++-- | DSL injection for the primitive variant of hydra.core.packaging.Definition+definitionPrimitive :: Typed.TypedTerm Packaging.PrimitiveDefinition -> Typed.TypedTerm Packaging.Definition+definitionPrimitive x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.packaging.Definition"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "primitive"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL name token for hydra.core.packaging.DefinitionReference+definitionReferenceDefinitionReference :: Typed.TypedName Packaging.DefinitionReference+definitionReferenceDefinitionReference = Typed.TypedName (Model.Name "hydra.core.packaging.DefinitionReference")++-- | DSL injection for the primitive variant of hydra.core.packaging.DefinitionReference+definitionReferencePrimitive :: Typed.TypedTerm Model.Name -> Typed.TypedTerm Packaging.DefinitionReference+definitionReferencePrimitive x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.packaging.DefinitionReference"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "primitive"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the term variant of hydra.core.packaging.DefinitionReference+definitionReferenceTerm :: Typed.TypedTerm Model.Name -> Typed.TypedTerm Packaging.DefinitionReference+definitionReferenceTerm x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.packaging.DefinitionReference"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "term"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the type variant of hydra.core.packaging.DefinitionReference+definitionReferenceType :: Typed.TypedTerm Model.Name -> Typed.TypedTerm Packaging.DefinitionReference+definitionReferenceType x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.packaging.DefinitionReference"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "type"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the term variant of hydra.core.packaging.Definition+definitionTerm :: Typed.TypedTerm Packaging.TermDefinition -> Typed.TypedTerm Packaging.Definition+definitionTerm x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.packaging.Definition"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "term"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the type variant of hydra.core.packaging.Definition+definitionType :: Typed.TypedTerm Packaging.TypeDefinition -> Typed.TypedTerm Packaging.Definition+definitionType x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.packaging.Definition"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "type"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the api variant of hydra.core.packaging.DependencyScope+dependencyScopeApi :: Typed.TypedTerm Packaging.DependencyScope+dependencyScopeApi =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.packaging.DependencyScope"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "api"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL name token for hydra.core.packaging.DependencyScope+dependencyScopeDependencyScope :: Typed.TypedName Packaging.DependencyScope+dependencyScopeDependencyScope = Typed.TypedName (Model.Name "hydra.core.packaging.DependencyScope")++-- | DSL injection for the runtime variant of hydra.core.packaging.DependencyScope+dependencyScopeRuntime :: Typed.TypedTerm Packaging.DependencyScope+dependencyScopeRuntime =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.packaging.DependencyScope"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "runtime"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL injection for the test variant of hydra.core.packaging.DependencyScope+dependencyScopeTest :: Typed.TypedTerm Packaging.DependencyScope+dependencyScopeTest =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.packaging.DependencyScope"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "test"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL injection for the tool variant of hydra.core.packaging.DependencyScope+dependencyScopeTool :: Typed.TypedTerm Packaging.DependencyScope+dependencyScopeTool =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.packaging.DependencyScope"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "tool"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL constructor for hydra.core.packaging.EntityMetadata+entityMetadata :: Typed.TypedTerm (Maybe String) -> Typed.TypedTerm [String] -> Typed.TypedTerm [Packaging.EntityReference] -> Typed.TypedTerm (Maybe Packaging.LifecycleInfo) -> Typed.TypedTerm [Packaging.Provision] -> Typed.TypedTerm Packaging.EntityMetadata+entityMetadata description comments seeAlso lifecycle provisions =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.packaging.EntityMetadata"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "description"),+ Model.fieldTerm = (Typed.unTypedTerm description)},+ Model.Field {+ Model.fieldName = (Model.Name "comments"),+ Model.fieldTerm = (Typed.unTypedTerm comments)},+ Model.Field {+ Model.fieldName = (Model.Name "seeAlso"),+ Model.fieldTerm = (Typed.unTypedTerm seeAlso)},+ Model.Field {+ Model.fieldName = (Model.Name "lifecycle"),+ Model.fieldTerm = (Typed.unTypedTerm lifecycle)},+ Model.Field {+ Model.fieldName = (Model.Name "provisions"),+ Model.fieldTerm = (Typed.unTypedTerm provisions)}]}))++-- | DSL accessor for the comments field of hydra.core.packaging.EntityMetadata+entityMetadataComments :: Typed.TypedTerm Packaging.EntityMetadata -> Typed.TypedTerm [String]+entityMetadataComments x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.EntityMetadata"),+ Model.projectionFieldName = (Model.Name "comments")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the description field of hydra.core.packaging.EntityMetadata+entityMetadataDescription :: Typed.TypedTerm Packaging.EntityMetadata -> Typed.TypedTerm (Maybe String)+entityMetadataDescription x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.EntityMetadata"),+ Model.projectionFieldName = (Model.Name "description")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.packaging.EntityMetadata+entityMetadataEntityMetadata :: Typed.TypedName Packaging.EntityMetadata+entityMetadataEntityMetadata = Typed.TypedName (Model.Name "hydra.core.packaging.EntityMetadata")++-- | DSL accessor for the lifecycle field of hydra.core.packaging.EntityMetadata+entityMetadataLifecycle :: Typed.TypedTerm Packaging.EntityMetadata -> Typed.TypedTerm (Maybe Packaging.LifecycleInfo)+entityMetadataLifecycle x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.EntityMetadata"),+ Model.projectionFieldName = (Model.Name "lifecycle")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the provisions field of hydra.core.packaging.EntityMetadata+entityMetadataProvisions :: Typed.TypedTerm Packaging.EntityMetadata -> Typed.TypedTerm [Packaging.Provision]+entityMetadataProvisions x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.EntityMetadata"),+ Model.projectionFieldName = (Model.Name "provisions")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the seeAlso field of hydra.core.packaging.EntityMetadata+entityMetadataSeeAlso :: Typed.TypedTerm Packaging.EntityMetadata -> Typed.TypedTerm [Packaging.EntityReference]+entityMetadataSeeAlso x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.EntityMetadata"),+ Model.projectionFieldName = (Model.Name "seeAlso")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL updater for the comments field of hydra.core.packaging.EntityMetadata+entityMetadataWithComments :: Typed.TypedTerm Packaging.EntityMetadata -> Typed.TypedTerm [String] -> Typed.TypedTerm Packaging.EntityMetadata+entityMetadataWithComments original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.packaging.EntityMetadata"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "description"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.EntityMetadata"),+ Model.projectionFieldName = (Model.Name "description")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "comments"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "seeAlso"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.EntityMetadata"),+ Model.projectionFieldName = (Model.Name "seeAlso")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "lifecycle"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.EntityMetadata"),+ Model.projectionFieldName = (Model.Name "lifecycle")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "provisions"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.EntityMetadata"),+ Model.projectionFieldName = (Model.Name "provisions")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the description field of hydra.core.packaging.EntityMetadata+entityMetadataWithDescription :: Typed.TypedTerm Packaging.EntityMetadata -> Typed.TypedTerm (Maybe String) -> Typed.TypedTerm Packaging.EntityMetadata+entityMetadataWithDescription original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.packaging.EntityMetadata"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "description"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "comments"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.EntityMetadata"),+ Model.projectionFieldName = (Model.Name "comments")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "seeAlso"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.EntityMetadata"),+ Model.projectionFieldName = (Model.Name "seeAlso")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "lifecycle"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.EntityMetadata"),+ Model.projectionFieldName = (Model.Name "lifecycle")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "provisions"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.EntityMetadata"),+ Model.projectionFieldName = (Model.Name "provisions")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the lifecycle field of hydra.core.packaging.EntityMetadata+entityMetadataWithLifecycle :: Typed.TypedTerm Packaging.EntityMetadata -> Typed.TypedTerm (Maybe Packaging.LifecycleInfo) -> Typed.TypedTerm Packaging.EntityMetadata+entityMetadataWithLifecycle original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.packaging.EntityMetadata"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "description"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.EntityMetadata"),+ Model.projectionFieldName = (Model.Name "description")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "comments"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.EntityMetadata"),+ Model.projectionFieldName = (Model.Name "comments")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "seeAlso"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.EntityMetadata"),+ Model.projectionFieldName = (Model.Name "seeAlso")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "lifecycle"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "provisions"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.EntityMetadata"),+ Model.projectionFieldName = (Model.Name "provisions")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the provisions field of hydra.core.packaging.EntityMetadata+entityMetadataWithProvisions :: Typed.TypedTerm Packaging.EntityMetadata -> Typed.TypedTerm [Packaging.Provision] -> Typed.TypedTerm Packaging.EntityMetadata+entityMetadataWithProvisions original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.packaging.EntityMetadata"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "description"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.EntityMetadata"),+ Model.projectionFieldName = (Model.Name "description")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "comments"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.EntityMetadata"),+ Model.projectionFieldName = (Model.Name "comments")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "seeAlso"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.EntityMetadata"),+ Model.projectionFieldName = (Model.Name "seeAlso")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "lifecycle"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.EntityMetadata"),+ Model.projectionFieldName = (Model.Name "lifecycle")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "provisions"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL updater for the seeAlso field of hydra.core.packaging.EntityMetadata+entityMetadataWithSeeAlso :: Typed.TypedTerm Packaging.EntityMetadata -> Typed.TypedTerm [Packaging.EntityReference] -> Typed.TypedTerm Packaging.EntityMetadata+entityMetadataWithSeeAlso original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.packaging.EntityMetadata"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "description"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.EntityMetadata"),+ Model.projectionFieldName = (Model.Name "description")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "comments"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.EntityMetadata"),+ Model.projectionFieldName = (Model.Name "comments")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "seeAlso"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "lifecycle"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.EntityMetadata"),+ Model.projectionFieldName = (Model.Name "lifecycle")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "provisions"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.EntityMetadata"),+ Model.projectionFieldName = (Model.Name "provisions")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL injection for the definition variant of hydra.core.packaging.EntityReference+entityReferenceDefinition :: Typed.TypedTerm Packaging.DefinitionReference -> Typed.TypedTerm Packaging.EntityReference+entityReferenceDefinition x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.packaging.EntityReference"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "definition"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL name token for hydra.core.packaging.EntityReference+entityReferenceEntityReference :: Typed.TypedName Packaging.EntityReference+entityReferenceEntityReference = Typed.TypedName (Model.Name "hydra.core.packaging.EntityReference")++-- | DSL injection for the module variant of hydra.core.packaging.EntityReference+entityReferenceModule :: Typed.TypedTerm Packaging.ModuleName -> Typed.TypedTerm Packaging.EntityReference+entityReferenceModule x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.packaging.EntityReference"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "module"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the package variant of hydra.core.packaging.EntityReference+entityReferencePackage :: Typed.TypedTerm Packaging.PackageName -> Typed.TypedTerm Packaging.EntityReference+entityReferencePackage x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.packaging.EntityReference"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "package"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the termExpr variant of hydra.core.packaging.EntityReference+entityReferenceTermExpr :: Typed.TypedTerm String -> Typed.TypedTerm Packaging.EntityReference+entityReferenceTermExpr x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.packaging.EntityReference"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "termExpr"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the typeExpr variant of hydra.core.packaging.EntityReference+entityReferenceTypeExpr :: Typed.TypedTerm String -> Typed.TypedTerm Packaging.EntityReference+entityReferenceTypeExpr x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.packaging.EntityReference"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "typeExpr"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL constructor for hydra.core.packaging.LifecycleInfo+lifecycleInfo :: Typed.TypedTerm (Maybe Packaging.Version) -> Typed.TypedTerm (Maybe Packaging.Version) -> Typed.TypedTerm Packaging.LifecycleInfo+lifecycleInfo availableSince deprecatedSince =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.packaging.LifecycleInfo"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "availableSince"),+ Model.fieldTerm = (Typed.unTypedTerm availableSince)},+ Model.Field {+ Model.fieldName = (Model.Name "deprecatedSince"),+ Model.fieldTerm = (Typed.unTypedTerm deprecatedSince)}]}))++-- | DSL accessor for the availableSince field of hydra.core.packaging.LifecycleInfo+lifecycleInfoAvailableSince :: Typed.TypedTerm Packaging.LifecycleInfo -> Typed.TypedTerm (Maybe Packaging.Version)+lifecycleInfoAvailableSince x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.LifecycleInfo"),+ Model.projectionFieldName = (Model.Name "availableSince")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the deprecatedSince field of hydra.core.packaging.LifecycleInfo+lifecycleInfoDeprecatedSince :: Typed.TypedTerm Packaging.LifecycleInfo -> Typed.TypedTerm (Maybe Packaging.Version)+lifecycleInfoDeprecatedSince x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.LifecycleInfo"),+ Model.projectionFieldName = (Model.Name "deprecatedSince")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.packaging.LifecycleInfo+lifecycleInfoLifecycleInfo :: Typed.TypedName Packaging.LifecycleInfo+lifecycleInfoLifecycleInfo = Typed.TypedName (Model.Name "hydra.core.packaging.LifecycleInfo")++-- | DSL updater for the availableSince field of hydra.core.packaging.LifecycleInfo+lifecycleInfoWithAvailableSince :: Typed.TypedTerm Packaging.LifecycleInfo -> Typed.TypedTerm (Maybe Packaging.Version) -> Typed.TypedTerm Packaging.LifecycleInfo+lifecycleInfoWithAvailableSince original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.packaging.LifecycleInfo"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "availableSince"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "deprecatedSince"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.LifecycleInfo"),+ Model.projectionFieldName = (Model.Name "deprecatedSince")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the deprecatedSince field of hydra.core.packaging.LifecycleInfo+lifecycleInfoWithDeprecatedSince :: Typed.TypedTerm Packaging.LifecycleInfo -> Typed.TypedTerm (Maybe Packaging.Version) -> Typed.TypedTerm Packaging.LifecycleInfo+lifecycleInfoWithDeprecatedSince original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.packaging.LifecycleInfo"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "availableSince"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.LifecycleInfo"),+ Model.projectionFieldName = (Model.Name "availableSince")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "deprecatedSince"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL constructor for hydra.core.packaging.Module+module_ :: Typed.TypedTerm Packaging.ModuleName -> Typed.TypedTerm (Maybe Packaging.EntityMetadata) -> Typed.TypedTerm [Packaging.ModuleDependency] -> Typed.TypedTerm [Packaging.Definition] -> Typed.TypedTerm Packaging.Module+module_ name metadata dependencies definitions =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.packaging.Module"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Typed.unTypedTerm name)},+ Model.Field {+ Model.fieldName = (Model.Name "metadata"),+ Model.fieldTerm = (Typed.unTypedTerm metadata)},+ Model.Field {+ Model.fieldName = (Model.Name "dependencies"),+ Model.fieldTerm = (Typed.unTypedTerm dependencies)},+ Model.Field {+ Model.fieldName = (Model.Name "definitions"),+ Model.fieldTerm = (Typed.unTypedTerm definitions)}]}))++-- | DSL accessor for the definitions field of hydra.core.packaging.Module+moduleDefinitions :: Typed.TypedTerm Packaging.Module -> Typed.TypedTerm [Packaging.Definition]+moduleDefinitions x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.Module"),+ Model.projectionFieldName = (Model.Name "definitions")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the dependencies field of hydra.core.packaging.Module+moduleDependencies :: Typed.TypedTerm Packaging.Module -> Typed.TypedTerm [Packaging.ModuleDependency]+moduleDependencies x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.Module"),+ Model.projectionFieldName = (Model.Name "dependencies")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL constructor for hydra.core.packaging.ModuleDependency+moduleDependency :: Typed.TypedTerm Packaging.ModuleName -> Typed.TypedTerm (Maybe Packaging.PackageName) -> Typed.TypedTerm Packaging.ModuleDependency+moduleDependency module_ package =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.packaging.ModuleDependency"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "module"),+ Model.fieldTerm = (Typed.unTypedTerm module_)},+ Model.Field {+ Model.fieldName = (Model.Name "package"),+ Model.fieldTerm = (Typed.unTypedTerm package)}]}))++-- | DSL accessor for the module field of hydra.core.packaging.ModuleDependency+moduleDependencyModule :: Typed.TypedTerm Packaging.ModuleDependency -> Typed.TypedTerm Packaging.ModuleName+moduleDependencyModule x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.ModuleDependency"),+ Model.projectionFieldName = (Model.Name "module")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.packaging.ModuleDependency+moduleDependencyModuleDependency :: Typed.TypedName Packaging.ModuleDependency+moduleDependencyModuleDependency = Typed.TypedName (Model.Name "hydra.core.packaging.ModuleDependency")++-- | DSL accessor for the package field of hydra.core.packaging.ModuleDependency+moduleDependencyPackage :: Typed.TypedTerm Packaging.ModuleDependency -> Typed.TypedTerm (Maybe Packaging.PackageName)+moduleDependencyPackage x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.ModuleDependency"),+ Model.projectionFieldName = (Model.Name "package")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL updater for the module field of hydra.core.packaging.ModuleDependency+moduleDependencyWithModule :: Typed.TypedTerm Packaging.ModuleDependency -> Typed.TypedTerm Packaging.ModuleName -> Typed.TypedTerm Packaging.ModuleDependency+moduleDependencyWithModule original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.packaging.ModuleDependency"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "module"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "package"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.ModuleDependency"),+ Model.projectionFieldName = (Model.Name "package")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the package field of hydra.core.packaging.ModuleDependency+moduleDependencyWithPackage :: Typed.TypedTerm Packaging.ModuleDependency -> Typed.TypedTerm (Maybe Packaging.PackageName) -> Typed.TypedTerm Packaging.ModuleDependency+moduleDependencyWithPackage original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.packaging.ModuleDependency"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "module"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.ModuleDependency"),+ Model.projectionFieldName = (Model.Name "module")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "package"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL accessor for the metadata field of hydra.core.packaging.Module+moduleMetadata :: Typed.TypedTerm Packaging.Module -> Typed.TypedTerm (Maybe Packaging.EntityMetadata)+moduleMetadata x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.Module"),+ Model.projectionFieldName = (Model.Name "metadata")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.packaging.Module+moduleModule :: Typed.TypedName Packaging.Module+moduleModule = Typed.TypedName (Model.Name "hydra.core.packaging.Module")++-- | DSL accessor for the name field of hydra.core.packaging.Module+moduleName :: Typed.TypedTerm Packaging.Module -> Typed.TypedTerm Packaging.ModuleName+moduleName x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.Module"),+ Model.projectionFieldName = (Model.Name "name")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL constructor for the hydra.core.packaging.ModuleName wrapper+moduleName2 :: Typed.TypedTerm String -> Typed.TypedTerm Packaging.ModuleName+moduleName2 x =+ Typed.TypedTerm (Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.Name "hydra.core.packaging.ModuleName"),+ Model.wrappedTermBody = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.packaging.ModuleName+moduleNameModuleName :: Typed.TypedName Packaging.ModuleName+moduleNameModuleName = Typed.TypedName (Model.Name "hydra.core.packaging.ModuleName")++-- | DSL updater for the definitions field of hydra.core.packaging.Module+moduleWithDefinitions :: Typed.TypedTerm Packaging.Module -> Typed.TypedTerm [Packaging.Definition] -> Typed.TypedTerm Packaging.Module+moduleWithDefinitions original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.packaging.Module"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.Module"),+ Model.projectionFieldName = (Model.Name "name")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "metadata"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.Module"),+ Model.projectionFieldName = (Model.Name "metadata")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "dependencies"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.Module"),+ Model.projectionFieldName = (Model.Name "dependencies")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "definitions"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL updater for the dependencies field of hydra.core.packaging.Module+moduleWithDependencies :: Typed.TypedTerm Packaging.Module -> Typed.TypedTerm [Packaging.ModuleDependency] -> Typed.TypedTerm Packaging.Module+moduleWithDependencies original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.packaging.Module"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.Module"),+ Model.projectionFieldName = (Model.Name "name")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "metadata"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.Module"),+ Model.projectionFieldName = (Model.Name "metadata")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "dependencies"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "definitions"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.Module"),+ Model.projectionFieldName = (Model.Name "definitions")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the metadata field of hydra.core.packaging.Module+moduleWithMetadata :: Typed.TypedTerm Packaging.Module -> Typed.TypedTerm (Maybe Packaging.EntityMetadata) -> Typed.TypedTerm Packaging.Module+moduleWithMetadata original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.packaging.Module"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.Module"),+ Model.projectionFieldName = (Model.Name "name")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "metadata"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "dependencies"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.Module"),+ Model.projectionFieldName = (Model.Name "dependencies")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "definitions"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.Module"),+ Model.projectionFieldName = (Model.Name "definitions")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the name field of hydra.core.packaging.Module+moduleWithName :: Typed.TypedTerm Packaging.Module -> Typed.TypedTerm Packaging.ModuleName -> Typed.TypedTerm Packaging.Module+moduleWithName original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.packaging.Module"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "metadata"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.Module"),+ Model.projectionFieldName = (Model.Name "metadata")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "dependencies"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.Module"),+ Model.projectionFieldName = (Model.Name "dependencies")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "definitions"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.Module"),+ Model.projectionFieldName = (Model.Name "definitions")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL constructor for hydra.core.packaging.Package+package :: Typed.TypedTerm Packaging.PackageName -> Typed.TypedTerm (Maybe Packaging.EntityMetadata) -> Typed.TypedTerm [Packaging.PackageDependency] -> Typed.TypedTerm [Packaging.Module] -> Typed.TypedTerm Packaging.Package+package name metadata dependencies modules =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.packaging.Package"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Typed.unTypedTerm name)},+ Model.Field {+ Model.fieldName = (Model.Name "metadata"),+ Model.fieldTerm = (Typed.unTypedTerm metadata)},+ Model.Field {+ Model.fieldName = (Model.Name "dependencies"),+ Model.fieldTerm = (Typed.unTypedTerm dependencies)},+ Model.Field {+ Model.fieldName = (Model.Name "modules"),+ Model.fieldTerm = (Typed.unTypedTerm modules)}]}))++-- | DSL accessor for the dependencies field of hydra.core.packaging.Package+packageDependencies :: Typed.TypedTerm Packaging.Package -> Typed.TypedTerm [Packaging.PackageDependency]+packageDependencies x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.Package"),+ Model.projectionFieldName = (Model.Name "dependencies")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL constructor for hydra.core.packaging.PackageDependency+packageDependency :: Typed.TypedTerm Packaging.PackageName -> Typed.TypedTerm Packaging.VersionSpecifier -> Typed.TypedTerm (Maybe Packaging.DependencyScope) -> Typed.TypedTerm Packaging.PackageDependency+packageDependency name version scope =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.packaging.PackageDependency"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Typed.unTypedTerm name)},+ Model.Field {+ Model.fieldName = (Model.Name "version"),+ Model.fieldTerm = (Typed.unTypedTerm version)},+ Model.Field {+ Model.fieldName = (Model.Name "scope"),+ Model.fieldTerm = (Typed.unTypedTerm scope)}]}))++-- | DSL accessor for the name field of hydra.core.packaging.PackageDependency+packageDependencyName :: Typed.TypedTerm Packaging.PackageDependency -> Typed.TypedTerm Packaging.PackageName+packageDependencyName x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.PackageDependency"),+ Model.projectionFieldName = (Model.Name "name")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.packaging.PackageDependency+packageDependencyPackageDependency :: Typed.TypedName Packaging.PackageDependency+packageDependencyPackageDependency = Typed.TypedName (Model.Name "hydra.core.packaging.PackageDependency")++-- | DSL accessor for the scope field of hydra.core.packaging.PackageDependency+packageDependencyScope :: Typed.TypedTerm Packaging.PackageDependency -> Typed.TypedTerm (Maybe Packaging.DependencyScope)+packageDependencyScope x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.PackageDependency"),+ Model.projectionFieldName = (Model.Name "scope")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the version field of hydra.core.packaging.PackageDependency+packageDependencyVersion :: Typed.TypedTerm Packaging.PackageDependency -> Typed.TypedTerm Packaging.VersionSpecifier+packageDependencyVersion x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.PackageDependency"),+ Model.projectionFieldName = (Model.Name "version")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL updater for the name field of hydra.core.packaging.PackageDependency+packageDependencyWithName :: Typed.TypedTerm Packaging.PackageDependency -> Typed.TypedTerm Packaging.PackageName -> Typed.TypedTerm Packaging.PackageDependency+packageDependencyWithName original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.packaging.PackageDependency"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "version"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.PackageDependency"),+ Model.projectionFieldName = (Model.Name "version")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "scope"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.PackageDependency"),+ Model.projectionFieldName = (Model.Name "scope")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the scope field of hydra.core.packaging.PackageDependency+packageDependencyWithScope :: Typed.TypedTerm Packaging.PackageDependency -> Typed.TypedTerm (Maybe Packaging.DependencyScope) -> Typed.TypedTerm Packaging.PackageDependency+packageDependencyWithScope original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.packaging.PackageDependency"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.PackageDependency"),+ Model.projectionFieldName = (Model.Name "name")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "version"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.PackageDependency"),+ Model.projectionFieldName = (Model.Name "version")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "scope"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL updater for the version field of hydra.core.packaging.PackageDependency+packageDependencyWithVersion :: Typed.TypedTerm Packaging.PackageDependency -> Typed.TypedTerm Packaging.VersionSpecifier -> Typed.TypedTerm Packaging.PackageDependency+packageDependencyWithVersion original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.packaging.PackageDependency"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.PackageDependency"),+ Model.projectionFieldName = (Model.Name "name")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "version"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "scope"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.PackageDependency"),+ Model.projectionFieldName = (Model.Name "scope")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL accessor for the metadata field of hydra.core.packaging.Package+packageMetadata :: Typed.TypedTerm Packaging.Package -> Typed.TypedTerm (Maybe Packaging.EntityMetadata)+packageMetadata x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.Package"),+ Model.projectionFieldName = (Model.Name "metadata")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the modules field of hydra.core.packaging.Package+packageModules :: Typed.TypedTerm Packaging.Package -> Typed.TypedTerm [Packaging.Module]+packageModules x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.Package"),+ Model.projectionFieldName = (Model.Name "modules")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the name field of hydra.core.packaging.Package+packageName :: Typed.TypedTerm Packaging.Package -> Typed.TypedTerm Packaging.PackageName+packageName x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.Package"),+ Model.projectionFieldName = (Model.Name "name")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL constructor for the hydra.core.packaging.PackageName wrapper+packageName2 :: Typed.TypedTerm String -> Typed.TypedTerm Packaging.PackageName+packageName2 x =+ Typed.TypedTerm (Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.Name "hydra.core.packaging.PackageName"),+ Model.wrappedTermBody = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.packaging.PackageName+packageNamePackageName :: Typed.TypedName Packaging.PackageName+packageNamePackageName = Typed.TypedName (Model.Name "hydra.core.packaging.PackageName")++-- | DSL name token for hydra.core.packaging.Package+packagePackage :: Typed.TypedName Packaging.Package+packagePackage = Typed.TypedName (Model.Name "hydra.core.packaging.Package")++-- | DSL updater for the dependencies field of hydra.core.packaging.Package+packageWithDependencies :: Typed.TypedTerm Packaging.Package -> Typed.TypedTerm [Packaging.PackageDependency] -> Typed.TypedTerm Packaging.Package+packageWithDependencies original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.packaging.Package"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.Package"),+ Model.projectionFieldName = (Model.Name "name")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "metadata"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.Package"),+ Model.projectionFieldName = (Model.Name "metadata")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "dependencies"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "modules"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.Package"),+ Model.projectionFieldName = (Model.Name "modules")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the metadata field of hydra.core.packaging.Package+packageWithMetadata :: Typed.TypedTerm Packaging.Package -> Typed.TypedTerm (Maybe Packaging.EntityMetadata) -> Typed.TypedTerm Packaging.Package+packageWithMetadata original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.packaging.Package"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.Package"),+ Model.projectionFieldName = (Model.Name "name")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "metadata"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "dependencies"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.Package"),+ Model.projectionFieldName = (Model.Name "dependencies")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "modules"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.Package"),+ Model.projectionFieldName = (Model.Name "modules")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the modules field of hydra.core.packaging.Package+packageWithModules :: Typed.TypedTerm Packaging.Package -> Typed.TypedTerm [Packaging.Module] -> Typed.TypedTerm Packaging.Package+packageWithModules original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.packaging.Package"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.Package"),+ Model.projectionFieldName = (Model.Name "name")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "metadata"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.Package"),+ Model.projectionFieldName = (Model.Name "metadata")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "dependencies"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.Package"),+ Model.projectionFieldName = (Model.Name "dependencies")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "modules"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL updater for the name field of hydra.core.packaging.Package+packageWithName :: Typed.TypedTerm Packaging.Package -> Typed.TypedTerm Packaging.PackageName -> Typed.TypedTerm Packaging.Package+packageWithName original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.packaging.Package"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "metadata"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.Package"),+ Model.projectionFieldName = (Model.Name "metadata")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "dependencies"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.Package"),+ Model.projectionFieldName = (Model.Name "dependencies")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "modules"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.Package"),+ Model.projectionFieldName = (Model.Name "modules")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL constructor for hydra.core.packaging.PrimitiveDefinition+primitiveDefinition :: Typed.TypedTerm Model.Name -> Typed.TypedTerm (Maybe Packaging.EntityMetadata) -> Typed.TypedTerm Typing.TermSignature -> Typed.TypedTerm Bool -> Typed.TypedTerm Bool -> Typed.TypedTerm (Maybe Model.Term) -> Typed.TypedTerm Packaging.PrimitiveDefinition+primitiveDefinition name metadata signature isPure isTotal defaultImplementation =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.packaging.PrimitiveDefinition"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Typed.unTypedTerm name)},+ Model.Field {+ Model.fieldName = (Model.Name "metadata"),+ Model.fieldTerm = (Typed.unTypedTerm metadata)},+ Model.Field {+ Model.fieldName = (Model.Name "signature"),+ Model.fieldTerm = (Typed.unTypedTerm signature)},+ Model.Field {+ Model.fieldName = (Model.Name "isPure"),+ Model.fieldTerm = (Typed.unTypedTerm isPure)},+ Model.Field {+ Model.fieldName = (Model.Name "isTotal"),+ Model.fieldTerm = (Typed.unTypedTerm isTotal)},+ Model.Field {+ Model.fieldName = (Model.Name "defaultImplementation"),+ Model.fieldTerm = (Typed.unTypedTerm defaultImplementation)}]}))++-- | DSL accessor for the defaultImplementation field of hydra.core.packaging.PrimitiveDefinition+primitiveDefinitionDefaultImplementation :: Typed.TypedTerm Packaging.PrimitiveDefinition -> Typed.TypedTerm (Maybe Model.Term)+primitiveDefinitionDefaultImplementation x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.PrimitiveDefinition"),+ Model.projectionFieldName = (Model.Name "defaultImplementation")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the isPure field of hydra.core.packaging.PrimitiveDefinition+primitiveDefinitionIsPure :: Typed.TypedTerm Packaging.PrimitiveDefinition -> Typed.TypedTerm Bool+primitiveDefinitionIsPure x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.PrimitiveDefinition"),+ Model.projectionFieldName = (Model.Name "isPure")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the isTotal field of hydra.core.packaging.PrimitiveDefinition+primitiveDefinitionIsTotal :: Typed.TypedTerm Packaging.PrimitiveDefinition -> Typed.TypedTerm Bool+primitiveDefinitionIsTotal x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.PrimitiveDefinition"),+ Model.projectionFieldName = (Model.Name "isTotal")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the metadata field of hydra.core.packaging.PrimitiveDefinition+primitiveDefinitionMetadata :: Typed.TypedTerm Packaging.PrimitiveDefinition -> Typed.TypedTerm (Maybe Packaging.EntityMetadata)+primitiveDefinitionMetadata x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.PrimitiveDefinition"),+ Model.projectionFieldName = (Model.Name "metadata")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the name field of hydra.core.packaging.PrimitiveDefinition+primitiveDefinitionName :: Typed.TypedTerm Packaging.PrimitiveDefinition -> Typed.TypedTerm Model.Name+primitiveDefinitionName x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.PrimitiveDefinition"),+ Model.projectionFieldName = (Model.Name "name")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.packaging.PrimitiveDefinition+primitiveDefinitionPrimitiveDefinition :: Typed.TypedName Packaging.PrimitiveDefinition+primitiveDefinitionPrimitiveDefinition = Typed.TypedName (Model.Name "hydra.core.packaging.PrimitiveDefinition")++-- | DSL accessor for the signature field of hydra.core.packaging.PrimitiveDefinition+primitiveDefinitionSignature :: Typed.TypedTerm Packaging.PrimitiveDefinition -> Typed.TypedTerm Typing.TermSignature+primitiveDefinitionSignature x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.PrimitiveDefinition"),+ Model.projectionFieldName = (Model.Name "signature")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL updater for the defaultImplementation field of hydra.core.packaging.PrimitiveDefinition+primitiveDefinitionWithDefaultImplementation :: Typed.TypedTerm Packaging.PrimitiveDefinition -> Typed.TypedTerm (Maybe Model.Term) -> Typed.TypedTerm Packaging.PrimitiveDefinition+primitiveDefinitionWithDefaultImplementation original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.packaging.PrimitiveDefinition"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.PrimitiveDefinition"),+ Model.projectionFieldName = (Model.Name "name")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "metadata"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.PrimitiveDefinition"),+ Model.projectionFieldName = (Model.Name "metadata")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "signature"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.PrimitiveDefinition"),+ Model.projectionFieldName = (Model.Name "signature")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "isPure"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.PrimitiveDefinition"),+ Model.projectionFieldName = (Model.Name "isPure")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "isTotal"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.PrimitiveDefinition"),+ Model.projectionFieldName = (Model.Name "isTotal")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "defaultImplementation"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL updater for the isPure field of hydra.core.packaging.PrimitiveDefinition+primitiveDefinitionWithIsPure :: Typed.TypedTerm Packaging.PrimitiveDefinition -> Typed.TypedTerm Bool -> Typed.TypedTerm Packaging.PrimitiveDefinition+primitiveDefinitionWithIsPure original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.packaging.PrimitiveDefinition"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.PrimitiveDefinition"),+ Model.projectionFieldName = (Model.Name "name")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "metadata"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.PrimitiveDefinition"),+ Model.projectionFieldName = (Model.Name "metadata")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "signature"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.PrimitiveDefinition"),+ Model.projectionFieldName = (Model.Name "signature")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "isPure"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "isTotal"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.PrimitiveDefinition"),+ Model.projectionFieldName = (Model.Name "isTotal")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "defaultImplementation"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.PrimitiveDefinition"),+ Model.projectionFieldName = (Model.Name "defaultImplementation")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the isTotal field of hydra.core.packaging.PrimitiveDefinition+primitiveDefinitionWithIsTotal :: Typed.TypedTerm Packaging.PrimitiveDefinition -> Typed.TypedTerm Bool -> Typed.TypedTerm Packaging.PrimitiveDefinition+primitiveDefinitionWithIsTotal original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.packaging.PrimitiveDefinition"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.PrimitiveDefinition"),+ Model.projectionFieldName = (Model.Name "name")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "metadata"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.PrimitiveDefinition"),+ Model.projectionFieldName = (Model.Name "metadata")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "signature"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.PrimitiveDefinition"),+ Model.projectionFieldName = (Model.Name "signature")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "isPure"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.PrimitiveDefinition"),+ Model.projectionFieldName = (Model.Name "isPure")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "isTotal"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "defaultImplementation"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.PrimitiveDefinition"),+ Model.projectionFieldName = (Model.Name "defaultImplementation")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the metadata field of hydra.core.packaging.PrimitiveDefinition+primitiveDefinitionWithMetadata :: Typed.TypedTerm Packaging.PrimitiveDefinition -> Typed.TypedTerm (Maybe Packaging.EntityMetadata) -> Typed.TypedTerm Packaging.PrimitiveDefinition+primitiveDefinitionWithMetadata original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.packaging.PrimitiveDefinition"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.PrimitiveDefinition"),+ Model.projectionFieldName = (Model.Name "name")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "metadata"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "signature"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.PrimitiveDefinition"),+ Model.projectionFieldName = (Model.Name "signature")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "isPure"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.PrimitiveDefinition"),+ Model.projectionFieldName = (Model.Name "isPure")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "isTotal"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.PrimitiveDefinition"),+ Model.projectionFieldName = (Model.Name "isTotal")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "defaultImplementation"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.PrimitiveDefinition"),+ Model.projectionFieldName = (Model.Name "defaultImplementation")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the name field of hydra.core.packaging.PrimitiveDefinition+primitiveDefinitionWithName :: Typed.TypedTerm Packaging.PrimitiveDefinition -> Typed.TypedTerm Model.Name -> Typed.TypedTerm Packaging.PrimitiveDefinition+primitiveDefinitionWithName original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.packaging.PrimitiveDefinition"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "metadata"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.PrimitiveDefinition"),+ Model.projectionFieldName = (Model.Name "metadata")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "signature"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.PrimitiveDefinition"),+ Model.projectionFieldName = (Model.Name "signature")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "isPure"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.PrimitiveDefinition"),+ Model.projectionFieldName = (Model.Name "isPure")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "isTotal"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.PrimitiveDefinition"),+ Model.projectionFieldName = (Model.Name "isTotal")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "defaultImplementation"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.PrimitiveDefinition"),+ Model.projectionFieldName = (Model.Name "defaultImplementation")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the signature field of hydra.core.packaging.PrimitiveDefinition+primitiveDefinitionWithSignature :: Typed.TypedTerm Packaging.PrimitiveDefinition -> Typed.TypedTerm Typing.TermSignature -> Typed.TypedTerm Packaging.PrimitiveDefinition+primitiveDefinitionWithSignature original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.packaging.PrimitiveDefinition"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.PrimitiveDefinition"),+ Model.projectionFieldName = (Model.Name "name")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "metadata"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.PrimitiveDefinition"),+ Model.projectionFieldName = (Model.Name "metadata")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "signature"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "isPure"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.PrimitiveDefinition"),+ Model.projectionFieldName = (Model.Name "isPure")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "isTotal"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.PrimitiveDefinition"),+ Model.projectionFieldName = (Model.Name "isTotal")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "defaultImplementation"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.PrimitiveDefinition"),+ Model.projectionFieldName = (Model.Name "defaultImplementation")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL constructor for hydra.core.packaging.Provision+provision :: Typed.TypedTerm Model.Name -> Typed.TypedTerm Packaging.ProvisionKind -> Typed.TypedTerm String -> Typed.TypedTerm Packaging.Provision+provision name kind statement =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.packaging.Provision"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Typed.unTypedTerm name)},+ Model.Field {+ Model.fieldName = (Model.Name "kind"),+ Model.fieldTerm = (Typed.unTypedTerm kind)},+ Model.Field {+ Model.fieldName = (Model.Name "statement"),+ Model.fieldTerm = (Typed.unTypedTerm statement)}]}))++-- | DSL accessor for the kind field of hydra.core.packaging.Provision+provisionKind :: Typed.TypedTerm Packaging.Provision -> Typed.TypedTerm Packaging.ProvisionKind+provisionKind x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.Provision"),+ Model.projectionFieldName = (Model.Name "kind")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.packaging.ProvisionKind+provisionKindProvisionKind :: Typed.TypedName Packaging.ProvisionKind+provisionKindProvisionKind = Typed.TypedName (Model.Name "hydra.core.packaging.ProvisionKind")++-- | DSL injection for the recommendation variant of hydra.core.packaging.ProvisionKind+provisionKindRecommendation :: Typed.TypedTerm Packaging.ProvisionKind+provisionKindRecommendation =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.packaging.ProvisionKind"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "recommendation"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL injection for the requirement variant of hydra.core.packaging.ProvisionKind+provisionKindRequirement :: Typed.TypedTerm Packaging.ProvisionKind+provisionKindRequirement =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.packaging.ProvisionKind"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "requirement"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL accessor for the name field of hydra.core.packaging.Provision+provisionName :: Typed.TypedTerm Packaging.Provision -> Typed.TypedTerm Model.Name+provisionName x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.Provision"),+ Model.projectionFieldName = (Model.Name "name")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.packaging.Provision+provisionProvision :: Typed.TypedName Packaging.Provision+provisionProvision = Typed.TypedName (Model.Name "hydra.core.packaging.Provision")++-- | DSL accessor for the statement field of hydra.core.packaging.Provision+provisionStatement :: Typed.TypedTerm Packaging.Provision -> Typed.TypedTerm String+provisionStatement x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.Provision"),+ Model.projectionFieldName = (Model.Name "statement")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL updater for the kind field of hydra.core.packaging.Provision+provisionWithKind :: Typed.TypedTerm Packaging.Provision -> Typed.TypedTerm Packaging.ProvisionKind -> Typed.TypedTerm Packaging.Provision+provisionWithKind original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.packaging.Provision"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.Provision"),+ Model.projectionFieldName = (Model.Name "name")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "kind"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "statement"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.Provision"),+ Model.projectionFieldName = (Model.Name "statement")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the name field of hydra.core.packaging.Provision+provisionWithName :: Typed.TypedTerm Packaging.Provision -> Typed.TypedTerm Model.Name -> Typed.TypedTerm Packaging.Provision+provisionWithName original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.packaging.Provision"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "kind"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.Provision"),+ Model.projectionFieldName = (Model.Name "kind")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "statement"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.Provision"),+ Model.projectionFieldName = (Model.Name "statement")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the statement field of hydra.core.packaging.Provision+provisionWithStatement :: Typed.TypedTerm Packaging.Provision -> Typed.TypedTerm String -> Typed.TypedTerm Packaging.Provision+provisionWithStatement original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.packaging.Provision"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.Provision"),+ Model.projectionFieldName = (Model.Name "name")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "kind"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.Provision"),+ Model.projectionFieldName = (Model.Name "kind")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "statement"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL constructor for hydra.core.packaging.TermDefinition+termDefinition :: Typed.TypedTerm Model.Name -> Typed.TypedTerm (Maybe Packaging.EntityMetadata) -> Typed.TypedTerm (Maybe Typing.TermSignature) -> Typed.TypedTerm Model.Term -> Typed.TypedTerm Packaging.TermDefinition+termDefinition name metadata signature body =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.packaging.TermDefinition"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Typed.unTypedTerm name)},+ Model.Field {+ Model.fieldName = (Model.Name "metadata"),+ Model.fieldTerm = (Typed.unTypedTerm metadata)},+ Model.Field {+ Model.fieldName = (Model.Name "signature"),+ Model.fieldTerm = (Typed.unTypedTerm signature)},+ Model.Field {+ Model.fieldName = (Model.Name "body"),+ Model.fieldTerm = (Typed.unTypedTerm body)}]}))++-- | DSL accessor for the body field of hydra.core.packaging.TermDefinition+termDefinitionBody :: Typed.TypedTerm Packaging.TermDefinition -> Typed.TypedTerm Model.Term+termDefinitionBody x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.TermDefinition"),+ Model.projectionFieldName = (Model.Name "body")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the metadata field of hydra.core.packaging.TermDefinition+termDefinitionMetadata :: Typed.TypedTerm Packaging.TermDefinition -> Typed.TypedTerm (Maybe Packaging.EntityMetadata)+termDefinitionMetadata x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.TermDefinition"),+ Model.projectionFieldName = (Model.Name "metadata")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the name field of hydra.core.packaging.TermDefinition+termDefinitionName :: Typed.TypedTerm Packaging.TermDefinition -> Typed.TypedTerm Model.Name+termDefinitionName x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.TermDefinition"),+ Model.projectionFieldName = (Model.Name "name")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the signature field of hydra.core.packaging.TermDefinition+termDefinitionSignature :: Typed.TypedTerm Packaging.TermDefinition -> Typed.TypedTerm (Maybe Typing.TermSignature)+termDefinitionSignature x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.TermDefinition"),+ Model.projectionFieldName = (Model.Name "signature")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.packaging.TermDefinition+termDefinitionTermDefinition :: Typed.TypedName Packaging.TermDefinition+termDefinitionTermDefinition = Typed.TypedName (Model.Name "hydra.core.packaging.TermDefinition")++-- | DSL updater for the body field of hydra.core.packaging.TermDefinition+termDefinitionWithBody :: Typed.TypedTerm Packaging.TermDefinition -> Typed.TypedTerm Model.Term -> Typed.TypedTerm Packaging.TermDefinition+termDefinitionWithBody original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.packaging.TermDefinition"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.TermDefinition"),+ Model.projectionFieldName = (Model.Name "name")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "metadata"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.TermDefinition"),+ Model.projectionFieldName = (Model.Name "metadata")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "signature"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.TermDefinition"),+ Model.projectionFieldName = (Model.Name "signature")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "body"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL updater for the metadata field of hydra.core.packaging.TermDefinition+termDefinitionWithMetadata :: Typed.TypedTerm Packaging.TermDefinition -> Typed.TypedTerm (Maybe Packaging.EntityMetadata) -> Typed.TypedTerm Packaging.TermDefinition+termDefinitionWithMetadata original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.packaging.TermDefinition"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.TermDefinition"),+ Model.projectionFieldName = (Model.Name "name")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "metadata"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "signature"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.TermDefinition"),+ Model.projectionFieldName = (Model.Name "signature")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "body"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.TermDefinition"),+ Model.projectionFieldName = (Model.Name "body")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the name field of hydra.core.packaging.TermDefinition+termDefinitionWithName :: Typed.TypedTerm Packaging.TermDefinition -> Typed.TypedTerm Model.Name -> Typed.TypedTerm Packaging.TermDefinition+termDefinitionWithName original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.packaging.TermDefinition"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "metadata"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.TermDefinition"),+ Model.projectionFieldName = (Model.Name "metadata")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "signature"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.TermDefinition"),+ Model.projectionFieldName = (Model.Name "signature")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "body"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.TermDefinition"),+ Model.projectionFieldName = (Model.Name "body")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the signature field of hydra.core.packaging.TermDefinition+termDefinitionWithSignature :: Typed.TypedTerm Packaging.TermDefinition -> Typed.TypedTerm (Maybe Typing.TermSignature) -> Typed.TypedTerm Packaging.TermDefinition+termDefinitionWithSignature original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.packaging.TermDefinition"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.TermDefinition"),+ Model.projectionFieldName = (Model.Name "name")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "metadata"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.TermDefinition"),+ Model.projectionFieldName = (Model.Name "metadata")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "signature"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "body"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.TermDefinition"),+ Model.projectionFieldName = (Model.Name "body")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL constructor for hydra.core.packaging.TypeDefinition+typeDefinition :: Typed.TypedTerm Model.Name -> Typed.TypedTerm (Maybe Packaging.EntityMetadata) -> Typed.TypedTerm Model.TypeScheme -> Typed.TypedTerm Packaging.TypeDefinition+typeDefinition name metadata body =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.packaging.TypeDefinition"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Typed.unTypedTerm name)},+ Model.Field {+ Model.fieldName = (Model.Name "metadata"),+ Model.fieldTerm = (Typed.unTypedTerm metadata)},+ Model.Field {+ Model.fieldName = (Model.Name "body"),+ Model.fieldTerm = (Typed.unTypedTerm body)}]}))++-- | DSL accessor for the body field of hydra.core.packaging.TypeDefinition+typeDefinitionBody :: Typed.TypedTerm Packaging.TypeDefinition -> Typed.TypedTerm Model.TypeScheme+typeDefinitionBody x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.TypeDefinition"),+ Model.projectionFieldName = (Model.Name "body")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the metadata field of hydra.core.packaging.TypeDefinition+typeDefinitionMetadata :: Typed.TypedTerm Packaging.TypeDefinition -> Typed.TypedTerm (Maybe Packaging.EntityMetadata)+typeDefinitionMetadata x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.TypeDefinition"),+ Model.projectionFieldName = (Model.Name "metadata")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the name field of hydra.core.packaging.TypeDefinition+typeDefinitionName :: Typed.TypedTerm Packaging.TypeDefinition -> Typed.TypedTerm Model.Name+typeDefinitionName x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.TypeDefinition"),+ Model.projectionFieldName = (Model.Name "name")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.packaging.TypeDefinition+typeDefinitionTypeDefinition :: Typed.TypedName Packaging.TypeDefinition+typeDefinitionTypeDefinition = Typed.TypedName (Model.Name "hydra.core.packaging.TypeDefinition")++-- | DSL updater for the body field of hydra.core.packaging.TypeDefinition+typeDefinitionWithBody :: Typed.TypedTerm Packaging.TypeDefinition -> Typed.TypedTerm Model.TypeScheme -> Typed.TypedTerm Packaging.TypeDefinition+typeDefinitionWithBody original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.packaging.TypeDefinition"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.TypeDefinition"),+ Model.projectionFieldName = (Model.Name "name")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "metadata"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.TypeDefinition"),+ Model.projectionFieldName = (Model.Name "metadata")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "body"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL updater for the metadata field of hydra.core.packaging.TypeDefinition+typeDefinitionWithMetadata :: Typed.TypedTerm Packaging.TypeDefinition -> Typed.TypedTerm (Maybe Packaging.EntityMetadata) -> Typed.TypedTerm Packaging.TypeDefinition+typeDefinitionWithMetadata original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.packaging.TypeDefinition"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.TypeDefinition"),+ Model.projectionFieldName = (Model.Name "name")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "metadata"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "body"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.TypeDefinition"),+ Model.projectionFieldName = (Model.Name "body")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the name field of hydra.core.packaging.TypeDefinition+typeDefinitionWithName :: Typed.TypedTerm Packaging.TypeDefinition -> Typed.TypedTerm Model.Name -> Typed.TypedTerm Packaging.TypeDefinition+typeDefinitionWithName original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.packaging.TypeDefinition"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "metadata"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.TypeDefinition"),+ Model.projectionFieldName = (Model.Name "metadata")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "body"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.TypeDefinition"),+ Model.projectionFieldName = (Model.Name "body")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL accessor for the body of hydra.core.packaging.ModuleName+unModuleName :: Typed.TypedTerm Packaging.ModuleName -> Typed.TypedTerm String+unModuleName x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermUnwrap (Model.Name "hydra.core.packaging.ModuleName")),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the body of hydra.core.packaging.PackageName+unPackageName :: Typed.TypedTerm Packaging.PackageName -> Typed.TypedTerm String+unPackageName x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermUnwrap (Model.Name "hydra.core.packaging.PackageName")),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the body of hydra.core.packaging.Version+unVersion :: Typed.TypedTerm Packaging.Version -> Typed.TypedTerm String+unVersion x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermUnwrap (Model.Name "hydra.core.packaging.Version")),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL constructor for the hydra.core.packaging.Version wrapper+version :: Typed.TypedTerm String -> Typed.TypedTerm Packaging.Version+version x =+ Typed.TypedTerm (Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.Name "hydra.core.packaging.Version"),+ Model.wrappedTermBody = (Typed.unTypedTerm x)}))++-- | DSL constructor for hydra.core.packaging.VersionRange+versionRange :: Typed.TypedTerm (Maybe Packaging.Version) -> Typed.TypedTerm (Maybe Packaging.Version) -> Typed.TypedTerm Packaging.VersionRange+versionRange lowerInclusive upperExclusive =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.packaging.VersionRange"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "lowerInclusive"),+ Model.fieldTerm = (Typed.unTypedTerm lowerInclusive)},+ Model.Field {+ Model.fieldName = (Model.Name "upperExclusive"),+ Model.fieldTerm = (Typed.unTypedTerm upperExclusive)}]}))++-- | DSL accessor for the lowerInclusive field of hydra.core.packaging.VersionRange+versionRangeLowerInclusive :: Typed.TypedTerm Packaging.VersionRange -> Typed.TypedTerm (Maybe Packaging.Version)+versionRangeLowerInclusive x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.VersionRange"),+ Model.projectionFieldName = (Model.Name "lowerInclusive")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the upperExclusive field of hydra.core.packaging.VersionRange+versionRangeUpperExclusive :: Typed.TypedTerm Packaging.VersionRange -> Typed.TypedTerm (Maybe Packaging.Version)+versionRangeUpperExclusive x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.VersionRange"),+ Model.projectionFieldName = (Model.Name "upperExclusive")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.packaging.VersionRange+versionRangeVersionRange :: Typed.TypedName Packaging.VersionRange+versionRangeVersionRange = Typed.TypedName (Model.Name "hydra.core.packaging.VersionRange")++-- | DSL updater for the lowerInclusive field of hydra.core.packaging.VersionRange+versionRangeWithLowerInclusive :: Typed.TypedTerm Packaging.VersionRange -> Typed.TypedTerm (Maybe Packaging.Version) -> Typed.TypedTerm Packaging.VersionRange+versionRangeWithLowerInclusive original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.packaging.VersionRange"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "lowerInclusive"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "upperExclusive"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.VersionRange"),+ Model.projectionFieldName = (Model.Name "upperExclusive")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the upperExclusive field of hydra.core.packaging.VersionRange+versionRangeWithUpperExclusive :: Typed.TypedTerm Packaging.VersionRange -> Typed.TypedTerm (Maybe Packaging.Version) -> Typed.TypedTerm Packaging.VersionRange+versionRangeWithUpperExclusive original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.packaging.VersionRange"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "lowerInclusive"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.packaging.VersionRange"),+ Model.projectionFieldName = (Model.Name "lowerInclusive")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "upperExclusive"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL injection for the any variant of hydra.core.packaging.VersionSpecifier+versionSpecifierAny :: Typed.TypedTerm Packaging.VersionSpecifier+versionSpecifierAny =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.packaging.VersionSpecifier"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "any"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL injection for the atLeast variant of hydra.core.packaging.VersionSpecifier+versionSpecifierAtLeast :: Typed.TypedTerm Packaging.Version -> Typed.TypedTerm Packaging.VersionSpecifier+versionSpecifierAtLeast x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.packaging.VersionSpecifier"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "atLeast"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the exact variant of hydra.core.packaging.VersionSpecifier+versionSpecifierExact :: Typed.TypedTerm Packaging.Version -> Typed.TypedTerm Packaging.VersionSpecifier+versionSpecifierExact x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.packaging.VersionSpecifier"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "exact"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the range variant of hydra.core.packaging.VersionSpecifier+versionSpecifierRange :: Typed.TypedTerm Packaging.VersionRange -> Typed.TypedTerm Packaging.VersionSpecifier+versionSpecifierRange x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.packaging.VersionSpecifier"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "range"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL name token for hydra.core.packaging.VersionSpecifier+versionSpecifierVersionSpecifier :: Typed.TypedName Packaging.VersionSpecifier+versionSpecifierVersionSpecifier = Typed.TypedName (Model.Name "hydra.core.packaging.VersionSpecifier")++-- | DSL name token for hydra.core.packaging.Version+versionVersion :: Typed.TypedName Packaging.Version+versionVersion = Typed.TypedName (Model.Name "hydra.core.packaging.Version")
@@ -0,0 +1,237 @@+-- Note: this is an automatically generated file. Do not edit.++-- | DSL functions for hydra.core.parsing++module Hydra.Core.Dsl.Parsing where++import qualified Hydra.Core.Decode.Parsing as DecodeParsing+import qualified Hydra.Core.Dsl.Model as DslModel+import qualified Hydra.Core.Encode.Parsing as EncodeParsing+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Parsing as Parsing+import qualified Hydra.Core.Typed as Typed+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | DSL composition builder for the decoder of hydra.core.parsing.ParseResult+decodeParseResult :: Typed.TypedTerm (Graph.Graph -> Model.Term -> Either Errors.DecodingError a) -> Typed.TypedTerm (Graph.Graph -> Model.Term -> Either Errors.DecodingError (Parsing.ParseResult a))+decodeParseResult a =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.decode.parsing.parseResult")),+ Model.applicationArgument = (Typed.unTypedTerm a)}))++-- | DSL composition builder for the decoder of hydra.core.parsing.ParseSuccess+decodeParseSuccess :: Typed.TypedTerm (Graph.Graph -> Model.Term -> Either Errors.DecodingError a) -> Typed.TypedTerm (Graph.Graph -> Model.Term -> Either Errors.DecodingError (Parsing.ParseSuccess a))+decodeParseSuccess a =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.decode.parsing.parseSuccess")),+ Model.applicationArgument = (Typed.unTypedTerm a)}))++-- | DSL composition builder for the decoder of hydra.core.parsing.Parser+decodeParser :: Typed.TypedTerm (Graph.Graph -> Model.Term -> Either Errors.DecodingError a) -> Typed.TypedTerm (Graph.Graph -> Model.Term -> Either Errors.DecodingError (Parsing.Parser a))+decodeParser a =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.decode.parsing.parser")),+ Model.applicationArgument = (Typed.unTypedTerm a)}))++-- | DSL composition builder for the encoder of hydra.core.parsing.ParseResult+encodeParseResult :: Typed.TypedTerm (a -> Model.Term) -> Typed.TypedTerm (Parsing.ParseResult a -> Model.Term)+encodeParseResult a =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.encode.parsing.parseResult")),+ Model.applicationArgument = (Typed.unTypedTerm a)}))++-- | DSL composition builder for the encoder of hydra.core.parsing.ParseSuccess+encodeParseSuccess :: Typed.TypedTerm (a -> Model.Term) -> Typed.TypedTerm (Parsing.ParseSuccess a -> Model.Term)+encodeParseSuccess a =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.encode.parsing.parseSuccess")),+ Model.applicationArgument = (Typed.unTypedTerm a)}))++-- | DSL composition builder for the encoder of hydra.core.parsing.Parser+encodeParser :: Typed.TypedTerm (a -> Model.Term) -> Typed.TypedTerm (Parsing.Parser a -> Model.Term)+encodeParser a =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.encode.parsing.parser")),+ Model.applicationArgument = (Typed.unTypedTerm a)}))++-- | DSL constructor for hydra.core.parsing.ParseError+parseError :: Typed.TypedTerm String -> Typed.TypedTerm [Int] -> Typed.TypedTerm Parsing.ParseError+parseError message remainder =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.parsing.ParseError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "message"),+ Model.fieldTerm = (Typed.unTypedTerm message)},+ Model.Field {+ Model.fieldName = (Model.Name "remainder"),+ Model.fieldTerm = (Typed.unTypedTerm remainder)}]}))++-- | DSL accessor for the message field of hydra.core.parsing.ParseError+parseErrorMessage :: Typed.TypedTerm Parsing.ParseError -> Typed.TypedTerm String+parseErrorMessage x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.parsing.ParseError"),+ Model.projectionFieldName = (Model.Name "message")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.parsing.ParseError+parseErrorParseError :: Typed.TypedName Parsing.ParseError+parseErrorParseError = Typed.TypedName (Model.Name "hydra.core.parsing.ParseError")++-- | DSL accessor for the remainder field of hydra.core.parsing.ParseError+parseErrorRemainder :: Typed.TypedTerm Parsing.ParseError -> Typed.TypedTerm [Int]+parseErrorRemainder x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.parsing.ParseError"),+ Model.projectionFieldName = (Model.Name "remainder")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL updater for the message field of hydra.core.parsing.ParseError+parseErrorWithMessage :: Typed.TypedTerm Parsing.ParseError -> Typed.TypedTerm String -> Typed.TypedTerm Parsing.ParseError+parseErrorWithMessage original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.parsing.ParseError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "message"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "remainder"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.parsing.ParseError"),+ Model.projectionFieldName = (Model.Name "remainder")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the remainder field of hydra.core.parsing.ParseError+parseErrorWithRemainder :: Typed.TypedTerm Parsing.ParseError -> Typed.TypedTerm [Int] -> Typed.TypedTerm Parsing.ParseError+parseErrorWithRemainder original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.parsing.ParseError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "message"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.parsing.ParseError"),+ Model.projectionFieldName = (Model.Name "message")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "remainder"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL injection for the failure variant of hydra.core.parsing.ParseResult+parseResultFailure :: Typed.TypedTerm Parsing.ParseError -> Typed.TypedTerm (Parsing.ParseResult a)+parseResultFailure x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.parsing.ParseResult"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "failure"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL name token for hydra.core.parsing.ParseResult+parseResultParseResult :: Typed.TypedName (Parsing.ParseResult a)+parseResultParseResult = Typed.TypedName (Model.Name "hydra.core.parsing.ParseResult")++-- | DSL injection for the success variant of hydra.core.parsing.ParseResult+parseResultSuccess :: Typed.TypedTerm (Parsing.ParseSuccess a) -> Typed.TypedTerm (Parsing.ParseResult a)+parseResultSuccess x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.parsing.ParseResult"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "success"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL constructor for hydra.core.parsing.ParseSuccess+parseSuccess :: Typed.TypedTerm a -> Typed.TypedTerm [Int] -> Typed.TypedTerm (Parsing.ParseSuccess a)+parseSuccess value remainder =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.parsing.ParseSuccess"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "value"),+ Model.fieldTerm = (Typed.unTypedTerm value)},+ Model.Field {+ Model.fieldName = (Model.Name "remainder"),+ Model.fieldTerm = (Typed.unTypedTerm remainder)}]}))++-- | DSL name token for hydra.core.parsing.ParseSuccess+parseSuccessParseSuccess :: Typed.TypedName (Parsing.ParseSuccess a)+parseSuccessParseSuccess = Typed.TypedName (Model.Name "hydra.core.parsing.ParseSuccess")++-- | DSL accessor for the remainder field of hydra.core.parsing.ParseSuccess+parseSuccessRemainder :: Typed.TypedTerm (Parsing.ParseSuccess a) -> Typed.TypedTerm [Int]+parseSuccessRemainder x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.parsing.ParseSuccess"),+ Model.projectionFieldName = (Model.Name "remainder")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the value field of hydra.core.parsing.ParseSuccess+parseSuccessValue :: Typed.TypedTerm (Parsing.ParseSuccess a) -> Typed.TypedTerm a+parseSuccessValue x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.parsing.ParseSuccess"),+ Model.projectionFieldName = (Model.Name "value")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL updater for the remainder field of hydra.core.parsing.ParseSuccess+parseSuccessWithRemainder :: Typed.TypedTerm (Parsing.ParseSuccess a) -> Typed.TypedTerm [Int] -> Typed.TypedTerm (Parsing.ParseSuccess a)+parseSuccessWithRemainder original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.parsing.ParseSuccess"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "value"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.parsing.ParseSuccess"),+ Model.projectionFieldName = (Model.Name "value")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "remainder"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL updater for the value field of hydra.core.parsing.ParseSuccess+parseSuccessWithValue :: Typed.TypedTerm (Parsing.ParseSuccess a) -> Typed.TypedTerm a -> Typed.TypedTerm (Parsing.ParseSuccess a)+parseSuccessWithValue original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.parsing.ParseSuccess"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "value"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "remainder"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.parsing.ParseSuccess"),+ Model.projectionFieldName = (Model.Name "remainder")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL constructor for the hydra.core.parsing.Parser wrapper+parser :: Typed.TypedTerm ([Int] -> Parsing.ParseResult a) -> Typed.TypedTerm (Parsing.Parser a)+parser x =+ Typed.TypedTerm (Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.Name "hydra.core.parsing.Parser"),+ Model.wrappedTermBody = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.parsing.Parser+parserParser :: Typed.TypedName (Parsing.Parser a)+parserParser = Typed.TypedName (Model.Name "hydra.core.parsing.Parser")++-- | DSL accessor for the body of hydra.core.parsing.Parser+unParser :: Typed.TypedTerm (Parsing.Parser a) -> Typed.TypedTerm ([Int] -> Parsing.ParseResult a)+unParser x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermUnwrap (Model.Name "hydra.core.parsing.Parser")),+ Model.applicationArgument = (Typed.unTypedTerm x)}))
@@ -0,0 +1,1773 @@+-- Note: this is an automatically generated file. Do not edit.++-- | DSL functions for hydra.core.paths++module Hydra.Core.Dsl.Paths where++import qualified Hydra.Core.Decode.Paths as DecodePaths+import qualified Hydra.Core.Dsl.Model as DslModel+import qualified Hydra.Core.Encode.Paths as EncodePaths+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Typed as Typed+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void+import qualified Data.Map as M++-- | DSL constructor for hydra.core.paths.LambdaVariableReference+lambdaVariableReference :: Typed.TypedTerm Model.Name -> Typed.TypedTerm Paths.TermNodeId -> Typed.TypedTerm Model.Type -> Typed.TypedTerm Paths.LambdaVariableReference+lambdaVariableReference variable boundByNode type_ =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.paths.LambdaVariableReference"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "variable"),+ Model.fieldTerm = (Typed.unTypedTerm variable)},+ Model.Field {+ Model.fieldName = (Model.Name "boundByNode"),+ Model.fieldTerm = (Typed.unTypedTerm boundByNode)},+ Model.Field {+ Model.fieldName = (Model.Name "type"),+ Model.fieldTerm = (Typed.unTypedTerm type_)}]}))++-- | DSL accessor for the boundByNode field of hydra.core.paths.LambdaVariableReference+lambdaVariableReferenceBoundByNode :: Typed.TypedTerm Paths.LambdaVariableReference -> Typed.TypedTerm Paths.TermNodeId+lambdaVariableReferenceBoundByNode x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.paths.LambdaVariableReference"),+ Model.projectionFieldName = (Model.Name "boundByNode")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.paths.LambdaVariableReference+lambdaVariableReferenceLambdaVariableReference :: Typed.TypedName Paths.LambdaVariableReference+lambdaVariableReferenceLambdaVariableReference = Typed.TypedName (Model.Name "hydra.core.paths.LambdaVariableReference")++-- | DSL accessor for the type field of hydra.core.paths.LambdaVariableReference+lambdaVariableReferenceType :: Typed.TypedTerm Paths.LambdaVariableReference -> Typed.TypedTerm Model.Type+lambdaVariableReferenceType x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.paths.LambdaVariableReference"),+ Model.projectionFieldName = (Model.Name "type")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the variable field of hydra.core.paths.LambdaVariableReference+lambdaVariableReferenceVariable :: Typed.TypedTerm Paths.LambdaVariableReference -> Typed.TypedTerm Model.Name+lambdaVariableReferenceVariable x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.paths.LambdaVariableReference"),+ Model.projectionFieldName = (Model.Name "variable")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL updater for the boundByNode field of hydra.core.paths.LambdaVariableReference+lambdaVariableReferenceWithBoundByNode :: Typed.TypedTerm Paths.LambdaVariableReference -> Typed.TypedTerm Paths.TermNodeId -> Typed.TypedTerm Paths.LambdaVariableReference+lambdaVariableReferenceWithBoundByNode original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.paths.LambdaVariableReference"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "variable"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.paths.LambdaVariableReference"),+ Model.projectionFieldName = (Model.Name "variable")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "boundByNode"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "type"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.paths.LambdaVariableReference"),+ Model.projectionFieldName = (Model.Name "type")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the type field of hydra.core.paths.LambdaVariableReference+lambdaVariableReferenceWithType :: Typed.TypedTerm Paths.LambdaVariableReference -> Typed.TypedTerm Model.Type -> Typed.TypedTerm Paths.LambdaVariableReference+lambdaVariableReferenceWithType original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.paths.LambdaVariableReference"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "variable"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.paths.LambdaVariableReference"),+ Model.projectionFieldName = (Model.Name "variable")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "boundByNode"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.paths.LambdaVariableReference"),+ Model.projectionFieldName = (Model.Name "boundByNode")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "type"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL updater for the variable field of hydra.core.paths.LambdaVariableReference+lambdaVariableReferenceWithVariable :: Typed.TypedTerm Paths.LambdaVariableReference -> Typed.TypedTerm Model.Name -> Typed.TypedTerm Paths.LambdaVariableReference+lambdaVariableReferenceWithVariable original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.paths.LambdaVariableReference"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "variable"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "boundByNode"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.paths.LambdaVariableReference"),+ Model.projectionFieldName = (Model.Name "boundByNode")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "type"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.paths.LambdaVariableReference"),+ Model.projectionFieldName = (Model.Name "type")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL constructor for hydra.core.paths.LetVariableReference+letVariableReference :: Typed.TypedTerm Model.Name -> Typed.TypedTerm Paths.TermNodeId -> Typed.TypedTerm Model.Type -> Typed.TypedTerm Paths.LetVariableReference+letVariableReference variable bindingNode type_ =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.paths.LetVariableReference"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "variable"),+ Model.fieldTerm = (Typed.unTypedTerm variable)},+ Model.Field {+ Model.fieldName = (Model.Name "bindingNode"),+ Model.fieldTerm = (Typed.unTypedTerm bindingNode)},+ Model.Field {+ Model.fieldName = (Model.Name "type"),+ Model.fieldTerm = (Typed.unTypedTerm type_)}]}))++-- | DSL accessor for the bindingNode field of hydra.core.paths.LetVariableReference+letVariableReferenceBindingNode :: Typed.TypedTerm Paths.LetVariableReference -> Typed.TypedTerm Paths.TermNodeId+letVariableReferenceBindingNode x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.paths.LetVariableReference"),+ Model.projectionFieldName = (Model.Name "bindingNode")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.paths.LetVariableReference+letVariableReferenceLetVariableReference :: Typed.TypedName Paths.LetVariableReference+letVariableReferenceLetVariableReference = Typed.TypedName (Model.Name "hydra.core.paths.LetVariableReference")++-- | DSL accessor for the type field of hydra.core.paths.LetVariableReference+letVariableReferenceType :: Typed.TypedTerm Paths.LetVariableReference -> Typed.TypedTerm Model.Type+letVariableReferenceType x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.paths.LetVariableReference"),+ Model.projectionFieldName = (Model.Name "type")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the variable field of hydra.core.paths.LetVariableReference+letVariableReferenceVariable :: Typed.TypedTerm Paths.LetVariableReference -> Typed.TypedTerm Model.Name+letVariableReferenceVariable x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.paths.LetVariableReference"),+ Model.projectionFieldName = (Model.Name "variable")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL updater for the bindingNode field of hydra.core.paths.LetVariableReference+letVariableReferenceWithBindingNode :: Typed.TypedTerm Paths.LetVariableReference -> Typed.TypedTerm Paths.TermNodeId -> Typed.TypedTerm Paths.LetVariableReference+letVariableReferenceWithBindingNode original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.paths.LetVariableReference"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "variable"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.paths.LetVariableReference"),+ Model.projectionFieldName = (Model.Name "variable")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "bindingNode"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "type"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.paths.LetVariableReference"),+ Model.projectionFieldName = (Model.Name "type")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the type field of hydra.core.paths.LetVariableReference+letVariableReferenceWithType :: Typed.TypedTerm Paths.LetVariableReference -> Typed.TypedTerm Model.Type -> Typed.TypedTerm Paths.LetVariableReference+letVariableReferenceWithType original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.paths.LetVariableReference"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "variable"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.paths.LetVariableReference"),+ Model.projectionFieldName = (Model.Name "variable")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "bindingNode"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.paths.LetVariableReference"),+ Model.projectionFieldName = (Model.Name "bindingNode")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "type"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL updater for the variable field of hydra.core.paths.LetVariableReference+letVariableReferenceWithVariable :: Typed.TypedTerm Paths.LetVariableReference -> Typed.TypedTerm Model.Name -> Typed.TypedTerm Paths.LetVariableReference+letVariableReferenceWithVariable original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.paths.LetVariableReference"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "variable"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "bindingNode"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.paths.LetVariableReference"),+ Model.projectionFieldName = (Model.Name "bindingNode")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "type"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.paths.LetVariableReference"),+ Model.projectionFieldName = (Model.Name "type")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL constructor for hydra.core.paths.NominalTypeReference+nominalTypeReference :: Typed.TypedTerm Model.Name -> Typed.TypedTerm Paths.NominalTypeReference+nominalTypeReference name =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.paths.NominalTypeReference"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Typed.unTypedTerm name)}]}))++-- | DSL accessor for the name field of hydra.core.paths.NominalTypeReference+nominalTypeReferenceName :: Typed.TypedTerm Paths.NominalTypeReference -> Typed.TypedTerm Model.Name+nominalTypeReferenceName x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.paths.NominalTypeReference"),+ Model.projectionFieldName = (Model.Name "name")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.paths.NominalTypeReference+nominalTypeReferenceNominalTypeReference :: Typed.TypedName Paths.NominalTypeReference+nominalTypeReferenceNominalTypeReference = Typed.TypedName (Model.Name "hydra.core.paths.NominalTypeReference")++-- | DSL updater for the name field of hydra.core.paths.NominalTypeReference+nominalTypeReferenceWithName :: Typed.TypedTerm Paths.NominalTypeReference -> Typed.TypedTerm Model.Name -> Typed.TypedTerm Paths.NominalTypeReference+nominalTypeReferenceWithName original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.paths.NominalTypeReference"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL constructor for hydra.core.paths.PrimitiveReference+primitiveReference :: Typed.TypedTerm Model.Name -> Typed.TypedTerm Model.Type -> Typed.TypedTerm Paths.PrimitiveReference+primitiveReference name type_ =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.paths.PrimitiveReference"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Typed.unTypedTerm name)},+ Model.Field {+ Model.fieldName = (Model.Name "type"),+ Model.fieldTerm = (Typed.unTypedTerm type_)}]}))++-- | DSL accessor for the name field of hydra.core.paths.PrimitiveReference+primitiveReferenceName :: Typed.TypedTerm Paths.PrimitiveReference -> Typed.TypedTerm Model.Name+primitiveReferenceName x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.paths.PrimitiveReference"),+ Model.projectionFieldName = (Model.Name "name")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.paths.PrimitiveReference+primitiveReferencePrimitiveReference :: Typed.TypedName Paths.PrimitiveReference+primitiveReferencePrimitiveReference = Typed.TypedName (Model.Name "hydra.core.paths.PrimitiveReference")++-- | DSL accessor for the type field of hydra.core.paths.PrimitiveReference+primitiveReferenceType :: Typed.TypedTerm Paths.PrimitiveReference -> Typed.TypedTerm Model.Type+primitiveReferenceType x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.paths.PrimitiveReference"),+ Model.projectionFieldName = (Model.Name "type")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL updater for the name field of hydra.core.paths.PrimitiveReference+primitiveReferenceWithName :: Typed.TypedTerm Paths.PrimitiveReference -> Typed.TypedTerm Model.Name -> Typed.TypedTerm Paths.PrimitiveReference+primitiveReferenceWithName original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.paths.PrimitiveReference"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "type"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.paths.PrimitiveReference"),+ Model.projectionFieldName = (Model.Name "type")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the type field of hydra.core.paths.PrimitiveReference+primitiveReferenceWithType :: Typed.TypedTerm Paths.PrimitiveReference -> Typed.TypedTerm Model.Type -> Typed.TypedTerm Paths.PrimitiveReference+primitiveReferenceWithType original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.paths.PrimitiveReference"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.paths.PrimitiveReference"),+ Model.projectionFieldName = (Model.Name "name")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "type"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL constructor for hydra.core.paths.SubtermLink+subtermLink :: Typed.TypedTerm Paths.SubtermStep -> Typed.TypedTerm Paths.TermNode -> Typed.TypedTerm Paths.SubtermLink+subtermLink step child =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.paths.SubtermLink"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "step"),+ Model.fieldTerm = (Typed.unTypedTerm step)},+ Model.Field {+ Model.fieldName = (Model.Name "child"),+ Model.fieldTerm = (Typed.unTypedTerm child)}]}))++-- | DSL accessor for the child field of hydra.core.paths.SubtermLink+subtermLinkChild :: Typed.TypedTerm Paths.SubtermLink -> Typed.TypedTerm Paths.TermNode+subtermLinkChild x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.paths.SubtermLink"),+ Model.projectionFieldName = (Model.Name "child")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the step field of hydra.core.paths.SubtermLink+subtermLinkStep :: Typed.TypedTerm Paths.SubtermLink -> Typed.TypedTerm Paths.SubtermStep+subtermLinkStep x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.paths.SubtermLink"),+ Model.projectionFieldName = (Model.Name "step")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.paths.SubtermLink+subtermLinkSubtermLink :: Typed.TypedName Paths.SubtermLink+subtermLinkSubtermLink = Typed.TypedName (Model.Name "hydra.core.paths.SubtermLink")++-- | DSL updater for the child field of hydra.core.paths.SubtermLink+subtermLinkWithChild :: Typed.TypedTerm Paths.SubtermLink -> Typed.TypedTerm Paths.TermNode -> Typed.TypedTerm Paths.SubtermLink+subtermLinkWithChild original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.paths.SubtermLink"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "step"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.paths.SubtermLink"),+ Model.projectionFieldName = (Model.Name "step")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "child"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL updater for the step field of hydra.core.paths.SubtermLink+subtermLinkWithStep :: Typed.TypedTerm Paths.SubtermLink -> Typed.TypedTerm Paths.SubtermStep -> Typed.TypedTerm Paths.SubtermLink+subtermLinkWithStep original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.paths.SubtermLink"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "step"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "child"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.paths.SubtermLink"),+ Model.projectionFieldName = (Model.Name "child")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL constructor for the hydra.core.paths.SubtermPath wrapper+subtermPath :: Typed.TypedTerm [Paths.SubtermStep] -> Typed.TypedTerm Paths.SubtermPath+subtermPath x =+ Typed.TypedTerm (Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.Name "hydra.core.paths.SubtermPath"),+ Model.wrappedTermBody = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.paths.SubtermPath+subtermPathSubtermPath :: Typed.TypedName Paths.SubtermPath+subtermPathSubtermPath = Typed.TypedName (Model.Name "hydra.core.paths.SubtermPath")++-- | DSL injection for the annotatedAnnotation variant of hydra.core.paths.SubtermStep+subtermStepAnnotatedAnnotation :: Typed.TypedTerm Paths.SubtermStep+subtermStepAnnotatedAnnotation =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.paths.SubtermStep"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "annotatedAnnotation"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL injection for the annotatedBody variant of hydra.core.paths.SubtermStep+subtermStepAnnotatedBody :: Typed.TypedTerm Paths.SubtermStep+subtermStepAnnotatedBody =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.paths.SubtermStep"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "annotatedBody"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL injection for the applicationArgument variant of hydra.core.paths.SubtermStep+subtermStepApplicationArgument :: Typed.TypedTerm Paths.SubtermStep+subtermStepApplicationArgument =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.paths.SubtermStep"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "applicationArgument"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL injection for the applicationFunction variant of hydra.core.paths.SubtermStep+subtermStepApplicationFunction :: Typed.TypedTerm Paths.SubtermStep+subtermStepApplicationFunction =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.paths.SubtermStep"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "applicationFunction"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL injection for the casesCase variant of hydra.core.paths.SubtermStep+subtermStepCasesCase :: Typed.TypedTerm Model.Name -> Typed.TypedTerm Paths.SubtermStep+subtermStepCasesCase x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.paths.SubtermStep"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "casesCase"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the casesDefault variant of hydra.core.paths.SubtermStep+subtermStepCasesDefault :: Typed.TypedTerm Paths.SubtermStep+subtermStepCasesDefault =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.paths.SubtermStep"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "casesDefault"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL injection for the eitherLeft variant of hydra.core.paths.SubtermStep+subtermStepEitherLeft :: Typed.TypedTerm Paths.SubtermStep+subtermStepEitherLeft =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.paths.SubtermStep"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "eitherLeft"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL injection for the eitherRight variant of hydra.core.paths.SubtermStep+subtermStepEitherRight :: Typed.TypedTerm Paths.SubtermStep+subtermStepEitherRight =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.paths.SubtermStep"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "eitherRight"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL injection for the injectField variant of hydra.core.paths.SubtermStep+subtermStepInjectField :: Typed.TypedTerm Model.Name -> Typed.TypedTerm Paths.SubtermStep+subtermStepInjectField x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.paths.SubtermStep"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "injectField"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the lambdaBody variant of hydra.core.paths.SubtermStep+subtermStepLambdaBody :: Typed.TypedTerm Paths.SubtermStep+subtermStepLambdaBody =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.paths.SubtermStep"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "lambdaBody"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL injection for the letBinding variant of hydra.core.paths.SubtermStep+subtermStepLetBinding :: Typed.TypedTerm Model.Name -> Typed.TypedTerm Paths.SubtermStep+subtermStepLetBinding x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.paths.SubtermStep"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "letBinding"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the letBody variant of hydra.core.paths.SubtermStep+subtermStepLetBody :: Typed.TypedTerm Paths.SubtermStep+subtermStepLetBody =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.paths.SubtermStep"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "letBody"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL injection for the listElement variant of hydra.core.paths.SubtermStep+subtermStepListElement :: Typed.TypedTerm Int -> Typed.TypedTerm Paths.SubtermStep+subtermStepListElement x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.paths.SubtermStep"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "listElement"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the mapEntry variant of hydra.core.paths.SubtermStep+subtermStepMapEntry :: Typed.TypedTerm Int -> Typed.TypedTerm Paths.SubtermStep+subtermStepMapEntry x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.paths.SubtermStep"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "mapEntry"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the optionalGiven variant of hydra.core.paths.SubtermStep+subtermStepOptionalGiven :: Typed.TypedTerm Paths.SubtermStep+subtermStepOptionalGiven =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.paths.SubtermStep"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "optionalGiven"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL injection for the pairFirst variant of hydra.core.paths.SubtermStep+subtermStepPairFirst :: Typed.TypedTerm Paths.SubtermStep+subtermStepPairFirst =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.paths.SubtermStep"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "pairFirst"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL injection for the pairSecond variant of hydra.core.paths.SubtermStep+subtermStepPairSecond :: Typed.TypedTerm Paths.SubtermStep+subtermStepPairSecond =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.paths.SubtermStep"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "pairSecond"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL injection for the recordField variant of hydra.core.paths.SubtermStep+subtermStepRecordField :: Typed.TypedTerm Model.Name -> Typed.TypedTerm Paths.SubtermStep+subtermStepRecordField x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.paths.SubtermStep"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "recordField"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the setElement variant of hydra.core.paths.SubtermStep+subtermStepSetElement :: Typed.TypedTerm Int -> Typed.TypedTerm Paths.SubtermStep+subtermStepSetElement x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.paths.SubtermStep"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "setElement"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL name token for hydra.core.paths.SubtermStep+subtermStepSubtermStep :: Typed.TypedName Paths.SubtermStep+subtermStepSubtermStep = Typed.TypedName (Model.Name "hydra.core.paths.SubtermStep")++-- | DSL injection for the typeApplicationBody variant of hydra.core.paths.SubtermStep+subtermStepTypeApplicationBody :: Typed.TypedTerm Paths.SubtermStep+subtermStepTypeApplicationBody =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.paths.SubtermStep"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "typeApplicationBody"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL injection for the typeLambdaBody variant of hydra.core.paths.SubtermStep+subtermStepTypeLambdaBody :: Typed.TypedTerm Paths.SubtermStep+subtermStepTypeLambdaBody =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.paths.SubtermStep"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "typeLambdaBody"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL injection for the wrapBody variant of hydra.core.paths.SubtermStep+subtermStepWrapBody :: Typed.TypedTerm Paths.SubtermStep+subtermStepWrapBody =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.paths.SubtermStep"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "wrapBody"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL constructor for hydra.core.paths.SubtypeLink+subtypeLink :: Typed.TypedTerm Paths.SubtypeStep -> Typed.TypedTerm Paths.TypeNode -> Typed.TypedTerm Paths.SubtypeLink+subtypeLink step child =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.paths.SubtypeLink"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "step"),+ Model.fieldTerm = (Typed.unTypedTerm step)},+ Model.Field {+ Model.fieldName = (Model.Name "child"),+ Model.fieldTerm = (Typed.unTypedTerm child)}]}))++-- | DSL accessor for the child field of hydra.core.paths.SubtypeLink+subtypeLinkChild :: Typed.TypedTerm Paths.SubtypeLink -> Typed.TypedTerm Paths.TypeNode+subtypeLinkChild x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.paths.SubtypeLink"),+ Model.projectionFieldName = (Model.Name "child")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the step field of hydra.core.paths.SubtypeLink+subtypeLinkStep :: Typed.TypedTerm Paths.SubtypeLink -> Typed.TypedTerm Paths.SubtypeStep+subtypeLinkStep x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.paths.SubtypeLink"),+ Model.projectionFieldName = (Model.Name "step")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.paths.SubtypeLink+subtypeLinkSubtypeLink :: Typed.TypedName Paths.SubtypeLink+subtypeLinkSubtypeLink = Typed.TypedName (Model.Name "hydra.core.paths.SubtypeLink")++-- | DSL updater for the child field of hydra.core.paths.SubtypeLink+subtypeLinkWithChild :: Typed.TypedTerm Paths.SubtypeLink -> Typed.TypedTerm Paths.TypeNode -> Typed.TypedTerm Paths.SubtypeLink+subtypeLinkWithChild original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.paths.SubtypeLink"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "step"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.paths.SubtypeLink"),+ Model.projectionFieldName = (Model.Name "step")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "child"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL updater for the step field of hydra.core.paths.SubtypeLink+subtypeLinkWithStep :: Typed.TypedTerm Paths.SubtypeLink -> Typed.TypedTerm Paths.SubtypeStep -> Typed.TypedTerm Paths.SubtypeLink+subtypeLinkWithStep original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.paths.SubtypeLink"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "step"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "child"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.paths.SubtypeLink"),+ Model.projectionFieldName = (Model.Name "child")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL constructor for the hydra.core.paths.SubtypePath wrapper+subtypePath :: Typed.TypedTerm [Paths.SubtypeStep] -> Typed.TypedTerm Paths.SubtypePath+subtypePath x =+ Typed.TypedTerm (Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.Name "hydra.core.paths.SubtypePath"),+ Model.wrappedTermBody = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.paths.SubtypePath+subtypePathSubtypePath :: Typed.TypedName Paths.SubtypePath+subtypePathSubtypePath = Typed.TypedName (Model.Name "hydra.core.paths.SubtypePath")++-- | DSL injection for the annotatedBody variant of hydra.core.paths.SubtypeStep+subtypeStepAnnotatedBody :: Typed.TypedTerm Paths.SubtypeStep+subtypeStepAnnotatedBody =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.paths.SubtypeStep"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "annotatedBody"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL injection for the applicationArgument variant of hydra.core.paths.SubtypeStep+subtypeStepApplicationArgument :: Typed.TypedTerm Paths.SubtypeStep+subtypeStepApplicationArgument =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.paths.SubtypeStep"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "applicationArgument"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL injection for the applicationFunction variant of hydra.core.paths.SubtypeStep+subtypeStepApplicationFunction :: Typed.TypedTerm Paths.SubtypeStep+subtypeStepApplicationFunction =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.paths.SubtypeStep"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "applicationFunction"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL injection for the effectValue variant of hydra.core.paths.SubtypeStep+subtypeStepEffectValue :: Typed.TypedTerm Paths.SubtypeStep+subtypeStepEffectValue =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.paths.SubtypeStep"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "effectValue"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL injection for the eitherLeft variant of hydra.core.paths.SubtypeStep+subtypeStepEitherLeft :: Typed.TypedTerm Paths.SubtypeStep+subtypeStepEitherLeft =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.paths.SubtypeStep"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "eitherLeft"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL injection for the eitherRight variant of hydra.core.paths.SubtypeStep+subtypeStepEitherRight :: Typed.TypedTerm Paths.SubtypeStep+subtypeStepEitherRight =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.paths.SubtypeStep"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "eitherRight"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL injection for the forallBody variant of hydra.core.paths.SubtypeStep+subtypeStepForallBody :: Typed.TypedTerm Paths.SubtypeStep+subtypeStepForallBody =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.paths.SubtypeStep"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "forallBody"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL injection for the functionCodomain variant of hydra.core.paths.SubtypeStep+subtypeStepFunctionCodomain :: Typed.TypedTerm Paths.SubtypeStep+subtypeStepFunctionCodomain =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.paths.SubtypeStep"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "functionCodomain"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL injection for the functionDomain variant of hydra.core.paths.SubtypeStep+subtypeStepFunctionDomain :: Typed.TypedTerm Paths.SubtypeStep+subtypeStepFunctionDomain =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.paths.SubtypeStep"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "functionDomain"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL injection for the listElement variant of hydra.core.paths.SubtypeStep+subtypeStepListElement :: Typed.TypedTerm Paths.SubtypeStep+subtypeStepListElement =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.paths.SubtypeStep"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "listElement"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL injection for the mapKeys variant of hydra.core.paths.SubtypeStep+subtypeStepMapKeys :: Typed.TypedTerm Paths.SubtypeStep+subtypeStepMapKeys =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.paths.SubtypeStep"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "mapKeys"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL injection for the mapValues variant of hydra.core.paths.SubtypeStep+subtypeStepMapValues :: Typed.TypedTerm Paths.SubtypeStep+subtypeStepMapValues =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.paths.SubtypeStep"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "mapValues"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL injection for the optionalElement variant of hydra.core.paths.SubtypeStep+subtypeStepOptionalElement :: Typed.TypedTerm Paths.SubtypeStep+subtypeStepOptionalElement =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.paths.SubtypeStep"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "optionalElement"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL injection for the pairFirst variant of hydra.core.paths.SubtypeStep+subtypeStepPairFirst :: Typed.TypedTerm Paths.SubtypeStep+subtypeStepPairFirst =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.paths.SubtypeStep"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "pairFirst"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL injection for the pairSecond variant of hydra.core.paths.SubtypeStep+subtypeStepPairSecond :: Typed.TypedTerm Paths.SubtypeStep+subtypeStepPairSecond =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.paths.SubtypeStep"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "pairSecond"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL injection for the recordField variant of hydra.core.paths.SubtypeStep+subtypeStepRecordField :: Typed.TypedTerm Model.Name -> Typed.TypedTerm Paths.SubtypeStep+subtypeStepRecordField x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.paths.SubtypeStep"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "recordField"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the setElement variant of hydra.core.paths.SubtypeStep+subtypeStepSetElement :: Typed.TypedTerm Paths.SubtypeStep+subtypeStepSetElement =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.paths.SubtypeStep"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "setElement"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL name token for hydra.core.paths.SubtypeStep+subtypeStepSubtypeStep :: Typed.TypedName Paths.SubtypeStep+subtypeStepSubtypeStep = Typed.TypedName (Model.Name "hydra.core.paths.SubtypeStep")++-- | DSL injection for the unionField variant of hydra.core.paths.SubtypeStep+subtypeStepUnionField :: Typed.TypedTerm Model.Name -> Typed.TypedTerm Paths.SubtypeStep+subtypeStepUnionField x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.paths.SubtypeStep"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "unionField"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the wrapBody variant of hydra.core.paths.SubtypeStep+subtypeStepWrapBody :: Typed.TypedTerm Paths.SubtypeStep+subtypeStepWrapBody =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.paths.SubtypeStep"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "wrapBody"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL injection for the casesTypeName variant of hydra.core.paths.TermAttributeLink+termAttributeLinkCasesTypeName :: Typed.TypedTerm Model.Name -> Typed.TypedTerm Paths.TermAttributeLink+termAttributeLinkCasesTypeName x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.paths.TermAttributeLink"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "casesTypeName"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the injectTypeName variant of hydra.core.paths.TermAttributeLink+termAttributeLinkInjectTypeName :: Typed.TypedTerm Model.Name -> Typed.TypedTerm Paths.TermAttributeLink+termAttributeLinkInjectTypeName x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.paths.TermAttributeLink"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "injectTypeName"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the lambdaDomainGiven variant of hydra.core.paths.TermAttributeLink+termAttributeLinkLambdaDomainGiven :: Typed.TypedTerm Model.Type -> Typed.TypedTerm Paths.TermAttributeLink+termAttributeLinkLambdaDomainGiven x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.paths.TermAttributeLink"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "lambdaDomainGiven"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the lambdaParameter variant of hydra.core.paths.TermAttributeLink+termAttributeLinkLambdaParameter :: Typed.TypedTerm Model.Name -> Typed.TypedTerm Paths.TermAttributeLink+termAttributeLinkLambdaParameter x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.paths.TermAttributeLink"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "lambdaParameter"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the letBindingTypeSchemeGiven variant of hydra.core.paths.TermAttributeLink+termAttributeLinkLetBindingTypeSchemeGiven :: Typed.TypedTerm (Model.Name, Model.TypeScheme) -> Typed.TypedTerm Paths.TermAttributeLink+termAttributeLinkLetBindingTypeSchemeGiven x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.paths.TermAttributeLink"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "letBindingTypeSchemeGiven"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the literal variant of hydra.core.paths.TermAttributeLink+termAttributeLinkLiteral :: Typed.TypedTerm Model.Literal -> Typed.TypedTerm Paths.TermAttributeLink+termAttributeLinkLiteral x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.paths.TermAttributeLink"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "literal"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the projectFieldName variant of hydra.core.paths.TermAttributeLink+termAttributeLinkProjectFieldName :: Typed.TypedTerm Model.Name -> Typed.TypedTerm Paths.TermAttributeLink+termAttributeLinkProjectFieldName x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.paths.TermAttributeLink"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "projectFieldName"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the projectTypeName variant of hydra.core.paths.TermAttributeLink+termAttributeLinkProjectTypeName :: Typed.TypedTerm Model.Name -> Typed.TypedTerm Paths.TermAttributeLink+termAttributeLinkProjectTypeName x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.paths.TermAttributeLink"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "projectTypeName"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the recordTypeName variant of hydra.core.paths.TermAttributeLink+termAttributeLinkRecordTypeName :: Typed.TypedTerm Model.Name -> Typed.TypedTerm Paths.TermAttributeLink+termAttributeLinkRecordTypeName x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.paths.TermAttributeLink"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "recordTypeName"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL name token for hydra.core.paths.TermAttributeLink+termAttributeLinkTermAttributeLink :: Typed.TypedName Paths.TermAttributeLink+termAttributeLinkTermAttributeLink = Typed.TypedName (Model.Name "hydra.core.paths.TermAttributeLink")++-- | DSL injection for the typeApplicationType variant of hydra.core.paths.TermAttributeLink+termAttributeLinkTypeApplicationType :: Typed.TypedTerm Model.Type -> Typed.TypedTerm Paths.TermAttributeLink+termAttributeLinkTypeApplicationType x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.paths.TermAttributeLink"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "typeApplicationType"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the typeLambdaParameter variant of hydra.core.paths.TermAttributeLink+termAttributeLinkTypeLambdaParameter :: Typed.TypedTerm Model.Name -> Typed.TypedTerm Paths.TermAttributeLink+termAttributeLinkTypeLambdaParameter x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.paths.TermAttributeLink"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "typeLambdaParameter"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the unwrapTypeName variant of hydra.core.paths.TermAttributeLink+termAttributeLinkUnwrapTypeName :: Typed.TypedTerm Model.Name -> Typed.TypedTerm Paths.TermAttributeLink+termAttributeLinkUnwrapTypeName x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.paths.TermAttributeLink"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "unwrapTypeName"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the wrapTypeName variant of hydra.core.paths.TermAttributeLink+termAttributeLinkWrapTypeName :: Typed.TypedTerm Model.Name -> Typed.TypedTerm Paths.TermAttributeLink+termAttributeLinkWrapTypeName x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.paths.TermAttributeLink"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "wrapTypeName"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL constructor for hydra.core.paths.TermGraph+termGraph :: Typed.TypedTerm (M.Map Model.Name Paths.TermNode) -> Typed.TypedTerm Paths.TermGraph+termGraph roots =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.paths.TermGraph"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "roots"),+ Model.fieldTerm = (Typed.unTypedTerm roots)}]}))++-- | DSL accessor for the roots field of hydra.core.paths.TermGraph+termGraphRoots :: Typed.TypedTerm Paths.TermGraph -> Typed.TypedTerm (M.Map Model.Name Paths.TermNode)+termGraphRoots x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.paths.TermGraph"),+ Model.projectionFieldName = (Model.Name "roots")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.paths.TermGraph+termGraphTermGraph :: Typed.TypedName Paths.TermGraph+termGraphTermGraph = Typed.TypedName (Model.Name "hydra.core.paths.TermGraph")++-- | DSL updater for the roots field of hydra.core.paths.TermGraph+termGraphWithRoots :: Typed.TypedTerm Paths.TermGraph -> Typed.TypedTerm (M.Map Model.Name Paths.TermNode) -> Typed.TypedTerm Paths.TermGraph+termGraphWithRoots original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.paths.TermGraph"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "roots"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL injection for the attribute variant of hydra.core.paths.TermLink+termLinkAttribute :: Typed.TypedTerm Paths.TermAttributeLink -> Typed.TypedTerm Paths.TermLink+termLinkAttribute x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.paths.TermLink"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "attribute"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the reference variant of hydra.core.paths.TermLink+termLinkReference :: Typed.TypedTerm Paths.TermReferenceLink -> Typed.TypedTerm Paths.TermLink+termLinkReference x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.paths.TermLink"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "reference"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the subterm variant of hydra.core.paths.TermLink+termLinkSubterm :: Typed.TypedTerm Paths.SubtermLink -> Typed.TypedTerm Paths.TermLink+termLinkSubterm x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.paths.TermLink"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "subterm"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL name token for hydra.core.paths.TermLink+termLinkTermLink :: Typed.TypedName Paths.TermLink+termLinkTermLink = Typed.TypedName (Model.Name "hydra.core.paths.TermLink")++-- | DSL constructor for hydra.core.paths.TermNode+termNode :: Typed.TypedTerm Model.Term -> Typed.TypedTerm Model.Type -> Typed.TypedTerm [Paths.TermLink] -> Typed.TypedTerm Paths.TermNode+termNode term type_ links =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.paths.TermNode"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "term"),+ Model.fieldTerm = (Typed.unTypedTerm term)},+ Model.Field {+ Model.fieldName = (Model.Name "type"),+ Model.fieldTerm = (Typed.unTypedTerm type_)},+ Model.Field {+ Model.fieldName = (Model.Name "links"),+ Model.fieldTerm = (Typed.unTypedTerm links)}]}))++-- | DSL constructor for hydra.core.paths.TermNodeId+termNodeId :: Typed.TypedTerm Model.Name -> Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm Paths.TermNodeId+termNodeId root path =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.paths.TermNodeId"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "root"),+ Model.fieldTerm = (Typed.unTypedTerm root)},+ Model.Field {+ Model.fieldName = (Model.Name "path"),+ Model.fieldTerm = (Typed.unTypedTerm path)}]}))++-- | DSL accessor for the path field of hydra.core.paths.TermNodeId+termNodeIdPath :: Typed.TypedTerm Paths.TermNodeId -> Typed.TypedTerm Paths.SubtermPath+termNodeIdPath x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.paths.TermNodeId"),+ Model.projectionFieldName = (Model.Name "path")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the root field of hydra.core.paths.TermNodeId+termNodeIdRoot :: Typed.TypedTerm Paths.TermNodeId -> Typed.TypedTerm Model.Name+termNodeIdRoot x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.paths.TermNodeId"),+ Model.projectionFieldName = (Model.Name "root")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.paths.TermNodeId+termNodeIdTermNodeId :: Typed.TypedName Paths.TermNodeId+termNodeIdTermNodeId = Typed.TypedName (Model.Name "hydra.core.paths.TermNodeId")++-- | DSL updater for the path field of hydra.core.paths.TermNodeId+termNodeIdWithPath :: Typed.TypedTerm Paths.TermNodeId -> Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm Paths.TermNodeId+termNodeIdWithPath original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.paths.TermNodeId"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "root"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.paths.TermNodeId"),+ Model.projectionFieldName = (Model.Name "root")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "path"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL updater for the root field of hydra.core.paths.TermNodeId+termNodeIdWithRoot :: Typed.TypedTerm Paths.TermNodeId -> Typed.TypedTerm Model.Name -> Typed.TypedTerm Paths.TermNodeId+termNodeIdWithRoot original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.paths.TermNodeId"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "root"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "path"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.paths.TermNodeId"),+ Model.projectionFieldName = (Model.Name "path")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL accessor for the links field of hydra.core.paths.TermNode+termNodeLinks :: Typed.TypedTerm Paths.TermNode -> Typed.TypedTerm [Paths.TermLink]+termNodeLinks x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.paths.TermNode"),+ Model.projectionFieldName = (Model.Name "links")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the term field of hydra.core.paths.TermNode+termNodeTerm :: Typed.TypedTerm Paths.TermNode -> Typed.TypedTerm Model.Term+termNodeTerm x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.paths.TermNode"),+ Model.projectionFieldName = (Model.Name "term")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.paths.TermNode+termNodeTermNode :: Typed.TypedName Paths.TermNode+termNodeTermNode = Typed.TypedName (Model.Name "hydra.core.paths.TermNode")++-- | DSL accessor for the type field of hydra.core.paths.TermNode+termNodeType :: Typed.TypedTerm Paths.TermNode -> Typed.TypedTerm Model.Type+termNodeType x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.paths.TermNode"),+ Model.projectionFieldName = (Model.Name "type")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL updater for the links field of hydra.core.paths.TermNode+termNodeWithLinks :: Typed.TypedTerm Paths.TermNode -> Typed.TypedTerm [Paths.TermLink] -> Typed.TypedTerm Paths.TermNode+termNodeWithLinks original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.paths.TermNode"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "term"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.paths.TermNode"),+ Model.projectionFieldName = (Model.Name "term")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "type"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.paths.TermNode"),+ Model.projectionFieldName = (Model.Name "type")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "links"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL updater for the term field of hydra.core.paths.TermNode+termNodeWithTerm :: Typed.TypedTerm Paths.TermNode -> Typed.TypedTerm Model.Term -> Typed.TypedTerm Paths.TermNode+termNodeWithTerm original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.paths.TermNode"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "term"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "type"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.paths.TermNode"),+ Model.projectionFieldName = (Model.Name "type")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "links"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.paths.TermNode"),+ Model.projectionFieldName = (Model.Name "links")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the type field of hydra.core.paths.TermNode+termNodeWithType :: Typed.TypedTerm Paths.TermNode -> Typed.TypedTerm Model.Type -> Typed.TypedTerm Paths.TermNode+termNodeWithType original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.paths.TermNode"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "term"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.paths.TermNode"),+ Model.projectionFieldName = (Model.Name "term")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "type"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "links"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.paths.TermNode"),+ Model.projectionFieldName = (Model.Name "links")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL injection for the lambda variant of hydra.core.paths.TermReference+termReferenceLambda :: Typed.TypedTerm Paths.LambdaVariableReference -> Typed.TypedTerm Paths.TermReference+termReferenceLambda x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.paths.TermReference"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "lambda"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the let variant of hydra.core.paths.TermReference+termReferenceLet :: Typed.TypedTerm Paths.LetVariableReference -> Typed.TypedTerm Paths.TermReference+termReferenceLet x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.paths.TermReference"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "let"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL constructor for hydra.core.paths.TermReferenceLink+termReferenceLink :: Typed.TypedTerm Paths.SubtermStep -> Typed.TypedTerm Paths.TermReference -> Typed.TypedTerm Paths.TermReferenceLink+termReferenceLink step target =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.paths.TermReferenceLink"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "step"),+ Model.fieldTerm = (Typed.unTypedTerm step)},+ Model.Field {+ Model.fieldName = (Model.Name "target"),+ Model.fieldTerm = (Typed.unTypedTerm target)}]}))++-- | DSL accessor for the step field of hydra.core.paths.TermReferenceLink+termReferenceLinkStep :: Typed.TypedTerm Paths.TermReferenceLink -> Typed.TypedTerm Paths.SubtermStep+termReferenceLinkStep x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.paths.TermReferenceLink"),+ Model.projectionFieldName = (Model.Name "step")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the target field of hydra.core.paths.TermReferenceLink+termReferenceLinkTarget :: Typed.TypedTerm Paths.TermReferenceLink -> Typed.TypedTerm Paths.TermReference+termReferenceLinkTarget x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.paths.TermReferenceLink"),+ Model.projectionFieldName = (Model.Name "target")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.paths.TermReferenceLink+termReferenceLinkTermReferenceLink :: Typed.TypedName Paths.TermReferenceLink+termReferenceLinkTermReferenceLink = Typed.TypedName (Model.Name "hydra.core.paths.TermReferenceLink")++-- | DSL updater for the step field of hydra.core.paths.TermReferenceLink+termReferenceLinkWithStep :: Typed.TypedTerm Paths.TermReferenceLink -> Typed.TypedTerm Paths.SubtermStep -> Typed.TypedTerm Paths.TermReferenceLink+termReferenceLinkWithStep original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.paths.TermReferenceLink"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "step"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "target"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.paths.TermReferenceLink"),+ Model.projectionFieldName = (Model.Name "target")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the target field of hydra.core.paths.TermReferenceLink+termReferenceLinkWithTarget :: Typed.TypedTerm Paths.TermReferenceLink -> Typed.TypedTerm Paths.TermReference -> Typed.TypedTerm Paths.TermReferenceLink+termReferenceLinkWithTarget original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.paths.TermReferenceLink"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "step"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.paths.TermReferenceLink"),+ Model.projectionFieldName = (Model.Name "step")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "target"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL injection for the primitive variant of hydra.core.paths.TermReference+termReferencePrimitive :: Typed.TypedTerm Paths.PrimitiveReference -> Typed.TypedTerm Paths.TermReference+termReferencePrimitive x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.paths.TermReference"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "primitive"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL name token for hydra.core.paths.TermReference+termReferenceTermReference :: Typed.TypedName Paths.TermReference+termReferenceTermReference = Typed.TypedName (Model.Name "hydra.core.paths.TermReference")++-- | DSL injection for the annotatedAnnotation variant of hydra.core.paths.TypeAttributeLink+typeAttributeLinkAnnotatedAnnotation :: Typed.TypedTerm Model.Term -> Typed.TypedTerm Paths.TypeAttributeLink+typeAttributeLinkAnnotatedAnnotation x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.paths.TypeAttributeLink"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "annotatedAnnotation"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the forallParameter variant of hydra.core.paths.TypeAttributeLink+typeAttributeLinkForallParameter :: Typed.TypedTerm Model.Name -> Typed.TypedTerm Paths.TypeAttributeLink+typeAttributeLinkForallParameter x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.paths.TypeAttributeLink"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "forallParameter"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the literal variant of hydra.core.paths.TypeAttributeLink+typeAttributeLinkLiteral :: Typed.TypedTerm Model.LiteralType -> Typed.TypedTerm Paths.TypeAttributeLink+typeAttributeLinkLiteral x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.paths.TypeAttributeLink"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "literal"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL name token for hydra.core.paths.TypeAttributeLink+typeAttributeLinkTypeAttributeLink :: Typed.TypedName Paths.TypeAttributeLink+typeAttributeLinkTypeAttributeLink = Typed.TypedName (Model.Name "hydra.core.paths.TypeAttributeLink")++-- | DSL constructor for hydra.core.paths.TypeGraph+typeGraph :: Typed.TypedTerm (M.Map Model.Name Paths.TypeNode) -> Typed.TypedTerm Paths.TypeGraph+typeGraph roots =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.paths.TypeGraph"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "roots"),+ Model.fieldTerm = (Typed.unTypedTerm roots)}]}))++-- | DSL accessor for the roots field of hydra.core.paths.TypeGraph+typeGraphRoots :: Typed.TypedTerm Paths.TypeGraph -> Typed.TypedTerm (M.Map Model.Name Paths.TypeNode)+typeGraphRoots x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.paths.TypeGraph"),+ Model.projectionFieldName = (Model.Name "roots")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.paths.TypeGraph+typeGraphTypeGraph :: Typed.TypedName Paths.TypeGraph+typeGraphTypeGraph = Typed.TypedName (Model.Name "hydra.core.paths.TypeGraph")++-- | DSL updater for the roots field of hydra.core.paths.TypeGraph+typeGraphWithRoots :: Typed.TypedTerm Paths.TypeGraph -> Typed.TypedTerm (M.Map Model.Name Paths.TypeNode) -> Typed.TypedTerm Paths.TypeGraph+typeGraphWithRoots original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.paths.TypeGraph"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "roots"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL injection for the attribute variant of hydra.core.paths.TypeLink+typeLinkAttribute :: Typed.TypedTerm Paths.TypeAttributeLink -> Typed.TypedTerm Paths.TypeLink+typeLinkAttribute x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.paths.TypeLink"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "attribute"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the reference variant of hydra.core.paths.TypeLink+typeLinkReference :: Typed.TypedTerm Paths.TypeReferenceLink -> Typed.TypedTerm Paths.TypeLink+typeLinkReference x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.paths.TypeLink"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "reference"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the subtype variant of hydra.core.paths.TypeLink+typeLinkSubtype :: Typed.TypedTerm Paths.SubtypeLink -> Typed.TypedTerm Paths.TypeLink+typeLinkSubtype x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.paths.TypeLink"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "subtype"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL name token for hydra.core.paths.TypeLink+typeLinkTypeLink :: Typed.TypedName Paths.TypeLink+typeLinkTypeLink = Typed.TypedName (Model.Name "hydra.core.paths.TypeLink")++-- | DSL constructor for hydra.core.paths.TypeNode+typeNode :: Typed.TypedTerm Model.Type -> Typed.TypedTerm [Paths.TypeLink] -> Typed.TypedTerm Paths.TypeNode+typeNode type_ links =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.paths.TypeNode"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "type"),+ Model.fieldTerm = (Typed.unTypedTerm type_)},+ Model.Field {+ Model.fieldName = (Model.Name "links"),+ Model.fieldTerm = (Typed.unTypedTerm links)}]}))++-- | DSL constructor for hydra.core.paths.TypeNodeId+typeNodeId :: Typed.TypedTerm Model.Name -> Typed.TypedTerm Paths.SubtypePath -> Typed.TypedTerm Paths.TypeNodeId+typeNodeId root path =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.paths.TypeNodeId"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "root"),+ Model.fieldTerm = (Typed.unTypedTerm root)},+ Model.Field {+ Model.fieldName = (Model.Name "path"),+ Model.fieldTerm = (Typed.unTypedTerm path)}]}))++-- | DSL accessor for the path field of hydra.core.paths.TypeNodeId+typeNodeIdPath :: Typed.TypedTerm Paths.TypeNodeId -> Typed.TypedTerm Paths.SubtypePath+typeNodeIdPath x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.paths.TypeNodeId"),+ Model.projectionFieldName = (Model.Name "path")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the root field of hydra.core.paths.TypeNodeId+typeNodeIdRoot :: Typed.TypedTerm Paths.TypeNodeId -> Typed.TypedTerm Model.Name+typeNodeIdRoot x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.paths.TypeNodeId"),+ Model.projectionFieldName = (Model.Name "root")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.paths.TypeNodeId+typeNodeIdTypeNodeId :: Typed.TypedName Paths.TypeNodeId+typeNodeIdTypeNodeId = Typed.TypedName (Model.Name "hydra.core.paths.TypeNodeId")++-- | DSL updater for the path field of hydra.core.paths.TypeNodeId+typeNodeIdWithPath :: Typed.TypedTerm Paths.TypeNodeId -> Typed.TypedTerm Paths.SubtypePath -> Typed.TypedTerm Paths.TypeNodeId+typeNodeIdWithPath original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.paths.TypeNodeId"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "root"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.paths.TypeNodeId"),+ Model.projectionFieldName = (Model.Name "root")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "path"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL updater for the root field of hydra.core.paths.TypeNodeId+typeNodeIdWithRoot :: Typed.TypedTerm Paths.TypeNodeId -> Typed.TypedTerm Model.Name -> Typed.TypedTerm Paths.TypeNodeId+typeNodeIdWithRoot original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.paths.TypeNodeId"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "root"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "path"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.paths.TypeNodeId"),+ Model.projectionFieldName = (Model.Name "path")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL accessor for the links field of hydra.core.paths.TypeNode+typeNodeLinks :: Typed.TypedTerm Paths.TypeNode -> Typed.TypedTerm [Paths.TypeLink]+typeNodeLinks x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.paths.TypeNode"),+ Model.projectionFieldName = (Model.Name "links")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the type field of hydra.core.paths.TypeNode+typeNodeType :: Typed.TypedTerm Paths.TypeNode -> Typed.TypedTerm Model.Type+typeNodeType x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.paths.TypeNode"),+ Model.projectionFieldName = (Model.Name "type")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.paths.TypeNode+typeNodeTypeNode :: Typed.TypedName Paths.TypeNode+typeNodeTypeNode = Typed.TypedName (Model.Name "hydra.core.paths.TypeNode")++-- | DSL updater for the links field of hydra.core.paths.TypeNode+typeNodeWithLinks :: Typed.TypedTerm Paths.TypeNode -> Typed.TypedTerm [Paths.TypeLink] -> Typed.TypedTerm Paths.TypeNode+typeNodeWithLinks original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.paths.TypeNode"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "type"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.paths.TypeNode"),+ Model.projectionFieldName = (Model.Name "type")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "links"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL updater for the type field of hydra.core.paths.TypeNode+typeNodeWithType :: Typed.TypedTerm Paths.TypeNode -> Typed.TypedTerm Model.Type -> Typed.TypedTerm Paths.TypeNode+typeNodeWithType original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.paths.TypeNode"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "type"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "links"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.paths.TypeNode"),+ Model.projectionFieldName = (Model.Name "links")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL constructor for hydra.core.paths.TypeReferenceLink+typeReferenceLink :: Typed.TypedTerm Paths.SubtypeStep -> Typed.TypedTerm Paths.TypeReference -> Typed.TypedTerm Paths.TypeReferenceLink+typeReferenceLink step target =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.paths.TypeReferenceLink"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "step"),+ Model.fieldTerm = (Typed.unTypedTerm step)},+ Model.Field {+ Model.fieldName = (Model.Name "target"),+ Model.fieldTerm = (Typed.unTypedTerm target)}]}))++-- | DSL accessor for the step field of hydra.core.paths.TypeReferenceLink+typeReferenceLinkStep :: Typed.TypedTerm Paths.TypeReferenceLink -> Typed.TypedTerm Paths.SubtypeStep+typeReferenceLinkStep x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.paths.TypeReferenceLink"),+ Model.projectionFieldName = (Model.Name "step")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the target field of hydra.core.paths.TypeReferenceLink+typeReferenceLinkTarget :: Typed.TypedTerm Paths.TypeReferenceLink -> Typed.TypedTerm Paths.TypeReference+typeReferenceLinkTarget x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.paths.TypeReferenceLink"),+ Model.projectionFieldName = (Model.Name "target")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.paths.TypeReferenceLink+typeReferenceLinkTypeReferenceLink :: Typed.TypedName Paths.TypeReferenceLink+typeReferenceLinkTypeReferenceLink = Typed.TypedName (Model.Name "hydra.core.paths.TypeReferenceLink")++-- | DSL updater for the step field of hydra.core.paths.TypeReferenceLink+typeReferenceLinkWithStep :: Typed.TypedTerm Paths.TypeReferenceLink -> Typed.TypedTerm Paths.SubtypeStep -> Typed.TypedTerm Paths.TypeReferenceLink+typeReferenceLinkWithStep original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.paths.TypeReferenceLink"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "step"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "target"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.paths.TypeReferenceLink"),+ Model.projectionFieldName = (Model.Name "target")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the target field of hydra.core.paths.TypeReferenceLink+typeReferenceLinkWithTarget :: Typed.TypedTerm Paths.TypeReferenceLink -> Typed.TypedTerm Paths.TypeReference -> Typed.TypedTerm Paths.TypeReferenceLink+typeReferenceLinkWithTarget original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.paths.TypeReferenceLink"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "step"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.paths.TypeReferenceLink"),+ Model.projectionFieldName = (Model.Name "step")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "target"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL injection for the nominal variant of hydra.core.paths.TypeReference+typeReferenceNominal :: Typed.TypedTerm Paths.NominalTypeReference -> Typed.TypedTerm Paths.TypeReference+typeReferenceNominal x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.paths.TypeReference"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "nominal"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL name token for hydra.core.paths.TypeReference+typeReferenceTypeReference :: Typed.TypedName Paths.TypeReference+typeReferenceTypeReference = Typed.TypedName (Model.Name "hydra.core.paths.TypeReference")++-- | DSL injection for the variable variant of hydra.core.paths.TypeReference+typeReferenceVariable :: Typed.TypedTerm Paths.TypeVariableReference -> Typed.TypedTerm Paths.TypeReference+typeReferenceVariable x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.paths.TypeReference"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "variable"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL constructor for hydra.core.paths.TypeVariableReference+typeVariableReference :: Typed.TypedTerm Model.Name -> Typed.TypedTerm Paths.TypeNodeId -> Typed.TypedTerm Paths.TypeVariableReference+typeVariableReference variable boundByNode =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.paths.TypeVariableReference"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "variable"),+ Model.fieldTerm = (Typed.unTypedTerm variable)},+ Model.Field {+ Model.fieldName = (Model.Name "boundByNode"),+ Model.fieldTerm = (Typed.unTypedTerm boundByNode)}]}))++-- | DSL accessor for the boundByNode field of hydra.core.paths.TypeVariableReference+typeVariableReferenceBoundByNode :: Typed.TypedTerm Paths.TypeVariableReference -> Typed.TypedTerm Paths.TypeNodeId+typeVariableReferenceBoundByNode x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.paths.TypeVariableReference"),+ Model.projectionFieldName = (Model.Name "boundByNode")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.paths.TypeVariableReference+typeVariableReferenceTypeVariableReference :: Typed.TypedName Paths.TypeVariableReference+typeVariableReferenceTypeVariableReference = Typed.TypedName (Model.Name "hydra.core.paths.TypeVariableReference")++-- | DSL accessor for the variable field of hydra.core.paths.TypeVariableReference+typeVariableReferenceVariable :: Typed.TypedTerm Paths.TypeVariableReference -> Typed.TypedTerm Model.Name+typeVariableReferenceVariable x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.paths.TypeVariableReference"),+ Model.projectionFieldName = (Model.Name "variable")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL updater for the boundByNode field of hydra.core.paths.TypeVariableReference+typeVariableReferenceWithBoundByNode :: Typed.TypedTerm Paths.TypeVariableReference -> Typed.TypedTerm Paths.TypeNodeId -> Typed.TypedTerm Paths.TypeVariableReference+typeVariableReferenceWithBoundByNode original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.paths.TypeVariableReference"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "variable"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.paths.TypeVariableReference"),+ Model.projectionFieldName = (Model.Name "variable")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "boundByNode"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL updater for the variable field of hydra.core.paths.TypeVariableReference+typeVariableReferenceWithVariable :: Typed.TypedTerm Paths.TypeVariableReference -> Typed.TypedTerm Model.Name -> Typed.TypedTerm Paths.TypeVariableReference+typeVariableReferenceWithVariable original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.paths.TypeVariableReference"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "variable"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "boundByNode"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.paths.TypeVariableReference"),+ Model.projectionFieldName = (Model.Name "boundByNode")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL accessor for the body of hydra.core.paths.SubtermPath+unSubtermPath :: Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm [Paths.SubtermStep]+unSubtermPath x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermUnwrap (Model.Name "hydra.core.paths.SubtermPath")),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the body of hydra.core.paths.SubtypePath+unSubtypePath :: Typed.TypedTerm Paths.SubtypePath -> Typed.TypedTerm [Paths.SubtypeStep]+unSubtypePath x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermUnwrap (Model.Name "hydra.core.paths.SubtypePath")),+ Model.applicationArgument = (Typed.unTypedTerm x)}))
@@ -0,0 +1,220 @@+-- Note: this is an automatically generated file. Do not edit.++-- | DSL functions for hydra.core.predicates++module Hydra.Core.Dsl.Predicates where++import qualified Hydra.Core.Arity as Arity+import qualified Hydra.Core.Ast as Ast+import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Decode.Model as DecodeModel+import qualified Hydra.Core.Dependencies as Dependencies+import qualified Hydra.Core.Diff as Diff+import qualified Hydra.Core.Docs as Docs+import qualified Hydra.Core.Dsl.Arity as DslArity+import qualified Hydra.Core.Dsl.Ast as DslAst+import qualified Hydra.Core.Dsl.Coders as DslCoders+import qualified Hydra.Core.Dsl.Dependencies as DslDependencies+import qualified Hydra.Core.Dsl.Diff as DslDiff+import qualified Hydra.Core.Dsl.Docs as DslDocs+import qualified Hydra.Core.Dsl.Error.Checking as ErrorChecking+import qualified Hydra.Core.Dsl.Error.File as DslErrorFile+import qualified Hydra.Core.Dsl.Error.Model as DslErrorModel+import qualified Hydra.Core.Dsl.Error.Packaging as DslErrorPackaging+import qualified Hydra.Core.Dsl.Error.System as DslErrorSystem+import qualified Hydra.Core.Dsl.Errors as DslErrors+import qualified Hydra.Core.Dsl.File as DslFile+import qualified Hydra.Core.Dsl.Graph as DslGraph+import qualified Hydra.Core.Dsl.Json.Model as DslJsonModel+import qualified Hydra.Core.Dsl.Lexical as DslLexical+import qualified Hydra.Core.Dsl.Markdown as DslMarkdown+import qualified Hydra.Core.Dsl.Model as DslModel+import qualified Hydra.Core.Dsl.Packaging as DslPackaging+import qualified Hydra.Core.Dsl.Parsing as DslParsing+import qualified Hydra.Core.Dsl.Paths as DslPaths+import qualified Hydra.Core.Dsl.Query as DslQuery+import qualified Hydra.Core.Dsl.Regex as DslRegex+import qualified Hydra.Core.Dsl.Relational as DslRelational+import qualified Hydra.Core.Dsl.Rewriting as DslRewriting+import qualified Hydra.Core.Dsl.Scoping as DslScoping+import qualified Hydra.Core.Dsl.Strip as DslStrip+import qualified Hydra.Core.Dsl.System as DslSystem+import qualified Hydra.Core.Dsl.Tabular as DslTabular+import qualified Hydra.Core.Dsl.Testing as DslTesting+import qualified Hydra.Core.Dsl.Time as DslTime+import qualified Hydra.Core.Dsl.Topology as DslTopology+import qualified Hydra.Core.Dsl.Typing as DslTyping+import qualified Hydra.Core.Dsl.Util as DslUtil+import qualified Hydra.Core.Dsl.Validation as DslValidation+import qualified Hydra.Core.Dsl.Variants as DslVariants+import qualified Hydra.Core.Error.Checking as Checking+import qualified Hydra.Core.Error.File as ErrorFile+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Error.Packaging as ErrorPackaging+import qualified Hydra.Core.Error.System as ErrorSystem+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Json.Model as JsonModel+import qualified Hydra.Core.Lexical as Lexical+import qualified Hydra.Core.Markdown as Markdown+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Parsing as Parsing+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Predicates as Predicates+import qualified Hydra.Core.Query as Query+import qualified Hydra.Core.Reflect as Reflect+import qualified Hydra.Core.Regex as Regex+import qualified Hydra.Core.Relational as Relational+import qualified Hydra.Core.Rewriting as Rewriting+import qualified Hydra.Core.Scoping as Scoping+import qualified Hydra.Core.Strip as Strip+import qualified Hydra.Core.System as System+import qualified Hydra.Core.Tabular as Tabular+import qualified Hydra.Core.Testing as Testing+import qualified Hydra.Core.Time as Time+import qualified Hydra.Core.Topology as Topology+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Validation as Validation+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void+import qualified Data.Map as M++-- | DSL reference to hydra.core.predicates.isComplexBinding+isComplexBinding :: Typed.TypedTerm Graph.Graph -> Typed.TypedTerm Model.Binding -> Typed.TypedTerm Bool+isComplexBinding arg0 arg1 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.predicates.isComplexBinding")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)}))++-- | DSL reference to hydra.core.predicates.isComplexTerm+isComplexTerm :: Typed.TypedTerm Graph.Graph -> Typed.TypedTerm Model.Term -> Typed.TypedTerm Bool+isComplexTerm arg0 arg1 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.predicates.isComplexTerm")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)}))++-- | DSL reference to hydra.core.predicates.isComplexVariable+isComplexVariable :: Typed.TypedTerm Graph.Graph -> Typed.TypedTerm Model.Name -> Typed.TypedTerm Bool+isComplexVariable arg0 arg1 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.predicates.isComplexVariable")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)}))++-- | DSL reference to hydra.core.predicates.isEncodedTerm+isEncodedTerm :: Typed.TypedTerm Model.Term -> Typed.TypedTerm Bool+isEncodedTerm arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.predicates.isEncodedTerm")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.predicates.isEncodedType+isEncodedType :: Typed.TypedTerm Model.Term -> Typed.TypedTerm Bool+isEncodedType arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.predicates.isEncodedType")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.predicates.isEnumRowType+isEnumRowType :: Typed.TypedTerm [Model.FieldType] -> Typed.TypedTerm Bool+isEnumRowType arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.predicates.isEnumRowType")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.predicates.isEnumType+isEnumType :: Typed.TypedTerm Model.Type -> Typed.TypedTerm Bool+isEnumType arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.predicates.isEnumType")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.predicates.isNominalType+isNominalType :: Typed.TypedTerm Model.Type -> Typed.TypedTerm Bool+isNominalType arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.predicates.isNominalType")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.predicates.isSerializable+isSerializable :: Typed.TypedTerm t0 -> Typed.TypedTerm Graph.Graph -> Typed.TypedTerm Model.Binding -> Typed.TypedTerm (Either Errors.Error Bool)+isSerializable arg0 arg1 arg2 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.predicates.isSerializable")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)})),+ Model.applicationArgument = (Typed.unTypedTerm arg2)}))++-- | DSL reference to hydra.core.predicates.isSerializableByName+isSerializableByName :: Typed.TypedTerm t0 -> Typed.TypedTerm Graph.Graph -> Typed.TypedTerm Model.Name -> Typed.TypedTerm (Either Errors.Error Bool)+isSerializableByName arg0 arg1 arg2 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.predicates.isSerializableByName")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)})),+ Model.applicationArgument = (Typed.unTypedTerm arg2)}))++-- | DSL reference to hydra.core.predicates.isSerializableType+isSerializableType :: Typed.TypedTerm Model.Type -> Typed.TypedTerm Bool+isSerializableType arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.predicates.isSerializableType")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.predicates.isTrivialTerm+isTrivialTerm :: Typed.TypedTerm Model.Term -> Typed.TypedTerm Bool+isTrivialTerm arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.predicates.isTrivialTerm")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.predicates.isType+isType :: Typed.TypedTerm Model.Type -> Typed.TypedTerm Bool+isType arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.predicates.isType")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.predicates.isUnitTerm+isUnitTerm :: Typed.TypedTerm Model.Term -> Typed.TypedTerm Bool+isUnitTerm arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.predicates.isUnitTerm")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.predicates.isUnitType+isUnitType :: Typed.TypedTerm Model.Type -> Typed.TypedTerm Bool+isUnitType arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.predicates.isUnitType")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.predicates.typeDependencies+typeDependencies :: Typed.TypedTerm t0 -> Typed.TypedTerm Graph.Graph -> Typed.TypedTerm Bool -> Typed.TypedTerm (Model.Type -> Model.Type) -> Typed.TypedTerm Model.Name -> Typed.TypedTerm (Either Errors.Error (M.Map Model.Name Model.Type))+typeDependencies arg0 arg1 arg2 arg3 arg4 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.predicates.typeDependencies")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)})),+ Model.applicationArgument = (Typed.unTypedTerm arg2)})),+ Model.applicationArgument = (Typed.unTypedTerm arg3)})),+ Model.applicationArgument = (Typed.unTypedTerm arg4)}))
@@ -0,0 +1,134 @@+-- Note: this is an automatically generated file. Do not edit.++-- | DSL functions for hydra.core.print.docs++module Hydra.Core.Dsl.Print.Docs where++import qualified Hydra.Core.Ast as Ast+import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Diff as Diff+import qualified Hydra.Core.Docs as Docs+import qualified Hydra.Core.Dsl.Ast as DslAst+import qualified Hydra.Core.Dsl.Coders as DslCoders+import qualified Hydra.Core.Dsl.Diff as DslDiff+import qualified Hydra.Core.Dsl.Docs as DslDocs+import qualified Hydra.Core.Dsl.Error.Checking as ErrorChecking+import qualified Hydra.Core.Dsl.Error.File as DslErrorFile+import qualified Hydra.Core.Dsl.Error.Model as DslErrorModel+import qualified Hydra.Core.Dsl.Error.Packaging as DslErrorPackaging+import qualified Hydra.Core.Dsl.Error.System as DslErrorSystem+import qualified Hydra.Core.Dsl.Errors as DslErrors+import qualified Hydra.Core.Dsl.File as DslFile+import qualified Hydra.Core.Dsl.Graph as DslGraph+import qualified Hydra.Core.Dsl.Json.Model as DslJsonModel+import qualified Hydra.Core.Dsl.Markdown as DslMarkdown+import qualified Hydra.Core.Dsl.Model as DslModel+import qualified Hydra.Core.Dsl.Packaging as DslPackaging+import qualified Hydra.Core.Dsl.Parsing as DslParsing+import qualified Hydra.Core.Dsl.Paths as DslPaths+import qualified Hydra.Core.Dsl.Query as DslQuery+import qualified Hydra.Core.Dsl.Regex as DslRegex+import qualified Hydra.Core.Dsl.Relational as DslRelational+import qualified Hydra.Core.Dsl.System as DslSystem+import qualified Hydra.Core.Dsl.Tabular as DslTabular+import qualified Hydra.Core.Dsl.Testing as DslTesting+import qualified Hydra.Core.Dsl.Time as DslTime+import qualified Hydra.Core.Dsl.Topology as DslTopology+import qualified Hydra.Core.Dsl.Typing as DslTyping+import qualified Hydra.Core.Dsl.Util as DslUtil+import qualified Hydra.Core.Dsl.Validation as DslValidation+import qualified Hydra.Core.Dsl.Variants as DslVariants+import qualified Hydra.Core.Error.Checking as Checking+import qualified Hydra.Core.Error.File as ErrorFile+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Error.Packaging as ErrorPackaging+import qualified Hydra.Core.Error.System as ErrorSystem+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Json.Model as JsonModel+import qualified Hydra.Core.Markdown as Markdown+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Parse.Docs as ParseDocs+import qualified Hydra.Core.Parsing as Parsing+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Print.Docs as PrintDocs+import qualified Hydra.Core.Query as Query+import qualified Hydra.Core.Regex as Regex+import qualified Hydra.Core.Relational as Relational+import qualified Hydra.Core.System as System+import qualified Hydra.Core.Tabular as Tabular+import qualified Hydra.Core.Testing as Testing+import qualified Hydra.Core.Time as Time+import qualified Hydra.Core.Topology as Topology+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Validation as Validation+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | DSL reference to hydra.core.print.docs.definitionReference+definitionReference :: Typed.TypedTerm Packaging.DefinitionReference -> Typed.TypedTerm String+definitionReference arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.print.docs.definitionReference")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.print.docs.docSegment+docSegment :: Typed.TypedTerm Docs.DocSegment -> Typed.TypedTerm String+docSegment arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.print.docs.docSegment")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.print.docs.docSegmentWith+docSegmentWith :: Typed.TypedTerm (Packaging.EntityReference -> String) -> Typed.TypedTerm Docs.DocSegment -> Typed.TypedTerm String+docSegmentWith arg0 arg1 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.print.docs.docSegmentWith")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)}))++-- | DSL reference to hydra.core.print.docs.docSegments+docSegments :: Typed.TypedTerm [Docs.DocSegment] -> Typed.TypedTerm String+docSegments arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.print.docs.docSegments")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.print.docs.docSegmentsWith+docSegmentsWith :: Typed.TypedTerm (Packaging.EntityReference -> String) -> Typed.TypedTerm [Docs.DocSegment] -> Typed.TypedTerm String+docSegmentsWith arg0 arg1 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.print.docs.docSegmentsWith")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)}))++-- | DSL reference to hydra.core.print.docs.entityReference+entityReference :: Typed.TypedTerm Packaging.EntityReference -> Typed.TypedTerm String+entityReference arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.print.docs.entityReference")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.print.docs.renderDocString+renderDocString :: Typed.TypedTerm String -> Typed.TypedTerm String+renderDocString arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.print.docs.renderDocString")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.print.docs.renderDocStringWith+renderDocStringWith :: Typed.TypedTerm (Packaging.EntityReference -> String) -> Typed.TypedTerm String -> Typed.TypedTerm String+renderDocStringWith arg0 arg1 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.print.docs.renderDocStringWith")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)}))
@@ -0,0 +1,952 @@+-- Note: this is an automatically generated file. Do not edit.++-- | DSL functions for hydra.core.query++module Hydra.Core.Dsl.Query where++import qualified Hydra.Core.Decode.Query as DecodeQuery+import qualified Hydra.Core.Dsl.Model as DslModel+import qualified Hydra.Core.Encode.Query as EncodeQuery+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Query as Query+import qualified Hydra.Core.Typed as Typed+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | DSL name token for hydra.core.query.ComparisonConstraint+comparisonConstraintComparisonConstraint :: Typed.TypedName Query.ComparisonConstraint+comparisonConstraintComparisonConstraint = Typed.TypedName (Model.Name "hydra.core.query.ComparisonConstraint")++-- | DSL injection for the equal variant of hydra.core.query.ComparisonConstraint+comparisonConstraintEqual :: Typed.TypedTerm Query.ComparisonConstraint+comparisonConstraintEqual =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.query.ComparisonConstraint"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "equal"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL injection for the greaterThan variant of hydra.core.query.ComparisonConstraint+comparisonConstraintGreaterThan :: Typed.TypedTerm Query.ComparisonConstraint+comparisonConstraintGreaterThan =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.query.ComparisonConstraint"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "greaterThan"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL injection for the greaterThanOrEqual variant of hydra.core.query.ComparisonConstraint+comparisonConstraintGreaterThanOrEqual :: Typed.TypedTerm Query.ComparisonConstraint+comparisonConstraintGreaterThanOrEqual =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.query.ComparisonConstraint"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "greaterThanOrEqual"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL injection for the lessThan variant of hydra.core.query.ComparisonConstraint+comparisonConstraintLessThan :: Typed.TypedTerm Query.ComparisonConstraint+comparisonConstraintLessThan =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.query.ComparisonConstraint"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "lessThan"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL injection for the lessThanOrEqual variant of hydra.core.query.ComparisonConstraint+comparisonConstraintLessThanOrEqual :: Typed.TypedTerm Query.ComparisonConstraint+comparisonConstraintLessThanOrEqual =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.query.ComparisonConstraint"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "lessThanOrEqual"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL injection for the notEqual variant of hydra.core.query.ComparisonConstraint+comparisonConstraintNotEqual :: Typed.TypedTerm Query.ComparisonConstraint+comparisonConstraintNotEqual =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.query.ComparisonConstraint"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "notEqual"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL constructor for hydra.core.query.Edge+edge :: Typed.TypedTerm Model.Name -> Typed.TypedTerm (Maybe Model.Name) -> Typed.TypedTerm (Maybe Model.Name) -> Typed.TypedTerm Query.Edge+edge type_ out in_ =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.query.Edge"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "type"),+ Model.fieldTerm = (Typed.unTypedTerm type_)},+ Model.Field {+ Model.fieldName = (Model.Name "out"),+ Model.fieldTerm = (Typed.unTypedTerm out)},+ Model.Field {+ Model.fieldName = (Model.Name "in"),+ Model.fieldTerm = (Typed.unTypedTerm in_)}]}))++-- | DSL name token for hydra.core.query.Edge+edgeEdge :: Typed.TypedName Query.Edge+edgeEdge = Typed.TypedName (Model.Name "hydra.core.query.Edge")++-- | DSL accessor for the in field of hydra.core.query.Edge+edgeIn :: Typed.TypedTerm Query.Edge -> Typed.TypedTerm (Maybe Model.Name)+edgeIn x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.query.Edge"),+ Model.projectionFieldName = (Model.Name "in")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the out field of hydra.core.query.Edge+edgeOut :: Typed.TypedTerm Query.Edge -> Typed.TypedTerm (Maybe Model.Name)+edgeOut x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.query.Edge"),+ Model.projectionFieldName = (Model.Name "out")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the type field of hydra.core.query.Edge+edgeType :: Typed.TypedTerm Query.Edge -> Typed.TypedTerm Model.Name+edgeType x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.query.Edge"),+ Model.projectionFieldName = (Model.Name "type")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL updater for the in field of hydra.core.query.Edge+edgeWithIn :: Typed.TypedTerm Query.Edge -> Typed.TypedTerm (Maybe Model.Name) -> Typed.TypedTerm Query.Edge+edgeWithIn original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.query.Edge"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "type"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.query.Edge"),+ Model.projectionFieldName = (Model.Name "type")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "out"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.query.Edge"),+ Model.projectionFieldName = (Model.Name "out")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "in"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL updater for the out field of hydra.core.query.Edge+edgeWithOut :: Typed.TypedTerm Query.Edge -> Typed.TypedTerm (Maybe Model.Name) -> Typed.TypedTerm Query.Edge+edgeWithOut original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.query.Edge"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "type"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.query.Edge"),+ Model.projectionFieldName = (Model.Name "type")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "out"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "in"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.query.Edge"),+ Model.projectionFieldName = (Model.Name "in")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the type field of hydra.core.query.Edge+edgeWithType :: Typed.TypedTerm Query.Edge -> Typed.TypedTerm Model.Name -> Typed.TypedTerm Query.Edge+edgeWithType original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.query.Edge"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "type"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "out"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.query.Edge"),+ Model.projectionFieldName = (Model.Name "out")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "in"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.query.Edge"),+ Model.projectionFieldName = (Model.Name "in")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL constructor for hydra.core.query.GraphPattern+graphPattern :: Typed.TypedTerm Model.Name -> Typed.TypedTerm [Query.Pattern] -> Typed.TypedTerm Query.GraphPattern+graphPattern graph patterns =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.query.GraphPattern"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "graph"),+ Model.fieldTerm = (Typed.unTypedTerm graph)},+ Model.Field {+ Model.fieldName = (Model.Name "patterns"),+ Model.fieldTerm = (Typed.unTypedTerm patterns)}]}))++-- | DSL accessor for the graph field of hydra.core.query.GraphPattern+graphPatternGraph :: Typed.TypedTerm Query.GraphPattern -> Typed.TypedTerm Model.Name+graphPatternGraph x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.query.GraphPattern"),+ Model.projectionFieldName = (Model.Name "graph")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.query.GraphPattern+graphPatternGraphPattern :: Typed.TypedName Query.GraphPattern+graphPatternGraphPattern = Typed.TypedName (Model.Name "hydra.core.query.GraphPattern")++-- | DSL accessor for the patterns field of hydra.core.query.GraphPattern+graphPatternPatterns :: Typed.TypedTerm Query.GraphPattern -> Typed.TypedTerm [Query.Pattern]+graphPatternPatterns x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.query.GraphPattern"),+ Model.projectionFieldName = (Model.Name "patterns")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL updater for the graph field of hydra.core.query.GraphPattern+graphPatternWithGraph :: Typed.TypedTerm Query.GraphPattern -> Typed.TypedTerm Model.Name -> Typed.TypedTerm Query.GraphPattern+graphPatternWithGraph original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.query.GraphPattern"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "graph"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "patterns"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.query.GraphPattern"),+ Model.projectionFieldName = (Model.Name "patterns")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the patterns field of hydra.core.query.GraphPattern+graphPatternWithPatterns :: Typed.TypedTerm Query.GraphPattern -> Typed.TypedTerm [Query.Pattern] -> Typed.TypedTerm Query.GraphPattern+graphPatternWithPatterns original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.query.GraphPattern"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "graph"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.query.GraphPattern"),+ Model.projectionFieldName = (Model.Name "graph")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "patterns"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL name token for hydra.core.query.Node+nodeNode :: Typed.TypedName Query.Node+nodeNode = Typed.TypedName (Model.Name "hydra.core.query.Node")++-- | DSL injection for the term variant of hydra.core.query.Node+nodeTerm :: Typed.TypedTerm Model.Term -> Typed.TypedTerm Query.Node+nodeTerm x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.query.Node"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "term"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the variable variant of hydra.core.query.Node+nodeVariable :: Typed.TypedTerm Query.Variable -> Typed.TypedTerm Query.Node+nodeVariable x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.query.Node"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "variable"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the wildcard variant of hydra.core.query.Node+nodeWildcard :: Typed.TypedTerm Query.Node+nodeWildcard =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.query.Node"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "wildcard"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL constructor for hydra.core.query.PathEquation+pathEquation :: Typed.TypedTerm Query.Path -> Typed.TypedTerm Query.Path -> Typed.TypedTerm Query.PathEquation+pathEquation left right =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.query.PathEquation"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "left"),+ Model.fieldTerm = (Typed.unTypedTerm left)},+ Model.Field {+ Model.fieldName = (Model.Name "right"),+ Model.fieldTerm = (Typed.unTypedTerm right)}]}))++-- | DSL accessor for the left field of hydra.core.query.PathEquation+pathEquationLeft :: Typed.TypedTerm Query.PathEquation -> Typed.TypedTerm Query.Path+pathEquationLeft x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.query.PathEquation"),+ Model.projectionFieldName = (Model.Name "left")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.query.PathEquation+pathEquationPathEquation :: Typed.TypedName Query.PathEquation+pathEquationPathEquation = Typed.TypedName (Model.Name "hydra.core.query.PathEquation")++-- | DSL accessor for the right field of hydra.core.query.PathEquation+pathEquationRight :: Typed.TypedTerm Query.PathEquation -> Typed.TypedTerm Query.Path+pathEquationRight x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.query.PathEquation"),+ Model.projectionFieldName = (Model.Name "right")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL updater for the left field of hydra.core.query.PathEquation+pathEquationWithLeft :: Typed.TypedTerm Query.PathEquation -> Typed.TypedTerm Query.Path -> Typed.TypedTerm Query.PathEquation+pathEquationWithLeft original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.query.PathEquation"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "left"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "right"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.query.PathEquation"),+ Model.projectionFieldName = (Model.Name "right")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the right field of hydra.core.query.PathEquation+pathEquationWithRight :: Typed.TypedTerm Query.PathEquation -> Typed.TypedTerm Query.Path -> Typed.TypedTerm Query.PathEquation+pathEquationWithRight original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.query.PathEquation"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "left"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.query.PathEquation"),+ Model.projectionFieldName = (Model.Name "left")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "right"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL injection for the inverse variant of hydra.core.query.Path+pathInverse :: Typed.TypedTerm Query.Path -> Typed.TypedTerm Query.Path+pathInverse x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.query.Path"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "inverse"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL name token for hydra.core.query.Path+pathPath :: Typed.TypedName Query.Path+pathPath = Typed.TypedName (Model.Name "hydra.core.query.Path")++-- | DSL injection for the regex variant of hydra.core.query.Path+pathRegex :: Typed.TypedTerm Query.RegexSequence -> Typed.TypedTerm Query.Path+pathRegex x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.query.Path"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "regex"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the step variant of hydra.core.query.Path+pathStep :: Typed.TypedTerm Query.Step -> Typed.TypedTerm Query.Path+pathStep x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.query.Path"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "step"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the conjunction variant of hydra.core.query.Pattern+patternConjunction :: Typed.TypedTerm [Query.Pattern] -> Typed.TypedTerm Query.Pattern+patternConjunction x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.query.Pattern"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "conjunction"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the disjunction variant of hydra.core.query.Pattern+patternDisjunction :: Typed.TypedTerm [Query.Pattern] -> Typed.TypedTerm Query.Pattern+patternDisjunction x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.query.Pattern"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "disjunction"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the graph variant of hydra.core.query.Pattern+patternGraph :: Typed.TypedTerm Query.GraphPattern -> Typed.TypedTerm Query.Pattern+patternGraph x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.query.Pattern"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "graph"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL constructor for hydra.core.query.PatternImplication+patternImplication :: Typed.TypedTerm Query.Pattern -> Typed.TypedTerm Query.Pattern -> Typed.TypedTerm Query.PatternImplication+patternImplication antecedent consequent =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.query.PatternImplication"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "antecedent"),+ Model.fieldTerm = (Typed.unTypedTerm antecedent)},+ Model.Field {+ Model.fieldName = (Model.Name "consequent"),+ Model.fieldTerm = (Typed.unTypedTerm consequent)}]}))++-- | DSL accessor for the antecedent field of hydra.core.query.PatternImplication+patternImplicationAntecedent :: Typed.TypedTerm Query.PatternImplication -> Typed.TypedTerm Query.Pattern+patternImplicationAntecedent x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.query.PatternImplication"),+ Model.projectionFieldName = (Model.Name "antecedent")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the consequent field of hydra.core.query.PatternImplication+patternImplicationConsequent :: Typed.TypedTerm Query.PatternImplication -> Typed.TypedTerm Query.Pattern+patternImplicationConsequent x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.query.PatternImplication"),+ Model.projectionFieldName = (Model.Name "consequent")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.query.PatternImplication+patternImplicationPatternImplication :: Typed.TypedName Query.PatternImplication+patternImplicationPatternImplication = Typed.TypedName (Model.Name "hydra.core.query.PatternImplication")++-- | DSL updater for the antecedent field of hydra.core.query.PatternImplication+patternImplicationWithAntecedent :: Typed.TypedTerm Query.PatternImplication -> Typed.TypedTerm Query.Pattern -> Typed.TypedTerm Query.PatternImplication+patternImplicationWithAntecedent original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.query.PatternImplication"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "antecedent"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "consequent"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.query.PatternImplication"),+ Model.projectionFieldName = (Model.Name "consequent")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the consequent field of hydra.core.query.PatternImplication+patternImplicationWithConsequent :: Typed.TypedTerm Query.PatternImplication -> Typed.TypedTerm Query.Pattern -> Typed.TypedTerm Query.PatternImplication+patternImplicationWithConsequent original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.query.PatternImplication"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "antecedent"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.query.PatternImplication"),+ Model.projectionFieldName = (Model.Name "antecedent")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "consequent"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL injection for the negation variant of hydra.core.query.Pattern+patternNegation :: Typed.TypedTerm Query.Pattern -> Typed.TypedTerm Query.Pattern+patternNegation x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.query.Pattern"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "negation"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL name token for hydra.core.query.Pattern+patternPattern :: Typed.TypedName Query.Pattern+patternPattern = Typed.TypedName (Model.Name "hydra.core.query.Pattern")++-- | DSL injection for the triple variant of hydra.core.query.Pattern+patternTriple :: Typed.TypedTerm Query.TriplePattern -> Typed.TypedTerm Query.Pattern+patternTriple x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.query.Pattern"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "triple"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL constructor for hydra.core.query.Query+query :: Typed.TypedTerm [Query.Variable] -> Typed.TypedTerm [Query.Pattern] -> Typed.TypedTerm Query.Query+query variables patterns =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.query.Query"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "variables"),+ Model.fieldTerm = (Typed.unTypedTerm variables)},+ Model.Field {+ Model.fieldName = (Model.Name "patterns"),+ Model.fieldTerm = (Typed.unTypedTerm patterns)}]}))++-- | DSL accessor for the patterns field of hydra.core.query.Query+queryPatterns :: Typed.TypedTerm Query.Query -> Typed.TypedTerm [Query.Pattern]+queryPatterns x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.query.Query"),+ Model.projectionFieldName = (Model.Name "patterns")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.query.Query+queryQuery :: Typed.TypedName Query.Query+queryQuery = Typed.TypedName (Model.Name "hydra.core.query.Query")++-- | DSL accessor for the variables field of hydra.core.query.Query+queryVariables :: Typed.TypedTerm Query.Query -> Typed.TypedTerm [Query.Variable]+queryVariables x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.query.Query"),+ Model.projectionFieldName = (Model.Name "variables")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL updater for the patterns field of hydra.core.query.Query+queryWithPatterns :: Typed.TypedTerm Query.Query -> Typed.TypedTerm [Query.Pattern] -> Typed.TypedTerm Query.Query+queryWithPatterns original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.query.Query"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "variables"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.query.Query"),+ Model.projectionFieldName = (Model.Name "variables")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "patterns"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL updater for the variables field of hydra.core.query.Query+queryWithVariables :: Typed.TypedTerm Query.Query -> Typed.TypedTerm [Query.Variable] -> Typed.TypedTerm Query.Query+queryWithVariables original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.query.Query"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "variables"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "patterns"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.query.Query"),+ Model.projectionFieldName = (Model.Name "patterns")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL constructor for hydra.core.query.Range+range :: Typed.TypedTerm Int -> Typed.TypedTerm Int -> Typed.TypedTerm Query.Range+range min max =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.query.Range"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "min"),+ Model.fieldTerm = (Typed.unTypedTerm min)},+ Model.Field {+ Model.fieldName = (Model.Name "max"),+ Model.fieldTerm = (Typed.unTypedTerm max)}]}))++-- | DSL accessor for the max field of hydra.core.query.Range+rangeMax :: Typed.TypedTerm Query.Range -> Typed.TypedTerm Int+rangeMax x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.query.Range"),+ Model.projectionFieldName = (Model.Name "max")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the min field of hydra.core.query.Range+rangeMin :: Typed.TypedTerm Query.Range -> Typed.TypedTerm Int+rangeMin x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.query.Range"),+ Model.projectionFieldName = (Model.Name "min")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.query.Range+rangeRange :: Typed.TypedName Query.Range+rangeRange = Typed.TypedName (Model.Name "hydra.core.query.Range")++-- | DSL updater for the max field of hydra.core.query.Range+rangeWithMax :: Typed.TypedTerm Query.Range -> Typed.TypedTerm Int -> Typed.TypedTerm Query.Range+rangeWithMax original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.query.Range"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "min"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.query.Range"),+ Model.projectionFieldName = (Model.Name "min")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "max"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL updater for the min field of hydra.core.query.Range+rangeWithMin :: Typed.TypedTerm Query.Range -> Typed.TypedTerm Int -> Typed.TypedTerm Query.Range+rangeWithMin original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.query.Range"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "min"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "max"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.query.Range"),+ Model.projectionFieldName = (Model.Name "max")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL injection for the atLeast variant of hydra.core.query.RegexQuantifier+regexQuantifierAtLeast :: Typed.TypedTerm Int -> Typed.TypedTerm Query.RegexQuantifier+regexQuantifierAtLeast x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.query.RegexQuantifier"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "atLeast"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the exactly variant of hydra.core.query.RegexQuantifier+regexQuantifierExactly :: Typed.TypedTerm Int -> Typed.TypedTerm Query.RegexQuantifier+regexQuantifierExactly x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.query.RegexQuantifier"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "exactly"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the one variant of hydra.core.query.RegexQuantifier+regexQuantifierOne :: Typed.TypedTerm Query.RegexQuantifier+regexQuantifierOne =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.query.RegexQuantifier"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "one"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL injection for the oneOrMore variant of hydra.core.query.RegexQuantifier+regexQuantifierOneOrMore :: Typed.TypedTerm Query.RegexQuantifier+regexQuantifierOneOrMore =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.query.RegexQuantifier"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "oneOrMore"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL injection for the range variant of hydra.core.query.RegexQuantifier+regexQuantifierRange :: Typed.TypedTerm Query.Range -> Typed.TypedTerm Query.RegexQuantifier+regexQuantifierRange x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.query.RegexQuantifier"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "range"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL name token for hydra.core.query.RegexQuantifier+regexQuantifierRegexQuantifier :: Typed.TypedName Query.RegexQuantifier+regexQuantifierRegexQuantifier = Typed.TypedName (Model.Name "hydra.core.query.RegexQuantifier")++-- | DSL injection for the zeroOrMore variant of hydra.core.query.RegexQuantifier+regexQuantifierZeroOrMore :: Typed.TypedTerm Query.RegexQuantifier+regexQuantifierZeroOrMore =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.query.RegexQuantifier"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "zeroOrMore"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL injection for the zeroOrOne variant of hydra.core.query.RegexQuantifier+regexQuantifierZeroOrOne :: Typed.TypedTerm Query.RegexQuantifier+regexQuantifierZeroOrOne =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.query.RegexQuantifier"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "zeroOrOne"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL constructor for hydra.core.query.RegexSequence+regexSequence :: Typed.TypedTerm Query.Path -> Typed.TypedTerm Query.RegexQuantifier -> Typed.TypedTerm Query.RegexSequence+regexSequence path quantifier =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.query.RegexSequence"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "path"),+ Model.fieldTerm = (Typed.unTypedTerm path)},+ Model.Field {+ Model.fieldName = (Model.Name "quantifier"),+ Model.fieldTerm = (Typed.unTypedTerm quantifier)}]}))++-- | DSL accessor for the path field of hydra.core.query.RegexSequence+regexSequencePath :: Typed.TypedTerm Query.RegexSequence -> Typed.TypedTerm Query.Path+regexSequencePath x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.query.RegexSequence"),+ Model.projectionFieldName = (Model.Name "path")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the quantifier field of hydra.core.query.RegexSequence+regexSequenceQuantifier :: Typed.TypedTerm Query.RegexSequence -> Typed.TypedTerm Query.RegexQuantifier+regexSequenceQuantifier x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.query.RegexSequence"),+ Model.projectionFieldName = (Model.Name "quantifier")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.query.RegexSequence+regexSequenceRegexSequence :: Typed.TypedName Query.RegexSequence+regexSequenceRegexSequence = Typed.TypedName (Model.Name "hydra.core.query.RegexSequence")++-- | DSL updater for the path field of hydra.core.query.RegexSequence+regexSequenceWithPath :: Typed.TypedTerm Query.RegexSequence -> Typed.TypedTerm Query.Path -> Typed.TypedTerm Query.RegexSequence+regexSequenceWithPath original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.query.RegexSequence"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "path"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "quantifier"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.query.RegexSequence"),+ Model.projectionFieldName = (Model.Name "quantifier")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the quantifier field of hydra.core.query.RegexSequence+regexSequenceWithQuantifier :: Typed.TypedTerm Query.RegexSequence -> Typed.TypedTerm Query.RegexQuantifier -> Typed.TypedTerm Query.RegexSequence+regexSequenceWithQuantifier original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.query.RegexSequence"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "path"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.query.RegexSequence"),+ Model.projectionFieldName = (Model.Name "path")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "quantifier"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL injection for the compare variant of hydra.core.query.Step+stepCompare :: Typed.TypedTerm Query.ComparisonConstraint -> Typed.TypedTerm Query.Step+stepCompare x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.query.Step"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "compare"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the edge variant of hydra.core.query.Step+stepEdge :: Typed.TypedTerm Query.Edge -> Typed.TypedTerm Query.Step+stepEdge x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.query.Step"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "edge"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the project variant of hydra.core.query.Step+stepProject :: Typed.TypedTerm Model.Projection -> Typed.TypedTerm Query.Step+stepProject x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.query.Step"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "project"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL name token for hydra.core.query.Step+stepStep :: Typed.TypedName Query.Step+stepStep = Typed.TypedName (Model.Name "hydra.core.query.Step")++-- | DSL constructor for hydra.core.query.TriplePattern+triplePattern :: Typed.TypedTerm Query.Node -> Typed.TypedTerm Query.Path -> Typed.TypedTerm Query.Node -> Typed.TypedTerm Query.TriplePattern+triplePattern subject predicate object =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.query.TriplePattern"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "subject"),+ Model.fieldTerm = (Typed.unTypedTerm subject)},+ Model.Field {+ Model.fieldName = (Model.Name "predicate"),+ Model.fieldTerm = (Typed.unTypedTerm predicate)},+ Model.Field {+ Model.fieldName = (Model.Name "object"),+ Model.fieldTerm = (Typed.unTypedTerm object)}]}))++-- | DSL accessor for the object field of hydra.core.query.TriplePattern+triplePatternObject :: Typed.TypedTerm Query.TriplePattern -> Typed.TypedTerm Query.Node+triplePatternObject x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.query.TriplePattern"),+ Model.projectionFieldName = (Model.Name "object")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the predicate field of hydra.core.query.TriplePattern+triplePatternPredicate :: Typed.TypedTerm Query.TriplePattern -> Typed.TypedTerm Query.Path+triplePatternPredicate x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.query.TriplePattern"),+ Model.projectionFieldName = (Model.Name "predicate")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the subject field of hydra.core.query.TriplePattern+triplePatternSubject :: Typed.TypedTerm Query.TriplePattern -> Typed.TypedTerm Query.Node+triplePatternSubject x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.query.TriplePattern"),+ Model.projectionFieldName = (Model.Name "subject")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.query.TriplePattern+triplePatternTriplePattern :: Typed.TypedName Query.TriplePattern+triplePatternTriplePattern = Typed.TypedName (Model.Name "hydra.core.query.TriplePattern")++-- | DSL updater for the object field of hydra.core.query.TriplePattern+triplePatternWithObject :: Typed.TypedTerm Query.TriplePattern -> Typed.TypedTerm Query.Node -> Typed.TypedTerm Query.TriplePattern+triplePatternWithObject original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.query.TriplePattern"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "subject"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.query.TriplePattern"),+ Model.projectionFieldName = (Model.Name "subject")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "predicate"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.query.TriplePattern"),+ Model.projectionFieldName = (Model.Name "predicate")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "object"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL updater for the predicate field of hydra.core.query.TriplePattern+triplePatternWithPredicate :: Typed.TypedTerm Query.TriplePattern -> Typed.TypedTerm Query.Path -> Typed.TypedTerm Query.TriplePattern+triplePatternWithPredicate original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.query.TriplePattern"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "subject"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.query.TriplePattern"),+ Model.projectionFieldName = (Model.Name "subject")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "predicate"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "object"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.query.TriplePattern"),+ Model.projectionFieldName = (Model.Name "object")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the subject field of hydra.core.query.TriplePattern+triplePatternWithSubject :: Typed.TypedTerm Query.TriplePattern -> Typed.TypedTerm Query.Node -> Typed.TypedTerm Query.TriplePattern+triplePatternWithSubject original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.query.TriplePattern"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "subject"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "predicate"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.query.TriplePattern"),+ Model.projectionFieldName = (Model.Name "predicate")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "object"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.query.TriplePattern"),+ Model.projectionFieldName = (Model.Name "object")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL accessor for the body of hydra.core.query.Variable+unVariable :: Typed.TypedTerm Query.Variable -> Typed.TypedTerm String+unVariable x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermUnwrap (Model.Name "hydra.core.query.Variable")),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL constructor for the hydra.core.query.Variable wrapper+variable :: Typed.TypedTerm String -> Typed.TypedTerm Query.Variable+variable x =+ Typed.TypedTerm (Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.Name "hydra.core.query.Variable"),+ Model.wrappedTermBody = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.query.Variable+variableVariable :: Typed.TypedName Query.Variable+variableVariable = Typed.TypedName (Model.Name "hydra.core.query.Variable")
@@ -0,0 +1,191 @@+-- Note: this is an automatically generated file. Do not edit.++-- | DSL functions for hydra.core.reduction++module Hydra.Core.Dsl.Reduction where++import qualified Hydra.Core.Annotations as Annotations+import qualified Hydra.Core.Arity as Arity+import qualified Hydra.Core.Ast as Ast+import qualified Hydra.Core.Checking as Checking+import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Diff as Diff+import qualified Hydra.Core.Docs as Docs+import qualified Hydra.Core.Dsl.Annotations as DslAnnotations+import qualified Hydra.Core.Dsl.Arity as DslArity+import qualified Hydra.Core.Dsl.Ast as DslAst+import qualified Hydra.Core.Dsl.Checking as DslChecking+import qualified Hydra.Core.Dsl.Coders as DslCoders+import qualified Hydra.Core.Dsl.Diff as DslDiff+import qualified Hydra.Core.Dsl.Docs as DslDocs+import qualified Hydra.Core.Dsl.Error.Checking as DslErrorChecking+import qualified Hydra.Core.Dsl.Error.File as DslErrorFile+import qualified Hydra.Core.Dsl.Error.Model as DslErrorModel+import qualified Hydra.Core.Dsl.Error.Packaging as DslErrorPackaging+import qualified Hydra.Core.Dsl.Error.System as DslErrorSystem+import qualified Hydra.Core.Dsl.Errors as DslErrors+import qualified Hydra.Core.Dsl.File as DslFile+import qualified Hydra.Core.Dsl.Graph as DslGraph+import qualified Hydra.Core.Dsl.Json.Model as DslJsonModel+import qualified Hydra.Core.Dsl.Lexical as DslLexical+import qualified Hydra.Core.Dsl.Markdown as DslMarkdown+import qualified Hydra.Core.Dsl.Model as DslModel+import qualified Hydra.Core.Dsl.Packaging as DslPackaging+import qualified Hydra.Core.Dsl.Parsing as DslParsing+import qualified Hydra.Core.Dsl.Paths as DslPaths+import qualified Hydra.Core.Dsl.Query as DslQuery+import qualified Hydra.Core.Dsl.Regex as DslRegex+import qualified Hydra.Core.Dsl.Relational as DslRelational+import qualified Hydra.Core.Dsl.Resolution as DslResolution+import qualified Hydra.Core.Dsl.Rewriting as DslRewriting+import qualified Hydra.Core.Dsl.Scoping as DslScoping+import qualified Hydra.Core.Dsl.Strip as DslStrip+import qualified Hydra.Core.Dsl.System as DslSystem+import qualified Hydra.Core.Dsl.Tabular as DslTabular+import qualified Hydra.Core.Dsl.Testing as DslTesting+import qualified Hydra.Core.Dsl.Time as DslTime+import qualified Hydra.Core.Dsl.Topology as DslTopology+import qualified Hydra.Core.Dsl.Typing as DslTyping+import qualified Hydra.Core.Dsl.Util as DslUtil+import qualified Hydra.Core.Dsl.Validation as DslValidation+import qualified Hydra.Core.Dsl.Variables as DslVariables+import qualified Hydra.Core.Dsl.Variants as DslVariants+import qualified Hydra.Core.Error.Checking as ErrorChecking+import qualified Hydra.Core.Error.File as ErrorFile+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Error.Packaging as ErrorPackaging+import qualified Hydra.Core.Error.System as ErrorSystem+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.Extract.Model as ExtractModel+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Hoisting as Hoisting+import qualified Hydra.Core.Inference as Inference+import qualified Hydra.Core.Json.Model as JsonModel+import qualified Hydra.Core.Lexical as Lexical+import qualified Hydra.Core.Markdown as Markdown+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Parsing as Parsing+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Print.Errors as PrintErrors+import qualified Hydra.Core.Print.Model as PrintModel+import qualified Hydra.Core.Query as Query+import qualified Hydra.Core.Reduction as Reduction+import qualified Hydra.Core.Regex as Regex+import qualified Hydra.Core.Relational as Relational+import qualified Hydra.Core.Resolution as Resolution+import qualified Hydra.Core.Rewriting as Rewriting+import qualified Hydra.Core.Scoping as Scoping+import qualified Hydra.Core.Strip as Strip+import qualified Hydra.Core.System as System+import qualified Hydra.Core.Tabular as Tabular+import qualified Hydra.Core.Testing as Testing+import qualified Hydra.Core.Time as Time+import qualified Hydra.Core.Topology as Topology+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Validation as Validation+import qualified Hydra.Core.Variables as Variables+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | DSL reference to hydra.core.reduction.alphaConvert+alphaConvert :: Typed.TypedTerm Model.Name -> Typed.TypedTerm Model.Name -> Typed.TypedTerm Model.Term -> Typed.TypedTerm Model.Term+alphaConvert arg0 arg1 arg2 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.reduction.alphaConvert")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)})),+ Model.applicationArgument = (Typed.unTypedTerm arg2)}))++-- | DSL reference to hydra.core.reduction.betaReduceType+betaReduceType :: Typed.TypedTerm t0 -> Typed.TypedTerm Graph.Graph -> Typed.TypedTerm Model.Type -> Typed.TypedTerm (Either Errors.Error Model.Type)+betaReduceType arg0 arg1 arg2 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.reduction.betaReduceType")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)})),+ Model.applicationArgument = (Typed.unTypedTerm arg2)}))++-- | DSL reference to hydra.core.reduction.contractTerm+contractTerm :: Typed.TypedTerm Model.Term -> Typed.TypedTerm Model.Term+contractTerm arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.reduction.contractTerm")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.reduction.countPrimitiveInvocations+countPrimitiveInvocations :: Typed.TypedTerm Bool+countPrimitiveInvocations =+ Typed.TypedTerm (Model.TermVariable (Model.Name "hydra.core.reduction.countPrimitiveInvocations"))++-- | DSL reference to hydra.core.reduction.etaExpandTerm+etaExpandTerm :: Typed.TypedTerm Graph.Graph -> Typed.TypedTerm Model.Term -> Typed.TypedTerm Model.Term+etaExpandTerm arg0 arg1 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.reduction.etaExpandTerm")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)}))++-- | DSL reference to hydra.core.reduction.etaExpandTypedTerm+etaExpandTypedTerm :: Typed.TypedTerm Typing.InferenceContext -> Typed.TypedTerm Graph.Graph -> Typed.TypedTerm Model.Term -> Typed.TypedTerm (Either Errors.Error Model.Term)+etaExpandTypedTerm arg0 arg1 arg2 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.reduction.etaExpandTypedTerm")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)})),+ Model.applicationArgument = (Typed.unTypedTerm arg2)}))++-- | DSL reference to hydra.core.reduction.etaExpansionArity+etaExpansionArity :: Typed.TypedTerm Graph.Graph -> Typed.TypedTerm Model.Term -> Typed.TypedTerm Int+etaExpansionArity arg0 arg1 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.reduction.etaExpansionArity")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)}))++-- | DSL reference to hydra.core.reduction.etaReduceTerm+etaReduceTerm :: Typed.TypedTerm Model.Term -> Typed.TypedTerm Model.Term+etaReduceTerm arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.reduction.etaReduceTerm")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.reduction.reduceTerm+reduceTerm :: Typed.TypedTerm t0 -> Typed.TypedTerm Graph.Graph -> Typed.TypedTerm Bool -> Typed.TypedTerm Model.Term -> Typed.TypedTerm (Either Errors.Error Model.Term)+reduceTerm arg0 arg1 arg2 arg3 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.reduction.reduceTerm")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)})),+ Model.applicationArgument = (Typed.unTypedTerm arg2)})),+ Model.applicationArgument = (Typed.unTypedTerm arg3)}))++-- | DSL reference to hydra.core.reduction.termIsClosed+termIsClosed :: Typed.TypedTerm Model.Term -> Typed.TypedTerm Bool+termIsClosed arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.reduction.termIsClosed")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.reduction.termIsValue+termIsValue :: Typed.TypedTerm Model.Term -> Typed.TypedTerm Bool+termIsValue arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.reduction.termIsValue")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))
@@ -0,0 +1,145 @@+-- Note: this is an automatically generated file. Do not edit.++-- | DSL functions for hydra.core.refs++module Hydra.Core.Dsl.Refs where++import qualified Hydra.Core.Ast as Ast+import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Diff as Diff+import qualified Hydra.Core.Docs as Docs+import qualified Hydra.Core.Dsl.Ast as DslAst+import qualified Hydra.Core.Dsl.Coders as DslCoders+import qualified Hydra.Core.Dsl.Diff as DslDiff+import qualified Hydra.Core.Dsl.Docs as DslDocs+import qualified Hydra.Core.Dsl.Error.Checking as ErrorChecking+import qualified Hydra.Core.Dsl.Error.File as DslErrorFile+import qualified Hydra.Core.Dsl.Error.Model as DslErrorModel+import qualified Hydra.Core.Dsl.Error.Packaging as DslErrorPackaging+import qualified Hydra.Core.Dsl.Error.System as DslErrorSystem+import qualified Hydra.Core.Dsl.Errors as DslErrors+import qualified Hydra.Core.Dsl.File as DslFile+import qualified Hydra.Core.Dsl.Graph as DslGraph+import qualified Hydra.Core.Dsl.Json.Model as DslJsonModel+import qualified Hydra.Core.Dsl.Markdown as DslMarkdown+import qualified Hydra.Core.Dsl.Model as DslModel+import qualified Hydra.Core.Dsl.Names as DslNames+import qualified Hydra.Core.Dsl.Packaging as DslPackaging+import qualified Hydra.Core.Dsl.Parsing as DslParsing+import qualified Hydra.Core.Dsl.Paths as DslPaths+import qualified Hydra.Core.Dsl.Query as DslQuery+import qualified Hydra.Core.Dsl.Regex as DslRegex+import qualified Hydra.Core.Dsl.Relational as DslRelational+import qualified Hydra.Core.Dsl.System as DslSystem+import qualified Hydra.Core.Dsl.Tabular as DslTabular+import qualified Hydra.Core.Dsl.Testing as DslTesting+import qualified Hydra.Core.Dsl.Time as DslTime+import qualified Hydra.Core.Dsl.Topology as DslTopology+import qualified Hydra.Core.Dsl.Typing as DslTyping+import qualified Hydra.Core.Dsl.Util as DslUtil+import qualified Hydra.Core.Dsl.Validation as DslValidation+import qualified Hydra.Core.Dsl.Variants as DslVariants+import qualified Hydra.Core.Error.Checking as Checking+import qualified Hydra.Core.Error.File as ErrorFile+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Error.Packaging as ErrorPackaging+import qualified Hydra.Core.Error.System as ErrorSystem+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Json.Model as JsonModel+import qualified Hydra.Core.Markdown as Markdown+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Names as Names+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Parsing as Parsing+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Query as Query+import qualified Hydra.Core.Refs as Refs+import qualified Hydra.Core.Regex as Regex+import qualified Hydra.Core.Relational as Relational+import qualified Hydra.Core.System as System+import qualified Hydra.Core.Tabular as Tabular+import qualified Hydra.Core.Testing as Testing+import qualified Hydra.Core.Time as Time+import qualified Hydra.Core.Topology as Topology+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Validation as Validation+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void+import qualified Data.Map as M+import qualified Data.Set as S++-- | DSL reference to hydra.core.refs.decodeRef+decodeRef :: Typed.TypedName t0 -> Typed.TypedTerm Model.Term+decodeRef arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.refs.decodeRef")),+ Model.applicationArgument = (Model.TermVariable (Typed.unTypedName arg0))}))++-- | DSL reference to hydra.core.refs.encodeList+encodeList :: Typed.TypedTerm (t0 -> Model.Term) -> Typed.TypedTerm [t0] -> Typed.TypedTerm Model.Term+encodeList arg0 arg1 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.refs.encodeList")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)}))++-- | DSL reference to hydra.core.refs.encodeMap+encodeMap :: Typed.TypedTerm (t0 -> Model.Term) -> Typed.TypedTerm (t1 -> Model.Term) -> Typed.TypedTerm (M.Map t0 t1) -> Typed.TypedTerm Model.Term+encodeMap arg0 arg1 arg2 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.refs.encodeMap")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)})),+ Model.applicationArgument = (Typed.unTypedTerm arg2)}))++-- | DSL reference to hydra.core.refs.encodeOptional+encodeOptional :: Typed.TypedTerm (t0 -> Model.Term) -> Typed.TypedTerm (Maybe t0) -> Typed.TypedTerm Model.Term+encodeOptional arg0 arg1 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.refs.encodeOptional")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)}))++-- | DSL reference to hydra.core.refs.encodePair+encodePair :: Typed.TypedTerm (t0 -> Model.Term) -> Typed.TypedTerm (t1 -> Model.Term) -> Typed.TypedTerm (t0, t1) -> Typed.TypedTerm Model.Term+encodePair arg0 arg1 arg2 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.refs.encodePair")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)})),+ Model.applicationArgument = (Typed.unTypedTerm arg2)}))++-- | DSL reference to hydra.core.refs.encodeRef+encodeRef :: Typed.TypedName t0 -> Typed.TypedTerm Model.Term+encodeRef arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.refs.encodeRef")),+ Model.applicationArgument = (Model.TermVariable (Typed.unTypedName arg0))}))++-- | DSL reference to hydra.core.refs.encodeSet+encodeSet :: Typed.TypedTerm (t0 -> Model.Term) -> Typed.TypedTerm (S.Set t0) -> Typed.TypedTerm Model.Term+encodeSet arg0 arg1 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.refs.encodeSet")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)}))++-- | DSL reference to hydra.core.refs.showRef+showRef :: Typed.TypedName t0 -> Typed.TypedTerm Model.Term+showRef arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.refs.showRef")),+ Model.applicationArgument = (Model.TermVariable (Typed.unTypedName arg0))}))
@@ -0,0 +1,438 @@+-- Note: this is an automatically generated file. Do not edit.++-- | DSL functions for hydra.core.regex++module Hydra.Core.Dsl.Regex where++import qualified Hydra.Core.Decode.Regex as DecodeRegex+import qualified Hydra.Core.Dsl.Model as DslModel+import qualified Hydra.Core.Encode.Regex as EncodeRegex+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Regex as Regex+import qualified Hydra.Core.Typed as Typed+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | DSL injection for the anchorEnd variant of hydra.core.regex.Atom+atomAnchorEnd :: Typed.TypedTerm Regex.Atom+atomAnchorEnd =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.regex.Atom"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "anchorEnd"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL injection for the anchorStart variant of hydra.core.regex.Atom+atomAnchorStart :: Typed.TypedTerm Regex.Atom+atomAnchorStart =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.regex.Atom"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "anchorStart"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL injection for the any variant of hydra.core.regex.Atom+atomAny :: Typed.TypedTerm Regex.Atom+atomAny =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.regex.Atom"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "any"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL name token for hydra.core.regex.Atom+atomAtom :: Typed.TypedName Regex.Atom+atomAtom = Typed.TypedName (Model.Name "hydra.core.regex.Atom")++-- | DSL injection for the class variant of hydra.core.regex.Atom+atomClass :: Typed.TypedTerm Regex.CharacterClass -> Typed.TypedTerm Regex.Atom+atomClass x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.regex.Atom"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "class"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the group variant of hydra.core.regex.Atom+atomGroup :: Typed.TypedTerm Regex.Alternation -> Typed.TypedTerm Regex.Atom+atomGroup x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.regex.Atom"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "group"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the literal variant of hydra.core.regex.Atom+atomLiteral :: Typed.TypedTerm Int -> Typed.TypedTerm Regex.Atom+atomLiteral x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.regex.Atom"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "literal"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL constructor for hydra.core.regex.CharacterClass+characterClass :: Typed.TypedTerm Bool -> Typed.TypedTerm [Regex.ClassItem] -> Typed.TypedTerm Regex.CharacterClass+characterClass negated items =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.regex.CharacterClass"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "negated"),+ Model.fieldTerm = (Typed.unTypedTerm negated)},+ Model.Field {+ Model.fieldName = (Model.Name "items"),+ Model.fieldTerm = (Typed.unTypedTerm items)}]}))++-- | DSL name token for hydra.core.regex.CharacterClass+characterClassCharacterClass :: Typed.TypedName Regex.CharacterClass+characterClassCharacterClass = Typed.TypedName (Model.Name "hydra.core.regex.CharacterClass")++-- | DSL accessor for the items field of hydra.core.regex.CharacterClass+characterClassItems :: Typed.TypedTerm Regex.CharacterClass -> Typed.TypedTerm [Regex.ClassItem]+characterClassItems x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.regex.CharacterClass"),+ Model.projectionFieldName = (Model.Name "items")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the negated field of hydra.core.regex.CharacterClass+characterClassNegated :: Typed.TypedTerm Regex.CharacterClass -> Typed.TypedTerm Bool+characterClassNegated x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.regex.CharacterClass"),+ Model.projectionFieldName = (Model.Name "negated")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL updater for the items field of hydra.core.regex.CharacterClass+characterClassWithItems :: Typed.TypedTerm Regex.CharacterClass -> Typed.TypedTerm [Regex.ClassItem] -> Typed.TypedTerm Regex.CharacterClass+characterClassWithItems original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.regex.CharacterClass"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "negated"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.regex.CharacterClass"),+ Model.projectionFieldName = (Model.Name "negated")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "items"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL updater for the negated field of hydra.core.regex.CharacterClass+characterClassWithNegated :: Typed.TypedTerm Regex.CharacterClass -> Typed.TypedTerm Bool -> Typed.TypedTerm Regex.CharacterClass+characterClassWithNegated original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.regex.CharacterClass"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "negated"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "items"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.regex.CharacterClass"),+ Model.projectionFieldName = (Model.Name "items")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL constructor for hydra.core.regex.CharacterRange+characterRange :: Typed.TypedTerm Int -> Typed.TypedTerm Int -> Typed.TypedTerm Regex.CharacterRange+characterRange from to =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.regex.CharacterRange"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "from"),+ Model.fieldTerm = (Typed.unTypedTerm from)},+ Model.Field {+ Model.fieldName = (Model.Name "to"),+ Model.fieldTerm = (Typed.unTypedTerm to)}]}))++-- | DSL name token for hydra.core.regex.CharacterRange+characterRangeCharacterRange :: Typed.TypedName Regex.CharacterRange+characterRangeCharacterRange = Typed.TypedName (Model.Name "hydra.core.regex.CharacterRange")++-- | DSL accessor for the from field of hydra.core.regex.CharacterRange+characterRangeFrom :: Typed.TypedTerm Regex.CharacterRange -> Typed.TypedTerm Int+characterRangeFrom x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.regex.CharacterRange"),+ Model.projectionFieldName = (Model.Name "from")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the to field of hydra.core.regex.CharacterRange+characterRangeTo :: Typed.TypedTerm Regex.CharacterRange -> Typed.TypedTerm Int+characterRangeTo x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.regex.CharacterRange"),+ Model.projectionFieldName = (Model.Name "to")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL updater for the from field of hydra.core.regex.CharacterRange+characterRangeWithFrom :: Typed.TypedTerm Regex.CharacterRange -> Typed.TypedTerm Int -> Typed.TypedTerm Regex.CharacterRange+characterRangeWithFrom original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.regex.CharacterRange"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "from"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "to"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.regex.CharacterRange"),+ Model.projectionFieldName = (Model.Name "to")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the to field of hydra.core.regex.CharacterRange+characterRangeWithTo :: Typed.TypedTerm Regex.CharacterRange -> Typed.TypedTerm Int -> Typed.TypedTerm Regex.CharacterRange+characterRangeWithTo original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.regex.CharacterRange"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "from"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.regex.CharacterRange"),+ Model.projectionFieldName = (Model.Name "from")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "to"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL injection for the character variant of hydra.core.regex.ClassItem+classItemCharacter :: Typed.TypedTerm Int -> Typed.TypedTerm Regex.ClassItem+classItemCharacter x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.regex.ClassItem"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "character"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL name token for hydra.core.regex.ClassItem+classItemClassItem :: Typed.TypedName Regex.ClassItem+classItemClassItem = Typed.TypedName (Model.Name "hydra.core.regex.ClassItem")++-- | DSL injection for the range variant of hydra.core.regex.ClassItem+classItemRange :: Typed.TypedTerm Regex.CharacterRange -> Typed.TypedTerm Regex.ClassItem+classItemRange x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.regex.ClassItem"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "range"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL constructor for hydra.core.regex.Quantified+quantified :: Typed.TypedTerm Regex.Atom -> Typed.TypedTerm Regex.Quantifier -> Typed.TypedTerm Regex.Quantified+quantified atom quantifier =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.regex.Quantified"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "atom"),+ Model.fieldTerm = (Typed.unTypedTerm atom)},+ Model.Field {+ Model.fieldName = (Model.Name "quantifier"),+ Model.fieldTerm = (Typed.unTypedTerm quantifier)}]}))++-- | DSL accessor for the atom field of hydra.core.regex.Quantified+quantifiedAtom :: Typed.TypedTerm Regex.Quantified -> Typed.TypedTerm Regex.Atom+quantifiedAtom x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.regex.Quantified"),+ Model.projectionFieldName = (Model.Name "atom")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.regex.Quantified+quantifiedQuantified :: Typed.TypedName Regex.Quantified+quantifiedQuantified = Typed.TypedName (Model.Name "hydra.core.regex.Quantified")++-- | DSL accessor for the quantifier field of hydra.core.regex.Quantified+quantifiedQuantifier :: Typed.TypedTerm Regex.Quantified -> Typed.TypedTerm Regex.Quantifier+quantifiedQuantifier x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.regex.Quantified"),+ Model.projectionFieldName = (Model.Name "quantifier")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL updater for the atom field of hydra.core.regex.Quantified+quantifiedWithAtom :: Typed.TypedTerm Regex.Quantified -> Typed.TypedTerm Regex.Atom -> Typed.TypedTerm Regex.Quantified+quantifiedWithAtom original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.regex.Quantified"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "atom"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "quantifier"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.regex.Quantified"),+ Model.projectionFieldName = (Model.Name "quantifier")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the quantifier field of hydra.core.regex.Quantified+quantifiedWithQuantifier :: Typed.TypedTerm Regex.Quantified -> Typed.TypedTerm Regex.Quantifier -> Typed.TypedTerm Regex.Quantified+quantifiedWithQuantifier original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.regex.Quantified"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "atom"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.regex.Quantified"),+ Model.projectionFieldName = (Model.Name "atom")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "quantifier"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL injection for the atLeast variant of hydra.core.regex.Quantifier+quantifierAtLeast :: Typed.TypedTerm Int -> Typed.TypedTerm Regex.Quantifier+quantifierAtLeast x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.regex.Quantifier"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "atLeast"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the exactly variant of hydra.core.regex.Quantifier+quantifierExactly :: Typed.TypedTerm Int -> Typed.TypedTerm Regex.Quantifier+quantifierExactly x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.regex.Quantifier"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "exactly"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the one variant of hydra.core.regex.Quantifier+quantifierOne :: Typed.TypedTerm Regex.Quantifier+quantifierOne =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.regex.Quantifier"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "one"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL injection for the oneOrMore variant of hydra.core.regex.Quantifier+quantifierOneOrMore :: Typed.TypedTerm Regex.Quantifier+quantifierOneOrMore =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.regex.Quantifier"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "oneOrMore"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL name token for hydra.core.regex.Quantifier+quantifierQuantifier :: Typed.TypedName Regex.Quantifier+quantifierQuantifier = Typed.TypedName (Model.Name "hydra.core.regex.Quantifier")++-- | DSL injection for the range variant of hydra.core.regex.Quantifier+quantifierRange :: Typed.TypedTerm Regex.QuantifierRange -> Typed.TypedTerm Regex.Quantifier+quantifierRange x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.regex.Quantifier"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "range"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL constructor for hydra.core.regex.QuantifierRange+quantifierRange2 :: Typed.TypedTerm Int -> Typed.TypedTerm Int -> Typed.TypedTerm Regex.QuantifierRange+quantifierRange2 min max =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.regex.QuantifierRange"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "min"),+ Model.fieldTerm = (Typed.unTypedTerm min)},+ Model.Field {+ Model.fieldName = (Model.Name "max"),+ Model.fieldTerm = (Typed.unTypedTerm max)}]}))++-- | DSL accessor for the max field of hydra.core.regex.QuantifierRange+quantifierRangeMax :: Typed.TypedTerm Regex.QuantifierRange -> Typed.TypedTerm Int+quantifierRangeMax x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.regex.QuantifierRange"),+ Model.projectionFieldName = (Model.Name "max")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the min field of hydra.core.regex.QuantifierRange+quantifierRangeMin :: Typed.TypedTerm Regex.QuantifierRange -> Typed.TypedTerm Int+quantifierRangeMin x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.regex.QuantifierRange"),+ Model.projectionFieldName = (Model.Name "min")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.regex.QuantifierRange+quantifierRangeQuantifierRange :: Typed.TypedName Regex.QuantifierRange+quantifierRangeQuantifierRange = Typed.TypedName (Model.Name "hydra.core.regex.QuantifierRange")++-- | DSL updater for the max field of hydra.core.regex.QuantifierRange+quantifierRangeWithMax :: Typed.TypedTerm Regex.QuantifierRange -> Typed.TypedTerm Int -> Typed.TypedTerm Regex.QuantifierRange+quantifierRangeWithMax original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.regex.QuantifierRange"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "min"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.regex.QuantifierRange"),+ Model.projectionFieldName = (Model.Name "min")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "max"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL updater for the min field of hydra.core.regex.QuantifierRange+quantifierRangeWithMin :: Typed.TypedTerm Regex.QuantifierRange -> Typed.TypedTerm Int -> Typed.TypedTerm Regex.QuantifierRange+quantifierRangeWithMin original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.regex.QuantifierRange"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "min"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "max"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.regex.QuantifierRange"),+ Model.projectionFieldName = (Model.Name "max")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL injection for the zeroOrMore variant of hydra.core.regex.Quantifier+quantifierZeroOrMore :: Typed.TypedTerm Regex.Quantifier+quantifierZeroOrMore =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.regex.Quantifier"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "zeroOrMore"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL injection for the zeroOrOne variant of hydra.core.regex.Quantifier+quantifierZeroOrOne :: Typed.TypedTerm Regex.Quantifier+quantifierZeroOrOne =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.regex.Quantifier"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "zeroOrOne"),+ Model.fieldTerm = Model.TermUnit}}))
@@ -0,0 +1,518 @@+-- Note: this is an automatically generated file. Do not edit.++-- | DSL functions for hydra.core.relational++module Hydra.Core.Dsl.Relational where++import qualified Hydra.Core.Decode.Relational as DecodeRelational+import qualified Hydra.Core.Dsl.Model as DslModel+import qualified Hydra.Core.Encode.Relational as EncodeRelational+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Relational as Relational+import qualified Hydra.Core.Typed as Typed+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void+import qualified Data.Map as M+import qualified Data.Set as S++-- | DSL constructor for the hydra.core.relational.ColumnName wrapper+columnName :: Typed.TypedTerm String -> Typed.TypedTerm Relational.ColumnName+columnName x =+ Typed.TypedTerm (Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.Name "hydra.core.relational.ColumnName"),+ Model.wrappedTermBody = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.relational.ColumnName+columnNameColumnName :: Typed.TypedName Relational.ColumnName+columnNameColumnName = Typed.TypedName (Model.Name "hydra.core.relational.ColumnName")++-- | DSL constructor for hydra.core.relational.ColumnSchema+columnSchema :: Typed.TypedTerm Relational.ColumnName -> Typed.TypedTerm t -> Typed.TypedTerm (Relational.ColumnSchema t)+columnSchema name domain =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.relational.ColumnSchema"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Typed.unTypedTerm name)},+ Model.Field {+ Model.fieldName = (Model.Name "domain"),+ Model.fieldTerm = (Typed.unTypedTerm domain)}]}))++-- | DSL name token for hydra.core.relational.ColumnSchema+columnSchemaColumnSchema :: Typed.TypedName (Relational.ColumnSchema t)+columnSchemaColumnSchema = Typed.TypedName (Model.Name "hydra.core.relational.ColumnSchema")++-- | DSL accessor for the domain field of hydra.core.relational.ColumnSchema+columnSchemaDomain :: Typed.TypedTerm (Relational.ColumnSchema t) -> Typed.TypedTerm t+columnSchemaDomain x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.relational.ColumnSchema"),+ Model.projectionFieldName = (Model.Name "domain")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the name field of hydra.core.relational.ColumnSchema+columnSchemaName :: Typed.TypedTerm (Relational.ColumnSchema t) -> Typed.TypedTerm Relational.ColumnName+columnSchemaName x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.relational.ColumnSchema"),+ Model.projectionFieldName = (Model.Name "name")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL updater for the domain field of hydra.core.relational.ColumnSchema+columnSchemaWithDomain :: Typed.TypedTerm (Relational.ColumnSchema t) -> Typed.TypedTerm t -> Typed.TypedTerm (Relational.ColumnSchema t)+columnSchemaWithDomain original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.relational.ColumnSchema"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.relational.ColumnSchema"),+ Model.projectionFieldName = (Model.Name "name")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "domain"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL updater for the name field of hydra.core.relational.ColumnSchema+columnSchemaWithName :: Typed.TypedTerm (Relational.ColumnSchema t) -> Typed.TypedTerm Relational.ColumnName -> Typed.TypedTerm (Relational.ColumnSchema t)+columnSchemaWithName original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.relational.ColumnSchema"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "domain"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.relational.ColumnSchema"),+ Model.projectionFieldName = (Model.Name "domain")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL composition builder for the decoder of hydra.core.relational.ColumnSchema+decodeColumnSchema :: Typed.TypedTerm (Graph.Graph -> Model.Term -> Either Errors.DecodingError t) -> Typed.TypedTerm (Graph.Graph -> Model.Term -> Either Errors.DecodingError (Relational.ColumnSchema t))+decodeColumnSchema t =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.decode.relational.columnSchema")),+ Model.applicationArgument = (Typed.unTypedTerm t)}))++-- | DSL composition builder for the decoder of hydra.core.relational.Relation+decodeRelation :: Typed.TypedTerm (Graph.Graph -> Model.Term -> Either Errors.DecodingError v) -> Typed.TypedTerm (Graph.Graph -> Model.Term -> Either Errors.DecodingError (Relational.Relation v))+decodeRelation v =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.decode.relational.relation")),+ Model.applicationArgument = (Typed.unTypedTerm v)}))++-- | DSL composition builder for the decoder of hydra.core.relational.RelationSchema+decodeRelationSchema :: Typed.TypedTerm (Graph.Graph -> Model.Term -> Either Errors.DecodingError t) -> Typed.TypedTerm (Graph.Graph -> Model.Term -> Either Errors.DecodingError (Relational.RelationSchema t))+decodeRelationSchema t =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.decode.relational.relationSchema")),+ Model.applicationArgument = (Typed.unTypedTerm t)}))++-- | DSL composition builder for the decoder of hydra.core.relational.Relationship+decodeRelationship :: Typed.TypedTerm (Graph.Graph -> Model.Term -> Either Errors.DecodingError v) -> Typed.TypedTerm (Graph.Graph -> Model.Term -> Either Errors.DecodingError (Relational.Relationship v))+decodeRelationship v =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.decode.relational.relationship")),+ Model.applicationArgument = (Typed.unTypedTerm v)}))++-- | DSL composition builder for the decoder of hydra.core.relational.Row+decodeRow :: Typed.TypedTerm (Graph.Graph -> Model.Term -> Either Errors.DecodingError v) -> Typed.TypedTerm (Graph.Graph -> Model.Term -> Either Errors.DecodingError (Relational.Row v))+decodeRow v =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.decode.relational.row")),+ Model.applicationArgument = (Typed.unTypedTerm v)}))++-- | DSL composition builder for the encoder of hydra.core.relational.ColumnSchema+encodeColumnSchema :: Typed.TypedTerm (t -> Model.Term) -> Typed.TypedTerm (Relational.ColumnSchema t -> Model.Term)+encodeColumnSchema t =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.encode.relational.columnSchema")),+ Model.applicationArgument = (Typed.unTypedTerm t)}))++-- | DSL composition builder for the encoder of hydra.core.relational.Relation+encodeRelation :: Typed.TypedTerm (v -> Model.Term) -> Typed.TypedTerm (Relational.Relation v -> Model.Term)+encodeRelation v =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.encode.relational.relation")),+ Model.applicationArgument = (Typed.unTypedTerm v)}))++-- | DSL composition builder for the encoder of hydra.core.relational.RelationSchema+encodeRelationSchema :: Typed.TypedTerm (t -> Model.Term) -> Typed.TypedTerm (Relational.RelationSchema t -> Model.Term)+encodeRelationSchema t =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.encode.relational.relationSchema")),+ Model.applicationArgument = (Typed.unTypedTerm t)}))++-- | DSL composition builder for the encoder of hydra.core.relational.Relationship+encodeRelationship :: Typed.TypedTerm (v -> Model.Term) -> Typed.TypedTerm (Relational.Relationship v -> Model.Term)+encodeRelationship v =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.encode.relational.relationship")),+ Model.applicationArgument = (Typed.unTypedTerm v)}))++-- | DSL composition builder for the encoder of hydra.core.relational.Row+encodeRow :: Typed.TypedTerm (v -> Model.Term) -> Typed.TypedTerm (Relational.Row v -> Model.Term)+encodeRow v =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.encode.relational.row")),+ Model.applicationArgument = (Typed.unTypedTerm v)}))++-- | DSL constructor for hydra.core.relational.ForeignKey+foreignKey :: Typed.TypedTerm Relational.RelationName -> Typed.TypedTerm (M.Map Relational.ColumnName Relational.ColumnName) -> Typed.TypedTerm Relational.ForeignKey+foreignKey foreignRelation keys =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.relational.ForeignKey"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "foreignRelation"),+ Model.fieldTerm = (Typed.unTypedTerm foreignRelation)},+ Model.Field {+ Model.fieldName = (Model.Name "keys"),+ Model.fieldTerm = (Typed.unTypedTerm keys)}]}))++-- | DSL name token for hydra.core.relational.ForeignKey+foreignKeyForeignKey :: Typed.TypedName Relational.ForeignKey+foreignKeyForeignKey = Typed.TypedName (Model.Name "hydra.core.relational.ForeignKey")++-- | DSL accessor for the foreignRelation field of hydra.core.relational.ForeignKey+foreignKeyForeignRelation :: Typed.TypedTerm Relational.ForeignKey -> Typed.TypedTerm Relational.RelationName+foreignKeyForeignRelation x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.relational.ForeignKey"),+ Model.projectionFieldName = (Model.Name "foreignRelation")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the keys field of hydra.core.relational.ForeignKey+foreignKeyKeys :: Typed.TypedTerm Relational.ForeignKey -> Typed.TypedTerm (M.Map Relational.ColumnName Relational.ColumnName)+foreignKeyKeys x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.relational.ForeignKey"),+ Model.projectionFieldName = (Model.Name "keys")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL updater for the foreignRelation field of hydra.core.relational.ForeignKey+foreignKeyWithForeignRelation :: Typed.TypedTerm Relational.ForeignKey -> Typed.TypedTerm Relational.RelationName -> Typed.TypedTerm Relational.ForeignKey+foreignKeyWithForeignRelation original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.relational.ForeignKey"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "foreignRelation"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "keys"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.relational.ForeignKey"),+ Model.projectionFieldName = (Model.Name "keys")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the keys field of hydra.core.relational.ForeignKey+foreignKeyWithKeys :: Typed.TypedTerm Relational.ForeignKey -> Typed.TypedTerm (M.Map Relational.ColumnName Relational.ColumnName) -> Typed.TypedTerm Relational.ForeignKey+foreignKeyWithKeys original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.relational.ForeignKey"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "foreignRelation"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.relational.ForeignKey"),+ Model.projectionFieldName = (Model.Name "foreignRelation")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "keys"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL constructor for the hydra.core.relational.PrimaryKey wrapper+primaryKey :: Typed.TypedTerm [Relational.ColumnName] -> Typed.TypedTerm Relational.PrimaryKey+primaryKey x =+ Typed.TypedTerm (Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.Name "hydra.core.relational.PrimaryKey"),+ Model.wrappedTermBody = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.relational.PrimaryKey+primaryKeyPrimaryKey :: Typed.TypedName Relational.PrimaryKey+primaryKeyPrimaryKey = Typed.TypedName (Model.Name "hydra.core.relational.PrimaryKey")++-- | DSL constructor for the hydra.core.relational.Relation wrapper+relation :: Typed.TypedTerm [Relational.Row v] -> Typed.TypedTerm (Relational.Relation v)+relation x =+ Typed.TypedTerm (Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.Name "hydra.core.relational.Relation"),+ Model.wrappedTermBody = (Typed.unTypedTerm x)}))++-- | DSL constructor for the hydra.core.relational.RelationName wrapper+relationName :: Typed.TypedTerm String -> Typed.TypedTerm Relational.RelationName+relationName x =+ Typed.TypedTerm (Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.Name "hydra.core.relational.RelationName"),+ Model.wrappedTermBody = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.relational.RelationName+relationNameRelationName :: Typed.TypedName Relational.RelationName+relationNameRelationName = Typed.TypedName (Model.Name "hydra.core.relational.RelationName")++-- | DSL name token for hydra.core.relational.Relation+relationRelation :: Typed.TypedName (Relational.Relation v)+relationRelation = Typed.TypedName (Model.Name "hydra.core.relational.Relation")++-- | DSL constructor for hydra.core.relational.RelationSchema+relationSchema :: Typed.TypedTerm Relational.RelationName -> Typed.TypedTerm [Relational.ColumnSchema t] -> Typed.TypedTerm [Relational.PrimaryKey] -> Typed.TypedTerm [Relational.ForeignKey] -> Typed.TypedTerm (Relational.RelationSchema t)+relationSchema name columns primaryKeys foreignKeys =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.relational.RelationSchema"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Typed.unTypedTerm name)},+ Model.Field {+ Model.fieldName = (Model.Name "columns"),+ Model.fieldTerm = (Typed.unTypedTerm columns)},+ Model.Field {+ Model.fieldName = (Model.Name "primaryKeys"),+ Model.fieldTerm = (Typed.unTypedTerm primaryKeys)},+ Model.Field {+ Model.fieldName = (Model.Name "foreignKeys"),+ Model.fieldTerm = (Typed.unTypedTerm foreignKeys)}]}))++-- | DSL accessor for the columns field of hydra.core.relational.RelationSchema+relationSchemaColumns :: Typed.TypedTerm (Relational.RelationSchema t) -> Typed.TypedTerm [Relational.ColumnSchema t]+relationSchemaColumns x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.relational.RelationSchema"),+ Model.projectionFieldName = (Model.Name "columns")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the foreignKeys field of hydra.core.relational.RelationSchema+relationSchemaForeignKeys :: Typed.TypedTerm (Relational.RelationSchema t) -> Typed.TypedTerm [Relational.ForeignKey]+relationSchemaForeignKeys x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.relational.RelationSchema"),+ Model.projectionFieldName = (Model.Name "foreignKeys")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the name field of hydra.core.relational.RelationSchema+relationSchemaName :: Typed.TypedTerm (Relational.RelationSchema t) -> Typed.TypedTerm Relational.RelationName+relationSchemaName x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.relational.RelationSchema"),+ Model.projectionFieldName = (Model.Name "name")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the primaryKeys field of hydra.core.relational.RelationSchema+relationSchemaPrimaryKeys :: Typed.TypedTerm (Relational.RelationSchema t) -> Typed.TypedTerm [Relational.PrimaryKey]+relationSchemaPrimaryKeys x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.relational.RelationSchema"),+ Model.projectionFieldName = (Model.Name "primaryKeys")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.relational.RelationSchema+relationSchemaRelationSchema :: Typed.TypedName (Relational.RelationSchema t)+relationSchemaRelationSchema = Typed.TypedName (Model.Name "hydra.core.relational.RelationSchema")++-- | DSL updater for the columns field of hydra.core.relational.RelationSchema+relationSchemaWithColumns :: Typed.TypedTerm (Relational.RelationSchema t) -> Typed.TypedTerm [Relational.ColumnSchema t] -> Typed.TypedTerm (Relational.RelationSchema t)+relationSchemaWithColumns original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.relational.RelationSchema"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.relational.RelationSchema"),+ Model.projectionFieldName = (Model.Name "name")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "columns"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "primaryKeys"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.relational.RelationSchema"),+ Model.projectionFieldName = (Model.Name "primaryKeys")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "foreignKeys"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.relational.RelationSchema"),+ Model.projectionFieldName = (Model.Name "foreignKeys")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the foreignKeys field of hydra.core.relational.RelationSchema+relationSchemaWithForeignKeys :: Typed.TypedTerm (Relational.RelationSchema t) -> Typed.TypedTerm [Relational.ForeignKey] -> Typed.TypedTerm (Relational.RelationSchema t)+relationSchemaWithForeignKeys original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.relational.RelationSchema"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.relational.RelationSchema"),+ Model.projectionFieldName = (Model.Name "name")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "columns"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.relational.RelationSchema"),+ Model.projectionFieldName = (Model.Name "columns")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "primaryKeys"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.relational.RelationSchema"),+ Model.projectionFieldName = (Model.Name "primaryKeys")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "foreignKeys"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL updater for the name field of hydra.core.relational.RelationSchema+relationSchemaWithName :: Typed.TypedTerm (Relational.RelationSchema t) -> Typed.TypedTerm Relational.RelationName -> Typed.TypedTerm (Relational.RelationSchema t)+relationSchemaWithName original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.relational.RelationSchema"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "columns"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.relational.RelationSchema"),+ Model.projectionFieldName = (Model.Name "columns")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "primaryKeys"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.relational.RelationSchema"),+ Model.projectionFieldName = (Model.Name "primaryKeys")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "foreignKeys"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.relational.RelationSchema"),+ Model.projectionFieldName = (Model.Name "foreignKeys")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the primaryKeys field of hydra.core.relational.RelationSchema+relationSchemaWithPrimaryKeys :: Typed.TypedTerm (Relational.RelationSchema t) -> Typed.TypedTerm [Relational.PrimaryKey] -> Typed.TypedTerm (Relational.RelationSchema t)+relationSchemaWithPrimaryKeys original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.relational.RelationSchema"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.relational.RelationSchema"),+ Model.projectionFieldName = (Model.Name "name")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "columns"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.relational.RelationSchema"),+ Model.projectionFieldName = (Model.Name "columns")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "primaryKeys"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "foreignKeys"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.relational.RelationSchema"),+ Model.projectionFieldName = (Model.Name "foreignKeys")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL constructor for the hydra.core.relational.Relationship wrapper+relationship :: Typed.TypedTerm (S.Set (M.Map Relational.ColumnName v)) -> Typed.TypedTerm (Relational.Relationship v)+relationship x =+ Typed.TypedTerm (Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.Name "hydra.core.relational.Relationship"),+ Model.wrappedTermBody = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.relational.Relationship+relationshipRelationship :: Typed.TypedName (Relational.Relationship v)+relationshipRelationship = Typed.TypedName (Model.Name "hydra.core.relational.Relationship")++-- | DSL constructor for the hydra.core.relational.Row wrapper+row :: Typed.TypedTerm [v] -> Typed.TypedTerm (Relational.Row v)+row x =+ Typed.TypedTerm (Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.Name "hydra.core.relational.Row"),+ Model.wrappedTermBody = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.relational.Row+rowRow :: Typed.TypedName (Relational.Row v)+rowRow = Typed.TypedName (Model.Name "hydra.core.relational.Row")++-- | DSL accessor for the body of hydra.core.relational.ColumnName+unColumnName :: Typed.TypedTerm Relational.ColumnName -> Typed.TypedTerm String+unColumnName x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermUnwrap (Model.Name "hydra.core.relational.ColumnName")),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the body of hydra.core.relational.PrimaryKey+unPrimaryKey :: Typed.TypedTerm Relational.PrimaryKey -> Typed.TypedTerm [Relational.ColumnName]+unPrimaryKey x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermUnwrap (Model.Name "hydra.core.relational.PrimaryKey")),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the body of hydra.core.relational.Relation+unRelation :: Typed.TypedTerm (Relational.Relation v) -> Typed.TypedTerm [Relational.Row v]+unRelation x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermUnwrap (Model.Name "hydra.core.relational.Relation")),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the body of hydra.core.relational.RelationName+unRelationName :: Typed.TypedTerm Relational.RelationName -> Typed.TypedTerm String+unRelationName x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermUnwrap (Model.Name "hydra.core.relational.RelationName")),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the body of hydra.core.relational.Relationship+unRelationship :: Typed.TypedTerm (Relational.Relationship v) -> Typed.TypedTerm (S.Set (M.Map Relational.ColumnName v))+unRelationship x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermUnwrap (Model.Name "hydra.core.relational.Relationship")),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the body of hydra.core.relational.Row+unRow :: Typed.TypedTerm (Relational.Row v) -> Typed.TypedTerm [v]+unRow x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermUnwrap (Model.Name "hydra.core.relational.Row")),+ Model.applicationArgument = (Typed.unTypedTerm x)}))
@@ -0,0 +1,285 @@+-- Note: this is an automatically generated file. Do not edit.++-- | DSL functions for hydra.core.resolution++module Hydra.Core.Dsl.Resolution where++import qualified Hydra.Core.Ast as Ast+import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Diff as Diff+import qualified Hydra.Core.Docs as Docs+import qualified Hydra.Core.Dsl.Ast as DslAst+import qualified Hydra.Core.Dsl.Coders as DslCoders+import qualified Hydra.Core.Dsl.Diff as DslDiff+import qualified Hydra.Core.Dsl.Docs as DslDocs+import qualified Hydra.Core.Dsl.Error.Checking as ErrorChecking+import qualified Hydra.Core.Dsl.Error.File as DslErrorFile+import qualified Hydra.Core.Dsl.Error.Model as DslErrorModel+import qualified Hydra.Core.Dsl.Error.Packaging as DslErrorPackaging+import qualified Hydra.Core.Dsl.Error.System as DslErrorSystem+import qualified Hydra.Core.Dsl.Errors as DslErrors+import qualified Hydra.Core.Dsl.File as DslFile+import qualified Hydra.Core.Dsl.Graph as DslGraph+import qualified Hydra.Core.Dsl.Json.Model as DslJsonModel+import qualified Hydra.Core.Dsl.Lexical as DslLexical+import qualified Hydra.Core.Dsl.Markdown as DslMarkdown+import qualified Hydra.Core.Dsl.Model as DslModel+import qualified Hydra.Core.Dsl.Names as DslNames+import qualified Hydra.Core.Dsl.Packaging as DslPackaging+import qualified Hydra.Core.Dsl.Parsing as DslParsing+import qualified Hydra.Core.Dsl.Paths as DslPaths+import qualified Hydra.Core.Dsl.Query as DslQuery+import qualified Hydra.Core.Dsl.Regex as DslRegex+import qualified Hydra.Core.Dsl.Relational as DslRelational+import qualified Hydra.Core.Dsl.Scoping as DslScoping+import qualified Hydra.Core.Dsl.Strip as DslStrip+import qualified Hydra.Core.Dsl.System as DslSystem+import qualified Hydra.Core.Dsl.Tabular as DslTabular+import qualified Hydra.Core.Dsl.Testing as DslTesting+import qualified Hydra.Core.Dsl.Time as DslTime+import qualified Hydra.Core.Dsl.Topology as DslTopology+import qualified Hydra.Core.Dsl.Typing as DslTyping+import qualified Hydra.Core.Dsl.Util as DslUtil+import qualified Hydra.Core.Dsl.Validation as DslValidation+import qualified Hydra.Core.Dsl.Variables as DslVariables+import qualified Hydra.Core.Dsl.Variants as DslVariants+import qualified Hydra.Core.Error.Checking as Checking+import qualified Hydra.Core.Error.File as ErrorFile+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Error.Packaging as ErrorPackaging+import qualified Hydra.Core.Error.System as ErrorSystem+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Json.Model as JsonModel+import qualified Hydra.Core.Lexical as Lexical+import qualified Hydra.Core.Markdown as Markdown+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Names as Names+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Parsing as Parsing+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Print.Model as PrintModel+import qualified Hydra.Core.Query as Query+import qualified Hydra.Core.Regex as Regex+import qualified Hydra.Core.Relational as Relational+import qualified Hydra.Core.Resolution as Resolution+import qualified Hydra.Core.Scoping as Scoping+import qualified Hydra.Core.Strip as Strip+import qualified Hydra.Core.Substitution as Substitution+import qualified Hydra.Core.System as System+import qualified Hydra.Core.Tabular as Tabular+import qualified Hydra.Core.Testing as Testing+import qualified Hydra.Core.Time as Time+import qualified Hydra.Core.Topology as Topology+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Validation as Validation+import qualified Hydra.Core.Variables as Variables+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void+import qualified Data.Map as M++-- | DSL reference to hydra.core.resolution.dereferenceType+dereferenceType :: Typed.TypedTerm t0 -> Typed.TypedTerm Graph.Graph -> Typed.TypedTerm Model.Name -> Typed.TypedTerm (Either Errors.Error (Maybe Model.Type))+dereferenceType arg0 arg1 arg2 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.resolution.dereferenceType")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)})),+ Model.applicationArgument = (Typed.unTypedTerm arg2)}))++-- | DSL reference to hydra.core.resolution.fTypeIsPolymorphic+fTypeIsPolymorphic :: Typed.TypedTerm Model.Type -> Typed.TypedTerm Bool+fTypeIsPolymorphic arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.resolution.fTypeIsPolymorphic")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.resolution.fieldMap+fieldMap :: Typed.TypedTerm [Model.Field] -> Typed.TypedTerm (M.Map Model.Name Model.Term)+fieldMap arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.resolution.fieldMap")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.resolution.fieldTypeMap+fieldTypeMap :: Typed.TypedTerm [Model.FieldType] -> Typed.TypedTerm (M.Map Model.Name Model.Type)+fieldTypeMap arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.resolution.fieldTypeMap")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.resolution.fieldTypes+fieldTypes :: Typed.TypedTerm t0 -> Typed.TypedTerm Graph.Graph -> Typed.TypedTerm Model.Type -> Typed.TypedTerm (Either Errors.Error (M.Map Model.Name Model.Type))+fieldTypes arg0 arg1 arg2 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.resolution.fieldTypes")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)})),+ Model.applicationArgument = (Typed.unTypedTerm arg2)}))++-- | DSL reference to hydra.core.resolution.findFieldType+findFieldType :: Typed.TypedTerm t0 -> Typed.TypedTerm Model.Name -> Typed.TypedTerm [Model.FieldType] -> Typed.TypedTerm (Either Errors.Error Model.Type)+findFieldType arg0 arg1 arg2 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.resolution.findFieldType")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)})),+ Model.applicationArgument = (Typed.unTypedTerm arg2)}))++-- | DSL reference to hydra.core.resolution.fullyStripAndNormalizeType+fullyStripAndNormalizeType :: Typed.TypedTerm Model.Type -> Typed.TypedTerm Model.Type+fullyStripAndNormalizeType arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.resolution.fullyStripAndNormalizeType")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.resolution.fullyStripType+fullyStripType :: Typed.TypedTerm Model.Type -> Typed.TypedTerm Model.Type+fullyStripType arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.resolution.fullyStripType")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.resolution.instantiateType+instantiateType :: Typed.TypedTerm Typing.InferenceContext -> Typed.TypedTerm Model.Type -> Typed.TypedTerm (Model.Type, Typing.InferenceContext)+instantiateType arg0 arg1 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.resolution.instantiateType")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)}))++-- | DSL reference to hydra.core.resolution.instantiateTypeScheme+instantiateTypeScheme :: Typed.TypedTerm Typing.InferenceContext -> Typed.TypedTerm Model.TypeScheme -> Typed.TypedTerm (Model.TypeScheme, Typing.InferenceContext)+instantiateTypeScheme arg0 arg1 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.resolution.instantiateTypeScheme")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)}))++-- | DSL reference to hydra.core.resolution.mapKeyResolvesToString+mapKeyResolvesToString :: Typed.TypedTerm (M.Map Model.Name Model.Type) -> Typed.TypedTerm Model.Type -> Typed.TypedTerm Bool+mapKeyResolvesToString arg0 arg1 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.resolution.mapKeyResolvesToString")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)}))++-- | DSL reference to hydra.core.resolution.nominalApplication+nominalApplication :: Typed.TypedTerm Model.Name -> Typed.TypedTerm [Model.Type] -> Typed.TypedTerm Model.Type+nominalApplication arg0 arg1 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.resolution.nominalApplication")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)}))++-- | DSL reference to hydra.core.resolution.requireRecordType+requireRecordType :: Typed.TypedTerm t0 -> Typed.TypedTerm Graph.Graph -> Typed.TypedTerm Model.Name -> Typed.TypedTerm (Either Errors.Error [Model.FieldType])+requireRecordType arg0 arg1 arg2 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.resolution.requireRecordType")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)})),+ Model.applicationArgument = (Typed.unTypedTerm arg2)}))++-- | DSL reference to hydra.core.resolution.requireRowType+requireRowType :: Typed.TypedTerm t0 -> Typed.TypedTerm String -> Typed.TypedTerm (Model.Type -> Maybe t1) -> Typed.TypedTerm Graph.Graph -> Typed.TypedTerm Model.Name -> Typed.TypedTerm (Either Errors.Error t1)+requireRowType arg0 arg1 arg2 arg3 arg4 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.resolution.requireRowType")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)})),+ Model.applicationArgument = (Typed.unTypedTerm arg2)})),+ Model.applicationArgument = (Typed.unTypedTerm arg3)})),+ Model.applicationArgument = (Typed.unTypedTerm arg4)}))++-- | DSL reference to hydra.core.resolution.requireSchemaType+requireSchemaType :: Typed.TypedTerm Typing.InferenceContext -> Typed.TypedTerm (M.Map Model.Name Model.TypeScheme) -> Typed.TypedTerm Model.Name -> Typed.TypedTerm (Either Errors.Error (Model.TypeScheme, Typing.InferenceContext))+requireSchemaType arg0 arg1 arg2 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.resolution.requireSchemaType")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)})),+ Model.applicationArgument = (Typed.unTypedTerm arg2)}))++-- | DSL reference to hydra.core.resolution.requireType+requireType :: Typed.TypedTerm t0 -> Typed.TypedTerm Graph.Graph -> Typed.TypedTerm Model.Name -> Typed.TypedTerm (Either Errors.Error Model.Type)+requireType arg0 arg1 arg2 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.resolution.requireType")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)})),+ Model.applicationArgument = (Typed.unTypedTerm arg2)}))++-- | DSL reference to hydra.core.resolution.requireUnionField+requireUnionField :: Typed.TypedTerm t0 -> Typed.TypedTerm Graph.Graph -> Typed.TypedTerm Model.Name -> Typed.TypedTerm Model.Name -> Typed.TypedTerm (Either Errors.Error Model.Type)+requireUnionField arg0 arg1 arg2 arg3 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.resolution.requireUnionField")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)})),+ Model.applicationArgument = (Typed.unTypedTerm arg2)})),+ Model.applicationArgument = (Typed.unTypedTerm arg3)}))++-- | DSL reference to hydra.core.resolution.requireUnionType+requireUnionType :: Typed.TypedTerm t0 -> Typed.TypedTerm Graph.Graph -> Typed.TypedTerm Model.Name -> Typed.TypedTerm (Either Errors.Error [Model.FieldType])+requireUnionType arg0 arg1 arg2 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.resolution.requireUnionType")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)})),+ Model.applicationArgument = (Typed.unTypedTerm arg2)}))++-- | DSL reference to hydra.core.resolution.resolveBaseType+resolveBaseType :: Typed.TypedTerm (M.Map Model.Name Model.Type) -> Typed.TypedTerm Model.Type -> Typed.TypedTerm Model.Type+resolveBaseType arg0 arg1 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.resolution.resolveBaseType")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)}))++-- | DSL reference to hydra.core.resolution.resolveType+resolveType :: Typed.TypedTerm Graph.Graph -> Typed.TypedTerm Model.Type -> Typed.TypedTerm (Maybe Model.Type)+resolveType arg0 arg1 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.resolution.resolveType")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)}))++-- | DSL reference to hydra.core.resolution.typeToTypeScheme+typeToTypeScheme :: Typed.TypedTerm Model.Type -> Typed.TypedTerm Model.TypeScheme+typeToTypeScheme arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.resolution.typeToTypeScheme")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))
@@ -0,0 +1,293 @@+-- Note: this is an automatically generated file. Do not edit.++-- | DSL functions for hydra.core.rewriting++module Hydra.Core.Dsl.Rewriting where++import qualified Hydra.Core.Ast as Ast+import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Constants as Constants+import qualified Hydra.Core.Diff as Diff+import qualified Hydra.Core.Docs as Docs+import qualified Hydra.Core.Dsl.Ast as DslAst+import qualified Hydra.Core.Dsl.Coders as DslCoders+import qualified Hydra.Core.Dsl.Constants as DslConstants+import qualified Hydra.Core.Dsl.Diff as DslDiff+import qualified Hydra.Core.Dsl.Docs as DslDocs+import qualified Hydra.Core.Dsl.Error.Checking as ErrorChecking+import qualified Hydra.Core.Dsl.Error.File as DslErrorFile+import qualified Hydra.Core.Dsl.Error.Model as DslErrorModel+import qualified Hydra.Core.Dsl.Error.Packaging as DslErrorPackaging+import qualified Hydra.Core.Dsl.Error.System as DslErrorSystem+import qualified Hydra.Core.Dsl.Errors as DslErrors+import qualified Hydra.Core.Dsl.File as DslFile+import qualified Hydra.Core.Dsl.Graph as DslGraph+import qualified Hydra.Core.Dsl.Json.Model as DslJsonModel+import qualified Hydra.Core.Dsl.Markdown as DslMarkdown+import qualified Hydra.Core.Dsl.Model as DslModel+import qualified Hydra.Core.Dsl.Packaging as DslPackaging+import qualified Hydra.Core.Dsl.Parsing as DslParsing+import qualified Hydra.Core.Dsl.Paths as DslPaths+import qualified Hydra.Core.Dsl.Query as DslQuery+import qualified Hydra.Core.Dsl.Regex as DslRegex+import qualified Hydra.Core.Dsl.Relational as DslRelational+import qualified Hydra.Core.Dsl.Scoping as DslScoping+import qualified Hydra.Core.Dsl.System as DslSystem+import qualified Hydra.Core.Dsl.Tabular as DslTabular+import qualified Hydra.Core.Dsl.Testing as DslTesting+import qualified Hydra.Core.Dsl.Time as DslTime+import qualified Hydra.Core.Dsl.Topology as DslTopology+import qualified Hydra.Core.Dsl.Typing as DslTyping+import qualified Hydra.Core.Dsl.Util as DslUtil+import qualified Hydra.Core.Dsl.Validation as DslValidation+import qualified Hydra.Core.Dsl.Variants as DslVariants+import qualified Hydra.Core.Error.Checking as Checking+import qualified Hydra.Core.Error.File as ErrorFile+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Error.Packaging as ErrorPackaging+import qualified Hydra.Core.Error.System as ErrorSystem+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Json.Model as JsonModel+import qualified Hydra.Core.Markdown as Markdown+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Parsing as Parsing+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Query as Query+import qualified Hydra.Core.Regex as Regex+import qualified Hydra.Core.Relational as Relational+import qualified Hydra.Core.Rewriting as Rewriting+import qualified Hydra.Core.Scoping as Scoping+import qualified Hydra.Core.System as System+import qualified Hydra.Core.Tabular as Tabular+import qualified Hydra.Core.Testing as Testing+import qualified Hydra.Core.Time as Time+import qualified Hydra.Core.Topology as Topology+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Validation as Validation+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | DSL reference to hydra.core.rewriting.applyInsideTypeLambdasAndAnnotations+applyInsideTypeLambdasAndAnnotations :: Typed.TypedTerm (Model.Term -> Model.Term) -> Typed.TypedTerm Model.Term -> Typed.TypedTerm Model.Term+applyInsideTypeLambdasAndAnnotations arg0 arg1 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.rewriting.applyInsideTypeLambdasAndAnnotations")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)}))++-- | DSL reference to hydra.core.rewriting.foldOverTerm+foldOverTerm :: Typed.TypedTerm Coders.TraversalOrder -> Typed.TypedTerm (t0 -> Model.Term -> t0) -> Typed.TypedTerm t0 -> Typed.TypedTerm Model.Term -> Typed.TypedTerm t0+foldOverTerm arg0 arg1 arg2 arg3 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.rewriting.foldOverTerm")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)})),+ Model.applicationArgument = (Typed.unTypedTerm arg2)})),+ Model.applicationArgument = (Typed.unTypedTerm arg3)}))++-- | DSL reference to hydra.core.rewriting.foldOverType+foldOverType :: Typed.TypedTerm Coders.TraversalOrder -> Typed.TypedTerm (t0 -> Model.Type -> t0) -> Typed.TypedTerm t0 -> Typed.TypedTerm Model.Type -> Typed.TypedTerm t0+foldOverType arg0 arg1 arg2 arg3 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.rewriting.foldOverType")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)})),+ Model.applicationArgument = (Typed.unTypedTerm arg2)})),+ Model.applicationArgument = (Typed.unTypedTerm arg3)}))++-- | DSL reference to hydra.core.rewriting.foldTermWithGraphAndPath+foldTermWithGraphAndPath :: Typed.TypedTerm ((t0 -> Model.Term -> t0) -> [Paths.SubtermStep] -> Graph.Graph -> t0 -> Model.Term -> t0) -> Typed.TypedTerm Graph.Graph -> Typed.TypedTerm t0 -> Typed.TypedTerm Model.Term -> Typed.TypedTerm t0+foldTermWithGraphAndPath arg0 arg1 arg2 arg3 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.rewriting.foldTermWithGraphAndPath")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)})),+ Model.applicationArgument = (Typed.unTypedTerm arg2)})),+ Model.applicationArgument = (Typed.unTypedTerm arg3)}))++-- | DSL reference to hydra.core.rewriting.mapBeneathTypeAnnotations+mapBeneathTypeAnnotations :: Typed.TypedTerm (Model.Type -> Model.Type) -> Typed.TypedTerm Model.Type -> Typed.TypedTerm Model.Type+mapBeneathTypeAnnotations arg0 arg1 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.rewriting.mapBeneathTypeAnnotations")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)}))++-- | DSL reference to hydra.core.rewriting.rewriteAndFoldTerm+rewriteAndFoldTerm :: Typed.TypedTerm ((t0 -> Model.Term -> (t0, Model.Term)) -> t0 -> Model.Term -> (t0, Model.Term)) -> Typed.TypedTerm t0 -> Typed.TypedTerm Model.Term -> Typed.TypedTerm (t0, Model.Term)+rewriteAndFoldTerm arg0 arg1 arg2 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.rewriting.rewriteAndFoldTerm")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)})),+ Model.applicationArgument = (Typed.unTypedTerm arg2)}))++-- | DSL reference to hydra.core.rewriting.rewriteAndFoldTermWithGraph+rewriteAndFoldTermWithGraph :: Typed.TypedTerm ((t0 -> Model.Term -> (t0, Model.Term)) -> Graph.Graph -> t0 -> Model.Term -> (t0, Model.Term)) -> Typed.TypedTerm Graph.Graph -> Typed.TypedTerm t0 -> Typed.TypedTerm Model.Term -> Typed.TypedTerm (t0, Model.Term)+rewriteAndFoldTermWithGraph arg0 arg1 arg2 arg3 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.rewriting.rewriteAndFoldTermWithGraph")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)})),+ Model.applicationArgument = (Typed.unTypedTerm arg2)})),+ Model.applicationArgument = (Typed.unTypedTerm arg3)}))++-- | DSL reference to hydra.core.rewriting.rewriteAndFoldTermWithGraphAndPath+rewriteAndFoldTermWithGraphAndPath :: Typed.TypedTerm ((t0 -> Model.Term -> (t0, Model.Term)) -> [Paths.SubtermStep] -> Graph.Graph -> t0 -> Model.Term -> (t0, Model.Term)) -> Typed.TypedTerm Graph.Graph -> Typed.TypedTerm t0 -> Typed.TypedTerm Model.Term -> Typed.TypedTerm (t0, Model.Term)+rewriteAndFoldTermWithGraphAndPath arg0 arg1 arg2 arg3 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.rewriting.rewriteAndFoldTermWithGraphAndPath")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)})),+ Model.applicationArgument = (Typed.unTypedTerm arg2)})),+ Model.applicationArgument = (Typed.unTypedTerm arg3)}))++-- | DSL reference to hydra.core.rewriting.rewriteAndFoldTermWithPath+rewriteAndFoldTermWithPath :: Typed.TypedTerm (([Paths.SubtermStep] -> t0 -> Model.Term -> (t0, Model.Term)) -> [Paths.SubtermStep] -> t0 -> Model.Term -> (t0, Model.Term)) -> Typed.TypedTerm t0 -> Typed.TypedTerm Model.Term -> Typed.TypedTerm (t0, Model.Term)+rewriteAndFoldTermWithPath arg0 arg1 arg2 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.rewriting.rewriteAndFoldTermWithPath")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)})),+ Model.applicationArgument = (Typed.unTypedTerm arg2)}))++-- | DSL reference to hydra.core.rewriting.rewriteTerm+rewriteTerm :: Typed.TypedTerm ((Model.Term -> Model.Term) -> Model.Term -> Model.Term) -> Typed.TypedTerm Model.Term -> Typed.TypedTerm Model.Term+rewriteTerm arg0 arg1 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.rewriting.rewriteTerm")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)}))++-- | DSL reference to hydra.core.rewriting.rewriteTermM+rewriteTermM :: Typed.TypedTerm ((Model.Term -> Either t0 Model.Term) -> Model.Term -> Either t0 Model.Term) -> Typed.TypedTerm Model.Term -> Typed.TypedTerm (Either t0 Model.Term)+rewriteTermM arg0 arg1 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.rewriting.rewriteTermM")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)}))++-- | DSL reference to hydra.core.rewriting.rewriteTermWithContext+rewriteTermWithContext :: Typed.TypedTerm ((t0 -> Model.Term -> Model.Term) -> t0 -> Model.Term -> Model.Term) -> Typed.TypedTerm t0 -> Typed.TypedTerm Model.Term -> Typed.TypedTerm Model.Term+rewriteTermWithContext arg0 arg1 arg2 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.rewriting.rewriteTermWithContext")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)})),+ Model.applicationArgument = (Typed.unTypedTerm arg2)}))++-- | DSL reference to hydra.core.rewriting.rewriteTermWithContextM+rewriteTermWithContextM :: Typed.TypedTerm ((t0 -> Model.Term -> Either t1 Model.Term) -> t0 -> Model.Term -> Either t1 Model.Term) -> Typed.TypedTerm t0 -> Typed.TypedTerm Model.Term -> Typed.TypedTerm (Either t1 Model.Term)+rewriteTermWithContextM arg0 arg1 arg2 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.rewriting.rewriteTermWithContextM")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)})),+ Model.applicationArgument = (Typed.unTypedTerm arg2)}))++-- | DSL reference to hydra.core.rewriting.rewriteTermWithGraph+rewriteTermWithGraph :: Typed.TypedTerm ((Model.Term -> t0) -> Graph.Graph -> Model.Term -> t0) -> Typed.TypedTerm Graph.Graph -> Typed.TypedTerm Model.Term -> Typed.TypedTerm t0+rewriteTermWithGraph arg0 arg1 arg2 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.rewriting.rewriteTermWithGraph")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)})),+ Model.applicationArgument = (Typed.unTypedTerm arg2)}))++-- | DSL reference to hydra.core.rewriting.rewriteType+rewriteType :: Typed.TypedTerm ((Model.Type -> Model.Type) -> Model.Type -> Model.Type) -> Typed.TypedTerm Model.Type -> Typed.TypedTerm Model.Type+rewriteType arg0 arg1 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.rewriting.rewriteType")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)}))++-- | DSL reference to hydra.core.rewriting.rewriteTypeM+rewriteTypeM :: Typed.TypedTerm ((Model.Type -> Either t0 Model.Type) -> Model.Type -> Either t0 Model.Type) -> Typed.TypedTerm Model.Type -> Typed.TypedTerm (Either t0 Model.Type)+rewriteTypeM arg0 arg1 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.rewriting.rewriteTypeM")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)}))++-- | DSL reference to hydra.core.rewriting.subterms+subterms :: Typed.TypedTerm Model.Term -> Typed.TypedTerm [Model.Term]+subterms arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.rewriting.subterms")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.rewriting.subtermsWithSteps+subtermsWithSteps :: Typed.TypedTerm Model.Term -> Typed.TypedTerm [(Paths.SubtermStep, Model.Term)]+subtermsWithSteps arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.rewriting.subtermsWithSteps")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.rewriting.subtypes+subtypes :: Typed.TypedTerm Model.Type -> Typed.TypedTerm [Model.Type]+subtypes arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.rewriting.subtypes")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.rewriting.subtypesWithSteps+subtypesWithSteps :: Typed.TypedTerm Model.Type -> Typed.TypedTerm [(Paths.SubtypeStep, Model.Type)]+subtypesWithSteps arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.rewriting.subtypesWithSteps")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.rewriting.wrapTermToRecord+wrapTermToRecord :: Typed.TypedTerm Model.Name -> Typed.TypedTerm Model.Term -> Typed.TypedTerm Model.Term+wrapTermToRecord arg0 arg1 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.rewriting.wrapTermToRecord")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)}))++-- | DSL reference to hydra.core.rewriting.wrapTypeToRecord+wrapTypeToRecord :: Typed.TypedTerm Model.Type -> Typed.TypedTerm Model.Type+wrapTypeToRecord arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.rewriting.wrapTypeToRecord")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))
@@ -0,0 +1,137 @@+-- Note: this is an automatically generated file. Do not edit.++-- | DSL functions for hydra.core.scoping++module Hydra.Core.Dsl.Scoping where++import qualified Hydra.Core.Ast as Ast+import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Diff as Diff+import qualified Hydra.Core.Docs as Docs+import qualified Hydra.Core.Dsl.Ast as DslAst+import qualified Hydra.Core.Dsl.Coders as DslCoders+import qualified Hydra.Core.Dsl.Diff as DslDiff+import qualified Hydra.Core.Dsl.Docs as DslDocs+import qualified Hydra.Core.Dsl.Error.Checking as ErrorChecking+import qualified Hydra.Core.Dsl.Error.File as DslErrorFile+import qualified Hydra.Core.Dsl.Error.Model as DslErrorModel+import qualified Hydra.Core.Dsl.Error.Packaging as DslErrorPackaging+import qualified Hydra.Core.Dsl.Error.System as DslErrorSystem+import qualified Hydra.Core.Dsl.Errors as DslErrors+import qualified Hydra.Core.Dsl.File as DslFile+import qualified Hydra.Core.Dsl.Graph as DslGraph+import qualified Hydra.Core.Dsl.Json.Model as DslJsonModel+import qualified Hydra.Core.Dsl.Markdown as DslMarkdown+import qualified Hydra.Core.Dsl.Model as DslModel+import qualified Hydra.Core.Dsl.Packaging as DslPackaging+import qualified Hydra.Core.Dsl.Parsing as DslParsing+import qualified Hydra.Core.Dsl.Paths as DslPaths+import qualified Hydra.Core.Dsl.Query as DslQuery+import qualified Hydra.Core.Dsl.Regex as DslRegex+import qualified Hydra.Core.Dsl.Relational as DslRelational+import qualified Hydra.Core.Dsl.System as DslSystem+import qualified Hydra.Core.Dsl.Tabular as DslTabular+import qualified Hydra.Core.Dsl.Testing as DslTesting+import qualified Hydra.Core.Dsl.Time as DslTime+import qualified Hydra.Core.Dsl.Topology as DslTopology+import qualified Hydra.Core.Dsl.Typing as DslTyping+import qualified Hydra.Core.Dsl.Util as DslUtil+import qualified Hydra.Core.Dsl.Validation as DslValidation+import qualified Hydra.Core.Dsl.Variants as DslVariants+import qualified Hydra.Core.Error.Checking as Checking+import qualified Hydra.Core.Error.File as ErrorFile+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Error.Packaging as ErrorPackaging+import qualified Hydra.Core.Error.System as ErrorSystem+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Json.Model as JsonModel+import qualified Hydra.Core.Markdown as Markdown+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Parsing as Parsing+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Query as Query+import qualified Hydra.Core.Regex as Regex+import qualified Hydra.Core.Relational as Relational+import qualified Hydra.Core.Scoping as Scoping+import qualified Hydra.Core.System as System+import qualified Hydra.Core.Tabular as Tabular+import qualified Hydra.Core.Testing as Testing+import qualified Hydra.Core.Time as Time+import qualified Hydra.Core.Topology as Topology+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Validation as Validation+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | DSL reference to hydra.core.scoping.extendGraphForLambda+extendGraphForLambda :: Typed.TypedTerm Graph.Graph -> Typed.TypedTerm Model.Lambda -> Typed.TypedTerm Graph.Graph+extendGraphForLambda arg0 arg1 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.scoping.extendGraphForLambda")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)}))++-- | DSL reference to hydra.core.scoping.extendGraphForLet+extendGraphForLet :: Typed.TypedTerm (Graph.Graph -> Model.Binding -> Maybe Model.Term) -> Typed.TypedTerm Graph.Graph -> Typed.TypedTerm Model.Let -> Typed.TypedTerm Graph.Graph+extendGraphForLet arg0 arg1 arg2 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.scoping.extendGraphForLet")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)})),+ Model.applicationArgument = (Typed.unTypedTerm arg2)}))++-- | DSL reference to hydra.core.scoping.extendGraphForTypeLambda+extendGraphForTypeLambda :: Typed.TypedTerm Graph.Graph -> Typed.TypedTerm Model.TypeLambda -> Typed.TypedTerm Graph.Graph+extendGraphForTypeLambda arg0 arg1 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.scoping.extendGraphForTypeLambda")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)}))++-- | DSL reference to hydra.core.scoping.extendGraphWithBindings+extendGraphWithBindings :: Typed.TypedTerm [Model.Binding] -> Typed.TypedTerm Graph.Graph -> Typed.TypedTerm Graph.Graph+extendGraphWithBindings arg0 arg1 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.scoping.extendGraphWithBindings")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)}))++-- | DSL reference to hydra.core.scoping.fTypeToTypeScheme+fTypeToTypeScheme :: Typed.TypedTerm Model.Type -> Typed.TypedTerm Model.TypeScheme+fTypeToTypeScheme arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.scoping.fTypeToTypeScheme")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.scoping.termSignatureToTypeScheme+termSignatureToTypeScheme :: Typed.TypedTerm Typing.TermSignature -> Typed.TypedTerm Model.TypeScheme+termSignatureToTypeScheme arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.scoping.termSignatureToTypeScheme")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.scoping.typeSchemeToFType+typeSchemeToFType :: Typed.TypedTerm Model.TypeScheme -> Typed.TypedTerm Model.Type+typeSchemeToFType arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.scoping.typeSchemeToFType")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.scoping.typeSchemeToTermSignature+typeSchemeToTermSignature :: Typed.TypedTerm Model.TypeScheme -> Typed.TypedTerm Typing.TermSignature+typeSchemeToTermSignature arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.scoping.typeSchemeToTermSignature")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))
@@ -0,0 +1,521 @@+-- Note: this is an automatically generated file. Do not edit.++-- | DSL functions for hydra.core.serialization++module Hydra.Core.Dsl.Serialization where++import qualified Hydra.Core.Ast as Ast+import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Diff as Diff+import qualified Hydra.Core.Docs as Docs+import qualified Hydra.Core.Dsl.Ast as DslAst+import qualified Hydra.Core.Dsl.Coders as DslCoders+import qualified Hydra.Core.Dsl.Diff as DslDiff+import qualified Hydra.Core.Dsl.Docs as DslDocs+import qualified Hydra.Core.Dsl.Error.Checking as ErrorChecking+import qualified Hydra.Core.Dsl.Error.File as DslErrorFile+import qualified Hydra.Core.Dsl.Error.Model as DslErrorModel+import qualified Hydra.Core.Dsl.Error.Packaging as DslErrorPackaging+import qualified Hydra.Core.Dsl.Error.System as DslErrorSystem+import qualified Hydra.Core.Dsl.Errors as DslErrors+import qualified Hydra.Core.Dsl.File as DslFile+import qualified Hydra.Core.Dsl.Formatting as DslFormatting+import qualified Hydra.Core.Dsl.Graph as DslGraph+import qualified Hydra.Core.Dsl.Json.Model as DslJsonModel+import qualified Hydra.Core.Dsl.Markdown as DslMarkdown+import qualified Hydra.Core.Dsl.Model as DslModel+import qualified Hydra.Core.Dsl.Packaging as DslPackaging+import qualified Hydra.Core.Dsl.Parsing as DslParsing+import qualified Hydra.Core.Dsl.Paths as DslPaths+import qualified Hydra.Core.Dsl.Query as DslQuery+import qualified Hydra.Core.Dsl.Regex as DslRegex+import qualified Hydra.Core.Dsl.Relational as DslRelational+import qualified Hydra.Core.Dsl.System as DslSystem+import qualified Hydra.Core.Dsl.Tabular as DslTabular+import qualified Hydra.Core.Dsl.Testing as DslTesting+import qualified Hydra.Core.Dsl.Time as DslTime+import qualified Hydra.Core.Dsl.Topology as DslTopology+import qualified Hydra.Core.Dsl.Typing as DslTyping+import qualified Hydra.Core.Dsl.Util as DslUtil+import qualified Hydra.Core.Dsl.Validation as DslValidation+import qualified Hydra.Core.Dsl.Variants as DslVariants+import qualified Hydra.Core.Error.Checking as Checking+import qualified Hydra.Core.Error.File as ErrorFile+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Error.Packaging as ErrorPackaging+import qualified Hydra.Core.Error.System as ErrorSystem+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Formatting as Formatting+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Json.Model as JsonModel+import qualified Hydra.Core.Markdown as Markdown+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Parsing as Parsing+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Query as Query+import qualified Hydra.Core.Regex as Regex+import qualified Hydra.Core.Relational as Relational+import qualified Hydra.Core.Serialization as Serialization+import qualified Hydra.Core.System as System+import qualified Hydra.Core.Tabular as Tabular+import qualified Hydra.Core.Testing as Testing+import qualified Hydra.Core.Time as Time+import qualified Hydra.Core.Topology as Topology+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Validation as Validation+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | DSL reference to hydra.core.serialization.angleBraces+angleBraces :: Typed.TypedTerm Ast.Brackets+angleBraces = Typed.TypedTerm (Model.TermVariable (Model.Name "hydra.core.serialization.angleBraces"))++-- | DSL reference to hydra.core.serialization.angleBracesList+angleBracesList :: Typed.TypedTerm Ast.BlockStyle -> Typed.TypedTerm [Ast.Expr] -> Typed.TypedTerm Ast.Expr+angleBracesList arg0 arg1 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.serialization.angleBracesList")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)}))++-- | DSL reference to hydra.core.serialization.bracesListAdaptive+bracesListAdaptive :: Typed.TypedTerm [Ast.Expr] -> Typed.TypedTerm Ast.Expr+bracesListAdaptive arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.serialization.bracesListAdaptive")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.serialization.bracketList+bracketList :: Typed.TypedTerm Ast.BlockStyle -> Typed.TypedTerm [Ast.Expr] -> Typed.TypedTerm Ast.Expr+bracketList arg0 arg1 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.serialization.bracketList")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)}))++-- | DSL reference to hydra.core.serialization.bracketListAdaptive+bracketListAdaptive :: Typed.TypedTerm [Ast.Expr] -> Typed.TypedTerm Ast.Expr+bracketListAdaptive arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.serialization.bracketListAdaptive")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.serialization.brackets+brackets :: Typed.TypedTerm Ast.Brackets -> Typed.TypedTerm Ast.BlockStyle -> Typed.TypedTerm Ast.Expr -> Typed.TypedTerm Ast.Expr+brackets arg0 arg1 arg2 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.serialization.brackets")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)})),+ Model.applicationArgument = (Typed.unTypedTerm arg2)}))++-- | DSL reference to hydra.core.serialization.chooseLayout+chooseLayout :: Typed.TypedTerm Int -> Typed.TypedTerm Ast.Expr -> Typed.TypedTerm Ast.Expr -> Typed.TypedTerm Ast.Expr+chooseLayout arg0 arg1 arg2 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.serialization.chooseLayout")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)})),+ Model.applicationArgument = (Typed.unTypedTerm arg2)}))++-- | DSL reference to hydra.core.serialization.commaSep+commaSep :: Typed.TypedTerm Ast.BlockStyle -> Typed.TypedTerm [Ast.Expr] -> Typed.TypedTerm Ast.Expr+commaSep arg0 arg1 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.serialization.commaSep")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)}))++-- | DSL reference to hydra.core.serialization.commaSepAdaptive+commaSepAdaptive :: Typed.TypedTerm [Ast.Expr] -> Typed.TypedTerm Ast.Expr+commaSepAdaptive arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.serialization.commaSepAdaptive")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.serialization.cst+cst :: Typed.TypedTerm String -> Typed.TypedTerm Ast.Expr+cst arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.serialization.cst")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.serialization.curlyBlock+curlyBlock :: Typed.TypedTerm Ast.BlockStyle -> Typed.TypedTerm Ast.Expr -> Typed.TypedTerm Ast.Expr+curlyBlock arg0 arg1 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.serialization.curlyBlock")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)}))++-- | DSL reference to hydra.core.serialization.curlyBraces+curlyBraces :: Typed.TypedTerm Ast.Brackets+curlyBraces = Typed.TypedTerm (Model.TermVariable (Model.Name "hydra.core.serialization.curlyBraces"))++-- | DSL reference to hydra.core.serialization.curlyBracesList+curlyBracesList :: Typed.TypedTerm (Maybe String) -> Typed.TypedTerm Ast.BlockStyle -> Typed.TypedTerm [Ast.Expr] -> Typed.TypedTerm Ast.Expr+curlyBracesList arg0 arg1 arg2 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.serialization.curlyBracesList")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)})),+ Model.applicationArgument = (Typed.unTypedTerm arg2)}))++-- | DSL reference to hydra.core.serialization.customIndent+customIndent :: Typed.TypedTerm String -> Typed.TypedTerm String -> Typed.TypedTerm String+customIndent arg0 arg1 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.serialization.customIndent")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)}))++-- | DSL reference to hydra.core.serialization.customIndentBlock+customIndentBlock :: Typed.TypedTerm String -> Typed.TypedTerm [Ast.Expr] -> Typed.TypedTerm Ast.Expr+customIndentBlock arg0 arg1 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.serialization.customIndentBlock")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)}))++-- | DSL reference to hydra.core.serialization.dotSep+dotSep :: Typed.TypedTerm [Ast.Expr] -> Typed.TypedTerm Ast.Expr+dotSep arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.serialization.dotSep")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.serialization.doubleNewlineSep+doubleNewlineSep :: Typed.TypedTerm [Ast.Expr] -> Typed.TypedTerm Ast.Expr+doubleNewlineSep arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.serialization.doubleNewlineSep")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.serialization.doubleSpace+doubleSpace :: Typed.TypedTerm String+doubleSpace = Typed.TypedTerm (Model.TermVariable (Model.Name "hydra.core.serialization.doubleSpace"))++-- | DSL reference to hydra.core.serialization.expressionLength+expressionLength :: Typed.TypedTerm Ast.Expr -> Typed.TypedTerm Int+expressionLength arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.serialization.expressionLength")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.serialization.fullBlockStyle+fullBlockStyle :: Typed.TypedTerm Ast.BlockStyle+fullBlockStyle = Typed.TypedTerm (Model.TermVariable (Model.Name "hydra.core.serialization.fullBlockStyle"))++-- | DSL reference to hydra.core.serialization.halfBlockStyle+halfBlockStyle :: Typed.TypedTerm Ast.BlockStyle+halfBlockStyle = Typed.TypedTerm (Model.TermVariable (Model.Name "hydra.core.serialization.halfBlockStyle"))++-- | DSL reference to hydra.core.serialization.ifx+ifx :: Typed.TypedTerm Ast.Op -> Typed.TypedTerm Ast.Expr -> Typed.TypedTerm Ast.Expr -> Typed.TypedTerm Ast.Expr+ifx arg0 arg1 arg2 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.serialization.ifx")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)})),+ Model.applicationArgument = (Typed.unTypedTerm arg2)}))++-- | DSL reference to hydra.core.serialization.indent+indent :: Typed.TypedTerm String -> Typed.TypedTerm String+indent arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.serialization.indent")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.serialization.indentBlock+indentBlock :: Typed.TypedTerm [Ast.Expr] -> Typed.TypedTerm Ast.Expr+indentBlock arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.serialization.indentBlock")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.serialization.indentSubsequentLines+indentSubsequentLines :: Typed.TypedTerm String -> Typed.TypedTerm Ast.Expr -> Typed.TypedTerm Ast.Expr+indentSubsequentLines arg0 arg1 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.serialization.indentSubsequentLines")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)}))++-- | DSL reference to hydra.core.serialization.infixWs+infixWs :: Typed.TypedTerm String -> Typed.TypedTerm Ast.Expr -> Typed.TypedTerm Ast.Expr -> Typed.TypedTerm Ast.Expr+infixWs arg0 arg1 arg2 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.serialization.infixWs")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)})),+ Model.applicationArgument = (Typed.unTypedTerm arg2)}))++-- | DSL reference to hydra.core.serialization.infixWsList+infixWsList :: Typed.TypedTerm String -> Typed.TypedTerm [Ast.Expr] -> Typed.TypedTerm Ast.Expr+infixWsList arg0 arg1 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.serialization.infixWsList")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)}))++-- | DSL reference to hydra.core.serialization.inlineStyle+inlineStyle :: Typed.TypedTerm Ast.BlockStyle+inlineStyle = Typed.TypedTerm (Model.TermVariable (Model.Name "hydra.core.serialization.inlineStyle"))++-- | DSL reference to hydra.core.serialization.maxLineWidth+maxLineWidth :: Typed.TypedTerm Int+maxLineWidth = Typed.TypedTerm (Model.TermVariable (Model.Name "hydra.core.serialization.maxLineWidth"))++-- | DSL reference to hydra.core.serialization.newlineSep+newlineSep :: Typed.TypedTerm [Ast.Expr] -> Typed.TypedTerm Ast.Expr+newlineSep arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.serialization.newlineSep")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.serialization.noPadding+noPadding :: Typed.TypedTerm Ast.Padding+noPadding = Typed.TypedTerm (Model.TermVariable (Model.Name "hydra.core.serialization.noPadding"))++-- | DSL reference to hydra.core.serialization.noSep+noSep :: Typed.TypedTerm [Ast.Expr] -> Typed.TypedTerm Ast.Expr+noSep arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.serialization.noSep")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.serialization.num+num :: Typed.TypedTerm Int -> Typed.TypedTerm Ast.Expr+num arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.serialization.num")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.serialization.op+op :: Typed.TypedTerm String -> Typed.TypedTerm Int -> Typed.TypedTerm Ast.Associativity -> Typed.TypedTerm Ast.Op+op arg0 arg1 arg2 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.serialization.op")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)})),+ Model.applicationArgument = (Typed.unTypedTerm arg2)}))++-- | DSL reference to hydra.core.serialization.orOp+orOp :: Typed.TypedTerm Bool -> Typed.TypedTerm Ast.Op+orOp arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.serialization.orOp")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.serialization.orSep+orSep :: Typed.TypedTerm Ast.BlockStyle -> Typed.TypedTerm [Ast.Expr] -> Typed.TypedTerm Ast.Expr+orSep arg0 arg1 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.serialization.orSep")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)}))++-- | DSL reference to hydra.core.serialization.parenList+parenList :: Typed.TypedTerm Bool -> Typed.TypedTerm [Ast.Expr] -> Typed.TypedTerm Ast.Expr+parenList arg0 arg1 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.serialization.parenList")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)}))++-- | DSL reference to hydra.core.serialization.parenListAdaptive+parenListAdaptive :: Typed.TypedTerm [Ast.Expr] -> Typed.TypedTerm Ast.Expr+parenListAdaptive arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.serialization.parenListAdaptive")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.serialization.parens+parens :: Typed.TypedTerm Ast.Expr -> Typed.TypedTerm Ast.Expr+parens arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.serialization.parens")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.serialization.parentheses+parentheses :: Typed.TypedTerm Ast.Brackets+parentheses = Typed.TypedTerm (Model.TermVariable (Model.Name "hydra.core.serialization.parentheses"))++-- | DSL reference to hydra.core.serialization.parenthesize+parenthesize :: Typed.TypedTerm Ast.Expr -> Typed.TypedTerm Ast.Expr+parenthesize arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.serialization.parenthesize")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.serialization.prefix+prefix :: Typed.TypedTerm String -> Typed.TypedTerm Ast.Expr -> Typed.TypedTerm Ast.Expr+prefix arg0 arg1 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.serialization.prefix")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)}))++-- | DSL reference to hydra.core.serialization.printExpr+printExpr :: Typed.TypedTerm Ast.Expr -> Typed.TypedTerm String+printExpr arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.serialization.printExpr")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.serialization.semicolonSep+semicolonSep :: Typed.TypedTerm [Ast.Expr] -> Typed.TypedTerm Ast.Expr+semicolonSep arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.serialization.semicolonSep")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.serialization.sep+sep :: Typed.TypedTerm Ast.Op -> Typed.TypedTerm [Ast.Expr] -> Typed.TypedTerm Ast.Expr+sep arg0 arg1 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.serialization.sep")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)}))++-- | DSL reference to hydra.core.serialization.spaceSep+spaceSep :: Typed.TypedTerm [Ast.Expr] -> Typed.TypedTerm Ast.Expr+spaceSep arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.serialization.spaceSep")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.serialization.spaceSepAdaptive+spaceSepAdaptive :: Typed.TypedTerm [Ast.Expr] -> Typed.TypedTerm Ast.Expr+spaceSepAdaptive arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.serialization.spaceSepAdaptive")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.serialization.squareBrackets+squareBrackets :: Typed.TypedTerm Ast.Brackets+squareBrackets = Typed.TypedTerm (Model.TermVariable (Model.Name "hydra.core.serialization.squareBrackets"))++-- | DSL reference to hydra.core.serialization.structuralSep+structuralSep :: Typed.TypedTerm Ast.Op -> Typed.TypedTerm [Ast.Expr] -> Typed.TypedTerm Ast.Expr+structuralSep arg0 arg1 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.serialization.structuralSep")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)}))++-- | DSL reference to hydra.core.serialization.structuralSpaceSep+structuralSpaceSep :: Typed.TypedTerm [Ast.Expr] -> Typed.TypedTerm Ast.Expr+structuralSpaceSep arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.serialization.structuralSpaceSep")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.serialization.suffix+suffix :: Typed.TypedTerm String -> Typed.TypedTerm Ast.Expr -> Typed.TypedTerm Ast.Expr+suffix arg0 arg1 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.serialization.suffix")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)}))++-- | DSL reference to hydra.core.serialization.sym+sym :: Typed.TypedTerm String -> Typed.TypedTerm Ast.Symbol+sym arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.serialization.sym")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.serialization.symbolSep+symbolSep :: Typed.TypedTerm String -> Typed.TypedTerm Ast.BlockStyle -> Typed.TypedTerm [Ast.Expr] -> Typed.TypedTerm Ast.Expr+symbolSep arg0 arg1 arg2 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.serialization.symbolSep")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)})),+ Model.applicationArgument = (Typed.unTypedTerm arg2)}))++-- | DSL reference to hydra.core.serialization.tabIndent+tabIndent :: Typed.TypedTerm Ast.Expr -> Typed.TypedTerm Ast.Expr+tabIndent arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.serialization.tabIndent")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.serialization.tabIndentDoubleSpace+tabIndentDoubleSpace :: Typed.TypedTerm [Ast.Expr] -> Typed.TypedTerm Ast.Expr+tabIndentDoubleSpace arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.serialization.tabIndentDoubleSpace")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.serialization.tabIndentSingleSpace+tabIndentSingleSpace :: Typed.TypedTerm [Ast.Expr] -> Typed.TypedTerm Ast.Expr+tabIndentSingleSpace arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.serialization.tabIndentSingleSpace")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.serialization.unsupportedType+unsupportedType :: Typed.TypedTerm String -> Typed.TypedTerm Ast.Expr+unsupportedType arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.serialization.unsupportedType")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.serialization.unsupportedVariant+unsupportedVariant :: Typed.TypedTerm String -> Typed.TypedTerm String -> Typed.TypedTerm Ast.Expr+unsupportedVariant arg0 arg1 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.serialization.unsupportedVariant")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)}))++-- | DSL reference to hydra.core.serialization.withComma+withComma :: Typed.TypedTerm Ast.Expr -> Typed.TypedTerm Ast.Expr+withComma arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.serialization.withComma")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.serialization.withSemi+withSemi :: Typed.TypedTerm Ast.Expr -> Typed.TypedTerm Ast.Expr+withSemi arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.serialization.withSemi")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))
@@ -0,0 +1,172 @@+-- Note: this is an automatically generated file. Do not edit.++-- | DSL functions for hydra.core.sorting++module Hydra.Core.Dsl.Sorting where++import qualified Hydra.Core.Ast as Ast+import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Constants as Constants+import qualified Hydra.Core.Diff as Diff+import qualified Hydra.Core.Docs as Docs+import qualified Hydra.Core.Dsl.Ast as DslAst+import qualified Hydra.Core.Dsl.Coders as DslCoders+import qualified Hydra.Core.Dsl.Constants as DslConstants+import qualified Hydra.Core.Dsl.Diff as DslDiff+import qualified Hydra.Core.Dsl.Docs as DslDocs+import qualified Hydra.Core.Dsl.Error.Checking as ErrorChecking+import qualified Hydra.Core.Dsl.Error.File as DslErrorFile+import qualified Hydra.Core.Dsl.Error.Model as DslErrorModel+import qualified Hydra.Core.Dsl.Error.Packaging as DslErrorPackaging+import qualified Hydra.Core.Dsl.Error.System as DslErrorSystem+import qualified Hydra.Core.Dsl.Errors as DslErrors+import qualified Hydra.Core.Dsl.File as DslFile+import qualified Hydra.Core.Dsl.Graph as DslGraph+import qualified Hydra.Core.Dsl.Json.Model as DslJsonModel+import qualified Hydra.Core.Dsl.Markdown as DslMarkdown+import qualified Hydra.Core.Dsl.Model as DslModel+import qualified Hydra.Core.Dsl.Packaging as DslPackaging+import qualified Hydra.Core.Dsl.Parsing as DslParsing+import qualified Hydra.Core.Dsl.Paths as DslPaths+import qualified Hydra.Core.Dsl.Query as DslQuery+import qualified Hydra.Core.Dsl.Regex as DslRegex+import qualified Hydra.Core.Dsl.Relational as DslRelational+import qualified Hydra.Core.Dsl.System as DslSystem+import qualified Hydra.Core.Dsl.Tabular as DslTabular+import qualified Hydra.Core.Dsl.Testing as DslTesting+import qualified Hydra.Core.Dsl.Time as DslTime+import qualified Hydra.Core.Dsl.Topology as DslTopology+import qualified Hydra.Core.Dsl.Typing as DslTyping+import qualified Hydra.Core.Dsl.Util as DslUtil+import qualified Hydra.Core.Dsl.Validation as DslValidation+import qualified Hydra.Core.Dsl.Variants as DslVariants+import qualified Hydra.Core.Error.Checking as Checking+import qualified Hydra.Core.Error.File as ErrorFile+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Error.Packaging as ErrorPackaging+import qualified Hydra.Core.Error.System as ErrorSystem+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Json.Model as JsonModel+import qualified Hydra.Core.Markdown as Markdown+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Parsing as Parsing+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Query as Query+import qualified Hydra.Core.Regex as Regex+import qualified Hydra.Core.Relational as Relational+import qualified Hydra.Core.Sorting as Sorting+import qualified Hydra.Core.System as System+import qualified Hydra.Core.Tabular as Tabular+import qualified Hydra.Core.Testing as Testing+import qualified Hydra.Core.Time as Time+import qualified Hydra.Core.Topology as Topology+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Validation as Validation+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void+import qualified Data.Map as M+import qualified Data.Set as S++-- | DSL reference to hydra.core.sorting.adjacencyListToMap+adjacencyListToMap :: Typed.TypedTerm [(t0, [t1])] -> Typed.TypedTerm (M.Map t0 [t1])+adjacencyListToMap arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.sorting.adjacencyListToMap")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.sorting.adjacencyListsToGraph+adjacencyListsToGraph :: Typed.TypedTerm [(t0, [t0])] -> Typed.TypedTerm (M.Map Int [Int], (Int -> Maybe t0))+adjacencyListsToGraph arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.sorting.adjacencyListsToGraph")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.sorting.createOrderingIsomorphism+createOrderingIsomorphism :: Typed.TypedTerm [t0] -> Typed.TypedTerm [t0] -> Typed.TypedTerm (Topology.OrderingIsomorphism t1)+createOrderingIsomorphism arg0 arg1 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.sorting.createOrderingIsomorphism")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)}))++-- | DSL reference to hydra.core.sorting.findReachableNodes+findReachableNodes :: Typed.TypedTerm (t0 -> S.Set t0) -> Typed.TypedTerm t0 -> Typed.TypedTerm (S.Set t0)+findReachableNodes arg0 arg1 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.sorting.findReachableNodes")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)}))++-- | DSL reference to hydra.core.sorting.initialState+initialState :: Typed.TypedTerm Topology.TarjanState+initialState = Typed.TypedTerm (Model.TermVariable (Model.Name "hydra.core.sorting.initialState"))++-- | DSL reference to hydra.core.sorting.popStackUntil+popStackUntil :: Typed.TypedTerm Int -> Typed.TypedTerm Topology.TarjanState -> Typed.TypedTerm ([Int], Topology.TarjanState)+popStackUntil arg0 arg1 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.sorting.popStackUntil")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)}))++-- | DSL reference to hydra.core.sorting.propagateTags+propagateTags :: Typed.TypedTerm [(t0, [t0])] -> Typed.TypedTerm [(t0, [t1])] -> Typed.TypedTerm [(t0, (S.Set t1))]+propagateTags arg0 arg1 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.sorting.propagateTags")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)}))++-- | DSL reference to hydra.core.sorting.strongConnect+strongConnect :: Typed.TypedTerm (M.Map Int [Int]) -> Typed.TypedTerm Int -> Typed.TypedTerm Topology.TarjanState -> Typed.TypedTerm Topology.TarjanState+strongConnect arg0 arg1 arg2 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.sorting.strongConnect")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)})),+ Model.applicationArgument = (Typed.unTypedTerm arg2)}))++-- | DSL reference to hydra.core.sorting.stronglyConnectedComponents+stronglyConnectedComponents :: Typed.TypedTerm (M.Map Int [Int]) -> Typed.TypedTerm [[Int]]+stronglyConnectedComponents arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.sorting.stronglyConnectedComponents")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.sorting.topologicalSort+topologicalSort :: Typed.TypedTerm [(t0, [t0])] -> Typed.TypedTerm (Either [[t0]] [t0])+topologicalSort arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.sorting.topologicalSort")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.sorting.topologicalSortComponents+topologicalSortComponents :: Typed.TypedTerm [(t0, [t0])] -> Typed.TypedTerm [[t0]]+topologicalSortComponents arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.sorting.topologicalSortComponents")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.sorting.topologicalSortNodes+topologicalSortNodes :: Typed.TypedTerm (t0 -> t1) -> Typed.TypedTerm (t0 -> [t1]) -> Typed.TypedTerm [t0] -> Typed.TypedTerm [[t0]]+topologicalSortNodes arg0 arg1 arg2 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.sorting.topologicalSortNodes")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)})),+ Model.applicationArgument = (Typed.unTypedTerm arg2)}))
@@ -0,0 +1,157 @@+-- Note: this is an automatically generated file. Do not edit.++-- | DSL functions for hydra.core.strip++module Hydra.Core.Dsl.Strip where++import qualified Hydra.Core.Ast as Ast+import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Diff as Diff+import qualified Hydra.Core.Docs as Docs+import qualified Hydra.Core.Dsl.Ast as DslAst+import qualified Hydra.Core.Dsl.Coders as DslCoders+import qualified Hydra.Core.Dsl.Diff as DslDiff+import qualified Hydra.Core.Dsl.Docs as DslDocs+import qualified Hydra.Core.Dsl.Error.Checking as ErrorChecking+import qualified Hydra.Core.Dsl.Error.File as DslErrorFile+import qualified Hydra.Core.Dsl.Error.Model as DslErrorModel+import qualified Hydra.Core.Dsl.Error.Packaging as DslErrorPackaging+import qualified Hydra.Core.Dsl.Error.System as DslErrorSystem+import qualified Hydra.Core.Dsl.Errors as DslErrors+import qualified Hydra.Core.Dsl.File as DslFile+import qualified Hydra.Core.Dsl.Graph as DslGraph+import qualified Hydra.Core.Dsl.Json.Model as DslJsonModel+import qualified Hydra.Core.Dsl.Markdown as DslMarkdown+import qualified Hydra.Core.Dsl.Model as DslModel+import qualified Hydra.Core.Dsl.Packaging as DslPackaging+import qualified Hydra.Core.Dsl.Parsing as DslParsing+import qualified Hydra.Core.Dsl.Paths as DslPaths+import qualified Hydra.Core.Dsl.Query as DslQuery+import qualified Hydra.Core.Dsl.Regex as DslRegex+import qualified Hydra.Core.Dsl.Relational as DslRelational+import qualified Hydra.Core.Dsl.Rewriting as DslRewriting+import qualified Hydra.Core.Dsl.System as DslSystem+import qualified Hydra.Core.Dsl.Tabular as DslTabular+import qualified Hydra.Core.Dsl.Testing as DslTesting+import qualified Hydra.Core.Dsl.Time as DslTime+import qualified Hydra.Core.Dsl.Topology as DslTopology+import qualified Hydra.Core.Dsl.Typing as DslTyping+import qualified Hydra.Core.Dsl.Util as DslUtil+import qualified Hydra.Core.Dsl.Validation as DslValidation+import qualified Hydra.Core.Dsl.Variants as DslVariants+import qualified Hydra.Core.Error.Checking as Checking+import qualified Hydra.Core.Error.File as ErrorFile+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Error.Packaging as ErrorPackaging+import qualified Hydra.Core.Error.System as ErrorSystem+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Json.Model as JsonModel+import qualified Hydra.Core.Markdown as Markdown+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Parsing as Parsing+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Query as Query+import qualified Hydra.Core.Regex as Regex+import qualified Hydra.Core.Relational as Relational+import qualified Hydra.Core.Rewriting as Rewriting+import qualified Hydra.Core.Strip as Strip+import qualified Hydra.Core.System as System+import qualified Hydra.Core.Tabular as Tabular+import qualified Hydra.Core.Testing as Testing+import qualified Hydra.Core.Time as Time+import qualified Hydra.Core.Topology as Topology+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Validation as Validation+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | DSL reference to hydra.core.strip.deannotateAndDetypeTerm+deannotateAndDetypeTerm :: Typed.TypedTerm Model.Term -> Typed.TypedTerm Model.Term+deannotateAndDetypeTerm arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.strip.deannotateAndDetypeTerm")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.strip.deannotateTerm+deannotateTerm :: Typed.TypedTerm Model.Term -> Typed.TypedTerm Model.Term+deannotateTerm arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.strip.deannotateTerm")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.strip.deannotateType+deannotateType :: Typed.TypedTerm Model.Type -> Typed.TypedTerm Model.Type+deannotateType arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.strip.deannotateType")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.strip.deannotateTypeParameters+deannotateTypeParameters :: Typed.TypedTerm Model.Type -> Typed.TypedTerm Model.Type+deannotateTypeParameters arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.strip.deannotateTypeParameters")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.strip.deannotateTypeRecursive+deannotateTypeRecursive :: Typed.TypedTerm Model.Type -> Typed.TypedTerm Model.Type+deannotateTypeRecursive arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.strip.deannotateTypeRecursive")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.strip.deannotateTypeSchemeRecursive+deannotateTypeSchemeRecursive :: Typed.TypedTerm Model.TypeScheme -> Typed.TypedTerm Model.TypeScheme+deannotateTypeSchemeRecursive arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.strip.deannotateTypeSchemeRecursive")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.strip.detypeTerm+detypeTerm :: Typed.TypedTerm Model.Term -> Typed.TypedTerm Model.Term+detypeTerm arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.strip.detypeTerm")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.strip.removeTermAnnotations+removeTermAnnotations :: Typed.TypedTerm Model.Term -> Typed.TypedTerm Model.Term+removeTermAnnotations arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.strip.removeTermAnnotations")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.strip.removeTypeAnnotations+removeTypeAnnotations :: Typed.TypedTerm Model.Type -> Typed.TypedTerm Model.Type+removeTypeAnnotations arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.strip.removeTypeAnnotations")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.strip.removeTypeAnnotationsFromTerm+removeTypeAnnotationsFromTerm :: Typed.TypedTerm Model.Term -> Typed.TypedTerm Model.Term+removeTypeAnnotationsFromTerm arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.strip.removeTypeAnnotationsFromTerm")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.strip.removeTypesFromTerm+removeTypesFromTerm :: Typed.TypedTerm Model.Term -> Typed.TypedTerm Model.Term+removeTypesFromTerm arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.strip.removeTypesFromTerm")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.strip.stripTypeLambdas+stripTypeLambdas :: Typed.TypedTerm Model.Term -> Typed.TypedTerm Model.Term+stripTypeLambdas arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.strip.stripTypeLambdas")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))
@@ -0,0 +1,357 @@+-- Note: this is an automatically generated file. Do not edit.++-- | DSL functions for hydra.core.system++module Hydra.Core.Dsl.System where++import qualified Hydra.Core.Decode.System as DecodeSystem+import qualified Hydra.Core.Dsl.File as DslFile+import qualified Hydra.Core.Dsl.Model as DslModel+import qualified Hydra.Core.Encode.System as EncodeSystem+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.System as System+import qualified Hydra.Core.Typed as Typed+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void+import qualified Data.ByteString as B+import qualified Data.Map as M++-- | DSL constructor for hydra.core.system.Command+command :: Typed.TypedTerm File.FilePath -> Typed.TypedTerm [String] -> Typed.TypedTerm (Maybe File.FilePath) -> Typed.TypedTerm (Maybe (M.Map System.EnvironmentVariable String)) -> Typed.TypedTerm System.Command+command program arguments workingDirectory environment =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.system.Command"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "program"),+ Model.fieldTerm = (Typed.unTypedTerm program)},+ Model.Field {+ Model.fieldName = (Model.Name "arguments"),+ Model.fieldTerm = (Typed.unTypedTerm arguments)},+ Model.Field {+ Model.fieldName = (Model.Name "workingDirectory"),+ Model.fieldTerm = (Typed.unTypedTerm workingDirectory)},+ Model.Field {+ Model.fieldName = (Model.Name "environment"),+ Model.fieldTerm = (Typed.unTypedTerm environment)}]}))++-- | DSL accessor for the arguments field of hydra.core.system.Command+commandArguments :: Typed.TypedTerm System.Command -> Typed.TypedTerm [String]+commandArguments x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.system.Command"),+ Model.projectionFieldName = (Model.Name "arguments")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.system.Command+commandCommand :: Typed.TypedName System.Command+commandCommand = Typed.TypedName (Model.Name "hydra.core.system.Command")++-- | DSL accessor for the environment field of hydra.core.system.Command+commandEnvironment :: Typed.TypedTerm System.Command -> Typed.TypedTerm (Maybe (M.Map System.EnvironmentVariable String))+commandEnvironment x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.system.Command"),+ Model.projectionFieldName = (Model.Name "environment")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the program field of hydra.core.system.Command+commandProgram :: Typed.TypedTerm System.Command -> Typed.TypedTerm File.FilePath+commandProgram x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.system.Command"),+ Model.projectionFieldName = (Model.Name "program")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL updater for the arguments field of hydra.core.system.Command+commandWithArguments :: Typed.TypedTerm System.Command -> Typed.TypedTerm [String] -> Typed.TypedTerm System.Command+commandWithArguments original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.system.Command"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "program"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.system.Command"),+ Model.projectionFieldName = (Model.Name "program")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "arguments"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "workingDirectory"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.system.Command"),+ Model.projectionFieldName = (Model.Name "workingDirectory")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "environment"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.system.Command"),+ Model.projectionFieldName = (Model.Name "environment")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the environment field of hydra.core.system.Command+commandWithEnvironment :: Typed.TypedTerm System.Command -> Typed.TypedTerm (Maybe (M.Map System.EnvironmentVariable String)) -> Typed.TypedTerm System.Command+commandWithEnvironment original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.system.Command"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "program"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.system.Command"),+ Model.projectionFieldName = (Model.Name "program")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "arguments"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.system.Command"),+ Model.projectionFieldName = (Model.Name "arguments")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "workingDirectory"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.system.Command"),+ Model.projectionFieldName = (Model.Name "workingDirectory")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "environment"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL updater for the program field of hydra.core.system.Command+commandWithProgram :: Typed.TypedTerm System.Command -> Typed.TypedTerm File.FilePath -> Typed.TypedTerm System.Command+commandWithProgram original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.system.Command"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "program"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "arguments"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.system.Command"),+ Model.projectionFieldName = (Model.Name "arguments")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "workingDirectory"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.system.Command"),+ Model.projectionFieldName = (Model.Name "workingDirectory")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "environment"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.system.Command"),+ Model.projectionFieldName = (Model.Name "environment")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the workingDirectory field of hydra.core.system.Command+commandWithWorkingDirectory :: Typed.TypedTerm System.Command -> Typed.TypedTerm (Maybe File.FilePath) -> Typed.TypedTerm System.Command+commandWithWorkingDirectory original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.system.Command"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "program"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.system.Command"),+ Model.projectionFieldName = (Model.Name "program")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "arguments"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.system.Command"),+ Model.projectionFieldName = (Model.Name "arguments")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "workingDirectory"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "environment"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.system.Command"),+ Model.projectionFieldName = (Model.Name "environment")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL accessor for the workingDirectory field of hydra.core.system.Command+commandWorkingDirectory :: Typed.TypedTerm System.Command -> Typed.TypedTerm (Maybe File.FilePath)+commandWorkingDirectory x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.system.Command"),+ Model.projectionFieldName = (Model.Name "workingDirectory")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL constructor for the hydra.core.system.EnvironmentVariable wrapper+environmentVariable :: Typed.TypedTerm String -> Typed.TypedTerm System.EnvironmentVariable+environmentVariable x =+ Typed.TypedTerm (Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.Name "hydra.core.system.EnvironmentVariable"),+ Model.wrappedTermBody = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.system.EnvironmentVariable+environmentVariableEnvironmentVariable :: Typed.TypedName System.EnvironmentVariable+environmentVariableEnvironmentVariable = Typed.TypedName (Model.Name "hydra.core.system.EnvironmentVariable")++-- | DSL constructor for hydra.core.system.ProcessResult+processResult :: Typed.TypedTerm System.StatusCode -> Typed.TypedTerm B.ByteString -> Typed.TypedTerm B.ByteString -> Typed.TypedTerm System.ProcessResult+processResult exitCode stdout stderr =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.system.ProcessResult"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "exitCode"),+ Model.fieldTerm = (Typed.unTypedTerm exitCode)},+ Model.Field {+ Model.fieldName = (Model.Name "stdout"),+ Model.fieldTerm = (Typed.unTypedTerm stdout)},+ Model.Field {+ Model.fieldName = (Model.Name "stderr"),+ Model.fieldTerm = (Typed.unTypedTerm stderr)}]}))++-- | DSL accessor for the exitCode field of hydra.core.system.ProcessResult+processResultExitCode :: Typed.TypedTerm System.ProcessResult -> Typed.TypedTerm System.StatusCode+processResultExitCode x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.system.ProcessResult"),+ Model.projectionFieldName = (Model.Name "exitCode")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.system.ProcessResult+processResultProcessResult :: Typed.TypedName System.ProcessResult+processResultProcessResult = Typed.TypedName (Model.Name "hydra.core.system.ProcessResult")++-- | DSL accessor for the stderr field of hydra.core.system.ProcessResult+processResultStderr :: Typed.TypedTerm System.ProcessResult -> Typed.TypedTerm B.ByteString+processResultStderr x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.system.ProcessResult"),+ Model.projectionFieldName = (Model.Name "stderr")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the stdout field of hydra.core.system.ProcessResult+processResultStdout :: Typed.TypedTerm System.ProcessResult -> Typed.TypedTerm B.ByteString+processResultStdout x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.system.ProcessResult"),+ Model.projectionFieldName = (Model.Name "stdout")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL updater for the exitCode field of hydra.core.system.ProcessResult+processResultWithExitCode :: Typed.TypedTerm System.ProcessResult -> Typed.TypedTerm System.StatusCode -> Typed.TypedTerm System.ProcessResult+processResultWithExitCode original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.system.ProcessResult"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "exitCode"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "stdout"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.system.ProcessResult"),+ Model.projectionFieldName = (Model.Name "stdout")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "stderr"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.system.ProcessResult"),+ Model.projectionFieldName = (Model.Name "stderr")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the stderr field of hydra.core.system.ProcessResult+processResultWithStderr :: Typed.TypedTerm System.ProcessResult -> Typed.TypedTerm B.ByteString -> Typed.TypedTerm System.ProcessResult+processResultWithStderr original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.system.ProcessResult"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "exitCode"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.system.ProcessResult"),+ Model.projectionFieldName = (Model.Name "exitCode")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "stdout"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.system.ProcessResult"),+ Model.projectionFieldName = (Model.Name "stdout")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "stderr"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL updater for the stdout field of hydra.core.system.ProcessResult+processResultWithStdout :: Typed.TypedTerm System.ProcessResult -> Typed.TypedTerm B.ByteString -> Typed.TypedTerm System.ProcessResult+processResultWithStdout original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.system.ProcessResult"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "exitCode"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.system.ProcessResult"),+ Model.projectionFieldName = (Model.Name "exitCode")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "stdout"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "stderr"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.system.ProcessResult"),+ Model.projectionFieldName = (Model.Name "stderr")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL constructor for the hydra.core.system.StatusCode wrapper+statusCode :: Typed.TypedTerm Int -> Typed.TypedTerm System.StatusCode+statusCode x =+ Typed.TypedTerm (Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.Name "hydra.core.system.StatusCode"),+ Model.wrappedTermBody = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.system.StatusCode+statusCodeStatusCode :: Typed.TypedName System.StatusCode+statusCodeStatusCode = Typed.TypedName (Model.Name "hydra.core.system.StatusCode")++-- | DSL accessor for the body of hydra.core.system.EnvironmentVariable+unEnvironmentVariable :: Typed.TypedTerm System.EnvironmentVariable -> Typed.TypedTerm String+unEnvironmentVariable x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermUnwrap (Model.Name "hydra.core.system.EnvironmentVariable")),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the body of hydra.core.system.StatusCode+unStatusCode :: Typed.TypedTerm System.StatusCode -> Typed.TypedTerm Int+unStatusCode x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermUnwrap (Model.Name "hydra.core.system.StatusCode")),+ Model.applicationArgument = (Typed.unTypedTerm x)}))
@@ -0,0 +1,290 @@+-- Note: this is an automatically generated file. Do not edit.++-- | DSL functions for hydra.core.tabular++module Hydra.Core.Dsl.Tabular where++import qualified Hydra.Core.Decode.Tabular as DecodeTabular+import qualified Hydra.Core.Dsl.Model as DslModel+import qualified Hydra.Core.Dsl.Relational as DslRelational+import qualified Hydra.Core.Encode.Tabular as EncodeTabular+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Relational as Relational+import qualified Hydra.Core.Tabular as Tabular+import qualified Hydra.Core.Typed as Typed+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | DSL constructor for hydra.core.tabular.ColumnType+columnType :: Typed.TypedTerm Relational.ColumnName -> Typed.TypedTerm Model.Type -> Typed.TypedTerm Tabular.ColumnType+columnType name type_ =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.tabular.ColumnType"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Typed.unTypedTerm name)},+ Model.Field {+ Model.fieldName = (Model.Name "type"),+ Model.fieldTerm = (Typed.unTypedTerm type_)}]}))++-- | DSL name token for hydra.core.tabular.ColumnType+columnTypeColumnType :: Typed.TypedName Tabular.ColumnType+columnTypeColumnType = Typed.TypedName (Model.Name "hydra.core.tabular.ColumnType")++-- | DSL accessor for the name field of hydra.core.tabular.ColumnType+columnTypeName :: Typed.TypedTerm Tabular.ColumnType -> Typed.TypedTerm Relational.ColumnName+columnTypeName x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.tabular.ColumnType"),+ Model.projectionFieldName = (Model.Name "name")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the type field of hydra.core.tabular.ColumnType+columnTypeType :: Typed.TypedTerm Tabular.ColumnType -> Typed.TypedTerm Model.Type+columnTypeType x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.tabular.ColumnType"),+ Model.projectionFieldName = (Model.Name "type")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL updater for the name field of hydra.core.tabular.ColumnType+columnTypeWithName :: Typed.TypedTerm Tabular.ColumnType -> Typed.TypedTerm Relational.ColumnName -> Typed.TypedTerm Tabular.ColumnType+columnTypeWithName original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.tabular.ColumnType"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "type"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.tabular.ColumnType"),+ Model.projectionFieldName = (Model.Name "type")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the type field of hydra.core.tabular.ColumnType+columnTypeWithType :: Typed.TypedTerm Tabular.ColumnType -> Typed.TypedTerm Model.Type -> Typed.TypedTerm Tabular.ColumnType+columnTypeWithType original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.tabular.ColumnType"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.tabular.ColumnType"),+ Model.projectionFieldName = (Model.Name "name")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "type"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL constructor for the hydra.core.tabular.DataRow wrapper+dataRow :: Typed.TypedTerm [Maybe v] -> Typed.TypedTerm (Tabular.DataRow v)+dataRow x =+ Typed.TypedTerm (Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.Name "hydra.core.tabular.DataRow"),+ Model.wrappedTermBody = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.tabular.DataRow+dataRowDataRow :: Typed.TypedName (Tabular.DataRow v)+dataRowDataRow = Typed.TypedName (Model.Name "hydra.core.tabular.DataRow")++-- | DSL composition builder for the decoder of hydra.core.tabular.DataRow+decodeDataRow :: Typed.TypedTerm (Graph.Graph -> Model.Term -> Either Errors.DecodingError v) -> Typed.TypedTerm (Graph.Graph -> Model.Term -> Either Errors.DecodingError (Tabular.DataRow v))+decodeDataRow v =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.decode.tabular.dataRow")),+ Model.applicationArgument = (Typed.unTypedTerm v)}))++-- | DSL composition builder for the decoder of hydra.core.tabular.Table+decodeTable :: Typed.TypedTerm (Graph.Graph -> Model.Term -> Either Errors.DecodingError v) -> Typed.TypedTerm (Graph.Graph -> Model.Term -> Either Errors.DecodingError (Tabular.Table v))+decodeTable v =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.decode.tabular.table")),+ Model.applicationArgument = (Typed.unTypedTerm v)}))++-- | DSL composition builder for the encoder of hydra.core.tabular.DataRow+encodeDataRow :: Typed.TypedTerm (v -> Model.Term) -> Typed.TypedTerm (Tabular.DataRow v -> Model.Term)+encodeDataRow v =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.encode.tabular.dataRow")),+ Model.applicationArgument = (Typed.unTypedTerm v)}))++-- | DSL composition builder for the encoder of hydra.core.tabular.Table+encodeTable :: Typed.TypedTerm (v -> Model.Term) -> Typed.TypedTerm (Tabular.Table v -> Model.Term)+encodeTable v =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.encode.tabular.table")),+ Model.applicationArgument = (Typed.unTypedTerm v)}))++-- | DSL constructor for the hydra.core.tabular.HeaderRow wrapper+headerRow :: Typed.TypedTerm [String] -> Typed.TypedTerm Tabular.HeaderRow+headerRow x =+ Typed.TypedTerm (Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.Name "hydra.core.tabular.HeaderRow"),+ Model.wrappedTermBody = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.tabular.HeaderRow+headerRowHeaderRow :: Typed.TypedName Tabular.HeaderRow+headerRowHeaderRow = Typed.TypedName (Model.Name "hydra.core.tabular.HeaderRow")++-- | DSL constructor for hydra.core.tabular.Table+table :: Typed.TypedTerm (Maybe Tabular.HeaderRow) -> Typed.TypedTerm [Tabular.DataRow v] -> Typed.TypedTerm (Tabular.Table v)+table header data_ =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.tabular.Table"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "header"),+ Model.fieldTerm = (Typed.unTypedTerm header)},+ Model.Field {+ Model.fieldName = (Model.Name "data"),+ Model.fieldTerm = (Typed.unTypedTerm data_)}]}))++-- | DSL accessor for the data field of hydra.core.tabular.Table+tableData :: Typed.TypedTerm (Tabular.Table v) -> Typed.TypedTerm [Tabular.DataRow v]+tableData x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.tabular.Table"),+ Model.projectionFieldName = (Model.Name "data")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the header field of hydra.core.tabular.Table+tableHeader :: Typed.TypedTerm (Tabular.Table v) -> Typed.TypedTerm (Maybe Tabular.HeaderRow)+tableHeader x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.tabular.Table"),+ Model.projectionFieldName = (Model.Name "header")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.tabular.Table+tableTable :: Typed.TypedName (Tabular.Table v)+tableTable = Typed.TypedName (Model.Name "hydra.core.tabular.Table")++-- | DSL constructor for hydra.core.tabular.TableType+tableType :: Typed.TypedTerm Relational.RelationName -> Typed.TypedTerm [Tabular.ColumnType] -> Typed.TypedTerm Tabular.TableType+tableType name columns =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.tabular.TableType"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Typed.unTypedTerm name)},+ Model.Field {+ Model.fieldName = (Model.Name "columns"),+ Model.fieldTerm = (Typed.unTypedTerm columns)}]}))++-- | DSL accessor for the columns field of hydra.core.tabular.TableType+tableTypeColumns :: Typed.TypedTerm Tabular.TableType -> Typed.TypedTerm [Tabular.ColumnType]+tableTypeColumns x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.tabular.TableType"),+ Model.projectionFieldName = (Model.Name "columns")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the name field of hydra.core.tabular.TableType+tableTypeName :: Typed.TypedTerm Tabular.TableType -> Typed.TypedTerm Relational.RelationName+tableTypeName x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.tabular.TableType"),+ Model.projectionFieldName = (Model.Name "name")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.tabular.TableType+tableTypeTableType :: Typed.TypedName Tabular.TableType+tableTypeTableType = Typed.TypedName (Model.Name "hydra.core.tabular.TableType")++-- | DSL updater for the columns field of hydra.core.tabular.TableType+tableTypeWithColumns :: Typed.TypedTerm Tabular.TableType -> Typed.TypedTerm [Tabular.ColumnType] -> Typed.TypedTerm Tabular.TableType+tableTypeWithColumns original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.tabular.TableType"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.tabular.TableType"),+ Model.projectionFieldName = (Model.Name "name")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "columns"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL updater for the name field of hydra.core.tabular.TableType+tableTypeWithName :: Typed.TypedTerm Tabular.TableType -> Typed.TypedTerm Relational.RelationName -> Typed.TypedTerm Tabular.TableType+tableTypeWithName original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.tabular.TableType"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "columns"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.tabular.TableType"),+ Model.projectionFieldName = (Model.Name "columns")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the data field of hydra.core.tabular.Table+tableWithData :: Typed.TypedTerm (Tabular.Table v) -> Typed.TypedTerm [Tabular.DataRow v] -> Typed.TypedTerm (Tabular.Table v)+tableWithData original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.tabular.Table"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "header"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.tabular.Table"),+ Model.projectionFieldName = (Model.Name "header")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "data"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL updater for the header field of hydra.core.tabular.Table+tableWithHeader :: Typed.TypedTerm (Tabular.Table v) -> Typed.TypedTerm (Maybe Tabular.HeaderRow) -> Typed.TypedTerm (Tabular.Table v)+tableWithHeader original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.tabular.Table"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "header"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "data"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.tabular.Table"),+ Model.projectionFieldName = (Model.Name "data")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL accessor for the body of hydra.core.tabular.DataRow+unDataRow :: Typed.TypedTerm (Tabular.DataRow v) -> Typed.TypedTerm [Maybe v]+unDataRow x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermUnwrap (Model.Name "hydra.core.tabular.DataRow")),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the body of hydra.core.tabular.HeaderRow+unHeaderRow :: Typed.TypedTerm Tabular.HeaderRow -> Typed.TypedTerm [String]+unHeaderRow x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermUnwrap (Model.Name "hydra.core.tabular.HeaderRow")),+ Model.applicationArgument = (Typed.unTypedTerm x)}))
@@ -0,0 +1,177 @@+-- Note: this is an automatically generated file. Do not edit.++-- | DSL functions for hydra.core.test.transform++module Hydra.Core.Dsl.Test.Transform where++import qualified Hydra.Core.Ast as Ast+import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Diff as Diff+import qualified Hydra.Core.Docs as Docs+import qualified Hydra.Core.Dsl.Ast as DslAst+import qualified Hydra.Core.Dsl.Coders as DslCoders+import qualified Hydra.Core.Dsl.Diff as DslDiff+import qualified Hydra.Core.Dsl.Docs as DslDocs+import qualified Hydra.Core.Dsl.Error.Checking as ErrorChecking+import qualified Hydra.Core.Dsl.Error.File as DslErrorFile+import qualified Hydra.Core.Dsl.Error.Model as DslErrorModel+import qualified Hydra.Core.Dsl.Error.Packaging as DslErrorPackaging+import qualified Hydra.Core.Dsl.Error.System as DslErrorSystem+import qualified Hydra.Core.Dsl.Errors as DslErrors+import qualified Hydra.Core.Dsl.File as DslFile+import qualified Hydra.Core.Dsl.Formatting as DslFormatting+import qualified Hydra.Core.Dsl.Graph as DslGraph+import qualified Hydra.Core.Dsl.Json.Model as DslJsonModel+import qualified Hydra.Core.Dsl.Markdown as DslMarkdown+import qualified Hydra.Core.Dsl.Model as DslModel+import qualified Hydra.Core.Dsl.Packaging as DslPackaging+import qualified Hydra.Core.Dsl.Parsing as DslParsing+import qualified Hydra.Core.Dsl.Paths as DslPaths+import qualified Hydra.Core.Dsl.Query as DslQuery+import qualified Hydra.Core.Dsl.Regex as DslRegex+import qualified Hydra.Core.Dsl.Relational as DslRelational+import qualified Hydra.Core.Dsl.Sorting as DslSorting+import qualified Hydra.Core.Dsl.System as DslSystem+import qualified Hydra.Core.Dsl.Tabular as DslTabular+import qualified Hydra.Core.Dsl.Testing as DslTesting+import qualified Hydra.Core.Dsl.Time as DslTime+import qualified Hydra.Core.Dsl.Topology as DslTopology+import qualified Hydra.Core.Dsl.Typing as DslTyping+import qualified Hydra.Core.Dsl.Util as DslUtil+import qualified Hydra.Core.Dsl.Validation as DslValidation+import qualified Hydra.Core.Dsl.Variants as DslVariants+import qualified Hydra.Core.Error.Checking as Checking+import qualified Hydra.Core.Error.File as ErrorFile+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Error.Packaging as ErrorPackaging+import qualified Hydra.Core.Error.System as ErrorSystem+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Formatting as Formatting+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Json.Model as JsonModel+import qualified Hydra.Core.Markdown as Markdown+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Parsing as Parsing+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Query as Query+import qualified Hydra.Core.Regex as Regex+import qualified Hydra.Core.Relational as Relational+import qualified Hydra.Core.Sorting as Sorting+import qualified Hydra.Core.System as System+import qualified Hydra.Core.Tabular as Tabular+import qualified Hydra.Core.Test.Transform as Transform+import qualified Hydra.Core.Testing as Testing+import qualified Hydra.Core.Time as Time+import qualified Hydra.Core.Topology as Topology+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Validation as Validation+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | DSL reference to hydra.core.test.transform.addGenerationPrefix+addGenerationPrefix :: Typed.TypedTerm Packaging.ModuleName -> Typed.TypedTerm Packaging.ModuleName+addGenerationPrefix arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.test.transform.addGenerationPrefix")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.test.transform.buildConvertCaseCall+buildConvertCaseCall :: Typed.TypedTerm Util.CaseConvention -> Typed.TypedTerm Util.CaseConvention -> Typed.TypedTerm String -> Typed.TypedTerm Model.Term+buildConvertCaseCall arg0 arg1 arg2 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.test.transform.buildConvertCaseCall")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)})),+ Model.applicationArgument = (Typed.unTypedTerm arg2)}))++-- | DSL reference to hydra.core.test.transform.buildTopologicalSortCall+buildTopologicalSortCall :: Typed.TypedTerm [(Int, [Int])] -> Typed.TypedTerm Model.Term+buildTopologicalSortCall arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.test.transform.buildTopologicalSortCall")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.test.transform.buildTopologicalSortSCCCall+buildTopologicalSortSCCCall :: Typed.TypedTerm [(Int, [Int])] -> Typed.TypedTerm Model.Term+buildTopologicalSortSCCCall arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.test.transform.buildTopologicalSortSCCCall")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.test.transform.collectTestCases+collectTestCases :: Typed.TypedTerm Testing.TestGroup -> Typed.TypedTerm [Testing.TestCaseWithMetadata]+collectTestCases arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.test.transform.collectTestCases")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.test.transform.encodeAdjacencyList+encodeAdjacencyList :: Typed.TypedTerm [(Int, [Int])] -> Typed.TypedTerm Model.Term+encodeAdjacencyList arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.test.transform.encodeAdjacencyList")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.test.transform.encodeCaseConvention+encodeCaseConvention :: Typed.TypedTerm Util.CaseConvention -> Typed.TypedTerm Model.Term+encodeCaseConvention arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.test.transform.encodeCaseConvention")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.test.transform.encodeEitherListList+encodeEitherListList :: Typed.TypedTerm (Either [[Int]] [Int]) -> Typed.TypedTerm Model.Term+encodeEitherListList arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.test.transform.encodeEitherListList")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.test.transform.encodeInt+encodeInt :: Typed.TypedTerm Int -> Typed.TypedTerm Model.Term+encodeInt arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.test.transform.encodeInt")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.test.transform.encodeIntList+encodeIntList :: Typed.TypedTerm [Int] -> Typed.TypedTerm Model.Term+encodeIntList arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.test.transform.encodeIntList")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.test.transform.encodeListList+encodeListList :: Typed.TypedTerm [[Int]] -> Typed.TypedTerm Model.Term+encodeListList arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.test.transform.encodeListList")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.test.transform.transformModule+transformModule :: Typed.TypedTerm Packaging.Module -> Typed.TypedTerm Packaging.Module+transformModule arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.test.transform.transformModule")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.test.transform.transformTestCase+transformTestCase :: Typed.TypedTerm t0 -> Typed.TypedTerm (Maybe t0)+transformTestCase arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.test.transform.transformTestCase")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.test.transform.transformToCompiledTests+transformToCompiledTests :: Typed.TypedTerm Testing.TestGroup -> Typed.TypedTerm (Maybe Testing.TestGroup)+transformToCompiledTests arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.test.transform.transformToCompiledTests")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))
@@ -0,0 +1,102 @@+-- Note: this is an automatically generated file. Do not edit.++-- | DSL functions for hydra.core.test.utils++module Hydra.Core.Dsl.Test.Utils where++import qualified Hydra.Core.Ast as Ast+import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Diff as Diff+import qualified Hydra.Core.Docs as Docs+import qualified Hydra.Core.Dsl.Ast as DslAst+import qualified Hydra.Core.Dsl.Coders as DslCoders+import qualified Hydra.Core.Dsl.Diff as DslDiff+import qualified Hydra.Core.Dsl.Docs as DslDocs+import qualified Hydra.Core.Dsl.Error.Checking as ErrorChecking+import qualified Hydra.Core.Dsl.Error.File as DslErrorFile+import qualified Hydra.Core.Dsl.Error.Model as DslErrorModel+import qualified Hydra.Core.Dsl.Error.Packaging as DslErrorPackaging+import qualified Hydra.Core.Dsl.Error.System as DslErrorSystem+import qualified Hydra.Core.Dsl.Errors as DslErrors+import qualified Hydra.Core.Dsl.File as DslFile+import qualified Hydra.Core.Dsl.Graph as DslGraph+import qualified Hydra.Core.Dsl.Json.Model as DslJsonModel+import qualified Hydra.Core.Dsl.Lexical as DslLexical+import qualified Hydra.Core.Dsl.Markdown as DslMarkdown+import qualified Hydra.Core.Dsl.Model as DslModel+import qualified Hydra.Core.Dsl.Packaging as DslPackaging+import qualified Hydra.Core.Dsl.Parsing as DslParsing+import qualified Hydra.Core.Dsl.Paths as DslPaths+import qualified Hydra.Core.Dsl.Query as DslQuery+import qualified Hydra.Core.Dsl.Regex as DslRegex+import qualified Hydra.Core.Dsl.Relational as DslRelational+import qualified Hydra.Core.Dsl.System as DslSystem+import qualified Hydra.Core.Dsl.Tabular as DslTabular+import qualified Hydra.Core.Dsl.Testing as DslTesting+import qualified Hydra.Core.Dsl.Time as DslTime+import qualified Hydra.Core.Dsl.Topology as DslTopology+import qualified Hydra.Core.Dsl.Typing as DslTyping+import qualified Hydra.Core.Dsl.Util as DslUtil+import qualified Hydra.Core.Dsl.Validation as DslValidation+import qualified Hydra.Core.Dsl.Variants as DslVariants+import qualified Hydra.Core.Error.Checking as Checking+import qualified Hydra.Core.Error.File as ErrorFile+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Error.Packaging as ErrorPackaging+import qualified Hydra.Core.Error.System as ErrorSystem+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Inference as Inference+import qualified Hydra.Core.Json.Model as JsonModel+import qualified Hydra.Core.Lexical as Lexical+import qualified Hydra.Core.Markdown as Markdown+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Parsing as Parsing+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Print.Errors as PrintErrors+import qualified Hydra.Core.Query as Query+import qualified Hydra.Core.Regex as Regex+import qualified Hydra.Core.Relational as Relational+import qualified Hydra.Core.System as System+import qualified Hydra.Core.Tabular as Tabular+import qualified Hydra.Core.Test.Utils as Utils+import qualified Hydra.Core.Testing as Testing+import qualified Hydra.Core.Time as Time+import qualified Hydra.Core.Topology as Topology+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Validation as Validation+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | DSL reference to hydra.core.test.utils.inferTerm+inferTerm :: Typed.TypedTerm Graph.Graph -> Typed.TypedTerm Model.Term -> Typed.TypedTerm (Either String Model.Term)+inferTerm arg0 arg1 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.test.utils.inferTerm")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)}))++-- | DSL reference to hydra.core.test.utils.inferTestCase+inferTestCase :: Typed.TypedTerm t0 -> Typed.TypedTerm Testing.TestCaseWithMetadata -> Typed.TypedTerm (Either t1 Testing.TestCaseWithMetadata)+inferTestCase arg0 arg1 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.test.utils.inferTestCase")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)}))++-- | DSL reference to hydra.core.test.utils.inferTestGroupTerms+inferTestGroupTerms :: Typed.TypedTerm t0 -> Typed.TypedTerm Testing.TestGroup -> Typed.TypedTerm (Either t1 Testing.TestGroup)+inferTestGroupTerms arg0 arg1 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.test.utils.inferTestGroupTerms")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)}))
@@ -0,0 +1,637 @@+-- Note: this is an automatically generated file. Do not edit.++-- | DSL functions for hydra.core.testing++module Hydra.Core.Dsl.Testing where++import qualified Hydra.Core.Decode.Testing as DecodeTesting+import qualified Hydra.Core.Dsl.Model as DslModel+import qualified Hydra.Core.Encode.Testing as EncodeTesting+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Testing as Testing+import qualified Hydra.Core.Typed as Typed+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | DSL constructor for hydra.core.testing.EffectfulTestCase+effectfulTestCase :: Typed.TypedTerm (() -> IO String) -> Typed.TypedTerm (() -> String) -> Typed.TypedTerm Testing.EffectfulTestCase+effectfulTestCase actual expected =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.testing.EffectfulTestCase"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "actual"),+ Model.fieldTerm = (Typed.unTypedTerm actual)},+ Model.Field {+ Model.fieldName = (Model.Name "expected"),+ Model.fieldTerm = (Typed.unTypedTerm expected)}]}))++-- | DSL accessor for the actual field of hydra.core.testing.EffectfulTestCase+effectfulTestCaseActual :: Typed.TypedTerm Testing.EffectfulTestCase -> Typed.TypedTerm (() -> IO String)+effectfulTestCaseActual x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.testing.EffectfulTestCase"),+ Model.projectionFieldName = (Model.Name "actual")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.testing.EffectfulTestCase+effectfulTestCaseEffectfulTestCase :: Typed.TypedName Testing.EffectfulTestCase+effectfulTestCaseEffectfulTestCase = Typed.TypedName (Model.Name "hydra.core.testing.EffectfulTestCase")++-- | DSL accessor for the expected field of hydra.core.testing.EffectfulTestCase+effectfulTestCaseExpected :: Typed.TypedTerm Testing.EffectfulTestCase -> Typed.TypedTerm (() -> String)+effectfulTestCaseExpected x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.testing.EffectfulTestCase"),+ Model.projectionFieldName = (Model.Name "expected")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL updater for the actual field of hydra.core.testing.EffectfulTestCase+effectfulTestCaseWithActual :: Typed.TypedTerm Testing.EffectfulTestCase -> Typed.TypedTerm (() -> IO String) -> Typed.TypedTerm Testing.EffectfulTestCase+effectfulTestCaseWithActual original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.testing.EffectfulTestCase"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "actual"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "expected"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.testing.EffectfulTestCase"),+ Model.projectionFieldName = (Model.Name "expected")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the expected field of hydra.core.testing.EffectfulTestCase+effectfulTestCaseWithExpected :: Typed.TypedTerm Testing.EffectfulTestCase -> Typed.TypedTerm (() -> String) -> Typed.TypedTerm Testing.EffectfulTestCase+effectfulTestCaseWithExpected original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.testing.EffectfulTestCase"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "actual"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.testing.EffectfulTestCase"),+ Model.projectionFieldName = (Model.Name "actual")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "expected"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL constructor for the hydra.core.testing.Tag wrapper+tag :: Typed.TypedTerm String -> Typed.TypedTerm Testing.Tag+tag x =+ Typed.TypedTerm (Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.Name "hydra.core.testing.Tag"),+ Model.wrappedTermBody = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.testing.Tag+tagTag :: Typed.TypedName Testing.Tag+tagTag = Typed.TypedName (Model.Name "hydra.core.testing.Tag")++-- | DSL injection for the effectful variant of hydra.core.testing.TestCase+testCaseEffectful :: Typed.TypedTerm Testing.EffectfulTestCase -> Typed.TypedTerm Testing.TestCase+testCaseEffectful x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.testing.TestCase"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "effectful"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL name token for hydra.core.testing.TestCase+testCaseTestCase :: Typed.TypedName Testing.TestCase+testCaseTestCase = Typed.TypedName (Model.Name "hydra.core.testing.TestCase")++-- | DSL injection for the universal variant of hydra.core.testing.TestCase+testCaseUniversal :: Typed.TypedTerm Testing.UniversalTestCase -> Typed.TypedTerm Testing.TestCase+testCaseUniversal x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.testing.TestCase"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "universal"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL constructor for hydra.core.testing.TestCaseWithMetadata+testCaseWithMetadata :: Typed.TypedTerm String -> Typed.TypedTerm Testing.TestCase -> Typed.TypedTerm (Maybe String) -> Typed.TypedTerm [Testing.Tag] -> Typed.TypedTerm [Model.Name] -> Typed.TypedTerm Testing.TestCaseWithMetadata+testCaseWithMetadata name case_ description tags provisions =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.testing.TestCaseWithMetadata"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Typed.unTypedTerm name)},+ Model.Field {+ Model.fieldName = (Model.Name "case"),+ Model.fieldTerm = (Typed.unTypedTerm case_)},+ Model.Field {+ Model.fieldName = (Model.Name "description"),+ Model.fieldTerm = (Typed.unTypedTerm description)},+ Model.Field {+ Model.fieldName = (Model.Name "tags"),+ Model.fieldTerm = (Typed.unTypedTerm tags)},+ Model.Field {+ Model.fieldName = (Model.Name "provisions"),+ Model.fieldTerm = (Typed.unTypedTerm provisions)}]}))++-- | DSL accessor for the case field of hydra.core.testing.TestCaseWithMetadata+testCaseWithMetadataCase :: Typed.TypedTerm Testing.TestCaseWithMetadata -> Typed.TypedTerm Testing.TestCase+testCaseWithMetadataCase x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.testing.TestCaseWithMetadata"),+ Model.projectionFieldName = (Model.Name "case")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the description field of hydra.core.testing.TestCaseWithMetadata+testCaseWithMetadataDescription :: Typed.TypedTerm Testing.TestCaseWithMetadata -> Typed.TypedTerm (Maybe String)+testCaseWithMetadataDescription x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.testing.TestCaseWithMetadata"),+ Model.projectionFieldName = (Model.Name "description")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the name field of hydra.core.testing.TestCaseWithMetadata+testCaseWithMetadataName :: Typed.TypedTerm Testing.TestCaseWithMetadata -> Typed.TypedTerm String+testCaseWithMetadataName x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.testing.TestCaseWithMetadata"),+ Model.projectionFieldName = (Model.Name "name")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the provisions field of hydra.core.testing.TestCaseWithMetadata+testCaseWithMetadataProvisions :: Typed.TypedTerm Testing.TestCaseWithMetadata -> Typed.TypedTerm [Model.Name]+testCaseWithMetadataProvisions x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.testing.TestCaseWithMetadata"),+ Model.projectionFieldName = (Model.Name "provisions")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the tags field of hydra.core.testing.TestCaseWithMetadata+testCaseWithMetadataTags :: Typed.TypedTerm Testing.TestCaseWithMetadata -> Typed.TypedTerm [Testing.Tag]+testCaseWithMetadataTags x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.testing.TestCaseWithMetadata"),+ Model.projectionFieldName = (Model.Name "tags")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.testing.TestCaseWithMetadata+testCaseWithMetadataTestCaseWithMetadata :: Typed.TypedName Testing.TestCaseWithMetadata+testCaseWithMetadataTestCaseWithMetadata = Typed.TypedName (Model.Name "hydra.core.testing.TestCaseWithMetadata")++-- | DSL updater for the case field of hydra.core.testing.TestCaseWithMetadata+testCaseWithMetadataWithCase :: Typed.TypedTerm Testing.TestCaseWithMetadata -> Typed.TypedTerm Testing.TestCase -> Typed.TypedTerm Testing.TestCaseWithMetadata+testCaseWithMetadataWithCase original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.testing.TestCaseWithMetadata"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.testing.TestCaseWithMetadata"),+ Model.projectionFieldName = (Model.Name "name")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "case"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "description"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.testing.TestCaseWithMetadata"),+ Model.projectionFieldName = (Model.Name "description")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "tags"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.testing.TestCaseWithMetadata"),+ Model.projectionFieldName = (Model.Name "tags")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "provisions"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.testing.TestCaseWithMetadata"),+ Model.projectionFieldName = (Model.Name "provisions")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the description field of hydra.core.testing.TestCaseWithMetadata+testCaseWithMetadataWithDescription :: Typed.TypedTerm Testing.TestCaseWithMetadata -> Typed.TypedTerm (Maybe String) -> Typed.TypedTerm Testing.TestCaseWithMetadata+testCaseWithMetadataWithDescription original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.testing.TestCaseWithMetadata"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.testing.TestCaseWithMetadata"),+ Model.projectionFieldName = (Model.Name "name")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "case"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.testing.TestCaseWithMetadata"),+ Model.projectionFieldName = (Model.Name "case")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "description"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "tags"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.testing.TestCaseWithMetadata"),+ Model.projectionFieldName = (Model.Name "tags")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "provisions"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.testing.TestCaseWithMetadata"),+ Model.projectionFieldName = (Model.Name "provisions")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the name field of hydra.core.testing.TestCaseWithMetadata+testCaseWithMetadataWithName :: Typed.TypedTerm Testing.TestCaseWithMetadata -> Typed.TypedTerm String -> Typed.TypedTerm Testing.TestCaseWithMetadata+testCaseWithMetadataWithName original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.testing.TestCaseWithMetadata"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "case"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.testing.TestCaseWithMetadata"),+ Model.projectionFieldName = (Model.Name "case")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "description"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.testing.TestCaseWithMetadata"),+ Model.projectionFieldName = (Model.Name "description")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "tags"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.testing.TestCaseWithMetadata"),+ Model.projectionFieldName = (Model.Name "tags")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "provisions"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.testing.TestCaseWithMetadata"),+ Model.projectionFieldName = (Model.Name "provisions")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the provisions field of hydra.core.testing.TestCaseWithMetadata+testCaseWithMetadataWithProvisions :: Typed.TypedTerm Testing.TestCaseWithMetadata -> Typed.TypedTerm [Model.Name] -> Typed.TypedTerm Testing.TestCaseWithMetadata+testCaseWithMetadataWithProvisions original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.testing.TestCaseWithMetadata"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.testing.TestCaseWithMetadata"),+ Model.projectionFieldName = (Model.Name "name")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "case"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.testing.TestCaseWithMetadata"),+ Model.projectionFieldName = (Model.Name "case")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "description"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.testing.TestCaseWithMetadata"),+ Model.projectionFieldName = (Model.Name "description")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "tags"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.testing.TestCaseWithMetadata"),+ Model.projectionFieldName = (Model.Name "tags")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "provisions"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL updater for the tags field of hydra.core.testing.TestCaseWithMetadata+testCaseWithMetadataWithTags :: Typed.TypedTerm Testing.TestCaseWithMetadata -> Typed.TypedTerm [Testing.Tag] -> Typed.TypedTerm Testing.TestCaseWithMetadata+testCaseWithMetadataWithTags original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.testing.TestCaseWithMetadata"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.testing.TestCaseWithMetadata"),+ Model.projectionFieldName = (Model.Name "name")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "case"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.testing.TestCaseWithMetadata"),+ Model.projectionFieldName = (Model.Name "case")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "description"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.testing.TestCaseWithMetadata"),+ Model.projectionFieldName = (Model.Name "description")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "tags"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "provisions"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.testing.TestCaseWithMetadata"),+ Model.projectionFieldName = (Model.Name "provisions")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL constructor for hydra.core.testing.TestGroup+testGroup :: Typed.TypedTerm String -> Typed.TypedTerm (Maybe String) -> Typed.TypedTerm [Testing.TestGroup] -> Typed.TypedTerm [Testing.TestCaseWithMetadata] -> Typed.TypedTerm Testing.TestGroup+testGroup name description subgroups cases =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.testing.TestGroup"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Typed.unTypedTerm name)},+ Model.Field {+ Model.fieldName = (Model.Name "description"),+ Model.fieldTerm = (Typed.unTypedTerm description)},+ Model.Field {+ Model.fieldName = (Model.Name "subgroups"),+ Model.fieldTerm = (Typed.unTypedTerm subgroups)},+ Model.Field {+ Model.fieldName = (Model.Name "cases"),+ Model.fieldTerm = (Typed.unTypedTerm cases)}]}))++-- | DSL accessor for the cases field of hydra.core.testing.TestGroup+testGroupCases :: Typed.TypedTerm Testing.TestGroup -> Typed.TypedTerm [Testing.TestCaseWithMetadata]+testGroupCases x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.testing.TestGroup"),+ Model.projectionFieldName = (Model.Name "cases")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the description field of hydra.core.testing.TestGroup+testGroupDescription :: Typed.TypedTerm Testing.TestGroup -> Typed.TypedTerm (Maybe String)+testGroupDescription x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.testing.TestGroup"),+ Model.projectionFieldName = (Model.Name "description")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the name field of hydra.core.testing.TestGroup+testGroupName :: Typed.TypedTerm Testing.TestGroup -> Typed.TypedTerm String+testGroupName x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.testing.TestGroup"),+ Model.projectionFieldName = (Model.Name "name")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the subgroups field of hydra.core.testing.TestGroup+testGroupSubgroups :: Typed.TypedTerm Testing.TestGroup -> Typed.TypedTerm [Testing.TestGroup]+testGroupSubgroups x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.testing.TestGroup"),+ Model.projectionFieldName = (Model.Name "subgroups")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.testing.TestGroup+testGroupTestGroup :: Typed.TypedName Testing.TestGroup+testGroupTestGroup = Typed.TypedName (Model.Name "hydra.core.testing.TestGroup")++-- | DSL updater for the cases field of hydra.core.testing.TestGroup+testGroupWithCases :: Typed.TypedTerm Testing.TestGroup -> Typed.TypedTerm [Testing.TestCaseWithMetadata] -> Typed.TypedTerm Testing.TestGroup+testGroupWithCases original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.testing.TestGroup"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.testing.TestGroup"),+ Model.projectionFieldName = (Model.Name "name")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "description"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.testing.TestGroup"),+ Model.projectionFieldName = (Model.Name "description")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "subgroups"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.testing.TestGroup"),+ Model.projectionFieldName = (Model.Name "subgroups")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "cases"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL updater for the description field of hydra.core.testing.TestGroup+testGroupWithDescription :: Typed.TypedTerm Testing.TestGroup -> Typed.TypedTerm (Maybe String) -> Typed.TypedTerm Testing.TestGroup+testGroupWithDescription original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.testing.TestGroup"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.testing.TestGroup"),+ Model.projectionFieldName = (Model.Name "name")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "description"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "subgroups"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.testing.TestGroup"),+ Model.projectionFieldName = (Model.Name "subgroups")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "cases"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.testing.TestGroup"),+ Model.projectionFieldName = (Model.Name "cases")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the name field of hydra.core.testing.TestGroup+testGroupWithName :: Typed.TypedTerm Testing.TestGroup -> Typed.TypedTerm String -> Typed.TypedTerm Testing.TestGroup+testGroupWithName original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.testing.TestGroup"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "description"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.testing.TestGroup"),+ Model.projectionFieldName = (Model.Name "description")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "subgroups"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.testing.TestGroup"),+ Model.projectionFieldName = (Model.Name "subgroups")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "cases"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.testing.TestGroup"),+ Model.projectionFieldName = (Model.Name "cases")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the subgroups field of hydra.core.testing.TestGroup+testGroupWithSubgroups :: Typed.TypedTerm Testing.TestGroup -> Typed.TypedTerm [Testing.TestGroup] -> Typed.TypedTerm Testing.TestGroup+testGroupWithSubgroups original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.testing.TestGroup"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.testing.TestGroup"),+ Model.projectionFieldName = (Model.Name "name")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "description"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.testing.TestGroup"),+ Model.projectionFieldName = (Model.Name "description")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "subgroups"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "cases"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.testing.TestGroup"),+ Model.projectionFieldName = (Model.Name "cases")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL accessor for the body of hydra.core.testing.Tag+unTag :: Typed.TypedTerm Testing.Tag -> Typed.TypedTerm String+unTag x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermUnwrap (Model.Name "hydra.core.testing.Tag")),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL constructor for hydra.core.testing.UniversalTestCase+universalTestCase :: Typed.TypedTerm (() -> String) -> Typed.TypedTerm (() -> String) -> Typed.TypedTerm Testing.UniversalTestCase+universalTestCase actual expected =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.testing.UniversalTestCase"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "actual"),+ Model.fieldTerm = (Typed.unTypedTerm actual)},+ Model.Field {+ Model.fieldName = (Model.Name "expected"),+ Model.fieldTerm = (Typed.unTypedTerm expected)}]}))++-- | DSL accessor for the actual field of hydra.core.testing.UniversalTestCase+universalTestCaseActual :: Typed.TypedTerm Testing.UniversalTestCase -> Typed.TypedTerm (() -> String)+universalTestCaseActual x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.testing.UniversalTestCase"),+ Model.projectionFieldName = (Model.Name "actual")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the expected field of hydra.core.testing.UniversalTestCase+universalTestCaseExpected :: Typed.TypedTerm Testing.UniversalTestCase -> Typed.TypedTerm (() -> String)+universalTestCaseExpected x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.testing.UniversalTestCase"),+ Model.projectionFieldName = (Model.Name "expected")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.testing.UniversalTestCase+universalTestCaseUniversalTestCase :: Typed.TypedName Testing.UniversalTestCase+universalTestCaseUniversalTestCase = Typed.TypedName (Model.Name "hydra.core.testing.UniversalTestCase")++-- | DSL updater for the actual field of hydra.core.testing.UniversalTestCase+universalTestCaseWithActual :: Typed.TypedTerm Testing.UniversalTestCase -> Typed.TypedTerm (() -> String) -> Typed.TypedTerm Testing.UniversalTestCase+universalTestCaseWithActual original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.testing.UniversalTestCase"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "actual"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "expected"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.testing.UniversalTestCase"),+ Model.projectionFieldName = (Model.Name "expected")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the expected field of hydra.core.testing.UniversalTestCase+universalTestCaseWithExpected :: Typed.TypedTerm Testing.UniversalTestCase -> Typed.TypedTerm (() -> String) -> Typed.TypedTerm Testing.UniversalTestCase+universalTestCaseWithExpected original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.testing.UniversalTestCase"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "actual"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.testing.UniversalTestCase"),+ Model.projectionFieldName = (Model.Name "actual")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "expected"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))
@@ -0,0 +1,85 @@+-- Note: this is an automatically generated file. Do not edit.++-- | DSL functions for hydra.core.time++module Hydra.Core.Dsl.Time where++import qualified Hydra.Core.Decode.Time as DecodeTime+import qualified Hydra.Core.Dsl.Model as DslModel+import qualified Hydra.Core.Encode.Time as EncodeTime+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Time as Time+import qualified Hydra.Core.Typed as Typed+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void+import qualified Data.Int as I++-- | DSL constructor for hydra.core.time.Timespec+timespec :: Typed.TypedTerm I.Int64 -> Typed.TypedTerm I.Int64 -> Typed.TypedTerm Time.Timespec+timespec seconds nanoseconds =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.time.Timespec"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "seconds"),+ Model.fieldTerm = (Typed.unTypedTerm seconds)},+ Model.Field {+ Model.fieldName = (Model.Name "nanoseconds"),+ Model.fieldTerm = (Typed.unTypedTerm nanoseconds)}]}))++-- | DSL accessor for the nanoseconds field of hydra.core.time.Timespec+timespecNanoseconds :: Typed.TypedTerm Time.Timespec -> Typed.TypedTerm I.Int64+timespecNanoseconds x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.time.Timespec"),+ Model.projectionFieldName = (Model.Name "nanoseconds")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the seconds field of hydra.core.time.Timespec+timespecSeconds :: Typed.TypedTerm Time.Timespec -> Typed.TypedTerm I.Int64+timespecSeconds x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.time.Timespec"),+ Model.projectionFieldName = (Model.Name "seconds")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.time.Timespec+timespecTimespec :: Typed.TypedName Time.Timespec+timespecTimespec = Typed.TypedName (Model.Name "hydra.core.time.Timespec")++-- | DSL updater for the nanoseconds field of hydra.core.time.Timespec+timespecWithNanoseconds :: Typed.TypedTerm Time.Timespec -> Typed.TypedTerm I.Int64 -> Typed.TypedTerm Time.Timespec+timespecWithNanoseconds original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.time.Timespec"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "seconds"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.time.Timespec"),+ Model.projectionFieldName = (Model.Name "seconds")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "nanoseconds"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL updater for the seconds field of hydra.core.time.Timespec+timespecWithSeconds :: Typed.TypedTerm Time.Timespec -> Typed.TypedTerm I.Int64 -> Typed.TypedTerm Time.Timespec+timespecWithSeconds original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.time.Timespec"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "seconds"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "nanoseconds"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.time.Timespec"),+ Model.projectionFieldName = (Model.Name "nanoseconds")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))
@@ -0,0 +1,455 @@+-- Note: this is an automatically generated file. Do not edit.++-- | DSL functions for hydra.core.topology++module Hydra.Core.Dsl.Topology where++import qualified Hydra.Core.Decode.Topology as DecodeTopology+import qualified Hydra.Core.Dsl.Model as DslModel+import qualified Hydra.Core.Encode.Topology as EncodeTopology+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Topology as Topology+import qualified Hydra.Core.Typed as Typed+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void+import qualified Data.Map as M+import qualified Data.Set as S++-- | DSL composition builder for the decoder of hydra.core.topology.OrderingIsomorphism+decodeOrderingIsomorphism :: Typed.TypedTerm (Graph.Graph -> Model.Term -> Either Errors.DecodingError a) -> Typed.TypedTerm (Graph.Graph -> Model.Term -> Either Errors.DecodingError (Topology.OrderingIsomorphism a))+decodeOrderingIsomorphism a =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.decode.topology.orderingIsomorphism")),+ Model.applicationArgument = (Typed.unTypedTerm a)}))++-- | DSL composition builder for the encoder of hydra.core.topology.OrderingIsomorphism+encodeOrderingIsomorphism :: Typed.TypedTerm (a -> Model.Term) -> Typed.TypedTerm (Topology.OrderingIsomorphism a -> Model.Term)+encodeOrderingIsomorphism a =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.encode.topology.orderingIsomorphism")),+ Model.applicationArgument = (Typed.unTypedTerm a)}))++-- | DSL constructor for hydra.core.topology.OrderingIsomorphism+orderingIsomorphism :: Typed.TypedTerm ([a] -> [a]) -> Typed.TypedTerm ([a] -> [a]) -> Typed.TypedTerm (Topology.OrderingIsomorphism a)+orderingIsomorphism encode decode =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.topology.OrderingIsomorphism"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "encode"),+ Model.fieldTerm = (Typed.unTypedTerm encode)},+ Model.Field {+ Model.fieldName = (Model.Name "decode"),+ Model.fieldTerm = (Typed.unTypedTerm decode)}]}))++-- | DSL accessor for the decode field of hydra.core.topology.OrderingIsomorphism+orderingIsomorphismDecode :: Typed.TypedTerm (Topology.OrderingIsomorphism a) -> Typed.TypedTerm ([a] -> [a])+orderingIsomorphismDecode x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.topology.OrderingIsomorphism"),+ Model.projectionFieldName = (Model.Name "decode")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the encode field of hydra.core.topology.OrderingIsomorphism+orderingIsomorphismEncode :: Typed.TypedTerm (Topology.OrderingIsomorphism a) -> Typed.TypedTerm ([a] -> [a])+orderingIsomorphismEncode x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.topology.OrderingIsomorphism"),+ Model.projectionFieldName = (Model.Name "encode")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.topology.OrderingIsomorphism+orderingIsomorphismOrderingIsomorphism :: Typed.TypedName (Topology.OrderingIsomorphism a)+orderingIsomorphismOrderingIsomorphism = Typed.TypedName (Model.Name "hydra.core.topology.OrderingIsomorphism")++-- | DSL updater for the decode field of hydra.core.topology.OrderingIsomorphism+orderingIsomorphismWithDecode :: Typed.TypedTerm (Topology.OrderingIsomorphism a) -> Typed.TypedTerm ([a] -> [a]) -> Typed.TypedTerm (Topology.OrderingIsomorphism a)+orderingIsomorphismWithDecode original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.topology.OrderingIsomorphism"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "encode"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.topology.OrderingIsomorphism"),+ Model.projectionFieldName = (Model.Name "encode")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "decode"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL updater for the encode field of hydra.core.topology.OrderingIsomorphism+orderingIsomorphismWithEncode :: Typed.TypedTerm (Topology.OrderingIsomorphism a) -> Typed.TypedTerm ([a] -> [a]) -> Typed.TypedTerm (Topology.OrderingIsomorphism a)+orderingIsomorphismWithEncode original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.topology.OrderingIsomorphism"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "encode"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "decode"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.topology.OrderingIsomorphism"),+ Model.projectionFieldName = (Model.Name "decode")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL constructor for hydra.core.topology.TarjanState+tarjanState :: Typed.TypedTerm Int -> Typed.TypedTerm (M.Map Topology.Vertex Int) -> Typed.TypedTerm (M.Map Topology.Vertex Int) -> Typed.TypedTerm [Topology.Vertex] -> Typed.TypedTerm (S.Set Topology.Vertex) -> Typed.TypedTerm [[Topology.Vertex]] -> Typed.TypedTerm Topology.TarjanState+tarjanState counter indices lowLinks stack onStack sccs =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.topology.TarjanState"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "counter"),+ Model.fieldTerm = (Typed.unTypedTerm counter)},+ Model.Field {+ Model.fieldName = (Model.Name "indices"),+ Model.fieldTerm = (Typed.unTypedTerm indices)},+ Model.Field {+ Model.fieldName = (Model.Name "lowLinks"),+ Model.fieldTerm = (Typed.unTypedTerm lowLinks)},+ Model.Field {+ Model.fieldName = (Model.Name "stack"),+ Model.fieldTerm = (Typed.unTypedTerm stack)},+ Model.Field {+ Model.fieldName = (Model.Name "onStack"),+ Model.fieldTerm = (Typed.unTypedTerm onStack)},+ Model.Field {+ Model.fieldName = (Model.Name "sccs"),+ Model.fieldTerm = (Typed.unTypedTerm sccs)}]}))++-- | DSL accessor for the counter field of hydra.core.topology.TarjanState+tarjanStateCounter :: Typed.TypedTerm Topology.TarjanState -> Typed.TypedTerm Int+tarjanStateCounter x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.topology.TarjanState"),+ Model.projectionFieldName = (Model.Name "counter")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the indices field of hydra.core.topology.TarjanState+tarjanStateIndices :: Typed.TypedTerm Topology.TarjanState -> Typed.TypedTerm (M.Map Topology.Vertex Int)+tarjanStateIndices x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.topology.TarjanState"),+ Model.projectionFieldName = (Model.Name "indices")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the lowLinks field of hydra.core.topology.TarjanState+tarjanStateLowLinks :: Typed.TypedTerm Topology.TarjanState -> Typed.TypedTerm (M.Map Topology.Vertex Int)+tarjanStateLowLinks x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.topology.TarjanState"),+ Model.projectionFieldName = (Model.Name "lowLinks")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the onStack field of hydra.core.topology.TarjanState+tarjanStateOnStack :: Typed.TypedTerm Topology.TarjanState -> Typed.TypedTerm (S.Set Topology.Vertex)+tarjanStateOnStack x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.topology.TarjanState"),+ Model.projectionFieldName = (Model.Name "onStack")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the sccs field of hydra.core.topology.TarjanState+tarjanStateSccs :: Typed.TypedTerm Topology.TarjanState -> Typed.TypedTerm [[Topology.Vertex]]+tarjanStateSccs x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.topology.TarjanState"),+ Model.projectionFieldName = (Model.Name "sccs")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the stack field of hydra.core.topology.TarjanState+tarjanStateStack :: Typed.TypedTerm Topology.TarjanState -> Typed.TypedTerm [Topology.Vertex]+tarjanStateStack x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.topology.TarjanState"),+ Model.projectionFieldName = (Model.Name "stack")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.topology.TarjanState+tarjanStateTarjanState :: Typed.TypedName Topology.TarjanState+tarjanStateTarjanState = Typed.TypedName (Model.Name "hydra.core.topology.TarjanState")++-- | DSL updater for the counter field of hydra.core.topology.TarjanState+tarjanStateWithCounter :: Typed.TypedTerm Topology.TarjanState -> Typed.TypedTerm Int -> Typed.TypedTerm Topology.TarjanState+tarjanStateWithCounter original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.topology.TarjanState"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "counter"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "indices"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.topology.TarjanState"),+ Model.projectionFieldName = (Model.Name "indices")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "lowLinks"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.topology.TarjanState"),+ Model.projectionFieldName = (Model.Name "lowLinks")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "stack"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.topology.TarjanState"),+ Model.projectionFieldName = (Model.Name "stack")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "onStack"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.topology.TarjanState"),+ Model.projectionFieldName = (Model.Name "onStack")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "sccs"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.topology.TarjanState"),+ Model.projectionFieldName = (Model.Name "sccs")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the indices field of hydra.core.topology.TarjanState+tarjanStateWithIndices :: Typed.TypedTerm Topology.TarjanState -> Typed.TypedTerm (M.Map Topology.Vertex Int) -> Typed.TypedTerm Topology.TarjanState+tarjanStateWithIndices original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.topology.TarjanState"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "counter"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.topology.TarjanState"),+ Model.projectionFieldName = (Model.Name "counter")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "indices"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "lowLinks"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.topology.TarjanState"),+ Model.projectionFieldName = (Model.Name "lowLinks")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "stack"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.topology.TarjanState"),+ Model.projectionFieldName = (Model.Name "stack")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "onStack"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.topology.TarjanState"),+ Model.projectionFieldName = (Model.Name "onStack")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "sccs"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.topology.TarjanState"),+ Model.projectionFieldName = (Model.Name "sccs")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the lowLinks field of hydra.core.topology.TarjanState+tarjanStateWithLowLinks :: Typed.TypedTerm Topology.TarjanState -> Typed.TypedTerm (M.Map Topology.Vertex Int) -> Typed.TypedTerm Topology.TarjanState+tarjanStateWithLowLinks original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.topology.TarjanState"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "counter"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.topology.TarjanState"),+ Model.projectionFieldName = (Model.Name "counter")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "indices"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.topology.TarjanState"),+ Model.projectionFieldName = (Model.Name "indices")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "lowLinks"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "stack"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.topology.TarjanState"),+ Model.projectionFieldName = (Model.Name "stack")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "onStack"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.topology.TarjanState"),+ Model.projectionFieldName = (Model.Name "onStack")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "sccs"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.topology.TarjanState"),+ Model.projectionFieldName = (Model.Name "sccs")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the onStack field of hydra.core.topology.TarjanState+tarjanStateWithOnStack :: Typed.TypedTerm Topology.TarjanState -> Typed.TypedTerm (S.Set Topology.Vertex) -> Typed.TypedTerm Topology.TarjanState+tarjanStateWithOnStack original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.topology.TarjanState"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "counter"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.topology.TarjanState"),+ Model.projectionFieldName = (Model.Name "counter")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "indices"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.topology.TarjanState"),+ Model.projectionFieldName = (Model.Name "indices")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "lowLinks"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.topology.TarjanState"),+ Model.projectionFieldName = (Model.Name "lowLinks")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "stack"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.topology.TarjanState"),+ Model.projectionFieldName = (Model.Name "stack")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "onStack"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "sccs"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.topology.TarjanState"),+ Model.projectionFieldName = (Model.Name "sccs")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the sccs field of hydra.core.topology.TarjanState+tarjanStateWithSccs :: Typed.TypedTerm Topology.TarjanState -> Typed.TypedTerm [[Topology.Vertex]] -> Typed.TypedTerm Topology.TarjanState+tarjanStateWithSccs original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.topology.TarjanState"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "counter"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.topology.TarjanState"),+ Model.projectionFieldName = (Model.Name "counter")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "indices"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.topology.TarjanState"),+ Model.projectionFieldName = (Model.Name "indices")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "lowLinks"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.topology.TarjanState"),+ Model.projectionFieldName = (Model.Name "lowLinks")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "stack"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.topology.TarjanState"),+ Model.projectionFieldName = (Model.Name "stack")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "onStack"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.topology.TarjanState"),+ Model.projectionFieldName = (Model.Name "onStack")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "sccs"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL updater for the stack field of hydra.core.topology.TarjanState+tarjanStateWithStack :: Typed.TypedTerm Topology.TarjanState -> Typed.TypedTerm [Topology.Vertex] -> Typed.TypedTerm Topology.TarjanState+tarjanStateWithStack original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.topology.TarjanState"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "counter"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.topology.TarjanState"),+ Model.projectionFieldName = (Model.Name "counter")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "indices"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.topology.TarjanState"),+ Model.projectionFieldName = (Model.Name "indices")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "lowLinks"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.topology.TarjanState"),+ Model.projectionFieldName = (Model.Name "lowLinks")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "stack"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "onStack"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.topology.TarjanState"),+ Model.projectionFieldName = (Model.Name "onStack")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "sccs"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.topology.TarjanState"),+ Model.projectionFieldName = (Model.Name "sccs")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))
@@ -0,0 +1,1451 @@+-- Note: this is an automatically generated file. Do not edit.++-- | DSL functions for hydra.core.typing++module Hydra.Core.Dsl.Typing where++import qualified Hydra.Core.Decode.Typing as DecodeTyping+import qualified Hydra.Core.Dsl.Model as DslModel+import qualified Hydra.Core.Dsl.Paths as DslPaths+import qualified Hydra.Core.Encode.Typing as EncodeTyping+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void+import qualified Data.Map as M++-- | DSL composition builder for the decoder of hydra.core.typing.FunctionStructure+decodeFunctionStructure :: Typed.TypedTerm (Graph.Graph -> Model.Term -> Either Errors.DecodingError env) -> Typed.TypedTerm (Graph.Graph -> Model.Term -> Either Errors.DecodingError (Typing.FunctionStructure env))+decodeFunctionStructure env =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.decode.typing.functionStructure")),+ Model.applicationArgument = (Typed.unTypedTerm env)}))++-- | DSL composition builder for the encoder of hydra.core.typing.FunctionStructure+encodeFunctionStructure :: Typed.TypedTerm (env -> Model.Term) -> Typed.TypedTerm (Typing.FunctionStructure env -> Model.Term)+encodeFunctionStructure env =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.encode.typing.functionStructure")),+ Model.applicationArgument = (Typed.unTypedTerm env)}))++-- | DSL constructor for hydra.core.typing.FunctionStructure+functionStructure :: Typed.TypedTerm [Model.Name] -> Typed.TypedTerm [Model.Name] -> Typed.TypedTerm [Model.Binding] -> Typed.TypedTerm Model.Term -> Typed.TypedTerm [Model.Type] -> Typed.TypedTerm (Maybe Model.Type) -> Typed.TypedTerm env -> Typed.TypedTerm (Typing.FunctionStructure env)+functionStructure typeParams params bindings body domains codomain environment =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.typing.FunctionStructure"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "typeParams"),+ Model.fieldTerm = (Typed.unTypedTerm typeParams)},+ Model.Field {+ Model.fieldName = (Model.Name "params"),+ Model.fieldTerm = (Typed.unTypedTerm params)},+ Model.Field {+ Model.fieldName = (Model.Name "bindings"),+ Model.fieldTerm = (Typed.unTypedTerm bindings)},+ Model.Field {+ Model.fieldName = (Model.Name "body"),+ Model.fieldTerm = (Typed.unTypedTerm body)},+ Model.Field {+ Model.fieldName = (Model.Name "domains"),+ Model.fieldTerm = (Typed.unTypedTerm domains)},+ Model.Field {+ Model.fieldName = (Model.Name "codomain"),+ Model.fieldTerm = (Typed.unTypedTerm codomain)},+ Model.Field {+ Model.fieldName = (Model.Name "environment"),+ Model.fieldTerm = (Typed.unTypedTerm environment)}]}))++-- | DSL accessor for the bindings field of hydra.core.typing.FunctionStructure+functionStructureBindings :: Typed.TypedTerm (Typing.FunctionStructure env) -> Typed.TypedTerm [Model.Binding]+functionStructureBindings x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.typing.FunctionStructure"),+ Model.projectionFieldName = (Model.Name "bindings")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the body field of hydra.core.typing.FunctionStructure+functionStructureBody :: Typed.TypedTerm (Typing.FunctionStructure env) -> Typed.TypedTerm Model.Term+functionStructureBody x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.typing.FunctionStructure"),+ Model.projectionFieldName = (Model.Name "body")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the codomain field of hydra.core.typing.FunctionStructure+functionStructureCodomain :: Typed.TypedTerm (Typing.FunctionStructure env) -> Typed.TypedTerm (Maybe Model.Type)+functionStructureCodomain x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.typing.FunctionStructure"),+ Model.projectionFieldName = (Model.Name "codomain")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the domains field of hydra.core.typing.FunctionStructure+functionStructureDomains :: Typed.TypedTerm (Typing.FunctionStructure env) -> Typed.TypedTerm [Model.Type]+functionStructureDomains x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.typing.FunctionStructure"),+ Model.projectionFieldName = (Model.Name "domains")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the environment field of hydra.core.typing.FunctionStructure+functionStructureEnvironment :: Typed.TypedTerm (Typing.FunctionStructure env) -> Typed.TypedTerm env+functionStructureEnvironment x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.typing.FunctionStructure"),+ Model.projectionFieldName = (Model.Name "environment")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.typing.FunctionStructure+functionStructureFunctionStructure :: Typed.TypedName (Typing.FunctionStructure env)+functionStructureFunctionStructure = Typed.TypedName (Model.Name "hydra.core.typing.FunctionStructure")++-- | DSL accessor for the params field of hydra.core.typing.FunctionStructure+functionStructureParams :: Typed.TypedTerm (Typing.FunctionStructure env) -> Typed.TypedTerm [Model.Name]+functionStructureParams x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.typing.FunctionStructure"),+ Model.projectionFieldName = (Model.Name "params")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the typeParams field of hydra.core.typing.FunctionStructure+functionStructureTypeParams :: Typed.TypedTerm (Typing.FunctionStructure env) -> Typed.TypedTerm [Model.Name]+functionStructureTypeParams x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.typing.FunctionStructure"),+ Model.projectionFieldName = (Model.Name "typeParams")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL updater for the bindings field of hydra.core.typing.FunctionStructure+functionStructureWithBindings :: Typed.TypedTerm (Typing.FunctionStructure env) -> Typed.TypedTerm [Model.Binding] -> Typed.TypedTerm (Typing.FunctionStructure env)+functionStructureWithBindings original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.typing.FunctionStructure"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "typeParams"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.typing.FunctionStructure"),+ Model.projectionFieldName = (Model.Name "typeParams")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "params"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.typing.FunctionStructure"),+ Model.projectionFieldName = (Model.Name "params")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "bindings"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "body"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.typing.FunctionStructure"),+ Model.projectionFieldName = (Model.Name "body")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "domains"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.typing.FunctionStructure"),+ Model.projectionFieldName = (Model.Name "domains")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "codomain"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.typing.FunctionStructure"),+ Model.projectionFieldName = (Model.Name "codomain")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "environment"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.typing.FunctionStructure"),+ Model.projectionFieldName = (Model.Name "environment")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the body field of hydra.core.typing.FunctionStructure+functionStructureWithBody :: Typed.TypedTerm (Typing.FunctionStructure env) -> Typed.TypedTerm Model.Term -> Typed.TypedTerm (Typing.FunctionStructure env)+functionStructureWithBody original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.typing.FunctionStructure"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "typeParams"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.typing.FunctionStructure"),+ Model.projectionFieldName = (Model.Name "typeParams")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "params"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.typing.FunctionStructure"),+ Model.projectionFieldName = (Model.Name "params")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "bindings"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.typing.FunctionStructure"),+ Model.projectionFieldName = (Model.Name "bindings")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "body"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "domains"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.typing.FunctionStructure"),+ Model.projectionFieldName = (Model.Name "domains")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "codomain"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.typing.FunctionStructure"),+ Model.projectionFieldName = (Model.Name "codomain")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "environment"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.typing.FunctionStructure"),+ Model.projectionFieldName = (Model.Name "environment")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the codomain field of hydra.core.typing.FunctionStructure+functionStructureWithCodomain :: Typed.TypedTerm (Typing.FunctionStructure env) -> Typed.TypedTerm (Maybe Model.Type) -> Typed.TypedTerm (Typing.FunctionStructure env)+functionStructureWithCodomain original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.typing.FunctionStructure"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "typeParams"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.typing.FunctionStructure"),+ Model.projectionFieldName = (Model.Name "typeParams")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "params"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.typing.FunctionStructure"),+ Model.projectionFieldName = (Model.Name "params")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "bindings"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.typing.FunctionStructure"),+ Model.projectionFieldName = (Model.Name "bindings")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "body"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.typing.FunctionStructure"),+ Model.projectionFieldName = (Model.Name "body")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "domains"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.typing.FunctionStructure"),+ Model.projectionFieldName = (Model.Name "domains")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "codomain"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "environment"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.typing.FunctionStructure"),+ Model.projectionFieldName = (Model.Name "environment")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the domains field of hydra.core.typing.FunctionStructure+functionStructureWithDomains :: Typed.TypedTerm (Typing.FunctionStructure env) -> Typed.TypedTerm [Model.Type] -> Typed.TypedTerm (Typing.FunctionStructure env)+functionStructureWithDomains original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.typing.FunctionStructure"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "typeParams"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.typing.FunctionStructure"),+ Model.projectionFieldName = (Model.Name "typeParams")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "params"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.typing.FunctionStructure"),+ Model.projectionFieldName = (Model.Name "params")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "bindings"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.typing.FunctionStructure"),+ Model.projectionFieldName = (Model.Name "bindings")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "body"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.typing.FunctionStructure"),+ Model.projectionFieldName = (Model.Name "body")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "domains"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "codomain"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.typing.FunctionStructure"),+ Model.projectionFieldName = (Model.Name "codomain")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "environment"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.typing.FunctionStructure"),+ Model.projectionFieldName = (Model.Name "environment")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the environment field of hydra.core.typing.FunctionStructure+functionStructureWithEnvironment :: Typed.TypedTerm (Typing.FunctionStructure env) -> Typed.TypedTerm env -> Typed.TypedTerm (Typing.FunctionStructure env)+functionStructureWithEnvironment original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.typing.FunctionStructure"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "typeParams"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.typing.FunctionStructure"),+ Model.projectionFieldName = (Model.Name "typeParams")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "params"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.typing.FunctionStructure"),+ Model.projectionFieldName = (Model.Name "params")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "bindings"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.typing.FunctionStructure"),+ Model.projectionFieldName = (Model.Name "bindings")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "body"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.typing.FunctionStructure"),+ Model.projectionFieldName = (Model.Name "body")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "domains"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.typing.FunctionStructure"),+ Model.projectionFieldName = (Model.Name "domains")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "codomain"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.typing.FunctionStructure"),+ Model.projectionFieldName = (Model.Name "codomain")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "environment"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL updater for the params field of hydra.core.typing.FunctionStructure+functionStructureWithParams :: Typed.TypedTerm (Typing.FunctionStructure env) -> Typed.TypedTerm [Model.Name] -> Typed.TypedTerm (Typing.FunctionStructure env)+functionStructureWithParams original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.typing.FunctionStructure"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "typeParams"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.typing.FunctionStructure"),+ Model.projectionFieldName = (Model.Name "typeParams")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "params"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "bindings"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.typing.FunctionStructure"),+ Model.projectionFieldName = (Model.Name "bindings")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "body"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.typing.FunctionStructure"),+ Model.projectionFieldName = (Model.Name "body")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "domains"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.typing.FunctionStructure"),+ Model.projectionFieldName = (Model.Name "domains")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "codomain"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.typing.FunctionStructure"),+ Model.projectionFieldName = (Model.Name "codomain")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "environment"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.typing.FunctionStructure"),+ Model.projectionFieldName = (Model.Name "environment")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the typeParams field of hydra.core.typing.FunctionStructure+functionStructureWithTypeParams :: Typed.TypedTerm (Typing.FunctionStructure env) -> Typed.TypedTerm [Model.Name] -> Typed.TypedTerm (Typing.FunctionStructure env)+functionStructureWithTypeParams original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.typing.FunctionStructure"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "typeParams"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "params"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.typing.FunctionStructure"),+ Model.projectionFieldName = (Model.Name "params")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "bindings"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.typing.FunctionStructure"),+ Model.projectionFieldName = (Model.Name "bindings")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "body"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.typing.FunctionStructure"),+ Model.projectionFieldName = (Model.Name "body")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "domains"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.typing.FunctionStructure"),+ Model.projectionFieldName = (Model.Name "domains")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "codomain"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.typing.FunctionStructure"),+ Model.projectionFieldName = (Model.Name "codomain")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "environment"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.typing.FunctionStructure"),+ Model.projectionFieldName = (Model.Name "environment")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL constructor for hydra.core.typing.InferenceContext+inferenceContext :: Typed.TypedTerm Int -> Typed.TypedTerm [Paths.SubtermStep] -> Typed.TypedTerm Typing.InferenceContext+inferenceContext freshTypeVariableCount trace =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.typing.InferenceContext"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "freshTypeVariableCount"),+ Model.fieldTerm = (Typed.unTypedTerm freshTypeVariableCount)},+ Model.Field {+ Model.fieldName = (Model.Name "trace"),+ Model.fieldTerm = (Typed.unTypedTerm trace)}]}))++-- | DSL accessor for the freshTypeVariableCount field of hydra.core.typing.InferenceContext+inferenceContextFreshTypeVariableCount :: Typed.TypedTerm Typing.InferenceContext -> Typed.TypedTerm Int+inferenceContextFreshTypeVariableCount x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.typing.InferenceContext"),+ Model.projectionFieldName = (Model.Name "freshTypeVariableCount")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.typing.InferenceContext+inferenceContextInferenceContext :: Typed.TypedName Typing.InferenceContext+inferenceContextInferenceContext = Typed.TypedName (Model.Name "hydra.core.typing.InferenceContext")++-- | DSL accessor for the trace field of hydra.core.typing.InferenceContext+inferenceContextTrace :: Typed.TypedTerm Typing.InferenceContext -> Typed.TypedTerm [Paths.SubtermStep]+inferenceContextTrace x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.typing.InferenceContext"),+ Model.projectionFieldName = (Model.Name "trace")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL updater for the freshTypeVariableCount field of hydra.core.typing.InferenceContext+inferenceContextWithFreshTypeVariableCount :: Typed.TypedTerm Typing.InferenceContext -> Typed.TypedTerm Int -> Typed.TypedTerm Typing.InferenceContext+inferenceContextWithFreshTypeVariableCount original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.typing.InferenceContext"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "freshTypeVariableCount"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "trace"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.typing.InferenceContext"),+ Model.projectionFieldName = (Model.Name "trace")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the trace field of hydra.core.typing.InferenceContext+inferenceContextWithTrace :: Typed.TypedTerm Typing.InferenceContext -> Typed.TypedTerm [Paths.SubtermStep] -> Typed.TypedTerm Typing.InferenceContext+inferenceContextWithTrace original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.typing.InferenceContext"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "freshTypeVariableCount"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.typing.InferenceContext"),+ Model.projectionFieldName = (Model.Name "freshTypeVariableCount")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "trace"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL constructor for hydra.core.typing.InferenceResult+inferenceResult :: Typed.TypedTerm Model.Term -> Typed.TypedTerm Model.Type -> Typed.TypedTerm Typing.TypeSubst -> Typed.TypedTerm (M.Map Model.Name Model.TypeVariableConstraints) -> Typed.TypedTerm Typing.InferenceContext -> Typed.TypedTerm Typing.InferenceResult+inferenceResult term type_ subst classConstraints context =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.typing.InferenceResult"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "term"),+ Model.fieldTerm = (Typed.unTypedTerm term)},+ Model.Field {+ Model.fieldName = (Model.Name "type"),+ Model.fieldTerm = (Typed.unTypedTerm type_)},+ Model.Field {+ Model.fieldName = (Model.Name "subst"),+ Model.fieldTerm = (Typed.unTypedTerm subst)},+ Model.Field {+ Model.fieldName = (Model.Name "classConstraints"),+ Model.fieldTerm = (Typed.unTypedTerm classConstraints)},+ Model.Field {+ Model.fieldName = (Model.Name "context"),+ Model.fieldTerm = (Typed.unTypedTerm context)}]}))++-- | DSL accessor for the classConstraints field of hydra.core.typing.InferenceResult+inferenceResultClassConstraints :: Typed.TypedTerm Typing.InferenceResult -> Typed.TypedTerm (M.Map Model.Name Model.TypeVariableConstraints)+inferenceResultClassConstraints x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.typing.InferenceResult"),+ Model.projectionFieldName = (Model.Name "classConstraints")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the context field of hydra.core.typing.InferenceResult+inferenceResultContext :: Typed.TypedTerm Typing.InferenceResult -> Typed.TypedTerm Typing.InferenceContext+inferenceResultContext x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.typing.InferenceResult"),+ Model.projectionFieldName = (Model.Name "context")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.typing.InferenceResult+inferenceResultInferenceResult :: Typed.TypedName Typing.InferenceResult+inferenceResultInferenceResult = Typed.TypedName (Model.Name "hydra.core.typing.InferenceResult")++-- | DSL accessor for the subst field of hydra.core.typing.InferenceResult+inferenceResultSubst :: Typed.TypedTerm Typing.InferenceResult -> Typed.TypedTerm Typing.TypeSubst+inferenceResultSubst x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.typing.InferenceResult"),+ Model.projectionFieldName = (Model.Name "subst")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the term field of hydra.core.typing.InferenceResult+inferenceResultTerm :: Typed.TypedTerm Typing.InferenceResult -> Typed.TypedTerm Model.Term+inferenceResultTerm x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.typing.InferenceResult"),+ Model.projectionFieldName = (Model.Name "term")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the type field of hydra.core.typing.InferenceResult+inferenceResultType :: Typed.TypedTerm Typing.InferenceResult -> Typed.TypedTerm Model.Type+inferenceResultType x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.typing.InferenceResult"),+ Model.projectionFieldName = (Model.Name "type")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL updater for the classConstraints field of hydra.core.typing.InferenceResult+inferenceResultWithClassConstraints :: Typed.TypedTerm Typing.InferenceResult -> Typed.TypedTerm (M.Map Model.Name Model.TypeVariableConstraints) -> Typed.TypedTerm Typing.InferenceResult+inferenceResultWithClassConstraints original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.typing.InferenceResult"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "term"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.typing.InferenceResult"),+ Model.projectionFieldName = (Model.Name "term")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "type"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.typing.InferenceResult"),+ Model.projectionFieldName = (Model.Name "type")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "subst"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.typing.InferenceResult"),+ Model.projectionFieldName = (Model.Name "subst")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "classConstraints"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "context"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.typing.InferenceResult"),+ Model.projectionFieldName = (Model.Name "context")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the context field of hydra.core.typing.InferenceResult+inferenceResultWithContext :: Typed.TypedTerm Typing.InferenceResult -> Typed.TypedTerm Typing.InferenceContext -> Typed.TypedTerm Typing.InferenceResult+inferenceResultWithContext original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.typing.InferenceResult"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "term"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.typing.InferenceResult"),+ Model.projectionFieldName = (Model.Name "term")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "type"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.typing.InferenceResult"),+ Model.projectionFieldName = (Model.Name "type")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "subst"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.typing.InferenceResult"),+ Model.projectionFieldName = (Model.Name "subst")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "classConstraints"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.typing.InferenceResult"),+ Model.projectionFieldName = (Model.Name "classConstraints")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "context"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL updater for the subst field of hydra.core.typing.InferenceResult+inferenceResultWithSubst :: Typed.TypedTerm Typing.InferenceResult -> Typed.TypedTerm Typing.TypeSubst -> Typed.TypedTerm Typing.InferenceResult+inferenceResultWithSubst original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.typing.InferenceResult"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "term"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.typing.InferenceResult"),+ Model.projectionFieldName = (Model.Name "term")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "type"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.typing.InferenceResult"),+ Model.projectionFieldName = (Model.Name "type")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "subst"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "classConstraints"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.typing.InferenceResult"),+ Model.projectionFieldName = (Model.Name "classConstraints")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "context"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.typing.InferenceResult"),+ Model.projectionFieldName = (Model.Name "context")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the term field of hydra.core.typing.InferenceResult+inferenceResultWithTerm :: Typed.TypedTerm Typing.InferenceResult -> Typed.TypedTerm Model.Term -> Typed.TypedTerm Typing.InferenceResult+inferenceResultWithTerm original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.typing.InferenceResult"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "term"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "type"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.typing.InferenceResult"),+ Model.projectionFieldName = (Model.Name "type")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "subst"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.typing.InferenceResult"),+ Model.projectionFieldName = (Model.Name "subst")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "classConstraints"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.typing.InferenceResult"),+ Model.projectionFieldName = (Model.Name "classConstraints")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "context"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.typing.InferenceResult"),+ Model.projectionFieldName = (Model.Name "context")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the type field of hydra.core.typing.InferenceResult+inferenceResultWithType :: Typed.TypedTerm Typing.InferenceResult -> Typed.TypedTerm Model.Type -> Typed.TypedTerm Typing.InferenceResult+inferenceResultWithType original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.typing.InferenceResult"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "term"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.typing.InferenceResult"),+ Model.projectionFieldName = (Model.Name "term")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "type"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "subst"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.typing.InferenceResult"),+ Model.projectionFieldName = (Model.Name "subst")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "classConstraints"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.typing.InferenceResult"),+ Model.projectionFieldName = (Model.Name "classConstraints")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "context"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.typing.InferenceResult"),+ Model.projectionFieldName = (Model.Name "context")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL constructor for hydra.core.typing.Parameter+parameter :: Typed.TypedTerm Model.Name -> Typed.TypedTerm (Maybe String) -> Typed.TypedTerm Model.Type -> Typed.TypedTerm Bool -> Typed.TypedTerm Typing.Parameter+parameter name description type_ isLazy =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.typing.Parameter"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Typed.unTypedTerm name)},+ Model.Field {+ Model.fieldName = (Model.Name "description"),+ Model.fieldTerm = (Typed.unTypedTerm description)},+ Model.Field {+ Model.fieldName = (Model.Name "type"),+ Model.fieldTerm = (Typed.unTypedTerm type_)},+ Model.Field {+ Model.fieldName = (Model.Name "isLazy"),+ Model.fieldTerm = (Typed.unTypedTerm isLazy)}]}))++-- | DSL accessor for the description field of hydra.core.typing.Parameter+parameterDescription :: Typed.TypedTerm Typing.Parameter -> Typed.TypedTerm (Maybe String)+parameterDescription x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.typing.Parameter"),+ Model.projectionFieldName = (Model.Name "description")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the isLazy field of hydra.core.typing.Parameter+parameterIsLazy :: Typed.TypedTerm Typing.Parameter -> Typed.TypedTerm Bool+parameterIsLazy x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.typing.Parameter"),+ Model.projectionFieldName = (Model.Name "isLazy")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the name field of hydra.core.typing.Parameter+parameterName :: Typed.TypedTerm Typing.Parameter -> Typed.TypedTerm Model.Name+parameterName x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.typing.Parameter"),+ Model.projectionFieldName = (Model.Name "name")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.typing.Parameter+parameterParameter :: Typed.TypedName Typing.Parameter+parameterParameter = Typed.TypedName (Model.Name "hydra.core.typing.Parameter")++-- | DSL accessor for the type field of hydra.core.typing.Parameter+parameterType :: Typed.TypedTerm Typing.Parameter -> Typed.TypedTerm Model.Type+parameterType x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.typing.Parameter"),+ Model.projectionFieldName = (Model.Name "type")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL updater for the description field of hydra.core.typing.Parameter+parameterWithDescription :: Typed.TypedTerm Typing.Parameter -> Typed.TypedTerm (Maybe String) -> Typed.TypedTerm Typing.Parameter+parameterWithDescription original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.typing.Parameter"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.typing.Parameter"),+ Model.projectionFieldName = (Model.Name "name")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "description"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "type"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.typing.Parameter"),+ Model.projectionFieldName = (Model.Name "type")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "isLazy"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.typing.Parameter"),+ Model.projectionFieldName = (Model.Name "isLazy")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the isLazy field of hydra.core.typing.Parameter+parameterWithIsLazy :: Typed.TypedTerm Typing.Parameter -> Typed.TypedTerm Bool -> Typed.TypedTerm Typing.Parameter+parameterWithIsLazy original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.typing.Parameter"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.typing.Parameter"),+ Model.projectionFieldName = (Model.Name "name")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "description"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.typing.Parameter"),+ Model.projectionFieldName = (Model.Name "description")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "type"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.typing.Parameter"),+ Model.projectionFieldName = (Model.Name "type")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "isLazy"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL updater for the name field of hydra.core.typing.Parameter+parameterWithName :: Typed.TypedTerm Typing.Parameter -> Typed.TypedTerm Model.Name -> Typed.TypedTerm Typing.Parameter+parameterWithName original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.typing.Parameter"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "description"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.typing.Parameter"),+ Model.projectionFieldName = (Model.Name "description")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "type"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.typing.Parameter"),+ Model.projectionFieldName = (Model.Name "type")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "isLazy"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.typing.Parameter"),+ Model.projectionFieldName = (Model.Name "isLazy")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the type field of hydra.core.typing.Parameter+parameterWithType :: Typed.TypedTerm Typing.Parameter -> Typed.TypedTerm Model.Type -> Typed.TypedTerm Typing.Parameter+parameterWithType original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.typing.Parameter"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.typing.Parameter"),+ Model.projectionFieldName = (Model.Name "name")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "description"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.typing.Parameter"),+ Model.projectionFieldName = (Model.Name "description")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "type"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "isLazy"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.typing.Parameter"),+ Model.projectionFieldName = (Model.Name "isLazy")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL constructor for hydra.core.typing.Result+result :: Typed.TypedTerm (Maybe String) -> Typed.TypedTerm Model.Type -> Typed.TypedTerm Typing.Result+result description type_ =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.typing.Result"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "description"),+ Model.fieldTerm = (Typed.unTypedTerm description)},+ Model.Field {+ Model.fieldName = (Model.Name "type"),+ Model.fieldTerm = (Typed.unTypedTerm type_)}]}))++-- | DSL accessor for the description field of hydra.core.typing.Result+resultDescription :: Typed.TypedTerm Typing.Result -> Typed.TypedTerm (Maybe String)+resultDescription x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.typing.Result"),+ Model.projectionFieldName = (Model.Name "description")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.typing.Result+resultResult :: Typed.TypedName Typing.Result+resultResult = Typed.TypedName (Model.Name "hydra.core.typing.Result")++-- | DSL accessor for the type field of hydra.core.typing.Result+resultType :: Typed.TypedTerm Typing.Result -> Typed.TypedTerm Model.Type+resultType x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.typing.Result"),+ Model.projectionFieldName = (Model.Name "type")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL updater for the description field of hydra.core.typing.Result+resultWithDescription :: Typed.TypedTerm Typing.Result -> Typed.TypedTerm (Maybe String) -> Typed.TypedTerm Typing.Result+resultWithDescription original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.typing.Result"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "description"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "type"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.typing.Result"),+ Model.projectionFieldName = (Model.Name "type")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the type field of hydra.core.typing.Result+resultWithType :: Typed.TypedTerm Typing.Result -> Typed.TypedTerm Model.Type -> Typed.TypedTerm Typing.Result+resultWithType original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.typing.Result"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "description"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.typing.Result"),+ Model.projectionFieldName = (Model.Name "description")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "type"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL constructor for hydra.core.typing.TermSignature+termSignature :: Typed.TypedTerm [Typing.TypeParameter] -> Typed.TypedTerm [Typing.Parameter] -> Typed.TypedTerm Typing.Result -> Typed.TypedTerm Typing.TermSignature+termSignature typeParameters parameters result =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.typing.TermSignature"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "typeParameters"),+ Model.fieldTerm = (Typed.unTypedTerm typeParameters)},+ Model.Field {+ Model.fieldName = (Model.Name "parameters"),+ Model.fieldTerm = (Typed.unTypedTerm parameters)},+ Model.Field {+ Model.fieldName = (Model.Name "result"),+ Model.fieldTerm = (Typed.unTypedTerm result)}]}))++-- | DSL accessor for the parameters field of hydra.core.typing.TermSignature+termSignatureParameters :: Typed.TypedTerm Typing.TermSignature -> Typed.TypedTerm [Typing.Parameter]+termSignatureParameters x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.typing.TermSignature"),+ Model.projectionFieldName = (Model.Name "parameters")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the result field of hydra.core.typing.TermSignature+termSignatureResult :: Typed.TypedTerm Typing.TermSignature -> Typed.TypedTerm Typing.Result+termSignatureResult x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.typing.TermSignature"),+ Model.projectionFieldName = (Model.Name "result")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.typing.TermSignature+termSignatureTermSignature :: Typed.TypedName Typing.TermSignature+termSignatureTermSignature = Typed.TypedName (Model.Name "hydra.core.typing.TermSignature")++-- | DSL accessor for the typeParameters field of hydra.core.typing.TermSignature+termSignatureTypeParameters :: Typed.TypedTerm Typing.TermSignature -> Typed.TypedTerm [Typing.TypeParameter]+termSignatureTypeParameters x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.typing.TermSignature"),+ Model.projectionFieldName = (Model.Name "typeParameters")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL updater for the parameters field of hydra.core.typing.TermSignature+termSignatureWithParameters :: Typed.TypedTerm Typing.TermSignature -> Typed.TypedTerm [Typing.Parameter] -> Typed.TypedTerm Typing.TermSignature+termSignatureWithParameters original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.typing.TermSignature"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "typeParameters"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.typing.TermSignature"),+ Model.projectionFieldName = (Model.Name "typeParameters")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "parameters"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "result"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.typing.TermSignature"),+ Model.projectionFieldName = (Model.Name "result")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the result field of hydra.core.typing.TermSignature+termSignatureWithResult :: Typed.TypedTerm Typing.TermSignature -> Typed.TypedTerm Typing.Result -> Typed.TypedTerm Typing.TermSignature+termSignatureWithResult original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.typing.TermSignature"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "typeParameters"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.typing.TermSignature"),+ Model.projectionFieldName = (Model.Name "typeParameters")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "parameters"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.typing.TermSignature"),+ Model.projectionFieldName = (Model.Name "parameters")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "result"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL updater for the typeParameters field of hydra.core.typing.TermSignature+termSignatureWithTypeParameters :: Typed.TypedTerm Typing.TermSignature -> Typed.TypedTerm [Typing.TypeParameter] -> Typed.TypedTerm Typing.TermSignature+termSignatureWithTypeParameters original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.typing.TermSignature"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "typeParameters"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "parameters"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.typing.TermSignature"),+ Model.projectionFieldName = (Model.Name "parameters")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "result"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.typing.TermSignature"),+ Model.projectionFieldName = (Model.Name "result")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL constructor for the hydra.core.typing.TermSubst wrapper+termSubst :: Typed.TypedTerm (M.Map Model.Name Model.Term) -> Typed.TypedTerm Typing.TermSubst+termSubst x =+ Typed.TypedTerm (Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.Name "hydra.core.typing.TermSubst"),+ Model.wrappedTermBody = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.typing.TermSubst+termSubstTermSubst :: Typed.TypedName Typing.TermSubst+termSubstTermSubst = Typed.TypedName (Model.Name "hydra.core.typing.TermSubst")++-- | DSL constructor for hydra.core.typing.TypeClass+typeClass :: Typed.TypedTerm String -> Typed.TypedTerm Typing.TypeClass+typeClass description =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.typing.TypeClass"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "description"),+ Model.fieldTerm = (Typed.unTypedTerm description)}]}))++-- | DSL accessor for the description field of hydra.core.typing.TypeClass+typeClassDescription :: Typed.TypedTerm Typing.TypeClass -> Typed.TypedTerm String+typeClassDescription x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.typing.TypeClass"),+ Model.projectionFieldName = (Model.Name "description")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.typing.TypeClass+typeClassTypeClass :: Typed.TypedName Typing.TypeClass+typeClassTypeClass = Typed.TypedName (Model.Name "hydra.core.typing.TypeClass")++-- | DSL updater for the description field of hydra.core.typing.TypeClass+typeClassWithDescription :: Typed.TypedTerm Typing.TypeClass -> Typed.TypedTerm String -> Typed.TypedTerm Typing.TypeClass+typeClassWithDescription original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.typing.TypeClass"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "description"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL constructor for hydra.core.typing.TypeConstraint+typeConstraint :: Typed.TypedTerm Model.Type -> Typed.TypedTerm Model.Type -> Typed.TypedTerm String -> Typed.TypedTerm Typing.TypeConstraint+typeConstraint left right comment =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.typing.TypeConstraint"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "left"),+ Model.fieldTerm = (Typed.unTypedTerm left)},+ Model.Field {+ Model.fieldName = (Model.Name "right"),+ Model.fieldTerm = (Typed.unTypedTerm right)},+ Model.Field {+ Model.fieldName = (Model.Name "comment"),+ Model.fieldTerm = (Typed.unTypedTerm comment)}]}))++-- | DSL accessor for the comment field of hydra.core.typing.TypeConstraint+typeConstraintComment :: Typed.TypedTerm Typing.TypeConstraint -> Typed.TypedTerm String+typeConstraintComment x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.typing.TypeConstraint"),+ Model.projectionFieldName = (Model.Name "comment")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the left field of hydra.core.typing.TypeConstraint+typeConstraintLeft :: Typed.TypedTerm Typing.TypeConstraint -> Typed.TypedTerm Model.Type+typeConstraintLeft x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.typing.TypeConstraint"),+ Model.projectionFieldName = (Model.Name "left")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the right field of hydra.core.typing.TypeConstraint+typeConstraintRight :: Typed.TypedTerm Typing.TypeConstraint -> Typed.TypedTerm Model.Type+typeConstraintRight x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.typing.TypeConstraint"),+ Model.projectionFieldName = (Model.Name "right")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.typing.TypeConstraint+typeConstraintTypeConstraint :: Typed.TypedName Typing.TypeConstraint+typeConstraintTypeConstraint = Typed.TypedName (Model.Name "hydra.core.typing.TypeConstraint")++-- | DSL updater for the comment field of hydra.core.typing.TypeConstraint+typeConstraintWithComment :: Typed.TypedTerm Typing.TypeConstraint -> Typed.TypedTerm String -> Typed.TypedTerm Typing.TypeConstraint+typeConstraintWithComment original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.typing.TypeConstraint"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "left"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.typing.TypeConstraint"),+ Model.projectionFieldName = (Model.Name "left")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "right"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.typing.TypeConstraint"),+ Model.projectionFieldName = (Model.Name "right")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "comment"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL updater for the left field of hydra.core.typing.TypeConstraint+typeConstraintWithLeft :: Typed.TypedTerm Typing.TypeConstraint -> Typed.TypedTerm Model.Type -> Typed.TypedTerm Typing.TypeConstraint+typeConstraintWithLeft original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.typing.TypeConstraint"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "left"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "right"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.typing.TypeConstraint"),+ Model.projectionFieldName = (Model.Name "right")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "comment"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.typing.TypeConstraint"),+ Model.projectionFieldName = (Model.Name "comment")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the right field of hydra.core.typing.TypeConstraint+typeConstraintWithRight :: Typed.TypedTerm Typing.TypeConstraint -> Typed.TypedTerm Model.Type -> Typed.TypedTerm Typing.TypeConstraint+typeConstraintWithRight original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.typing.TypeConstraint"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "left"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.typing.TypeConstraint"),+ Model.projectionFieldName = (Model.Name "left")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "right"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "comment"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.typing.TypeConstraint"),+ Model.projectionFieldName = (Model.Name "comment")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL constructor for hydra.core.typing.TypeParameter+typeParameter :: Typed.TypedTerm Model.Name -> Typed.TypedTerm [Model.TypeClassConstraint] -> Typed.TypedTerm Typing.TypeParameter+typeParameter name constraints =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.typing.TypeParameter"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Typed.unTypedTerm name)},+ Model.Field {+ Model.fieldName = (Model.Name "constraints"),+ Model.fieldTerm = (Typed.unTypedTerm constraints)}]}))++-- | DSL accessor for the constraints field of hydra.core.typing.TypeParameter+typeParameterConstraints :: Typed.TypedTerm Typing.TypeParameter -> Typed.TypedTerm [Model.TypeClassConstraint]+typeParameterConstraints x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.typing.TypeParameter"),+ Model.projectionFieldName = (Model.Name "constraints")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the name field of hydra.core.typing.TypeParameter+typeParameterName :: Typed.TypedTerm Typing.TypeParameter -> Typed.TypedTerm Model.Name+typeParameterName x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.typing.TypeParameter"),+ Model.projectionFieldName = (Model.Name "name")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.typing.TypeParameter+typeParameterTypeParameter :: Typed.TypedName Typing.TypeParameter+typeParameterTypeParameter = Typed.TypedName (Model.Name "hydra.core.typing.TypeParameter")++-- | DSL updater for the constraints field of hydra.core.typing.TypeParameter+typeParameterWithConstraints :: Typed.TypedTerm Typing.TypeParameter -> Typed.TypedTerm [Model.TypeClassConstraint] -> Typed.TypedTerm Typing.TypeParameter+typeParameterWithConstraints original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.typing.TypeParameter"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.typing.TypeParameter"),+ Model.projectionFieldName = (Model.Name "name")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "constraints"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL updater for the name field of hydra.core.typing.TypeParameter+typeParameterWithName :: Typed.TypedTerm Typing.TypeParameter -> Typed.TypedTerm Model.Name -> Typed.TypedTerm Typing.TypeParameter+typeParameterWithName original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.typing.TypeParameter"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "constraints"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.typing.TypeParameter"),+ Model.projectionFieldName = (Model.Name "constraints")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL constructor for the hydra.core.typing.TypeSubst wrapper+typeSubst :: Typed.TypedTerm (M.Map Model.Name Model.Type) -> Typed.TypedTerm Typing.TypeSubst+typeSubst x =+ Typed.TypedTerm (Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.Name "hydra.core.typing.TypeSubst"),+ Model.wrappedTermBody = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.typing.TypeSubst+typeSubstTypeSubst :: Typed.TypedName Typing.TypeSubst+typeSubstTypeSubst = Typed.TypedName (Model.Name "hydra.core.typing.TypeSubst")++-- | DSL accessor for the body of hydra.core.typing.TermSubst+unTermSubst :: Typed.TypedTerm Typing.TermSubst -> Typed.TypedTerm (M.Map Model.Name Model.Term)+unTermSubst x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermUnwrap (Model.Name "hydra.core.typing.TermSubst")),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the body of hydra.core.typing.TypeSubst+unTypeSubst :: Typed.TypedTerm Typing.TypeSubst -> Typed.TypedTerm (M.Map Model.Name Model.Type)+unTypeSubst x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermUnwrap (Model.Name "hydra.core.typing.TypeSubst")),+ Model.applicationArgument = (Typed.unTypedTerm x)}))
@@ -0,0 +1,274 @@+-- Note: this is an automatically generated file. Do not edit.++-- | DSL functions for hydra.core.util++module Hydra.Core.Dsl.Util where++import qualified Hydra.Core.Decode.Util as DecodeUtil+import qualified Hydra.Core.Dsl.Model as DslModel+import qualified Hydra.Core.Dsl.Packaging as DslPackaging+import qualified Hydra.Core.Encode.Util as EncodeUtil+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Util as Util+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void+import qualified Data.Map as M++-- | DSL injection for the camel variant of hydra.core.util.CaseConvention+caseConventionCamel :: Typed.TypedTerm Util.CaseConvention+caseConventionCamel =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.util.CaseConvention"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "camel"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL name token for hydra.core.util.CaseConvention+caseConventionCaseConvention :: Typed.TypedName Util.CaseConvention+caseConventionCaseConvention = Typed.TypedName (Model.Name "hydra.core.util.CaseConvention")++-- | DSL injection for the lowerSnake variant of hydra.core.util.CaseConvention+caseConventionLowerSnake :: Typed.TypedTerm Util.CaseConvention+caseConventionLowerSnake =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.util.CaseConvention"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "lowerSnake"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL injection for the pascal variant of hydra.core.util.CaseConvention+caseConventionPascal :: Typed.TypedTerm Util.CaseConvention+caseConventionPascal =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.util.CaseConvention"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "pascal"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL injection for the upperDashed variant of hydra.core.util.CaseConvention+caseConventionUpperDashed :: Typed.TypedTerm Util.CaseConvention+caseConventionUpperDashed =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.util.CaseConvention"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "upperDashed"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL injection for the upperSnake variant of hydra.core.util.CaseConvention+caseConventionUpperSnake :: Typed.TypedTerm Util.CaseConvention+caseConventionUpperSnake =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.util.CaseConvention"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "upperSnake"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL name token for hydra.core.util.Comparison+comparisonComparison :: Typed.TypedName Util.Comparison+comparisonComparison = Typed.TypedName (Model.Name "hydra.core.util.Comparison")++-- | DSL injection for the equalTo variant of hydra.core.util.Comparison+comparisonEqualTo :: Typed.TypedTerm Util.Comparison+comparisonEqualTo =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.util.Comparison"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "equalTo"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL injection for the greaterThan variant of hydra.core.util.Comparison+comparisonGreaterThan :: Typed.TypedTerm Util.Comparison+comparisonGreaterThan =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.util.Comparison"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "greaterThan"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL injection for the lessThan variant of hydra.core.util.Comparison+comparisonLessThan :: Typed.TypedTerm Util.Comparison+comparisonLessThan =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.util.Comparison"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "lessThan"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL composition builder for the decoder of hydra.core.util.ModuleNames+decodeModuleNames :: Typed.TypedTerm (Graph.Graph -> Model.Term -> Either Errors.DecodingError n) -> Typed.TypedTerm (Graph.Graph -> Model.Term -> Either Errors.DecodingError (Util.ModuleNames n))+decodeModuleNames n =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.decode.util.moduleNames")),+ Model.applicationArgument = (Typed.unTypedTerm n)}))++-- | DSL composition builder for the encoder of hydra.core.util.ModuleNames+encodeModuleNames :: Typed.TypedTerm (n -> Model.Term) -> Typed.TypedTerm (Util.ModuleNames n -> Model.Term)+encodeModuleNames n =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.encode.util.moduleNames")),+ Model.applicationArgument = (Typed.unTypedTerm n)}))++-- | DSL constructor for hydra.core.util.ModuleNames+moduleNames :: Typed.TypedTerm (Packaging.ModuleName, n) -> Typed.TypedTerm (M.Map Packaging.ModuleName n) -> Typed.TypedTerm (Util.ModuleNames n)+moduleNames focus mapping =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.util.ModuleNames"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "focus"),+ Model.fieldTerm = (Typed.unTypedTerm focus)},+ Model.Field {+ Model.fieldName = (Model.Name "mapping"),+ Model.fieldTerm = (Typed.unTypedTerm mapping)}]}))++-- | DSL accessor for the focus field of hydra.core.util.ModuleNames+moduleNamesFocus :: Typed.TypedTerm (Util.ModuleNames n) -> Typed.TypedTerm (Packaging.ModuleName, n)+moduleNamesFocus x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.util.ModuleNames"),+ Model.projectionFieldName = (Model.Name "focus")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the mapping field of hydra.core.util.ModuleNames+moduleNamesMapping :: Typed.TypedTerm (Util.ModuleNames n) -> Typed.TypedTerm (M.Map Packaging.ModuleName n)+moduleNamesMapping x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.util.ModuleNames"),+ Model.projectionFieldName = (Model.Name "mapping")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.util.ModuleNames+moduleNamesModuleNames :: Typed.TypedName (Util.ModuleNames n)+moduleNamesModuleNames = Typed.TypedName (Model.Name "hydra.core.util.ModuleNames")++-- | DSL updater for the focus field of hydra.core.util.ModuleNames+moduleNamesWithFocus :: Typed.TypedTerm (Util.ModuleNames n) -> Typed.TypedTerm (Packaging.ModuleName, n) -> Typed.TypedTerm (Util.ModuleNames n)+moduleNamesWithFocus original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.util.ModuleNames"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "focus"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "mapping"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.util.ModuleNames"),+ Model.projectionFieldName = (Model.Name "mapping")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the mapping field of hydra.core.util.ModuleNames+moduleNamesWithMapping :: Typed.TypedTerm (Util.ModuleNames n) -> Typed.TypedTerm (M.Map Packaging.ModuleName n) -> Typed.TypedTerm (Util.ModuleNames n)+moduleNamesWithMapping original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.util.ModuleNames"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "focus"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.util.ModuleNames"),+ Model.projectionFieldName = (Model.Name "focus")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "mapping"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL injection for the arbitrary variant of hydra.core.util.Precision+precisionArbitrary :: Typed.TypedTerm Util.Precision+precisionArbitrary =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.util.Precision"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "arbitrary"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL injection for the bits variant of hydra.core.util.Precision+precisionBits :: Typed.TypedTerm Int -> Typed.TypedTerm Util.Precision+precisionBits x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.util.Precision"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "bits"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL name token for hydra.core.util.Precision+precisionPrecision :: Typed.TypedName Util.Precision+precisionPrecision = Typed.TypedName (Model.Name "hydra.core.util.Precision")++-- | DSL constructor for hydra.core.util.QualifiedName+qualifiedName :: Typed.TypedTerm (Maybe Packaging.ModuleName) -> Typed.TypedTerm String -> Typed.TypedTerm Util.QualifiedName+qualifiedName moduleName local =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.util.QualifiedName"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "moduleName"),+ Model.fieldTerm = (Typed.unTypedTerm moduleName)},+ Model.Field {+ Model.fieldName = (Model.Name "local"),+ Model.fieldTerm = (Typed.unTypedTerm local)}]}))++-- | DSL accessor for the local field of hydra.core.util.QualifiedName+qualifiedNameLocal :: Typed.TypedTerm Util.QualifiedName -> Typed.TypedTerm String+qualifiedNameLocal x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.util.QualifiedName"),+ Model.projectionFieldName = (Model.Name "local")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the moduleName field of hydra.core.util.QualifiedName+qualifiedNameModuleName :: Typed.TypedTerm Util.QualifiedName -> Typed.TypedTerm (Maybe Packaging.ModuleName)+qualifiedNameModuleName x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.util.QualifiedName"),+ Model.projectionFieldName = (Model.Name "moduleName")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.util.QualifiedName+qualifiedNameQualifiedName :: Typed.TypedName Util.QualifiedName+qualifiedNameQualifiedName = Typed.TypedName (Model.Name "hydra.core.util.QualifiedName")++-- | DSL updater for the local field of hydra.core.util.QualifiedName+qualifiedNameWithLocal :: Typed.TypedTerm Util.QualifiedName -> Typed.TypedTerm String -> Typed.TypedTerm Util.QualifiedName+qualifiedNameWithLocal original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.util.QualifiedName"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "moduleName"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.util.QualifiedName"),+ Model.projectionFieldName = (Model.Name "moduleName")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "local"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL updater for the moduleName field of hydra.core.util.QualifiedName+qualifiedNameWithModuleName :: Typed.TypedTerm Util.QualifiedName -> Typed.TypedTerm (Maybe Packaging.ModuleName) -> Typed.TypedTerm Util.QualifiedName+qualifiedNameWithModuleName original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.util.QualifiedName"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "moduleName"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "local"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.util.QualifiedName"),+ Model.projectionFieldName = (Model.Name "local")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))
@@ -0,0 +1,286 @@+-- Note: this is an automatically generated file. Do not edit.++-- | DSL functions for hydra.core.validation++module Hydra.Core.Dsl.Validation where++import qualified Hydra.Core.Decode.Validation as DecodeValidation+import qualified Hydra.Core.Dsl.Error.Model as DslErrorModel+import qualified Hydra.Core.Dsl.Model as DslModel+import qualified Hydra.Core.Encode.Validation as EncodeValidation+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Validation as Validation+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void+import qualified Data.Set as S++-- | DSL composition builder for the decoder of hydra.core.validation.ValidationResult+decodeValidationResult :: Typed.TypedTerm (Graph.Graph -> Model.Term -> Either Errors.DecodingError e) -> Typed.TypedTerm (Graph.Graph -> Model.Term -> Either Errors.DecodingError (Validation.ValidationResult e))+decodeValidationResult e =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.decode.validation.validationResult")),+ Model.applicationArgument = (Typed.unTypedTerm e)}))++-- | DSL composition builder for the encoder of hydra.core.validation.ValidationResult+encodeValidationResult :: Typed.TypedTerm (e -> Model.Term) -> Typed.TypedTerm (Validation.ValidationResult e -> Model.Term)+encodeValidationResult e =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.encode.validation.validationResult")),+ Model.applicationArgument = (Typed.unTypedTerm e)}))++-- | DSL constructor for hydra.core.validation.ValidationProfile+validationProfile :: Typed.TypedTerm (S.Set Model.Name) -> Typed.TypedTerm (S.Set Model.Name) -> Typed.TypedTerm Int -> Typed.TypedTerm Int -> Typed.TypedTerm Validation.ValidationProfile+validationProfile errorRules warningRules maxErrors maxWarnings =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.validation.ValidationProfile"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "errorRules"),+ Model.fieldTerm = (Typed.unTypedTerm errorRules)},+ Model.Field {+ Model.fieldName = (Model.Name "warningRules"),+ Model.fieldTerm = (Typed.unTypedTerm warningRules)},+ Model.Field {+ Model.fieldName = (Model.Name "maxErrors"),+ Model.fieldTerm = (Typed.unTypedTerm maxErrors)},+ Model.Field {+ Model.fieldName = (Model.Name "maxWarnings"),+ Model.fieldTerm = (Typed.unTypedTerm maxWarnings)}]}))++-- | DSL accessor for the errorRules field of hydra.core.validation.ValidationProfile+validationProfileErrorRules :: Typed.TypedTerm Validation.ValidationProfile -> Typed.TypedTerm (S.Set Model.Name)+validationProfileErrorRules x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.validation.ValidationProfile"),+ Model.projectionFieldName = (Model.Name "errorRules")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the maxErrors field of hydra.core.validation.ValidationProfile+validationProfileMaxErrors :: Typed.TypedTerm Validation.ValidationProfile -> Typed.TypedTerm Int+validationProfileMaxErrors x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.validation.ValidationProfile"),+ Model.projectionFieldName = (Model.Name "maxErrors")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL accessor for the maxWarnings field of hydra.core.validation.ValidationProfile+validationProfileMaxWarnings :: Typed.TypedTerm Validation.ValidationProfile -> Typed.TypedTerm Int+validationProfileMaxWarnings x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.validation.ValidationProfile"),+ Model.projectionFieldName = (Model.Name "maxWarnings")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.validation.ValidationProfile+validationProfileValidationProfile :: Typed.TypedName Validation.ValidationProfile+validationProfileValidationProfile = Typed.TypedName (Model.Name "hydra.core.validation.ValidationProfile")++-- | DSL accessor for the warningRules field of hydra.core.validation.ValidationProfile+validationProfileWarningRules :: Typed.TypedTerm Validation.ValidationProfile -> Typed.TypedTerm (S.Set Model.Name)+validationProfileWarningRules x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.validation.ValidationProfile"),+ Model.projectionFieldName = (Model.Name "warningRules")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL updater for the errorRules field of hydra.core.validation.ValidationProfile+validationProfileWithErrorRules :: Typed.TypedTerm Validation.ValidationProfile -> Typed.TypedTerm (S.Set Model.Name) -> Typed.TypedTerm Validation.ValidationProfile+validationProfileWithErrorRules original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.validation.ValidationProfile"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "errorRules"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "warningRules"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.validation.ValidationProfile"),+ Model.projectionFieldName = (Model.Name "warningRules")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "maxErrors"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.validation.ValidationProfile"),+ Model.projectionFieldName = (Model.Name "maxErrors")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "maxWarnings"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.validation.ValidationProfile"),+ Model.projectionFieldName = (Model.Name "maxWarnings")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the maxErrors field of hydra.core.validation.ValidationProfile+validationProfileWithMaxErrors :: Typed.TypedTerm Validation.ValidationProfile -> Typed.TypedTerm Int -> Typed.TypedTerm Validation.ValidationProfile+validationProfileWithMaxErrors original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.validation.ValidationProfile"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "errorRules"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.validation.ValidationProfile"),+ Model.projectionFieldName = (Model.Name "errorRules")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "warningRules"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.validation.ValidationProfile"),+ Model.projectionFieldName = (Model.Name "warningRules")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "maxErrors"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "maxWarnings"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.validation.ValidationProfile"),+ Model.projectionFieldName = (Model.Name "maxWarnings")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the maxWarnings field of hydra.core.validation.ValidationProfile+validationProfileWithMaxWarnings :: Typed.TypedTerm Validation.ValidationProfile -> Typed.TypedTerm Int -> Typed.TypedTerm Validation.ValidationProfile+validationProfileWithMaxWarnings original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.validation.ValidationProfile"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "errorRules"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.validation.ValidationProfile"),+ Model.projectionFieldName = (Model.Name "errorRules")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "warningRules"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.validation.ValidationProfile"),+ Model.projectionFieldName = (Model.Name "warningRules")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "maxErrors"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.validation.ValidationProfile"),+ Model.projectionFieldName = (Model.Name "maxErrors")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "maxWarnings"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL updater for the warningRules field of hydra.core.validation.ValidationProfile+validationProfileWithWarningRules :: Typed.TypedTerm Validation.ValidationProfile -> Typed.TypedTerm (S.Set Model.Name) -> Typed.TypedTerm Validation.ValidationProfile+validationProfileWithWarningRules original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.validation.ValidationProfile"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "errorRules"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.validation.ValidationProfile"),+ Model.projectionFieldName = (Model.Name "errorRules")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "warningRules"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "maxErrors"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.validation.ValidationProfile"),+ Model.projectionFieldName = (Model.Name "maxErrors")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "maxWarnings"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.validation.ValidationProfile"),+ Model.projectionFieldName = (Model.Name "maxWarnings")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL constructor for hydra.core.validation.ValidationResult+validationResult :: Typed.TypedTerm [e] -> Typed.TypedTerm [e] -> Typed.TypedTerm (Validation.ValidationResult e)+validationResult errors warnings =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.validation.ValidationResult"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "errors"),+ Model.fieldTerm = (Typed.unTypedTerm errors)},+ Model.Field {+ Model.fieldName = (Model.Name "warnings"),+ Model.fieldTerm = (Typed.unTypedTerm warnings)}]}))++-- | DSL accessor for the errors field of hydra.core.validation.ValidationResult+validationResultErrors :: Typed.TypedTerm (Validation.ValidationResult e) -> Typed.TypedTerm [e]+validationResultErrors x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.validation.ValidationResult"),+ Model.projectionFieldName = (Model.Name "errors")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.core.validation.ValidationResult+validationResultValidationResult :: Typed.TypedName (Validation.ValidationResult e)+validationResultValidationResult = Typed.TypedName (Model.Name "hydra.core.validation.ValidationResult")++-- | DSL accessor for the warnings field of hydra.core.validation.ValidationResult+validationResultWarnings :: Typed.TypedTerm (Validation.ValidationResult e) -> Typed.TypedTerm [e]+validationResultWarnings x =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.validation.ValidationResult"),+ Model.projectionFieldName = (Model.Name "warnings")})),+ Model.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL updater for the errors field of hydra.core.validation.ValidationResult+validationResultWithErrors :: Typed.TypedTerm (Validation.ValidationResult e) -> Typed.TypedTerm [e] -> Typed.TypedTerm (Validation.ValidationResult e)+validationResultWithErrors original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.validation.ValidationResult"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "errors"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)},+ Model.Field {+ Model.fieldName = (Model.Name "warnings"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.validation.ValidationResult"),+ Model.projectionFieldName = (Model.Name "warnings")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the warnings field of hydra.core.validation.ValidationResult+validationResultWithWarnings :: Typed.TypedTerm (Validation.ValidationResult e) -> Typed.TypedTerm [e] -> Typed.TypedTerm (Validation.ValidationResult e)+validationResultWithWarnings original newVal =+ Typed.TypedTerm (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.validation.ValidationResult"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "errors"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = (Model.Name "hydra.core.validation.ValidationResult"),+ Model.projectionFieldName = (Model.Name "errors")})),+ Model.applicationArgument = (Typed.unTypedTerm original)}))},+ Model.Field {+ Model.fieldName = (Model.Name "warnings"),+ Model.fieldTerm = (Typed.unTypedTerm newVal)}]}))
@@ -0,0 +1,200 @@+-- Note: this is an automatically generated file. Do not edit.++-- | DSL functions for hydra.core.variables++module Hydra.Core.Dsl.Variables where++import qualified Hydra.Core.Ast as Ast+import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Diff as Diff+import qualified Hydra.Core.Docs as Docs+import qualified Hydra.Core.Dsl.Ast as DslAst+import qualified Hydra.Core.Dsl.Coders as DslCoders+import qualified Hydra.Core.Dsl.Diff as DslDiff+import qualified Hydra.Core.Dsl.Docs as DslDocs+import qualified Hydra.Core.Dsl.Error.Checking as ErrorChecking+import qualified Hydra.Core.Dsl.Error.File as DslErrorFile+import qualified Hydra.Core.Dsl.Error.Model as DslErrorModel+import qualified Hydra.Core.Dsl.Error.Packaging as DslErrorPackaging+import qualified Hydra.Core.Dsl.Error.System as DslErrorSystem+import qualified Hydra.Core.Dsl.Errors as DslErrors+import qualified Hydra.Core.Dsl.File as DslFile+import qualified Hydra.Core.Dsl.Graph as DslGraph+import qualified Hydra.Core.Dsl.Json.Model as DslJsonModel+import qualified Hydra.Core.Dsl.Markdown as DslMarkdown+import qualified Hydra.Core.Dsl.Model as DslModel+import qualified Hydra.Core.Dsl.Names as DslNames+import qualified Hydra.Core.Dsl.Packaging as DslPackaging+import qualified Hydra.Core.Dsl.Parsing as DslParsing+import qualified Hydra.Core.Dsl.Paths as DslPaths+import qualified Hydra.Core.Dsl.Query as DslQuery+import qualified Hydra.Core.Dsl.Regex as DslRegex+import qualified Hydra.Core.Dsl.Relational as DslRelational+import qualified Hydra.Core.Dsl.Rewriting as DslRewriting+import qualified Hydra.Core.Dsl.System as DslSystem+import qualified Hydra.Core.Dsl.Tabular as DslTabular+import qualified Hydra.Core.Dsl.Testing as DslTesting+import qualified Hydra.Core.Dsl.Time as DslTime+import qualified Hydra.Core.Dsl.Topology as DslTopology+import qualified Hydra.Core.Dsl.Typing as DslTyping+import qualified Hydra.Core.Dsl.Util as DslUtil+import qualified Hydra.Core.Dsl.Validation as DslValidation+import qualified Hydra.Core.Dsl.Variants as DslVariants+import qualified Hydra.Core.Error.Checking as Checking+import qualified Hydra.Core.Error.File as ErrorFile+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Error.Packaging as ErrorPackaging+import qualified Hydra.Core.Error.System as ErrorSystem+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Json.Model as JsonModel+import qualified Hydra.Core.Markdown as Markdown+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Names as Names+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Parsing as Parsing+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Query as Query+import qualified Hydra.Core.Regex as Regex+import qualified Hydra.Core.Relational as Relational+import qualified Hydra.Core.Rewriting as Rewriting+import qualified Hydra.Core.System as System+import qualified Hydra.Core.Tabular as Tabular+import qualified Hydra.Core.Testing as Testing+import qualified Hydra.Core.Time as Time+import qualified Hydra.Core.Topology as Topology+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Validation as Validation+import qualified Hydra.Core.Variables as Variables+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void+import qualified Data.Map as M+import qualified Data.Set as S++-- | DSL reference to hydra.core.variables.freeTypeVariablesInTerm+freeTypeVariablesInTerm :: Typed.TypedTerm Model.Term -> Typed.TypedTerm (S.Set Model.Name)+freeTypeVariablesInTerm arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.variables.freeTypeVariablesInTerm")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.variables.freeVariablesInTerm+freeVariablesInTerm :: Typed.TypedTerm Model.Term -> Typed.TypedTerm (S.Set Model.Name)+freeVariablesInTerm arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.variables.freeVariablesInTerm")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.variables.freeVariablesInType+freeVariablesInType :: Typed.TypedTerm Model.Type -> Typed.TypedTerm (S.Set Model.Name)+freeVariablesInType arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.variables.freeVariablesInType")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.variables.freeVariablesInTypeOrdered+freeVariablesInTypeOrdered :: Typed.TypedTerm Model.Type -> Typed.TypedTerm [Model.Name]+freeVariablesInTypeOrdered arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.variables.freeVariablesInTypeOrdered")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.variables.freeVariablesInTypeScheme+freeVariablesInTypeScheme :: Typed.TypedTerm Model.TypeScheme -> Typed.TypedTerm (S.Set Model.Name)+freeVariablesInTypeScheme arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.variables.freeVariablesInTypeScheme")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.variables.freeVariablesInTypeSchemeSimple+freeVariablesInTypeSchemeSimple :: Typed.TypedTerm Model.TypeScheme -> Typed.TypedTerm (S.Set Model.Name)+freeVariablesInTypeSchemeSimple arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.variables.freeVariablesInTypeSchemeSimple")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.variables.freeVariablesInTypeSimple+freeVariablesInTypeSimple :: Typed.TypedTerm Model.Type -> Typed.TypedTerm (S.Set Model.Name)+freeVariablesInTypeSimple arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.variables.freeVariablesInTypeSimple")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.variables.isFreeVariableInTerm+isFreeVariableInTerm :: Typed.TypedTerm Model.Name -> Typed.TypedTerm Model.Term -> Typed.TypedTerm Bool+isFreeVariableInTerm arg0 arg1 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.variables.isFreeVariableInTerm")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)}))++-- | DSL reference to hydra.core.variables.normalizeTypeVariablesInTerm+normalizeTypeVariablesInTerm :: Typed.TypedTerm Model.Term -> Typed.TypedTerm Model.Term+normalizeTypeVariablesInTerm arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.variables.normalizeTypeVariablesInTerm")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.core.variables.replaceFreeTermVariable+replaceFreeTermVariable :: Typed.TypedTerm Model.Name -> Typed.TypedTerm Model.Term -> Typed.TypedTerm Model.Term -> Typed.TypedTerm Model.Term+replaceFreeTermVariable arg0 arg1 arg2 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.variables.replaceFreeTermVariable")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)})),+ Model.applicationArgument = (Typed.unTypedTerm arg2)}))++-- | DSL reference to hydra.core.variables.replaceFreeTypeVariable+replaceFreeTypeVariable :: Typed.TypedTerm Model.Name -> Typed.TypedTerm Model.Type -> Typed.TypedTerm Model.Type -> Typed.TypedTerm Model.Type+replaceFreeTypeVariable arg0 arg1 arg2 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.variables.replaceFreeTypeVariable")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)})),+ Model.applicationArgument = (Typed.unTypedTerm arg2)}))++-- | DSL reference to hydra.core.variables.substituteTypeVariables+substituteTypeVariables :: Typed.TypedTerm (M.Map Model.Name Model.Name) -> Typed.TypedTerm Model.Type -> Typed.TypedTerm Model.Type+substituteTypeVariables arg0 arg1 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.variables.substituteTypeVariables")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)}))++-- | DSL reference to hydra.core.variables.substituteVariable+substituteVariable :: Typed.TypedTerm Model.Name -> Typed.TypedTerm Model.Name -> Typed.TypedTerm Model.Term -> Typed.TypedTerm Model.Term+substituteVariable arg0 arg1 arg2 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.variables.substituteVariable")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)})),+ Model.applicationArgument = (Typed.unTypedTerm arg2)}))++-- | DSL reference to hydra.core.variables.substituteVariables+substituteVariables :: Typed.TypedTerm (M.Map Model.Name Model.Name) -> Typed.TypedTerm Model.Term -> Typed.TypedTerm Model.Term+substituteVariables arg0 arg1 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.variables.substituteVariables")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)})),+ Model.applicationArgument = (Typed.unTypedTerm arg1)}))++-- | DSL reference to hydra.core.variables.unshadowVariables+unshadowVariables :: Typed.TypedTerm Model.Term -> Typed.TypedTerm Model.Term+unshadowVariables arg0 =+ Typed.TypedTerm (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.variables.unshadowVariables")),+ Model.applicationArgument = (Typed.unTypedTerm arg0)}))
@@ -0,0 +1,432 @@+-- Note: this is an automatically generated file. Do not edit.++-- | DSL functions for hydra.core.variants++module Hydra.Core.Dsl.Variants where++import qualified Hydra.Core.Decode.Variants as DecodeVariants+import qualified Hydra.Core.Dsl.Model as DslModel+import qualified Hydra.Core.Encode.Variants as EncodeVariants+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | DSL injection for the binary variant of hydra.core.variants.LiteralVariant+literalVariantBinary :: Typed.TypedTerm Variants.LiteralVariant+literalVariantBinary =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.variants.LiteralVariant"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "binary"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL injection for the boolean variant of hydra.core.variants.LiteralVariant+literalVariantBoolean :: Typed.TypedTerm Variants.LiteralVariant+literalVariantBoolean =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.variants.LiteralVariant"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "boolean"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL injection for the decimal variant of hydra.core.variants.LiteralVariant+literalVariantDecimal :: Typed.TypedTerm Variants.LiteralVariant+literalVariantDecimal =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.variants.LiteralVariant"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "decimal"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL injection for the float variant of hydra.core.variants.LiteralVariant+literalVariantFloat :: Typed.TypedTerm Variants.LiteralVariant+literalVariantFloat =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.variants.LiteralVariant"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "float"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL injection for the integer variant of hydra.core.variants.LiteralVariant+literalVariantInteger :: Typed.TypedTerm Variants.LiteralVariant+literalVariantInteger =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.variants.LiteralVariant"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "integer"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL name token for hydra.core.variants.LiteralVariant+literalVariantLiteralVariant :: Typed.TypedName Variants.LiteralVariant+literalVariantLiteralVariant = Typed.TypedName (Model.Name "hydra.core.variants.LiteralVariant")++-- | DSL injection for the string variant of hydra.core.variants.LiteralVariant+literalVariantString :: Typed.TypedTerm Variants.LiteralVariant+literalVariantString =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.variants.LiteralVariant"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "string"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL injection for the annotated variant of hydra.core.variants.TermVariant+termVariantAnnotated :: Typed.TypedTerm Variants.TermVariant+termVariantAnnotated =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.variants.TermVariant"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "annotated"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL injection for the application variant of hydra.core.variants.TermVariant+termVariantApplication :: Typed.TypedTerm Variants.TermVariant+termVariantApplication =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.variants.TermVariant"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "application"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL injection for the cases variant of hydra.core.variants.TermVariant+termVariantCases :: Typed.TypedTerm Variants.TermVariant+termVariantCases =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.variants.TermVariant"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "cases"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL injection for the either variant of hydra.core.variants.TermVariant+termVariantEither :: Typed.TypedTerm Variants.TermVariant+termVariantEither =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.variants.TermVariant"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "either"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL injection for the inject variant of hydra.core.variants.TermVariant+termVariantInject :: Typed.TypedTerm Variants.TermVariant+termVariantInject =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.variants.TermVariant"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "inject"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL injection for the lambda variant of hydra.core.variants.TermVariant+termVariantLambda :: Typed.TypedTerm Variants.TermVariant+termVariantLambda =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.variants.TermVariant"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "lambda"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL injection for the let variant of hydra.core.variants.TermVariant+termVariantLet :: Typed.TypedTerm Variants.TermVariant+termVariantLet =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.variants.TermVariant"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "let"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL injection for the list variant of hydra.core.variants.TermVariant+termVariantList :: Typed.TypedTerm Variants.TermVariant+termVariantList =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.variants.TermVariant"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "list"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL injection for the literal variant of hydra.core.variants.TermVariant+termVariantLiteral :: Typed.TypedTerm Variants.TermVariant+termVariantLiteral =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.variants.TermVariant"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "literal"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL injection for the map variant of hydra.core.variants.TermVariant+termVariantMap :: Typed.TypedTerm Variants.TermVariant+termVariantMap =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.variants.TermVariant"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "map"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL injection for the optional variant of hydra.core.variants.TermVariant+termVariantOptional :: Typed.TypedTerm Variants.TermVariant+termVariantOptional =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.variants.TermVariant"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "optional"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL injection for the pair variant of hydra.core.variants.TermVariant+termVariantPair :: Typed.TypedTerm Variants.TermVariant+termVariantPair =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.variants.TermVariant"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "pair"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL injection for the project variant of hydra.core.variants.TermVariant+termVariantProject :: Typed.TypedTerm Variants.TermVariant+termVariantProject =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.variants.TermVariant"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "project"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL injection for the record variant of hydra.core.variants.TermVariant+termVariantRecord :: Typed.TypedTerm Variants.TermVariant+termVariantRecord =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.variants.TermVariant"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "record"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL injection for the set variant of hydra.core.variants.TermVariant+termVariantSet :: Typed.TypedTerm Variants.TermVariant+termVariantSet =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.variants.TermVariant"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "set"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL name token for hydra.core.variants.TermVariant+termVariantTermVariant :: Typed.TypedName Variants.TermVariant+termVariantTermVariant = Typed.TypedName (Model.Name "hydra.core.variants.TermVariant")++-- | DSL injection for the typeApplication variant of hydra.core.variants.TermVariant+termVariantTypeApplication :: Typed.TypedTerm Variants.TermVariant+termVariantTypeApplication =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.variants.TermVariant"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "typeApplication"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL injection for the typeLambda variant of hydra.core.variants.TermVariant+termVariantTypeLambda :: Typed.TypedTerm Variants.TermVariant+termVariantTypeLambda =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.variants.TermVariant"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "typeLambda"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL injection for the unit variant of hydra.core.variants.TermVariant+termVariantUnit :: Typed.TypedTerm Variants.TermVariant+termVariantUnit =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.variants.TermVariant"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "unit"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL injection for the unwrap variant of hydra.core.variants.TermVariant+termVariantUnwrap :: Typed.TypedTerm Variants.TermVariant+termVariantUnwrap =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.variants.TermVariant"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "unwrap"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL injection for the variable variant of hydra.core.variants.TermVariant+termVariantVariable :: Typed.TypedTerm Variants.TermVariant+termVariantVariable =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.variants.TermVariant"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "variable"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL injection for the wrap variant of hydra.core.variants.TermVariant+termVariantWrap :: Typed.TypedTerm Variants.TermVariant+termVariantWrap =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.variants.TermVariant"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "wrap"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL injection for the annotated variant of hydra.core.variants.TypeVariant+typeVariantAnnotated :: Typed.TypedTerm Variants.TypeVariant+typeVariantAnnotated =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.variants.TypeVariant"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "annotated"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL injection for the application variant of hydra.core.variants.TypeVariant+typeVariantApplication :: Typed.TypedTerm Variants.TypeVariant+typeVariantApplication =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.variants.TypeVariant"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "application"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL injection for the effect variant of hydra.core.variants.TypeVariant+typeVariantEffect :: Typed.TypedTerm Variants.TypeVariant+typeVariantEffect =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.variants.TypeVariant"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "effect"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL injection for the either variant of hydra.core.variants.TypeVariant+typeVariantEither :: Typed.TypedTerm Variants.TypeVariant+typeVariantEither =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.variants.TypeVariant"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "either"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL injection for the forall variant of hydra.core.variants.TypeVariant+typeVariantForall :: Typed.TypedTerm Variants.TypeVariant+typeVariantForall =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.variants.TypeVariant"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "forall"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL injection for the function variant of hydra.core.variants.TypeVariant+typeVariantFunction :: Typed.TypedTerm Variants.TypeVariant+typeVariantFunction =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.variants.TypeVariant"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "function"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL injection for the list variant of hydra.core.variants.TypeVariant+typeVariantList :: Typed.TypedTerm Variants.TypeVariant+typeVariantList =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.variants.TypeVariant"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "list"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL injection for the literal variant of hydra.core.variants.TypeVariant+typeVariantLiteral :: Typed.TypedTerm Variants.TypeVariant+typeVariantLiteral =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.variants.TypeVariant"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "literal"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL injection for the map variant of hydra.core.variants.TypeVariant+typeVariantMap :: Typed.TypedTerm Variants.TypeVariant+typeVariantMap =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.variants.TypeVariant"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "map"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL injection for the optional variant of hydra.core.variants.TypeVariant+typeVariantOptional :: Typed.TypedTerm Variants.TypeVariant+typeVariantOptional =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.variants.TypeVariant"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "optional"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL injection for the pair variant of hydra.core.variants.TypeVariant+typeVariantPair :: Typed.TypedTerm Variants.TypeVariant+typeVariantPair =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.variants.TypeVariant"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "pair"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL injection for the record variant of hydra.core.variants.TypeVariant+typeVariantRecord :: Typed.TypedTerm Variants.TypeVariant+typeVariantRecord =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.variants.TypeVariant"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "record"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL injection for the set variant of hydra.core.variants.TypeVariant+typeVariantSet :: Typed.TypedTerm Variants.TypeVariant+typeVariantSet =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.variants.TypeVariant"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "set"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL name token for hydra.core.variants.TypeVariant+typeVariantTypeVariant :: Typed.TypedName Variants.TypeVariant+typeVariantTypeVariant = Typed.TypedName (Model.Name "hydra.core.variants.TypeVariant")++-- | DSL injection for the union variant of hydra.core.variants.TypeVariant+typeVariantUnion :: Typed.TypedTerm Variants.TypeVariant+typeVariantUnion =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.variants.TypeVariant"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "union"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL injection for the unit variant of hydra.core.variants.TypeVariant+typeVariantUnit :: Typed.TypedTerm Variants.TypeVariant+typeVariantUnit =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.variants.TypeVariant"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "unit"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL injection for the variable variant of hydra.core.variants.TypeVariant+typeVariantVariable :: Typed.TypedTerm Variants.TypeVariant+typeVariantVariable =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.variants.TypeVariant"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "variable"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL injection for the void variant of hydra.core.variants.TypeVariant+typeVariantVoid :: Typed.TypedTerm Variants.TypeVariant+typeVariantVoid =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.variants.TypeVariant"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "void"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL injection for the wrap variant of hydra.core.variants.TypeVariant+typeVariantWrap :: Typed.TypedTerm Variants.TypeVariant+typeVariantWrap =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.variants.TypeVariant"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "wrap"),+ Model.fieldTerm = Model.TermUnit}}))
@@ -0,0 +1,105 @@+-- Note: this is an automatically generated file. Do not edit.++-- | DSL functions for hydra.core.yaml.model++module Hydra.Core.Dsl.Yaml.Model where++import qualified Hydra.Core.Decode.Yaml.Model as DecodeYamlModel+import qualified Hydra.Core.Dsl.Model as DslModel+import qualified Hydra.Core.Encode.Yaml.Model as EncodeYamlModel+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Yaml.Model as YamlModel+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void+import qualified Data.Map as M++-- | DSL injection for the mapping variant of hydra.core.yaml.model.Node+nodeMapping :: Typed.TypedTerm (M.Map YamlModel.Node YamlModel.Node) -> Typed.TypedTerm YamlModel.Node+nodeMapping x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.yaml.model.Node"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "mapping"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL name token for hydra.core.yaml.model.Node+nodeNode :: Typed.TypedName YamlModel.Node+nodeNode = Typed.TypedName (Model.Name "hydra.core.yaml.model.Node")++-- | DSL injection for the scalar variant of hydra.core.yaml.model.Node+nodeScalar :: Typed.TypedTerm YamlModel.Scalar -> Typed.TypedTerm YamlModel.Node+nodeScalar x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.yaml.model.Node"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "scalar"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the sequence variant of hydra.core.yaml.model.Node+nodeSequence :: Typed.TypedTerm [YamlModel.Node] -> Typed.TypedTerm YamlModel.Node+nodeSequence x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.yaml.model.Node"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "sequence"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the bool variant of hydra.core.yaml.model.Scalar+scalarBool :: Typed.TypedTerm Bool -> Typed.TypedTerm YamlModel.Scalar+scalarBool x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.yaml.model.Scalar"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "bool"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the decimal variant of hydra.core.yaml.model.Scalar+scalarDecimal :: Typed.TypedTerm Sci.Scientific -> Typed.TypedTerm YamlModel.Scalar+scalarDecimal x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.yaml.model.Scalar"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "decimal"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the float variant of hydra.core.yaml.model.Scalar+scalarFloat :: Typed.TypedTerm Double -> Typed.TypedTerm YamlModel.Scalar+scalarFloat x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.yaml.model.Scalar"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "float"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the int variant of hydra.core.yaml.model.Scalar+scalarInt :: Typed.TypedTerm Integer -> Typed.TypedTerm YamlModel.Scalar+scalarInt x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.yaml.model.Scalar"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "int"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the null variant of hydra.core.yaml.model.Scalar+scalarNull :: Typed.TypedTerm YamlModel.Scalar+scalarNull =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.yaml.model.Scalar"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "null"),+ Model.fieldTerm = Model.TermUnit}}))++-- | DSL name token for hydra.core.yaml.model.Scalar+scalarScalar :: Typed.TypedName YamlModel.Scalar+scalarScalar = Typed.TypedName (Model.Name "hydra.core.yaml.model.Scalar")++-- | DSL injection for the str variant of hydra.core.yaml.model.Scalar+scalarStr :: Typed.TypedTerm String -> Typed.TypedTerm YamlModel.Scalar+scalarStr x =+ Typed.TypedTerm (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.yaml.model.Scalar"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "str"),+ Model.fieldTerm = (Typed.unTypedTerm x)}}))
@@ -0,0 +1,924 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Functions for generating domain-specific DSL modules from type modules++module Hydra.Core.Dsls where++import qualified Hydra.Core.Annotations as Annotations+import qualified Hydra.Core.Ast as Ast+import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Constants as Constants+import qualified Hydra.Core.Decode.Model as DecodeModel+import qualified Hydra.Core.Diff as Diff+import qualified Hydra.Core.Docs as Docs+import qualified Hydra.Core.Encode.Model as EncodeModel+import qualified Hydra.Core.Error.Checking as Checking+import qualified Hydra.Core.Error.File as ErrorFile+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Error.Packaging as ErrorPackaging+import qualified Hydra.Core.Error.System as ErrorSystem+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Formatting as Formatting+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Json.Model as JsonModel+import qualified Hydra.Core.Lexical as Lexical+import qualified Hydra.Core.Overlay.Haskell.Lib.Eithers as Eithers+import qualified Hydra.Core.Overlay.Haskell.Lib.Equality as Equality+import qualified Hydra.Core.Overlay.Haskell.Lib.Lists as Lists+import qualified Hydra.Core.Overlay.Haskell.Lib.Logic as Logic+import qualified Hydra.Core.Overlay.Haskell.Lib.Maps as Maps+import qualified Hydra.Core.Overlay.Haskell.Lib.Optionals as Optionals+import qualified Hydra.Core.Overlay.Haskell.Lib.Pairs as Pairs+import qualified Hydra.Core.Overlay.Haskell.Lib.Sets as Sets+import qualified Hydra.Core.Overlay.Haskell.Lib.Strings as Strings+import qualified Hydra.Core.Markdown as Markdown+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Names as Names+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Parsing as Parsing+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Query as Query+import qualified Hydra.Core.Reflect as Reflect+import qualified Hydra.Core.Regex as Regex+import qualified Hydra.Core.Relational as Relational+import qualified Hydra.Core.Rewriting as Rewriting+import qualified Hydra.Core.Scoping as Scoping+import qualified Hydra.Core.Strip as Strip+import qualified Hydra.Core.System as System+import qualified Hydra.Core.Tabular as Tabular+import qualified Hydra.Core.Testing as Testing+import qualified Hydra.Core.Time as Time+import qualified Hydra.Core.Topology as Topology+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Validation as Validation+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | Collect forall type variable names from a type+collectForallVars :: Model.Type -> [Model.Name]+collectForallVars typ =+ case typ of+ Model.TypeAnnotated v0 -> collectForallVars (Model.annotatedTypeBody v0)+ Model.TypeForall v0 -> Lists.cons (Model.forallTypeParameter v0) (collectForallVars (Model.forallTypeBody v0))+ _ -> []++-- | Deduplicate bindings by appending numeric suffixes to duplicate names+deduplicateBindings :: [Model.Binding] -> [Model.Binding]+deduplicateBindings bindings =+ Lists.foldl (\acc -> \b ->+ let usedNames = Sets.fromList (Lists.map (\a -> Model.bindingName a) acc)+ uniqueName = Lexical.chooseUniqueName usedNames (Model.bindingName b)+ in (Lists.concat2 acc [+ Model.Binding {+ Model.bindingName = uniqueName,+ Model.bindingTerm = (Model.bindingTerm b),+ Model.bindingTypeScheme = (Model.bindingTypeScheme b)}])) [] bindings++-- | Generate a binding name for a DSL function from a type name+dslBindingName :: Model.Name -> Model.Name+dslBindingName = Names.derivedBindingName [+ "dsl"] False++-- | Generate a qualified DSL element name from a type name and local element name+dslDefinitionName :: Model.Name -> String -> Model.Name+dslDefinitionName = Names.derivedDefinitionName [+ "dsl"] False True++-- | Transform a source module into a DSL module+dslModule :: t0 -> Graph.Graph -> Packaging.Module -> Either Errors.Error (Maybe Packaging.Module)+dslModule cx graph mod =+ Eithers.bind (filterTypeBindings cx graph (Optionals.givens (Lists.map (\d -> case d of+ Packaging.DefinitionType v0 -> Just ((\name -> \typ ->+ let schemaTerm = Model.TermVariable (Model.Name "hydra.core.model.Type")+ dataTerm =+ Annotations.normalizeTermAnnotations (Model.TermAnnotated (Model.AnnotatedTerm {+ Model.annotatedTermBody = (EncodeModel.type_ typ),+ Model.annotatedTermAnnotation = (Annotations.wrapAnnotationMap (Maps.fromList [+ (Constants.keyType, schemaTerm)]))}))+ in Model.Binding {+ Model.bindingName = name,+ Model.bindingTerm = dataTerm,+ Model.bindingTypeScheme = (Just (Model.TypeScheme {+ Model.typeSchemeVariables = [],+ Model.typeSchemeBody = (Model.TypeVariable (Model.Name "hydra.core.model.Type")),+ Model.typeSchemeConstraints = Maps.empty}))}) (Packaging.typeDefinitionName v0) (Model.typeSchemeBody (Packaging.typeDefinitionBody v0)))+ _ -> Nothing) (Packaging.moduleDefinitions mod)))) (\typeBindings -> Eithers.bind (Eithers.mapList (\b -> Eithers.bimap (\_e -> Errors.ErrorDecoding _e) (\x -> x) (generateBindingsForType cx graph b)) typeBindings) (\typeDslBindings -> Eithers.bind (Eithers.mapList (\d -> generateRefBindings d) (Packaging.moduleDefinitions mod)) (\refDslBindings ->+ let allBindings = deduplicateBindings (Lists.concat2 (Lists.concat typeDslBindings) (Lists.concat refDslBindings))+ in (Logic.ifElse (Lists.isEmpty allBindings) (Right Nothing) (Right (Just (Packaging.Module {+ Packaging.moduleName = (dslModuleName (Packaging.moduleName mod)),+ Packaging.moduleMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just (Strings.concat [+ "DSL functions for ",+ (Packaging.unModuleName (Packaging.moduleName mod))])),+ Packaging.entityMetadataComments = [],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.moduleDependencies = (Lists.map (\ns -> Packaging.ModuleDependency {+ Packaging.moduleDependencyModule = ns,+ Packaging.moduleDependencyPackage = Nothing}) (Lists.distinct (Lists.concat2 [+ Packaging.moduleName mod,+ (Packaging.ModuleName "hydra.core.typed"),+ (Names.derivedModuleName [+ "encode"] True (Packaging.moduleName mod)),+ (Names.derivedModuleName [+ "decode"] True (Packaging.moduleName mod))] (Lists.concat2 (Lists.map (\dep -> Packaging.moduleDependencyModule dep) (Packaging.moduleDependencies mod)) (Lists.map dslModuleName (Lists.map (\dep -> Packaging.moduleDependencyModule dep) (Packaging.moduleDependencies mod))))))),+ Packaging.moduleDefinitions = (Lists.map (\b -> Packaging.DefinitionTerm (Packaging.TermDefinition {+ Packaging.termDefinitionName = (Model.bindingName b),+ Packaging.termDefinitionMetadata = Nothing,+ Packaging.termDefinitionSignature = (Optionals.map Scoping.typeSchemeToTermSignature (Model.bindingTypeScheme b)),+ Packaging.termDefinitionBody = (Model.bindingTerm b)})) allBindings)})))))))++-- | Generate a DSL module name from a source module name+dslModuleName :: Packaging.ModuleName -> Packaging.ModuleName+dslModuleName = Names.derivedModuleName [+ "dsl"] False++-- | Build a TypedTerm-wrapped TypeScheme (functions of phantom terms) from a TermSignature+dslSignatureTypeScheme :: Typing.TermSignature -> Model.TypeScheme+dslSignatureTypeScheme sig =++ let typeVars = Lists.map (\tp -> Typing.typeParameterName tp) (Typing.termSignatureTypeParameters sig)+ paramTypes = Lists.map (\p -> Typing.parameterType p) (Typing.termSignatureParameters sig)+ resultType = Typing.resultType (Typing.termSignatureResult sig)+ wrappedResult =+ Model.TypeApplication (Model.ApplicationType {+ Model.applicationTypeFunction = (Model.TypeVariable (Model.Name "hydra.core.typed.TypedTerm")),+ Model.applicationTypeArgument = resultType})+ funType =+ Lists.foldr (\paramType -> \acc -> Model.TypeFunction (Model.FunctionType {+ Model.functionTypeDomain = (Logic.ifElse ((\t -> case (Strip.deannotateType t) of+ Model.TypeApplication v0 -> case (Strip.deannotateType (Model.applicationTypeFunction v0)) of+ Model.TypeVariable v1 -> Equality.equal v1 (Model.Name "hydra.core.typed.TypedName")+ _ -> False+ _ -> False) (Strip.deannotateType paramType)) paramType (Model.TypeApplication (Model.ApplicationType {+ Model.applicationTypeFunction = (Model.TypeVariable (Model.Name "hydra.core.typed.TypedTerm")),+ Model.applicationTypeArgument = paramType}))),+ Model.functionTypeCodomain = acc})) wrappedResult paramTypes+ in Model.TypeScheme {+ Model.typeSchemeVariables = typeVars,+ Model.typeSchemeBody = funType,+ Model.typeSchemeConstraints = Maps.empty}++-- | Build a TypeScheme with TypedTerm-wrapped parameter and result types+dslTypeScheme :: Model.Type -> [Model.Type] -> Model.Type -> Model.TypeScheme+dslTypeScheme origType paramTypes resultType =++ let typeVars = collectForallVars origType+ wrappedResult =+ Model.TypeApplication (Model.ApplicationType {+ Model.applicationTypeFunction = (Model.TypeVariable (Model.Name "hydra.core.typed.TypedTerm")),+ Model.applicationTypeArgument = resultType})+ funType =+ Lists.foldr (\paramType -> \acc -> Model.TypeFunction (Model.FunctionType {+ Model.functionTypeDomain = (Model.TypeApplication (Model.ApplicationType {+ Model.applicationTypeFunction = (Model.TypeVariable (Model.Name "hydra.core.typed.TypedTerm")),+ Model.applicationTypeArgument = paramType})),+ Model.functionTypeCodomain = acc})) wrappedResult paramTypes+ in Model.TypeScheme {+ Model.typeSchemeVariables = typeVars,+ Model.typeSchemeBody = funType,+ Model.typeSchemeConstraints = Maps.empty}++-- | Filter bindings to only DSL-eligible type definitions+filterTypeBindings :: t0 -> t1 -> [Model.Binding] -> Either t2 [Model.Binding]+filterTypeBindings cx graph bindings =+ Eithers.map Optionals.givens (Eithers.mapList (isDslEligibleBinding cx graph) (Lists.filter Annotations.isNativeType bindings))++-- | Generate all DSL bindings for a type binding+generateBindingsForType :: t0 -> Graph.Graph -> Model.Binding -> Either Errors.DecodingError [Model.Binding]+generateBindingsForType cx graph b =++ let typeName = Model.bindingName b+ in (Eithers.bind (DecodeModel.type_ graph (Model.bindingTerm b)) (\rawType ->+ let typ = Strip.deannotateTypeParameters (Strip.deannotateType rawType)+ in (Right (case typ of+ Model.TypeRecord v0 -> Lists.concat [+ [+ generateTypeNameToken rawType typeName],+ (generateParametricRefBuilders rawType typeName),+ (generateRecordConstructor rawType typeName v0),+ (Lists.map (generateRecordAccessor rawType typeName) v0),+ (Lists.map (generateRecordWithUpdater rawType typeName v0) v0)]+ Model.TypeUnion v0 -> Lists.concat [+ [+ generateTypeNameToken rawType typeName],+ (generateParametricRefBuilders rawType typeName),+ (Lists.map (generateUnionInjector rawType typeName) v0)]+ Model.TypeWrap v0 -> Lists.concat [+ [+ generateTypeNameToken rawType typeName],+ (generateParametricRefBuilders rawType typeName),+ (generateWrappedTypeAccessors rawType typeName v0)]+ _ -> []))))++-- | Generate encode/decode composition builders for a parametric type definition+generateParametricRefBuilders :: Model.Type -> Model.Name -> [Model.Binding]+generateParametricRefBuilders origType typeName =++ let vars = collectForallVars origType+ in (Logic.ifElse (Lists.isEmpty vars) [] [++ let vars = collectForallVars origType+ localName = Names.localNameOf typeName+ builderLocalName =+ Strings.concat [+ "encode",+ localName]+ builderName = dslDefinitionName typeName builderLocalName+ refName = Names.derivedBindingName [+ "encode"] True typeName+ paramPairs =+ Lists.map (\v -> (+ Model.unName v,+ (Model.TypeApplication (Model.ApplicationType {+ Model.applicationTypeFunction = (Model.TypeVariable (Model.Name "hydra.core.typed.TypedTerm")),+ Model.applicationTypeArgument = (Model.TypeFunction (Model.FunctionType {+ Model.functionTypeDomain = (Model.TypeVariable v),+ Model.functionTypeCodomain = (Model.TypeVariable (Model.Name "hydra.core.model.Term"))}))})))) vars+ appBody =+ Lists.foldl (\acc -> \pp -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.Term"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "application"),+ Model.fieldTerm = (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.model.Application"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "function"),+ Model.fieldTerm = acc},+ Model.Field {+ Model.fieldName = (Model.Name "argument"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermUnwrap (Model.Name "hydra.core.typed.TypedTerm")),+ Model.applicationArgument = (Model.TermVariable (Model.Name (Pairs.first pp)))}))}]}))}})) (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.Term"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "variable"),+ Model.fieldTerm = (Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.Name "hydra.core.model.Name"),+ Model.wrappedTermBody = (Model.TermLiteral (Model.LiteralString (Model.unName refName)))}))}})) paramPairs+ builderTerm =+ Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.Name "hydra.core.typed.TypedTerm"),+ Model.wrappedTermBody = appBody})+ rawBody =+ Lists.foldl (\acc -> \pp -> Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name (Pairs.first pp)),+ Model.lambdaDomain = (Just (Pairs.second pp)),+ Model.lambdaBody = acc})) builderTerm (Lists.reverse paramPairs)+ description =+ Strings.concat [+ "DSL composition builder for the ",+ "encode",+ "r of ",+ (Model.unName typeName)]+ body = Annotations.setTermDescription (Just description) rawBody+ resultType = nominalResultType typeName origType+ paramTypes =+ Lists.map (\v -> Model.TypeFunction (Model.FunctionType {+ Model.functionTypeDomain = (Model.TypeVariable v),+ Model.functionTypeCodomain = (Model.TypeVariable (Model.Name "hydra.core.model.Term"))})) vars+ ts =+ dslTypeScheme origType paramTypes (Model.TypeFunction (Model.FunctionType {+ Model.functionTypeDomain = resultType,+ Model.functionTypeCodomain = (Model.TypeVariable (Model.Name "hydra.core.model.Term"))}))+ in Model.Binding {+ Model.bindingName = builderName,+ Model.bindingTerm = body,+ Model.bindingTypeScheme = (Just ts)},++ let vars = collectForallVars origType+ localName = Names.localNameOf typeName+ builderLocalName =+ Strings.concat [+ "decode",+ localName]+ builderName = dslDefinitionName typeName builderLocalName+ refName = Names.derivedBindingName [+ "decode"] True typeName+ paramPairs =+ Lists.map (\v -> (+ Model.unName v,+ (Model.TypeApplication (Model.ApplicationType {+ Model.applicationTypeFunction = (Model.TypeVariable (Model.Name "hydra.core.typed.TypedTerm")),+ Model.applicationTypeArgument = (Model.TypeFunction (Model.FunctionType {+ Model.functionTypeDomain = (Model.TypeVariable (Model.Name "hydra.core.graph.Graph")),+ Model.functionTypeCodomain = (Model.TypeFunction (Model.FunctionType {+ Model.functionTypeDomain = (Model.TypeVariable (Model.Name "hydra.core.model.Term")),+ Model.functionTypeCodomain = (Model.TypeEither (Model.EitherType {+ Model.eitherTypeLeft = (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError")),+ Model.eitherTypeRight = (Model.TypeVariable v)}))}))}))})))) vars+ appBody =+ Lists.foldl (\acc -> \pp -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.Term"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "application"),+ Model.fieldTerm = (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.model.Application"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "function"),+ Model.fieldTerm = acc},+ Model.Field {+ Model.fieldName = (Model.Name "argument"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermUnwrap (Model.Name "hydra.core.typed.TypedTerm")),+ Model.applicationArgument = (Model.TermVariable (Model.Name (Pairs.first pp)))}))}]}))}})) (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.Term"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "variable"),+ Model.fieldTerm = (Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.Name "hydra.core.model.Name"),+ Model.wrappedTermBody = (Model.TermLiteral (Model.LiteralString (Model.unName refName)))}))}})) paramPairs+ builderTerm =+ Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.Name "hydra.core.typed.TypedTerm"),+ Model.wrappedTermBody = appBody})+ rawBody =+ Lists.foldl (\acc -> \pp -> Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name (Pairs.first pp)),+ Model.lambdaDomain = (Just (Pairs.second pp)),+ Model.lambdaBody = acc})) builderTerm (Lists.reverse paramPairs)+ description =+ Strings.concat [+ "DSL composition builder for the ",+ "decode",+ "r of ",+ (Model.unName typeName)]+ body = Annotations.setTermDescription (Just description) rawBody+ resultType = nominalResultType typeName origType+ paramTypes =+ Lists.map (\v -> Model.TypeFunction (Model.FunctionType {+ Model.functionTypeDomain = (Model.TypeVariable (Model.Name "hydra.core.graph.Graph")),+ Model.functionTypeCodomain = (Model.TypeFunction (Model.FunctionType {+ Model.functionTypeDomain = (Model.TypeVariable (Model.Name "hydra.core.model.Term")),+ Model.functionTypeCodomain = (Model.TypeEither (Model.EitherType {+ Model.eitherTypeLeft = (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError")),+ Model.eitherTypeRight = (Model.TypeVariable v)}))}))})) vars+ ts =+ dslTypeScheme origType paramTypes (Model.TypeFunction (Model.FunctionType {+ Model.functionTypeDomain = (Model.TypeVariable (Model.Name "hydra.core.graph.Graph")),+ Model.functionTypeCodomain = (Model.TypeFunction (Model.FunctionType {+ Model.functionTypeDomain = (Model.TypeVariable (Model.Name "hydra.core.model.Term")),+ Model.functionTypeCodomain = (Model.TypeEither (Model.EitherType {+ Model.eitherTypeLeft = (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError")),+ Model.eitherTypeRight = resultType}))}))}))+ in Model.Binding {+ Model.bindingName = builderName,+ Model.bindingTerm = body,+ Model.bindingTypeScheme = (Just ts)}])++-- | Generate a record field accessor function+generateRecordAccessor :: Model.Type -> Model.Name -> Model.FieldType -> Model.Binding+generateRecordAccessor origType typeName ft =++ let fieldName = Model.fieldTypeName ft+ accessorLocalName =+ Strings.concat [+ Formatting.decapitalize (Names.localNameOf typeName),+ (Strings.join "" (Lists.map (\s -> Formatting.capitalize s) (Strings.splitOn "." (Model.unName fieldName))))]+ accessorName = dslDefinitionName typeName accessorLocalName+ paramDomain =+ Model.TypeApplication (Model.ApplicationType {+ Model.applicationTypeFunction = (Model.TypeVariable (Model.Name "hydra.core.typed.TypedTerm")),+ Model.applicationTypeArgument = (nominalResultType typeName origType)})+ rawBody =+ Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "x"),+ Model.lambdaDomain = (Just paramDomain),+ Model.lambdaBody = (Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.Name "hydra.core.typed.TypedTerm"),+ Model.wrappedTermBody = (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.Term"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "application"),+ Model.fieldTerm = (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.model.Application"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "function"),+ Model.fieldTerm = (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.Term"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "project"),+ Model.fieldTerm = (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.model.Projection"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "typeName"),+ Model.fieldTerm = (Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.Name "hydra.core.model.Name"),+ Model.wrappedTermBody = (Model.TermLiteral (Model.LiteralString (Model.unName typeName)))}))},+ Model.Field {+ Model.fieldName = (Model.Name "fieldName"),+ Model.fieldTerm = (Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.Name "hydra.core.model.Name"),+ Model.wrappedTermBody = (Model.TermLiteral (Model.LiteralString (Model.unName fieldName)))}))}]}))}}))},+ Model.Field {+ Model.fieldName = (Model.Name "argument"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermUnwrap (Model.Name "hydra.core.typed.TypedTerm")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "x"))}))}]}))}}))}))})+ description =+ Strings.concat [+ "DSL accessor for the ",+ (Model.unName fieldName),+ " field of ",+ (Model.unName typeName)]+ body = Annotations.setTermDescription (Just description) rawBody+ ts = dslTypeScheme origType [+ nominalResultType typeName origType] (Model.fieldTypeType ft)+ in Model.Binding {+ Model.bindingName = accessorName,+ Model.bindingTerm = body,+ Model.bindingTypeScheme = (Just ts)}++-- | Generate a record constructor function+generateRecordConstructor :: Model.Type -> Model.Name -> [Model.FieldType] -> [Model.Binding]+generateRecordConstructor origType typeName fieldTypes =++ let dFields =+ Lists.map (\ft -> Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.model.Field"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.Name "hydra.core.model.Name"),+ Model.wrappedTermBody = (Model.TermLiteral (Model.LiteralString (Model.unName (Model.fieldTypeName ft))))}))},+ Model.Field {+ Model.fieldName = (Model.Name "term"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermUnwrap (Model.Name "hydra.core.typed.TypedTerm")),+ Model.applicationArgument = (Model.TermVariable (Model.Name (Formatting.decapitalize (Names.localNameOf (Model.fieldTypeName ft)))))}))}]})) fieldTypes+ recordTerm =+ Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.Name "hydra.core.typed.TypedTerm"),+ Model.wrappedTermBody = (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.Term"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "record"),+ Model.fieldTerm = (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.model.Record"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "typeName"),+ Model.fieldTerm = (Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.Name "hydra.core.model.Name"),+ Model.wrappedTermBody = (Model.TermLiteral (Model.LiteralString (Model.unName typeName)))}))},+ Model.Field {+ Model.fieldName = (Model.Name "fields"),+ Model.fieldTerm = (Model.TermList dFields)}]}))}}))})+ paramPairs =+ Lists.map (\ft -> (+ Formatting.decapitalize (Names.localNameOf (Model.fieldTypeName ft)),+ (Model.TypeApplication (Model.ApplicationType {+ Model.applicationTypeFunction = (Model.TypeVariable (Model.Name "hydra.core.typed.TypedTerm")),+ Model.applicationTypeArgument = (Model.fieldTypeType ft)})))) fieldTypes+ rawBody =+ Lists.foldl (\acc -> \pp -> Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name (Pairs.first pp)),+ Model.lambdaDomain = (Just (Pairs.second pp)),+ Model.lambdaBody = acc})) recordTerm (Lists.reverse paramPairs)+ description =+ Strings.concat [+ "DSL constructor for ",+ (Model.unName typeName)]+ body = Annotations.setTermDescription (Just description) rawBody+ paramTypes = Lists.map (\ft -> Model.fieldTypeType ft) fieldTypes+ resultType = nominalResultType typeName origType+ ts = dslTypeScheme origType paramTypes resultType+ in [+ Model.Binding {+ Model.bindingName = (dslBindingName typeName),+ Model.bindingTerm = body,+ Model.bindingTypeScheme = (Just ts)}]++-- | Generate a withXxx record field updater function+generateRecordWithUpdater :: Model.Type -> Model.Name -> [Model.FieldType] -> Model.FieldType -> Model.Binding+generateRecordWithUpdater origType typeName allFields targetField =++ let targetFieldName = Model.fieldTypeName targetField+ updaterLocalName =+ Strings.concat [+ Formatting.decapitalize (Names.localNameOf typeName),+ "With",+ (Strings.join "" (Lists.map (\s -> Formatting.capitalize s) (Strings.splitOn "." (Model.unName targetFieldName))))]+ updaterName = dslDefinitionName typeName updaterLocalName+ dFields =+ Lists.map (\ft -> Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.model.Field"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.Name "hydra.core.model.Name"),+ Model.wrappedTermBody = (Model.TermLiteral (Model.LiteralString (Model.unName (Model.fieldTypeName ft))))}))},+ Model.Field {+ Model.fieldName = (Model.Name "term"),+ Model.fieldTerm = (Logic.ifElse (Equality.equal (Model.unName (Model.fieldTypeName ft)) (Model.unName targetFieldName)) (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermUnwrap (Model.Name "hydra.core.typed.TypedTerm")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "newVal"))})) (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.Term"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "application"),+ Model.fieldTerm = (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.model.Application"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "function"),+ Model.fieldTerm = (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.Term"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "project"),+ Model.fieldTerm = (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.model.Projection"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "typeName"),+ Model.fieldTerm = (Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.Name "hydra.core.model.Name"),+ Model.wrappedTermBody = (Model.TermLiteral (Model.LiteralString (Model.unName typeName)))}))},+ Model.Field {+ Model.fieldName = (Model.Name "fieldName"),+ Model.fieldTerm = (Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.Name "hydra.core.model.Name"),+ Model.wrappedTermBody = (Model.TermLiteral (Model.LiteralString (Model.unName (Model.fieldTypeName ft))))}))}]}))}}))},+ Model.Field {+ Model.fieldName = (Model.Name "argument"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermUnwrap (Model.Name "hydra.core.typed.TypedTerm")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "original"))}))}]}))}})))}]})) allFields+ recDomain =+ Model.TypeApplication (Model.ApplicationType {+ Model.applicationTypeFunction = (Model.TypeVariable (Model.Name "hydra.core.typed.TypedTerm")),+ Model.applicationTypeArgument = (nominalResultType typeName origType)})+ fieldDomain =+ Model.TypeApplication (Model.ApplicationType {+ Model.applicationTypeFunction = (Model.TypeVariable (Model.Name "hydra.core.typed.TypedTerm")),+ Model.applicationTypeArgument = (Model.fieldTypeType targetField)})+ rawBody =+ Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "original"),+ Model.lambdaDomain = (Just recDomain),+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "newVal"),+ Model.lambdaDomain = (Just fieldDomain),+ Model.lambdaBody = (Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.Name "hydra.core.typed.TypedTerm"),+ Model.wrappedTermBody = (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.Term"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "record"),+ Model.fieldTerm = (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.model.Record"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "typeName"),+ Model.fieldTerm = (Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.Name "hydra.core.model.Name"),+ Model.wrappedTermBody = (Model.TermLiteral (Model.LiteralString (Model.unName typeName)))}))},+ Model.Field {+ Model.fieldName = (Model.Name "fields"),+ Model.fieldTerm = (Model.TermList dFields)}]}))}}))}))}))})+ description =+ Strings.concat [+ "DSL updater for the ",+ (Model.unName targetFieldName),+ " field of ",+ (Model.unName typeName)]+ body = Annotations.setTermDescription (Just description) rawBody+ recType = nominalResultType typeName origType+ ts =+ dslTypeScheme origType [+ recType,+ (Model.fieldTypeType targetField)] recType+ in Model.Binding {+ Model.bindingName = updaterName,+ Model.bindingTerm = body,+ Model.bindingTypeScheme = (Just ts)}++-- | Generate typed reference DSL bindings for a primitive (or signature-carrying term) definition+generateRefBindings :: Packaging.Definition -> Either t0 [Model.Binding]+generateRefBindings d =+ case d of+ Packaging.DefinitionType _ -> Right []+ Packaging.DefinitionTerm v0 -> Optionals.match (Packaging.termDefinitionSignature v0) (Right []) (\sig -> Logic.ifElse (signatureIsVoidFree sig) (Right [+ generateSignatureRef (Packaging.termDefinitionName v0) sig]) (Right []))+ Packaging.DefinitionPrimitive v0 -> Logic.ifElse (signatureIsVoidFree (Packaging.primitiveDefinitionSignature v0)) (Right [+ generateSignatureRef (Packaging.primitiveDefinitionName v0) (Packaging.primitiveDefinitionSignature v0)]) (Right [])+ _ -> Right []++-- | Generate a typed-reference DSL wrapper from a term/primitive name and signature+generateSignatureRef :: Model.Name -> Typing.TermSignature -> Model.Binding+generateSignatureRef refName sig =++ let params = Typing.termSignatureParameters sig+ paramFlags =+ Lists.map (\p -> (+ Model.unName (Typing.parameterName p),+ ((\t -> case (Strip.deannotateType t) of+ Model.TypeApplication v0 -> case (Strip.deannotateType (Model.applicationTypeFunction v0)) of+ Model.TypeVariable v1 -> Equality.equal v1 (Model.Name "hydra.core.typed.TypedName")+ _ -> False+ _ -> False) (Strip.deannotateType (Typing.parameterType p))))) params+ paramPairs =+ Lists.map (\p ->+ let pt = Typing.parameterType p+ in (+ Model.unName (Typing.parameterName p),+ (Logic.ifElse ((\t -> case (Strip.deannotateType t) of+ Model.TypeApplication v0 -> case (Strip.deannotateType (Model.applicationTypeFunction v0)) of+ Model.TypeVariable v1 -> Equality.equal v1 (Model.Name "hydra.core.typed.TypedName")+ _ -> False+ _ -> False) (Strip.deannotateType pt)) pt (Model.TypeApplication (Model.ApplicationType {+ Model.applicationTypeFunction = (Model.TypeVariable (Model.Name "hydra.core.typed.TypedTerm")),+ Model.applicationTypeArgument = pt}))))) params+ appBody =+ Lists.foldl (\acc -> \pf -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.Term"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "application"),+ Model.fieldTerm = (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.model.Application"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "function"),+ Model.fieldTerm = acc},+ Model.Field {+ Model.fieldName = (Model.Name "argument"),+ Model.fieldTerm = (Logic.ifElse (Pairs.second pf) (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.Term"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "variable"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermUnwrap (Model.Name "hydra.core.typed.TypedName")),+ Model.applicationArgument = (Model.TermVariable (Model.Name (Pairs.first pf)))}))}})) (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermUnwrap (Model.Name "hydra.core.typed.TypedTerm")),+ Model.applicationArgument = (Model.TermVariable (Model.Name (Pairs.first pf)))})))}]}))}})) (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.Term"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "variable"),+ Model.fieldTerm = (Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.Name "hydra.core.model.Name"),+ Model.wrappedTermBody = (Model.TermLiteral (Model.LiteralString (Model.unName refName)))}))}})) paramFlags+ refTerm =+ Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.Name "hydra.core.typed.TypedTerm"),+ Model.wrappedTermBody = appBody})+ rawBody =+ Lists.foldl (\acc -> \pp -> Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name (Pairs.first pp)),+ Model.lambdaDomain = (Just (Pairs.second pp)),+ Model.lambdaBody = acc})) refTerm (Lists.reverse paramPairs)+ description =+ Strings.concat [+ "DSL reference to ",+ (Model.unName refName)]+ body = Annotations.setTermDescription (Just description) rawBody+ ts = dslSignatureTypeScheme sig+ in Model.Binding {+ Model.bindingName = (dslDefinitionName refName (Names.localNameOf refName)),+ Model.bindingTerm = body,+ Model.bindingTypeScheme = (Just ts)}++-- | Generate a TypedName token constant for a type definition+generateTypeNameToken :: Model.Type -> Model.Name -> Model.Binding+generateTypeNameToken origType typeName =++ let localName = Names.localNameOf typeName+ tokenLocalName =+ Strings.concat [+ Formatting.decapitalize localName,+ localName]+ tokenName = dslDefinitionName typeName tokenLocalName+ description =+ Strings.concat [+ "DSL name token for ",+ (Model.unName typeName)]+ body =+ Annotations.setTermDescription (Just description) (Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.Name "hydra.core.typed.TypedName"),+ Model.wrappedTermBody = (Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.Name "hydra.core.model.Name"),+ Model.wrappedTermBody = (Model.TermLiteral (Model.LiteralString (Model.unName typeName)))}))}))+ ts =+ Model.TypeScheme {+ Model.typeSchemeVariables = (collectForallVars origType),+ Model.typeSchemeBody = (Model.TypeApplication (Model.ApplicationType {+ Model.applicationTypeFunction = (Model.TypeVariable (Model.Name "hydra.core.typed.TypedName")),+ Model.applicationTypeArgument = (nominalResultType typeName origType)})),+ Model.typeSchemeConstraints = Maps.empty}+ in Model.Binding {+ Model.bindingName = tokenName,+ Model.bindingTerm = body,+ Model.bindingTypeScheme = (Just ts)}++-- | Generate a union injection helper+generateUnionInjector :: Model.Type -> Model.Name -> Model.FieldType -> Model.Binding+generateUnionInjector origType typeName ft =++ let fieldName = Model.fieldTypeName ft+ fieldType = Model.fieldTypeType ft+ injectorLocalName =+ Strings.concat [+ Formatting.decapitalize (Names.localNameOf typeName),+ (Strings.join "" (Lists.map (\s -> Formatting.capitalize s) (Strings.splitOn "." (Model.unName fieldName))))]+ injectorName = dslDefinitionName typeName injectorLocalName+ isUnit =+ (\t -> case (Strip.deannotateType t) of+ Model.TypeUnit -> True+ _ -> False) fieldType+ dFieldValue =+ Logic.ifElse isUnit (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.Term"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "unit"),+ Model.fieldTerm = Model.TermUnit}})) (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermUnwrap (Model.Name "hydra.core.typed.TypedTerm")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "x"))}))+ injectionTerm =+ Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.Name "hydra.core.typed.TypedTerm"),+ Model.wrappedTermBody = (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.Term"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "inject"),+ Model.fieldTerm = (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.model.Injection"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "typeName"),+ Model.fieldTerm = (Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.Name "hydra.core.model.Name"),+ Model.wrappedTermBody = (Model.TermLiteral (Model.LiteralString (Model.unName typeName)))}))},+ Model.Field {+ Model.fieldName = (Model.Name "field"),+ Model.fieldTerm = (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.model.Field"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.Name "hydra.core.model.Name"),+ Model.wrappedTermBody = (Model.TermLiteral (Model.LiteralString (Model.unName fieldName)))}))},+ Model.Field {+ Model.fieldName = (Model.Name "term"),+ Model.fieldTerm = dFieldValue}]}))}]}))}}))})+ variantDomain =+ Model.TypeApplication (Model.ApplicationType {+ Model.applicationTypeFunction = (Model.TypeVariable (Model.Name "hydra.core.typed.TypedTerm")),+ Model.applicationTypeArgument = (Model.fieldTypeType ft)})+ rawBody =+ Logic.ifElse isUnit injectionTerm (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "x"),+ Model.lambdaDomain = (Just variantDomain),+ Model.lambdaBody = injectionTerm}))+ description =+ Strings.concat [+ "DSL injection for the ",+ (Model.unName fieldName),+ " variant of ",+ (Model.unName typeName)]+ body = Annotations.setTermDescription (Just description) rawBody+ unionType = nominalResultType typeName origType+ ts =+ Logic.ifElse isUnit (dslTypeScheme origType [] unionType) (dslTypeScheme origType [+ Model.fieldTypeType ft] unionType)+ in Model.Binding {+ Model.bindingName = injectorName,+ Model.bindingTerm = body,+ Model.bindingTypeScheme = (Just ts)}++-- | Generate wrap/unwrap accessors for a wrapped type+generateWrappedTypeAccessors :: Model.Type -> Model.Name -> Model.Type -> [Model.Binding]+generateWrappedTypeAccessors origType typeName innerType =++ let localName = Names.localNameOf typeName+ wrapName = dslDefinitionName typeName (Formatting.decapitalize localName)+ unwrapLocalName =+ Strings.concat [+ "un",+ localName]+ unwrapName = dslDefinitionName typeName unwrapLocalName+ wrapperType = nominalResultType typeName origType+ wrapDomain =+ Model.TypeApplication (Model.ApplicationType {+ Model.applicationTypeFunction = (Model.TypeVariable (Model.Name "hydra.core.typed.TypedTerm")),+ Model.applicationTypeArgument = innerType})+ rawWrapBody =+ Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "x"),+ Model.lambdaDomain = (Just wrapDomain),+ Model.lambdaBody = (Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.Name "hydra.core.typed.TypedTerm"),+ Model.wrappedTermBody = (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.Term"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "wrap"),+ Model.fieldTerm = (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.model.WrappedTerm"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "typeName"),+ Model.fieldTerm = (Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.Name "hydra.core.model.Name"),+ Model.wrappedTermBody = (Model.TermLiteral (Model.LiteralString (Model.unName typeName)))}))},+ Model.Field {+ Model.fieldName = (Model.Name "body"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermUnwrap (Model.Name "hydra.core.typed.TypedTerm")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "x"))}))}]}))}}))}))})+ wrapDescription =+ Strings.concat [+ "DSL constructor for the ",+ (Model.unName typeName),+ " wrapper"]+ wrapBody = Annotations.setTermDescription (Just wrapDescription) rawWrapBody+ unwrapDomain =+ Model.TypeApplication (Model.ApplicationType {+ Model.applicationTypeFunction = (Model.TypeVariable (Model.Name "hydra.core.typed.TypedTerm")),+ Model.applicationTypeArgument = wrapperType})+ rawUnwrapBody =+ Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "x"),+ Model.lambdaDomain = (Just unwrapDomain),+ Model.lambdaBody = (Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.Name "hydra.core.typed.TypedTerm"),+ Model.wrappedTermBody = (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.Term"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "application"),+ Model.fieldTerm = (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.model.Application"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "function"),+ Model.fieldTerm = (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.Term"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "unwrap"),+ Model.fieldTerm = (Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.Name "hydra.core.model.Name"),+ Model.wrappedTermBody = (Model.TermLiteral (Model.LiteralString (Model.unName typeName)))}))}}))},+ Model.Field {+ Model.fieldName = (Model.Name "argument"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermUnwrap (Model.Name "hydra.core.typed.TypedTerm")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "x"))}))}]}))}}))}))})+ unwrapDescription =+ Strings.concat [+ "DSL accessor for the body of ",+ (Model.unName typeName)]+ unwrapBody = Annotations.setTermDescription (Just unwrapDescription) rawUnwrapBody+ wrapTs = dslTypeScheme origType [+ innerType] wrapperType+ unwrapTs = dslTypeScheme origType [+ wrapperType] innerType+ in [+ Model.Binding {+ Model.bindingName = wrapName,+ Model.bindingTerm = wrapBody,+ Model.bindingTypeScheme = (Just wrapTs)},+ Model.Binding {+ Model.bindingName = unwrapName,+ Model.bindingTerm = unwrapBody,+ Model.bindingTypeScheme = (Just unwrapTs)}]++-- | Check if a binding is eligible for DSL generation+isDslEligibleBinding :: t0 -> t1 -> Model.Binding -> Either t2 (Maybe Model.Binding)+isDslEligibleBinding cx graph b =++ let ns = Names.moduleNameOf (Model.bindingName b)+ in (Logic.ifElse (Equality.equal (Optionals.match ns "" Packaging.unModuleName) "hydra.core.typed") (Right Nothing) (Right (Just b)))++-- | Build the nominal result type with type applications for forall variables+nominalResultType :: Model.Name -> Model.Type -> Model.Type+nominalResultType typeName origType =++ let vars = collectForallVars origType+ in (Lists.foldl (\acc -> \v -> Model.TypeApplication (Model.ApplicationType {+ Model.applicationTypeFunction = acc,+ Model.applicationTypeArgument = (Model.TypeVariable v)})) (Model.TypeVariable typeName) vars)++-- | Check whether a term signature's parameter and result types are all void-free+signatureIsVoidFree :: Typing.TermSignature -> Bool+signatureIsVoidFree sig =++ let paramTypes = Lists.map (\p -> Typing.parameterType p) (Typing.termSignatureParameters sig)+ resultType = Typing.resultType (Typing.termSignatureResult sig)+ in (Lists.foldl (\acc -> \t -> Logic.and acc (typeIsVoidFree t)) (typeIsVoidFree resultType) paramTypes)++-- | Check whether a type contains no occurrence of the void type at any depth+typeIsVoidFree :: Model.Type -> Bool+typeIsVoidFree typ =++ let allVariants =+ Sets.fromList (Lists.map Reflect.typeVariant (Rewriting.foldOverType Coders.TraversalOrderPre (\m -> \t -> Lists.cons t m) [] typ))+ in (Logic.not (Sets.member Variants.TypeVariantVoid allVariants))
@@ -0,0 +1,247 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Term encoders for hydra.core.ast++module Hydra.Core.Encode.Ast where++import qualified Hydra.Core.Ast as Ast+import qualified Hydra.Core.Encode.Model as EncodeModel+import qualified Hydra.Core.Overlay.Haskell.Lib.Lists as Lists+import qualified Hydra.Core.Overlay.Haskell.Lib.Optionals as Optionals+import qualified Hydra.Core.Model as Model+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | Encoder for hydra.core.ast.Associativity+associativity :: Ast.Associativity -> Model.Term+associativity x =+ case x of+ Ast.AssociativityNone -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.ast.Associativity"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "none"),+ Model.fieldTerm = Model.TermUnit}})+ Ast.AssociativityLeft -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.ast.Associativity"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "left"),+ Model.fieldTerm = Model.TermUnit}})+ Ast.AssociativityRight -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.ast.Associativity"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "right"),+ Model.fieldTerm = Model.TermUnit}})+ Ast.AssociativityBoth -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.ast.Associativity"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "both"),+ Model.fieldTerm = Model.TermUnit}})++-- | Encoder for hydra.core.ast.BlockStyle+blockStyle :: Ast.BlockStyle -> Model.Term+blockStyle x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.ast.BlockStyle"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "indent"),+ Model.fieldTerm = ((\opt -> Model.TermOptional (Optionals.map (\x2 -> Model.TermLiteral (Model.LiteralString x2)) opt)) (Ast.blockStyleIndent x))},+ Model.Field {+ Model.fieldName = (Model.Name "newlineBeforeContent"),+ Model.fieldTerm = ((\x2 -> Model.TermLiteral (Model.LiteralBoolean x2)) (Ast.blockStyleNewlineBeforeContent x))},+ Model.Field {+ Model.fieldName = (Model.Name "newlineAfterContent"),+ Model.fieldTerm = ((\x2 -> Model.TermLiteral (Model.LiteralBoolean x2)) (Ast.blockStyleNewlineAfterContent x))}]})++-- | Encoder for hydra.core.ast.BracketExpr+bracketExpr :: Ast.BracketExpr -> Model.Term+bracketExpr x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.ast.BracketExpr"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "brackets"),+ Model.fieldTerm = (brackets (Ast.bracketExprBrackets x))},+ Model.Field {+ Model.fieldName = (Model.Name "enclosed"),+ Model.fieldTerm = (expr (Ast.bracketExprEnclosed x))},+ Model.Field {+ Model.fieldName = (Model.Name "style"),+ Model.fieldTerm = (blockStyle (Ast.bracketExprStyle x))}]})++-- | Encoder for hydra.core.ast.Brackets+brackets :: Ast.Brackets -> Model.Term+brackets x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.ast.Brackets"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "open"),+ Model.fieldTerm = (symbol (Ast.bracketsOpen x))},+ Model.Field {+ Model.fieldName = (Model.Name "close"),+ Model.fieldTerm = (symbol (Ast.bracketsClose x))}]})++-- | Encoder for hydra.core.ast.Expr+expr :: Ast.Expr -> Model.Term+expr x =+ case x of+ Ast.ExprConst v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.ast.Expr"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "const"),+ Model.fieldTerm = (symbol v0)}})+ Ast.ExprIndent v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.ast.Expr"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "indent"),+ Model.fieldTerm = (indentedExpression v0)}})+ Ast.ExprOp v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.ast.Expr"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "op"),+ Model.fieldTerm = (opExpr v0)}})+ Ast.ExprBrackets v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.ast.Expr"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "brackets"),+ Model.fieldTerm = (bracketExpr v0)}})+ Ast.ExprSeq v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.ast.Expr"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "seq"),+ Model.fieldTerm = (seqExpr v0)}})++-- | Encoder for hydra.core.ast.IndentStyle+indentStyle :: Ast.IndentStyle -> Model.Term+indentStyle x =+ case x of+ Ast.IndentStyleAllLines v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.ast.IndentStyle"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "allLines"),+ Model.fieldTerm = (Model.TermLiteral (Model.LiteralString v0))}})+ Ast.IndentStyleSubsequentLines v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.ast.IndentStyle"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "subsequentLines"),+ Model.fieldTerm = (Model.TermLiteral (Model.LiteralString v0))}})++-- | Encoder for hydra.core.ast.IndentedExpression+indentedExpression :: Ast.IndentedExpression -> Model.Term+indentedExpression x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.ast.IndentedExpression"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "style"),+ Model.fieldTerm = (indentStyle (Ast.indentedExpressionStyle x))},+ Model.Field {+ Model.fieldName = (Model.Name "expr"),+ Model.fieldTerm = (expr (Ast.indentedExpressionExpr x))}]})++-- | Encoder for hydra.core.ast.Op+op :: Ast.Op -> Model.Term+op x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.ast.Op"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "symbol"),+ Model.fieldTerm = (symbol (Ast.opSymbol x))},+ Model.Field {+ Model.fieldName = (Model.Name "padding"),+ Model.fieldTerm = (padding (Ast.opPadding x))},+ Model.Field {+ Model.fieldName = (Model.Name "precedence"),+ Model.fieldTerm = (precedence (Ast.opPrecedence x))},+ Model.Field {+ Model.fieldName = (Model.Name "associativity"),+ Model.fieldTerm = (associativity (Ast.opAssociativity x))}]})++-- | Encoder for hydra.core.ast.OpExpr+opExpr :: Ast.OpExpr -> Model.Term+opExpr x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.ast.OpExpr"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "op"),+ Model.fieldTerm = (op (Ast.opExprOp x))},+ Model.Field {+ Model.fieldName = (Model.Name "lhs"),+ Model.fieldTerm = (expr (Ast.opExprLhs x))},+ Model.Field {+ Model.fieldName = (Model.Name "rhs"),+ Model.fieldTerm = (expr (Ast.opExprRhs x))}]})++-- | Encoder for hydra.core.ast.Padding+padding :: Ast.Padding -> Model.Term+padding x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.ast.Padding"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "left"),+ Model.fieldTerm = (ws (Ast.paddingLeft x))},+ Model.Field {+ Model.fieldName = (Model.Name "right"),+ Model.fieldTerm = (ws (Ast.paddingRight x))}]})++-- | Encoder for hydra.core.ast.Precedence+precedence :: Ast.Precedence -> Model.Term+precedence x =+ Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.Name "hydra.core.ast.Precedence"),+ Model.wrappedTermBody = ((\x2 -> Model.TermLiteral (Model.LiteralInteger (Model.IntegerValueInt32 x2))) (Ast.unPrecedence x))})++-- | Encoder for hydra.core.ast.SeqExpr+seqExpr :: Ast.SeqExpr -> Model.Term+seqExpr x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.ast.SeqExpr"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "op"),+ Model.fieldTerm = (op (Ast.seqExprOp x))},+ Model.Field {+ Model.fieldName = (Model.Name "elements"),+ Model.fieldTerm = ((\xs -> Model.TermList (Lists.map expr xs)) (Ast.seqExprElements x))}]})++-- | Encoder for hydra.core.ast.Symbol+symbol :: Ast.Symbol -> Model.Term+symbol x =+ Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.Name "hydra.core.ast.Symbol"),+ Model.wrappedTermBody = ((\x2 -> Model.TermLiteral (Model.LiteralString x2)) (Ast.unSymbol x))})++-- | Encoder for hydra.core.ast.Ws+ws :: Ast.Ws -> Model.Term+ws x =+ case x of+ Ast.WsNone -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.ast.Ws"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "none"),+ Model.fieldTerm = Model.TermUnit}})+ Ast.WsSpace -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.ast.Ws"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "space"),+ Model.fieldTerm = Model.TermUnit}})+ Ast.WsBreak -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.ast.Ws"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "break"),+ Model.fieldTerm = Model.TermUnit}})+ Ast.WsBreakAndIndent v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.ast.Ws"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "breakAndIndent"),+ Model.fieldTerm = (Model.TermLiteral (Model.LiteralString v0))}})+ Ast.WsDoubleBreak -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.ast.Ws"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "doubleBreak"),+ Model.fieldTerm = Model.TermUnit}})
@@ -0,0 +1,110 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Term encoders for hydra.core.coders++module Hydra.Core.Encode.Coders where++import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Encode.Errors as Errors+import qualified Hydra.Core.Encode.File as File+import qualified Hydra.Core.Encode.Model as EncodeModel+import qualified Hydra.Core.Encode.Util as Util+import qualified Hydra.Core.Encode.Variants as Variants+import qualified Hydra.Core.Model as Model+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | Encoder for hydra.core.coders.CaseConventions+caseConventions :: Coders.CaseConventions -> Model.Term+caseConventions x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.coders.CaseConventions"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "constant"),+ Model.fieldTerm = (Util.caseConvention (Coders.caseConventionsConstant x))},+ Model.Field {+ Model.fieldName = (Model.Name "directory"),+ Model.fieldTerm = (Util.caseConvention (Coders.caseConventionsDirectory x))},+ Model.Field {+ Model.fieldName = (Model.Name "enumValue"),+ Model.fieldTerm = (Util.caseConvention (Coders.caseConventionsEnumValue x))},+ Model.Field {+ Model.fieldName = (Model.Name "field"),+ Model.fieldTerm = (Util.caseConvention (Coders.caseConventionsField x))},+ Model.Field {+ Model.fieldName = (Model.Name "file"),+ Model.fieldTerm = (Util.caseConvention (Coders.caseConventionsFile x))},+ Model.Field {+ Model.fieldName = (Model.Name "module"),+ Model.fieldTerm = (Util.caseConvention (Coders.caseConventionsModule x))},+ Model.Field {+ Model.fieldName = (Model.Name "term"),+ Model.fieldTerm = (Util.caseConvention (Coders.caseConventionsTerm x))},+ Model.Field {+ Model.fieldName = (Model.Name "termVariable"),+ Model.fieldTerm = (Util.caseConvention (Coders.caseConventionsTermVariable x))},+ Model.Field {+ Model.fieldName = (Model.Name "type"),+ Model.fieldTerm = (Util.caseConvention (Coders.caseConventionsType x))},+ Model.Field {+ Model.fieldName = (Model.Name "typeVariable"),+ Model.fieldTerm = (Util.caseConvention (Coders.caseConventionsTypeVariable x))}]})++-- | Encoder for hydra.core.coders.CoderDirection+coderDirection :: Coders.CoderDirection -> Model.Term+coderDirection x =+ case x of+ Coders.CoderDirectionEncode -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.coders.CoderDirection"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "encode"),+ Model.fieldTerm = Model.TermUnit}})+ Coders.CoderDirectionDecode -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.coders.CoderDirection"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "decode"),+ Model.fieldTerm = Model.TermUnit}})++-- | Encoder for hydra.core.coders.LanguageFeature+languageFeature :: Coders.LanguageFeature -> Model.Term+languageFeature x =+ case x of+ Coders.LanguageFeaturePartialApplication -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.coders.LanguageFeature"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "partialApplication"),+ Model.fieldTerm = Model.TermUnit}})+ Coders.LanguageFeatureNestedCaseStatements -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.coders.LanguageFeature"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "nestedCaseStatements"),+ Model.fieldTerm = Model.TermUnit}})+ Coders.LanguageFeatureNestedPolymorphicLetBindings -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.coders.LanguageFeature"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "nestedPolymorphicLetBindings"),+ Model.fieldTerm = Model.TermUnit}})++-- | Encoder for hydra.core.coders.LanguageName+languageName :: Coders.LanguageName -> Model.Term+languageName x =+ Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.Name "hydra.core.coders.LanguageName"),+ Model.wrappedTermBody = ((\x2 -> Model.TermLiteral (Model.LiteralString x2)) (Coders.unLanguageName x))})++-- | Encoder for hydra.core.coders.TraversalOrder+traversalOrder :: Coders.TraversalOrder -> Model.Term+traversalOrder x =+ case x of+ Coders.TraversalOrderPre -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.coders.TraversalOrder"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "pre"),+ Model.fieldTerm = Model.TermUnit}})+ Coders.TraversalOrderPost -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.coders.TraversalOrder"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "post"),+ Model.fieldTerm = Model.TermUnit}})
@@ -0,0 +1,167 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Term encoders for hydra.core.diff++module Hydra.Core.Encode.Diff where++import qualified Hydra.Core.Diff as Diff+import qualified Hydra.Core.Encode.Model as EncodeModel+import qualified Hydra.Core.Overlay.Haskell.Lib.Lists as Lists+import qualified Hydra.Core.Overlay.Haskell.Lib.Maps as Maps+import qualified Hydra.Core.Model as Model+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | Encoder for hydra.core.diff.Edit+edit :: (a -> Model.Term) -> (s -> Model.Term) -> Diff.Edit a s -> Model.Term+edit a s x =+ case x of+ Diff.EditRetain -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.diff.Edit"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "retain"),+ Model.fieldTerm = Model.TermUnit}})+ Diff.EditSet v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.diff.Edit"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "set"),+ Model.fieldTerm = (a v0)}})+ Diff.EditDelete -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.diff.Edit"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "delete"),+ Model.fieldTerm = Model.TermUnit}})+ Diff.EditDescend v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.diff.Edit"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "descend"),+ Model.fieldTerm = (Model.TermList (Lists.map (stepEdit a s) v0))}})++-- | Encoder for hydra.core.diff.Hole+hole :: (t -> Model.Term) -> (s -> Model.Term) -> Diff.Hole t s -> Model.Term+hole t s x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.diff.Hole"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "path"),+ Model.fieldTerm = ((\xs -> Model.TermList (Lists.map s xs)) (Diff.holePath x))},+ Model.Field {+ Model.fieldName = (Model.Name "type"),+ Model.fieldTerm = (t (Diff.holeType x))}]})++-- | Encoder for hydra.core.diff.HoleFiller+holeFiller :: (v -> Model.Term) -> (s -> Model.Term) -> Diff.HoleFiller v s -> Model.Term+holeFiller v s x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.diff.HoleFiller"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "path"),+ Model.fieldTerm = ((\xs -> Model.TermList (Lists.map s xs)) (Diff.holeFillerPath x))},+ Model.Field {+ Model.fieldName = (Model.Name "value"),+ Model.fieldTerm = (v (Diff.holeFillerValue x))}]})++-- | Encoder for hydra.core.diff.InvalidFillError+invalidFillError :: (t -> Model.Term) -> (v -> Model.Term) -> (s -> Model.Term) -> Diff.InvalidFillError t v s -> Model.Term+invalidFillError t v s x =+ case x of+ Diff.InvalidFillErrorIllTyped v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.diff.InvalidFillError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "illTyped"),+ Model.fieldTerm = (hole t s v0)}})+ Diff.InvalidFillErrorMissingFill v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.diff.InvalidFillError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "missingFill"),+ Model.fieldTerm = (hole t s v0)}})+ Diff.InvalidFillErrorExtraFill v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.diff.InvalidFillError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "extraFill"),+ Model.fieldTerm = (Model.TermLiteral (Model.LiteralInteger (Model.IntegerValueInt32 v0)))}})++-- | Encoder for hydra.core.diff.MigrationError+migrationError :: (t -> Model.Term) -> (v -> Model.Term) -> (s -> Model.Term) -> Diff.MigrationError t v s -> Model.Term+migrationError t v s x =+ case x of+ Diff.MigrationErrorNotAnInstance v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.diff.MigrationError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "notAnInstance"),+ Model.fieldTerm = (v v0)}})+ Diff.MigrationErrorOutOfRange v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.diff.MigrationError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "outOfRange"),+ Model.fieldTerm = (v v0)}})+ Diff.MigrationErrorRejectedVariant v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.diff.MigrationError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "rejectedVariant"),+ Model.fieldTerm = (v v0)}})+ Diff.MigrationErrorIllTypedResult v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.diff.MigrationError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "illTypedResult"),+ Model.fieldTerm = (mistyped t v v0)}})+ Diff.MigrationErrorUnfilledHole v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.diff.MigrationError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "unfilledHole"),+ Model.fieldTerm = (hole t s v0)}})++-- | Encoder for hydra.core.diff.MigrationPlan+migrationPlan :: Ord n => ((n -> Model.Term) -> (t -> Model.Term) -> (s -> Model.Term) -> Diff.MigrationPlan n t s -> Model.Term)+migrationPlan n t s x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.diff.MigrationPlan"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "edits"),+ Model.fieldTerm = ((\m -> Model.TermMap (Maps.bimap n (edit t s) m)) (Diff.migrationPlanEdits x))},+ Model.Field {+ Model.fieldName = (Model.Name "holes"),+ Model.fieldTerm = ((\xs -> Model.TermList (Lists.map (schemaHole n t s) xs)) (Diff.migrationPlanHoles x))}]})++-- | Encoder for hydra.core.diff.Mistyped+mistyped :: (t -> Model.Term) -> (v -> Model.Term) -> Diff.Mistyped t v -> Model.Term+mistyped t v x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.diff.Mistyped"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "value"),+ Model.fieldTerm = (v (Diff.mistypedValue x))},+ Model.Field {+ Model.fieldName = (Model.Name "type"),+ Model.fieldTerm = (t (Diff.mistypedType x))}]})++-- | Encoder for hydra.core.diff.SchemaHole+schemaHole :: (n -> Model.Term) -> (t -> Model.Term) -> (s -> Model.Term) -> Diff.SchemaHole n t s -> Model.Term+schemaHole n t s x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.diff.SchemaHole"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "typeName"),+ Model.fieldTerm = (n (Diff.schemaHoleTypeName x))},+ Model.Field {+ Model.fieldName = (Model.Name "hole"),+ Model.fieldTerm = (hole t s (Diff.schemaHoleHole x))}]})++-- | Encoder for hydra.core.diff.StepEdit+stepEdit :: (a -> Model.Term) -> (s -> Model.Term) -> Diff.StepEdit a s -> Model.Term+stepEdit a s x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.diff.StepEdit"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "step"),+ Model.fieldTerm = (s (Diff.stepEditStep x))},+ Model.Field {+ Model.fieldName = (Model.Name "edit"),+ Model.fieldTerm = (edit a s (Diff.stepEditEdit x))}]})
@@ -0,0 +1,27 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Term encoders for hydra.core.docs++module Hydra.Core.Encode.Docs where++import qualified Hydra.Core.Docs as Docs+import qualified Hydra.Core.Encode.Packaging as Packaging+import qualified Hydra.Core.Model as Model+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | Encoder for hydra.core.docs.DocSegment+docSegment :: Docs.DocSegment -> Model.Term+docSegment x =+ case x of+ Docs.DocSegmentRef v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.docs.DocSegment"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "ref"),+ Model.fieldTerm = (Packaging.entityReference v0)}})+ Docs.DocSegmentText v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.docs.DocSegment"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "text"),+ Model.fieldTerm = (Model.TermLiteral (Model.LiteralString v0))}})
@@ -0,0 +1,244 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Term encoders for hydra.core.error.checking++module Hydra.Core.Encode.Error.Checking where++import qualified Hydra.Core.Encode.Model as EncodeModel+import qualified Hydra.Core.Encode.Paths as Paths+import qualified Hydra.Core.Encode.Typing as Typing+import qualified Hydra.Core.Encode.Variants as Variants+import qualified Hydra.Core.Error.Checking as Checking+import qualified Hydra.Core.Overlay.Haskell.Lib.Lists as Lists+import qualified Hydra.Core.Overlay.Haskell.Lib.Sets as Sets+import qualified Hydra.Core.Model as Model+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | Encoder for hydra.core.error.checking.CheckingError+checkingError :: Checking.CheckingError -> Model.Term+checkingError x =+ case x of+ Checking.CheckingErrorIncorrectUnification v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.checking.CheckingError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "incorrectUnification"),+ Model.fieldTerm = (incorrectUnificationError v0)}})+ Checking.CheckingErrorNotAForallType v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.checking.CheckingError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "notAForallType"),+ Model.fieldTerm = (notAForallTypeError v0)}})+ Checking.CheckingErrorNotAFunctionType v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.checking.CheckingError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "notAFunctionType"),+ Model.fieldTerm = (notAFunctionTypeError v0)}})+ Checking.CheckingErrorOther v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.checking.CheckingError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "other"),+ Model.fieldTerm = (otherCheckingError v0)}})+ Checking.CheckingErrorTypeArityMismatch v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.checking.CheckingError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "typeArityMismatch"),+ Model.fieldTerm = (typeArityMismatchError v0)}})+ Checking.CheckingErrorTypeMismatch v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.checking.CheckingError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "typeMismatch"),+ Model.fieldTerm = (typeMismatchError v0)}})+ Checking.CheckingErrorUnboundTypeVariables v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.checking.CheckingError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "unboundTypeVariables"),+ Model.fieldTerm = (unboundTypeVariablesError v0)}})+ Checking.CheckingErrorUndefinedTermVariable v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.checking.CheckingError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "undefinedTermVariable"),+ Model.fieldTerm = (undefinedTermVariableCheckingError v0)}})+ Checking.CheckingErrorUnequalTypes v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.checking.CheckingError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "unequalTypes"),+ Model.fieldTerm = (unequalTypesError v0)}})+ Checking.CheckingErrorUnsupportedTermVariant v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.checking.CheckingError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "unsupportedTermVariant"),+ Model.fieldTerm = (unsupportedTermVariantError v0)}})+ Checking.CheckingErrorUntypedLambda v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.checking.CheckingError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "untypedLambda"),+ Model.fieldTerm = (untypedLambdaError v0)}})+ Checking.CheckingErrorUntypedLetBinding v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.checking.CheckingError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "untypedLetBinding"),+ Model.fieldTerm = (untypedLetBindingError v0)}})+ Checking.CheckingErrorUntypedTermVariable v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.checking.CheckingError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "untypedTermVariable"),+ Model.fieldTerm = (untypedTermVariableCheckingError v0)}})++-- | Encoder for hydra.core.error.checking.IncorrectUnificationError+incorrectUnificationError :: Checking.IncorrectUnificationError -> Model.Term+incorrectUnificationError x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.checking.IncorrectUnificationError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "substitution"),+ Model.fieldTerm = (Typing.typeSubst (Checking.incorrectUnificationErrorSubstitution x))}]})++-- | Encoder for hydra.core.error.checking.NotAForallTypeError+notAForallTypeError :: Checking.NotAForallTypeError -> Model.Term+notAForallTypeError x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.checking.NotAForallTypeError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "type"),+ Model.fieldTerm = (EncodeModel.type_ (Checking.notAForallTypeErrorType x))},+ Model.Field {+ Model.fieldName = (Model.Name "typeArguments"),+ Model.fieldTerm = ((\xs -> Model.TermList (Lists.map EncodeModel.type_ xs)) (Checking.notAForallTypeErrorTypeArguments x))}]})++-- | Encoder for hydra.core.error.checking.NotAFunctionTypeError+notAFunctionTypeError :: Checking.NotAFunctionTypeError -> Model.Term+notAFunctionTypeError x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.checking.NotAFunctionTypeError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "type"),+ Model.fieldTerm = (EncodeModel.type_ (Checking.notAFunctionTypeErrorType x))}]})++-- | Encoder for hydra.core.error.checking.OtherCheckingError+otherCheckingError :: Checking.OtherCheckingError -> Model.Term+otherCheckingError x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.checking.OtherCheckingError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "path"),+ Model.fieldTerm = (Paths.subtermPath (Checking.otherCheckingErrorPath x))},+ Model.Field {+ Model.fieldName = (Model.Name "message"),+ Model.fieldTerm = ((\x2 -> Model.TermLiteral (Model.LiteralString x2)) (Checking.otherCheckingErrorMessage x))}]})++-- | Encoder for hydra.core.error.checking.TypeArityMismatchError+typeArityMismatchError :: Checking.TypeArityMismatchError -> Model.Term+typeArityMismatchError x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.checking.TypeArityMismatchError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "type"),+ Model.fieldTerm = (EncodeModel.type_ (Checking.typeArityMismatchErrorType x))},+ Model.Field {+ Model.fieldName = (Model.Name "expectedArity"),+ Model.fieldTerm = ((\x2 -> Model.TermLiteral (Model.LiteralInteger (Model.IntegerValueInt32 x2))) (Checking.typeArityMismatchErrorExpectedArity x))},+ Model.Field {+ Model.fieldName = (Model.Name "actualArity"),+ Model.fieldTerm = ((\x2 -> Model.TermLiteral (Model.LiteralInteger (Model.IntegerValueInt32 x2))) (Checking.typeArityMismatchErrorActualArity x))},+ Model.Field {+ Model.fieldName = (Model.Name "typeArguments"),+ Model.fieldTerm = ((\xs -> Model.TermList (Lists.map EncodeModel.type_ xs)) (Checking.typeArityMismatchErrorTypeArguments x))}]})++-- | Encoder for hydra.core.error.checking.TypeMismatchError+typeMismatchError :: Checking.TypeMismatchError -> Model.Term+typeMismatchError x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.checking.TypeMismatchError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "expectedType"),+ Model.fieldTerm = (EncodeModel.type_ (Checking.typeMismatchErrorExpectedType x))},+ Model.Field {+ Model.fieldName = (Model.Name "actualType"),+ Model.fieldTerm = (EncodeModel.type_ (Checking.typeMismatchErrorActualType x))}]})++-- | Encoder for hydra.core.error.checking.UnboundTypeVariablesError+unboundTypeVariablesError :: Checking.UnboundTypeVariablesError -> Model.Term+unboundTypeVariablesError x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.checking.UnboundTypeVariablesError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "variables"),+ Model.fieldTerm = ((\s -> Model.TermSet (Sets.map EncodeModel.name s)) (Checking.unboundTypeVariablesErrorVariables x))},+ Model.Field {+ Model.fieldName = (Model.Name "type"),+ Model.fieldTerm = (EncodeModel.type_ (Checking.unboundTypeVariablesErrorType x))}]})++-- | Encoder for hydra.core.error.checking.UndefinedTermVariableCheckingError+undefinedTermVariableCheckingError :: Checking.UndefinedTermVariableCheckingError -> Model.Term+undefinedTermVariableCheckingError x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.checking.UndefinedTermVariableCheckingError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "path"),+ Model.fieldTerm = (Paths.subtermPath (Checking.undefinedTermVariableCheckingErrorPath x))},+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (EncodeModel.name (Checking.undefinedTermVariableCheckingErrorName x))}]})++-- | Encoder for hydra.core.error.checking.UnequalTypesError+unequalTypesError :: Checking.UnequalTypesError -> Model.Term+unequalTypesError x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.checking.UnequalTypesError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "types"),+ Model.fieldTerm = ((\xs -> Model.TermList (Lists.map EncodeModel.type_ xs)) (Checking.unequalTypesErrorTypes x))},+ Model.Field {+ Model.fieldName = (Model.Name "description"),+ Model.fieldTerm = ((\x2 -> Model.TermLiteral (Model.LiteralString x2)) (Checking.unequalTypesErrorDescription x))}]})++-- | Encoder for hydra.core.error.checking.UnsupportedTermVariantError+unsupportedTermVariantError :: Checking.UnsupportedTermVariantError -> Model.Term+unsupportedTermVariantError x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.checking.UnsupportedTermVariantError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "termVariant"),+ Model.fieldTerm = (Variants.termVariant (Checking.unsupportedTermVariantErrorTermVariant x))}]})++-- | Encoder for hydra.core.error.checking.UntypedLambdaError+untypedLambdaError :: Checking.UntypedLambdaError -> Model.Term+untypedLambdaError x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.checking.UntypedLambdaError"),+ Model.recordFields = []})++-- | Encoder for hydra.core.error.checking.UntypedLetBindingError+untypedLetBindingError :: Checking.UntypedLetBindingError -> Model.Term+untypedLetBindingError x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.checking.UntypedLetBindingError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "binding"),+ Model.fieldTerm = (EncodeModel.binding (Checking.untypedLetBindingErrorBinding x))}]})++-- | Encoder for hydra.core.error.checking.UntypedTermVariableCheckingError+untypedTermVariableCheckingError :: Checking.UntypedTermVariableCheckingError -> Model.Term+untypedTermVariableCheckingError x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.checking.UntypedTermVariableCheckingError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "path"),+ Model.fieldTerm = (Paths.subtermPath (Checking.untypedTermVariableCheckingErrorPath x))},+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (EncodeModel.name (Checking.untypedTermVariableCheckingErrorName x))}]})
@@ -0,0 +1,42 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Term encoders for hydra.core.error.file++module Hydra.Core.Encode.Error.File where++import qualified Hydra.Core.Encode.File as EncodeFile+import qualified Hydra.Core.Error.File as ErrorFile+import qualified Hydra.Core.Model as Model+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | Encoder for hydra.core.error.file.FileError+fileError :: ErrorFile.FileError -> Model.Term+fileError x =+ case x of+ ErrorFile.FileErrorAlreadyExists v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.file.FileError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "alreadyExists"),+ Model.fieldTerm = (EncodeFile.filePath v0)}})+ ErrorFile.FileErrorInvalidPath v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.file.FileError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "invalidPath"),+ Model.fieldTerm = (Model.TermLiteral (Model.LiteralString v0))}})+ ErrorFile.FileErrorNotFound v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.file.FileError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "notFound"),+ Model.fieldTerm = (EncodeFile.filePath v0)}})+ ErrorFile.FileErrorOther v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.file.FileError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "other"),+ Model.fieldTerm = (Model.TermLiteral (Model.LiteralString v0))}})+ ErrorFile.FileErrorPermissionDenied v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.file.FileError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "permissionDenied"),+ Model.fieldTerm = (EncodeFile.filePath v0)}})
@@ -0,0 +1,873 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Term encoders for hydra.core.error.model++module Hydra.Core.Encode.Error.Model where++import qualified Hydra.Core.Encode.Model as EncodeModel+import qualified Hydra.Core.Encode.Paths as Paths+import qualified Hydra.Core.Encode.Variants as Variants+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Overlay.Haskell.Lib.Lists as Lists+import qualified Hydra.Core.Model as Model+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | Encoder for hydra.core.error.model.ConstantConditionError+constantConditionError :: ErrorModel.ConstantConditionError -> Model.Term+constantConditionError x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.ConstantConditionError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Paths.subtermPath (ErrorModel.constantConditionErrorLocation x))},+ Model.Field {+ Model.fieldName = (Model.Name "value"),+ Model.fieldTerm = ((\x2 -> Model.TermLiteral (Model.LiteralBoolean x2)) (ErrorModel.constantConditionErrorValue x))}]})++-- | Encoder for hydra.core.error.model.DuplicateBindingError+duplicateBindingError :: ErrorModel.DuplicateBindingError -> Model.Term+duplicateBindingError x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.DuplicateBindingError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Paths.subtermPath (ErrorModel.duplicateBindingErrorLocation x))},+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (EncodeModel.name (ErrorModel.duplicateBindingErrorName x))}]})++-- | Encoder for hydra.core.error.model.DuplicateFieldError+duplicateFieldError :: ErrorModel.DuplicateFieldError -> Model.Term+duplicateFieldError x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.DuplicateFieldError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Paths.subtermPath (ErrorModel.duplicateFieldErrorLocation x))},+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (EncodeModel.name (ErrorModel.duplicateFieldErrorName x))}]})++-- | Encoder for hydra.core.error.model.DuplicateRecordTypeFieldNamesError+duplicateRecordTypeFieldNamesError :: ErrorModel.DuplicateRecordTypeFieldNamesError -> Model.Term+duplicateRecordTypeFieldNamesError x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.DuplicateRecordTypeFieldNamesError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Paths.subtermPath (ErrorModel.duplicateRecordTypeFieldNamesErrorLocation x))},+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (EncodeModel.name (ErrorModel.duplicateRecordTypeFieldNamesErrorName x))}]})++-- | Encoder for hydra.core.error.model.DuplicateUnionTypeFieldNamesError+duplicateUnionTypeFieldNamesError :: ErrorModel.DuplicateUnionTypeFieldNamesError -> Model.Term+duplicateUnionTypeFieldNamesError x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.DuplicateUnionTypeFieldNamesError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Paths.subtermPath (ErrorModel.duplicateUnionTypeFieldNamesErrorLocation x))},+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (EncodeModel.name (ErrorModel.duplicateUnionTypeFieldNamesErrorName x))}]})++-- | Encoder for hydra.core.error.model.EmptyCaseStatementError+emptyCaseStatementError :: ErrorModel.EmptyCaseStatementError -> Model.Term+emptyCaseStatementError x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.EmptyCaseStatementError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Paths.subtermPath (ErrorModel.emptyCaseStatementErrorLocation x))},+ Model.Field {+ Model.fieldName = (Model.Name "typeName"),+ Model.fieldTerm = (EncodeModel.name (ErrorModel.emptyCaseStatementErrorTypeName x))}]})++-- | Encoder for hydra.core.error.model.EmptyLetBindingsError+emptyLetBindingsError :: ErrorModel.EmptyLetBindingsError -> Model.Term+emptyLetBindingsError x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.EmptyLetBindingsError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Paths.subtermPath (ErrorModel.emptyLetBindingsErrorLocation x))}]})++-- | Encoder for hydra.core.error.model.EmptyRecordTypeError+emptyRecordTypeError :: ErrorModel.EmptyRecordTypeError -> Model.Term+emptyRecordTypeError x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.EmptyRecordTypeError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Paths.subtermPath (ErrorModel.emptyRecordTypeErrorLocation x))}]})++-- | Encoder for hydra.core.error.model.EmptyTermAnnotationError+emptyTermAnnotationError :: ErrorModel.EmptyTermAnnotationError -> Model.Term+emptyTermAnnotationError x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.EmptyTermAnnotationError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Paths.subtermPath (ErrorModel.emptyTermAnnotationErrorLocation x))}]})++-- | Encoder for hydra.core.error.model.EmptyTypeAnnotationError+emptyTypeAnnotationError :: ErrorModel.EmptyTypeAnnotationError -> Model.Term+emptyTypeAnnotationError x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.EmptyTypeAnnotationError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Paths.subtermPath (ErrorModel.emptyTypeAnnotationErrorLocation x))}]})++-- | Encoder for hydra.core.error.model.EmptyTypeNameInTermError+emptyTypeNameInTermError :: ErrorModel.EmptyTypeNameInTermError -> Model.Term+emptyTypeNameInTermError x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.EmptyTypeNameInTermError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Paths.subtermPath (ErrorModel.emptyTypeNameInTermErrorLocation x))}]})++-- | Encoder for hydra.core.error.model.EmptyUnionTypeError+emptyUnionTypeError :: ErrorModel.EmptyUnionTypeError -> Model.Term+emptyUnionTypeError x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.EmptyUnionTypeError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Paths.subtermPath (ErrorModel.emptyUnionTypeErrorLocation x))}]})++-- | Encoder for hydra.core.error.model.ExtraRecordFieldsError+extraRecordFieldsError :: ErrorModel.ExtraRecordFieldsError -> Model.Term+extraRecordFieldsError x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.ExtraRecordFieldsError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Paths.subtermPath (ErrorModel.extraRecordFieldsErrorLocation x))},+ Model.Field {+ Model.fieldName = (Model.Name "typeName"),+ Model.fieldTerm = (EncodeModel.name (ErrorModel.extraRecordFieldsErrorTypeName x))},+ Model.Field {+ Model.fieldName = (Model.Name "fieldNames"),+ Model.fieldTerm = ((\xs -> Model.TermList (Lists.map EncodeModel.name xs)) (ErrorModel.extraRecordFieldsErrorFieldNames x))}]})++-- | Encoder for hydra.core.error.model.InvalidForallParameterNameError+invalidForallParameterNameError :: ErrorModel.InvalidForallParameterNameError -> Model.Term+invalidForallParameterNameError x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.InvalidForallParameterNameError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Paths.subtermPath (ErrorModel.invalidForallParameterNameErrorLocation x))},+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (EncodeModel.name (ErrorModel.invalidForallParameterNameErrorName x))}]})++-- | Encoder for hydra.core.error.model.InvalidLambdaParameterNameError+invalidLambdaParameterNameError :: ErrorModel.InvalidLambdaParameterNameError -> Model.Term+invalidLambdaParameterNameError x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.InvalidLambdaParameterNameError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Paths.subtermPath (ErrorModel.invalidLambdaParameterNameErrorLocation x))},+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (EncodeModel.name (ErrorModel.invalidLambdaParameterNameErrorName x))}]})++-- | Encoder for hydra.core.error.model.InvalidLetBindingNameError+invalidLetBindingNameError :: ErrorModel.InvalidLetBindingNameError -> Model.Term+invalidLetBindingNameError x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.InvalidLetBindingNameError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Paths.subtermPath (ErrorModel.invalidLetBindingNameErrorLocation x))},+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (EncodeModel.name (ErrorModel.invalidLetBindingNameErrorName x))}]})++-- | Encoder for hydra.core.error.model.InvalidLiteralError+invalidLiteralError :: ErrorModel.InvalidLiteralError -> Model.Term+invalidLiteralError x =+ case x of+ ErrorModel.InvalidLiteralErrorTypeMismatch v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.model.InvalidLiteralError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "typeMismatch"),+ Model.fieldTerm = (literalTypeMismatchError v0)}})++-- | Encoder for hydra.core.error.model.InvalidTermError+invalidTermError :: ErrorModel.InvalidTermError -> Model.Term+invalidTermError x =+ case x of+ ErrorModel.InvalidTermErrorConstantCondition v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.model.InvalidTermError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "constantCondition"),+ Model.fieldTerm = (constantConditionError v0)}})+ ErrorModel.InvalidTermErrorDuplicateBinding v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.model.InvalidTermError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "duplicateBinding"),+ Model.fieldTerm = (duplicateBindingError v0)}})+ ErrorModel.InvalidTermErrorDuplicateField v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.model.InvalidTermError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "duplicateField"),+ Model.fieldTerm = (duplicateFieldError v0)}})+ ErrorModel.InvalidTermErrorEmptyCaseStatement v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.model.InvalidTermError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "emptyCaseStatement"),+ Model.fieldTerm = (emptyCaseStatementError v0)}})+ ErrorModel.InvalidTermErrorEmptyLetBindings v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.model.InvalidTermError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "emptyLetBindings"),+ Model.fieldTerm = (emptyLetBindingsError v0)}})+ ErrorModel.InvalidTermErrorEmptyTermAnnotation v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.model.InvalidTermError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "emptyTermAnnotation"),+ Model.fieldTerm = (emptyTermAnnotationError v0)}})+ ErrorModel.InvalidTermErrorEmptyTypeNameInTerm v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.model.InvalidTermError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "emptyTypeNameInTerm"),+ Model.fieldTerm = (emptyTypeNameInTermError v0)}})+ ErrorModel.InvalidTermErrorExtraRecordFields v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.model.InvalidTermError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "extraRecordFields"),+ Model.fieldTerm = (extraRecordFieldsError v0)}})+ ErrorModel.InvalidTermErrorInvalidLambdaParameterName v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.model.InvalidTermError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "invalidLambdaParameterName"),+ Model.fieldTerm = (invalidLambdaParameterNameError v0)}})+ ErrorModel.InvalidTermErrorInvalidLetBindingName v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.model.InvalidTermError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "invalidLetBindingName"),+ Model.fieldTerm = (invalidLetBindingNameError v0)}})+ ErrorModel.InvalidTermErrorInvalidTypeLambdaParameterName v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.model.InvalidTermError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "invalidTypeLambdaParameterName"),+ Model.fieldTerm = (invalidTypeLambdaParameterNameError v0)}})+ ErrorModel.InvalidTermErrorMissingCaseBranches v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.model.InvalidTermError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "missingCaseBranches"),+ Model.fieldTerm = (missingCaseBranchesError v0)}})+ ErrorModel.InvalidTermErrorMissingRecordFields v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.model.InvalidTermError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "missingRecordFields"),+ Model.fieldTerm = (missingRecordFieldsError v0)}})+ ErrorModel.InvalidTermErrorNestedTermAnnotation v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.model.InvalidTermError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "nestedTermAnnotation"),+ Model.fieldTerm = (nestedTermAnnotationError v0)}})+ ErrorModel.InvalidTermErrorNominalTypeKindMismatch v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.model.InvalidTermError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "nominalTypeKindMismatch"),+ Model.fieldTerm = (nominalTypeKindMismatchError v0)}})+ ErrorModel.InvalidTermErrorRedundantWrapUnwrap v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.model.InvalidTermError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "redundantWrapUnwrap"),+ Model.fieldTerm = (redundantWrapUnwrapError v0)}})+ ErrorModel.InvalidTermErrorSelfApplication v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.model.InvalidTermError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "selfApplication"),+ Model.fieldTerm = (selfApplicationError v0)}})+ ErrorModel.InvalidTermErrorTermVariableShadowing v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.model.InvalidTermError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "termVariableShadowing"),+ Model.fieldTerm = (termVariableShadowingError v0)}})+ ErrorModel.InvalidTermErrorTypeVariableShadowingInTypeLambda v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.model.InvalidTermError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "typeVariableShadowingInTypeLambda"),+ Model.fieldTerm = (typeVariableShadowingInTypeLambdaError v0)}})+ ErrorModel.InvalidTermErrorUndeclaredVariant v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.model.InvalidTermError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "undeclaredVariant"),+ Model.fieldTerm = (undeclaredVariantError v0)}})+ ErrorModel.InvalidTermErrorUndefinedTermVariable v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.model.InvalidTermError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "undefinedTermVariable"),+ Model.fieldTerm = (undefinedTermVariableError v0)}})+ ErrorModel.InvalidTermErrorUndefinedTypeVariableInBindingType v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.model.InvalidTermError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "undefinedTypeVariableInBindingType"),+ Model.fieldTerm = (undefinedTypeVariableInBindingTypeError v0)}})+ ErrorModel.InvalidTermErrorUndefinedTypeVariableInLambdaDomain v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.model.InvalidTermError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "undefinedTypeVariableInLambdaDomain"),+ Model.fieldTerm = (undefinedTypeVariableInLambdaDomainError v0)}})+ ErrorModel.InvalidTermErrorUndefinedTypeVariableInTypeApplication v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.model.InvalidTermError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "undefinedTypeVariableInTypeApplication"),+ Model.fieldTerm = (undefinedTypeVariableInTypeApplicationError v0)}})+ ErrorModel.InvalidTermErrorUnknownCaseAlternative v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.model.InvalidTermError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "unknownCaseAlternative"),+ Model.fieldTerm = (unknownCaseAlternativeError v0)}})+ ErrorModel.InvalidTermErrorUnknownPrimitiveName v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.model.InvalidTermError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "unknownPrimitiveName"),+ Model.fieldTerm = (unknownPrimitiveNameError v0)}})+ ErrorModel.InvalidTermErrorUnknownProjectedField v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.model.InvalidTermError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "unknownProjectedField"),+ Model.fieldTerm = (unknownProjectedFieldError v0)}})+ ErrorModel.InvalidTermErrorUnnecessaryIdentityApplication v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.model.InvalidTermError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "unnecessaryIdentityApplication"),+ Model.fieldTerm = (unnecessaryIdentityApplicationError v0)}})+ ErrorModel.InvalidTermErrorUnresolvedNominalType v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.model.InvalidTermError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "unresolvedNominalType"),+ Model.fieldTerm = (unresolvedNominalTypeError v0)}})+ ErrorModel.InvalidTermErrorUntypedTermVariable v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.model.InvalidTermError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "untypedTermVariable"),+ Model.fieldTerm = (untypedTermVariableError v0)}})++-- | Encoder for hydra.core.error.model.InvalidTypeError+invalidTypeError :: ErrorModel.InvalidTypeError -> Model.Term+invalidTypeError x =+ case x of+ ErrorModel.InvalidTypeErrorDuplicateRecordTypeFieldNames v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.model.InvalidTypeError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "duplicateRecordTypeFieldNames"),+ Model.fieldTerm = (duplicateRecordTypeFieldNamesError v0)}})+ ErrorModel.InvalidTypeErrorDuplicateUnionTypeFieldNames v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.model.InvalidTypeError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "duplicateUnionTypeFieldNames"),+ Model.fieldTerm = (duplicateUnionTypeFieldNamesError v0)}})+ ErrorModel.InvalidTypeErrorEmptyRecordType v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.model.InvalidTypeError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "emptyRecordType"),+ Model.fieldTerm = (emptyRecordTypeError v0)}})+ ErrorModel.InvalidTypeErrorEmptyTypeAnnotation v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.model.InvalidTypeError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "emptyTypeAnnotation"),+ Model.fieldTerm = (emptyTypeAnnotationError v0)}})+ ErrorModel.InvalidTypeErrorEmptyUnionType v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.model.InvalidTypeError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "emptyUnionType"),+ Model.fieldTerm = (emptyUnionTypeError v0)}})+ ErrorModel.InvalidTypeErrorInvalidForallParameterName v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.model.InvalidTypeError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "invalidForallParameterName"),+ Model.fieldTerm = (invalidForallParameterNameError v0)}})+ ErrorModel.InvalidTypeErrorInvalidTypeSchemeVariableName v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.model.InvalidTypeError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "invalidTypeSchemeVariableName"),+ Model.fieldTerm = (invalidTypeSchemeVariableNameError v0)}})+ ErrorModel.InvalidTypeErrorNestedTypeAnnotation v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.model.InvalidTypeError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "nestedTypeAnnotation"),+ Model.fieldTerm = (nestedTypeAnnotationError v0)}})+ ErrorModel.InvalidTypeErrorNonComparableMapKeyType v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.model.InvalidTypeError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "nonComparableMapKeyType"),+ Model.fieldTerm = (nonComparableMapKeyTypeError v0)}})+ ErrorModel.InvalidTypeErrorNonComparableSetElementType v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.model.InvalidTypeError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "nonComparableSetElementType"),+ Model.fieldTerm = (nonComparableSetElementTypeError v0)}})+ ErrorModel.InvalidTypeErrorSingleVariantUnion v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.model.InvalidTypeError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "singleVariantUnion"),+ Model.fieldTerm = (singleVariantUnionError v0)}})+ ErrorModel.InvalidTypeErrorTypeVariableShadowingInForall v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.model.InvalidTypeError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "typeVariableShadowingInForall"),+ Model.fieldTerm = (typeVariableShadowingInForallError v0)}})+ ErrorModel.InvalidTypeErrorUndefinedTypeVariable v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.model.InvalidTypeError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "undefinedTypeVariable"),+ Model.fieldTerm = (undefinedTypeVariableError v0)}})+ ErrorModel.InvalidTypeErrorVoidInNonBottomPosition v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.model.InvalidTypeError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "voidInNonBottomPosition"),+ Model.fieldTerm = (voidInNonBottomPositionError v0)}})++-- | Encoder for hydra.core.error.model.InvalidTypeLambdaParameterNameError+invalidTypeLambdaParameterNameError :: ErrorModel.InvalidTypeLambdaParameterNameError -> Model.Term+invalidTypeLambdaParameterNameError x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.InvalidTypeLambdaParameterNameError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Paths.subtermPath (ErrorModel.invalidTypeLambdaParameterNameErrorLocation x))},+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (EncodeModel.name (ErrorModel.invalidTypeLambdaParameterNameErrorName x))}]})++-- | Encoder for hydra.core.error.model.InvalidTypeSchemeVariableNameError+invalidTypeSchemeVariableNameError :: ErrorModel.InvalidTypeSchemeVariableNameError -> Model.Term+invalidTypeSchemeVariableNameError x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.InvalidTypeSchemeVariableNameError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Paths.subtermPath (ErrorModel.invalidTypeSchemeVariableNameErrorLocation x))},+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (EncodeModel.name (ErrorModel.invalidTypeSchemeVariableNameErrorName x))}]})++-- | Encoder for hydra.core.error.model.LiteralTypeMismatchError+literalTypeMismatchError :: ErrorModel.LiteralTypeMismatchError -> Model.Term+literalTypeMismatchError x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.LiteralTypeMismatchError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "expectedType"),+ Model.fieldTerm = (EncodeModel.literalType (ErrorModel.literalTypeMismatchErrorExpectedType x))},+ Model.Field {+ Model.fieldName = (Model.Name "actualType"),+ Model.fieldTerm = (EncodeModel.literalType (ErrorModel.literalTypeMismatchErrorActualType x))}]})++-- | Encoder for hydra.core.error.model.MissingCaseBranchesError+missingCaseBranchesError :: ErrorModel.MissingCaseBranchesError -> Model.Term+missingCaseBranchesError x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.MissingCaseBranchesError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Paths.subtermPath (ErrorModel.missingCaseBranchesErrorLocation x))},+ Model.Field {+ Model.fieldName = (Model.Name "typeName"),+ Model.fieldTerm = (EncodeModel.name (ErrorModel.missingCaseBranchesErrorTypeName x))},+ Model.Field {+ Model.fieldName = (Model.Name "variantNames"),+ Model.fieldTerm = ((\xs -> Model.TermList (Lists.map EncodeModel.name xs)) (ErrorModel.missingCaseBranchesErrorVariantNames x))}]})++-- | Encoder for hydra.core.error.model.MissingRecordFieldsError+missingRecordFieldsError :: ErrorModel.MissingRecordFieldsError -> Model.Term+missingRecordFieldsError x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.MissingRecordFieldsError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Paths.subtermPath (ErrorModel.missingRecordFieldsErrorLocation x))},+ Model.Field {+ Model.fieldName = (Model.Name "typeName"),+ Model.fieldTerm = (EncodeModel.name (ErrorModel.missingRecordFieldsErrorTypeName x))},+ Model.Field {+ Model.fieldName = (Model.Name "fieldNames"),+ Model.fieldTerm = ((\xs -> Model.TermList (Lists.map EncodeModel.name xs)) (ErrorModel.missingRecordFieldsErrorFieldNames x))}]})++-- | Encoder for hydra.core.error.model.NestedTermAnnotationError+nestedTermAnnotationError :: ErrorModel.NestedTermAnnotationError -> Model.Term+nestedTermAnnotationError x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.NestedTermAnnotationError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Paths.subtermPath (ErrorModel.nestedTermAnnotationErrorLocation x))}]})++-- | Encoder for hydra.core.error.model.NestedTypeAnnotationError+nestedTypeAnnotationError :: ErrorModel.NestedTypeAnnotationError -> Model.Term+nestedTypeAnnotationError x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.NestedTypeAnnotationError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Paths.subtermPath (ErrorModel.nestedTypeAnnotationErrorLocation x))}]})++-- | Encoder for hydra.core.error.model.NominalTypeKindMismatchError+nominalTypeKindMismatchError :: ErrorModel.NominalTypeKindMismatchError -> Model.Term+nominalTypeKindMismatchError x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.NominalTypeKindMismatchError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Paths.subtermPath (ErrorModel.nominalTypeKindMismatchErrorLocation x))},+ Model.Field {+ Model.fieldName = (Model.Name "typeName"),+ Model.fieldTerm = (EncodeModel.name (ErrorModel.nominalTypeKindMismatchErrorTypeName x))},+ Model.Field {+ Model.fieldName = (Model.Name "expectedVariant"),+ Model.fieldTerm = (Variants.typeVariant (ErrorModel.nominalTypeKindMismatchErrorExpectedVariant x))},+ Model.Field {+ Model.fieldName = (Model.Name "actualVariant"),+ Model.fieldTerm = (Variants.typeVariant (ErrorModel.nominalTypeKindMismatchErrorActualVariant x))}]})++-- | Encoder for hydra.core.error.model.NonComparableMapKeyTypeError+nonComparableMapKeyTypeError :: ErrorModel.NonComparableMapKeyTypeError -> Model.Term+nonComparableMapKeyTypeError x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.NonComparableMapKeyTypeError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Paths.subtermPath (ErrorModel.nonComparableMapKeyTypeErrorLocation x))},+ Model.Field {+ Model.fieldName = (Model.Name "keyType"),+ Model.fieldTerm = (EncodeModel.type_ (ErrorModel.nonComparableMapKeyTypeErrorKeyType x))}]})++-- | Encoder for hydra.core.error.model.NonComparableSetElementTypeError+nonComparableSetElementTypeError :: ErrorModel.NonComparableSetElementTypeError -> Model.Term+nonComparableSetElementTypeError x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.NonComparableSetElementTypeError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Paths.subtermPath (ErrorModel.nonComparableSetElementTypeErrorLocation x))},+ Model.Field {+ Model.fieldName = (Model.Name "elementType"),+ Model.fieldTerm = (EncodeModel.type_ (ErrorModel.nonComparableSetElementTypeErrorElementType x))}]})++-- | Encoder for hydra.core.error.model.RedundantWrapUnwrapError+redundantWrapUnwrapError :: ErrorModel.RedundantWrapUnwrapError -> Model.Term+redundantWrapUnwrapError x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.RedundantWrapUnwrapError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Paths.subtermPath (ErrorModel.redundantWrapUnwrapErrorLocation x))},+ Model.Field {+ Model.fieldName = (Model.Name "typeName"),+ Model.fieldTerm = (EncodeModel.name (ErrorModel.redundantWrapUnwrapErrorTypeName x))}]})++-- | Encoder for hydra.core.error.model.SelfApplicationError+selfApplicationError :: ErrorModel.SelfApplicationError -> Model.Term+selfApplicationError x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.SelfApplicationError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Paths.subtermPath (ErrorModel.selfApplicationErrorLocation x))},+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (EncodeModel.name (ErrorModel.selfApplicationErrorName x))}]})++-- | Encoder for hydra.core.error.model.SingleVariantUnionError+singleVariantUnionError :: ErrorModel.SingleVariantUnionError -> Model.Term+singleVariantUnionError x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.SingleVariantUnionError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Paths.subtermPath (ErrorModel.singleVariantUnionErrorLocation x))},+ Model.Field {+ Model.fieldName = (Model.Name "fieldName"),+ Model.fieldTerm = (EncodeModel.name (ErrorModel.singleVariantUnionErrorFieldName x))}]})++-- | Encoder for hydra.core.error.model.TermVariableShadowingError+termVariableShadowingError :: ErrorModel.TermVariableShadowingError -> Model.Term+termVariableShadowingError x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.TermVariableShadowingError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Paths.subtermPath (ErrorModel.termVariableShadowingErrorLocation x))},+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (EncodeModel.name (ErrorModel.termVariableShadowingErrorName x))}]})++-- | Encoder for hydra.core.error.model.TypeVariableShadowingInForallError+typeVariableShadowingInForallError :: ErrorModel.TypeVariableShadowingInForallError -> Model.Term+typeVariableShadowingInForallError x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.TypeVariableShadowingInForallError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Paths.subtermPath (ErrorModel.typeVariableShadowingInForallErrorLocation x))},+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (EncodeModel.name (ErrorModel.typeVariableShadowingInForallErrorName x))}]})++-- | Encoder for hydra.core.error.model.TypeVariableShadowingInTypeLambdaError+typeVariableShadowingInTypeLambdaError :: ErrorModel.TypeVariableShadowingInTypeLambdaError -> Model.Term+typeVariableShadowingInTypeLambdaError x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.TypeVariableShadowingInTypeLambdaError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Paths.subtermPath (ErrorModel.typeVariableShadowingInTypeLambdaErrorLocation x))},+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (EncodeModel.name (ErrorModel.typeVariableShadowingInTypeLambdaErrorName x))}]})++-- | Encoder for hydra.core.error.model.UndeclaredVariantError+undeclaredVariantError :: ErrorModel.UndeclaredVariantError -> Model.Term+undeclaredVariantError x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.UndeclaredVariantError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Paths.subtermPath (ErrorModel.undeclaredVariantErrorLocation x))},+ Model.Field {+ Model.fieldName = (Model.Name "typeName"),+ Model.fieldTerm = (EncodeModel.name (ErrorModel.undeclaredVariantErrorTypeName x))},+ Model.Field {+ Model.fieldName = (Model.Name "variantName"),+ Model.fieldTerm = (EncodeModel.name (ErrorModel.undeclaredVariantErrorVariantName x))}]})++-- | Encoder for hydra.core.error.model.UndefinedFieldError+undefinedFieldError :: ErrorModel.UndefinedFieldError -> Model.Term+undefinedFieldError x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.UndefinedFieldError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "fieldName"),+ Model.fieldTerm = (EncodeModel.name (ErrorModel.undefinedFieldErrorFieldName x))},+ Model.Field {+ Model.fieldName = (Model.Name "typeName"),+ Model.fieldTerm = (EncodeModel.name (ErrorModel.undefinedFieldErrorTypeName x))}]})++-- | Encoder for hydra.core.error.model.UndefinedTermVariableError+undefinedTermVariableError :: ErrorModel.UndefinedTermVariableError -> Model.Term+undefinedTermVariableError x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.UndefinedTermVariableError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Paths.subtermPath (ErrorModel.undefinedTermVariableErrorLocation x))},+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (EncodeModel.name (ErrorModel.undefinedTermVariableErrorName x))}]})++-- | Encoder for hydra.core.error.model.UndefinedTypeVariableError+undefinedTypeVariableError :: ErrorModel.UndefinedTypeVariableError -> Model.Term+undefinedTypeVariableError x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.UndefinedTypeVariableError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Paths.subtermPath (ErrorModel.undefinedTypeVariableErrorLocation x))},+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (EncodeModel.name (ErrorModel.undefinedTypeVariableErrorName x))}]})++-- | Encoder for hydra.core.error.model.UndefinedTypeVariableInBindingTypeError+undefinedTypeVariableInBindingTypeError :: ErrorModel.UndefinedTypeVariableInBindingTypeError -> Model.Term+undefinedTypeVariableInBindingTypeError x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.UndefinedTypeVariableInBindingTypeError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Paths.subtermPath (ErrorModel.undefinedTypeVariableInBindingTypeErrorLocation x))},+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (EncodeModel.name (ErrorModel.undefinedTypeVariableInBindingTypeErrorName x))}]})++-- | Encoder for hydra.core.error.model.UndefinedTypeVariableInLambdaDomainError+undefinedTypeVariableInLambdaDomainError :: ErrorModel.UndefinedTypeVariableInLambdaDomainError -> Model.Term+undefinedTypeVariableInLambdaDomainError x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.UndefinedTypeVariableInLambdaDomainError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Paths.subtermPath (ErrorModel.undefinedTypeVariableInLambdaDomainErrorLocation x))},+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (EncodeModel.name (ErrorModel.undefinedTypeVariableInLambdaDomainErrorName x))}]})++-- | Encoder for hydra.core.error.model.UndefinedTypeVariableInTypeApplicationError+undefinedTypeVariableInTypeApplicationError :: ErrorModel.UndefinedTypeVariableInTypeApplicationError -> Model.Term+undefinedTypeVariableInTypeApplicationError x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.UndefinedTypeVariableInTypeApplicationError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Paths.subtermPath (ErrorModel.undefinedTypeVariableInTypeApplicationErrorLocation x))},+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (EncodeModel.name (ErrorModel.undefinedTypeVariableInTypeApplicationErrorName x))}]})++-- | Encoder for hydra.core.error.model.UnexpectedTermVariantError+unexpectedTermVariantError :: ErrorModel.UnexpectedTermVariantError -> Model.Term+unexpectedTermVariantError x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.UnexpectedTermVariantError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "expectedVariant"),+ Model.fieldTerm = (Variants.termVariant (ErrorModel.unexpectedTermVariantErrorExpectedVariant x))},+ Model.Field {+ Model.fieldName = (Model.Name "actualTerm"),+ Model.fieldTerm = (EncodeModel.term (ErrorModel.unexpectedTermVariantErrorActualTerm x))}]})++-- | Encoder for hydra.core.error.model.UnexpectedTypeVariantError+unexpectedTypeVariantError :: ErrorModel.UnexpectedTypeVariantError -> Model.Term+unexpectedTypeVariantError x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.UnexpectedTypeVariantError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "expectedVariant"),+ Model.fieldTerm = (Variants.typeVariant (ErrorModel.unexpectedTypeVariantErrorExpectedVariant x))},+ Model.Field {+ Model.fieldName = (Model.Name "actualType"),+ Model.fieldTerm = (EncodeModel.type_ (ErrorModel.unexpectedTypeVariantErrorActualType x))}]})++-- | Encoder for hydra.core.error.model.UnknownCaseAlternativeError+unknownCaseAlternativeError :: ErrorModel.UnknownCaseAlternativeError -> Model.Term+unknownCaseAlternativeError x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.UnknownCaseAlternativeError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Paths.subtermPath (ErrorModel.unknownCaseAlternativeErrorLocation x))},+ Model.Field {+ Model.fieldName = (Model.Name "typeName"),+ Model.fieldTerm = (EncodeModel.name (ErrorModel.unknownCaseAlternativeErrorTypeName x))},+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (EncodeModel.name (ErrorModel.unknownCaseAlternativeErrorName x))}]})++-- | Encoder for hydra.core.error.model.UnknownPrimitiveNameError+unknownPrimitiveNameError :: ErrorModel.UnknownPrimitiveNameError -> Model.Term+unknownPrimitiveNameError x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.UnknownPrimitiveNameError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Paths.subtermPath (ErrorModel.unknownPrimitiveNameErrorLocation x))},+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (EncodeModel.name (ErrorModel.unknownPrimitiveNameErrorName x))}]})++-- | Encoder for hydra.core.error.model.UnknownProjectedFieldError+unknownProjectedFieldError :: ErrorModel.UnknownProjectedFieldError -> Model.Term+unknownProjectedFieldError x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.UnknownProjectedFieldError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Paths.subtermPath (ErrorModel.unknownProjectedFieldErrorLocation x))},+ Model.Field {+ Model.fieldName = (Model.Name "typeName"),+ Model.fieldTerm = (EncodeModel.name (ErrorModel.unknownProjectedFieldErrorTypeName x))},+ Model.Field {+ Model.fieldName = (Model.Name "fieldName"),+ Model.fieldTerm = (EncodeModel.name (ErrorModel.unknownProjectedFieldErrorFieldName x))}]})++-- | Encoder for hydra.core.error.model.UnnecessaryIdentityApplicationError+unnecessaryIdentityApplicationError :: ErrorModel.UnnecessaryIdentityApplicationError -> Model.Term+unnecessaryIdentityApplicationError x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.UnnecessaryIdentityApplicationError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Paths.subtermPath (ErrorModel.unnecessaryIdentityApplicationErrorLocation x))}]})++-- | Encoder for hydra.core.error.model.UnresolvedNominalTypeError+unresolvedNominalTypeError :: ErrorModel.UnresolvedNominalTypeError -> Model.Term+unresolvedNominalTypeError x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.UnresolvedNominalTypeError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Paths.subtermPath (ErrorModel.unresolvedNominalTypeErrorLocation x))},+ Model.Field {+ Model.fieldName = (Model.Name "typeName"),+ Model.fieldTerm = (EncodeModel.name (ErrorModel.unresolvedNominalTypeErrorTypeName x))}]})++-- | Encoder for hydra.core.error.model.UntypedTermVariableError+untypedTermVariableError :: ErrorModel.UntypedTermVariableError -> Model.Term+untypedTermVariableError x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.UntypedTermVariableError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Paths.subtermPath (ErrorModel.untypedTermVariableErrorLocation x))},+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (EncodeModel.name (ErrorModel.untypedTermVariableErrorName x))}]})++-- | Encoder for hydra.core.error.model.VoidInNonBottomPositionError+voidInNonBottomPositionError :: ErrorModel.VoidInNonBottomPositionError -> Model.Term+voidInNonBottomPositionError x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.model.VoidInNonBottomPositionError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "location"),+ Model.fieldTerm = (Paths.subtermPath (ErrorModel.voidInNonBottomPositionErrorLocation x))}]})
@@ -0,0 +1,272 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Term encoders for hydra.core.error.packaging++module Hydra.Core.Encode.Error.Packaging where++import qualified Hydra.Core.Encode.Model as EncodeModel+import qualified Hydra.Core.Encode.Packaging as EncodePackaging+import qualified Hydra.Core.Encode.Util as Util+import qualified Hydra.Core.Error.Packaging as ErrorPackaging+import qualified Hydra.Core.Model as Model+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | Encoder for hydra.core.error.packaging.ConflictingModuleNameError+conflictingModuleNameError :: ErrorPackaging.ConflictingModuleNameError -> Model.Term+conflictingModuleNameError x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.packaging.ConflictingModuleNameError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "first"),+ Model.fieldTerm = (EncodePackaging.moduleName (ErrorPackaging.conflictingModuleNameErrorFirst x))},+ Model.Field {+ Model.fieldName = (Model.Name "second"),+ Model.fieldTerm = (EncodePackaging.moduleName (ErrorPackaging.conflictingModuleNameErrorSecond x))}]})++-- | Encoder for hydra.core.error.packaging.ConflictingVariantNameError+conflictingVariantNameError :: ErrorPackaging.ConflictingVariantNameError -> Model.Term+conflictingVariantNameError x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.packaging.ConflictingVariantNameError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "moduleName"),+ Model.fieldTerm = (EncodePackaging.moduleName (ErrorPackaging.conflictingVariantNameErrorModuleName x))},+ Model.Field {+ Model.fieldName = (Model.Name "typeName"),+ Model.fieldTerm = (EncodeModel.name (ErrorPackaging.conflictingVariantNameErrorTypeName x))},+ Model.Field {+ Model.fieldName = (Model.Name "variantName"),+ Model.fieldTerm = (EncodeModel.name (ErrorPackaging.conflictingVariantNameErrorVariantName x))},+ Model.Field {+ Model.fieldName = (Model.Name "conflictingName"),+ Model.fieldTerm = (EncodeModel.name (ErrorPackaging.conflictingVariantNameErrorConflictingName x))}]})++-- | Encoder for hydra.core.error.packaging.DefinitionNotInModuleNameError+definitionNotInModuleNameError :: ErrorPackaging.DefinitionNotInModuleNameError -> Model.Term+definitionNotInModuleNameError x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.packaging.DefinitionNotInModuleNameError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "moduleName"),+ Model.fieldTerm = (EncodePackaging.moduleName (ErrorPackaging.definitionNotInModuleNameErrorModuleName x))},+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (EncodeModel.name (ErrorPackaging.definitionNotInModuleNameErrorName x))}]})++-- | Encoder for hydra.core.error.packaging.DefinitionsOutOfOrderError+definitionsOutOfOrderError :: ErrorPackaging.DefinitionsOutOfOrderError -> Model.Term+definitionsOutOfOrderError x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.packaging.DefinitionsOutOfOrderError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "moduleName"),+ Model.fieldTerm = (EncodePackaging.moduleName (ErrorPackaging.definitionsOutOfOrderErrorModuleName x))},+ Model.Field {+ Model.fieldName = (Model.Name "precedingName"),+ Model.fieldTerm = (EncodeModel.name (ErrorPackaging.definitionsOutOfOrderErrorPrecedingName x))},+ Model.Field {+ Model.fieldName = (Model.Name "followingName"),+ Model.fieldTerm = (EncodeModel.name (ErrorPackaging.definitionsOutOfOrderErrorFollowingName x))}]})++-- | Encoder for hydra.core.error.packaging.DuplicateDefinitionNameError+duplicateDefinitionNameError :: ErrorPackaging.DuplicateDefinitionNameError -> Model.Term+duplicateDefinitionNameError x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.packaging.DuplicateDefinitionNameError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "moduleName"),+ Model.fieldTerm = (EncodePackaging.moduleName (ErrorPackaging.duplicateDefinitionNameErrorModuleName x))},+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (EncodeModel.name (ErrorPackaging.duplicateDefinitionNameErrorName x))}]})++-- | Encoder for hydra.core.error.packaging.DuplicateModuleNameError+duplicateModuleNameError :: ErrorPackaging.DuplicateModuleNameError -> Model.Term+duplicateModuleNameError x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.packaging.DuplicateModuleNameError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "moduleName"),+ Model.fieldTerm = (EncodePackaging.moduleName (ErrorPackaging.duplicateModuleNameErrorModuleName x))}]})++-- | Encoder for hydra.core.error.packaging.InvalidDefinitionNameError+invalidDefinitionNameError :: ErrorPackaging.InvalidDefinitionNameError -> Model.Term+invalidDefinitionNameError x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.packaging.InvalidDefinitionNameError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "moduleName"),+ Model.fieldTerm = (EncodePackaging.moduleName (ErrorPackaging.invalidDefinitionNameErrorModuleName x))},+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (EncodeModel.name (ErrorPackaging.invalidDefinitionNameErrorName x))},+ Model.Field {+ Model.fieldName = (Model.Name "expectedConvention"),+ Model.fieldTerm = (Util.caseConvention (ErrorPackaging.invalidDefinitionNameErrorExpectedConvention x))}]})++-- | Encoder for hydra.core.error.packaging.InvalidModuleError+invalidModuleError :: ErrorPackaging.InvalidModuleError -> Model.Term+invalidModuleError x =+ case x of+ ErrorPackaging.InvalidModuleErrorConflictingVariantName v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.packaging.InvalidModuleError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "conflictingVariantName"),+ Model.fieldTerm = (conflictingVariantNameError v0)}})+ ErrorPackaging.InvalidModuleErrorDefinitionNotInModuleName v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.packaging.InvalidModuleError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "definitionNotInModuleName"),+ Model.fieldTerm = (definitionNotInModuleNameError v0)}})+ ErrorPackaging.InvalidModuleErrorDefinitionsOutOfOrder v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.packaging.InvalidModuleError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "definitionsOutOfOrder"),+ Model.fieldTerm = (definitionsOutOfOrderError v0)}})+ ErrorPackaging.InvalidModuleErrorDuplicateDefinitionName v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.packaging.InvalidModuleError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "duplicateDefinitionName"),+ Model.fieldTerm = (duplicateDefinitionNameError v0)}})+ ErrorPackaging.InvalidModuleErrorInvalidDefinitionName v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.packaging.InvalidModuleError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "invalidDefinitionName"),+ Model.fieldTerm = (invalidDefinitionNameError v0)}})+ ErrorPackaging.InvalidModuleErrorInvalidModuleNameConvention v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.packaging.InvalidModuleError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "invalidModuleNameConvention"),+ Model.fieldTerm = (invalidModuleNameConventionError v0)}})+ ErrorPackaging.InvalidModuleErrorMissingDocumentation v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.packaging.InvalidModuleError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "missingDocumentation"),+ Model.fieldTerm = (missingDocumentationError v0)}})++-- | Encoder for hydra.core.error.packaging.InvalidModuleNameConventionError+invalidModuleNameConventionError :: ErrorPackaging.InvalidModuleNameConventionError -> Model.Term+invalidModuleNameConventionError x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.packaging.InvalidModuleNameConventionError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "moduleName"),+ Model.fieldTerm = (EncodePackaging.moduleName (ErrorPackaging.invalidModuleNameConventionErrorModuleName x))}]})++-- | Encoder for hydra.core.error.packaging.InvalidPackageError+invalidPackageError :: ErrorPackaging.InvalidPackageError -> Model.Term+invalidPackageError x =+ case x of+ ErrorPackaging.InvalidPackageErrorConflictingModuleName v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.packaging.InvalidPackageError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "conflictingModuleName"),+ Model.fieldTerm = (conflictingModuleNameError v0)}})+ ErrorPackaging.InvalidPackageErrorDuplicateModuleName v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.packaging.InvalidPackageError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "duplicateModuleName"),+ Model.fieldTerm = (duplicateModuleNameError v0)}})+ ErrorPackaging.InvalidPackageErrorInvalidModule v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.packaging.InvalidPackageError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "invalidModule"),+ Model.fieldTerm = (invalidModuleError v0)}})+ ErrorPackaging.InvalidPackageErrorInvalidPackageName v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.packaging.InvalidPackageError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "invalidPackageName"),+ Model.fieldTerm = (invalidPackageNameError v0)}})+ ErrorPackaging.InvalidPackageErrorModuleInMultiplePackages v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.packaging.InvalidPackageError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "moduleInMultiplePackages"),+ Model.fieldTerm = (moduleInMultiplePackagesError v0)}})+ ErrorPackaging.InvalidPackageErrorNestedModuleName v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.packaging.InvalidPackageError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "nestedModuleName"),+ Model.fieldTerm = (nestedModuleNameError v0)}})+ ErrorPackaging.InvalidPackageErrorUndeclaredDependency v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.packaging.InvalidPackageError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "undeclaredDependency"),+ Model.fieldTerm = (undeclaredDependencyError v0)}})++-- | Encoder for hydra.core.error.packaging.InvalidPackageNameError+invalidPackageNameError :: ErrorPackaging.InvalidPackageNameError -> Model.Term+invalidPackageNameError x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.packaging.InvalidPackageNameError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "packageName"),+ Model.fieldTerm = (EncodePackaging.packageName (ErrorPackaging.invalidPackageNameErrorPackageName x))}]})++-- | Encoder for hydra.core.error.packaging.MissingDocumentationError+missingDocumentationError :: ErrorPackaging.MissingDocumentationError -> Model.Term+missingDocumentationError x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.packaging.MissingDocumentationError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "moduleName"),+ Model.fieldTerm = (EncodePackaging.moduleName (ErrorPackaging.missingDocumentationErrorModuleName x))},+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (EncodeModel.name (ErrorPackaging.missingDocumentationErrorName x))}]})++-- | Encoder for hydra.core.error.packaging.ModuleInMultiplePackagesError+moduleInMultiplePackagesError :: ErrorPackaging.ModuleInMultiplePackagesError -> Model.Term+moduleInMultiplePackagesError x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.packaging.ModuleInMultiplePackagesError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "moduleName"),+ Model.fieldTerm = (EncodePackaging.moduleName (ErrorPackaging.moduleInMultiplePackagesErrorModuleName x))},+ Model.Field {+ Model.fieldName = (Model.Name "firstPackage"),+ Model.fieldTerm = (EncodePackaging.packageName (ErrorPackaging.moduleInMultiplePackagesErrorFirstPackage x))},+ Model.Field {+ Model.fieldName = (Model.Name "secondPackage"),+ Model.fieldTerm = (EncodePackaging.packageName (ErrorPackaging.moduleInMultiplePackagesErrorSecondPackage x))}]})++-- | Encoder for hydra.core.error.packaging.NestedModuleNameError+nestedModuleNameError :: ErrorPackaging.NestedModuleNameError -> Model.Term+nestedModuleNameError x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.packaging.NestedModuleNameError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "outer"),+ Model.fieldTerm = (EncodePackaging.moduleName (ErrorPackaging.nestedModuleNameErrorOuter x))},+ Model.Field {+ Model.fieldName = (Model.Name "inner"),+ Model.fieldTerm = (EncodePackaging.moduleName (ErrorPackaging.nestedModuleNameErrorInner x))}]})++-- | Encoder for hydra.core.error.packaging.UndeclaredDependencyError+undeclaredDependencyError :: ErrorPackaging.UndeclaredDependencyError -> Model.Term+undeclaredDependencyError x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.error.packaging.UndeclaredDependencyError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "moduleName"),+ Model.fieldTerm = (EncodePackaging.moduleName (ErrorPackaging.undeclaredDependencyErrorModuleName x))},+ Model.Field {+ Model.fieldName = (Model.Name "referencedName"),+ Model.fieldTerm = (EncodeModel.name (ErrorPackaging.undeclaredDependencyErrorReferencedName x))},+ Model.Field {+ Model.fieldName = (Model.Name "owningModuleName"),+ Model.fieldTerm = (EncodePackaging.moduleName (ErrorPackaging.undeclaredDependencyErrorOwningModuleName x))}]})
@@ -0,0 +1,42 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Term encoders for hydra.core.error.system++module Hydra.Core.Encode.Error.System where++import qualified Hydra.Core.Encode.File as File+import qualified Hydra.Core.Error.System as System+import qualified Hydra.Core.Model as Model+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | Encoder for hydra.core.error.system.SystemError+systemError :: System.SystemError -> Model.Term+systemError x =+ case x of+ System.SystemErrorCommandNotFound v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.system.SystemError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "commandNotFound"),+ Model.fieldTerm = (File.filePath v0)}})+ System.SystemErrorPermissionDenied v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.system.SystemError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "permissionDenied"),+ Model.fieldTerm = (File.filePath v0)}})+ System.SystemErrorInvalidWorkingDirectory v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.system.SystemError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "invalidWorkingDirectory"),+ Model.fieldTerm = (File.filePath v0)}})+ System.SystemErrorInterrupted -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.system.SystemError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "interrupted"),+ Model.fieldTerm = Model.TermUnit}})+ System.SystemErrorOther v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.error.system.SystemError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "other"),+ Model.fieldTerm = (Model.TermLiteral (Model.LiteralString v0))}})
@@ -0,0 +1,321 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Term encoders for hydra.core.errors++module Hydra.Core.Encode.Errors where++import qualified Hydra.Core.Encode.Error.Checking as Checking+import qualified Hydra.Core.Encode.Error.Model as ErrorModel+import qualified Hydra.Core.Encode.Model as EncodeModel+import qualified Hydra.Core.Encode.Paths as Paths+import qualified Hydra.Core.Encode.Typing as Typing+import qualified Hydra.Core.Encode.Variants as Variants+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.Model as Model+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | Encoder for hydra.core.errors.DecodingError+decodingError :: Errors.DecodingError -> Model.Term+decodingError x =+ Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.Name "hydra.core.errors.DecodingError"),+ Model.wrappedTermBody = ((\x2 -> Model.TermLiteral (Model.LiteralString x2)) (Errors.unDecodingError x))})++-- | Encoder for hydra.core.errors.EmptyListError+emptyListError :: () -> Model.Term+emptyListError _ = Model.TermUnit++-- | Encoder for hydra.core.errors.Error+error :: Errors.Error -> Model.Term+error x =+ case x of+ Errors.ErrorChecking v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.errors.Error"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "checking"),+ Model.fieldTerm = (Checking.checkingError v0)}})+ Errors.ErrorDecoding v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.errors.Error"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "decoding"),+ Model.fieldTerm = (decodingError v0)}})+ Errors.ErrorDuplicateBinding v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.errors.Error"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "duplicateBinding"),+ Model.fieldTerm = (ErrorModel.duplicateBindingError v0)}})+ Errors.ErrorDuplicateField v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.errors.Error"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "duplicateField"),+ Model.fieldTerm = (ErrorModel.duplicateFieldError v0)}})+ Errors.ErrorExtraction v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.errors.Error"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "extraction"),+ Model.fieldTerm = (extractionError v0)}})+ Errors.ErrorInference v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.errors.Error"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "inference"),+ Model.fieldTerm = (inferenceError v0)}})+ Errors.ErrorInvalidLiteral v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.errors.Error"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "invalidLiteral"),+ Model.fieldTerm = (ErrorModel.invalidLiteralError v0)}})+ Errors.ErrorOther v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.errors.Error"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "other"),+ Model.fieldTerm = (otherError v0)}})+ Errors.ErrorResolution v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.errors.Error"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "resolution"),+ Model.fieldTerm = (resolutionError v0)}})+ Errors.ErrorUndefinedField v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.errors.Error"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "undefinedField"),+ Model.fieldTerm = (ErrorModel.undefinedFieldError v0)}})+ Errors.ErrorUndefinedTermVariable v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.errors.Error"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "undefinedTermVariable"),+ Model.fieldTerm = (ErrorModel.undefinedTermVariableError v0)}})+ Errors.ErrorUntypedTermVariable v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.errors.Error"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "untypedTermVariable"),+ Model.fieldTerm = (ErrorModel.untypedTermVariableError v0)}})+ Errors.ErrorUnexpectedTermVariant v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.errors.Error"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "unexpectedTermVariant"),+ Model.fieldTerm = (ErrorModel.unexpectedTermVariantError v0)}})+ Errors.ErrorUnexpectedTypeVariant v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.errors.Error"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "unexpectedTypeVariant"),+ Model.fieldTerm = (ErrorModel.unexpectedTypeVariantError v0)}})+ Errors.ErrorUnification v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.errors.Error"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "unification"),+ Model.fieldTerm = (unificationError v0)}})++-- | Encoder for hydra.core.errors.ExtractionError+extractionError :: Errors.ExtractionError -> Model.Term+extractionError x =+ case x of+ Errors.ExtractionErrorEmptyList v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.errors.ExtractionError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "emptyList"),+ Model.fieldTerm = (emptyListError v0)}})+ Errors.ExtractionErrorMultipleBindings v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.errors.ExtractionError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "multipleBindings"),+ Model.fieldTerm = (multipleBindingsError v0)}})+ Errors.ExtractionErrorMultipleFields v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.errors.ExtractionError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "multipleFields"),+ Model.fieldTerm = (multipleFieldsError v0)}})+ Errors.ExtractionErrorNoMatchingField v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.errors.ExtractionError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "noMatchingField"),+ Model.fieldTerm = (noMatchingFieldError v0)}})+ Errors.ExtractionErrorNoSuchBinding v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.errors.ExtractionError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "noSuchBinding"),+ Model.fieldTerm = (noSuchBindingError v0)}})+ Errors.ExtractionErrorNotEnoughCases v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.errors.ExtractionError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "notEnoughCases"),+ Model.fieldTerm = (notEnoughCasesError v0)}})+ Errors.ExtractionErrorUnexpectedShape v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.errors.ExtractionError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "unexpectedShape"),+ Model.fieldTerm = (unexpectedShapeError v0)}})++-- | Encoder for hydra.core.errors.InferenceError+inferenceError :: Errors.InferenceError -> Model.Term+inferenceError x =+ case x of+ Errors.InferenceErrorChecking v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.errors.InferenceError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "checking"),+ Model.fieldTerm = (Checking.checkingError v0)}})+ Errors.InferenceErrorOther v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.errors.InferenceError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "other"),+ Model.fieldTerm = (otherInferenceError v0)}})+ Errors.InferenceErrorUnification v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.errors.InferenceError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "unification"),+ Model.fieldTerm = (unificationInferenceError v0)}})++-- | Encoder for hydra.core.errors.MultipleBindingsError+multipleBindingsError :: Errors.MultipleBindingsError -> Model.Term+multipleBindingsError x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.errors.MultipleBindingsError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (EncodeModel.name (Errors.multipleBindingsErrorName x))}]})++-- | Encoder for hydra.core.errors.MultipleFieldsError+multipleFieldsError :: Errors.MultipleFieldsError -> Model.Term+multipleFieldsError x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.errors.MultipleFieldsError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "fieldName"),+ Model.fieldTerm = (EncodeModel.name (Errors.multipleFieldsErrorFieldName x))}]})++-- | Encoder for hydra.core.errors.NoMatchingFieldError+noMatchingFieldError :: Errors.NoMatchingFieldError -> Model.Term+noMatchingFieldError x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.errors.NoMatchingFieldError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "fieldName"),+ Model.fieldTerm = (EncodeModel.name (Errors.noMatchingFieldErrorFieldName x))}]})++-- | Encoder for hydra.core.errors.NoSuchBindingError+noSuchBindingError :: Errors.NoSuchBindingError -> Model.Term+noSuchBindingError x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.errors.NoSuchBindingError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (EncodeModel.name (Errors.noSuchBindingErrorName x))}]})++-- | Encoder for hydra.core.errors.NoSuchPrimitiveError+noSuchPrimitiveError :: Errors.NoSuchPrimitiveError -> Model.Term+noSuchPrimitiveError x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.errors.NoSuchPrimitiveError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (EncodeModel.name (Errors.noSuchPrimitiveErrorName x))}]})++-- | Encoder for hydra.core.errors.NotEnoughCasesError+notEnoughCasesError :: () -> Model.Term+notEnoughCasesError _ = Model.TermUnit++-- | Encoder for hydra.core.errors.OtherError+otherError :: Errors.OtherError -> Model.Term+otherError x =+ Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.Name "hydra.core.errors.OtherError"),+ Model.wrappedTermBody = ((\x2 -> Model.TermLiteral (Model.LiteralString x2)) (Errors.unOtherError x))})++-- | Encoder for hydra.core.errors.OtherInferenceError+otherInferenceError :: Errors.OtherInferenceError -> Model.Term+otherInferenceError x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.errors.OtherInferenceError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "path"),+ Model.fieldTerm = (Paths.subtermPath (Errors.otherInferenceErrorPath x))},+ Model.Field {+ Model.fieldName = (Model.Name "message"),+ Model.fieldTerm = ((\x2 -> Model.TermLiteral (Model.LiteralString x2)) (Errors.otherInferenceErrorMessage x))}]})++-- | Encoder for hydra.core.errors.OtherResolutionError+otherResolutionError :: Errors.OtherResolutionError -> Model.Term+otherResolutionError x =+ Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.Name "hydra.core.errors.OtherResolutionError"),+ Model.wrappedTermBody = ((\x2 -> Model.TermLiteral (Model.LiteralString x2)) (Errors.unOtherResolutionError x))})++-- | Encoder for hydra.core.errors.ResolutionError+resolutionError :: Errors.ResolutionError -> Model.Term+resolutionError x =+ case x of+ Errors.ResolutionErrorNoSuchBinding v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.errors.ResolutionError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "noSuchBinding"),+ Model.fieldTerm = (noSuchBindingError v0)}})+ Errors.ResolutionErrorNoSuchPrimitive v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.errors.ResolutionError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "noSuchPrimitive"),+ Model.fieldTerm = (noSuchPrimitiveError v0)}})+ Errors.ResolutionErrorNoMatchingField v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.errors.ResolutionError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "noMatchingField"),+ Model.fieldTerm = (noMatchingFieldError v0)}})+ Errors.ResolutionErrorOther v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.errors.ResolutionError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "other"),+ Model.fieldTerm = (otherResolutionError v0)}})+ Errors.ResolutionErrorUnexpectedShape v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.errors.ResolutionError"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "unexpectedShape"),+ Model.fieldTerm = (unexpectedShapeError v0)}})++-- | Encoder for hydra.core.errors.UnexpectedShapeError+unexpectedShapeError :: Errors.UnexpectedShapeError -> Model.Term+unexpectedShapeError x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.errors.UnexpectedShapeError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "expected"),+ Model.fieldTerm = ((\x2 -> Model.TermLiteral (Model.LiteralString x2)) (Errors.unexpectedShapeErrorExpected x))},+ Model.Field {+ Model.fieldName = (Model.Name "actual"),+ Model.fieldTerm = ((\x2 -> Model.TermLiteral (Model.LiteralString x2)) (Errors.unexpectedShapeErrorActual x))}]})++-- | Encoder for hydra.core.errors.UnificationError+unificationError :: Errors.UnificationError -> Model.Term+unificationError x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.errors.UnificationError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "leftType"),+ Model.fieldTerm = (EncodeModel.type_ (Errors.unificationErrorLeftType x))},+ Model.Field {+ Model.fieldName = (Model.Name "rightType"),+ Model.fieldTerm = (EncodeModel.type_ (Errors.unificationErrorRightType x))},+ Model.Field {+ Model.fieldName = (Model.Name "message"),+ Model.fieldTerm = ((\x2 -> Model.TermLiteral (Model.LiteralString x2)) (Errors.unificationErrorMessage x))}]})++-- | Encoder for hydra.core.errors.UnificationInferenceError+unificationInferenceError :: Errors.UnificationInferenceError -> Model.Term+unificationInferenceError x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.errors.UnificationInferenceError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "path"),+ Model.fieldTerm = (Paths.subtermPath (Errors.unificationInferenceErrorPath x))},+ Model.Field {+ Model.fieldName = (Model.Name "cause"),+ Model.fieldTerm = (unificationError (Errors.unificationInferenceErrorCause x))}]})
@@ -0,0 +1,90 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Term encoders for hydra.core.file++module Hydra.Core.Encode.File where++import qualified Hydra.Core.Encode.Model as EncodeModel+import qualified Hydra.Core.Encode.Time as Time+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Overlay.Haskell.Lib.Optionals as Optionals+import qualified Hydra.Core.Model as Model+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | Encoder for hydra.core.file.FileExtension+fileExtension :: File.FileExtension -> Model.Term+fileExtension x =+ Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.Name "hydra.core.file.FileExtension"),+ Model.wrappedTermBody = ((\x2 -> Model.TermLiteral (Model.LiteralString x2)) (File.unFileExtension x))})++-- | Encoder for hydra.core.file.FilePath+filePath :: File.FilePath -> Model.Term+filePath x =+ Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.Name "hydra.core.file.FilePath"),+ Model.wrappedTermBody = ((\x2 -> Model.TermLiteral (Model.LiteralString x2)) (File.unFilePath x))})++-- | Encoder for hydra.core.file.FileStatus+fileStatus :: File.FileStatus -> Model.Term+fileStatus x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.file.FileStatus"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "fileType"),+ Model.fieldTerm = (fileType (File.fileStatusFileType x))},+ Model.Field {+ Model.fieldName = (Model.Name "size"),+ Model.fieldTerm = ((\x2 -> Model.TermLiteral (Model.LiteralInteger (Model.IntegerValueInt64 x2))) (File.fileStatusSize x))},+ Model.Field {+ Model.fieldName = (Model.Name "modificationTime"),+ Model.fieldTerm = (Time.timespec (File.fileStatusModificationTime x))},+ Model.Field {+ Model.fieldName = (Model.Name "accessTime"),+ Model.fieldTerm = ((\opt -> Model.TermOptional (Optionals.map Time.timespec opt)) (File.fileStatusAccessTime x))},+ Model.Field {+ Model.fieldName = (Model.Name "statusChangeTime"),+ Model.fieldTerm = ((\opt -> Model.TermOptional (Optionals.map Time.timespec opt)) (File.fileStatusStatusChangeTime x))}]})++-- | Encoder for hydra.core.file.FileType+fileType :: File.FileType -> Model.Term+fileType x =+ case x of+ File.FileTypeBlock -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.file.FileType"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "block"),+ Model.fieldTerm = Model.TermUnit}})+ File.FileTypeCharacter -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.file.FileType"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "character"),+ Model.fieldTerm = Model.TermUnit}})+ File.FileTypeDirectory -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.file.FileType"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "directory"),+ Model.fieldTerm = Model.TermUnit}})+ File.FileTypeFifo -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.file.FileType"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "fifo"),+ Model.fieldTerm = Model.TermUnit}})+ File.FileTypeRegular -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.file.FileType"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "regular"),+ Model.fieldTerm = Model.TermUnit}})+ File.FileTypeLink -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.file.FileType"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "link"),+ Model.fieldTerm = Model.TermUnit}})+ File.FileTypeSocket -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.file.FileType"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "socket"),+ Model.fieldTerm = Model.TermUnit}})
@@ -0,0 +1,49 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Term encoders for hydra.core.json.model++module Hydra.Core.Encode.Json.Model where++import qualified Hydra.Core.Encode.Model as EncodeModel+import qualified Hydra.Core.Json.Model as JsonModel+import qualified Hydra.Core.Overlay.Haskell.Lib.Lists as Lists+import qualified Hydra.Core.Overlay.Haskell.Lib.Pairs as Pairs+import qualified Hydra.Core.Model as Model+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | Encoder for hydra.core.json.model.Value+value :: JsonModel.Value -> Model.Term+value x =+ case x of+ JsonModel.ValueArray v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.json.model.Value"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "array"),+ Model.fieldTerm = (Model.TermList (Lists.map value v0))}})+ JsonModel.ValueBoolean v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.json.model.Value"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "boolean"),+ Model.fieldTerm = (Model.TermLiteral (Model.LiteralBoolean v0))}})+ JsonModel.ValueNull -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.json.model.Value"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "null"),+ Model.fieldTerm = Model.TermUnit}})+ JsonModel.ValueNumber v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.json.model.Value"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "number"),+ Model.fieldTerm = (Model.TermLiteral (Model.LiteralDecimal v0))}})+ JsonModel.ValueObject v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.json.model.Value"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "object"),+ Model.fieldTerm = (Model.TermList (Lists.map (\p -> Model.TermPair (Pairs.bimap (\x -> Model.TermLiteral (Model.LiteralString x)) value p)) v0))}})+ JsonModel.ValueString v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.json.model.Value"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "string"),+ Model.fieldTerm = (Model.TermLiteral (Model.LiteralString v0))}})
@@ -0,0 +1,209 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Term encoders for hydra.core.markdown++module Hydra.Core.Encode.Markdown where++import qualified Hydra.Core.Overlay.Haskell.Lib.Lists as Lists+import qualified Hydra.Core.Overlay.Haskell.Lib.Optionals as Optionals+import qualified Hydra.Core.Markdown as Markdown+import qualified Hydra.Core.Model as Model+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | Encoder for hydra.core.markdown.Block+block :: Markdown.Block -> Model.Term+block x =+ case x of+ Markdown.BlockCodeBlock v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.markdown.Block"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "codeBlock"),+ Model.fieldTerm = (codeBlock v0)}})+ Markdown.BlockList v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.markdown.Block"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "list"),+ Model.fieldTerm = (list v0)}})+ Markdown.BlockParagraph v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.markdown.Block"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "paragraph"),+ Model.fieldTerm = (paragraph v0)}})+ Markdown.BlockRaw v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.markdown.Block"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "raw"),+ Model.fieldTerm = (Model.TermLiteral (Model.LiteralString v0))}})+ Markdown.BlockSection v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.markdown.Block"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "section"),+ Model.fieldTerm = (section v0)}})+ Markdown.BlockTable v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.markdown.Block"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "table"),+ Model.fieldTerm = (table v0)}})++-- | Encoder for hydra.core.markdown.CodeBlock+codeBlock :: Markdown.CodeBlock -> Model.Term+codeBlock x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.markdown.CodeBlock"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "language"),+ Model.fieldTerm = ((\opt -> Model.TermOptional (Optionals.map (\x2 -> Model.TermLiteral (Model.LiteralString x2)) opt)) (Markdown.codeBlockLanguage x))},+ Model.Field {+ Model.fieldName = (Model.Name "content"),+ Model.fieldTerm = ((\x2 -> Model.TermLiteral (Model.LiteralString x2)) (Markdown.codeBlockContent x))}]})++-- | Encoder for hydra.core.markdown.Document+document :: Markdown.Document -> Model.Term+document x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.markdown.Document"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "title"),+ Model.fieldTerm = ((\x2 -> Model.TermLiteral (Model.LiteralString x2)) (Markdown.documentTitle x))},+ Model.Field {+ Model.fieldName = (Model.Name "content"),+ Model.fieldTerm = ((\xs -> Model.TermList (Lists.map block xs)) (Markdown.documentContent x))}]})++-- | Encoder for hydra.core.markdown.Heading+heading :: Markdown.Heading -> Model.Term+heading x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.markdown.Heading"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "level"),+ Model.fieldTerm = ((\x2 -> Model.TermLiteral (Model.LiteralInteger (Model.IntegerValueInt32 x2))) (Markdown.headingLevel x))},+ Model.Field {+ Model.fieldName = (Model.Name "content"),+ Model.fieldTerm = ((\xs -> Model.TermList (Lists.map inline xs)) (Markdown.headingContent x))},+ Model.Field {+ Model.fieldName = (Model.Name "anchor"),+ Model.fieldTerm = ((\opt -> Model.TermOptional (Optionals.map (\x2 -> Model.TermLiteral (Model.LiteralString x2)) opt)) (Markdown.headingAnchor x))}]})++-- | Encoder for hydra.core.markdown.Inline+inline :: Markdown.Inline -> Model.Term+inline x =+ case x of+ Markdown.InlineCode v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.markdown.Inline"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "code"),+ Model.fieldTerm = (Model.TermLiteral (Model.LiteralString v0))}})+ Markdown.InlineEmphasis v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.markdown.Inline"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "emphasis"),+ Model.fieldTerm = (Model.TermList (Lists.map inline v0))}})+ Markdown.InlineLink v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.markdown.Inline"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "link"),+ Model.fieldTerm = (link v0)}})+ Markdown.InlineStrong v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.markdown.Inline"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "strong"),+ Model.fieldTerm = (Model.TermList (Lists.map inline v0))}})+ Markdown.InlineText v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.markdown.Inline"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "text"),+ Model.fieldTerm = (Model.TermLiteral (Model.LiteralString v0))}})++-- | Encoder for hydra.core.markdown.Link+link :: Markdown.Link -> Model.Term+link x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.markdown.Link"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "text"),+ Model.fieldTerm = ((\xs -> Model.TermList (Lists.map inline xs)) (Markdown.linkText x))},+ Model.Field {+ Model.fieldName = (Model.Name "target"),+ Model.fieldTerm = ((\x2 -> Model.TermLiteral (Model.LiteralString x2)) (Markdown.linkTarget x))}]})++-- | Encoder for hydra.core.markdown.List+list :: Markdown.List -> Model.Term+list x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.markdown.List"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "ordered"),+ Model.fieldTerm = ((\x2 -> Model.TermLiteral (Model.LiteralBoolean x2)) (Markdown.listOrdered x))},+ Model.Field {+ Model.fieldName = (Model.Name "items"),+ Model.fieldTerm = ((\xs -> Model.TermList (Lists.map listItem xs)) (Markdown.listItems x))}]})++-- | Encoder for hydra.core.markdown.ListItem+listItem :: Markdown.ListItem -> Model.Term+listItem x =+ Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.Name "hydra.core.markdown.ListItem"),+ Model.wrappedTermBody = ((\xs -> Model.TermList (Lists.map block xs)) (Markdown.unListItem x))})++-- | Encoder for hydra.core.markdown.Paragraph+paragraph :: Markdown.Paragraph -> Model.Term+paragraph x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.markdown.Paragraph"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "content"),+ Model.fieldTerm = ((\xs -> Model.TermList (Lists.map inline xs)) (Markdown.paragraphContent x))},+ Model.Field {+ Model.fieldName = (Model.Name "anchor"),+ Model.fieldTerm = ((\opt -> Model.TermOptional (Optionals.map (\x2 -> Model.TermLiteral (Model.LiteralString x2)) opt)) (Markdown.paragraphAnchor x))}]})++-- | Encoder for hydra.core.markdown.Section+section :: Markdown.Section -> Model.Term+section x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.markdown.Section"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "heading"),+ Model.fieldTerm = (heading (Markdown.sectionHeading x))},+ Model.Field {+ Model.fieldName = (Model.Name "content"),+ Model.fieldTerm = ((\xs -> Model.TermList (Lists.map block xs)) (Markdown.sectionContent x))},+ Model.Field {+ Model.fieldName = (Model.Name "anchor"),+ Model.fieldTerm = ((\opt -> Model.TermOptional (Optionals.map (\x2 -> Model.TermLiteral (Model.LiteralString x2)) opt)) (Markdown.sectionAnchor x))}]})++-- | Encoder for hydra.core.markdown.Table+table :: Markdown.Table -> Model.Term+table x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.markdown.Table"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "header"),+ Model.fieldTerm = (tableRow (Markdown.tableHeader x))},+ Model.Field {+ Model.fieldName = (Model.Name "rows"),+ Model.fieldTerm = ((\xs -> Model.TermList (Lists.map tableRow xs)) (Markdown.tableRows x))}]})++-- | Encoder for hydra.core.markdown.TableCell+tableCell :: Markdown.TableCell -> Model.Term+tableCell x =+ Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.Name "hydra.core.markdown.TableCell"),+ Model.wrappedTermBody = ((\xs -> Model.TermList (Lists.map inline xs)) (Markdown.unTableCell x))})++-- | Encoder for hydra.core.markdown.TableRow+tableRow :: Markdown.TableRow -> Model.Term+tableRow x =+ Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.Name "hydra.core.markdown.TableRow"),+ Model.wrappedTermBody = ((\xs -> Model.TermList (Lists.map tableCell xs)) (Markdown.unTableRow x))})
@@ -0,0 +1,759 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Term encoders for hydra.core.model++module Hydra.Core.Encode.Model where++import qualified Hydra.Core.Overlay.Haskell.Lib.Eithers as Eithers+import qualified Hydra.Core.Overlay.Haskell.Lib.Lists as Lists+import qualified Hydra.Core.Overlay.Haskell.Lib.Maps as Maps+import qualified Hydra.Core.Overlay.Haskell.Lib.Optionals as Optionals+import qualified Hydra.Core.Overlay.Haskell.Lib.Pairs as Pairs+import qualified Hydra.Core.Overlay.Haskell.Lib.Sets as Sets+import qualified Hydra.Core.Model as Model+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | Encoder for hydra.core.model.AnnotatedTerm+annotatedTerm :: Model.AnnotatedTerm -> Model.Term+annotatedTerm x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.model.AnnotatedTerm"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "body"),+ Model.fieldTerm = (term (Model.annotatedTermBody x))},+ Model.Field {+ Model.fieldName = (Model.Name "annotation"),+ Model.fieldTerm = (term (Model.annotatedTermAnnotation x))}]})++-- | Encoder for hydra.core.model.AnnotatedType+annotatedType :: Model.AnnotatedType -> Model.Term+annotatedType x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.model.AnnotatedType"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "body"),+ Model.fieldTerm = (type_ (Model.annotatedTypeBody x))},+ Model.Field {+ Model.fieldName = (Model.Name "annotation"),+ Model.fieldTerm = (term (Model.annotatedTypeAnnotation x))}]})++-- | Encoder for hydra.core.model.Application+application :: Model.Application -> Model.Term+application x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.model.Application"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "function"),+ Model.fieldTerm = (term (Model.applicationFunction x))},+ Model.Field {+ Model.fieldName = (Model.Name "argument"),+ Model.fieldTerm = (term (Model.applicationArgument x))}]})++-- | Encoder for hydra.core.model.ApplicationType+applicationType :: Model.ApplicationType -> Model.Term+applicationType x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.model.ApplicationType"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "function"),+ Model.fieldTerm = (type_ (Model.applicationTypeFunction x))},+ Model.Field {+ Model.fieldName = (Model.Name "argument"),+ Model.fieldTerm = (type_ (Model.applicationTypeArgument x))}]})++-- | Encoder for hydra.core.model.Binding+binding :: Model.Binding -> Model.Term+binding x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.model.Binding"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (name (Model.bindingName x))},+ Model.Field {+ Model.fieldName = (Model.Name "term"),+ Model.fieldTerm = (term (Model.bindingTerm x))},+ Model.Field {+ Model.fieldName = (Model.Name "typeScheme"),+ Model.fieldTerm = ((\opt -> Model.TermOptional (Optionals.map typeScheme opt)) (Model.bindingTypeScheme x))}]})++-- | Encoder for hydra.core.model.CaseAlternative+caseAlternative :: Model.CaseAlternative -> Model.Term+caseAlternative x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.model.CaseAlternative"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (name (Model.caseAlternativeName x))},+ Model.Field {+ Model.fieldName = (Model.Name "handler"),+ Model.fieldTerm = (term (Model.caseAlternativeHandler x))}]})++-- | Encoder for hydra.core.model.CaseStatement+caseStatement :: Model.CaseStatement -> Model.Term+caseStatement x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.model.CaseStatement"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "typeName"),+ Model.fieldTerm = (name (Model.caseStatementTypeName x))},+ Model.Field {+ Model.fieldName = (Model.Name "default"),+ Model.fieldTerm = ((\opt -> Model.TermOptional (Optionals.map term opt)) (Model.caseStatementDefault x))},+ Model.Field {+ Model.fieldName = (Model.Name "cases"),+ Model.fieldTerm = ((\xs -> Model.TermList (Lists.map caseAlternative xs)) (Model.caseStatementCases x))}]})++-- | Encoder for hydra.core.model.EitherType+eitherType :: Model.EitherType -> Model.Term+eitherType x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.model.EitherType"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "left"),+ Model.fieldTerm = (type_ (Model.eitherTypeLeft x))},+ Model.Field {+ Model.fieldName = (Model.Name "right"),+ Model.fieldTerm = (type_ (Model.eitherTypeRight x))}]})++-- | Encoder for hydra.core.model.Field+field :: Model.Field -> Model.Term+field x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.model.Field"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (name (Model.fieldName x))},+ Model.Field {+ Model.fieldName = (Model.Name "term"),+ Model.fieldTerm = (term (Model.fieldTerm x))}]})++-- | Encoder for hydra.core.model.FieldType+fieldType :: Model.FieldType -> Model.Term+fieldType x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.model.FieldType"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (name (Model.fieldTypeName x))},+ Model.Field {+ Model.fieldName = (Model.Name "type"),+ Model.fieldTerm = (type_ (Model.fieldTypeType x))}]})++-- | Encoder for hydra.core.model.FloatType+floatType :: Model.FloatType -> Model.Term+floatType x =+ case x of+ Model.FloatTypeFloat32 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.FloatType"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "float32"),+ Model.fieldTerm = Model.TermUnit}})+ Model.FloatTypeFloat64 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.FloatType"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "float64"),+ Model.fieldTerm = Model.TermUnit}})++-- | Encoder for hydra.core.model.FloatValue+floatValue :: Model.FloatValue -> Model.Term+floatValue x =+ case x of+ Model.FloatValueFloat32 v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.FloatValue"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "float32"),+ Model.fieldTerm = (Model.TermLiteral (Model.LiteralFloat (Model.FloatValueFloat32 v0)))}})+ Model.FloatValueFloat64 v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.FloatValue"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "float64"),+ Model.fieldTerm = (Model.TermLiteral (Model.LiteralFloat (Model.FloatValueFloat64 v0)))}})++-- | Encoder for hydra.core.model.ForallType+forallType :: Model.ForallType -> Model.Term+forallType x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.model.ForallType"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "parameter"),+ Model.fieldTerm = (name (Model.forallTypeParameter x))},+ Model.Field {+ Model.fieldName = (Model.Name "body"),+ Model.fieldTerm = (type_ (Model.forallTypeBody x))}]})++-- | Encoder for hydra.core.model.FunctionType+functionType :: Model.FunctionType -> Model.Term+functionType x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.model.FunctionType"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "domain"),+ Model.fieldTerm = (type_ (Model.functionTypeDomain x))},+ Model.Field {+ Model.fieldName = (Model.Name "codomain"),+ Model.fieldTerm = (type_ (Model.functionTypeCodomain x))}]})++-- | Encoder for hydra.core.model.Injection+injection :: Model.Injection -> Model.Term+injection x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.model.Injection"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "typeName"),+ Model.fieldTerm = (name (Model.injectionTypeName x))},+ Model.Field {+ Model.fieldName = (Model.Name "field"),+ Model.fieldTerm = (field (Model.injectionField x))}]})++-- | Encoder for hydra.core.model.IntegerType+integerType :: Model.IntegerType -> Model.Term+integerType x =+ case x of+ Model.IntegerTypeBigint -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.IntegerType"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "bigint"),+ Model.fieldTerm = Model.TermUnit}})+ Model.IntegerTypeInt8 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.IntegerType"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "int8"),+ Model.fieldTerm = Model.TermUnit}})+ Model.IntegerTypeInt16 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.IntegerType"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "int16"),+ Model.fieldTerm = Model.TermUnit}})+ Model.IntegerTypeInt32 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.IntegerType"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "int32"),+ Model.fieldTerm = Model.TermUnit}})+ Model.IntegerTypeInt64 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.IntegerType"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "int64"),+ Model.fieldTerm = Model.TermUnit}})+ Model.IntegerTypeUint8 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.IntegerType"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "uint8"),+ Model.fieldTerm = Model.TermUnit}})+ Model.IntegerTypeUint16 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.IntegerType"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "uint16"),+ Model.fieldTerm = Model.TermUnit}})+ Model.IntegerTypeUint32 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.IntegerType"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "uint32"),+ Model.fieldTerm = Model.TermUnit}})+ Model.IntegerTypeUint64 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.IntegerType"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "uint64"),+ Model.fieldTerm = Model.TermUnit}})++-- | Encoder for hydra.core.model.IntegerValue+integerValue :: Model.IntegerValue -> Model.Term+integerValue x =+ case x of+ Model.IntegerValueBigint v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.IntegerValue"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "bigint"),+ Model.fieldTerm = (Model.TermLiteral (Model.LiteralInteger (Model.IntegerValueBigint v0)))}})+ Model.IntegerValueInt8 v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.IntegerValue"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "int8"),+ Model.fieldTerm = (Model.TermLiteral (Model.LiteralInteger (Model.IntegerValueInt8 v0)))}})+ Model.IntegerValueInt16 v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.IntegerValue"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "int16"),+ Model.fieldTerm = (Model.TermLiteral (Model.LiteralInteger (Model.IntegerValueInt16 v0)))}})+ Model.IntegerValueInt32 v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.IntegerValue"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "int32"),+ Model.fieldTerm = (Model.TermLiteral (Model.LiteralInteger (Model.IntegerValueInt32 v0)))}})+ Model.IntegerValueInt64 v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.IntegerValue"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "int64"),+ Model.fieldTerm = (Model.TermLiteral (Model.LiteralInteger (Model.IntegerValueInt64 v0)))}})+ Model.IntegerValueUint8 v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.IntegerValue"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "uint8"),+ Model.fieldTerm = (Model.TermLiteral (Model.LiteralInteger (Model.IntegerValueUint8 v0)))}})+ Model.IntegerValueUint16 v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.IntegerValue"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "uint16"),+ Model.fieldTerm = (Model.TermLiteral (Model.LiteralInteger (Model.IntegerValueUint16 v0)))}})+ Model.IntegerValueUint32 v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.IntegerValue"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "uint32"),+ Model.fieldTerm = (Model.TermLiteral (Model.LiteralInteger (Model.IntegerValueUint32 v0)))}})+ Model.IntegerValueUint64 v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.IntegerValue"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "uint64"),+ Model.fieldTerm = (Model.TermLiteral (Model.LiteralInteger (Model.IntegerValueUint64 v0)))}})++-- | Encoder for hydra.core.model.Lambda+lambda :: Model.Lambda -> Model.Term+lambda x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.model.Lambda"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "parameter"),+ Model.fieldTerm = (name (Model.lambdaParameter x))},+ Model.Field {+ Model.fieldName = (Model.Name "domain"),+ Model.fieldTerm = ((\opt -> Model.TermOptional (Optionals.map type_ opt)) (Model.lambdaDomain x))},+ Model.Field {+ Model.fieldName = (Model.Name "body"),+ Model.fieldTerm = (term (Model.lambdaBody x))}]})++-- | Encoder for hydra.core.model.Let+let_ :: Model.Let -> Model.Term+let_ x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.model.Let"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "bindings"),+ Model.fieldTerm = ((\xs -> Model.TermList (Lists.map binding xs)) (Model.letBindings x))},+ Model.Field {+ Model.fieldName = (Model.Name "body"),+ Model.fieldTerm = (term (Model.letBody x))}]})++-- | Encoder for hydra.core.model.Literal+literal :: Model.Literal -> Model.Term+literal x =+ case x of+ Model.LiteralBinary v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.Literal"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "binary"),+ Model.fieldTerm = (Model.TermLiteral (Model.LiteralBinary v0))}})+ Model.LiteralBoolean v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.Literal"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "boolean"),+ Model.fieldTerm = (Model.TermLiteral (Model.LiteralBoolean v0))}})+ Model.LiteralDecimal v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.Literal"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "decimal"),+ Model.fieldTerm = (Model.TermLiteral (Model.LiteralDecimal v0))}})+ Model.LiteralFloat v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.Literal"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "float"),+ Model.fieldTerm = (floatValue v0)}})+ Model.LiteralInteger v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.Literal"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "integer"),+ Model.fieldTerm = (integerValue v0)}})+ Model.LiteralString v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.Literal"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "string"),+ Model.fieldTerm = (Model.TermLiteral (Model.LiteralString v0))}})++-- | Encoder for hydra.core.model.LiteralType+literalType :: Model.LiteralType -> Model.Term+literalType x =+ case x of+ Model.LiteralTypeBinary -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.LiteralType"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "binary"),+ Model.fieldTerm = Model.TermUnit}})+ Model.LiteralTypeBoolean -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.LiteralType"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "boolean"),+ Model.fieldTerm = Model.TermUnit}})+ Model.LiteralTypeDecimal -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.LiteralType"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "decimal"),+ Model.fieldTerm = Model.TermUnit}})+ Model.LiteralTypeFloat v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.LiteralType"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "float"),+ Model.fieldTerm = (floatType v0)}})+ Model.LiteralTypeInteger v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.LiteralType"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "integer"),+ Model.fieldTerm = (integerType v0)}})+ Model.LiteralTypeString -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.LiteralType"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "string"),+ Model.fieldTerm = Model.TermUnit}})++-- | Encoder for hydra.core.model.MapType+mapType :: Model.MapType -> Model.Term+mapType x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.model.MapType"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "keys"),+ Model.fieldTerm = (type_ (Model.mapTypeKeys x))},+ Model.Field {+ Model.fieldName = (Model.Name "values"),+ Model.fieldTerm = (type_ (Model.mapTypeValues x))}]})++-- | Encoder for hydra.core.model.Name+name :: Model.Name -> Model.Term+name x =+ Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.Name "hydra.core.model.Name"),+ Model.wrappedTermBody = ((\x2 -> Model.TermLiteral (Model.LiteralString x2)) (Model.unName x))})++-- | Encoder for hydra.core.model.PairType+pairType :: Model.PairType -> Model.Term+pairType x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.model.PairType"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "first"),+ Model.fieldTerm = (type_ (Model.pairTypeFirst x))},+ Model.Field {+ Model.fieldName = (Model.Name "second"),+ Model.fieldTerm = (type_ (Model.pairTypeSecond x))}]})++-- | Encoder for hydra.core.model.Projection+projection :: Model.Projection -> Model.Term+projection x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.model.Projection"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "typeName"),+ Model.fieldTerm = (name (Model.projectionTypeName x))},+ Model.Field {+ Model.fieldName = (Model.Name "fieldName"),+ Model.fieldTerm = (name (Model.projectionFieldName x))}]})++-- | Encoder for hydra.core.model.Record+record :: Model.Record -> Model.Term+record x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.model.Record"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "typeName"),+ Model.fieldTerm = (name (Model.recordTypeName x))},+ Model.Field {+ Model.fieldName = (Model.Name "fields"),+ Model.fieldTerm = ((\xs -> Model.TermList (Lists.map field xs)) (Model.recordFields x))}]})++-- | Encoder for hydra.core.model.Term+term :: Model.Term -> Model.Term+term x =+ case x of+ Model.TermAnnotated v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.Term"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "annotated"),+ Model.fieldTerm = (annotatedTerm v0)}})+ Model.TermApplication v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.Term"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "application"),+ Model.fieldTerm = (application v0)}})+ Model.TermCases v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.Term"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "cases"),+ Model.fieldTerm = (caseStatement v0)}})+ Model.TermEither v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.Term"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "either"),+ Model.fieldTerm = (Model.TermEither (Eithers.bimap term term v0))}})+ Model.TermInject v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.Term"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "inject"),+ Model.fieldTerm = (injection v0)}})+ Model.TermLambda v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.Term"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "lambda"),+ Model.fieldTerm = (lambda v0)}})+ Model.TermLet v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.Term"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "let"),+ Model.fieldTerm = (let_ v0)}})+ Model.TermList v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.Term"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "list"),+ Model.fieldTerm = (Model.TermList (Lists.map term v0))}})+ Model.TermLiteral v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.Term"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "literal"),+ Model.fieldTerm = (literal v0)}})+ Model.TermMap v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.Term"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "map"),+ Model.fieldTerm = (Model.TermMap (Maps.bimap term term v0))}})+ Model.TermOptional v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.Term"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "optional"),+ Model.fieldTerm = (Model.TermOptional (Optionals.map term v0))}})+ Model.TermPair v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.Term"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "pair"),+ Model.fieldTerm = (Model.TermPair (Pairs.bimap term term v0))}})+ Model.TermProject v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.Term"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "project"),+ Model.fieldTerm = (projection v0)}})+ Model.TermRecord v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.Term"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "record"),+ Model.fieldTerm = (record v0)}})+ Model.TermSet v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.Term"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "set"),+ Model.fieldTerm = (Model.TermSet (Sets.map term v0))}})+ Model.TermTypeApplication v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.Term"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "typeApplication"),+ Model.fieldTerm = (typeApplicationTerm v0)}})+ Model.TermTypeLambda v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.Term"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "typeLambda"),+ Model.fieldTerm = (typeLambda v0)}})+ Model.TermUnit -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.Term"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "unit"),+ Model.fieldTerm = Model.TermUnit}})+ Model.TermUnwrap v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.Term"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "unwrap"),+ Model.fieldTerm = (name v0)}})+ Model.TermVariable v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.Term"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "variable"),+ Model.fieldTerm = (name v0)}})+ Model.TermWrap v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.Term"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "wrap"),+ Model.fieldTerm = (wrappedTerm v0)}})++-- | Encoder for hydra.core.model.Type+type_ :: Model.Type -> Model.Term+type_ x =+ case x of+ Model.TypeAnnotated v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.Type"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "annotated"),+ Model.fieldTerm = (annotatedType v0)}})+ Model.TypeApplication v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.Type"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "application"),+ Model.fieldTerm = (applicationType v0)}})+ Model.TypeEffect v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.Type"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "effect"),+ Model.fieldTerm = (type_ v0)}})+ Model.TypeEither v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.Type"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "either"),+ Model.fieldTerm = (eitherType v0)}})+ Model.TypeForall v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.Type"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "forall"),+ Model.fieldTerm = (forallType v0)}})+ Model.TypeFunction v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.Type"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "function"),+ Model.fieldTerm = (functionType v0)}})+ Model.TypeList v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.Type"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "list"),+ Model.fieldTerm = (type_ v0)}})+ Model.TypeLiteral v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.Type"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "literal"),+ Model.fieldTerm = (literalType v0)}})+ Model.TypeMap v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.Type"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "map"),+ Model.fieldTerm = (mapType v0)}})+ Model.TypeOptional v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.Type"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "optional"),+ Model.fieldTerm = (type_ v0)}})+ Model.TypePair v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.Type"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "pair"),+ Model.fieldTerm = (pairType v0)}})+ Model.TypeRecord v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.Type"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "record"),+ Model.fieldTerm = (Model.TermList (Lists.map fieldType v0))}})+ Model.TypeSet v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.Type"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "set"),+ Model.fieldTerm = (type_ v0)}})+ Model.TypeUnion v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.Type"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "union"),+ Model.fieldTerm = (Model.TermList (Lists.map fieldType v0))}})+ Model.TypeUnit -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.Type"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "unit"),+ Model.fieldTerm = Model.TermUnit}})+ Model.TypeVariable v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.Type"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "variable"),+ Model.fieldTerm = (name v0)}})+ Model.TypeVoid -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.Type"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "void"),+ Model.fieldTerm = Model.TermUnit}})+ Model.TypeWrap v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.Type"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "wrap"),+ Model.fieldTerm = (type_ v0)}})++-- | Encoder for hydra.core.model.TypeApplicationTerm+typeApplicationTerm :: Model.TypeApplicationTerm -> Model.Term+typeApplicationTerm x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.model.TypeApplicationTerm"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "body"),+ Model.fieldTerm = (term (Model.typeApplicationTermBody x))},+ Model.Field {+ Model.fieldName = (Model.Name "type"),+ Model.fieldTerm = (type_ (Model.typeApplicationTermType x))}]})++-- | Encoder for hydra.core.model.TypeClassConstraint+typeClassConstraint :: Model.TypeClassConstraint -> Model.Term+typeClassConstraint x =+ case x of+ Model.TypeClassConstraintSimple v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.TypeClassConstraint"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "simple"),+ Model.fieldTerm = (name v0)}})++-- | Encoder for hydra.core.model.TypeLambda+typeLambda :: Model.TypeLambda -> Model.Term+typeLambda x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.model.TypeLambda"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "parameter"),+ Model.fieldTerm = (name (Model.typeLambdaParameter x))},+ Model.Field {+ Model.fieldName = (Model.Name "body"),+ Model.fieldTerm = (term (Model.typeLambdaBody x))}]})++-- | Encoder for hydra.core.model.TypeScheme+typeScheme :: Model.TypeScheme -> Model.Term+typeScheme x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.model.TypeScheme"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "variables"),+ Model.fieldTerm = ((\xs -> Model.TermList (Lists.map name xs)) (Model.typeSchemeVariables x))},+ Model.Field {+ Model.fieldName = (Model.Name "body"),+ Model.fieldTerm = (type_ (Model.typeSchemeBody x))},+ Model.Field {+ Model.fieldName = (Model.Name "constraints"),+ Model.fieldTerm = ((\m -> Model.TermMap (Maps.bimap name typeVariableConstraints m)) (Model.typeSchemeConstraints x))}]})++-- | Encoder for hydra.core.model.TypeVariableConstraints+typeVariableConstraints :: Model.TypeVariableConstraints -> Model.Term+typeVariableConstraints x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.model.TypeVariableConstraints"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "classes"),+ Model.fieldTerm = ((\s -> Model.TermSet (Sets.map typeClassConstraint s)) (Model.typeVariableConstraintsClasses x))}]})++-- | Encoder for hydra.core.model.WrappedTerm+wrappedTerm :: Model.WrappedTerm -> Model.Term+wrappedTerm x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.model.WrappedTerm"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "typeName"),+ Model.fieldTerm = (name (Model.wrappedTermTypeName x))},+ Model.Field {+ Model.fieldName = (Model.Name "body"),+ Model.fieldTerm = (term (Model.wrappedTermBody x))}]})
@@ -0,0 +1,362 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Term encoders for hydra.core.packaging++module Hydra.Core.Encode.Packaging where++import qualified Hydra.Core.Encode.Model as EncodeModel+import qualified Hydra.Core.Encode.Typing as Typing+import qualified Hydra.Core.Overlay.Haskell.Lib.Lists as Lists+import qualified Hydra.Core.Overlay.Haskell.Lib.Optionals as Optionals+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Packaging as Packaging+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | Encoder for hydra.core.packaging.Definition+definition :: Packaging.Definition -> Model.Term+definition x =+ case x of+ Packaging.DefinitionPrimitive v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.packaging.Definition"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "primitive"),+ Model.fieldTerm = (primitiveDefinition v0)}})+ Packaging.DefinitionTerm v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.packaging.Definition"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "term"),+ Model.fieldTerm = (termDefinition v0)}})+ Packaging.DefinitionType v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.packaging.Definition"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "type"),+ Model.fieldTerm = (typeDefinition v0)}})++-- | Encoder for hydra.core.packaging.DefinitionReference+definitionReference :: Packaging.DefinitionReference -> Model.Term+definitionReference x =+ case x of+ Packaging.DefinitionReferencePrimitive v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.packaging.DefinitionReference"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "primitive"),+ Model.fieldTerm = (EncodeModel.name v0)}})+ Packaging.DefinitionReferenceTerm v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.packaging.DefinitionReference"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "term"),+ Model.fieldTerm = (EncodeModel.name v0)}})+ Packaging.DefinitionReferenceType v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.packaging.DefinitionReference"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "type"),+ Model.fieldTerm = (EncodeModel.name v0)}})++-- | Encoder for hydra.core.packaging.DependencyScope+dependencyScope :: Packaging.DependencyScope -> Model.Term+dependencyScope x =+ case x of+ Packaging.DependencyScopeApi -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.packaging.DependencyScope"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "api"),+ Model.fieldTerm = Model.TermUnit}})+ Packaging.DependencyScopeRuntime -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.packaging.DependencyScope"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "runtime"),+ Model.fieldTerm = Model.TermUnit}})+ Packaging.DependencyScopeTest -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.packaging.DependencyScope"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "test"),+ Model.fieldTerm = Model.TermUnit}})+ Packaging.DependencyScopeTool -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.packaging.DependencyScope"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "tool"),+ Model.fieldTerm = Model.TermUnit}})++-- | Encoder for hydra.core.packaging.EntityMetadata+entityMetadata :: Packaging.EntityMetadata -> Model.Term+entityMetadata x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.packaging.EntityMetadata"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "description"),+ Model.fieldTerm = ((\opt -> Model.TermOptional (Optionals.map (\x2 -> Model.TermLiteral (Model.LiteralString x2)) opt)) (Packaging.entityMetadataDescription x))},+ Model.Field {+ Model.fieldName = (Model.Name "comments"),+ Model.fieldTerm = ((\xs -> Model.TermList (Lists.map (\x2 -> Model.TermLiteral (Model.LiteralString x2)) xs)) (Packaging.entityMetadataComments x))},+ Model.Field {+ Model.fieldName = (Model.Name "seeAlso"),+ Model.fieldTerm = ((\xs -> Model.TermList (Lists.map entityReference xs)) (Packaging.entityMetadataSeeAlso x))},+ Model.Field {+ Model.fieldName = (Model.Name "lifecycle"),+ Model.fieldTerm = ((\opt -> Model.TermOptional (Optionals.map lifecycleInfo opt)) (Packaging.entityMetadataLifecycle x))},+ Model.Field {+ Model.fieldName = (Model.Name "provisions"),+ Model.fieldTerm = ((\xs -> Model.TermList (Lists.map provision xs)) (Packaging.entityMetadataProvisions x))}]})++-- | Encoder for hydra.core.packaging.EntityReference+entityReference :: Packaging.EntityReference -> Model.Term+entityReference x =+ case x of+ Packaging.EntityReferenceDefinition v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.packaging.EntityReference"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "definition"),+ Model.fieldTerm = (definitionReference v0)}})+ Packaging.EntityReferenceModule v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.packaging.EntityReference"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "module"),+ Model.fieldTerm = (moduleName v0)}})+ Packaging.EntityReferencePackage v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.packaging.EntityReference"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "package"),+ Model.fieldTerm = (packageName v0)}})+ Packaging.EntityReferenceTermExpr v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.packaging.EntityReference"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "termExpr"),+ Model.fieldTerm = (Model.TermLiteral (Model.LiteralString v0))}})+ Packaging.EntityReferenceTypeExpr v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.packaging.EntityReference"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "typeExpr"),+ Model.fieldTerm = (Model.TermLiteral (Model.LiteralString v0))}})++-- | Encoder for hydra.core.packaging.LifecycleInfo+lifecycleInfo :: Packaging.LifecycleInfo -> Model.Term+lifecycleInfo x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.packaging.LifecycleInfo"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "availableSince"),+ Model.fieldTerm = ((\opt -> Model.TermOptional (Optionals.map version opt)) (Packaging.lifecycleInfoAvailableSince x))},+ Model.Field {+ Model.fieldName = (Model.Name "deprecatedSince"),+ Model.fieldTerm = ((\opt -> Model.TermOptional (Optionals.map version opt)) (Packaging.lifecycleInfoDeprecatedSince x))}]})++-- | Encoder for hydra.core.packaging.Module+module_ :: Packaging.Module -> Model.Term+module_ x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.packaging.Module"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (moduleName (Packaging.moduleName x))},+ Model.Field {+ Model.fieldName = (Model.Name "metadata"),+ Model.fieldTerm = ((\opt -> Model.TermOptional (Optionals.map entityMetadata opt)) (Packaging.moduleMetadata x))},+ Model.Field {+ Model.fieldName = (Model.Name "dependencies"),+ Model.fieldTerm = ((\xs -> Model.TermList (Lists.map moduleDependency xs)) (Packaging.moduleDependencies x))},+ Model.Field {+ Model.fieldName = (Model.Name "definitions"),+ Model.fieldTerm = ((\xs -> Model.TermList (Lists.map definition xs)) (Packaging.moduleDefinitions x))}]})++-- | Encoder for hydra.core.packaging.ModuleDependency+moduleDependency :: Packaging.ModuleDependency -> Model.Term+moduleDependency x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.packaging.ModuleDependency"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "module"),+ Model.fieldTerm = (moduleName (Packaging.moduleDependencyModule x))},+ Model.Field {+ Model.fieldName = (Model.Name "package"),+ Model.fieldTerm = ((\opt -> Model.TermOptional (Optionals.map packageName opt)) (Packaging.moduleDependencyPackage x))}]})++-- | Encoder for hydra.core.packaging.ModuleName+moduleName :: Packaging.ModuleName -> Model.Term+moduleName x =+ Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.Name "hydra.core.packaging.ModuleName"),+ Model.wrappedTermBody = ((\x2 -> Model.TermLiteral (Model.LiteralString x2)) (Packaging.unModuleName x))})++-- | Encoder for hydra.core.packaging.Package+package :: Packaging.Package -> Model.Term+package x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.packaging.Package"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (packageName (Packaging.packageName x))},+ Model.Field {+ Model.fieldName = (Model.Name "metadata"),+ Model.fieldTerm = ((\opt -> Model.TermOptional (Optionals.map entityMetadata opt)) (Packaging.packageMetadata x))},+ Model.Field {+ Model.fieldName = (Model.Name "dependencies"),+ Model.fieldTerm = ((\xs -> Model.TermList (Lists.map packageDependency xs)) (Packaging.packageDependencies x))},+ Model.Field {+ Model.fieldName = (Model.Name "modules"),+ Model.fieldTerm = ((\xs -> Model.TermList (Lists.map module_ xs)) (Packaging.packageModules x))}]})++-- | Encoder for hydra.core.packaging.PackageDependency+packageDependency :: Packaging.PackageDependency -> Model.Term+packageDependency x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.packaging.PackageDependency"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (packageName (Packaging.packageDependencyName x))},+ Model.Field {+ Model.fieldName = (Model.Name "version"),+ Model.fieldTerm = (versionSpecifier (Packaging.packageDependencyVersion x))},+ Model.Field {+ Model.fieldName = (Model.Name "scope"),+ Model.fieldTerm = ((\opt -> Model.TermOptional (Optionals.map dependencyScope opt)) (Packaging.packageDependencyScope x))}]})++-- | Encoder for hydra.core.packaging.PackageName+packageName :: Packaging.PackageName -> Model.Term+packageName x =+ Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.Name "hydra.core.packaging.PackageName"),+ Model.wrappedTermBody = ((\x2 -> Model.TermLiteral (Model.LiteralString x2)) (Packaging.unPackageName x))})++-- | Encoder for hydra.core.packaging.PrimitiveDefinition+primitiveDefinition :: Packaging.PrimitiveDefinition -> Model.Term+primitiveDefinition x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.packaging.PrimitiveDefinition"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (EncodeModel.name (Packaging.primitiveDefinitionName x))},+ Model.Field {+ Model.fieldName = (Model.Name "metadata"),+ Model.fieldTerm = ((\opt -> Model.TermOptional (Optionals.map entityMetadata opt)) (Packaging.primitiveDefinitionMetadata x))},+ Model.Field {+ Model.fieldName = (Model.Name "signature"),+ Model.fieldTerm = (Typing.termSignature (Packaging.primitiveDefinitionSignature x))},+ Model.Field {+ Model.fieldName = (Model.Name "isPure"),+ Model.fieldTerm = ((\x2 -> Model.TermLiteral (Model.LiteralBoolean x2)) (Packaging.primitiveDefinitionIsPure x))},+ Model.Field {+ Model.fieldName = (Model.Name "isTotal"),+ Model.fieldTerm = ((\x2 -> Model.TermLiteral (Model.LiteralBoolean x2)) (Packaging.primitiveDefinitionIsTotal x))},+ Model.Field {+ Model.fieldName = (Model.Name "defaultImplementation"),+ Model.fieldTerm = ((\opt -> Model.TermOptional (Optionals.map EncodeModel.term opt)) (Packaging.primitiveDefinitionDefaultImplementation x))}]})++-- | Encoder for hydra.core.packaging.Provision+provision :: Packaging.Provision -> Model.Term+provision x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.packaging.Provision"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (EncodeModel.name (Packaging.provisionName x))},+ Model.Field {+ Model.fieldName = (Model.Name "kind"),+ Model.fieldTerm = (provisionKind (Packaging.provisionKind x))},+ Model.Field {+ Model.fieldName = (Model.Name "statement"),+ Model.fieldTerm = ((\x2 -> Model.TermLiteral (Model.LiteralString x2)) (Packaging.provisionStatement x))}]})++-- | Encoder for hydra.core.packaging.ProvisionKind+provisionKind :: Packaging.ProvisionKind -> Model.Term+provisionKind x =+ case x of+ Packaging.ProvisionKindRequirement -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.packaging.ProvisionKind"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "requirement"),+ Model.fieldTerm = Model.TermUnit}})+ Packaging.ProvisionKindRecommendation -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.packaging.ProvisionKind"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "recommendation"),+ Model.fieldTerm = Model.TermUnit}})++-- | Encoder for hydra.core.packaging.TermDefinition+termDefinition :: Packaging.TermDefinition -> Model.Term+termDefinition x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.packaging.TermDefinition"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (EncodeModel.name (Packaging.termDefinitionName x))},+ Model.Field {+ Model.fieldName = (Model.Name "metadata"),+ Model.fieldTerm = ((\opt -> Model.TermOptional (Optionals.map entityMetadata opt)) (Packaging.termDefinitionMetadata x))},+ Model.Field {+ Model.fieldName = (Model.Name "signature"),+ Model.fieldTerm = ((\opt -> Model.TermOptional (Optionals.map Typing.termSignature opt)) (Packaging.termDefinitionSignature x))},+ Model.Field {+ Model.fieldName = (Model.Name "body"),+ Model.fieldTerm = (EncodeModel.term (Packaging.termDefinitionBody x))}]})++-- | Encoder for hydra.core.packaging.TypeDefinition+typeDefinition :: Packaging.TypeDefinition -> Model.Term+typeDefinition x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.packaging.TypeDefinition"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (EncodeModel.name (Packaging.typeDefinitionName x))},+ Model.Field {+ Model.fieldName = (Model.Name "metadata"),+ Model.fieldTerm = ((\opt -> Model.TermOptional (Optionals.map entityMetadata opt)) (Packaging.typeDefinitionMetadata x))},+ Model.Field {+ Model.fieldName = (Model.Name "body"),+ Model.fieldTerm = (EncodeModel.typeScheme (Packaging.typeDefinitionBody x))}]})++-- | Encoder for hydra.core.packaging.Version+version :: Packaging.Version -> Model.Term+version x =+ Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.Name "hydra.core.packaging.Version"),+ Model.wrappedTermBody = ((\x2 -> Model.TermLiteral (Model.LiteralString x2)) (Packaging.unVersion x))})++-- | Encoder for hydra.core.packaging.VersionRange+versionRange :: Packaging.VersionRange -> Model.Term+versionRange x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.packaging.VersionRange"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "lowerInclusive"),+ Model.fieldTerm = ((\opt -> Model.TermOptional (Optionals.map version opt)) (Packaging.versionRangeLowerInclusive x))},+ Model.Field {+ Model.fieldName = (Model.Name "upperExclusive"),+ Model.fieldTerm = ((\opt -> Model.TermOptional (Optionals.map version opt)) (Packaging.versionRangeUpperExclusive x))}]})++-- | Encoder for hydra.core.packaging.VersionSpecifier+versionSpecifier :: Packaging.VersionSpecifier -> Model.Term+versionSpecifier x =+ case x of+ Packaging.VersionSpecifierAny -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.packaging.VersionSpecifier"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "any"),+ Model.fieldTerm = Model.TermUnit}})+ Packaging.VersionSpecifierExact v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.packaging.VersionSpecifier"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "exact"),+ Model.fieldTerm = (version v0)}})+ Packaging.VersionSpecifierAtLeast v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.packaging.VersionSpecifier"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "atLeast"),+ Model.fieldTerm = (version v0)}})+ Packaging.VersionSpecifierRange v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.packaging.VersionSpecifier"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "range"),+ Model.fieldTerm = (versionRange v0)}})
@@ -0,0 +1,54 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Term encoders for hydra.core.parsing++module Hydra.Core.Encode.Parsing where++import qualified Hydra.Core.Encode.Model as EncodeModel+import qualified Hydra.Core.Overlay.Haskell.Lib.Lists as Lists+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Parsing as Parsing+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | Encoder for hydra.core.parsing.ParseError+parseError :: Parsing.ParseError -> Model.Term+parseError x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.parsing.ParseError"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "message"),+ Model.fieldTerm = ((\x2 -> Model.TermLiteral (Model.LiteralString x2)) (Parsing.parseErrorMessage x))},+ Model.Field {+ Model.fieldName = (Model.Name "remainder"),+ Model.fieldTerm = ((\xs -> Model.TermList (Lists.map (\x2 -> Model.TermLiteral (Model.LiteralInteger (Model.IntegerValueInt32 x2))) xs)) (Parsing.parseErrorRemainder x))}]})++-- | Encoder for hydra.core.parsing.ParseResult+parseResult :: (a -> Model.Term) -> Parsing.ParseResult a -> Model.Term+parseResult a x =+ case x of+ Parsing.ParseResultSuccess v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.parsing.ParseResult"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "success"),+ Model.fieldTerm = (parseSuccess a v0)}})+ Parsing.ParseResultFailure v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.parsing.ParseResult"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "failure"),+ Model.fieldTerm = (parseError v0)}})++-- | Encoder for hydra.core.parsing.ParseSuccess+parseSuccess :: (a -> Model.Term) -> Parsing.ParseSuccess a -> Model.Term+parseSuccess a x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.parsing.ParseSuccess"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "value"),+ Model.fieldTerm = (a (Parsing.parseSuccessValue x))},+ Model.Field {+ Model.fieldName = (Model.Name "remainder"),+ Model.fieldTerm = ((\xs -> Model.TermList (Lists.map (\x2 -> Model.TermLiteral (Model.LiteralInteger (Model.IntegerValueInt32 x2))) xs)) (Parsing.parseSuccessRemainder x))}]})
@@ -0,0 +1,604 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Term encoders for hydra.core.paths++module Hydra.Core.Encode.Paths where++import qualified Hydra.Core.Encode.Model as EncodeModel+import qualified Hydra.Core.Overlay.Haskell.Lib.Lists as Lists+import qualified Hydra.Core.Overlay.Haskell.Lib.Maps as Maps+import qualified Hydra.Core.Overlay.Haskell.Lib.Pairs as Pairs+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Paths as Paths+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | Encoder for hydra.core.paths.LambdaVariableReference+lambdaVariableReference :: Paths.LambdaVariableReference -> Model.Term+lambdaVariableReference x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.paths.LambdaVariableReference"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "variable"),+ Model.fieldTerm = (EncodeModel.name (Paths.lambdaVariableReferenceVariable x))},+ Model.Field {+ Model.fieldName = (Model.Name "boundByNode"),+ Model.fieldTerm = (termNodeId (Paths.lambdaVariableReferenceBoundByNode x))},+ Model.Field {+ Model.fieldName = (Model.Name "type"),+ Model.fieldTerm = (EncodeModel.type_ (Paths.lambdaVariableReferenceType x))}]})++-- | Encoder for hydra.core.paths.LetVariableReference+letVariableReference :: Paths.LetVariableReference -> Model.Term+letVariableReference x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.paths.LetVariableReference"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "variable"),+ Model.fieldTerm = (EncodeModel.name (Paths.letVariableReferenceVariable x))},+ Model.Field {+ Model.fieldName = (Model.Name "bindingNode"),+ Model.fieldTerm = (termNodeId (Paths.letVariableReferenceBindingNode x))},+ Model.Field {+ Model.fieldName = (Model.Name "type"),+ Model.fieldTerm = (EncodeModel.type_ (Paths.letVariableReferenceType x))}]})++-- | Encoder for hydra.core.paths.NominalTypeReference+nominalTypeReference :: Paths.NominalTypeReference -> Model.Term+nominalTypeReference x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.paths.NominalTypeReference"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (EncodeModel.name (Paths.nominalTypeReferenceName x))}]})++-- | Encoder for hydra.core.paths.PrimitiveReference+primitiveReference :: Paths.PrimitiveReference -> Model.Term+primitiveReference x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.paths.PrimitiveReference"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (EncodeModel.name (Paths.primitiveReferenceName x))},+ Model.Field {+ Model.fieldName = (Model.Name "type"),+ Model.fieldTerm = (EncodeModel.type_ (Paths.primitiveReferenceType x))}]})++-- | Encoder for hydra.core.paths.SubtermLink+subtermLink :: Paths.SubtermLink -> Model.Term+subtermLink x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.paths.SubtermLink"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "step"),+ Model.fieldTerm = (subtermStep (Paths.subtermLinkStep x))},+ Model.Field {+ Model.fieldName = (Model.Name "child"),+ Model.fieldTerm = (termNode (Paths.subtermLinkChild x))}]})++-- | Encoder for hydra.core.paths.SubtermPath+subtermPath :: Paths.SubtermPath -> Model.Term+subtermPath x =+ Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.Name "hydra.core.paths.SubtermPath"),+ Model.wrappedTermBody = ((\xs -> Model.TermList (Lists.map subtermStep xs)) (Paths.unSubtermPath x))})++-- | Encoder for hydra.core.paths.SubtermStep+subtermStep :: Paths.SubtermStep -> Model.Term+subtermStep x =+ case x of+ Paths.SubtermStepAnnotatedAnnotation -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.paths.SubtermStep"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "annotatedAnnotation"),+ Model.fieldTerm = Model.TermUnit}})+ Paths.SubtermStepAnnotatedBody -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.paths.SubtermStep"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "annotatedBody"),+ Model.fieldTerm = Model.TermUnit}})+ Paths.SubtermStepApplicationArgument -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.paths.SubtermStep"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "applicationArgument"),+ Model.fieldTerm = Model.TermUnit}})+ Paths.SubtermStepApplicationFunction -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.paths.SubtermStep"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "applicationFunction"),+ Model.fieldTerm = Model.TermUnit}})+ Paths.SubtermStepCasesCase v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.paths.SubtermStep"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "casesCase"),+ Model.fieldTerm = (EncodeModel.name v0)}})+ Paths.SubtermStepCasesDefault -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.paths.SubtermStep"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "casesDefault"),+ Model.fieldTerm = Model.TermUnit}})+ Paths.SubtermStepEitherLeft -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.paths.SubtermStep"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "eitherLeft"),+ Model.fieldTerm = Model.TermUnit}})+ Paths.SubtermStepEitherRight -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.paths.SubtermStep"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "eitherRight"),+ Model.fieldTerm = Model.TermUnit}})+ Paths.SubtermStepInjectField v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.paths.SubtermStep"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "injectField"),+ Model.fieldTerm = (EncodeModel.name v0)}})+ Paths.SubtermStepLambdaBody -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.paths.SubtermStep"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "lambdaBody"),+ Model.fieldTerm = Model.TermUnit}})+ Paths.SubtermStepLetBinding v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.paths.SubtermStep"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "letBinding"),+ Model.fieldTerm = (EncodeModel.name v0)}})+ Paths.SubtermStepLetBody -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.paths.SubtermStep"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "letBody"),+ Model.fieldTerm = Model.TermUnit}})+ Paths.SubtermStepListElement v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.paths.SubtermStep"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "listElement"),+ Model.fieldTerm = (Model.TermLiteral (Model.LiteralInteger (Model.IntegerValueInt32 v0)))}})+ Paths.SubtermStepMapEntry v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.paths.SubtermStep"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "mapEntry"),+ Model.fieldTerm = (Model.TermLiteral (Model.LiteralInteger (Model.IntegerValueInt32 v0)))}})+ Paths.SubtermStepOptionalGiven -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.paths.SubtermStep"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "optionalGiven"),+ Model.fieldTerm = Model.TermUnit}})+ Paths.SubtermStepPairFirst -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.paths.SubtermStep"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "pairFirst"),+ Model.fieldTerm = Model.TermUnit}})+ Paths.SubtermStepPairSecond -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.paths.SubtermStep"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "pairSecond"),+ Model.fieldTerm = Model.TermUnit}})+ Paths.SubtermStepRecordField v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.paths.SubtermStep"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "recordField"),+ Model.fieldTerm = (EncodeModel.name v0)}})+ Paths.SubtermStepSetElement v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.paths.SubtermStep"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "setElement"),+ Model.fieldTerm = (Model.TermLiteral (Model.LiteralInteger (Model.IntegerValueInt32 v0)))}})+ Paths.SubtermStepTypeApplicationBody -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.paths.SubtermStep"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "typeApplicationBody"),+ Model.fieldTerm = Model.TermUnit}})+ Paths.SubtermStepTypeLambdaBody -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.paths.SubtermStep"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "typeLambdaBody"),+ Model.fieldTerm = Model.TermUnit}})+ Paths.SubtermStepWrapBody -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.paths.SubtermStep"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "wrapBody"),+ Model.fieldTerm = Model.TermUnit}})++-- | Encoder for hydra.core.paths.SubtypeLink+subtypeLink :: Paths.SubtypeLink -> Model.Term+subtypeLink x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.paths.SubtypeLink"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "step"),+ Model.fieldTerm = (subtypeStep (Paths.subtypeLinkStep x))},+ Model.Field {+ Model.fieldName = (Model.Name "child"),+ Model.fieldTerm = (typeNode (Paths.subtypeLinkChild x))}]})++-- | Encoder for hydra.core.paths.SubtypePath+subtypePath :: Paths.SubtypePath -> Model.Term+subtypePath x =+ Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.Name "hydra.core.paths.SubtypePath"),+ Model.wrappedTermBody = ((\xs -> Model.TermList (Lists.map subtypeStep xs)) (Paths.unSubtypePath x))})++-- | Encoder for hydra.core.paths.SubtypeStep+subtypeStep :: Paths.SubtypeStep -> Model.Term+subtypeStep x =+ case x of+ Paths.SubtypeStepAnnotatedBody -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.paths.SubtypeStep"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "annotatedBody"),+ Model.fieldTerm = Model.TermUnit}})+ Paths.SubtypeStepApplicationArgument -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.paths.SubtypeStep"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "applicationArgument"),+ Model.fieldTerm = Model.TermUnit}})+ Paths.SubtypeStepApplicationFunction -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.paths.SubtypeStep"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "applicationFunction"),+ Model.fieldTerm = Model.TermUnit}})+ Paths.SubtypeStepEffectValue -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.paths.SubtypeStep"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "effectValue"),+ Model.fieldTerm = Model.TermUnit}})+ Paths.SubtypeStepEitherLeft -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.paths.SubtypeStep"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "eitherLeft"),+ Model.fieldTerm = Model.TermUnit}})+ Paths.SubtypeStepEitherRight -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.paths.SubtypeStep"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "eitherRight"),+ Model.fieldTerm = Model.TermUnit}})+ Paths.SubtypeStepForallBody -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.paths.SubtypeStep"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "forallBody"),+ Model.fieldTerm = Model.TermUnit}})+ Paths.SubtypeStepFunctionCodomain -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.paths.SubtypeStep"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "functionCodomain"),+ Model.fieldTerm = Model.TermUnit}})+ Paths.SubtypeStepFunctionDomain -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.paths.SubtypeStep"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "functionDomain"),+ Model.fieldTerm = Model.TermUnit}})+ Paths.SubtypeStepListElement -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.paths.SubtypeStep"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "listElement"),+ Model.fieldTerm = Model.TermUnit}})+ Paths.SubtypeStepMapKeys -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.paths.SubtypeStep"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "mapKeys"),+ Model.fieldTerm = Model.TermUnit}})+ Paths.SubtypeStepMapValues -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.paths.SubtypeStep"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "mapValues"),+ Model.fieldTerm = Model.TermUnit}})+ Paths.SubtypeStepOptionalElement -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.paths.SubtypeStep"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "optionalElement"),+ Model.fieldTerm = Model.TermUnit}})+ Paths.SubtypeStepPairFirst -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.paths.SubtypeStep"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "pairFirst"),+ Model.fieldTerm = Model.TermUnit}})+ Paths.SubtypeStepPairSecond -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.paths.SubtypeStep"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "pairSecond"),+ Model.fieldTerm = Model.TermUnit}})+ Paths.SubtypeStepRecordField v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.paths.SubtypeStep"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "recordField"),+ Model.fieldTerm = (EncodeModel.name v0)}})+ Paths.SubtypeStepSetElement -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.paths.SubtypeStep"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "setElement"),+ Model.fieldTerm = Model.TermUnit}})+ Paths.SubtypeStepUnionField v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.paths.SubtypeStep"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "unionField"),+ Model.fieldTerm = (EncodeModel.name v0)}})+ Paths.SubtypeStepWrapBody -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.paths.SubtypeStep"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "wrapBody"),+ Model.fieldTerm = Model.TermUnit}})++-- | Encoder for hydra.core.paths.TermAttributeLink+termAttributeLink :: Paths.TermAttributeLink -> Model.Term+termAttributeLink x =+ case x of+ Paths.TermAttributeLinkCasesTypeName v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.paths.TermAttributeLink"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "casesTypeName"),+ Model.fieldTerm = (EncodeModel.name v0)}})+ Paths.TermAttributeLinkInjectTypeName v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.paths.TermAttributeLink"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "injectTypeName"),+ Model.fieldTerm = (EncodeModel.name v0)}})+ Paths.TermAttributeLinkLambdaDomainGiven v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.paths.TermAttributeLink"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "lambdaDomainGiven"),+ Model.fieldTerm = (EncodeModel.type_ v0)}})+ Paths.TermAttributeLinkLambdaParameter v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.paths.TermAttributeLink"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "lambdaParameter"),+ Model.fieldTerm = (EncodeModel.name v0)}})+ Paths.TermAttributeLinkLetBindingTypeSchemeGiven v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.paths.TermAttributeLink"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "letBindingTypeSchemeGiven"),+ Model.fieldTerm = (Model.TermPair (Pairs.bimap EncodeModel.name EncodeModel.typeScheme v0))}})+ Paths.TermAttributeLinkLiteral v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.paths.TermAttributeLink"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "literal"),+ Model.fieldTerm = (EncodeModel.literal v0)}})+ Paths.TermAttributeLinkProjectFieldName v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.paths.TermAttributeLink"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "projectFieldName"),+ Model.fieldTerm = (EncodeModel.name v0)}})+ Paths.TermAttributeLinkProjectTypeName v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.paths.TermAttributeLink"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "projectTypeName"),+ Model.fieldTerm = (EncodeModel.name v0)}})+ Paths.TermAttributeLinkRecordTypeName v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.paths.TermAttributeLink"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "recordTypeName"),+ Model.fieldTerm = (EncodeModel.name v0)}})+ Paths.TermAttributeLinkTypeApplicationType v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.paths.TermAttributeLink"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "typeApplicationType"),+ Model.fieldTerm = (EncodeModel.type_ v0)}})+ Paths.TermAttributeLinkTypeLambdaParameter v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.paths.TermAttributeLink"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "typeLambdaParameter"),+ Model.fieldTerm = (EncodeModel.name v0)}})+ Paths.TermAttributeLinkUnwrapTypeName v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.paths.TermAttributeLink"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "unwrapTypeName"),+ Model.fieldTerm = (EncodeModel.name v0)}})+ Paths.TermAttributeLinkWrapTypeName v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.paths.TermAttributeLink"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "wrapTypeName"),+ Model.fieldTerm = (EncodeModel.name v0)}})++-- | Encoder for hydra.core.paths.TermGraph+termGraph :: Paths.TermGraph -> Model.Term+termGraph x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.paths.TermGraph"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "roots"),+ Model.fieldTerm = ((\m -> Model.TermMap (Maps.bimap EncodeModel.name termNode m)) (Paths.termGraphRoots x))}]})++-- | Encoder for hydra.core.paths.TermLink+termLink :: Paths.TermLink -> Model.Term+termLink x =+ case x of+ Paths.TermLinkAttribute v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.paths.TermLink"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "attribute"),+ Model.fieldTerm = (termAttributeLink v0)}})+ Paths.TermLinkReference v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.paths.TermLink"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "reference"),+ Model.fieldTerm = (termReferenceLink v0)}})+ Paths.TermLinkSubterm v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.paths.TermLink"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "subterm"),+ Model.fieldTerm = (subtermLink v0)}})++-- | Encoder for hydra.core.paths.TermNode+termNode :: Paths.TermNode -> Model.Term+termNode x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.paths.TermNode"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "term"),+ Model.fieldTerm = (EncodeModel.term (Paths.termNodeTerm x))},+ Model.Field {+ Model.fieldName = (Model.Name "type"),+ Model.fieldTerm = (EncodeModel.type_ (Paths.termNodeType x))},+ Model.Field {+ Model.fieldName = (Model.Name "links"),+ Model.fieldTerm = ((\xs -> Model.TermList (Lists.map termLink xs)) (Paths.termNodeLinks x))}]})++-- | Encoder for hydra.core.paths.TermNodeId+termNodeId :: Paths.TermNodeId -> Model.Term+termNodeId x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.paths.TermNodeId"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "root"),+ Model.fieldTerm = (EncodeModel.name (Paths.termNodeIdRoot x))},+ Model.Field {+ Model.fieldName = (Model.Name "path"),+ Model.fieldTerm = (subtermPath (Paths.termNodeIdPath x))}]})++-- | Encoder for hydra.core.paths.TermReference+termReference :: Paths.TermReference -> Model.Term+termReference x =+ case x of+ Paths.TermReferenceLambda v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.paths.TermReference"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "lambda"),+ Model.fieldTerm = (lambdaVariableReference v0)}})+ Paths.TermReferenceLet v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.paths.TermReference"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "let"),+ Model.fieldTerm = (letVariableReference v0)}})+ Paths.TermReferencePrimitive v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.paths.TermReference"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "primitive"),+ Model.fieldTerm = (primitiveReference v0)}})++-- | Encoder for hydra.core.paths.TermReferenceLink+termReferenceLink :: Paths.TermReferenceLink -> Model.Term+termReferenceLink x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.paths.TermReferenceLink"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "step"),+ Model.fieldTerm = (subtermStep (Paths.termReferenceLinkStep x))},+ Model.Field {+ Model.fieldName = (Model.Name "target"),+ Model.fieldTerm = (termReference (Paths.termReferenceLinkTarget x))}]})++-- | Encoder for hydra.core.paths.TypeAttributeLink+typeAttributeLink :: Paths.TypeAttributeLink -> Model.Term+typeAttributeLink x =+ case x of+ Paths.TypeAttributeLinkAnnotatedAnnotation v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.paths.TypeAttributeLink"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "annotatedAnnotation"),+ Model.fieldTerm = (EncodeModel.term v0)}})+ Paths.TypeAttributeLinkForallParameter v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.paths.TypeAttributeLink"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "forallParameter"),+ Model.fieldTerm = (EncodeModel.name v0)}})+ Paths.TypeAttributeLinkLiteral v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.paths.TypeAttributeLink"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "literal"),+ Model.fieldTerm = (EncodeModel.literalType v0)}})++-- | Encoder for hydra.core.paths.TypeGraph+typeGraph :: Paths.TypeGraph -> Model.Term+typeGraph x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.paths.TypeGraph"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "roots"),+ Model.fieldTerm = ((\m -> Model.TermMap (Maps.bimap EncodeModel.name typeNode m)) (Paths.typeGraphRoots x))}]})++-- | Encoder for hydra.core.paths.TypeLink+typeLink :: Paths.TypeLink -> Model.Term+typeLink x =+ case x of+ Paths.TypeLinkAttribute v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.paths.TypeLink"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "attribute"),+ Model.fieldTerm = (typeAttributeLink v0)}})+ Paths.TypeLinkReference v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.paths.TypeLink"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "reference"),+ Model.fieldTerm = (typeReferenceLink v0)}})+ Paths.TypeLinkSubtype v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.paths.TypeLink"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "subtype"),+ Model.fieldTerm = (subtypeLink v0)}})++-- | Encoder for hydra.core.paths.TypeNode+typeNode :: Paths.TypeNode -> Model.Term+typeNode x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.paths.TypeNode"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "type"),+ Model.fieldTerm = (EncodeModel.type_ (Paths.typeNodeType x))},+ Model.Field {+ Model.fieldName = (Model.Name "links"),+ Model.fieldTerm = ((\xs -> Model.TermList (Lists.map typeLink xs)) (Paths.typeNodeLinks x))}]})++-- | Encoder for hydra.core.paths.TypeNodeId+typeNodeId :: Paths.TypeNodeId -> Model.Term+typeNodeId x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.paths.TypeNodeId"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "root"),+ Model.fieldTerm = (EncodeModel.name (Paths.typeNodeIdRoot x))},+ Model.Field {+ Model.fieldName = (Model.Name "path"),+ Model.fieldTerm = (subtypePath (Paths.typeNodeIdPath x))}]})++-- | Encoder for hydra.core.paths.TypeReference+typeReference :: Paths.TypeReference -> Model.Term+typeReference x =+ case x of+ Paths.TypeReferenceNominal v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.paths.TypeReference"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "nominal"),+ Model.fieldTerm = (nominalTypeReference v0)}})+ Paths.TypeReferenceVariable v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.paths.TypeReference"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "variable"),+ Model.fieldTerm = (typeVariableReference v0)}})++-- | Encoder for hydra.core.paths.TypeReferenceLink+typeReferenceLink :: Paths.TypeReferenceLink -> Model.Term+typeReferenceLink x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.paths.TypeReferenceLink"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "step"),+ Model.fieldTerm = (subtypeStep (Paths.typeReferenceLinkStep x))},+ Model.Field {+ Model.fieldName = (Model.Name "target"),+ Model.fieldTerm = (typeReference (Paths.typeReferenceLinkTarget x))}]})++-- | Encoder for hydra.core.paths.TypeVariableReference+typeVariableReference :: Paths.TypeVariableReference -> Model.Term+typeVariableReference x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.paths.TypeVariableReference"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "variable"),+ Model.fieldTerm = (EncodeModel.name (Paths.typeVariableReferenceVariable x))},+ Model.Field {+ Model.fieldName = (Model.Name "boundByNode"),+ Model.fieldTerm = (typeNodeId (Paths.typeVariableReferenceBoundByNode x))}]})
@@ -0,0 +1,296 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Term encoders for hydra.core.query++module Hydra.Core.Encode.Query where++import qualified Hydra.Core.Encode.Model as EncodeModel+import qualified Hydra.Core.Overlay.Haskell.Lib.Lists as Lists+import qualified Hydra.Core.Overlay.Haskell.Lib.Optionals as Optionals+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Query as Query+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | Encoder for hydra.core.query.ComparisonConstraint+comparisonConstraint :: Query.ComparisonConstraint -> Model.Term+comparisonConstraint x =+ case x of+ Query.ComparisonConstraintEqual -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.query.ComparisonConstraint"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "equal"),+ Model.fieldTerm = Model.TermUnit}})+ Query.ComparisonConstraintNotEqual -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.query.ComparisonConstraint"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "notEqual"),+ Model.fieldTerm = Model.TermUnit}})+ Query.ComparisonConstraintLessThan -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.query.ComparisonConstraint"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "lessThan"),+ Model.fieldTerm = Model.TermUnit}})+ Query.ComparisonConstraintGreaterThan -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.query.ComparisonConstraint"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "greaterThan"),+ Model.fieldTerm = Model.TermUnit}})+ Query.ComparisonConstraintLessThanOrEqual -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.query.ComparisonConstraint"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "lessThanOrEqual"),+ Model.fieldTerm = Model.TermUnit}})+ Query.ComparisonConstraintGreaterThanOrEqual -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.query.ComparisonConstraint"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "greaterThanOrEqual"),+ Model.fieldTerm = Model.TermUnit}})++-- | Encoder for hydra.core.query.Edge+edge :: Query.Edge -> Model.Term+edge x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.query.Edge"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "type"),+ Model.fieldTerm = (EncodeModel.name (Query.edgeType x))},+ Model.Field {+ Model.fieldName = (Model.Name "out"),+ Model.fieldTerm = ((\opt -> Model.TermOptional (Optionals.map EncodeModel.name opt)) (Query.edgeOut x))},+ Model.Field {+ Model.fieldName = (Model.Name "in"),+ Model.fieldTerm = ((\opt -> Model.TermOptional (Optionals.map EncodeModel.name opt)) (Query.edgeIn x))}]})++-- | Encoder for hydra.core.query.GraphPattern+graphPattern :: Query.GraphPattern -> Model.Term+graphPattern x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.query.GraphPattern"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "graph"),+ Model.fieldTerm = (EncodeModel.name (Query.graphPatternGraph x))},+ Model.Field {+ Model.fieldName = (Model.Name "patterns"),+ Model.fieldTerm = ((\xs -> Model.TermList (Lists.map pattern xs)) (Query.graphPatternPatterns x))}]})++-- | Encoder for hydra.core.query.Node+node :: Query.Node -> Model.Term+node x =+ case x of+ Query.NodeTerm v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.query.Node"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "term"),+ Model.fieldTerm = (EncodeModel.term v0)}})+ Query.NodeVariable v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.query.Node"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "variable"),+ Model.fieldTerm = (variable v0)}})+ Query.NodeWildcard -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.query.Node"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "wildcard"),+ Model.fieldTerm = Model.TermUnit}})++-- | Encoder for hydra.core.query.Path+path :: Query.Path -> Model.Term+path x =+ case x of+ Query.PathStep v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.query.Path"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "step"),+ Model.fieldTerm = (step v0)}})+ Query.PathRegex v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.query.Path"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "regex"),+ Model.fieldTerm = (regexSequence v0)}})+ Query.PathInverse v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.query.Path"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "inverse"),+ Model.fieldTerm = (path v0)}})++-- | Encoder for hydra.core.query.PathEquation+pathEquation :: Query.PathEquation -> Model.Term+pathEquation x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.query.PathEquation"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "left"),+ Model.fieldTerm = (path (Query.pathEquationLeft x))},+ Model.Field {+ Model.fieldName = (Model.Name "right"),+ Model.fieldTerm = (path (Query.pathEquationRight x))}]})++-- | Encoder for hydra.core.query.Pattern+pattern :: Query.Pattern -> Model.Term+pattern x =+ case x of+ Query.PatternTriple v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.query.Pattern"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "triple"),+ Model.fieldTerm = (triplePattern v0)}})+ Query.PatternNegation v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.query.Pattern"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "negation"),+ Model.fieldTerm = (pattern v0)}})+ Query.PatternConjunction v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.query.Pattern"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "conjunction"),+ Model.fieldTerm = (Model.TermList (Lists.map pattern v0))}})+ Query.PatternDisjunction v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.query.Pattern"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "disjunction"),+ Model.fieldTerm = (Model.TermList (Lists.map pattern v0))}})+ Query.PatternGraph v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.query.Pattern"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "graph"),+ Model.fieldTerm = (graphPattern v0)}})++-- | Encoder for hydra.core.query.PatternImplication+patternImplication :: Query.PatternImplication -> Model.Term+patternImplication x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.query.PatternImplication"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "antecedent"),+ Model.fieldTerm = (pattern (Query.patternImplicationAntecedent x))},+ Model.Field {+ Model.fieldName = (Model.Name "consequent"),+ Model.fieldTerm = (pattern (Query.patternImplicationConsequent x))}]})++-- | Encoder for hydra.core.query.Query+query :: Query.Query -> Model.Term+query x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.query.Query"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "variables"),+ Model.fieldTerm = ((\xs -> Model.TermList (Lists.map variable xs)) (Query.queryVariables x))},+ Model.Field {+ Model.fieldName = (Model.Name "patterns"),+ Model.fieldTerm = ((\xs -> Model.TermList (Lists.map pattern xs)) (Query.queryPatterns x))}]})++-- | Encoder for hydra.core.query.Range+range :: Query.Range -> Model.Term+range x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.query.Range"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "min"),+ Model.fieldTerm = ((\x2 -> Model.TermLiteral (Model.LiteralInteger (Model.IntegerValueInt32 x2))) (Query.rangeMin x))},+ Model.Field {+ Model.fieldName = (Model.Name "max"),+ Model.fieldTerm = ((\x2 -> Model.TermLiteral (Model.LiteralInteger (Model.IntegerValueInt32 x2))) (Query.rangeMax x))}]})++-- | Encoder for hydra.core.query.RegexQuantifier+regexQuantifier :: Query.RegexQuantifier -> Model.Term+regexQuantifier x =+ case x of+ Query.RegexQuantifierOne -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.query.RegexQuantifier"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "one"),+ Model.fieldTerm = Model.TermUnit}})+ Query.RegexQuantifierZeroOrOne -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.query.RegexQuantifier"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "zeroOrOne"),+ Model.fieldTerm = Model.TermUnit}})+ Query.RegexQuantifierZeroOrMore -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.query.RegexQuantifier"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "zeroOrMore"),+ Model.fieldTerm = Model.TermUnit}})+ Query.RegexQuantifierOneOrMore -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.query.RegexQuantifier"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "oneOrMore"),+ Model.fieldTerm = Model.TermUnit}})+ Query.RegexQuantifierExactly v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.query.RegexQuantifier"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "exactly"),+ Model.fieldTerm = (Model.TermLiteral (Model.LiteralInteger (Model.IntegerValueInt32 v0)))}})+ Query.RegexQuantifierAtLeast v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.query.RegexQuantifier"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "atLeast"),+ Model.fieldTerm = (Model.TermLiteral (Model.LiteralInteger (Model.IntegerValueInt32 v0)))}})+ Query.RegexQuantifierRange v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.query.RegexQuantifier"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "range"),+ Model.fieldTerm = (range v0)}})++-- | Encoder for hydra.core.query.RegexSequence+regexSequence :: Query.RegexSequence -> Model.Term+regexSequence x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.query.RegexSequence"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "path"),+ Model.fieldTerm = (path (Query.regexSequencePath x))},+ Model.Field {+ Model.fieldName = (Model.Name "quantifier"),+ Model.fieldTerm = (regexQuantifier (Query.regexSequenceQuantifier x))}]})++-- | Encoder for hydra.core.query.Step+step :: Query.Step -> Model.Term+step x =+ case x of+ Query.StepEdge v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.query.Step"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "edge"),+ Model.fieldTerm = (edge v0)}})+ Query.StepProject v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.query.Step"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "project"),+ Model.fieldTerm = (EncodeModel.projection v0)}})+ Query.StepCompare v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.query.Step"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "compare"),+ Model.fieldTerm = (comparisonConstraint v0)}})++-- | Encoder for hydra.core.query.TriplePattern+triplePattern :: Query.TriplePattern -> Model.Term+triplePattern x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.query.TriplePattern"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "subject"),+ Model.fieldTerm = (node (Query.triplePatternSubject x))},+ Model.Field {+ Model.fieldName = (Model.Name "predicate"),+ Model.fieldTerm = (path (Query.triplePatternPredicate x))},+ Model.Field {+ Model.fieldName = (Model.Name "object"),+ Model.fieldTerm = (node (Query.triplePatternObject x))}]})++-- | Encoder for hydra.core.query.Variable+variable :: Query.Variable -> Model.Term+variable x =+ Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.Name "hydra.core.query.Variable"),+ Model.wrappedTermBody = ((\x2 -> Model.TermLiteral (Model.LiteralString x2)) (Query.unVariable x))})
@@ -0,0 +1,167 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Term encoders for hydra.core.regex++module Hydra.Core.Encode.Regex where++import qualified Hydra.Core.Encode.Model as EncodeModel+import qualified Hydra.Core.Overlay.Haskell.Lib.Lists as Lists+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Regex as Regex+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | Encoder for hydra.core.regex.Alternation+alternation :: [Regex.RegexSequence] -> Model.Term+alternation xs = Model.TermList (Lists.map regexSequence xs)++-- | Encoder for hydra.core.regex.Atom+atom :: Regex.Atom -> Model.Term+atom x =+ case x of+ Regex.AtomLiteral v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.regex.Atom"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "literal"),+ Model.fieldTerm = (Model.TermLiteral (Model.LiteralInteger (Model.IntegerValueInt32 v0)))}})+ Regex.AtomAny -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.regex.Atom"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "any"),+ Model.fieldTerm = Model.TermUnit}})+ Regex.AtomAnchorStart -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.regex.Atom"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "anchorStart"),+ Model.fieldTerm = Model.TermUnit}})+ Regex.AtomAnchorEnd -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.regex.Atom"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "anchorEnd"),+ Model.fieldTerm = Model.TermUnit}})+ Regex.AtomGroup v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.regex.Atom"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "group"),+ Model.fieldTerm = (alternation v0)}})+ Regex.AtomClass v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.regex.Atom"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "class"),+ Model.fieldTerm = (characterClass v0)}})++-- | Encoder for hydra.core.regex.CharacterClass+characterClass :: Regex.CharacterClass -> Model.Term+characterClass x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.regex.CharacterClass"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "negated"),+ Model.fieldTerm = ((\x2 -> Model.TermLiteral (Model.LiteralBoolean x2)) (Regex.characterClassNegated x))},+ Model.Field {+ Model.fieldName = (Model.Name "items"),+ Model.fieldTerm = ((\xs -> Model.TermList (Lists.map classItem xs)) (Regex.characterClassItems x))}]})++-- | Encoder for hydra.core.regex.CharacterRange+characterRange :: Regex.CharacterRange -> Model.Term+characterRange x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.regex.CharacterRange"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "from"),+ Model.fieldTerm = ((\x2 -> Model.TermLiteral (Model.LiteralInteger (Model.IntegerValueInt32 x2))) (Regex.characterRangeFrom x))},+ Model.Field {+ Model.fieldName = (Model.Name "to"),+ Model.fieldTerm = ((\x2 -> Model.TermLiteral (Model.LiteralInteger (Model.IntegerValueInt32 x2))) (Regex.characterRangeTo x))}]})++-- | Encoder for hydra.core.regex.ClassItem+classItem :: Regex.ClassItem -> Model.Term+classItem x =+ case x of+ Regex.ClassItemCharacter v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.regex.ClassItem"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "character"),+ Model.fieldTerm = (Model.TermLiteral (Model.LiteralInteger (Model.IntegerValueInt32 v0)))}})+ Regex.ClassItemRange v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.regex.ClassItem"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "range"),+ Model.fieldTerm = (characterRange v0)}})++-- | Encoder for hydra.core.regex.Quantified+quantified :: Regex.Quantified -> Model.Term+quantified x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.regex.Quantified"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "atom"),+ Model.fieldTerm = (atom (Regex.quantifiedAtom x))},+ Model.Field {+ Model.fieldName = (Model.Name "quantifier"),+ Model.fieldTerm = (quantifier (Regex.quantifiedQuantifier x))}]})++-- | Encoder for hydra.core.regex.Quantifier+quantifier :: Regex.Quantifier -> Model.Term+quantifier x =+ case x of+ Regex.QuantifierOne -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.regex.Quantifier"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "one"),+ Model.fieldTerm = Model.TermUnit}})+ Regex.QuantifierZeroOrOne -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.regex.Quantifier"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "zeroOrOne"),+ Model.fieldTerm = Model.TermUnit}})+ Regex.QuantifierZeroOrMore -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.regex.Quantifier"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "zeroOrMore"),+ Model.fieldTerm = Model.TermUnit}})+ Regex.QuantifierOneOrMore -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.regex.Quantifier"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "oneOrMore"),+ Model.fieldTerm = Model.TermUnit}})+ Regex.QuantifierExactly v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.regex.Quantifier"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "exactly"),+ Model.fieldTerm = (Model.TermLiteral (Model.LiteralInteger (Model.IntegerValueInt32 v0)))}})+ Regex.QuantifierAtLeast v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.regex.Quantifier"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "atLeast"),+ Model.fieldTerm = (Model.TermLiteral (Model.LiteralInteger (Model.IntegerValueInt32 v0)))}})+ Regex.QuantifierRange_ v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.regex.Quantifier"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "range"),+ Model.fieldTerm = (quantifierRange v0)}})++-- | Encoder for hydra.core.regex.QuantifierRange+quantifierRange :: Regex.QuantifierRange -> Model.Term+quantifierRange x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.regex.QuantifierRange"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "min"),+ Model.fieldTerm = ((\x2 -> Model.TermLiteral (Model.LiteralInteger (Model.IntegerValueInt32 x2))) (Regex.quantifierRangeMin x))},+ Model.Field {+ Model.fieldName = (Model.Name "max"),+ Model.fieldTerm = ((\x2 -> Model.TermLiteral (Model.LiteralInteger (Model.IntegerValueInt32 x2))) (Regex.quantifierRangeMax x))}]})++-- | Encoder for hydra.core.regex.Regex+regex :: Regex.Alternation -> Model.Term+regex = alternation++-- | Encoder for hydra.core.regex.RegexSequence+regexSequence :: [Regex.Quantified] -> Model.Term+regexSequence xs = Model.TermList (Lists.map quantified xs)
@@ -0,0 +1,102 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Term encoders for hydra.core.relational++module Hydra.Core.Encode.Relational where++import qualified Hydra.Core.Encode.Model as EncodeModel+import qualified Hydra.Core.Overlay.Haskell.Lib.Lists as Lists+import qualified Hydra.Core.Overlay.Haskell.Lib.Maps as Maps+import qualified Hydra.Core.Overlay.Haskell.Lib.Sets as Sets+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Relational as Relational+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | Encoder for hydra.core.relational.ColumnName+columnName :: Relational.ColumnName -> Model.Term+columnName x =+ Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.Name "hydra.core.relational.ColumnName"),+ Model.wrappedTermBody = ((\x2 -> Model.TermLiteral (Model.LiteralString x2)) (Relational.unColumnName x))})++-- | Encoder for hydra.core.relational.ColumnSchema+columnSchema :: (t -> Model.Term) -> Relational.ColumnSchema t -> Model.Term+columnSchema t x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.relational.ColumnSchema"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (columnName (Relational.columnSchemaName x))},+ Model.Field {+ Model.fieldName = (Model.Name "domain"),+ Model.fieldTerm = (t (Relational.columnSchemaDomain x))}]})++-- | Encoder for hydra.core.relational.ForeignKey+foreignKey :: Relational.ForeignKey -> Model.Term+foreignKey x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.relational.ForeignKey"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "foreignRelation"),+ Model.fieldTerm = (relationName (Relational.foreignKeyForeignRelation x))},+ Model.Field {+ Model.fieldName = (Model.Name "keys"),+ Model.fieldTerm = ((\m -> Model.TermMap (Maps.bimap columnName columnName m)) (Relational.foreignKeyKeys x))}]})++-- | Encoder for hydra.core.relational.PrimaryKey+primaryKey :: Relational.PrimaryKey -> Model.Term+primaryKey x =+ Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.Name "hydra.core.relational.PrimaryKey"),+ Model.wrappedTermBody = ((\xs -> Model.TermList (Lists.map columnName xs)) (Relational.unPrimaryKey x))})++-- | Encoder for hydra.core.relational.Relation+relation :: (v -> Model.Term) -> Relational.Relation v -> Model.Term+relation v x =+ Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.Name "hydra.core.relational.Relation"),+ Model.wrappedTermBody = ((\xs -> Model.TermList (Lists.map (row v) xs)) (Relational.unRelation x))})++-- | Encoder for hydra.core.relational.RelationName+relationName :: Relational.RelationName -> Model.Term+relationName x =+ Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.Name "hydra.core.relational.RelationName"),+ Model.wrappedTermBody = ((\x2 -> Model.TermLiteral (Model.LiteralString x2)) (Relational.unRelationName x))})++-- | Encoder for hydra.core.relational.RelationSchema+relationSchema :: (t -> Model.Term) -> Relational.RelationSchema t -> Model.Term+relationSchema t x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.relational.RelationSchema"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (relationName (Relational.relationSchemaName x))},+ Model.Field {+ Model.fieldName = (Model.Name "columns"),+ Model.fieldTerm = ((\xs -> Model.TermList (Lists.map (columnSchema t) xs)) (Relational.relationSchemaColumns x))},+ Model.Field {+ Model.fieldName = (Model.Name "primaryKeys"),+ Model.fieldTerm = ((\xs -> Model.TermList (Lists.map primaryKey xs)) (Relational.relationSchemaPrimaryKeys x))},+ Model.Field {+ Model.fieldName = (Model.Name "foreignKeys"),+ Model.fieldTerm = ((\xs -> Model.TermList (Lists.map foreignKey xs)) (Relational.relationSchemaForeignKeys x))}]})++-- | Encoder for hydra.core.relational.Relationship+relationship :: Ord v => ((v -> Model.Term) -> Relational.Relationship v -> Model.Term)+relationship v x =+ Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.Name "hydra.core.relational.Relationship"),+ Model.wrappedTermBody = ((\s -> Model.TermSet (Sets.map (\m -> Model.TermMap (Maps.bimap columnName v m)) s)) (Relational.unRelationship x))})++-- | Encoder for hydra.core.relational.Row+row :: (v -> Model.Term) -> Relational.Row v -> Model.Term+row v x =+ Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.Name "hydra.core.relational.Row"),+ Model.wrappedTermBody = ((\xs -> Model.TermList (Lists.map v xs)) (Relational.unRow x))})
@@ -0,0 +1,65 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Term encoders for hydra.core.system++module Hydra.Core.Encode.System where++import qualified Hydra.Core.Encode.File as File+import qualified Hydra.Core.Encode.Model as EncodeModel+import qualified Hydra.Core.Overlay.Haskell.Lib.Lists as Lists+import qualified Hydra.Core.Overlay.Haskell.Lib.Maps as Maps+import qualified Hydra.Core.Overlay.Haskell.Lib.Optionals as Optionals+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.System as System+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | Encoder for hydra.core.system.Command+command :: System.Command -> Model.Term+command x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.system.Command"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "program"),+ Model.fieldTerm = (File.filePath (System.commandProgram x))},+ Model.Field {+ Model.fieldName = (Model.Name "arguments"),+ Model.fieldTerm = ((\xs -> Model.TermList (Lists.map (\x2 -> Model.TermLiteral (Model.LiteralString x2)) xs)) (System.commandArguments x))},+ Model.Field {+ Model.fieldName = (Model.Name "workingDirectory"),+ Model.fieldTerm = ((\opt -> Model.TermOptional (Optionals.map File.filePath opt)) (System.commandWorkingDirectory x))},+ Model.Field {+ Model.fieldName = (Model.Name "environment"),+ Model.fieldTerm = ((\opt -> Model.TermOptional (Optionals.map (\m -> Model.TermMap (Maps.bimap environmentVariable (\x2 -> Model.TermLiteral (Model.LiteralString x2)) m)) opt)) (System.commandEnvironment x))}]})++-- | Encoder for hydra.core.system.EnvironmentVariable+environmentVariable :: System.EnvironmentVariable -> Model.Term+environmentVariable x =+ Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.Name "hydra.core.system.EnvironmentVariable"),+ Model.wrappedTermBody = ((\x2 -> Model.TermLiteral (Model.LiteralString x2)) (System.unEnvironmentVariable x))})++-- | Encoder for hydra.core.system.ProcessResult+processResult :: System.ProcessResult -> Model.Term+processResult x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.system.ProcessResult"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "exitCode"),+ Model.fieldTerm = (statusCode (System.processResultExitCode x))},+ Model.Field {+ Model.fieldName = (Model.Name "stdout"),+ Model.fieldTerm = ((\x2 -> Model.TermLiteral (Model.LiteralBinary x2)) (System.processResultStdout x))},+ Model.Field {+ Model.fieldName = (Model.Name "stderr"),+ Model.fieldTerm = ((\x2 -> Model.TermLiteral (Model.LiteralBinary x2)) (System.processResultStderr x))}]})++-- | Encoder for hydra.core.system.StatusCode+statusCode :: System.StatusCode -> Model.Term+statusCode x =+ Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.Name "hydra.core.system.StatusCode"),+ Model.wrappedTermBody = ((\x2 -> Model.TermLiteral (Model.LiteralInteger (Model.IntegerValueInt32 x2))) (System.unStatusCode x))})
@@ -0,0 +1,68 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Term encoders for hydra.core.tabular++module Hydra.Core.Encode.Tabular where++import qualified Hydra.Core.Encode.Model as EncodeModel+import qualified Hydra.Core.Encode.Relational as Relational+import qualified Hydra.Core.Overlay.Haskell.Lib.Lists as Lists+import qualified Hydra.Core.Overlay.Haskell.Lib.Optionals as Optionals+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Tabular as Tabular+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | Encoder for hydra.core.tabular.ColumnType+columnType :: Tabular.ColumnType -> Model.Term+columnType x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.tabular.ColumnType"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Relational.columnName (Tabular.columnTypeName x))},+ Model.Field {+ Model.fieldName = (Model.Name "type"),+ Model.fieldTerm = (EncodeModel.type_ (Tabular.columnTypeType x))}]})++-- | Encoder for hydra.core.tabular.DataRow+dataRow :: (v -> Model.Term) -> Tabular.DataRow v -> Model.Term+dataRow v x =+ Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.Name "hydra.core.tabular.DataRow"),+ Model.wrappedTermBody = ((\xs -> Model.TermList (Lists.map (\opt -> Model.TermOptional (Optionals.map v opt)) xs)) (Tabular.unDataRow x))})++-- | Encoder for hydra.core.tabular.HeaderRow+headerRow :: Tabular.HeaderRow -> Model.Term+headerRow x =+ Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.Name "hydra.core.tabular.HeaderRow"),+ Model.wrappedTermBody = ((\xs -> Model.TermList (Lists.map (\x2 -> Model.TermLiteral (Model.LiteralString x2)) xs)) (Tabular.unHeaderRow x))})++-- | Encoder for hydra.core.tabular.Table+table :: (v -> Model.Term) -> Tabular.Table v -> Model.Term+table v x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.tabular.Table"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "header"),+ Model.fieldTerm = ((\opt -> Model.TermOptional (Optionals.map headerRow opt)) (Tabular.tableHeader x))},+ Model.Field {+ Model.fieldName = (Model.Name "data"),+ Model.fieldTerm = ((\xs -> Model.TermList (Lists.map (dataRow v) xs)) (Tabular.tableData x))}]})++-- | Encoder for hydra.core.tabular.TableType+tableType :: Tabular.TableType -> Model.Term+tableType x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.tabular.TableType"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (Relational.relationName (Tabular.tableTypeName x))},+ Model.Field {+ Model.fieldName = (Model.Name "columns"),+ Model.fieldTerm = ((\xs -> Model.TermList (Lists.map columnType xs)) (Tabular.tableTypeColumns x))}]})
@@ -0,0 +1,19 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Term encoders for hydra.core.testing++module Hydra.Core.Encode.Testing where++import qualified Hydra.Core.Encode.Model as EncodeModel+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Testing as Testing+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | Encoder for hydra.core.testing.Tag+tag :: Testing.Tag -> Model.Term+tag x =+ Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.Name "hydra.core.testing.Tag"),+ Model.wrappedTermBody = ((\x2 -> Model.TermLiteral (Model.LiteralString x2)) (Testing.unTag x))})
@@ -0,0 +1,25 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Term encoders for hydra.core.time++module Hydra.Core.Encode.Time where++import qualified Hydra.Core.Encode.Model as EncodeModel+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Time as Time+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | Encoder for hydra.core.time.Timespec+timespec :: Time.Timespec -> Model.Term+timespec x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.time.Timespec"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "seconds"),+ Model.fieldTerm = ((\x2 -> Model.TermLiteral (Model.LiteralInteger (Model.IntegerValueInt64 x2))) (Time.timespecSeconds x))},+ Model.Field {+ Model.fieldName = (Model.Name "nanoseconds"),+ Model.fieldTerm = ((\x2 -> Model.TermLiteral (Model.LiteralInteger (Model.IntegerValueUint32 x2))) (Time.timespecNanoseconds x))}]})
@@ -0,0 +1,49 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Term encoders for hydra.core.topology++module Hydra.Core.Encode.Topology where++import qualified Hydra.Core.Encode.Model as EncodeModel+import qualified Hydra.Core.Overlay.Haskell.Lib.Lists as Lists+import qualified Hydra.Core.Overlay.Haskell.Lib.Maps as Maps+import qualified Hydra.Core.Overlay.Haskell.Lib.Sets as Sets+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Topology as Topology+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void+import qualified Data.Map as M++-- | Encoder for hydra.core.topology.Graph+graph :: M.Map Topology.Vertex [Topology.Vertex] -> Model.Term+graph m = Model.TermMap (Maps.bimap vertex (\xs -> Model.TermList (Lists.map vertex xs)) m)++-- | Encoder for hydra.core.topology.TarjanState+tarjanState :: Topology.TarjanState -> Model.Term+tarjanState x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.topology.TarjanState"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "counter"),+ Model.fieldTerm = ((\x2 -> Model.TermLiteral (Model.LiteralInteger (Model.IntegerValueInt32 x2))) (Topology.tarjanStateCounter x))},+ Model.Field {+ Model.fieldName = (Model.Name "indices"),+ Model.fieldTerm = ((\m -> Model.TermMap (Maps.bimap vertex (\x2 -> Model.TermLiteral (Model.LiteralInteger (Model.IntegerValueInt32 x2))) m)) (Topology.tarjanStateIndices x))},+ Model.Field {+ Model.fieldName = (Model.Name "lowLinks"),+ Model.fieldTerm = ((\m -> Model.TermMap (Maps.bimap vertex (\x2 -> Model.TermLiteral (Model.LiteralInteger (Model.IntegerValueInt32 x2))) m)) (Topology.tarjanStateLowLinks x))},+ Model.Field {+ Model.fieldName = (Model.Name "stack"),+ Model.fieldTerm = ((\xs -> Model.TermList (Lists.map vertex xs)) (Topology.tarjanStateStack x))},+ Model.Field {+ Model.fieldName = (Model.Name "onStack"),+ Model.fieldTerm = ((\s -> Model.TermSet (Sets.map vertex s)) (Topology.tarjanStateOnStack x))},+ Model.Field {+ Model.fieldName = (Model.Name "sccs"),+ Model.fieldTerm = ((\xs -> Model.TermList (Lists.map (\xs2 -> Model.TermList (Lists.map vertex xs2)) xs)) (Topology.tarjanStateSccs x))}]})++-- | Encoder for hydra.core.topology.Vertex+vertex :: Int -> Model.Term+vertex x = Model.TermLiteral (Model.LiteralInteger (Model.IntegerValueInt32 x))
@@ -0,0 +1,52 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Term encoders for hydra.core.typed++module Hydra.Core.Encode.Typed where++import qualified Hydra.Core.Encode.Model as EncodeModel+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Typed as Typed+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | Encoder for hydra.core.typed.TypedBinding+typedBinding :: (a -> Model.Term) -> Typed.TypedBinding a -> Model.Term+typedBinding a x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.typed.TypedBinding"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (EncodeModel.name (Typed.typedBindingName x))},+ Model.Field {+ Model.fieldName = (Model.Name "term"),+ Model.fieldTerm = (typedTerm a (Typed.typedBindingTerm x))}]})++-- | Encoder for hydra.core.typed.TypedName+typedName :: (a -> Model.Term) -> Typed.TypedName a -> Model.Term+typedName a x =+ Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.Name "hydra.core.typed.TypedName"),+ Model.wrappedTermBody = (EncodeModel.name (Typed.unTypedName x))})++-- | Encoder for hydra.core.typed.TypedTerm+typedTerm :: (a -> Model.Term) -> Typed.TypedTerm a -> Model.Term+typedTerm a x =+ Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.Name "hydra.core.typed.TypedTerm"),+ Model.wrappedTermBody = (EncodeModel.term (Typed.unTypedTerm x))})++-- | Encoder for hydra.core.typed.TypedTermDefinition+typedTermDefinition :: (a -> Model.Term) -> Typed.TypedTermDefinition a -> Model.Term+typedTermDefinition a x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.typed.TypedTermDefinition"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (EncodeModel.name (Typed.typedTermDefinitionName x))},+ Model.Field {+ Model.fieldName = (Model.Name "term"),+ Model.fieldTerm = (typedTerm a (Typed.typedTermDefinitionTerm x))}]})
@@ -0,0 +1,180 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Term encoders for hydra.core.typing++module Hydra.Core.Encode.Typing where++import qualified Hydra.Core.Encode.Model as EncodeModel+import qualified Hydra.Core.Encode.Paths as Paths+import qualified Hydra.Core.Overlay.Haskell.Lib.Lists as Lists+import qualified Hydra.Core.Overlay.Haskell.Lib.Maps as Maps+import qualified Hydra.Core.Overlay.Haskell.Lib.Optionals as Optionals+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Typing as Typing+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | Encoder for hydra.core.typing.FunctionStructure+functionStructure :: (env -> Model.Term) -> Typing.FunctionStructure env -> Model.Term+functionStructure env x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.typing.FunctionStructure"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "typeParams"),+ Model.fieldTerm = ((\xs -> Model.TermList (Lists.map EncodeModel.name xs)) (Typing.functionStructureTypeParams x))},+ Model.Field {+ Model.fieldName = (Model.Name "params"),+ Model.fieldTerm = ((\xs -> Model.TermList (Lists.map EncodeModel.name xs)) (Typing.functionStructureParams x))},+ Model.Field {+ Model.fieldName = (Model.Name "bindings"),+ Model.fieldTerm = ((\xs -> Model.TermList (Lists.map EncodeModel.binding xs)) (Typing.functionStructureBindings x))},+ Model.Field {+ Model.fieldName = (Model.Name "body"),+ Model.fieldTerm = (EncodeModel.term (Typing.functionStructureBody x))},+ Model.Field {+ Model.fieldName = (Model.Name "domains"),+ Model.fieldTerm = ((\xs -> Model.TermList (Lists.map EncodeModel.type_ xs)) (Typing.functionStructureDomains x))},+ Model.Field {+ Model.fieldName = (Model.Name "codomain"),+ Model.fieldTerm = ((\opt -> Model.TermOptional (Optionals.map EncodeModel.type_ opt)) (Typing.functionStructureCodomain x))},+ Model.Field {+ Model.fieldName = (Model.Name "environment"),+ Model.fieldTerm = (env (Typing.functionStructureEnvironment x))}]})++-- | Encoder for hydra.core.typing.InferenceContext+inferenceContext :: Typing.InferenceContext -> Model.Term+inferenceContext x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.typing.InferenceContext"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "freshTypeVariableCount"),+ Model.fieldTerm = ((\x2 -> Model.TermLiteral (Model.LiteralInteger (Model.IntegerValueInt32 x2))) (Typing.inferenceContextFreshTypeVariableCount x))},+ Model.Field {+ Model.fieldName = (Model.Name "trace"),+ Model.fieldTerm = ((\xs -> Model.TermList (Lists.map Paths.subtermStep xs)) (Typing.inferenceContextTrace x))}]})++-- | Encoder for hydra.core.typing.InferenceResult+inferenceResult :: Typing.InferenceResult -> Model.Term+inferenceResult x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.typing.InferenceResult"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "term"),+ Model.fieldTerm = (EncodeModel.term (Typing.inferenceResultTerm x))},+ Model.Field {+ Model.fieldName = (Model.Name "type"),+ Model.fieldTerm = (EncodeModel.type_ (Typing.inferenceResultType x))},+ Model.Field {+ Model.fieldName = (Model.Name "subst"),+ Model.fieldTerm = (typeSubst (Typing.inferenceResultSubst x))},+ Model.Field {+ Model.fieldName = (Model.Name "classConstraints"),+ Model.fieldTerm = ((\m -> Model.TermMap (Maps.bimap EncodeModel.name EncodeModel.typeVariableConstraints m)) (Typing.inferenceResultClassConstraints x))},+ Model.Field {+ Model.fieldName = (Model.Name "context"),+ Model.fieldTerm = (inferenceContext (Typing.inferenceResultContext x))}]})++-- | Encoder for hydra.core.typing.Parameter+parameter :: Typing.Parameter -> Model.Term+parameter x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.typing.Parameter"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (EncodeModel.name (Typing.parameterName x))},+ Model.Field {+ Model.fieldName = (Model.Name "description"),+ Model.fieldTerm = ((\opt -> Model.TermOptional (Optionals.map (\x2 -> Model.TermLiteral (Model.LiteralString x2)) opt)) (Typing.parameterDescription x))},+ Model.Field {+ Model.fieldName = (Model.Name "type"),+ Model.fieldTerm = (EncodeModel.type_ (Typing.parameterType x))},+ Model.Field {+ Model.fieldName = (Model.Name "isLazy"),+ Model.fieldTerm = ((\x2 -> Model.TermLiteral (Model.LiteralBoolean x2)) (Typing.parameterIsLazy x))}]})++-- | Encoder for hydra.core.typing.Result+result :: Typing.Result -> Model.Term+result x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.typing.Result"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "description"),+ Model.fieldTerm = ((\opt -> Model.TermOptional (Optionals.map (\x2 -> Model.TermLiteral (Model.LiteralString x2)) opt)) (Typing.resultDescription x))},+ Model.Field {+ Model.fieldName = (Model.Name "type"),+ Model.fieldTerm = (EncodeModel.type_ (Typing.resultType x))}]})++-- | Encoder for hydra.core.typing.TermSignature+termSignature :: Typing.TermSignature -> Model.Term+termSignature x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.typing.TermSignature"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "typeParameters"),+ Model.fieldTerm = ((\xs -> Model.TermList (Lists.map typeParameter xs)) (Typing.termSignatureTypeParameters x))},+ Model.Field {+ Model.fieldName = (Model.Name "parameters"),+ Model.fieldTerm = ((\xs -> Model.TermList (Lists.map parameter xs)) (Typing.termSignatureParameters x))},+ Model.Field {+ Model.fieldName = (Model.Name "result"),+ Model.fieldTerm = (result (Typing.termSignatureResult x))}]})++-- | Encoder for hydra.core.typing.TermSubst+termSubst :: Typing.TermSubst -> Model.Term+termSubst x =+ Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.Name "hydra.core.typing.TermSubst"),+ Model.wrappedTermBody = ((\m -> Model.TermMap (Maps.bimap EncodeModel.name EncodeModel.term m)) (Typing.unTermSubst x))})++-- | Encoder for hydra.core.typing.TypeClass+typeClass :: Typing.TypeClass -> Model.Term+typeClass x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.typing.TypeClass"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "description"),+ Model.fieldTerm = ((\x2 -> Model.TermLiteral (Model.LiteralString x2)) (Typing.typeClassDescription x))}]})++-- | Encoder for hydra.core.typing.TypeConstraint+typeConstraint :: Typing.TypeConstraint -> Model.Term+typeConstraint x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.typing.TypeConstraint"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "left"),+ Model.fieldTerm = (EncodeModel.type_ (Typing.typeConstraintLeft x))},+ Model.Field {+ Model.fieldName = (Model.Name "right"),+ Model.fieldTerm = (EncodeModel.type_ (Typing.typeConstraintRight x))},+ Model.Field {+ Model.fieldName = (Model.Name "comment"),+ Model.fieldTerm = ((\x2 -> Model.TermLiteral (Model.LiteralString x2)) (Typing.typeConstraintComment x))}]})++-- | Encoder for hydra.core.typing.TypeParameter+typeParameter :: Typing.TypeParameter -> Model.Term+typeParameter x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.typing.TypeParameter"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (EncodeModel.name (Typing.typeParameterName x))},+ Model.Field {+ Model.fieldName = (Model.Name "constraints"),+ Model.fieldTerm = ((\xs -> Model.TermList (Lists.map EncodeModel.typeClassConstraint xs)) (Typing.typeParameterConstraints x))}]})++-- | Encoder for hydra.core.typing.TypeSubst+typeSubst :: Typing.TypeSubst -> Model.Term+typeSubst x =+ Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.Name "hydra.core.typing.TypeSubst"),+ Model.wrappedTermBody = ((\m -> Model.TermMap (Maps.bimap EncodeModel.name EncodeModel.type_ m)) (Typing.unTypeSubst x))})
@@ -0,0 +1,107 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Term encoders for hydra.core.util++module Hydra.Core.Encode.Util where++import qualified Hydra.Core.Encode.Model as EncodeModel+import qualified Hydra.Core.Encode.Packaging as Packaging+import qualified Hydra.Core.Overlay.Haskell.Lib.Maps as Maps+import qualified Hydra.Core.Overlay.Haskell.Lib.Optionals as Optionals+import qualified Hydra.Core.Overlay.Haskell.Lib.Pairs as Pairs+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Util as Util+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | Encoder for hydra.core.util.CaseConvention+caseConvention :: Util.CaseConvention -> Model.Term+caseConvention x =+ case x of+ Util.CaseConventionCamel -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.util.CaseConvention"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "camel"),+ Model.fieldTerm = Model.TermUnit}})+ Util.CaseConventionPascal -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.util.CaseConvention"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "pascal"),+ Model.fieldTerm = Model.TermUnit}})+ Util.CaseConventionLowerSnake -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.util.CaseConvention"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "lowerSnake"),+ Model.fieldTerm = Model.TermUnit}})+ Util.CaseConventionUpperSnake -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.util.CaseConvention"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "upperSnake"),+ Model.fieldTerm = Model.TermUnit}})+ Util.CaseConventionUpperDashed -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.util.CaseConvention"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "upperDashed"),+ Model.fieldTerm = Model.TermUnit}})++-- | Encoder for hydra.core.util.Comparison+comparison :: Util.Comparison -> Model.Term+comparison x =+ case x of+ Util.ComparisonLessThan -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.util.Comparison"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "lessThan"),+ Model.fieldTerm = Model.TermUnit}})+ Util.ComparisonEqualTo -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.util.Comparison"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "equalTo"),+ Model.fieldTerm = Model.TermUnit}})+ Util.ComparisonGreaterThan -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.util.Comparison"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "greaterThan"),+ Model.fieldTerm = Model.TermUnit}})++-- | Encoder for hydra.core.util.ModuleNames+moduleNames :: (n -> Model.Term) -> Util.ModuleNames n -> Model.Term+moduleNames n x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.util.ModuleNames"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "focus"),+ Model.fieldTerm = ((\p -> Model.TermPair (Pairs.bimap Packaging.moduleName n p)) (Util.moduleNamesFocus x))},+ Model.Field {+ Model.fieldName = (Model.Name "mapping"),+ Model.fieldTerm = ((\m -> Model.TermMap (Maps.bimap Packaging.moduleName n m)) (Util.moduleNamesMapping x))}]})++-- | Encoder for hydra.core.util.Precision+precision :: Util.Precision -> Model.Term+precision x =+ case x of+ Util.PrecisionArbitrary -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.util.Precision"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "arbitrary"),+ Model.fieldTerm = Model.TermUnit}})+ Util.PrecisionBits v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.util.Precision"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "bits"),+ Model.fieldTerm = (Model.TermLiteral (Model.LiteralInteger (Model.IntegerValueInt32 v0)))}})++-- | Encoder for hydra.core.util.QualifiedName+qualifiedName :: Util.QualifiedName -> Model.Term+qualifiedName x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.util.QualifiedName"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "moduleName"),+ Model.fieldTerm = ((\opt -> Model.TermOptional (Optionals.map Packaging.moduleName opt)) (Util.qualifiedNameModuleName x))},+ Model.Field {+ Model.fieldName = (Model.Name "local"),+ Model.fieldTerm = ((\x2 -> Model.TermLiteral (Model.LiteralString x2)) (Util.qualifiedNameLocal x))}]})
@@ -0,0 +1,47 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Term encoders for hydra.core.validation++module Hydra.Core.Encode.Validation where++import qualified Hydra.Core.Encode.Error.Model as ErrorModel+import qualified Hydra.Core.Encode.Model as EncodeModel+import qualified Hydra.Core.Overlay.Haskell.Lib.Lists as Lists+import qualified Hydra.Core.Overlay.Haskell.Lib.Sets as Sets+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Validation as Validation+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | Encoder for hydra.core.validation.ValidationProfile+validationProfile :: Validation.ValidationProfile -> Model.Term+validationProfile x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.validation.ValidationProfile"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "errorRules"),+ Model.fieldTerm = ((\s -> Model.TermSet (Sets.map EncodeModel.name s)) (Validation.validationProfileErrorRules x))},+ Model.Field {+ Model.fieldName = (Model.Name "warningRules"),+ Model.fieldTerm = ((\s -> Model.TermSet (Sets.map EncodeModel.name s)) (Validation.validationProfileWarningRules x))},+ Model.Field {+ Model.fieldName = (Model.Name "maxErrors"),+ Model.fieldTerm = ((\x2 -> Model.TermLiteral (Model.LiteralInteger (Model.IntegerValueInt32 x2))) (Validation.validationProfileMaxErrors x))},+ Model.Field {+ Model.fieldName = (Model.Name "maxWarnings"),+ Model.fieldTerm = ((\x2 -> Model.TermLiteral (Model.LiteralInteger (Model.IntegerValueInt32 x2))) (Validation.validationProfileMaxWarnings x))}]})++-- | Encoder for hydra.core.validation.ValidationResult+validationResult :: (e -> Model.Term) -> Validation.ValidationResult e -> Model.Term+validationResult e x =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.validation.ValidationResult"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "errors"),+ Model.fieldTerm = ((\xs -> Model.TermList (Lists.map e xs)) (Validation.validationResultErrors x))},+ Model.Field {+ Model.fieldName = (Model.Name "warnings"),+ Model.fieldTerm = ((\xs -> Model.TermList (Lists.map e xs)) (Validation.validationResultWarnings x))}]})
@@ -0,0 +1,252 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Term encoders for hydra.core.variants++module Hydra.Core.Encode.Variants where++import qualified Hydra.Core.Encode.Model as EncodeModel+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | Encoder for hydra.core.variants.LiteralVariant+literalVariant :: Variants.LiteralVariant -> Model.Term+literalVariant x =+ case x of+ Variants.LiteralVariantBinary -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.variants.LiteralVariant"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "binary"),+ Model.fieldTerm = Model.TermUnit}})+ Variants.LiteralVariantBoolean -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.variants.LiteralVariant"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "boolean"),+ Model.fieldTerm = Model.TermUnit}})+ Variants.LiteralVariantDecimal -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.variants.LiteralVariant"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "decimal"),+ Model.fieldTerm = Model.TermUnit}})+ Variants.LiteralVariantFloat -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.variants.LiteralVariant"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "float"),+ Model.fieldTerm = Model.TermUnit}})+ Variants.LiteralVariantInteger -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.variants.LiteralVariant"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "integer"),+ Model.fieldTerm = Model.TermUnit}})+ Variants.LiteralVariantString -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.variants.LiteralVariant"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "string"),+ Model.fieldTerm = Model.TermUnit}})++-- | Encoder for hydra.core.variants.TermVariant+termVariant :: Variants.TermVariant -> Model.Term+termVariant x =+ case x of+ Variants.TermVariantAnnotated -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.variants.TermVariant"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "annotated"),+ Model.fieldTerm = Model.TermUnit}})+ Variants.TermVariantApplication -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.variants.TermVariant"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "application"),+ Model.fieldTerm = Model.TermUnit}})+ Variants.TermVariantCases -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.variants.TermVariant"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "cases"),+ Model.fieldTerm = Model.TermUnit}})+ Variants.TermVariantEither -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.variants.TermVariant"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "either"),+ Model.fieldTerm = Model.TermUnit}})+ Variants.TermVariantInject -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.variants.TermVariant"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "inject"),+ Model.fieldTerm = Model.TermUnit}})+ Variants.TermVariantLambda -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.variants.TermVariant"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "lambda"),+ Model.fieldTerm = Model.TermUnit}})+ Variants.TermVariantLet -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.variants.TermVariant"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "let"),+ Model.fieldTerm = Model.TermUnit}})+ Variants.TermVariantList -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.variants.TermVariant"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "list"),+ Model.fieldTerm = Model.TermUnit}})+ Variants.TermVariantLiteral -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.variants.TermVariant"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "literal"),+ Model.fieldTerm = Model.TermUnit}})+ Variants.TermVariantMap -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.variants.TermVariant"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "map"),+ Model.fieldTerm = Model.TermUnit}})+ Variants.TermVariantOptional -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.variants.TermVariant"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "optional"),+ Model.fieldTerm = Model.TermUnit}})+ Variants.TermVariantPair -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.variants.TermVariant"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "pair"),+ Model.fieldTerm = Model.TermUnit}})+ Variants.TermVariantProject -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.variants.TermVariant"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "project"),+ Model.fieldTerm = Model.TermUnit}})+ Variants.TermVariantRecord -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.variants.TermVariant"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "record"),+ Model.fieldTerm = Model.TermUnit}})+ Variants.TermVariantSet -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.variants.TermVariant"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "set"),+ Model.fieldTerm = Model.TermUnit}})+ Variants.TermVariantTypeApplication -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.variants.TermVariant"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "typeApplication"),+ Model.fieldTerm = Model.TermUnit}})+ Variants.TermVariantTypeLambda -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.variants.TermVariant"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "typeLambda"),+ Model.fieldTerm = Model.TermUnit}})+ Variants.TermVariantUnit -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.variants.TermVariant"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "unit"),+ Model.fieldTerm = Model.TermUnit}})+ Variants.TermVariantUnwrap -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.variants.TermVariant"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "unwrap"),+ Model.fieldTerm = Model.TermUnit}})+ Variants.TermVariantVariable -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.variants.TermVariant"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "variable"),+ Model.fieldTerm = Model.TermUnit}})+ Variants.TermVariantWrap -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.variants.TermVariant"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "wrap"),+ Model.fieldTerm = Model.TermUnit}})++-- | Encoder for hydra.core.variants.TypeVariant+typeVariant :: Variants.TypeVariant -> Model.Term+typeVariant x =+ case x of+ Variants.TypeVariantAnnotated -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.variants.TypeVariant"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "annotated"),+ Model.fieldTerm = Model.TermUnit}})+ Variants.TypeVariantApplication -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.variants.TypeVariant"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "application"),+ Model.fieldTerm = Model.TermUnit}})+ Variants.TypeVariantEffect -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.variants.TypeVariant"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "effect"),+ Model.fieldTerm = Model.TermUnit}})+ Variants.TypeVariantEither -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.variants.TypeVariant"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "either"),+ Model.fieldTerm = Model.TermUnit}})+ Variants.TypeVariantForall -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.variants.TypeVariant"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "forall"),+ Model.fieldTerm = Model.TermUnit}})+ Variants.TypeVariantFunction -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.variants.TypeVariant"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "function"),+ Model.fieldTerm = Model.TermUnit}})+ Variants.TypeVariantList -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.variants.TypeVariant"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "list"),+ Model.fieldTerm = Model.TermUnit}})+ Variants.TypeVariantLiteral -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.variants.TypeVariant"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "literal"),+ Model.fieldTerm = Model.TermUnit}})+ Variants.TypeVariantMap -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.variants.TypeVariant"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "map"),+ Model.fieldTerm = Model.TermUnit}})+ Variants.TypeVariantOptional -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.variants.TypeVariant"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "optional"),+ Model.fieldTerm = Model.TermUnit}})+ Variants.TypeVariantPair -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.variants.TypeVariant"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "pair"),+ Model.fieldTerm = Model.TermUnit}})+ Variants.TypeVariantRecord -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.variants.TypeVariant"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "record"),+ Model.fieldTerm = Model.TermUnit}})+ Variants.TypeVariantSet -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.variants.TypeVariant"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "set"),+ Model.fieldTerm = Model.TermUnit}})+ Variants.TypeVariantUnion -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.variants.TypeVariant"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "union"),+ Model.fieldTerm = Model.TermUnit}})+ Variants.TypeVariantUnit -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.variants.TypeVariant"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "unit"),+ Model.fieldTerm = Model.TermUnit}})+ Variants.TypeVariantVariable -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.variants.TypeVariant"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "variable"),+ Model.fieldTerm = Model.TermUnit}})+ Variants.TypeVariantVoid -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.variants.TypeVariant"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "void"),+ Model.fieldTerm = Model.TermUnit}})+ Variants.TypeVariantWrap -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.variants.TypeVariant"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "wrap"),+ Model.fieldTerm = Model.TermUnit}})
@@ -0,0 +1,69 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Term encoders for hydra.core.yaml.model++module Hydra.Core.Encode.Yaml.Model where++import qualified Hydra.Core.Encode.Model as EncodeModel+import qualified Hydra.Core.Overlay.Haskell.Lib.Lists as Lists+import qualified Hydra.Core.Overlay.Haskell.Lib.Maps as Maps+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Yaml.Model as YamlModel+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | Encoder for hydra.core.yaml.model.Node+node :: YamlModel.Node -> Model.Term+node x =+ case x of+ YamlModel.NodeMapping v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.yaml.model.Node"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "mapping"),+ Model.fieldTerm = (Model.TermMap (Maps.bimap node node v0))}})+ YamlModel.NodeScalar v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.yaml.model.Node"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "scalar"),+ Model.fieldTerm = (scalar v0)}})+ YamlModel.NodeSequence v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.yaml.model.Node"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "sequence"),+ Model.fieldTerm = (Model.TermList (Lists.map node v0))}})++-- | Encoder for hydra.core.yaml.model.Scalar+scalar :: YamlModel.Scalar -> Model.Term+scalar x =+ case x of+ YamlModel.ScalarBool v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.yaml.model.Scalar"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "bool"),+ Model.fieldTerm = (Model.TermLiteral (Model.LiteralBoolean v0))}})+ YamlModel.ScalarDecimal v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.yaml.model.Scalar"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "decimal"),+ Model.fieldTerm = (Model.TermLiteral (Model.LiteralDecimal v0))}})+ YamlModel.ScalarFloat v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.yaml.model.Scalar"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "float"),+ Model.fieldTerm = (Model.TermLiteral (Model.LiteralFloat (Model.FloatValueFloat64 v0)))}})+ YamlModel.ScalarInt v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.yaml.model.Scalar"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "int"),+ Model.fieldTerm = (Model.TermLiteral (Model.LiteralInteger (Model.IntegerValueBigint v0)))}})+ YamlModel.ScalarNull -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.yaml.model.Scalar"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "null"),+ Model.fieldTerm = Model.TermUnit}})+ YamlModel.ScalarStr v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.yaml.model.Scalar"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "str"),+ Model.fieldTerm = (Model.TermLiteral (Model.LiteralString v0))}})
@@ -0,0 +1,813 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Functions for generating term encoders from type modules++module Hydra.Core.Encoding where++import qualified Hydra.Core.Annotations as Annotations+import qualified Hydra.Core.Ast as Ast+import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Constants as Constants+import qualified Hydra.Core.Decode.Model as DecodeModel+import qualified Hydra.Core.Diff as Diff+import qualified Hydra.Core.Docs as Docs+import qualified Hydra.Core.Encode.Model as EncodeModel+import qualified Hydra.Core.Error.Checking as Checking+import qualified Hydra.Core.Error.File as ErrorFile+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Error.Packaging as ErrorPackaging+import qualified Hydra.Core.Error.System as ErrorSystem+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Formatting as Formatting+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Json.Model as JsonModel+import qualified Hydra.Core.Overlay.Haskell.Lib.Eithers as Eithers+import qualified Hydra.Core.Overlay.Haskell.Lib.Lists as Lists+import qualified Hydra.Core.Overlay.Haskell.Lib.Logic as Logic+import qualified Hydra.Core.Overlay.Haskell.Lib.Maps as Maps+import qualified Hydra.Core.Overlay.Haskell.Lib.Optionals as Optionals+import qualified Hydra.Core.Overlay.Haskell.Lib.Sets as Sets+import qualified Hydra.Core.Overlay.Haskell.Lib.Strings as Strings+import qualified Hydra.Core.Markdown as Markdown+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Names as Names+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Parsing as Parsing+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Predicates as Predicates+import qualified Hydra.Core.Query as Query+import qualified Hydra.Core.Regex as Regex+import qualified Hydra.Core.Relational as Relational+import qualified Hydra.Core.Rewriting as Rewriting+import qualified Hydra.Core.Scoping as Scoping+import qualified Hydra.Core.System as System+import qualified Hydra.Core.Tabular as Tabular+import qualified Hydra.Core.Testing as Testing+import qualified Hydra.Core.Time as Time+import qualified Hydra.Core.Topology as Topology+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Validation as Validation+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | Left-apply type-variable params to a base type in binder order (fixes param reversal)+applyForallParamsInOrder :: Model.Type -> [Model.Name] -> Model.Type+applyForallParamsInOrder base params =+ Lists.foldl (\acc -> \p -> Model.TypeApplication (Model.ApplicationType {+ Model.applicationTypeFunction = acc,+ Model.applicationTypeArgument = (Model.TypeVariable p)})) base params++-- | Transform a type binding into an encoder binding+encodeBinding :: t0 -> Graph.Graph -> Model.Binding -> Either Errors.DecodingError Model.Binding+encodeBinding cx graph b =+ Eithers.bind (DecodeModel.type_ graph (Model.bindingTerm b)) (\typ ->+ let rawBody = encodeTypeNamed (Model.bindingName b) typ+ description =+ Strings.concat [+ "Encoder for ",+ (Model.unName (Model.bindingName b))]+ in (Right (Model.Binding {+ Model.bindingName = (encodeBindingName (Model.bindingName b)),+ Model.bindingTerm = (Annotations.setTermDescription (Just description) rawBody),+ Model.bindingTypeScheme = (Just (encoderTypeSchemeNamed (Model.bindingName b) typ))})))++-- | Generate a binding name for an encoder function from a type name+encodeBindingName :: Model.Name -> Model.Name+encodeBindingName = Names.derivedBindingName [+ "encode"] True++-- | Generate an encoder for an Either type+encodeEitherType :: Model.EitherType -> Model.Term+encodeEitherType et =+ Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "e"),+ Model.lambdaDomain = (Just (Model.TypeEither (Model.EitherType {+ Model.eitherTypeLeft = (encoderFullResultType (Model.eitherTypeLeft et)),+ Model.eitherTypeRight = (encoderFullResultType (Model.eitherTypeRight et))}))),+ Model.lambdaBody = (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.Term"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "either"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermVariable (Model.Name "hydra.core.lib.eithers.bimap")),+ Model.typeApplicationTermType = (encoderFullResultType (Model.eitherTypeLeft et))})),+ Model.typeApplicationTermType = (encoderFullResultType (Model.eitherTypeRight et))})),+ Model.typeApplicationTermType = (Model.TypeVariable (Model.Name "hydra.core.model.Term"))})),+ Model.typeApplicationTermType = (Model.TypeVariable (Model.Name "hydra.core.model.Term"))})),+ Model.applicationArgument = (encodeType (Model.eitherTypeLeft et))})),+ Model.applicationArgument = (encodeType (Model.eitherTypeRight et))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "e"))}))}}))})++-- | Generate the encoder for a field's value+encodeFieldValue :: Model.Name -> Model.Name -> Model.Type -> Model.Term+encodeFieldValue typeName fieldName fieldType =+ Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "y"),+ Model.lambdaDomain = (Just (encoderFullResultType fieldType)),+ Model.lambdaBody = (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.Term"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "inject"),+ Model.fieldTerm = (encodeInjection typeName fieldName (Model.TermApplication (Model.Application {+ Model.applicationFunction = (encodeType fieldType),+ Model.applicationArgument = (Model.TermVariable (Model.Name "y"))})))}}))})++-- | Encode a float value based on its float type+encodeFloatValue :: Model.FloatType -> Model.Term -> Model.Term+encodeFloatValue floatType valTerm =+ Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.FloatValue"),+ Model.injectionField = Model.Field {+ Model.fieldName = case floatType of+ Model.FloatTypeFloat32 -> Model.Name "float32"+ Model.FloatTypeFloat64 -> Model.Name "float64",+ Model.fieldTerm = valTerm}})++-- | Generate an encoder for a polymorphic (forall) type+encodeForallType :: Model.ForallType -> Model.Term+encodeForallType ft =+ Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (encodeBindingName (Model.forallTypeParameter ft)),+ Model.lambdaDomain = (Just (Model.TypeFunction (Model.FunctionType {+ Model.functionTypeDomain = (Model.TypeVariable (Model.forallTypeParameter ft)),+ Model.functionTypeCodomain = (Model.TypeVariable (Model.Name "hydra.core.model.Term"))}))),+ Model.lambdaBody = (encodeType (Model.forallTypeBody ft))})++-- | Encode an Injection as a term+encodeInjection :: Model.Name -> Model.Name -> Model.Term -> Model.Term+encodeInjection typeName fieldName fieldTerm =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.model.Injection"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "typeName"),+ Model.fieldTerm = (encodeName typeName)},+ Model.Field {+ Model.fieldName = (Model.Name "field"),+ Model.fieldTerm = ((\fname -> \fterm -> Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.model.Field"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (encodeName fname)},+ Model.Field {+ Model.fieldName = (Model.Name "term"),+ Model.fieldTerm = fterm}]})) fieldName fieldTerm)}]})++-- | Encode an integer value based on its integer type+encodeIntegerValue :: Model.IntegerType -> Model.Term -> Model.Term+encodeIntegerValue intType valTerm =+ Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.IntegerValue"),+ Model.injectionField = Model.Field {+ Model.fieldName = case intType of+ Model.IntegerTypeBigint -> Model.Name "bigint"+ Model.IntegerTypeInt8 -> Model.Name "int8"+ Model.IntegerTypeInt16 -> Model.Name "int16"+ Model.IntegerTypeInt32 -> Model.Name "int32"+ Model.IntegerTypeInt64 -> Model.Name "int64"+ Model.IntegerTypeUint8 -> Model.Name "uint8"+ Model.IntegerTypeUint16 -> Model.Name "uint16"+ Model.IntegerTypeUint32 -> Model.Name "uint32"+ Model.IntegerTypeUint64 -> Model.Name "uint64",+ Model.fieldTerm = valTerm}})++-- | Generate an encoder for a list type+encodeListType :: Model.Type -> Model.Term+encodeListType elemType =+ Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "xs"),+ Model.lambdaDomain = (Just (Model.TypeList (encoderFullResultType elemType))),+ Model.lambdaBody = (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.Term"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "list"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermVariable (Model.Name "hydra.core.lib.lists.map")),+ Model.typeApplicationTermType = (encoderFullResultType elemType)})),+ Model.typeApplicationTermType = (Model.TypeVariable (Model.Name "hydra.core.model.Term"))})),+ Model.applicationArgument = (encodeType elemType)})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "xs"))}))}}))})++-- | Generate an encoder for a literal type+encodeLiteralType :: Model.LiteralType -> Model.Term+encodeLiteralType x =+ case x of+ Model.LiteralTypeBinary -> Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "x"),+ Model.lambdaDomain = (Just (Model.TypeLiteral Model.LiteralTypeBinary)),+ Model.lambdaBody = (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.Term"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "literal"),+ Model.fieldTerm = (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.Literal"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "binary"),+ Model.fieldTerm = (Model.TermVariable (Model.Name "x"))}}))}}))})+ Model.LiteralTypeBoolean -> Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "x"),+ Model.lambdaDomain = (Just (Model.TypeLiteral Model.LiteralTypeBoolean)),+ Model.lambdaBody = (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.Term"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "literal"),+ Model.fieldTerm = (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.Literal"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "boolean"),+ Model.fieldTerm = (Model.TermVariable (Model.Name "x"))}}))}}))})+ Model.LiteralTypeDecimal -> Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "x"),+ Model.lambdaDomain = (Just (Model.TypeLiteral Model.LiteralTypeDecimal)),+ Model.lambdaBody = (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.Term"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "literal"),+ Model.fieldTerm = (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.Literal"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "decimal"),+ Model.fieldTerm = (Model.TermVariable (Model.Name "x"))}}))}}))})+ Model.LiteralTypeString -> Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "x"),+ Model.lambdaDomain = (Just (Model.TypeLiteral Model.LiteralTypeString)),+ Model.lambdaBody = (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.Term"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "literal"),+ Model.fieldTerm = (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.Literal"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "string"),+ Model.fieldTerm = (Model.TermVariable (Model.Name "x"))}}))}}))})+ Model.LiteralTypeInteger v0 -> Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "x"),+ Model.lambdaDomain = (Just (Model.TypeLiteral (Model.LiteralTypeInteger v0))),+ Model.lambdaBody = (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.Term"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "literal"),+ Model.fieldTerm = (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.Literal"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "integer"),+ Model.fieldTerm = (encodeIntegerValue v0 (Model.TermVariable (Model.Name "x")))}}))}}))})+ Model.LiteralTypeFloat v0 -> Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "x"),+ Model.lambdaDomain = (Just (Model.TypeLiteral (Model.LiteralTypeFloat v0))),+ Model.lambdaBody = (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.Term"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "literal"),+ Model.fieldTerm = (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.Literal"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "float"),+ Model.fieldTerm = (encodeFloatValue v0 (Model.TermVariable (Model.Name "x")))}}))}}))})+ _ -> Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "x"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermVariable (Model.Name "x"))})++-- | Generate an encoder for a map type+encodeMapType :: Model.MapType -> Model.Term+encodeMapType mt =+ Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "m"),+ Model.lambdaDomain = (Just (Model.TypeMap (Model.MapType {+ Model.mapTypeKeys = (encoderFullResultType (Model.mapTypeKeys mt)),+ Model.mapTypeValues = (encoderFullResultType (Model.mapTypeValues mt))}))),+ Model.lambdaBody = (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.Term"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "map"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermVariable (Model.Name "hydra.core.lib.maps.bimap")),+ Model.typeApplicationTermType = (encoderFullResultType (Model.mapTypeKeys mt))})),+ Model.typeApplicationTermType = (Model.TypeVariable (Model.Name "hydra.core.model.Term"))})),+ Model.typeApplicationTermType = (encoderFullResultType (Model.mapTypeValues mt))})),+ Model.typeApplicationTermType = (Model.TypeVariable (Model.Name "hydra.core.model.Term"))})),+ Model.applicationArgument = (encodeType (Model.mapTypeKeys mt))})),+ Model.applicationArgument = (encodeType (Model.mapTypeValues mt))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "m"))}))}}))})++-- | Transform a type module into an encoder module+encodeModule :: t0 -> Graph.Graph -> Packaging.Module -> Either Errors.Error (Maybe Packaging.Module)+encodeModule cx graph mod =+ Eithers.bind (filterTypeBindings cx graph (Optionals.givens (Lists.map (\d -> case d of+ Packaging.DefinitionType v0 -> Just ((\name -> \typ ->+ let schemaTerm = Model.TermVariable (Model.Name "hydra.core.model.Type")+ dataTerm =+ Annotations.normalizeTermAnnotations (Model.TermAnnotated (Model.AnnotatedTerm {+ Model.annotatedTermBody = (EncodeModel.type_ typ),+ Model.annotatedTermAnnotation = (Annotations.wrapAnnotationMap (Maps.fromList [+ (Constants.keyType, schemaTerm)]))}))+ in Model.Binding {+ Model.bindingName = name,+ Model.bindingTerm = dataTerm,+ Model.bindingTypeScheme = (Just (Model.TypeScheme {+ Model.typeSchemeVariables = [],+ Model.typeSchemeBody = (Model.TypeVariable (Model.Name "hydra.core.model.Type")),+ Model.typeSchemeConstraints = Maps.empty}))}) (Packaging.typeDefinitionName v0) (Model.typeSchemeBody (Packaging.typeDefinitionBody v0)))+ _ -> Nothing) (Packaging.moduleDefinitions mod)))) (\typeBindings -> Logic.ifElse (Lists.isEmpty typeBindings) (Right Nothing) (Eithers.bind (Eithers.mapList (\b -> Eithers.bimap (\_e -> Errors.ErrorDecoding _e) (\x -> x) (encodeBinding cx graph b)) typeBindings) (\encodedBindings -> Right (Just (Packaging.Module {+ Packaging.moduleName = (encodeModuleName (Packaging.moduleName mod)),+ Packaging.moduleMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just (Strings.concat [+ "Term encoders for ",+ (Packaging.unModuleName (Packaging.moduleName mod))])),+ Packaging.entityMetadataComments = [],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.moduleDependencies = (Lists.map (\ns -> Packaging.ModuleDependency {+ Packaging.moduleDependencyModule = ns,+ Packaging.moduleDependencyPackage = Nothing}) (Lists.distinct (Lists.concat2 (Lists.map encodeModuleName (Lists.map (\dep -> Packaging.moduleDependencyModule dep) (Packaging.moduleDependencies mod))) [+ Packaging.moduleName mod]))),+ Packaging.moduleDefinitions = (Lists.map (\b -> Packaging.DefinitionTerm (Packaging.TermDefinition {+ Packaging.termDefinitionName = (Model.bindingName b),+ Packaging.termDefinitionMetadata = Nothing,+ Packaging.termDefinitionSignature = (Optionals.map Scoping.typeSchemeToTermSignature (Model.bindingTypeScheme b)),+ Packaging.termDefinitionBody = (Model.bindingTerm b)})) encodedBindings)})))))++-- | Generate an encoder module name from a source module name+encodeModuleName :: Packaging.ModuleName -> Packaging.ModuleName+encodeModuleName = Names.derivedModuleName [+ "encode"] True++-- | Encode a Name as a term+encodeName :: Model.Name -> Model.Term+encodeName n =+ Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.Name "hydra.core.model.Name"),+ Model.wrappedTermBody = (Model.TermLiteral (Model.LiteralString (Model.unName n)))})++-- | Generate an encoder for a Maybe type+encodeOptionalType :: Model.Type -> Model.Term+encodeOptionalType elemType =+ Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "opt"),+ Model.lambdaDomain = (Just (Model.TypeOptional (encoderFullResultType elemType))),+ Model.lambdaBody = (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.Term"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "optional"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermVariable (Model.Name "hydra.core.lib.optionals.map")),+ Model.typeApplicationTermType = (encoderFullResultType elemType)})),+ Model.typeApplicationTermType = (Model.TypeVariable (Model.Name "hydra.core.model.Term"))})),+ Model.applicationArgument = (encodeType elemType)})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "opt"))}))}}))})++-- | Generate an encoder for a pair type+encodePairType :: Model.PairType -> Model.Term+encodePairType pt =+ Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "p"),+ Model.lambdaDomain = (Just (Model.TypePair (Model.PairType {+ Model.pairTypeFirst = (encoderFullResultType (Model.pairTypeFirst pt)),+ Model.pairTypeSecond = (encoderFullResultType (Model.pairTypeSecond pt))}))),+ Model.lambdaBody = (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.Term"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "pair"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermVariable (Model.Name "hydra.core.lib.pairs.bimap")),+ Model.typeApplicationTermType = (encoderFullResultType (Model.pairTypeFirst pt))})),+ Model.typeApplicationTermType = (encoderFullResultType (Model.pairTypeSecond pt))})),+ Model.typeApplicationTermType = (Model.TypeVariable (Model.Name "hydra.core.model.Term"))})),+ Model.typeApplicationTermType = (Model.TypeVariable (Model.Name "hydra.core.model.Term"))})),+ Model.applicationArgument = (encodeType (Model.pairTypeFirst pt))})),+ Model.applicationArgument = (encodeType (Model.pairTypeSecond pt))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "p"))}))}}))})++-- | Generate an encoder for a record type (unnamed — should not be called directly)+encodeRecordType :: [Model.FieldType] -> Model.Term+encodeRecordType rt = encodeRecordTypeNamed (Model.Name "unknown") rt++-- | Generate an encoder for a record type with the given element name+encodeRecordTypeNamed :: Model.Name -> [Model.FieldType] -> Model.Term+encodeRecordTypeNamed ename rt =+ Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "x"),+ Model.lambdaDomain = (Just (Model.TypeVariable ename)),+ Model.lambdaBody = (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.Term"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "record"),+ Model.fieldTerm = (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.model.Record"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "typeName"),+ Model.fieldTerm = (encodeName ename)},+ Model.Field {+ Model.fieldName = (Model.Name "fields"),+ Model.fieldTerm = (Model.TermList (Lists.map ((\tname -> \recType -> \ft -> Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.model.Field"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "name"),+ Model.fieldTerm = (encodeName (Model.fieldTypeName ft))},+ Model.Field {+ Model.fieldName = (Model.Name "term"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (encodeType (Model.fieldTypeType ft)),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermProject (Model.Projection {+ Model.projectionTypeName = tname,+ Model.projectionFieldName = (Model.fieldTypeName ft)})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "x"))}))}))}]})) ename rt) rt))}]}))}}))})++-- | Generate an encoder for a set type+encodeSetType :: Model.Type -> Model.Term+encodeSetType elemType =+ Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "s"),+ Model.lambdaDomain = (Just (Model.TypeSet (encoderFullResultType elemType))),+ Model.lambdaBody = (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.Term"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "set"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermVariable (Model.Name "hydra.core.lib.sets.map")),+ Model.typeApplicationTermType = (encoderFullResultType elemType)})),+ Model.typeApplicationTermType = (Model.TypeVariable (Model.Name "hydra.core.model.Term"))})),+ Model.applicationArgument = (encodeType elemType)})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "s"))}))}}))})++-- | Generate an encoder term for a Type+encodeType :: Model.Type -> Model.Term+encodeType x =+ case x of+ Model.TypeAnnotated v0 -> encodeType (Model.annotatedTypeBody v0)+ Model.TypeApplication v0 -> Model.TermApplication (Model.Application {+ Model.applicationFunction = (encodeType (Model.applicationTypeFunction v0)),+ Model.applicationArgument = (encodeType (Model.applicationTypeArgument v0))})+ Model.TypeEither v0 -> encodeEitherType v0+ Model.TypeForall v0 -> encodeForallType v0+ Model.TypeFunction _ -> Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "x"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermVariable (Model.Name "x"))})+ Model.TypeList v0 -> encodeListType v0+ Model.TypeLiteral v0 -> encodeLiteralType v0+ Model.TypeMap v0 -> encodeMapType v0+ Model.TypeOptional v0 -> encodeOptionalType v0+ Model.TypePair v0 -> encodePairType v0+ Model.TypeRecord v0 -> encodeRecordType v0+ Model.TypeSet v0 -> encodeSetType v0+ Model.TypeUnion v0 -> encodeUnionType v0+ Model.TypeWrap v0 -> encodeWrappedType v0+ Model.TypeUnit -> Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "_"),+ Model.lambdaDomain = (Just Model.TypeUnit),+ Model.lambdaBody = (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.Term"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "unit"),+ Model.fieldTerm = Model.TermUnit}}))})+ Model.TypeVoid -> Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "_"),+ Model.lambdaDomain = (Just Model.TypeUnit),+ Model.lambdaBody = (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.Term"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "unit"),+ Model.fieldTerm = Model.TermUnit}}))})+ Model.TypeVariable v0 -> Model.TermVariable (encodeBindingName v0)+ _ -> Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "x"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermVariable (Model.Name "x"))})++-- | Generate an encoder term for a Type, with the element name for nominal types+encodeTypeNamed :: Model.Name -> Model.Type -> Model.Term+encodeTypeNamed ename typ =+ case typ of+ Model.TypeAnnotated v0 -> encodeTypeNamed ename (Model.annotatedTypeBody v0)+ Model.TypeApplication v0 -> Model.TermApplication (Model.Application {+ Model.applicationFunction = (encodeType (Model.applicationTypeFunction v0)),+ Model.applicationArgument = (encodeType (Model.applicationTypeArgument v0))})+ Model.TypeEither v0 -> encodeEitherType v0+ Model.TypeForall v0 -> Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (encodeBindingName (Model.forallTypeParameter v0)),+ Model.lambdaDomain = (Just (Model.TypeFunction (Model.FunctionType {+ Model.functionTypeDomain = (Model.TypeVariable (Model.forallTypeParameter v0)),+ Model.functionTypeCodomain = (Model.TypeVariable (Model.Name "hydra.core.model.Term"))}))),+ Model.lambdaBody = (encodeTypeNamed ename (Model.forallTypeBody v0))})+ Model.TypeFunction _ -> Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "x"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermVariable (Model.Name "x"))})+ Model.TypeList v0 -> encodeListType v0+ Model.TypeLiteral v0 -> encodeLiteralType v0+ Model.TypeMap v0 -> encodeMapType v0+ Model.TypeOptional v0 -> encodeOptionalType v0+ Model.TypePair v0 -> encodePairType v0+ Model.TypeRecord v0 -> encodeRecordTypeNamed ename v0+ Model.TypeSet v0 -> encodeSetType v0+ Model.TypeUnion v0 -> encodeUnionTypeNamed ename v0+ Model.TypeWrap v0 -> encodeWrappedTypeNamed ename v0+ Model.TypeUnit -> Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "_"),+ Model.lambdaDomain = (Just Model.TypeUnit),+ Model.lambdaBody = (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.Term"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "unit"),+ Model.fieldTerm = Model.TermUnit}}))})+ Model.TypeVoid -> Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "_"),+ Model.lambdaDomain = (Just Model.TypeUnit),+ Model.lambdaBody = (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.Term"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "unit"),+ Model.fieldTerm = Model.TermUnit}}))})+ Model.TypeVariable v0 -> Model.TermVariable (encodeBindingName v0)+ _ -> Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "x"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermVariable (Model.Name "x"))})++-- | Generate an encoder for a union type (placeholder name)+encodeUnionType :: [Model.FieldType] -> Model.Term+encodeUnionType rt = encodeUnionTypeNamed (Model.Name "unknown") rt++-- | Generate an encoder for a union type with the given element name+encodeUnionTypeNamed :: Model.Name -> [Model.FieldType] -> Model.Term+encodeUnionTypeNamed ename rt =+ Model.TermCases (Model.CaseStatement {+ Model.caseStatementTypeName = ename,+ Model.caseStatementDefault = Nothing,+ Model.caseStatementCases = (Lists.map (\ft -> Model.CaseAlternative {+ Model.caseAlternativeName = (Model.fieldTypeName ft),+ Model.caseAlternativeHandler = (encodeFieldValue ename (Model.fieldTypeName ft) (Model.fieldTypeType ft))}) rt)})++-- | Generate an encoder for a wrapped type (placeholder name)+encodeWrappedType :: Model.Type -> Model.Term+encodeWrappedType wt = encodeWrappedTypeNamed (Model.Name "unknown") wt++-- | Generate an encoder for a wrapped type with the given element name+encodeWrappedTypeNamed :: Model.Name -> Model.Type -> Model.Term+encodeWrappedTypeNamed ename wt =+ Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "x"),+ Model.lambdaDomain = (Just (Model.TypeVariable ename)),+ Model.lambdaBody = (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.model.Term"),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name "wrap"),+ Model.fieldTerm = (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.Name "hydra.core.model.WrappedTerm"),+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name "typeName"),+ Model.fieldTerm = (encodeName ename)},+ Model.Field {+ Model.fieldName = (Model.Name "body"),+ Model.fieldTerm = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (encodeType wt),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermUnwrap ename),+ Model.applicationArgument = (Model.TermVariable (Model.Name "x"))}))}))}]}))}}))})++-- | Collect forall type variable names from a type+encoderCollectForallVariables :: Model.Type -> [Model.Name]+encoderCollectForallVariables typ =+ case typ of+ Model.TypeAnnotated v0 -> encoderCollectForallVariables (Model.annotatedTypeBody v0)+ Model.TypeForall v0 -> Lists.cons (Model.forallTypeParameter v0) (encoderCollectForallVariables (Model.forallTypeBody v0))+ _ -> []++-- | Collect type variables needing Ord constraints+encoderCollectOrdVars :: Model.Type -> [Model.Name]+encoderCollectOrdVars typ =+ case typ of+ Model.TypeAnnotated v0 -> encoderCollectOrdVars (Model.annotatedTypeBody v0)+ Model.TypeApplication v0 -> Lists.concat2 (encoderCollectOrdVars (Model.applicationTypeFunction v0)) (encoderCollectOrdVars (Model.applicationTypeArgument v0))+ Model.TypeEffect v0 -> encoderCollectOrdVars v0+ Model.TypeEither v0 -> Lists.concat2 (encoderCollectOrdVars (Model.eitherTypeLeft v0)) (encoderCollectOrdVars (Model.eitherTypeRight v0))+ Model.TypeForall v0 -> encoderCollectOrdVars (Model.forallTypeBody v0)+ Model.TypeList v0 -> encoderCollectOrdVars v0+ Model.TypeMap v0 -> Lists.concat [+ encoderCollectTypeVarsFromType (Model.mapTypeKeys v0),+ (encoderCollectOrdVars (Model.mapTypeKeys v0)),+ (encoderCollectOrdVars (Model.mapTypeValues v0))]+ Model.TypeOptional v0 -> encoderCollectOrdVars v0+ Model.TypePair v0 -> Lists.concat2 (encoderCollectOrdVars (Model.pairTypeFirst v0)) (encoderCollectOrdVars (Model.pairTypeSecond v0))+ Model.TypeRecord v0 -> Lists.concat (Lists.map (\ft -> encoderCollectOrdVars (Model.fieldTypeType ft)) v0)+ Model.TypeSet v0 -> Lists.concat2 (encoderCollectTypeVarsFromType v0) (encoderCollectOrdVars v0)+ Model.TypeUnion v0 -> Lists.concat (Lists.map (\ft -> encoderCollectOrdVars (Model.fieldTypeType ft)) v0)+ Model.TypeWrap v0 -> encoderCollectOrdVars v0+ _ -> []++-- | Collect all type variable names from a type expression+encoderCollectTypeVarsFromType :: Model.Type -> [Model.Name]+encoderCollectTypeVarsFromType typ =+ case typ of+ Model.TypeAnnotated v0 -> encoderCollectTypeVarsFromType (Model.annotatedTypeBody v0)+ Model.TypeApplication v0 -> Lists.concat2 (encoderCollectTypeVarsFromType (Model.applicationTypeFunction v0)) (encoderCollectTypeVarsFromType (Model.applicationTypeArgument v0))+ Model.TypeEffect v0 -> encoderCollectTypeVarsFromType v0+ Model.TypeForall v0 -> encoderCollectTypeVarsFromType (Model.forallTypeBody v0)+ Model.TypeList v0 -> encoderCollectTypeVarsFromType v0+ Model.TypeMap v0 -> Lists.concat2 (encoderCollectTypeVarsFromType (Model.mapTypeKeys v0)) (encoderCollectTypeVarsFromType (Model.mapTypeValues v0))+ Model.TypeOptional v0 -> encoderCollectTypeVarsFromType v0+ Model.TypePair v0 -> Lists.concat2 (encoderCollectTypeVarsFromType (Model.pairTypeFirst v0)) (encoderCollectTypeVarsFromType (Model.pairTypeSecond v0))+ Model.TypeRecord v0 -> Lists.concat (Lists.map (\ft -> encoderCollectTypeVarsFromType (Model.fieldTypeType ft)) v0)+ Model.TypeSet v0 -> encoderCollectTypeVarsFromType v0+ Model.TypeUnion v0 -> Lists.concat (Lists.map (\ft -> encoderCollectTypeVarsFromType (Model.fieldTypeType ft)) v0)+ Model.TypeVariable v0 -> [+ v0]+ Model.TypeWrap v0 -> encoderCollectTypeVarsFromType v0+ _ -> []++-- | Get full result type for encoder input+encoderFullResultType :: Model.Type -> Model.Type+encoderFullResultType typ =+ case typ of+ Model.TypeAnnotated v0 -> encoderFullResultType (Model.annotatedTypeBody v0)+ Model.TypeApplication v0 -> Model.TypeApplication (Model.ApplicationType {+ Model.applicationTypeFunction = (encoderFullResultType (Model.applicationTypeFunction v0)),+ Model.applicationTypeArgument = (Model.applicationTypeArgument v0)})+ Model.TypeEffect v0 -> Model.TypeEffect (encoderFullResultType v0)+ Model.TypeEither v0 -> Model.TypeEither (Model.EitherType {+ Model.eitherTypeLeft = (encoderFullResultType (Model.eitherTypeLeft v0)),+ Model.eitherTypeRight = (encoderFullResultType (Model.eitherTypeRight v0))})+ Model.TypeForall v0 -> applyForallParamsInOrder (encoderFullResultType (stripForalls (Model.forallTypeBody v0))) (encoderCollectForallVariables typ)+ Model.TypeList v0 -> Model.TypeList (encoderFullResultType v0)+ Model.TypeLiteral v0 -> Model.TypeLiteral v0+ Model.TypeMap v0 -> Model.TypeMap (Model.MapType {+ Model.mapTypeKeys = (encoderFullResultType (Model.mapTypeKeys v0)),+ Model.mapTypeValues = (encoderFullResultType (Model.mapTypeValues v0))})+ Model.TypeOptional v0 -> Model.TypeOptional (encoderFullResultType v0)+ Model.TypePair v0 -> Model.TypePair (Model.PairType {+ Model.pairTypeFirst = (encoderFullResultType (Model.pairTypeFirst v0)),+ Model.pairTypeSecond = (encoderFullResultType (Model.pairTypeSecond v0))})+ Model.TypeRecord _ -> Model.TypeVariable (Model.Name "hydra.core.model.Term")+ Model.TypeSet v0 -> Model.TypeSet (encoderFullResultType v0)+ Model.TypeUnion _ -> Model.TypeVariable (Model.Name "hydra.core.model.Term")+ Model.TypeUnit -> Model.TypeUnit+ Model.TypeVariable v0 -> Model.TypeVariable v0+ Model.TypeVoid -> Model.TypeVoid+ Model.TypeWrap v0 -> encoderFullResultType v0+ _ -> Model.TypeVariable (Model.Name "hydra.core.model.Term")++-- | Get full result type for encoder input, using element name for nominal types+encoderFullResultTypeNamed :: Model.Name -> Model.Type -> Model.Type+encoderFullResultTypeNamed ename typ =+ case typ of+ Model.TypeAnnotated v0 -> encoderFullResultTypeNamed ename (Model.annotatedTypeBody v0)+ Model.TypeApplication v0 -> Model.TypeApplication (Model.ApplicationType {+ Model.applicationTypeFunction = (encoderFullResultType (Model.applicationTypeFunction v0)),+ Model.applicationTypeArgument = (Model.applicationTypeArgument v0)})+ Model.TypeEffect v0 -> Model.TypeEffect (encoderFullResultType v0)+ Model.TypeEither v0 -> Model.TypeEither (Model.EitherType {+ Model.eitherTypeLeft = (encoderFullResultType (Model.eitherTypeLeft v0)),+ Model.eitherTypeRight = (encoderFullResultType (Model.eitherTypeRight v0))})+ Model.TypeForall v0 -> applyForallParamsInOrder (encoderFullResultTypeNamed ename (stripForalls (Model.forallTypeBody v0))) (encoderCollectForallVariables typ)+ Model.TypeList v0 -> Model.TypeList (encoderFullResultType v0)+ Model.TypeLiteral v0 -> Model.TypeLiteral v0+ Model.TypeMap v0 -> Model.TypeMap (Model.MapType {+ Model.mapTypeKeys = (encoderFullResultType (Model.mapTypeKeys v0)),+ Model.mapTypeValues = (encoderFullResultType (Model.mapTypeValues v0))})+ Model.TypeOptional v0 -> Model.TypeOptional (encoderFullResultType v0)+ Model.TypePair v0 -> Model.TypePair (Model.PairType {+ Model.pairTypeFirst = (encoderFullResultType (Model.pairTypeFirst v0)),+ Model.pairTypeSecond = (encoderFullResultType (Model.pairTypeSecond v0))})+ Model.TypeRecord _ -> Model.TypeVariable ename+ Model.TypeSet v0 -> Model.TypeSet (encoderFullResultType v0)+ Model.TypeUnion _ -> Model.TypeVariable ename+ Model.TypeUnit -> Model.TypeUnit+ Model.TypeVariable v0 -> Model.TypeVariable v0+ Model.TypeVoid -> Model.TypeVoid+ Model.TypeWrap _ -> Model.TypeVariable ename+ _ -> Model.TypeVariable (Model.Name "hydra.core.model.Term")++-- | Build encoder function type+encoderType :: Model.Type -> Model.Type+encoderType typ =++ let resultType = encoderFullResultType typ+ baseType =+ Model.TypeFunction (Model.FunctionType {+ Model.functionTypeDomain = resultType,+ Model.functionTypeCodomain = (Model.TypeVariable (Model.Name "hydra.core.model.Term"))})+ in (prependForallEncoders baseType typ)++-- | Build encoder function type with element name for nominal types+encoderTypeNamed :: Model.Name -> Model.Type -> Model.Type+encoderTypeNamed ename typ =++ let resultType = encoderFullResultTypeNamed ename typ+ baseType =+ Model.TypeFunction (Model.FunctionType {+ Model.functionTypeDomain = resultType,+ Model.functionTypeCodomain = (Model.TypeVariable (Model.Name "hydra.core.model.Term"))})+ in (prependForallEncoders baseType typ)++-- | Construct a TypeScheme for an encoder function from a source type+encoderTypeScheme :: Model.Type -> Model.TypeScheme+encoderTypeScheme typ =++ let typeVars = encoderCollectForallVariables typ+ encoderFunType = encoderType typ+ allOrdVars = encoderCollectOrdVars typ+ ordVars = Lists.filter (\v -> Lists.member v typeVars) allOrdVars+ constraints =+ Maps.fromList (Lists.map (\v -> (+ v,+ Model.TypeVariableConstraints {+ Model.typeVariableConstraintsClasses = (Sets.singleton (Model.TypeClassConstraintSimple (Model.Name "ordering")))})) ordVars)+ in Model.TypeScheme {+ Model.typeSchemeVariables = typeVars,+ Model.typeSchemeBody = encoderFunType,+ Model.typeSchemeConstraints = constraints}++-- | Construct a TypeScheme for an encoder function, with element name for nominal types+encoderTypeSchemeNamed :: Model.Name -> Model.Type -> Model.TypeScheme+encoderTypeSchemeNamed ename typ =++ let typeVars = encoderCollectForallVariables typ+ encoderFunType = encoderTypeNamed ename typ+ allOrdVars = encoderCollectOrdVars typ+ ordVars = Lists.filter (\v -> Lists.member v typeVars) allOrdVars+ constraints =+ Maps.fromList (Lists.map (\v -> (+ v,+ Model.TypeVariableConstraints {+ Model.typeVariableConstraintsClasses = (Sets.singleton (Model.TypeClassConstraintSimple (Model.Name "ordering")))})) ordVars)+ in Model.TypeScheme {+ Model.typeSchemeVariables = typeVars,+ Model.typeSchemeBody = encoderFunType,+ Model.typeSchemeConstraints = constraints}++-- | Filter bindings to only encodable type definitions+filterTypeBindings :: t0 -> Graph.Graph -> [Model.Binding] -> Either Errors.Error [Model.Binding]+filterTypeBindings cx graph bindings =+ Eithers.map Optionals.givens (Eithers.mapList (isEncodableBinding cx graph) (Lists.filter Annotations.isNativeType bindings))++-- | Check if a binding is encodable (serializable type)+isEncodableBinding :: t0 -> Graph.Graph -> Model.Binding -> Either Errors.Error (Maybe Model.Binding)+isEncodableBinding cx graph b =+ Eithers.bind (Predicates.isSerializableByName cx graph (Model.bindingName b)) (\serializable -> Right (Logic.ifElse serializable (Just b) Nothing))++-- | Check whether a type is the unit type+isUnitType :: Model.Type -> Bool+isUnitType x =+ case x of+ Model.TypeUnit -> True+ _ -> False++-- | Prepend encoder types for forall parameters to base type+prependForallEncoders :: Model.Type -> Model.Type -> Model.Type+prependForallEncoders baseType typ =+ case typ of+ Model.TypeAnnotated v0 -> prependForallEncoders baseType (Model.annotatedTypeBody v0)+ Model.TypeForall v0 -> Model.TypeFunction (Model.FunctionType {+ Model.functionTypeDomain = (Model.TypeFunction (Model.FunctionType {+ Model.functionTypeDomain = (Model.TypeVariable (Model.forallTypeParameter v0)),+ Model.functionTypeCodomain = (Model.TypeVariable (Model.Name "hydra.core.model.Term"))})),+ Model.functionTypeCodomain = (prependForallEncoders baseType (Model.forallTypeBody v0))})+ _ -> baseType++-- | Remove all leading forall quantifiers, returning the quantified body+stripForalls :: Model.Type -> Model.Type+stripForalls typ =+ case typ of+ Model.TypeAnnotated v0 -> stripForalls (Model.annotatedTypeBody v0)+ Model.TypeForall v0 -> stripForalls (Model.forallTypeBody v0)+ _ -> typ
@@ -0,0 +1,193 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Graph to type environment conversions++module Hydra.Core.Environment where++import qualified Hydra.Core.Ast as Ast+import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Decode.Model as DecodeModel+import qualified Hydra.Core.Diff as Diff+import qualified Hydra.Core.Docs as Docs+import qualified Hydra.Core.Encode.Model as EncodeModel+import qualified Hydra.Core.Error.Checking as Checking+import qualified Hydra.Core.Error.File as ErrorFile+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Error.Packaging as ErrorPackaging+import qualified Hydra.Core.Error.System as ErrorSystem+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Json.Model as JsonModel+import qualified Hydra.Core.Lexical as Lexical+import qualified Hydra.Core.Overlay.Haskell.Lib.Eithers as Eithers+import qualified Hydra.Core.Overlay.Haskell.Lib.Equality as Equality+import qualified Hydra.Core.Overlay.Haskell.Lib.Lists as Lists+import qualified Hydra.Core.Overlay.Haskell.Lib.Logic as Logic+import qualified Hydra.Core.Overlay.Haskell.Lib.Maps as Maps+import qualified Hydra.Core.Overlay.Haskell.Lib.Optionals as Optionals+import qualified Hydra.Core.Overlay.Haskell.Lib.Pairs as Pairs+import qualified Hydra.Core.Overlay.Haskell.Lib.Sets as Sets+import qualified Hydra.Core.Markdown as Markdown+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Parsing as Parsing+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Query as Query+import qualified Hydra.Core.Regex as Regex+import qualified Hydra.Core.Relational as Relational+import qualified Hydra.Core.Scoping as Scoping+import qualified Hydra.Core.Sorting as Sorting+import qualified Hydra.Core.Strip as Strip+import qualified Hydra.Core.System as System+import qualified Hydra.Core.Tabular as Tabular+import qualified Hydra.Core.Testing as Testing+import qualified Hydra.Core.Time as Time+import qualified Hydra.Core.Topology as Topology+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Validation as Validation+import qualified Hydra.Core.Variables as Variables+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void+import qualified Data.Map as M++-- | Convert a definition to a typed term+definitionAsTypeApplicationTerm :: Model.Binding -> Either Errors.Error Model.TypeApplicationTerm+definitionAsTypeApplicationTerm el =+ Optionals.match (Model.bindingTypeScheme el) (Left (Errors.ErrorExtraction (Errors.ExtractionErrorUnexpectedShape (Errors.UnexpectedShapeError {+ Errors.unexpectedShapeErrorExpected = "typed binding",+ Errors.unexpectedShapeErrorActual = "untyped binding"})))) (\ts -> Right (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.bindingTerm el),+ Model.typeApplicationTermType = (Model.typeSchemeBody ts)}))++-- | Convert bindings and a body to a let expression+graphAsLet :: [Model.Binding] -> Model.Term -> Model.Let+graphAsLet bindings body =+ Model.Let {+ Model.letBindings = bindings,+ Model.letBody = body}++-- | Convert bindings and a body to a term, using let-term duality+graphAsTerm :: [Model.Binding] -> Model.Term -> Model.Term+graphAsTerm bindings body = Model.TermLet (graphAsLet bindings body)++-- | Decode a list of type-encoding bindings into a map of named types+graphAsTypes :: Graph.Graph -> [Model.Binding] -> Either Errors.DecodingError (M.Map Model.Name Model.Type)+graphAsTypes graph els =++ let toPair = \el -> Eithers.map (\typ -> (Model.bindingName el, typ)) (DecodeModel.type_ graph (Model.bindingTerm el))+ in (Eithers.map Maps.fromList (Eithers.mapList toPair els))++-- | Partition a list of definitions into type definitions and term definitions+partitionDefinitions :: [Packaging.Definition] -> ([Packaging.TypeDefinition], [Packaging.TermDefinition])+partitionDefinitions defs =++ let getType =+ \def -> case def of+ Packaging.DefinitionType v0 -> Just v0+ Packaging.DefinitionTerm _ -> Nothing+ Packaging.DefinitionPrimitive _ -> Nothing+ getTerm =+ \def -> case def of+ Packaging.DefinitionType _ -> Nothing+ Packaging.DefinitionTerm v0 -> Just v0+ Packaging.DefinitionPrimitive _ -> Nothing+ in (Optionals.givens (Lists.map getType defs), (Optionals.givens (Lists.map getTerm defs)))++-- | Reorder definitions: types first (with hydra.core.model.Name first among types), then topologically sorted terms+reorderDefs :: [Packaging.Definition] -> [Packaging.Definition]+reorderDefs defs =++ let partitioned = partitionDefinitions defs+ typeDefsRaw = Pairs.first partitioned+ nameFirst =+ Lists.filter (\td -> Equality.equal (Packaging.typeDefinitionName td) (Model.Name "hydra.core.model.Name")) typeDefsRaw+ nameRest =+ Lists.filter (\td -> Logic.not (Equality.equal (Packaging.typeDefinitionName td) (Model.Name "hydra.core.model.Name"))) typeDefsRaw+ typeDefs =+ Lists.concat [+ Lists.map (\td -> Packaging.DefinitionType td) nameFirst,+ (Lists.map (\td -> Packaging.DefinitionType td) nameRest)]+ termDefsWrapped = Lists.map (\td -> Packaging.DefinitionTerm td) (Pairs.second partitioned)+ sortedTermDefs =+ Lists.concat (Sorting.topologicalSortNodes (\d -> case d of+ Packaging.DefinitionTerm v0 -> Packaging.termDefinitionName v0) (\d -> case d of+ Packaging.DefinitionTerm v0 -> Sets.toList (Variables.freeVariablesInTerm (Packaging.termDefinitionBody v0))+ _ -> []) termDefsWrapped)+ in (Lists.concat [+ typeDefs,+ sortedTermDefs])++-- | Convert a schema graph to a typing environment (Either version)+schemaGraphToTypingEnvironment :: Graph.Graph -> Either Errors.Error (M.Map Model.Name Model.TypeScheme)+schemaGraphToTypingEnvironment g =++ let toTypeScheme =+ \vars -> \typ -> case (Strip.deannotateType typ) of+ Model.TypeForall v0 -> toTypeScheme (Lists.cons (Model.forallTypeParameter v0) vars) (Model.forallTypeBody v0)+ _ -> Model.TypeScheme {+ Model.typeSchemeVariables = (Lists.reverse vars),+ Model.typeSchemeBody = typ,+ Model.typeSchemeConstraints = Maps.empty}+ decodeType = \term -> Eithers.bimap (\_e -> Errors.ErrorDecoding _e) (\_a -> _a) (DecodeModel.type_ g term)+ decodeTypeScheme = \term -> Eithers.bimap (\_e -> Errors.ErrorDecoding _e) (\_a -> _a) (DecodeModel.typeScheme g term)+ toPair =+ \el ->+ let forTerm =+ \term -> case term of+ Model.TermRecord v0 -> Logic.ifElse (Equality.equal (Model.recordTypeName v0) (Model.Name "hydra.core.model.TypeScheme")) (Eithers.map Optionals.given (decodeTypeScheme (Model.bindingTerm el))) (Right Nothing)+ Model.TermInject v0 -> Logic.ifElse (Equality.equal (Model.injectionTypeName v0) (Model.Name "hydra.core.model.Type")) (Eithers.map (\decoded -> Just (toTypeScheme [] decoded)) (decodeType (Model.bindingTerm el))) (Right Nothing)+ _ -> Right Nothing+ in (Eithers.bind (Optionals.match (Model.bindingTypeScheme el) (Eithers.map (\typ -> Just (Scoping.fTypeToTypeScheme typ)) (decodeType (Model.bindingTerm el))) (\ts -> Logic.ifElse (Equality.equal ts (Model.TypeScheme {+ Model.typeSchemeVariables = [],+ Model.typeSchemeBody = (Model.TypeVariable (Model.Name "hydra.core.model.TypeScheme")),+ Model.typeSchemeConstraints = Maps.empty})) (Eithers.map Optionals.given (decodeTypeScheme (Model.bindingTerm el))) (Logic.ifElse (Equality.equal ts (Model.TypeScheme {+ Model.typeSchemeVariables = [],+ Model.typeSchemeBody = (Model.TypeVariable (Model.Name "hydra.core.model.Type")),+ Model.typeSchemeConstraints = Maps.empty})) (Eithers.map (\decoded -> Just (toTypeScheme [] decoded)) (decodeType (Model.bindingTerm el))) (forTerm (Strip.deannotateTerm (Model.bindingTerm el)))))) (\mts -> Right (Optionals.map (\ts -> (Model.bindingName el, ts)) mts)))+ in (Eithers.map (\mpairs -> Maps.fromList (Optionals.givens mpairs)) (Eithers.mapList toPair (Lexical.graphToBindings g)))++-- | Extract the bindings from a let term, or return an empty list for other terms+termAsBindings :: Model.Term -> [Model.Binding]+termAsBindings term =+ case (Strip.deannotateTerm term) of+ Model.TermLet v0 -> Model.letBindings v0+ _ -> []++-- | Encode a map of named types to a list of bindings+typesToDefinitions :: M.Map Model.Name Model.Type -> [Model.Binding]+typesToDefinitions typeMap =++ let toElement =+ \pair ->+ let name = Pairs.first pair+ in Model.Binding {+ Model.bindingName = name,+ Model.bindingTerm = (EncodeModel.type_ (Pairs.second pair)),+ Model.bindingTypeScheme = Nothing}+ in (Lists.map toElement (Maps.toList typeMap))++-- | Execute a computation in the context of a lambda body, extending the type context with the lambda parameter+withLambdaContext :: (t0 -> Graph.Graph) -> (Graph.Graph -> t0 -> t1) -> t0 -> Model.Lambda -> (t1 -> t2) -> t2+withLambdaContext getContext setContext env lam body =++ let newContext = Scoping.extendGraphForLambda (getContext env) lam+ in (body (setContext newContext env))++-- | Execute a computation in the context of a let body, extending the type context with the let bindings+withLetContext :: (t0 -> Graph.Graph) -> (Graph.Graph -> t0 -> t1) -> (Graph.Graph -> Model.Binding -> Maybe Model.Term) -> t0 -> Model.Let -> (t1 -> t2) -> t2+withLetContext getContext setContext forBinding env letrec body =++ let newContext = Scoping.extendGraphForLet forBinding (getContext env) letrec+ in (body (setContext newContext env))++-- | Execute a computation in the context of a type lambda body, extending the type context with the type parameter+withTypeLambdaContext :: (t0 -> Graph.Graph) -> (Graph.Graph -> t0 -> t1) -> t0 -> Model.TypeLambda -> (t1 -> t2) -> t2+withTypeLambdaContext getContext setContext env tlam body =++ let newContext = Scoping.extendGraphForTypeLambda (getContext env) tlam+ in (body (setContext newContext env))
@@ -0,0 +1,251 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Error types for type checking++module Hydra.Core.Error.Checking where++import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void+import qualified Data.Set as S++-- | An error that occurred during type checking+data CheckingError =+ -- | A post-unification consistency check failure+ CheckingErrorIncorrectUnification IncorrectUnificationError |+ -- | A type that is not a forall type when one was expected+ CheckingErrorNotAForallType NotAForallTypeError |+ -- | A type that is not a function type when one was expected+ CheckingErrorNotAFunctionType NotAFunctionTypeError |+ -- | A generic checking error+ CheckingErrorOther OtherCheckingError |+ -- | A type constructor applied to the wrong number of arguments+ CheckingErrorTypeArityMismatch TypeArityMismatchError |+ -- | A type mismatch between expected and actual types+ CheckingErrorTypeMismatch TypeMismatchError |+ -- | Type variables that are not bound in scope+ CheckingErrorUnboundTypeVariables UnboundTypeVariablesError |+ -- | A reference to a term variable that is not bound in scope, encountered during checking+ CheckingErrorUndefinedTermVariable UndefinedTermVariableCheckingError |+ -- | Multiple types that should be equal but are not+ CheckingErrorUnequalTypes UnequalTypesError |+ -- | A term variant that the type checker does not support+ CheckingErrorUnsupportedTermVariant UnsupportedTermVariantError |+ -- | A lambda expression without a type annotation on its parameter+ CheckingErrorUntypedLambda UntypedLambdaError |+ -- | A let binding without a type annotation+ CheckingErrorUntypedLetBinding UntypedLetBindingError |+ -- | A reference to a term variable whose type is not known, encountered during checking+ CheckingErrorUntypedTermVariable UntypedTermVariableCheckingError+ deriving (Eq, Ord, Read, Show)++_CheckingError = Model.Name "hydra.core.error.checking.CheckingError"++_CheckingError_incorrectUnification = Model.Name "incorrectUnification"++_CheckingError_notAForallType = Model.Name "notAForallType"++_CheckingError_notAFunctionType = Model.Name "notAFunctionType"++_CheckingError_other = Model.Name "other"++_CheckingError_typeArityMismatch = Model.Name "typeArityMismatch"++_CheckingError_typeMismatch = Model.Name "typeMismatch"++_CheckingError_unboundTypeVariables = Model.Name "unboundTypeVariables"++_CheckingError_undefinedTermVariable = Model.Name "undefinedTermVariable"++_CheckingError_unequalTypes = Model.Name "unequalTypes"++_CheckingError_unsupportedTermVariant = Model.Name "unsupportedTermVariant"++_CheckingError_untypedLambda = Model.Name "untypedLambda"++_CheckingError_untypedLetBinding = Model.Name "untypedLetBinding"++_CheckingError_untypedTermVariable = Model.Name "untypedTermVariable"++-- | A post-unification consistency check failure+data IncorrectUnificationError =+ IncorrectUnificationError {+ -- | The substitution that failed the consistency check+ incorrectUnificationErrorSubstitution :: Typing.TypeSubst}+ deriving (Eq, Ord, Read, Show)++_IncorrectUnificationError = Model.Name "hydra.core.error.checking.IncorrectUnificationError"++_IncorrectUnificationError_substitution = Model.Name "substitution"++-- | A type that is not a forall type when type arguments are being applied+data NotAForallTypeError =+ NotAForallTypeError {+ -- | The actual type encountered+ notAForallTypeErrorType :: Model.Type,+ -- | The type arguments that were being applied+ notAForallTypeErrorTypeArguments :: [Model.Type]}+ deriving (Eq, Ord, Read, Show)++_NotAForallTypeError = Model.Name "hydra.core.error.checking.NotAForallTypeError"++_NotAForallTypeError_type = Model.Name "type"++_NotAForallTypeError_typeArguments = Model.Name "typeArguments"++-- | A type that is not a function type when one was expected in an application+data NotAFunctionTypeError =+ NotAFunctionTypeError {+ -- | The actual type encountered+ notAFunctionTypeErrorType :: Model.Type}+ deriving (Eq, Ord, Read, Show)++_NotAFunctionTypeError = Model.Name "hydra.core.error.checking.NotAFunctionTypeError"++_NotAFunctionTypeError_type = Model.Name "type"++-- | A generic checking error: message + subterm path+data OtherCheckingError =+ OtherCheckingError {+ -- | The subterm path at which the error was observed+ otherCheckingErrorPath :: Paths.SubtermPath,+ -- | A human-readable error message+ otherCheckingErrorMessage :: String}+ deriving (Eq, Ord, Read, Show)++_OtherCheckingError = Model.Name "hydra.core.error.checking.OtherCheckingError"++_OtherCheckingError_path = Model.Name "path"++_OtherCheckingError_message = Model.Name "message"++-- | A type constructor applied to the wrong number of type arguments+data TypeArityMismatchError =+ TypeArityMismatchError {+ -- | The type being checked+ typeArityMismatchErrorType :: Model.Type,+ -- | The expected number of type arguments+ typeArityMismatchErrorExpectedArity :: Int,+ -- | The actual number of type arguments provided+ typeArityMismatchErrorActualArity :: Int,+ -- | The type arguments that were provided+ typeArityMismatchErrorTypeArguments :: [Model.Type]}+ deriving (Eq, Ord, Read, Show)++_TypeArityMismatchError = Model.Name "hydra.core.error.checking.TypeArityMismatchError"++_TypeArityMismatchError_type = Model.Name "type"++_TypeArityMismatchError_expectedArity = Model.Name "expectedArity"++_TypeArityMismatchError_actualArity = Model.Name "actualArity"++_TypeArityMismatchError_typeArguments = Model.Name "typeArguments"++-- | A type mismatch between expected and actual types+data TypeMismatchError =+ TypeMismatchError {+ -- | The expected type+ typeMismatchErrorExpectedType :: Model.Type,+ -- | The actual type encountered+ typeMismatchErrorActualType :: Model.Type}+ deriving (Eq, Ord, Read, Show)++_TypeMismatchError = Model.Name "hydra.core.error.checking.TypeMismatchError"++_TypeMismatchError_expectedType = Model.Name "expectedType"++_TypeMismatchError_actualType = Model.Name "actualType"++-- | Type variables that appear free in a type but are not bound in scope+data UnboundTypeVariablesError =+ UnboundTypeVariablesError {+ -- | The set of unbound type variable names+ unboundTypeVariablesErrorVariables :: (S.Set Model.Name),+ -- | The type containing the unbound variables+ unboundTypeVariablesErrorType :: Model.Type}+ deriving (Eq, Ord, Read, Show)++_UnboundTypeVariablesError = Model.Name "hydra.core.error.checking.UnboundTypeVariablesError"++_UnboundTypeVariablesError_variables = Model.Name "variables"++_UnboundTypeVariablesError_type = Model.Name "type"++-- | A reference to a term variable that is not bound in scope, encountered during checking+data UndefinedTermVariableCheckingError =+ UndefinedTermVariableCheckingError {+ -- | The subterm path at which the variable was referenced+ undefinedTermVariableCheckingErrorPath :: Paths.SubtermPath,+ -- | The name of the undefined variable+ undefinedTermVariableCheckingErrorName :: Model.Name}+ deriving (Eq, Ord, Read, Show)++_UndefinedTermVariableCheckingError = Model.Name "hydra.core.error.checking.UndefinedTermVariableCheckingError"++_UndefinedTermVariableCheckingError_path = Model.Name "path"++_UndefinedTermVariableCheckingError_name = Model.Name "name"++-- | Multiple types that should all be equal but are not+data UnequalTypesError =+ UnequalTypesError {+ -- | The list of types that are not all equal+ unequalTypesErrorTypes :: [Model.Type],+ -- | A description of the context in which the types were expected to be equal+ unequalTypesErrorDescription :: String}+ deriving (Eq, Ord, Read, Show)++_UnequalTypesError = Model.Name "hydra.core.error.checking.UnequalTypesError"++_UnequalTypesError_types = Model.Name "types"++_UnequalTypesError_description = Model.Name "description"++-- | A term variant that the type checker does not support+data UnsupportedTermVariantError =+ UnsupportedTermVariantError {+ -- | The unsupported term variant+ unsupportedTermVariantErrorTermVariant :: Variants.TermVariant}+ deriving (Eq, Ord, Read, Show)++_UnsupportedTermVariantError = Model.Name "hydra.core.error.checking.UnsupportedTermVariantError"++_UnsupportedTermVariantError_termVariant = Model.Name "termVariant"++-- | A lambda expression without a type annotation on its parameter+data UntypedLambdaError =+ UntypedLambdaError {}+ deriving (Eq, Ord, Read, Show)++_UntypedLambdaError = Model.Name "hydra.core.error.checking.UntypedLambdaError"++-- | A let binding without a type annotation+data UntypedLetBindingError =+ UntypedLetBindingError {+ -- | The untyped binding+ untypedLetBindingErrorBinding :: Model.Binding}+ deriving (Eq, Ord, Read, Show)++_UntypedLetBindingError = Model.Name "hydra.core.error.checking.UntypedLetBindingError"++_UntypedLetBindingError_binding = Model.Name "binding"++-- | A reference to a term variable whose type is not known, encountered during checking+data UntypedTermVariableCheckingError =+ UntypedTermVariableCheckingError {+ -- | The subterm path at which the variable was referenced+ untypedTermVariableCheckingErrorPath :: Paths.SubtermPath,+ -- | The name of the untyped variable+ untypedTermVariableCheckingErrorName :: Model.Name}+ deriving (Eq, Ord, Read, Show)++_UntypedTermVariableCheckingError = Model.Name "hydra.core.error.checking.UntypedTermVariableCheckingError"++_UntypedTermVariableCheckingError_path = Model.Name "path"++_UntypedTermVariableCheckingError_name = Model.Name "name"
@@ -0,0 +1,37 @@+-- Note: this is an automatically generated file. Do not edit.++-- | File-system error types++module Hydra.Core.Error.File where++import qualified Hydra.Core.File as File+import qualified Hydra.Core.Model as Model+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | A recoverable file-system error+data FileError =+ -- | A path already exists where one was required not to (POSIX EEXIST), e.g. creating a directory that is already present+ FileErrorAlreadyExists File.FilePath |+ -- | The path is syntactically invalid or cannot be represented by the host file system+ FileErrorInvalidPath String |+ -- | The requested path does not exist+ FileErrorNotFound File.FilePath |+ -- | Any other file-system error, represented as a host-provided message+ FileErrorOther String |+ -- | The host denied access to the requested path+ FileErrorPermissionDenied File.FilePath+ deriving (Eq, Ord, Read, Show)++_FileError = Model.Name "hydra.core.error.file.FileError"++_FileError_alreadyExists = Model.Name "alreadyExists"++_FileError_invalidPath = Model.Name "invalidPath"++_FileError_notFound = Model.Name "notFound"++_FileError_other = Model.Name "other"++_FileError_permissionDenied = Model.Name "permissionDenied"
@@ -0,0 +1,923 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Error types for core type and term validation++module Hydra.Core.Error.Model where++import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | An application of ifElse where the condition is a literal boolean, creating a dead branch (optional)+data ConstantConditionError =+ ConstantConditionError {+ -- | The path to the constant condition within the term+ constantConditionErrorLocation :: Paths.SubtermPath,+ -- | The constant boolean value of the condition+ constantConditionErrorValue :: Bool}+ deriving (Eq, Ord, Read, Show)++_ConstantConditionError = Model.Name "hydra.core.error.model.ConstantConditionError"++_ConstantConditionError_location = Model.Name "location"++_ConstantConditionError_value = Model.Name "value"++-- | A duplicate binding name in a let expression+data DuplicateBindingError =+ DuplicateBindingError {+ -- | The path to the duplicate binding within the term+ duplicateBindingErrorLocation :: Paths.SubtermPath,+ -- | The duplicated binding name+ duplicateBindingErrorName :: Model.Name}+ deriving (Eq, Ord, Read, Show)++_DuplicateBindingError = Model.Name "hydra.core.error.model.DuplicateBindingError"++_DuplicateBindingError_location = Model.Name "location"++_DuplicateBindingError_name = Model.Name "name"++-- | A duplicate field name in a record or union type+data DuplicateFieldError =+ DuplicateFieldError {+ -- | The path to the duplicate field within the term+ duplicateFieldErrorLocation :: Paths.SubtermPath,+ -- | The duplicated field name+ duplicateFieldErrorName :: Model.Name}+ deriving (Eq, Ord, Read, Show)++_DuplicateFieldError = Model.Name "hydra.core.error.model.DuplicateFieldError"++_DuplicateFieldError_location = Model.Name "location"++_DuplicateFieldError_name = Model.Name "name"++-- | A record type with duplicate field names+data DuplicateRecordTypeFieldNamesError =+ DuplicateRecordTypeFieldNamesError {+ -- | The path to the record type with duplicate fields+ duplicateRecordTypeFieldNamesErrorLocation :: Paths.SubtermPath,+ -- | The duplicated field name+ duplicateRecordTypeFieldNamesErrorName :: Model.Name}+ deriving (Eq, Ord, Read, Show)++_DuplicateRecordTypeFieldNamesError = Model.Name "hydra.core.error.model.DuplicateRecordTypeFieldNamesError"++_DuplicateRecordTypeFieldNamesError_location = Model.Name "location"++_DuplicateRecordTypeFieldNamesError_name = Model.Name "name"++-- | A union type with duplicate field names+data DuplicateUnionTypeFieldNamesError =+ DuplicateUnionTypeFieldNamesError {+ -- | The path to the union type with duplicate fields+ duplicateUnionTypeFieldNamesErrorLocation :: Paths.SubtermPath,+ -- | The duplicated field name+ duplicateUnionTypeFieldNamesErrorName :: Model.Name}+ deriving (Eq, Ord, Read, Show)++_DuplicateUnionTypeFieldNamesError = Model.Name "hydra.core.error.model.DuplicateUnionTypeFieldNamesError"++_DuplicateUnionTypeFieldNamesError_location = Model.Name "location"++_DuplicateUnionTypeFieldNamesError_name = Model.Name "name"++-- | A case statement with no cases and no default (optional)+data EmptyCaseStatementError =+ EmptyCaseStatementError {+ -- | The path to the empty case statement within the term+ emptyCaseStatementErrorLocation :: Paths.SubtermPath,+ -- | The name of the union type being matched+ emptyCaseStatementErrorTypeName :: Model.Name}+ deriving (Eq, Ord, Read, Show)++_EmptyCaseStatementError = Model.Name "hydra.core.error.model.EmptyCaseStatementError"++_EmptyCaseStatementError_location = Model.Name "location"++_EmptyCaseStatementError_typeName = Model.Name "typeName"++-- | A let expression with an empty list of bindings (optional)+data EmptyLetBindingsError =+ EmptyLetBindingsError {+ -- | The path to the empty let expression within the term+ emptyLetBindingsErrorLocation :: Paths.SubtermPath}+ deriving (Eq, Ord, Read, Show)++_EmptyLetBindingsError = Model.Name "hydra.core.error.model.EmptyLetBindingsError"++_EmptyLetBindingsError_location = Model.Name "location"++-- | A record type with no fields; TypeUnit is preferred for the unit-like case (optional)+data EmptyRecordTypeError =+ EmptyRecordTypeError {+ -- | The path to the empty record type+ emptyRecordTypeErrorLocation :: Paths.SubtermPath}+ deriving (Eq, Ord, Read, Show)++_EmptyRecordTypeError = Model.Name "hydra.core.error.model.EmptyRecordTypeError"++_EmptyRecordTypeError_location = Model.Name "location"++-- | A term annotation with an empty annotation map (optional)+data EmptyTermAnnotationError =+ EmptyTermAnnotationError {+ -- | The path to the empty annotation within the term+ emptyTermAnnotationErrorLocation :: Paths.SubtermPath}+ deriving (Eq, Ord, Read, Show)++_EmptyTermAnnotationError = Model.Name "hydra.core.error.model.EmptyTermAnnotationError"++_EmptyTermAnnotationError_location = Model.Name "location"++-- | A type annotation with an empty annotation map (optional)+data EmptyTypeAnnotationError =+ EmptyTypeAnnotationError {+ -- | The path to the empty annotation+ emptyTypeAnnotationErrorLocation :: Paths.SubtermPath}+ deriving (Eq, Ord, Read, Show)++_EmptyTypeAnnotationError = Model.Name "hydra.core.error.model.EmptyTypeAnnotationError"++_EmptyTypeAnnotationError_location = Model.Name "location"++-- | A record, injection, projection, or case statement with an empty type name (optional)+data EmptyTypeNameInTermError =+ EmptyTypeNameInTermError {+ -- | The path to the term with the empty type name+ emptyTypeNameInTermErrorLocation :: Paths.SubtermPath}+ deriving (Eq, Ord, Read, Show)++_EmptyTypeNameInTermError = Model.Name "hydra.core.error.model.EmptyTypeNameInTermError"++_EmptyTypeNameInTermError_location = Model.Name "location"++-- | A union type with no alternatives; TypeVoid is preferred (optional)+data EmptyUnionTypeError =+ EmptyUnionTypeError {+ -- | The path to the empty union type+ emptyUnionTypeErrorLocation :: Paths.SubtermPath}+ deriving (Eq, Ord, Read, Show)++_EmptyUnionTypeError = Model.Name "hydra.core.error.model.EmptyUnionTypeError"++_EmptyUnionTypeError_location = Model.Name "location"++-- | A record term supplying a field that its record type does not declare+data ExtraRecordFieldsError =+ ExtraRecordFieldsError {+ -- | The path to the record term within the term+ extraRecordFieldsErrorLocation :: Paths.SubtermPath,+ -- | The name of the record type+ extraRecordFieldsErrorTypeName :: Model.Name,+ -- | The names of the undeclared fields supplied by the record term+ extraRecordFieldsErrorFieldNames :: [Model.Name]}+ deriving (Eq, Ord, Read, Show)++_ExtraRecordFieldsError = Model.Name "hydra.core.error.model.ExtraRecordFieldsError"++_ExtraRecordFieldsError_location = Model.Name "location"++_ExtraRecordFieldsError_typeName = Model.Name "typeName"++_ExtraRecordFieldsError_fieldNames = Model.Name "fieldNames"++-- | A forall type parameter name that violates type variable naming conventions (optional)+data InvalidForallParameterNameError =+ InvalidForallParameterNameError {+ -- | The path to the forall type+ invalidForallParameterNameErrorLocation :: Paths.SubtermPath,+ -- | The invalid parameter name+ invalidForallParameterNameErrorName :: Model.Name}+ deriving (Eq, Ord, Read, Show)++_InvalidForallParameterNameError = Model.Name "hydra.core.error.model.InvalidForallParameterNameError"++_InvalidForallParameterNameError_location = Model.Name "location"++_InvalidForallParameterNameError_name = Model.Name "name"++-- | A lambda parameter name that violates naming conventions (optional)+data InvalidLambdaParameterNameError =+ InvalidLambdaParameterNameError {+ -- | The path to the lambda within the term+ invalidLambdaParameterNameErrorLocation :: Paths.SubtermPath,+ -- | The invalid parameter name+ invalidLambdaParameterNameErrorName :: Model.Name}+ deriving (Eq, Ord, Read, Show)++_InvalidLambdaParameterNameError = Model.Name "hydra.core.error.model.InvalidLambdaParameterNameError"++_InvalidLambdaParameterNameError_location = Model.Name "location"++_InvalidLambdaParameterNameError_name = Model.Name "name"++-- | A let binding name that violates naming conventions (optional)+data InvalidLetBindingNameError =+ InvalidLetBindingNameError {+ -- | The path to the binding within the term+ invalidLetBindingNameErrorLocation :: Paths.SubtermPath,+ -- | The invalid binding name+ invalidLetBindingNameErrorName :: Model.Name}+ deriving (Eq, Ord, Read, Show)++_InvalidLetBindingNameError = Model.Name "hydra.core.error.model.InvalidLetBindingNameError"++_InvalidLetBindingNameError_location = Model.Name "location"++_InvalidLetBindingNameError_name = Model.Name "name"++-- | An error indicating that a literal value is invalid+data InvalidLiteralError =+ -- | The literal's type does not match the expected literal type+ InvalidLiteralErrorTypeMismatch LiteralTypeMismatchError+ deriving (Eq, Ord, Read, Show)++_InvalidLiteralError = Model.Name "hydra.core.error.model.InvalidLiteralError"++_InvalidLiteralError_typeMismatch = Model.Name "typeMismatch"++-- | An error indicating that a term is invalid+data InvalidTermError =+ -- | An ifElse with a literal boolean condition (optional)+ InvalidTermErrorConstantCondition ConstantConditionError |+ -- | A duplicate binding name in a let expression+ InvalidTermErrorDuplicateBinding DuplicateBindingError |+ -- | A duplicate field name in a record or case statement+ InvalidTermErrorDuplicateField DuplicateFieldError |+ -- | A case statement with no cases and no default (optional)+ InvalidTermErrorEmptyCaseStatement EmptyCaseStatementError |+ -- | A let expression with no bindings (optional)+ InvalidTermErrorEmptyLetBindings EmptyLetBindingsError |+ -- | A term annotation with an empty annotation map (optional)+ InvalidTermErrorEmptyTermAnnotation EmptyTermAnnotationError |+ -- | A term with an empty type name (optional)+ InvalidTermErrorEmptyTypeNameInTerm EmptyTypeNameInTermError |+ -- | A record term supplying a field not declared by its record type+ InvalidTermErrorExtraRecordFields ExtraRecordFieldsError |+ -- | A lambda parameter name violating naming conventions (optional)+ InvalidTermErrorInvalidLambdaParameterName InvalidLambdaParameterNameError |+ -- | A let binding name violating naming conventions (optional)+ InvalidTermErrorInvalidLetBindingName InvalidLetBindingNameError |+ -- | A type lambda parameter name violating naming conventions (optional)+ InvalidTermErrorInvalidTypeLambdaParameterName InvalidTypeLambdaParameterNameError |+ -- | A case statement that does not cover every variant of the union it matches+ InvalidTermErrorMissingCaseBranches MissingCaseBranchesError |+ -- | A record term omitting a field declared by its record type+ InvalidTermErrorMissingRecordFields MissingRecordFieldsError |+ -- | Nested term annotations that should be merged (optional)+ InvalidTermErrorNestedTermAnnotation NestedTermAnnotationError |+ -- | A nominal type reference resolving to a type of the wrong kind (e.g. a record term naming a union type)+ InvalidTermErrorNominalTypeKindMismatch NominalTypeKindMismatchError |+ -- | A no-op unwrap-of-wrap round-trip (optional)+ InvalidTermErrorRedundantWrapUnwrap RedundantWrapUnwrapError |+ -- | A variable applied to itself (optional)+ InvalidTermErrorSelfApplication SelfApplicationError |+ -- | A binding that shadows a variable already in scope (optional)+ InvalidTermErrorTermVariableShadowing TermVariableShadowingError |+ -- | A type lambda parameter that shadows a type variable in scope (optional)+ InvalidTermErrorTypeVariableShadowingInTypeLambda TypeVariableShadowingInTypeLambdaError |+ -- | An injection naming a variant that is not declared by its union type+ InvalidTermErrorUndeclaredVariant UndeclaredVariantError |+ -- | A variable reference to an unbound term name+ InvalidTermErrorUndefinedTermVariable UndefinedTermVariableError |+ -- | An unbound type variable in a let binding's type scheme+ InvalidTermErrorUndefinedTypeVariableInBindingType UndefinedTypeVariableInBindingTypeError |+ -- | An unbound type variable in a lambda domain annotation+ InvalidTermErrorUndefinedTypeVariableInLambdaDomain UndefinedTypeVariableInLambdaDomainError |+ -- | An unbound type variable in a type application term+ InvalidTermErrorUndefinedTypeVariableInTypeApplication UndefinedTypeVariableInTypeApplicationError |+ -- | A case statement alternative naming a field that does not exist in the union it matches+ InvalidTermErrorUnknownCaseAlternative UnknownCaseAlternativeError |+ -- | A reference to an unknown primitive function+ InvalidTermErrorUnknownPrimitiveName UnknownPrimitiveNameError |+ -- | A projection naming a field that is not declared by its record type+ InvalidTermErrorUnknownProjectedField UnknownProjectedFieldError |+ -- | An identity lambda applied to an argument (optional)+ InvalidTermErrorUnnecessaryIdentityApplication UnnecessaryIdentityApplicationError |+ -- | A nominal type reference that does not resolve to any declared type in scope+ InvalidTermErrorUnresolvedNominalType UnresolvedNominalTypeError |+ -- | A term variable whose type is not known+ InvalidTermErrorUntypedTermVariable UntypedTermVariableError+ deriving (Eq, Ord, Read, Show)++_InvalidTermError = Model.Name "hydra.core.error.model.InvalidTermError"++_InvalidTermError_constantCondition = Model.Name "constantCondition"++_InvalidTermError_duplicateBinding = Model.Name "duplicateBinding"++_InvalidTermError_duplicateField = Model.Name "duplicateField"++_InvalidTermError_emptyCaseStatement = Model.Name "emptyCaseStatement"++_InvalidTermError_emptyLetBindings = Model.Name "emptyLetBindings"++_InvalidTermError_emptyTermAnnotation = Model.Name "emptyTermAnnotation"++_InvalidTermError_emptyTypeNameInTerm = Model.Name "emptyTypeNameInTerm"++_InvalidTermError_extraRecordFields = Model.Name "extraRecordFields"++_InvalidTermError_invalidLambdaParameterName = Model.Name "invalidLambdaParameterName"++_InvalidTermError_invalidLetBindingName = Model.Name "invalidLetBindingName"++_InvalidTermError_invalidTypeLambdaParameterName = Model.Name "invalidTypeLambdaParameterName"++_InvalidTermError_missingCaseBranches = Model.Name "missingCaseBranches"++_InvalidTermError_missingRecordFields = Model.Name "missingRecordFields"++_InvalidTermError_nestedTermAnnotation = Model.Name "nestedTermAnnotation"++_InvalidTermError_nominalTypeKindMismatch = Model.Name "nominalTypeKindMismatch"++_InvalidTermError_redundantWrapUnwrap = Model.Name "redundantWrapUnwrap"++_InvalidTermError_selfApplication = Model.Name "selfApplication"++_InvalidTermError_termVariableShadowing = Model.Name "termVariableShadowing"++_InvalidTermError_typeVariableShadowingInTypeLambda = Model.Name "typeVariableShadowingInTypeLambda"++_InvalidTermError_undeclaredVariant = Model.Name "undeclaredVariant"++_InvalidTermError_undefinedTermVariable = Model.Name "undefinedTermVariable"++_InvalidTermError_undefinedTypeVariableInBindingType = Model.Name "undefinedTypeVariableInBindingType"++_InvalidTermError_undefinedTypeVariableInLambdaDomain = Model.Name "undefinedTypeVariableInLambdaDomain"++_InvalidTermError_undefinedTypeVariableInTypeApplication = Model.Name "undefinedTypeVariableInTypeApplication"++_InvalidTermError_unknownCaseAlternative = Model.Name "unknownCaseAlternative"++_InvalidTermError_unknownPrimitiveName = Model.Name "unknownPrimitiveName"++_InvalidTermError_unknownProjectedField = Model.Name "unknownProjectedField"++_InvalidTermError_unnecessaryIdentityApplication = Model.Name "unnecessaryIdentityApplication"++_InvalidTermError_unresolvedNominalType = Model.Name "unresolvedNominalType"++_InvalidTermError_untypedTermVariable = Model.Name "untypedTermVariable"++-- | An error indicating that a type is invalid+data InvalidTypeError =+ -- | A record type with duplicate field names+ InvalidTypeErrorDuplicateRecordTypeFieldNames DuplicateRecordTypeFieldNamesError |+ -- | A union type with duplicate field names+ InvalidTypeErrorDuplicateUnionTypeFieldNames DuplicateUnionTypeFieldNamesError |+ -- | A record type with no fields (optional)+ InvalidTypeErrorEmptyRecordType EmptyRecordTypeError |+ -- | A type annotation with an empty annotation map (optional)+ InvalidTypeErrorEmptyTypeAnnotation EmptyTypeAnnotationError |+ -- | A union type with no alternatives (optional)+ InvalidTypeErrorEmptyUnionType EmptyUnionTypeError |+ -- | A forall parameter name violating naming conventions (optional)+ InvalidTypeErrorInvalidForallParameterName InvalidForallParameterNameError |+ -- | A type scheme variable name violating naming conventions (optional)+ InvalidTypeErrorInvalidTypeSchemeVariableName InvalidTypeSchemeVariableNameError |+ -- | Nested type annotations that should be merged (optional)+ InvalidTypeErrorNestedTypeAnnotation NestedTypeAnnotationError |+ -- | A map with a non-comparable key type+ InvalidTypeErrorNonComparableMapKeyType NonComparableMapKeyTypeError |+ -- | A set with a non-comparable element type+ InvalidTypeErrorNonComparableSetElementType NonComparableSetElementTypeError |+ -- | A union type with only one variant (optional)+ InvalidTypeErrorSingleVariantUnion SingleVariantUnionError |+ -- | A forall parameter that shadows a type variable in scope (optional)+ InvalidTypeErrorTypeVariableShadowingInForall TypeVariableShadowingInForallError |+ -- | A type variable reference to an unbound name+ InvalidTypeErrorUndefinedTypeVariable UndefinedTypeVariableError |+ -- | TypeVoid in a position where no value can be constructed (optional)+ InvalidTypeErrorVoidInNonBottomPosition VoidInNonBottomPositionError+ deriving (Eq, Ord, Read, Show)++_InvalidTypeError = Model.Name "hydra.core.error.model.InvalidTypeError"++_InvalidTypeError_duplicateRecordTypeFieldNames = Model.Name "duplicateRecordTypeFieldNames"++_InvalidTypeError_duplicateUnionTypeFieldNames = Model.Name "duplicateUnionTypeFieldNames"++_InvalidTypeError_emptyRecordType = Model.Name "emptyRecordType"++_InvalidTypeError_emptyTypeAnnotation = Model.Name "emptyTypeAnnotation"++_InvalidTypeError_emptyUnionType = Model.Name "emptyUnionType"++_InvalidTypeError_invalidForallParameterName = Model.Name "invalidForallParameterName"++_InvalidTypeError_invalidTypeSchemeVariableName = Model.Name "invalidTypeSchemeVariableName"++_InvalidTypeError_nestedTypeAnnotation = Model.Name "nestedTypeAnnotation"++_InvalidTypeError_nonComparableMapKeyType = Model.Name "nonComparableMapKeyType"++_InvalidTypeError_nonComparableSetElementType = Model.Name "nonComparableSetElementType"++_InvalidTypeError_singleVariantUnion = Model.Name "singleVariantUnion"++_InvalidTypeError_typeVariableShadowingInForall = Model.Name "typeVariableShadowingInForall"++_InvalidTypeError_undefinedTypeVariable = Model.Name "undefinedTypeVariable"++_InvalidTypeError_voidInNonBottomPosition = Model.Name "voidInNonBottomPosition"++-- | A type lambda parameter name that violates naming conventions (optional)+data InvalidTypeLambdaParameterNameError =+ InvalidTypeLambdaParameterNameError {+ -- | The path to the type lambda within the term+ invalidTypeLambdaParameterNameErrorLocation :: Paths.SubtermPath,+ -- | The invalid type lambda parameter name+ invalidTypeLambdaParameterNameErrorName :: Model.Name}+ deriving (Eq, Ord, Read, Show)++_InvalidTypeLambdaParameterNameError = Model.Name "hydra.core.error.model.InvalidTypeLambdaParameterNameError"++_InvalidTypeLambdaParameterNameError_location = Model.Name "location"++_InvalidTypeLambdaParameterNameError_name = Model.Name "name"++-- | A type scheme variable name that violates type variable naming conventions (optional)+data InvalidTypeSchemeVariableNameError =+ InvalidTypeSchemeVariableNameError {+ -- | The path to the type scheme+ invalidTypeSchemeVariableNameErrorLocation :: Paths.SubtermPath,+ -- | The invalid variable name+ invalidTypeSchemeVariableNameErrorName :: Model.Name}+ deriving (Eq, Ord, Read, Show)++_InvalidTypeSchemeVariableNameError = Model.Name "hydra.core.error.model.InvalidTypeSchemeVariableNameError"++_InvalidTypeSchemeVariableNameError_location = Model.Name "location"++_InvalidTypeSchemeVariableNameError_name = Model.Name "name"++-- | A mismatch between an expected literal type and the type of an actual literal value+data LiteralTypeMismatchError =+ LiteralTypeMismatchError {+ -- | The expected literal type+ literalTypeMismatchErrorExpectedType :: Model.LiteralType,+ -- | The actual literal type, derived from the value+ literalTypeMismatchErrorActualType :: Model.LiteralType}+ deriving (Eq, Ord, Read, Show)++_LiteralTypeMismatchError = Model.Name "hydra.core.error.model.LiteralTypeMismatchError"++_LiteralTypeMismatchError_expectedType = Model.Name "expectedType"++_LiteralTypeMismatchError_actualType = Model.Name "actualType"++-- | A case statement without a default branch that fails to cover every variant of the union it matches+data MissingCaseBranchesError =+ MissingCaseBranchesError {+ -- | The path to the case statement within the term+ missingCaseBranchesErrorLocation :: Paths.SubtermPath,+ -- | The name of the union type being matched+ missingCaseBranchesErrorTypeName :: Model.Name,+ -- | The names of the uncovered variants+ missingCaseBranchesErrorVariantNames :: [Model.Name]}+ deriving (Eq, Ord, Read, Show)++_MissingCaseBranchesError = Model.Name "hydra.core.error.model.MissingCaseBranchesError"++_MissingCaseBranchesError_location = Model.Name "location"++_MissingCaseBranchesError_typeName = Model.Name "typeName"++_MissingCaseBranchesError_variantNames = Model.Name "variantNames"++-- | A record term omitting a field declared by its record type+data MissingRecordFieldsError =+ MissingRecordFieldsError {+ -- | The path to the record term within the term+ missingRecordFieldsErrorLocation :: Paths.SubtermPath,+ -- | The name of the record type+ missingRecordFieldsErrorTypeName :: Model.Name,+ -- | The names of the missing fields+ missingRecordFieldsErrorFieldNames :: [Model.Name]}+ deriving (Eq, Ord, Read, Show)++_MissingRecordFieldsError = Model.Name "hydra.core.error.model.MissingRecordFieldsError"++_MissingRecordFieldsError_location = Model.Name "location"++_MissingRecordFieldsError_typeName = Model.Name "typeName"++_MissingRecordFieldsError_fieldNames = Model.Name "fieldNames"++-- | A term annotation directly wrapping another term annotation; annotations should be merged (optional)+data NestedTermAnnotationError =+ NestedTermAnnotationError {+ -- | The path to the outer annotation within the term+ nestedTermAnnotationErrorLocation :: Paths.SubtermPath}+ deriving (Eq, Ord, Read, Show)++_NestedTermAnnotationError = Model.Name "hydra.core.error.model.NestedTermAnnotationError"++_NestedTermAnnotationError_location = Model.Name "location"++-- | A type annotation directly wrapping another type annotation; annotations should be merged (optional)+data NestedTypeAnnotationError =+ NestedTypeAnnotationError {+ -- | The path to the outer annotation+ nestedTypeAnnotationErrorLocation :: Paths.SubtermPath}+ deriving (Eq, Ord, Read, Show)++_NestedTypeAnnotationError = Model.Name "hydra.core.error.model.NestedTypeAnnotationError"++_NestedTypeAnnotationError_location = Model.Name "location"++-- | A nominal type reference in a term (inject, cases, record, project, wrap, or unwrap) resolving to a declared type of the wrong kind, e.g. a record term naming a union type+data NominalTypeKindMismatchError =+ NominalTypeKindMismatchError {+ -- | The path to the term with the mismatched nominal type reference+ nominalTypeKindMismatchErrorLocation :: Paths.SubtermPath,+ -- | The name of the referenced type+ nominalTypeKindMismatchErrorTypeName :: Model.Name,+ -- | The type variant required at this site+ nominalTypeKindMismatchErrorExpectedVariant :: Variants.TypeVariant,+ -- | The type variant that the name actually resolves to+ nominalTypeKindMismatchErrorActualVariant :: Variants.TypeVariant}+ deriving (Eq, Ord, Read, Show)++_NominalTypeKindMismatchError = Model.Name "hydra.core.error.model.NominalTypeKindMismatchError"++_NominalTypeKindMismatchError_location = Model.Name "location"++_NominalTypeKindMismatchError_typeName = Model.Name "typeName"++_NominalTypeKindMismatchError_expectedVariant = Model.Name "expectedVariant"++_NominalTypeKindMismatchError_actualVariant = Model.Name "actualVariant"++-- | A map type whose key type is or directly contains a function type, which cannot be compared for equality+data NonComparableMapKeyTypeError =+ NonComparableMapKeyTypeError {+ -- | The path to the map type+ nonComparableMapKeyTypeErrorLocation :: Paths.SubtermPath,+ -- | The non-comparable key type+ nonComparableMapKeyTypeErrorKeyType :: Model.Type}+ deriving (Eq, Ord, Read, Show)++_NonComparableMapKeyTypeError = Model.Name "hydra.core.error.model.NonComparableMapKeyTypeError"++_NonComparableMapKeyTypeError_location = Model.Name "location"++_NonComparableMapKeyTypeError_keyType = Model.Name "keyType"++-- | A set type whose element type is or directly contains a function type, which cannot be compared for equality+data NonComparableSetElementTypeError =+ NonComparableSetElementTypeError {+ -- | The path to the set type+ nonComparableSetElementTypeErrorLocation :: Paths.SubtermPath,+ -- | The non-comparable element type+ nonComparableSetElementTypeErrorElementType :: Model.Type}+ deriving (Eq, Ord, Read, Show)++_NonComparableSetElementTypeError = Model.Name "hydra.core.error.model.NonComparableSetElementTypeError"++_NonComparableSetElementTypeError_location = Model.Name "location"++_NonComparableSetElementTypeError_elementType = Model.Name "elementType"++-- | An unwrap elimination applied to a wrap term of the same type, forming a no-op round-trip (optional)+data RedundantWrapUnwrapError =+ RedundantWrapUnwrapError {+ -- | The path to the redundant wrap/unwrap within the term+ redundantWrapUnwrapErrorLocation :: Paths.SubtermPath,+ -- | The type name of the wrapper+ redundantWrapUnwrapErrorTypeName :: Model.Name}+ deriving (Eq, Ord, Read, Show)++_RedundantWrapUnwrapError = Model.Name "hydra.core.error.model.RedundantWrapUnwrapError"++_RedundantWrapUnwrapError_location = Model.Name "location"++_RedundantWrapUnwrapError_typeName = Model.Name "typeName"++-- | A variable applied to itself, which is almost always a mistake in Hydra's type system (optional)+data SelfApplicationError =+ SelfApplicationError {+ -- | The path to the self-application within the term+ selfApplicationErrorLocation :: Paths.SubtermPath,+ -- | The name of the variable applied to itself+ selfApplicationErrorName :: Model.Name}+ deriving (Eq, Ord, Read, Show)++_SelfApplicationError = Model.Name "hydra.core.error.model.SelfApplicationError"++_SelfApplicationError_location = Model.Name "location"++_SelfApplicationError_name = Model.Name "name"++-- | A union type with exactly one field; could be a wrapped type or record instead (optional)+data SingleVariantUnionError =+ SingleVariantUnionError {+ -- | The path to the single-variant union type+ singleVariantUnionErrorLocation :: Paths.SubtermPath,+ -- | The name of the single field+ singleVariantUnionErrorFieldName :: Model.Name}+ deriving (Eq, Ord, Read, Show)++_SingleVariantUnionError = Model.Name "hydra.core.error.model.SingleVariantUnionError"++_SingleVariantUnionError_location = Model.Name "location"++_SingleVariantUnionError_fieldName = Model.Name "fieldName"++-- | A lambda parameter or let binding name that shadows a variable already in scope (optional)+data TermVariableShadowingError =+ TermVariableShadowingError {+ -- | The path to the shadowing binding within the term+ termVariableShadowingErrorLocation :: Paths.SubtermPath,+ -- | The name of the shadowed variable+ termVariableShadowingErrorName :: Model.Name}+ deriving (Eq, Ord, Read, Show)++_TermVariableShadowingError = Model.Name "hydra.core.error.model.TermVariableShadowingError"++_TermVariableShadowingError_location = Model.Name "location"++_TermVariableShadowingError_name = Model.Name "name"++-- | A forall type parameter that shadows a type variable already in scope (optional)+data TypeVariableShadowingInForallError =+ TypeVariableShadowingInForallError {+ -- | The path to the shadowing forall type+ typeVariableShadowingInForallErrorLocation :: Paths.SubtermPath,+ -- | The name of the shadowed type variable+ typeVariableShadowingInForallErrorName :: Model.Name}+ deriving (Eq, Ord, Read, Show)++_TypeVariableShadowingInForallError = Model.Name "hydra.core.error.model.TypeVariableShadowingInForallError"++_TypeVariableShadowingInForallError_location = Model.Name "location"++_TypeVariableShadowingInForallError_name = Model.Name "name"++-- | A type lambda parameter that shadows a type variable already in scope (optional)+data TypeVariableShadowingInTypeLambdaError =+ TypeVariableShadowingInTypeLambdaError {+ -- | The path to the type lambda within the term+ typeVariableShadowingInTypeLambdaErrorLocation :: Paths.SubtermPath,+ -- | The name of the shadowed type variable+ typeVariableShadowingInTypeLambdaErrorName :: Model.Name}+ deriving (Eq, Ord, Read, Show)++_TypeVariableShadowingInTypeLambdaError = Model.Name "hydra.core.error.model.TypeVariableShadowingInTypeLambdaError"++_TypeVariableShadowingInTypeLambdaError_location = Model.Name "location"++_TypeVariableShadowingInTypeLambdaError_name = Model.Name "name"++-- | An injection naming a variant that is not declared by its union type+data UndeclaredVariantError =+ UndeclaredVariantError {+ -- | The path to the injection within the term+ undeclaredVariantErrorLocation :: Paths.SubtermPath,+ -- | The name of the union type+ undeclaredVariantErrorTypeName :: Model.Name,+ -- | The undeclared variant name+ undeclaredVariantErrorVariantName :: Model.Name}+ deriving (Eq, Ord, Read, Show)++_UndeclaredVariantError = Model.Name "hydra.core.error.model.UndeclaredVariantError"++_UndeclaredVariantError_location = Model.Name "location"++_UndeclaredVariantError_typeName = Model.Name "typeName"++_UndeclaredVariantError_variantName = Model.Name "variantName"++-- | A reference to a field that does not exist in the given type+data UndefinedFieldError =+ UndefinedFieldError {+ -- | The name of the undefined field+ undefinedFieldErrorFieldName :: Model.Name,+ -- | The name of the type in which the field was expected+ undefinedFieldErrorTypeName :: Model.Name}+ deriving (Eq, Ord, Read, Show)++_UndefinedFieldError = Model.Name "hydra.core.error.model.UndefinedFieldError"++_UndefinedFieldError_fieldName = Model.Name "fieldName"++_UndefinedFieldError_typeName = Model.Name "typeName"++-- | A variable reference to a term name that is not bound in scope+data UndefinedTermVariableError =+ UndefinedTermVariableError {+ -- | The path to the undefined variable within the term+ undefinedTermVariableErrorLocation :: Paths.SubtermPath,+ -- | The name of the undefined variable+ undefinedTermVariableErrorName :: Model.Name}+ deriving (Eq, Ord, Read, Show)++_UndefinedTermVariableError = Model.Name "hydra.core.error.model.UndefinedTermVariableError"++_UndefinedTermVariableError_location = Model.Name "location"++_UndefinedTermVariableError_name = Model.Name "name"++-- | A type variable reference to a name that is not bound in scope+data UndefinedTypeVariableError =+ UndefinedTypeVariableError {+ -- | The path to the undefined type variable+ undefinedTypeVariableErrorLocation :: Paths.SubtermPath,+ -- | The name of the undefined type variable+ undefinedTypeVariableErrorName :: Model.Name}+ deriving (Eq, Ord, Read, Show)++_UndefinedTypeVariableError = Model.Name "hydra.core.error.model.UndefinedTypeVariableError"++_UndefinedTypeVariableError_location = Model.Name "location"++_UndefinedTypeVariableError_name = Model.Name "name"++-- | A type variable in a let binding's type scheme that is not bound by the scheme or enclosing scope+data UndefinedTypeVariableInBindingTypeError =+ UndefinedTypeVariableInBindingTypeError {+ -- | The path to the binding within the term+ undefinedTypeVariableInBindingTypeErrorLocation :: Paths.SubtermPath,+ -- | The name of the undefined type variable+ undefinedTypeVariableInBindingTypeErrorName :: Model.Name}+ deriving (Eq, Ord, Read, Show)++_UndefinedTypeVariableInBindingTypeError = Model.Name "hydra.core.error.model.UndefinedTypeVariableInBindingTypeError"++_UndefinedTypeVariableInBindingTypeError_location = Model.Name "location"++_UndefinedTypeVariableInBindingTypeError_name = Model.Name "name"++-- | A type variable in a lambda domain annotation that is not bound in scope+data UndefinedTypeVariableInLambdaDomainError =+ UndefinedTypeVariableInLambdaDomainError {+ -- | The path to the lambda within the term+ undefinedTypeVariableInLambdaDomainErrorLocation :: Paths.SubtermPath,+ -- | The name of the undefined type variable+ undefinedTypeVariableInLambdaDomainErrorName :: Model.Name}+ deriving (Eq, Ord, Read, Show)++_UndefinedTypeVariableInLambdaDomainError = Model.Name "hydra.core.error.model.UndefinedTypeVariableInLambdaDomainError"++_UndefinedTypeVariableInLambdaDomainError_location = Model.Name "location"++_UndefinedTypeVariableInLambdaDomainError_name = Model.Name "name"++-- | A type variable in a type application term that is not bound in scope+data UndefinedTypeVariableInTypeApplicationError =+ UndefinedTypeVariableInTypeApplicationError {+ -- | The path to the type application within the term+ undefinedTypeVariableInTypeApplicationErrorLocation :: Paths.SubtermPath,+ -- | The name of the undefined type variable+ undefinedTypeVariableInTypeApplicationErrorName :: Model.Name}+ deriving (Eq, Ord, Read, Show)++_UndefinedTypeVariableInTypeApplicationError =+ Model.Name "hydra.core.error.model.UndefinedTypeVariableInTypeApplicationError"++_UndefinedTypeVariableInTypeApplicationError_location = Model.Name "location"++_UndefinedTypeVariableInTypeApplicationError_name = Model.Name "name"++-- | An unexpected term variant was encountered+data UnexpectedTermVariantError =+ UnexpectedTermVariantError {+ -- | The expected term variant+ unexpectedTermVariantErrorExpectedVariant :: Variants.TermVariant,+ -- | The actual term that was encountered+ unexpectedTermVariantErrorActualTerm :: Model.Term}+ deriving (Eq, Ord, Read, Show)++_UnexpectedTermVariantError = Model.Name "hydra.core.error.model.UnexpectedTermVariantError"++_UnexpectedTermVariantError_expectedVariant = Model.Name "expectedVariant"++_UnexpectedTermVariantError_actualTerm = Model.Name "actualTerm"++-- | An unexpected type variant was encountered+data UnexpectedTypeVariantError =+ UnexpectedTypeVariantError {+ -- | The expected type variant+ unexpectedTypeVariantErrorExpectedVariant :: Variants.TypeVariant,+ -- | The actual type that was encountered+ unexpectedTypeVariantErrorActualType :: Model.Type}+ deriving (Eq, Ord, Read, Show)++_UnexpectedTypeVariantError = Model.Name "hydra.core.error.model.UnexpectedTypeVariantError"++_UnexpectedTypeVariantError_expectedVariant = Model.Name "expectedVariant"++_UnexpectedTypeVariantError_actualType = Model.Name "actualType"++-- | A case statement alternative naming a field that does not exist in the union it matches+data UnknownCaseAlternativeError =+ UnknownCaseAlternativeError {+ -- | The path to the case statement within the term+ unknownCaseAlternativeErrorLocation :: Paths.SubtermPath,+ -- | The name of the union type being matched+ unknownCaseAlternativeErrorTypeName :: Model.Name,+ -- | The unknown alternative name+ unknownCaseAlternativeErrorName :: Model.Name}+ deriving (Eq, Ord, Read, Show)++_UnknownCaseAlternativeError = Model.Name "hydra.core.error.model.UnknownCaseAlternativeError"++_UnknownCaseAlternativeError_location = Model.Name "location"++_UnknownCaseAlternativeError_typeName = Model.Name "typeName"++_UnknownCaseAlternativeError_name = Model.Name "name"++-- | A primitive function reference to a name not in the known primitive registry+data UnknownPrimitiveNameError =+ UnknownPrimitiveNameError {+ -- | The path to the primitive reference within the term+ unknownPrimitiveNameErrorLocation :: Paths.SubtermPath,+ -- | The unknown primitive name+ unknownPrimitiveNameErrorName :: Model.Name}+ deriving (Eq, Ord, Read, Show)++_UnknownPrimitiveNameError = Model.Name "hydra.core.error.model.UnknownPrimitiveNameError"++_UnknownPrimitiveNameError_location = Model.Name "location"++_UnknownPrimitiveNameError_name = Model.Name "name"++-- | A projection naming a field that is not declared by its record type+data UnknownProjectedFieldError =+ UnknownProjectedFieldError {+ -- | The path to the projection within the term+ unknownProjectedFieldErrorLocation :: Paths.SubtermPath,+ -- | The name of the record type+ unknownProjectedFieldErrorTypeName :: Model.Name,+ -- | The unknown projected field name+ unknownProjectedFieldErrorFieldName :: Model.Name}+ deriving (Eq, Ord, Read, Show)++_UnknownProjectedFieldError = Model.Name "hydra.core.error.model.UnknownProjectedFieldError"++_UnknownProjectedFieldError_location = Model.Name "location"++_UnknownProjectedFieldError_typeName = Model.Name "typeName"++_UnknownProjectedFieldError_fieldName = Model.Name "fieldName"++-- | An application of an identity lambda to an argument, which simplifies to the argument (optional)+data UnnecessaryIdentityApplicationError =+ UnnecessaryIdentityApplicationError {+ -- | The path to the identity application within the term+ unnecessaryIdentityApplicationErrorLocation :: Paths.SubtermPath}+ deriving (Eq, Ord, Read, Show)++_UnnecessaryIdentityApplicationError = Model.Name "hydra.core.error.model.UnnecessaryIdentityApplicationError"++_UnnecessaryIdentityApplicationError_location = Model.Name "location"++-- | A nominal type reference in a term (inject, cases, record, project, wrap, or unwrap) that does not resolve to any declared type in scope+data UnresolvedNominalTypeError =+ UnresolvedNominalTypeError {+ -- | The path to the term with the unresolved nominal type reference+ unresolvedNominalTypeErrorLocation :: Paths.SubtermPath,+ -- | The unresolved type name+ unresolvedNominalTypeErrorTypeName :: Model.Name}+ deriving (Eq, Ord, Read, Show)++_UnresolvedNominalTypeError = Model.Name "hydra.core.error.model.UnresolvedNominalTypeError"++_UnresolvedNominalTypeError_location = Model.Name "location"++_UnresolvedNominalTypeError_typeName = Model.Name "typeName"++-- | A term variable whose type is not known in the current scope+data UntypedTermVariableError =+ UntypedTermVariableError {+ -- | The path to the untyped variable within the term+ untypedTermVariableErrorLocation :: Paths.SubtermPath,+ -- | The name of the untyped variable+ untypedTermVariableErrorName :: Model.Name}+ deriving (Eq, Ord, Read, Show)++_UntypedTermVariableError = Model.Name "hydra.core.error.model.UntypedTermVariableError"++_UntypedTermVariableError_location = Model.Name "location"++_UntypedTermVariableError_name = Model.Name "name"++-- | TypeVoid appearing in a position where no value can be constructed, such as a record field, list element, map key/value, set element, pair component, or function codomain (optional)+data VoidInNonBottomPositionError =+ VoidInNonBottomPositionError {+ -- | The path to the void type in a non-bottom position+ voidInNonBottomPositionErrorLocation :: Paths.SubtermPath}+ deriving (Eq, Ord, Read, Show)++_VoidInNonBottomPositionError = Model.Name "hydra.core.error.model.VoidInNonBottomPositionError"++_VoidInNonBottomPositionError_location = Model.Name "location"
@@ -0,0 +1,287 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Error types for module and package validation++module Hydra.Core.Error.Packaging where++import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Util as Util+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | A module name which, when mapped to a target language's directory or package structure, conflicts with another module's mapped name. For example, hydra.foo.bar and hydra.fooBar might both map to the same directory in a case-insensitive filesystem.+data ConflictingModuleNameError =+ ConflictingModuleNameError {+ -- | The first module name+ conflictingModuleNameErrorFirst :: Packaging.ModuleName,+ -- | The second module name that conflicts with the first+ conflictingModuleNameErrorSecond :: Packaging.ModuleName}+ deriving (Eq, Ord, Read, Show)++_ConflictingModuleNameError = Model.Name "hydra.core.error.packaging.ConflictingModuleNameError"++_ConflictingModuleNameError_first = Model.Name "first"++_ConflictingModuleNameError_second = Model.Name "second"++-- | A union type variant name which, when capitalized and concatenated with its type name, conflicts with another type definition name. For example, a union type Foo with a variant bar produces FooBar, which conflicts with an existing type definition FooBar. This is currently a problem only for the Haskell target.+data ConflictingVariantNameError =+ ConflictingVariantNameError {+ -- | The name of the module containing the conflict+ conflictingVariantNameErrorModuleName :: Packaging.ModuleName,+ -- | The name of the union type+ conflictingVariantNameErrorTypeName :: Model.Name,+ -- | The name of the variant field causing the conflict+ conflictingVariantNameErrorVariantName :: Model.Name,+ -- | The name of the other type definition that conflicts with the generated constructor name+ conflictingVariantNameErrorConflictingName :: Model.Name}+ deriving (Eq, Ord, Read, Show)++_ConflictingVariantNameError = Model.Name "hydra.core.error.packaging.ConflictingVariantNameError"++_ConflictingVariantNameError_moduleName = Model.Name "moduleName"++_ConflictingVariantNameError_typeName = Model.Name "typeName"++_ConflictingVariantNameError_variantName = Model.Name "variantName"++_ConflictingVariantNameError_conflictingName = Model.Name "conflictingName"++-- | A definition whose name does not have the module's name as a prefix. If the module name is foo.bar, all definition names must have the form foo.bar.quux.+data DefinitionNotInModuleNameError =+ DefinitionNotInModuleNameError {+ -- | The name of the module+ definitionNotInModuleNameErrorModuleName :: Packaging.ModuleName,+ -- | The definition name that does not match the module name+ definitionNotInModuleNameErrorName :: Model.Name}+ deriving (Eq, Ord, Read, Show)++_DefinitionNotInModuleNameError = Model.Name "hydra.core.error.packaging.DefinitionNotInModuleNameError"++_DefinitionNotInModuleNameError_moduleName = Model.Name "moduleName"++_DefinitionNotInModuleNameError_name = Model.Name "name"++-- | Two consecutive definitions in a module's definitions list that are not in alphabetical order by local name. Hydra requires definitions to appear in lexicographic ASCII order of their local names.+data DefinitionsOutOfOrderError =+ DefinitionsOutOfOrderError {+ -- | The name of the module containing the misordered definitions+ definitionsOutOfOrderErrorModuleName :: Packaging.ModuleName,+ -- | The definition that appears first in the list+ definitionsOutOfOrderErrorPrecedingName :: Model.Name,+ -- | The definition that appears next, but should sort earlier than precedingName+ definitionsOutOfOrderErrorFollowingName :: Model.Name}+ deriving (Eq, Ord, Read, Show)++_DefinitionsOutOfOrderError = Model.Name "hydra.core.error.packaging.DefinitionsOutOfOrderError"++_DefinitionsOutOfOrderError_moduleName = Model.Name "moduleName"++_DefinitionsOutOfOrderError_precedingName = Model.Name "precedingName"++_DefinitionsOutOfOrderError_followingName = Model.Name "followingName"++-- | Two or more definitions in the same module share the same name+data DuplicateDefinitionNameError =+ DuplicateDefinitionNameError {+ -- | The name of the module containing the duplicates+ duplicateDefinitionNameErrorModuleName :: Packaging.ModuleName,+ -- | The duplicated definition name+ duplicateDefinitionNameErrorName :: Model.Name}+ deriving (Eq, Ord, Read, Show)++_DuplicateDefinitionNameError = Model.Name "hydra.core.error.packaging.DuplicateDefinitionNameError"++_DuplicateDefinitionNameError_moduleName = Model.Name "moduleName"++_DuplicateDefinitionNameError_name = Model.Name "name"++-- | Two or more modules in the same package share the same name+data DuplicateModuleNameError =+ DuplicateModuleNameError {+ -- | The duplicated module name+ duplicateModuleNameErrorModuleName :: Packaging.ModuleName}+ deriving (Eq, Ord, Read, Show)++_DuplicateModuleNameError = Model.Name "hydra.core.error.packaging.DuplicateModuleNameError"++_DuplicateModuleNameError_moduleName = Model.Name "moduleName"++-- | A definition whose local name does not match the expected naming convention. Term-level definitions must be camelCase; type-level definitions must be PascalCase.+data InvalidDefinitionNameError =+ InvalidDefinitionNameError {+ -- | The name of the module containing the definition+ invalidDefinitionNameErrorModuleName :: Packaging.ModuleName,+ -- | The definition name that violates the naming convention+ invalidDefinitionNameErrorName :: Model.Name,+ -- | The case convention the name should have followed (camel for term-level, pascal for type-level)+ invalidDefinitionNameErrorExpectedConvention :: Util.CaseConvention}+ deriving (Eq, Ord, Read, Show)++_InvalidDefinitionNameError = Model.Name "hydra.core.error.packaging.InvalidDefinitionNameError"++_InvalidDefinitionNameError_moduleName = Model.Name "moduleName"++_InvalidDefinitionNameError_name = Model.Name "name"++_InvalidDefinitionNameError_expectedConvention = Model.Name "expectedConvention"++-- | An error indicating that a module is invalid+data InvalidModuleError =+ -- | A union variant name that conflicts with another type definition when mapped to a target language+ InvalidModuleErrorConflictingVariantName ConflictingVariantNameError |+ -- | A definition whose name does not have the module's name as a prefix+ InvalidModuleErrorDefinitionNotInModuleName DefinitionNotInModuleNameError |+ -- | Two consecutive definitions in the definitions list that are not in alphabetical order+ InvalidModuleErrorDefinitionsOutOfOrder DefinitionsOutOfOrderError |+ -- | Two or more definitions in the same module share the same name+ InvalidModuleErrorDuplicateDefinitionName DuplicateDefinitionNameError |+ -- | A definition whose local name does not match the expected naming convention+ InvalidModuleErrorInvalidDefinitionName InvalidDefinitionNameError |+ -- | A module whose name does not match the module-name naming convention+ InvalidModuleErrorInvalidModuleNameConvention InvalidModuleNameConventionError |+ -- | A top-level definition lacking a description annotation+ InvalidModuleErrorMissingDocumentation MissingDocumentationError+ deriving (Eq, Ord, Read, Show)++_InvalidModuleError = Model.Name "hydra.core.error.packaging.InvalidModuleError"++_InvalidModuleError_conflictingVariantName = Model.Name "conflictingVariantName"++_InvalidModuleError_definitionNotInModuleName = Model.Name "definitionNotInModuleName"++_InvalidModuleError_definitionsOutOfOrder = Model.Name "definitionsOutOfOrder"++_InvalidModuleError_duplicateDefinitionName = Model.Name "duplicateDefinitionName"++_InvalidModuleError_invalidDefinitionName = Model.Name "invalidDefinitionName"++_InvalidModuleError_invalidModuleNameConvention = Model.Name "invalidModuleNameConvention"++_InvalidModuleError_missingDocumentation = Model.Name "missingDocumentation"++-- | A module whose name does not match the dotted-lowercase naming convention. Module names must be dot-separated lowercase segments, each starting with a letter, e.g. hydra.core.model or hydra.core.lib.lists.+data InvalidModuleNameConventionError =+ InvalidModuleNameConventionError {+ -- | The module name that violates the convention+ invalidModuleNameConventionErrorModuleName :: Packaging.ModuleName}+ deriving (Eq, Ord, Read, Show)++_InvalidModuleNameConventionError = Model.Name "hydra.core.error.packaging.InvalidModuleNameConventionError"++_InvalidModuleNameConventionError_moduleName = Model.Name "moduleName"++-- | An error indicating that a package is invalid+data InvalidPackageError =+ -- | Two module names that conflict when mapped to a target language+ InvalidPackageErrorConflictingModuleName ConflictingModuleNameError |+ -- | Two or more modules in the same package share the same name+ InvalidPackageErrorDuplicateModuleName DuplicateModuleNameError |+ -- | A module within the package is invalid+ InvalidPackageErrorInvalidModule InvalidModuleError |+ -- | A package whose name does not match the package-name naming convention+ InvalidPackageErrorInvalidPackageName InvalidPackageNameError |+ -- | A module namespace declared by more than one package+ InvalidPackageErrorModuleInMultiplePackages ModuleInMultiplePackagesError |+ -- | A module namespace that is a strict dotted-prefix of another module namespace in the same package+ InvalidPackageErrorNestedModuleName NestedModuleNameError |+ -- | A module references a name owned by another module that is not among its declared dependencies+ InvalidPackageErrorUndeclaredDependency UndeclaredDependencyError+ deriving (Eq, Ord, Read, Show)++_InvalidPackageError = Model.Name "hydra.core.error.packaging.InvalidPackageError"++_InvalidPackageError_conflictingModuleName = Model.Name "conflictingModuleName"++_InvalidPackageError_duplicateModuleName = Model.Name "duplicateModuleName"++_InvalidPackageError_invalidModule = Model.Name "invalidModule"++_InvalidPackageError_invalidPackageName = Model.Name "invalidPackageName"++_InvalidPackageError_moduleInMultiplePackages = Model.Name "moduleInMultiplePackages"++_InvalidPackageError_nestedModuleName = Model.Name "nestedModuleName"++_InvalidPackageError_undeclaredDependency = Model.Name "undeclaredDependency"++-- | A package whose name does not match the hyphen-separated lowercase naming convention. Package names must be hyphen-separated lowercase segments, each starting with a letter, e.g. hydra-kernel or hydra-python.+data InvalidPackageNameError =+ InvalidPackageNameError {+ -- | The package name that violates the convention+ invalidPackageNameErrorPackageName :: Packaging.PackageName}+ deriving (Eq, Ord, Read, Show)++_InvalidPackageNameError = Model.Name "hydra.core.error.packaging.InvalidPackageNameError"++_InvalidPackageNameError_packageName = Model.Name "packageName"++-- | A top-level definition whose term (or type, for type definitions) lacks a description annotation. Every definition in a Hydra module is expected to be wrapped in a doc "..." annotation at its top level.+data MissingDocumentationError =+ MissingDocumentationError {+ -- | The name of the module containing the undocumented definition+ missingDocumentationErrorModuleName :: Packaging.ModuleName,+ -- | The name of the undocumented definition+ missingDocumentationErrorName :: Model.Name}+ deriving (Eq, Ord, Read, Show)++_MissingDocumentationError = Model.Name "hydra.core.error.packaging.MissingDocumentationError"++_MissingDocumentationError_moduleName = Model.Name "moduleName"++_MissingDocumentationError_name = Model.Name "name"++-- | A module namespace declared by more than one package. Module-to-package routing requires each package's declared module set to partition the module universe; a namespace declared by two packages would otherwise be routed to one of them arbitrarily, with the other declaration silently ignored.+data ModuleInMultiplePackagesError =+ ModuleInMultiplePackagesError {+ -- | The module namespace declared by more than one package+ moduleInMultiplePackagesErrorModuleName :: Packaging.ModuleName,+ -- | The name of the first package declaring the module+ moduleInMultiplePackagesErrorFirstPackage :: Packaging.PackageName,+ -- | The name of the second package declaring the module+ moduleInMultiplePackagesErrorSecondPackage :: Packaging.PackageName}+ deriving (Eq, Ord, Read, Show)++_ModuleInMultiplePackagesError = Model.Name "hydra.core.error.packaging.ModuleInMultiplePackagesError"++_ModuleInMultiplePackagesError_moduleName = Model.Name "moduleName"++_ModuleInMultiplePackagesError_firstPackage = Model.Name "firstPackage"++_ModuleInMultiplePackagesError_secondPackage = Model.Name "secondPackage"++-- | A module namespace which is a strict dotted-prefix of another module namespace in the same package, e.g. hydra.core.codegen and hydra.core.codegen.docs. When two such namespaces coexist, a definition name that is prefix-valid for both modules cannot be unambiguously assigned to one.+data NestedModuleNameError =+ NestedModuleNameError {+ -- | The shorter namespace, a strict dotted-prefix of the inner namespace+ nestedModuleNameErrorOuter :: Packaging.ModuleName,+ -- | The longer namespace, which has the outer namespace as a strict dotted-prefix+ nestedModuleNameErrorInner :: Packaging.ModuleName}+ deriving (Eq, Ord, Read, Show)++_NestedModuleNameError = Model.Name "hydra.core.error.packaging.NestedModuleNameError"++_NestedModuleNameError_outer = Model.Name "outer"++_NestedModuleNameError_inner = Model.Name "inner"++-- | A module references a name owned by another module which is not among its declared moduleDependencies. Like a missing import: the reference may still resolve today via another module's transitive dependencies, but the declared dependency list no longer reflects what the module actually uses, and inference-time resolution is not guaranteed.+data UndeclaredDependencyError =+ UndeclaredDependencyError {+ -- | The name of the module containing the undeclared reference+ undeclaredDependencyErrorModuleName :: Packaging.ModuleName,+ -- | The free name referenced by the module's definitions+ undeclaredDependencyErrorReferencedName :: Model.Name,+ -- | The name of the module that actually defines the referenced name+ undeclaredDependencyErrorOwningModuleName :: Packaging.ModuleName}+ deriving (Eq, Ord, Read, Show)++_UndeclaredDependencyError = Model.Name "hydra.core.error.packaging.UndeclaredDependencyError"++_UndeclaredDependencyError_moduleName = Model.Name "moduleName"++_UndeclaredDependencyError_referencedName = Model.Name "referencedName"++_UndeclaredDependencyError_owningModuleName = Model.Name "owningModuleName"
@@ -0,0 +1,37 @@+-- Note: this is an automatically generated file. Do not edit.++-- | System-call error types++module Hydra.Core.Error.System where++import qualified Hydra.Core.File as File+import qualified Hydra.Core.Model as Model+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | A recoverable failure to launch a process or to perform a hydra.core.lib.system system call, named after the POSIX errno values the host reports. A child that launches successfully and then exits non-zero is not a SystemError; it is a ProcessResult with a non-zero exitCode+data SystemError =+ -- | POSIX ENOENT: the executable named by Command.program does not exist or is not found on PATH. Reported by the exec family (XSH, https://pubs.opengroup.org/onlinepubs/9799919799/functions/execve.html)+ SystemErrorCommandNotFound File.FilePath |+ -- | POSIX EACCES: the executable exists but is not executable, or a path component denies search permission+ SystemErrorPermissionDenied File.FilePath |+ -- | POSIX ENOENT or ENOTDIR raised by the implied chdir() to Command.workingDirectory+ SystemErrorInvalidWorkingDirectory File.FilePath |+ -- | The call was interrupted before the child produced a result (a portable abstraction over POSIX EINTR and host-level kills); the child's disposition is unknown+ SystemErrorInterrupted |+ -- | Any other failure, carrying the host-provided error message verbatim (covers errno values not modeled above, such as EMFILE, ENOMEM, or E2BIG)+ SystemErrorOther String+ deriving (Eq, Ord, Read, Show)++_SystemError = Model.Name "hydra.core.error.system.SystemError"++_SystemError_commandNotFound = Model.Name "commandNotFound"++_SystemError_permissionDenied = Model.Name "permissionDenied"++_SystemError_invalidWorkingDirectory = Model.Name "invalidWorkingDirectory"++_SystemError_interrupted = Model.Name "interrupted"++_SystemError_other = Model.Name "other"
@@ -0,0 +1,312 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Top-level error types for the Hydra kernel++module Hydra.Core.Errors where++import qualified Hydra.Core.Error.Checking as Checking+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | An error that occurred during decoding of a term+newtype DecodingError =+ DecodingError {+ unDecodingError :: String}+ deriving (Eq, Ord, Read, Show)++_DecodingError = Model.Name "hydra.core.errors.DecodingError"++-- | An empty list was encountered where a non-empty list was required+type EmptyListError = ()++_EmptyListError = Model.Name "hydra.core.errors.EmptyListError"++-- | An error of any kind, with kernel errors particularly differentiated+data Error =+ -- | A type checking error+ ErrorChecking Checking.CheckingError |+ -- | An error that occurred during decoding of a term+ ErrorDecoding DecodingError |+ -- | A duplicate binding name error+ ErrorDuplicateBinding ErrorModel.DuplicateBindingError |+ -- | A duplicate field name error+ ErrorDuplicateField ErrorModel.DuplicateFieldError |+ -- | An error that occurred while extracting a value from a term+ ErrorExtraction ExtractionError |+ -- | A type inference error+ ErrorInference InferenceError |+ -- | A literal value validation error+ ErrorInvalidLiteral ErrorModel.InvalidLiteralError |+ -- | Any other error+ ErrorOther OtherError |+ -- | A name-resolution error+ ErrorResolution ResolutionError |+ -- | A reference to an undefined field+ ErrorUndefinedField ErrorModel.UndefinedFieldError |+ -- | A reference to an undefined term variable+ ErrorUndefinedTermVariable ErrorModel.UndefinedTermVariableError |+ -- | A term variable whose type is not known+ ErrorUntypedTermVariable ErrorModel.UntypedTermVariableError |+ -- | An unexpected term variant+ ErrorUnexpectedTermVariant ErrorModel.UnexpectedTermVariantError |+ -- | An unexpected type variant+ ErrorUnexpectedTypeVariant ErrorModel.UnexpectedTypeVariantError |+ -- | A type unification error+ ErrorUnification UnificationError+ deriving (Eq, Ord, Read, Show)++_Error = Model.Name "hydra.core.errors.Error"++_Error_checking = Model.Name "checking"++_Error_decoding = Model.Name "decoding"++_Error_duplicateBinding = Model.Name "duplicateBinding"++_Error_duplicateField = Model.Name "duplicateField"++_Error_extraction = Model.Name "extraction"++_Error_inference = Model.Name "inference"++_Error_invalidLiteral = Model.Name "invalidLiteral"++_Error_other = Model.Name "other"++_Error_resolution = Model.Name "resolution"++_Error_undefinedField = Model.Name "undefinedField"++_Error_undefinedTermVariable = Model.Name "undefinedTermVariable"++_Error_untypedTermVariable = Model.Name "untypedTermVariable"++_Error_unexpectedTermVariant = Model.Name "unexpectedTermVariant"++_Error_unexpectedTypeVariant = Model.Name "unexpectedTypeVariant"++_Error_unification = Model.Name "unification"++-- | An error that occurred while extracting a typed value from a term+data ExtractionError =+ -- | An empty list was encountered where a non-empty list was required+ ExtractionErrorEmptyList EmptyListError |+ -- | Multiple let bindings were found with the same name+ ExtractionErrorMultipleBindings MultipleBindingsError |+ -- | Multiple record fields were found with the same field name+ ExtractionErrorMultipleFields MultipleFieldsError |+ -- | No field with the expected name was found in a record+ ExtractionErrorNoMatchingField NoMatchingFieldError |+ -- | No let binding with the expected name was found+ ExtractionErrorNoSuchBinding NoSuchBindingError |+ -- | A case statement did not contain enough cases to match the target+ ExtractionErrorNotEnoughCases NotEnoughCasesError |+ -- | A term, type, literal, or other value had an unexpected shape+ ExtractionErrorUnexpectedShape UnexpectedShapeError+ deriving (Eq, Ord, Read, Show)++_ExtractionError = Model.Name "hydra.core.errors.ExtractionError"++_ExtractionError_emptyList = Model.Name "emptyList"++_ExtractionError_multipleBindings = Model.Name "multipleBindings"++_ExtractionError_multipleFields = Model.Name "multipleFields"++_ExtractionError_noMatchingField = Model.Name "noMatchingField"++_ExtractionError_noSuchBinding = Model.Name "noSuchBinding"++_ExtractionError_notEnoughCases = Model.Name "notEnoughCases"++_ExtractionError_unexpectedShape = Model.Name "unexpectedShape"++-- | An error that occurred during type inference+data InferenceError =+ -- | A type checking error encountered during inference+ InferenceErrorChecking Checking.CheckingError |+ -- | A generic inference error carrying a message and a subterm path. Placeholder arm; sites should migrate to typed variants.+ InferenceErrorOther OtherInferenceError |+ -- | A unification failure encountered while inferring types+ InferenceErrorUnification UnificationInferenceError+ deriving (Eq, Ord, Read, Show)++_InferenceError = Model.Name "hydra.core.errors.InferenceError"++_InferenceError_checking = Model.Name "checking"++_InferenceError_other = Model.Name "other"++_InferenceError_unification = Model.Name "unification"++-- | Multiple let bindings with the same name were found+data MultipleBindingsError =+ MultipleBindingsError {+ -- | The binding name which was duplicated+ multipleBindingsErrorName :: Model.Name}+ deriving (Eq, Ord, Read, Show)++_MultipleBindingsError = Model.Name "hydra.core.errors.MultipleBindingsError"++_MultipleBindingsError_name = Model.Name "name"++-- | Multiple fields with the same name were found in a record+data MultipleFieldsError =+ MultipleFieldsError {+ -- | The field name which appeared more than once+ multipleFieldsErrorFieldName :: Model.Name}+ deriving (Eq, Ord, Read, Show)++_MultipleFieldsError = Model.Name "hydra.core.errors.MultipleFieldsError"++_MultipleFieldsError_fieldName = Model.Name "fieldName"++-- | No field with the expected name was present+data NoMatchingFieldError =+ NoMatchingFieldError {+ -- | The field name which was not found+ noMatchingFieldErrorFieldName :: Model.Name}+ deriving (Eq, Ord, Read, Show)++_NoMatchingFieldError = Model.Name "hydra.core.errors.NoMatchingFieldError"++_NoMatchingFieldError_fieldName = Model.Name "fieldName"++-- | No let binding with the expected name was present+data NoSuchBindingError =+ NoSuchBindingError {+ -- | The binding name which was not found+ noSuchBindingErrorName :: Model.Name}+ deriving (Eq, Ord, Read, Show)++_NoSuchBindingError = Model.Name "hydra.core.errors.NoSuchBindingError"++_NoSuchBindingError_name = Model.Name "name"++-- | No primitive function with the expected name was registered in the graph+data NoSuchPrimitiveError =+ NoSuchPrimitiveError {+ -- | The primitive name which was not found+ noSuchPrimitiveErrorName :: Model.Name}+ deriving (Eq, Ord, Read, Show)++_NoSuchPrimitiveError = Model.Name "hydra.core.errors.NoSuchPrimitiveError"++_NoSuchPrimitiveError_name = Model.Name "name"++-- | A case statement was missing a case for the requested variant+type NotEnoughCasesError = ()++_NotEnoughCasesError = Model.Name "hydra.core.errors.NotEnoughCasesError"++-- | Any other error+newtype OtherError =+ OtherError {+ unOtherError :: String}+ deriving (Eq, Ord, Read, Show)++_OtherError = Model.Name "hydra.core.errors.OtherError"++-- | A generic inference error: message + subterm path+data OtherInferenceError =+ OtherInferenceError {+ -- | The subterm path at which the error was observed+ otherInferenceErrorPath :: Paths.SubtermPath,+ -- | A human-readable error message+ otherInferenceErrorMessage :: String}+ deriving (Eq, Ord, Read, Show)++_OtherInferenceError = Model.Name "hydra.core.errors.OtherInferenceError"++_OtherInferenceError_path = Model.Name "path"++_OtherInferenceError_message = Model.Name "message"++-- | A generic resolution error: message+newtype OtherResolutionError =+ OtherResolutionError {+ unOtherResolutionError :: String}+ deriving (Eq, Ord, Read, Show)++_OtherResolutionError = Model.Name "hydra.core.errors.OtherResolutionError"++-- | An error that occurred while resolving a name, primitive, or record/union shape in a graph+data ResolutionError =+ -- | No binding with the expected name was found in the graph+ ResolutionErrorNoSuchBinding NoSuchBindingError |+ -- | No primitive function with the expected name was found in the graph+ ResolutionErrorNoSuchPrimitive NoSuchPrimitiveError |+ -- | No field with the expected name was present in a record or case statement+ ResolutionErrorNoMatchingField NoMatchingFieldError |+ -- | A generic resolution error carrying a message+ ResolutionErrorOther OtherResolutionError |+ -- | A term had a shape other than the one expected (e.g. a record, an injection)+ ResolutionErrorUnexpectedShape UnexpectedShapeError+ deriving (Eq, Ord, Read, Show)++_ResolutionError = Model.Name "hydra.core.errors.ResolutionError"++_ResolutionError_noSuchBinding = Model.Name "noSuchBinding"++_ResolutionError_noSuchPrimitive = Model.Name "noSuchPrimitive"++_ResolutionError_noMatchingField = Model.Name "noMatchingField"++_ResolutionError_other = Model.Name "other"++_ResolutionError_unexpectedShape = Model.Name "unexpectedShape"++-- | A term, type, literal, or related value had a shape other than the one expected+data UnexpectedShapeError =+ UnexpectedShapeError {+ -- | A description of the expected shape+ unexpectedShapeErrorExpected :: String,+ -- | A description of the shape actually encountered+ unexpectedShapeErrorActual :: String}+ deriving (Eq, Ord, Read, Show)++_UnexpectedShapeError = Model.Name "hydra.core.errors.UnexpectedShapeError"++_UnexpectedShapeError_expected = Model.Name "expected"++_UnexpectedShapeError_actual = Model.Name "actual"++-- | An error that occurred during type unification+data UnificationError =+ UnificationError {+ -- | The left-hand type in the unification+ unificationErrorLeftType :: Model.Type,+ -- | The right-hand type in the unification+ unificationErrorRightType :: Model.Type,+ -- | A human-readable error message+ unificationErrorMessage :: String}+ deriving (Eq, Ord, Read, Show)++_UnificationError = Model.Name "hydra.core.errors.UnificationError"++_UnificationError_leftType = Model.Name "leftType"++_UnificationError_rightType = Model.Name "rightType"++_UnificationError_message = Model.Name "message"++-- | A unification failure at a specific subterm locus during inference+data UnificationInferenceError =+ UnificationInferenceError {+ -- | The subterm path at which the unification failure was observed+ unificationInferenceErrorPath :: Paths.SubtermPath,+ -- | The underlying unification error+ unificationInferenceErrorCause :: UnificationError}+ deriving (Eq, Ord, Read, Show)++_UnificationInferenceError = Model.Name "hydra.core.errors.UnificationInferenceError"++_UnificationInferenceError_path = Model.Name "path"++_UnificationInferenceError_cause = Model.Name "cause"
@@ -0,0 +1,110 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Utilities for extracting values from JSON objects++module Hydra.Core.Extract.Json where++import qualified Hydra.Core.Ast as Ast+import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Diff as Diff+import qualified Hydra.Core.Docs as Docs+import qualified Hydra.Core.Error.Checking as Checking+import qualified Hydra.Core.Error.File as ErrorFile+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Error.Packaging as ErrorPackaging+import qualified Hydra.Core.Error.System as ErrorSystem+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Json.Model as JsonModel+import qualified Hydra.Core.Json.Writer as Writer+import qualified Hydra.Core.Overlay.Haskell.Lib.Eithers as Eithers+import qualified Hydra.Core.Overlay.Haskell.Lib.Maps as Maps+import qualified Hydra.Core.Overlay.Haskell.Lib.Optionals as Optionals+import qualified Hydra.Core.Overlay.Haskell.Lib.Strings as Strings+import qualified Hydra.Core.Markdown as Markdown+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Parsing as Parsing+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Query as Query+import qualified Hydra.Core.Regex as Regex+import qualified Hydra.Core.Relational as Relational+import qualified Hydra.Core.System as System+import qualified Hydra.Core.Tabular as Tabular+import qualified Hydra.Core.Testing as Testing+import qualified Hydra.Core.Time as Time+import qualified Hydra.Core.Topology as Topology+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Validation as Validation+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void+import qualified Data.Map as M++-- | Extract an array from a JSON value, failing if the value is not an array+expectArray :: JsonModel.Value -> Either String [JsonModel.Value]+expectArray value =+ case value of+ JsonModel.ValueArray v0 -> Right v0+ _ -> Left (Strings.concat2 (Strings.concat2 "expected " "JSON array") (Strings.concat2 " but found " (showValue value)))++-- | Extract a number from a JSON value, failing if the value is not a number+expectNumber :: JsonModel.Value -> Either String Sci.Scientific+expectNumber value =+ case value of+ JsonModel.ValueNumber v0 -> Right v0+ _ -> Left (Strings.concat2 (Strings.concat2 "expected " "JSON number") (Strings.concat2 " but found " (showValue value)))++-- | Extract an object from a JSON value as a name-keyed map, failing if the value is not an object. Field order is not preserved; lookups are by name.+expectObject :: JsonModel.Value -> Either String (M.Map String JsonModel.Value)+expectObject value =+ case value of+ JsonModel.ValueObject v0 -> Right (Maps.fromList v0)+ _ -> Left (Strings.concat2 (Strings.concat2 "expected " "JSON object") (Strings.concat2 " but found " (showValue value)))++-- | Extract a string from a JSON value, failing if the value is not a string+expectString :: JsonModel.Value -> Either String String+expectString value =+ case value of+ JsonModel.ValueString v0 -> Right v0+ _ -> Left (Strings.concat2 (Strings.concat2 "expected " "JSON string") (Strings.concat2 " but found " (showValue value)))++-- | Look up an optional field in a JSON object+opt :: Ord t0 => (t0 -> M.Map t0 t1 -> Maybe t1)+opt fname m = Maps.lookup fname m++-- | Look up an optional array field in a JSON object+optArray :: Ord t0 => (t0 -> M.Map t0 JsonModel.Value -> Either String (Maybe [JsonModel.Value]))+optArray fname m = Optionals.match (opt fname m) (Right Nothing) (\a -> Eithers.map (\x -> Just x) (expectArray a))++-- | Look up an optional string field in a JSON object+optString :: Ord t0 => (t0 -> M.Map t0 JsonModel.Value -> Either String (Maybe String))+optString fname m = Optionals.match (opt fname m) (Right Nothing) (\s -> Eithers.map (\x -> Just x) (expectString s))++-- | Look up a required field in a JSON object, failing if not found+require :: String -> M.Map String t0 -> Either String t0+require fname m =+ Optionals.match (Maps.lookup fname m) (Left (Strings.concat [+ "required attribute ",+ (showValue (JsonModel.ValueString fname)),+ " not found"])) (\value -> Right value)++-- | Look up a required array field in a JSON object+requireArray :: String -> M.Map String JsonModel.Value -> Either String [JsonModel.Value]+requireArray fname m = Eithers.bind (require fname m) expectArray++-- | Look up a required number field in a JSON object+requireNumber :: String -> M.Map String JsonModel.Value -> Either String Sci.Scientific+requireNumber fname m = Eithers.bind (require fname m) expectNumber++-- | Look up a required string field in a JSON object+requireString :: String -> M.Map String JsonModel.Value -> Either String String+requireString fname m = Eithers.bind (require fname m) expectString++-- | Show a JSON value as a string+showValue :: JsonModel.Value -> String+showValue value = Writer.printJson value
@@ -0,0 +1,643 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Extraction and validation for hydra.core.model types++module Hydra.Core.Extract.Model where++import qualified Hydra.Core.Ast as Ast+import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Diff as Diff+import qualified Hydra.Core.Docs as Docs+import qualified Hydra.Core.Error.Checking as Checking+import qualified Hydra.Core.Error.File as ErrorFile+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Error.Packaging as ErrorPackaging+import qualified Hydra.Core.Error.System as ErrorSystem+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Json.Model as JsonModel+import qualified Hydra.Core.Lexical as Lexical+import qualified Hydra.Core.Overlay.Haskell.Lib.Eithers as Eithers+import qualified Hydra.Core.Overlay.Haskell.Lib.Equality as Equality+import qualified Hydra.Core.Overlay.Haskell.Lib.Lists as Lists+import qualified Hydra.Core.Overlay.Haskell.Lib.Literals as Literals+import qualified Hydra.Core.Overlay.Haskell.Lib.Logic as Logic+import qualified Hydra.Core.Overlay.Haskell.Lib.Maps as Maps+import qualified Hydra.Core.Overlay.Haskell.Lib.Optionals as Optionals+import qualified Hydra.Core.Overlay.Haskell.Lib.Pairs as Pairs+import qualified Hydra.Core.Overlay.Haskell.Lib.Sets as Sets+import qualified Hydra.Core.Overlay.Haskell.Lib.Strings as Strings+import qualified Hydra.Core.Markdown as Markdown+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Parsing as Parsing+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Print.Errors as PrintErrors+import qualified Hydra.Core.Print.Model as PrintModel+import qualified Hydra.Core.Query as Query+import qualified Hydra.Core.Regex as Regex+import qualified Hydra.Core.Relational as Relational+import qualified Hydra.Core.Strip as Strip+import qualified Hydra.Core.System as System+import qualified Hydra.Core.Tabular as Tabular+import qualified Hydra.Core.Testing as Testing+import qualified Hydra.Core.Time as Time+import qualified Hydra.Core.Topology as Topology+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Validation as Validation+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void+import qualified Data.ByteString as B+import qualified Data.Int as I+import qualified Data.Map as M+import qualified Data.Set as S++-- | Extract an arbitrary-precision integer value from a term+bigint :: Graph.Graph -> Model.Term -> Either Errors.Error Integer+bigint graph t = Eithers.bind (literal graph t) (\l -> Eithers.bind (integerLiteral l) (\i -> bigintValue i))++-- | Extract a bigint value from an IntegerValue+bigintValue :: Model.IntegerValue -> Either Errors.Error Integer+bigintValue v =+ case v of+ Model.IntegerValueBigint v0 -> Right v0+ _ -> Left (Errors.ErrorExtraction (Errors.ExtractionErrorUnexpectedShape (Errors.UnexpectedShapeError {+ Errors.unexpectedShapeErrorExpected = "bigint",+ Errors.unexpectedShapeErrorActual = (PrintModel.integer v)})))++-- | Extract a binary data value from a term+binary :: Graph.Graph -> Model.Term -> Either Errors.Error B.ByteString+binary graph t = Eithers.bind (literal graph t) (\l -> binaryLiteral l)++-- | Extract a binary literal from a Literal value+binaryLiteral :: Model.Literal -> Either Errors.Error B.ByteString+binaryLiteral v =+ case v of+ Model.LiteralBinary v0 -> Right v0+ _ -> Left (Errors.ErrorExtraction (Errors.ExtractionErrorUnexpectedShape (Errors.UnexpectedShapeError {+ Errors.unexpectedShapeErrorExpected = "binary",+ Errors.unexpectedShapeErrorActual = (PrintModel.literal v)})))++-- | Extract a boolean value from a term+boolean :: Graph.Graph -> Model.Term -> Either Errors.Error Bool+boolean graph t = Eithers.bind (literal graph t) (\l -> booleanLiteral l)++-- | Extract a boolean literal from a Literal value+booleanLiteral :: Model.Literal -> Either Errors.Error Bool+booleanLiteral v =+ case v of+ Model.LiteralBoolean v0 -> Right v0+ _ -> Left (Errors.ErrorExtraction (Errors.ExtractionErrorUnexpectedShape (Errors.UnexpectedShapeError {+ Errors.unexpectedShapeErrorExpected = "boolean",+ Errors.unexpectedShapeErrorActual = (PrintModel.literal v)})))++-- | Extract case statement from a term+cases :: Model.Name -> Graph.Graph -> Model.Term -> Either Errors.Error Model.CaseStatement+cases name graph term0 =+ Eithers.bind (Lexical.stripAndDereferenceTerm graph term0) (\term -> case term of+ Model.TermCases v0 -> Logic.ifElse (Equality.equal (Model.unName (Model.caseStatementTypeName v0)) (Model.unName name)) (Right v0) (Left (Errors.ErrorExtraction (Errors.ExtractionErrorUnexpectedShape (Errors.UnexpectedShapeError {+ Errors.unexpectedShapeErrorExpected = (Strings.concat2 "case statement for type " (Model.unName name)),+ Errors.unexpectedShapeErrorActual = (PrintModel.term term)}))))+ _ -> Left (Errors.ErrorExtraction (Errors.ExtractionErrorUnexpectedShape (Errors.UnexpectedShapeError {+ Errors.unexpectedShapeErrorExpected = "case statement",+ Errors.unexpectedShapeErrorActual = (PrintModel.term term)}))))++-- | Extract an arbitrary-precision decimal value from a term+decimal :: Graph.Graph -> Model.Term -> Either Errors.Error Sci.Scientific+decimal graph t = Eithers.bind (literal graph t) (\l -> decimalLiteral l)++-- | Extract a decimal literal from a Literal value+decimalLiteral :: Model.Literal -> Either Errors.Error Sci.Scientific+decimalLiteral v =+ case v of+ Model.LiteralDecimal v0 -> Right v0+ _ -> Left (Errors.ErrorExtraction (Errors.ExtractionErrorUnexpectedShape (Errors.UnexpectedShapeError {+ Errors.unexpectedShapeErrorExpected = "decimal",+ Errors.unexpectedShapeErrorActual = (PrintModel.literal v)})))++-- | Decode an Either value using the provided left and right decoders+decodeEither :: (Graph.Graph -> Model.Term -> Either Errors.DecodingError t0) -> (Graph.Graph -> Model.Term -> Either Errors.DecodingError t1) -> Graph.Graph -> Model.Term -> Either Errors.DecodingError (Either t0 t1)+decodeEither leftDecoder rightDecoder g term =+ Eithers.bind (stripWithDecodingError g term) (\stripped -> case stripped of+ Model.TermEither v0 -> Eithers.either (\lv -> Eithers.map (\x -> Left x) (leftDecoder g lv)) (\rv -> Eithers.map (\x -> Right x) (rightDecoder g rv)) v0+ _ -> Left (Errors.DecodingError "expected either value"))++-- | Decode a list of elements using the provided element decoder+decodeList :: (Graph.Graph -> Model.Term -> Either Errors.DecodingError t0) -> Graph.Graph -> Model.Term -> Either Errors.DecodingError [t0]+decodeList elemDecoder g term =+ Eithers.bind (stripWithDecodingError g term) (\stripped -> case stripped of+ Model.TermList v0 -> Eithers.mapList (elemDecoder g) v0+ _ -> Left (Errors.DecodingError "expected list"))++-- | Decode a Map using the provided key and value decoders+decodeMap :: Ord t0 => ((Graph.Graph -> Model.Term -> Either Errors.DecodingError t0) -> (Graph.Graph -> Model.Term -> Either Errors.DecodingError t1) -> Graph.Graph -> Model.Term -> Either Errors.DecodingError (M.Map t0 t1))+decodeMap keyDecoder valDecoder g term =+ Eithers.bind (stripWithDecodingError g term) (\stripped -> case stripped of+ Model.TermMap v0 -> Eithers.map Maps.fromList (Eithers.mapList (\kv -> Eithers.bind (keyDecoder g (Pairs.first kv)) (\k -> Eithers.map (\v -> (k, v)) (valDecoder g (Pairs.second kv)))) (Maps.toList v0))+ _ -> Left (Errors.DecodingError "expected map"))++-- | Decode a Maybe value using the provided element decoder+decodeMaybe :: (Graph.Graph -> Model.Term -> Either Errors.DecodingError t0) -> Graph.Graph -> Model.Term -> Either Errors.DecodingError (Maybe t0)+decodeMaybe elemDecoder g term =+ Eithers.bind (stripWithDecodingError g term) (\stripped -> case stripped of+ Model.TermOptional v0 -> Eithers.mapOptional (elemDecoder g) v0+ _ -> Left (Errors.DecodingError "expected optional value"))++-- | Decode a Pair using the provided first and second decoders+decodePair :: (Graph.Graph -> Model.Term -> Either Errors.DecodingError t0) -> (Graph.Graph -> Model.Term -> Either Errors.DecodingError t1) -> Graph.Graph -> Model.Term -> Either Errors.DecodingError (t0, t1)+decodePair firstDecoder secondDecoder g term =+ Eithers.bind (stripWithDecodingError g term) (\stripped -> case stripped of+ Model.TermPair v0 -> Eithers.bind (firstDecoder g (Pairs.first v0)) (\f -> Eithers.map (\s -> (f, s)) (secondDecoder g (Pairs.second v0)))+ _ -> Left (Errors.DecodingError "expected pair"))++-- | Decode a Set using the provided element decoder+decodeSet :: Ord t0 => ((Graph.Graph -> Model.Term -> Either Errors.DecodingError t0) -> Graph.Graph -> Model.Term -> Either Errors.DecodingError (S.Set t0))+decodeSet elemDecoder g term =+ Eithers.bind (stripWithDecodingError g term) (\stripped -> case stripped of+ Model.TermSet v0 -> Eithers.map Sets.fromList (Eithers.mapList (elemDecoder g) (Sets.toList v0))+ _ -> Left (Errors.DecodingError "expected set"))++-- | Decode a unit value+decodeUnit :: Graph.Graph -> Model.Term -> Either Errors.DecodingError ()+decodeUnit g term =+ Eithers.bind (stripWithDecodingError g term) (\stripped -> case stripped of+ Model.TermUnit -> Right ()+ _ -> Left (Errors.DecodingError "expected a unit value"))++-- | Extract an either value from a term, applying functions to the left and right values+eitherTerm :: (Model.Term -> Either Errors.Error t0) -> (Model.Term -> Either Errors.Error t1) -> Graph.Graph -> Model.Term -> Either Errors.Error (Either t0 t1)+eitherTerm leftFun rightFun graph term0 =+ Eithers.bind (Lexical.stripAndDereferenceTerm graph term0) (\term -> case term of+ Model.TermEither v0 -> Eithers.either (\l -> Eithers.map (\x -> Left x) (leftFun l)) (\r -> Eithers.map (\x -> Right x) (rightFun r)) v0+ _ -> Left (Errors.ErrorExtraction (Errors.ExtractionErrorUnexpectedShape (Errors.UnexpectedShapeError {+ Errors.unexpectedShapeErrorExpected = "either value",+ Errors.unexpectedShapeErrorActual = (PrintModel.term term)}))))++-- | Extract the left and right types from an either type+eitherType :: Model.Type -> Either Errors.Error Model.EitherType+eitherType typ =++ let stripped = Strip.deannotateType typ+ in case stripped of+ Model.TypeEither v0 -> Right v0+ _ -> Left (Errors.ErrorExtraction (Errors.ExtractionErrorUnexpectedShape (Errors.UnexpectedShapeError {+ Errors.unexpectedShapeErrorExpected = "either type",+ Errors.unexpectedShapeErrorActual = (PrintModel.type_ typ)})))++-- | Extract a field value from a list of fields+field :: Model.Name -> (Model.Term -> Either Errors.Error t0) -> Graph.Graph -> [Model.Field] -> Either Errors.Error t0+field fname mapping graph fields =++ let matchingFields = Lists.filter (\f -> Equality.equal (Model.unName (Model.fieldName f)) (Model.unName fname)) fields+ noMatchErr =+ Left (Errors.ErrorExtraction (Errors.ExtractionErrorUnexpectedShape (Errors.UnexpectedShapeError {+ Errors.unexpectedShapeErrorExpected = (Strings.concat2 "field " (Model.unName fname)),+ Errors.unexpectedShapeErrorActual = "no matching field"})))+ in (Logic.ifElse (Lists.isEmpty matchingFields) noMatchErr (Logic.ifElse (Equality.equal (Lists.length matchingFields) 1) (Optionals.match (Lists.head matchingFields) noMatchErr (\mf -> Eithers.bind (Lexical.stripAndDereferenceTerm graph (Model.fieldTerm mf)) (\stripped -> mapping stripped))) (Left (Errors.ErrorExtraction (Errors.ExtractionErrorUnexpectedShape (Errors.UnexpectedShapeError {+ Errors.unexpectedShapeErrorExpected = "single field",+ Errors.unexpectedShapeErrorActual = (Strings.concat2 "multiple fields named " (Model.unName fname))}))))))++-- | Extract a 32-bit floating-point value from a term+float32 :: Graph.Graph -> Model.Term -> Either Errors.Error Float+float32 graph t = Eithers.bind (literal graph t) (\l -> Eithers.bind (floatLiteral l) (\f -> float32Value f))++-- | Extract a float32 value from a FloatValue+float32Value :: Model.FloatValue -> Either Errors.Error Float+float32Value v =+ case v of+ Model.FloatValueFloat32 v0 -> Right v0+ _ -> Left (Errors.ErrorExtraction (Errors.ExtractionErrorUnexpectedShape (Errors.UnexpectedShapeError {+ Errors.unexpectedShapeErrorExpected = "float32",+ Errors.unexpectedShapeErrorActual = (PrintModel.float v)})))++-- | Extract a 64-bit floating-point value from a term+float64 :: Graph.Graph -> Model.Term -> Either Errors.Error Double+float64 graph t = Eithers.bind (literal graph t) (\l -> Eithers.bind (floatLiteral l) (\f -> float64Value f))++-- | Extract a float64 value from a FloatValue+float64Value :: Model.FloatValue -> Either Errors.Error Double+float64Value v =+ case v of+ Model.FloatValueFloat64 v0 -> Right v0+ _ -> Left (Errors.ErrorExtraction (Errors.ExtractionErrorUnexpectedShape (Errors.UnexpectedShapeError {+ Errors.unexpectedShapeErrorExpected = "float64",+ Errors.unexpectedShapeErrorActual = (PrintModel.float v)})))++-- | Extract a floating-point literal from a Literal value+floatLiteral :: Model.Literal -> Either Errors.Error Model.FloatValue+floatLiteral lit =+ case lit of+ Model.LiteralFloat v0 -> Right v0+ _ -> Left (Errors.ErrorExtraction (Errors.ExtractionErrorUnexpectedShape (Errors.UnexpectedShapeError {+ Errors.unexpectedShapeErrorExpected = "floating-point value",+ Errors.unexpectedShapeErrorActual = (PrintModel.literal lit)})))++-- | Extract a float value from a term+floatValue :: Graph.Graph -> Model.Term -> Either Errors.Error Model.FloatValue+floatValue graph t = Eithers.bind (literal graph t) (\l -> floatLiteral l)++-- | Extract a function type from a type+functionType :: Model.Type -> Either Errors.Error Model.FunctionType+functionType typ =++ let stripped = Strip.deannotateType typ+ in case stripped of+ Model.TypeFunction v0 -> Right v0+ _ -> Left (Errors.ErrorExtraction (Errors.ExtractionErrorUnexpectedShape (Errors.UnexpectedShapeError {+ Errors.unexpectedShapeErrorExpected = "function type",+ Errors.unexpectedShapeErrorActual = (PrintModel.type_ typ)})))++-- | Extract a field from a union term+injection :: Model.Name -> Graph.Graph -> Model.Term -> Either Errors.Error Model.Field+injection expected graph term0 =+ Eithers.bind (Lexical.stripAndDereferenceTerm graph term0) (\term -> case term of+ Model.TermInject v0 -> Logic.ifElse (Equality.equal (Model.unName (Model.injectionTypeName v0)) (Model.unName expected)) (Right (Model.injectionField v0)) (Left (Errors.ErrorExtraction (Errors.ExtractionErrorUnexpectedShape (Errors.UnexpectedShapeError {+ Errors.unexpectedShapeErrorExpected = (Strings.concat2 "injection of type " (Model.unName expected)),+ Errors.unexpectedShapeErrorActual = (Model.unName (Model.injectionTypeName v0))}))))+ _ -> Left (Errors.ErrorExtraction (Errors.ExtractionErrorUnexpectedShape (Errors.UnexpectedShapeError {+ Errors.unexpectedShapeErrorExpected = "injection",+ Errors.unexpectedShapeErrorActual = (PrintModel.term term)}))))++-- | Extract a 16-bit signed integer value from a term+int16 :: Graph.Graph -> Model.Term -> Either Errors.Error I.Int16+int16 graph t = Eithers.bind (literal graph t) (\l -> Eithers.bind (integerLiteral l) (\i -> int16Value i))++-- | Extract an int16 value from an IntegerValue+int16Value :: Model.IntegerValue -> Either Errors.Error I.Int16+int16Value v =+ case v of+ Model.IntegerValueInt16 v0 -> Right v0+ _ -> Left (Errors.ErrorExtraction (Errors.ExtractionErrorUnexpectedShape (Errors.UnexpectedShapeError {+ Errors.unexpectedShapeErrorExpected = "int16",+ Errors.unexpectedShapeErrorActual = (PrintModel.integer v)})))++-- | Extract a 32-bit signed integer value from a term+int32 :: Graph.Graph -> Model.Term -> Either Errors.Error Int+int32 graph t = Eithers.bind (literal graph t) (\l -> Eithers.bind (integerLiteral l) (\i -> int32Value i))++-- | Extract an int32 value from an IntegerValue+int32Value :: Model.IntegerValue -> Either Errors.Error Int+int32Value v =+ case v of+ Model.IntegerValueInt32 v0 -> Right v0+ _ -> Left (Errors.ErrorExtraction (Errors.ExtractionErrorUnexpectedShape (Errors.UnexpectedShapeError {+ Errors.unexpectedShapeErrorExpected = "int32",+ Errors.unexpectedShapeErrorActual = (PrintModel.integer v)})))++-- | Extract a 64-bit signed integer value from a term+int64 :: Graph.Graph -> Model.Term -> Either Errors.Error I.Int64+int64 graph t = Eithers.bind (literal graph t) (\l -> Eithers.bind (integerLiteral l) (\i -> int64Value i))++-- | Extract an int64 value from an IntegerValue+int64Value :: Model.IntegerValue -> Either Errors.Error I.Int64+int64Value v =+ case v of+ Model.IntegerValueInt64 v0 -> Right v0+ _ -> Left (Errors.ErrorExtraction (Errors.ExtractionErrorUnexpectedShape (Errors.UnexpectedShapeError {+ Errors.unexpectedShapeErrorExpected = "int64",+ Errors.unexpectedShapeErrorActual = (PrintModel.integer v)})))++-- | Extract an 8-bit signed integer value from a term+int8 :: Graph.Graph -> Model.Term -> Either Errors.Error I.Int8+int8 graph t = Eithers.bind (literal graph t) (\l -> Eithers.bind (integerLiteral l) (\i -> int8Value i))++-- | Extract an int8 value from an IntegerValue+int8Value :: Model.IntegerValue -> Either Errors.Error I.Int8+int8Value v =+ case v of+ Model.IntegerValueInt8 v0 -> Right v0+ _ -> Left (Errors.ErrorExtraction (Errors.ExtractionErrorUnexpectedShape (Errors.UnexpectedShapeError {+ Errors.unexpectedShapeErrorExpected = "int8",+ Errors.unexpectedShapeErrorActual = (PrintModel.integer v)})))++-- | Extract an integer literal from a Literal value+integerLiteral :: Model.Literal -> Either Errors.Error Model.IntegerValue+integerLiteral lit =+ case lit of+ Model.LiteralInteger v0 -> Right v0+ _ -> Left (Errors.ErrorExtraction (Errors.ExtractionErrorUnexpectedShape (Errors.UnexpectedShapeError {+ Errors.unexpectedShapeErrorExpected = "integer value",+ Errors.unexpectedShapeErrorActual = (PrintModel.literal lit)})))++-- | Extract an integer value from a term+integerValue :: Graph.Graph -> Model.Term -> Either Errors.Error Model.IntegerValue+integerValue graph t = Eithers.bind (literal graph t) (\l -> integerLiteral l)++-- | Extract a lambda from a term+lambda :: Graph.Graph -> Model.Term -> Either Errors.Error Model.Lambda+lambda graph term0 =+ Eithers.bind (Lexical.stripAndDereferenceTerm graph term0) (\term -> case term of+ Model.TermLambda v0 -> Right v0+ _ -> Left (Errors.ErrorExtraction (Errors.ExtractionErrorUnexpectedShape (Errors.UnexpectedShapeError {+ Errors.unexpectedShapeErrorExpected = "lambda",+ Errors.unexpectedShapeErrorActual = (PrintModel.term term)}))))++-- | Extract the body of a lambda term+lambdaBody :: Graph.Graph -> Model.Term -> Either Errors.Error Model.Term+lambdaBody graph term = Eithers.map Model.lambdaBody (lambda graph term)++-- | Extract a let expression from a term+let_ :: Graph.Graph -> Model.Term -> Either Errors.Error Model.Let+let_ graph term0 =+ Eithers.bind (Lexical.stripAndDereferenceTerm graph term0) (\term -> case term of+ Model.TermLet v0 -> Right v0+ _ -> Left (Errors.ErrorExtraction (Errors.ExtractionErrorUnexpectedShape (Errors.UnexpectedShapeError {+ Errors.unexpectedShapeErrorExpected = "let term",+ Errors.unexpectedShapeErrorActual = (PrintModel.term term)}))))++-- | Extract a binding with the given name from a let term+letBinding :: String -> Graph.Graph -> Model.Term -> Either Errors.Error Model.Term+letBinding n graph term =++ let name = Model.Name n+ in (Eithers.bind (let_ graph term) (\letExpr ->+ let matchingBindings =+ Lists.filter (\b -> Equality.equal (Model.unName (Model.bindingName b)) (Model.unName name)) (Model.letBindings letExpr)+ noBindingErr =+ Left (Errors.ErrorExtraction (Errors.ExtractionErrorNoSuchBinding (Errors.NoSuchBindingError {+ Errors.noSuchBindingErrorName = name})))+ in (Logic.ifElse (Lists.isEmpty matchingBindings) noBindingErr (Logic.ifElse (Equality.equal (Lists.length matchingBindings) 1) (Optionals.match (Lists.head matchingBindings) noBindingErr (\b -> Right (Model.bindingTerm b))) (Left (Errors.ErrorExtraction (Errors.ExtractionErrorMultipleBindings (Errors.MultipleBindingsError {+ Errors.multipleBindingsErrorName = name}))))))))++-- | Extract a list of terms from a term+list :: Graph.Graph -> Model.Term -> Either Errors.Error [Model.Term]+list graph term =+ Eithers.bind (Lexical.stripAndDereferenceTerm graph term) (\stripped -> case stripped of+ Model.TermList v0 -> Right v0+ _ -> Left (Errors.ErrorExtraction (Errors.ExtractionErrorUnexpectedShape (Errors.UnexpectedShapeError {+ Errors.unexpectedShapeErrorExpected = "list",+ Errors.unexpectedShapeErrorActual = (PrintModel.term stripped)}))))++-- | Extract a list of values from a term, mapping a function over each element+listOf :: (Model.Term -> Either Errors.Error t0) -> Graph.Graph -> Model.Term -> Either Errors.Error [t0]+listOf f graph term = Eithers.bind (list graph term) (\els -> Eithers.mapList f els)++-- | Extract the element type from a list type+listType :: Model.Type -> Either Errors.Error Model.Type+listType typ =++ let stripped = Strip.deannotateType typ+ in case stripped of+ Model.TypeList v0 -> Right v0+ _ -> Left (Errors.ErrorExtraction (Errors.ExtractionErrorUnexpectedShape (Errors.UnexpectedShapeError {+ Errors.unexpectedShapeErrorExpected = "list type",+ Errors.unexpectedShapeErrorActual = (PrintModel.type_ typ)})))++-- | Extract a literal value from a term+literal :: Graph.Graph -> Model.Term -> Either Errors.Error Model.Literal+literal graph term0 =+ Eithers.bind (Lexical.stripAndDereferenceTerm graph term0) (\term -> case term of+ Model.TermLiteral v0 -> Right v0+ _ -> Left (Errors.ErrorExtraction (Errors.ExtractionErrorUnexpectedShape (Errors.UnexpectedShapeError {+ Errors.unexpectedShapeErrorExpected = "literal",+ Errors.unexpectedShapeErrorActual = (PrintModel.term term)}))))++-- | Extract a map of key-value pairs from a term, mapping functions over each key and value+map :: Ord t0 => ((Model.Term -> Either Errors.Error t0) -> (Model.Term -> Either Errors.Error t1) -> Graph.Graph -> Model.Term -> Either Errors.Error (M.Map t0 t1))+map fk fv graph term0 =++ let pair =+ \kvPair ->+ let kterm = Pairs.first kvPair+ vterm = Pairs.second kvPair+ in (Eithers.bind (fk kterm) (\kval -> Eithers.bind (fv vterm) (\vval -> Right (kval, vval))))+ in (Eithers.bind (Lexical.stripAndDereferenceTerm graph term0) (\term -> case term of+ Model.TermMap v0 -> Eithers.map Maps.fromList (Eithers.mapList pair (Maps.toList v0))+ _ -> Left (Errors.ErrorExtraction (Errors.ExtractionErrorUnexpectedShape (Errors.UnexpectedShapeError {+ Errors.unexpectedShapeErrorExpected = "map",+ Errors.unexpectedShapeErrorActual = (PrintModel.term term)})))))++-- | Extract the key and value types from a map type+mapType :: Model.Type -> Either Errors.Error Model.MapType+mapType typ =++ let stripped = Strip.deannotateType typ+ in case stripped of+ Model.TypeMap v0 -> Right v0+ _ -> Left (Errors.ErrorExtraction (Errors.ExtractionErrorUnexpectedShape (Errors.UnexpectedShapeError {+ Errors.unexpectedShapeErrorExpected = "map type",+ Errors.unexpectedShapeErrorActual = (PrintModel.type_ typ)})))++-- | Ensure a function has the expected number of arguments+nArgs :: Model.Name -> Int -> [t0] -> Either Errors.Error ()+nArgs name n args =+ Logic.ifElse (Equality.equal (Lists.length args) n) (Right ()) (Left (Errors.ErrorExtraction (Errors.ExtractionErrorUnexpectedShape (Errors.UnexpectedShapeError {+ Errors.unexpectedShapeErrorExpected = (Strings.concat [+ Literals.printInt32 n,+ " arguments to primitive ",+ (Literals.printString (Model.unName name))]),+ Errors.unexpectedShapeErrorActual = (Literals.printInt32 (Lists.length args))}))))++-- | Extract an optional value from a term, applying a function to the value if present+optionalTerm :: (Model.Term -> Either Errors.Error t0) -> Graph.Graph -> Model.Term -> Either Errors.Error (Maybe t0)+optionalTerm f graph term0 =+ Eithers.bind (Lexical.stripAndDereferenceTerm graph term0) (\term -> case term of+ Model.TermOptional v0 -> Optionals.match v0 (Right Nothing) (\t -> Eithers.map Optionals.given (f t))+ _ -> Left (Errors.ErrorExtraction (Errors.ExtractionErrorUnexpectedShape (Errors.UnexpectedShapeError {+ Errors.unexpectedShapeErrorExpected = "optional value",+ Errors.unexpectedShapeErrorActual = (PrintModel.term term)}))))++-- | Extract the base type from an optional type+optionalType :: Model.Type -> Either Errors.Error Model.Type+optionalType typ =++ let stripped = Strip.deannotateType typ+ in case stripped of+ Model.TypeOptional v0 -> Right v0+ _ -> Left (Errors.ErrorExtraction (Errors.ExtractionErrorUnexpectedShape (Errors.UnexpectedShapeError {+ Errors.unexpectedShapeErrorExpected = "optional type",+ Errors.unexpectedShapeErrorActual = (PrintModel.type_ typ)})))++-- | Extract a pair of values from a term, applying functions to each component+pair :: (Model.Term -> Either Errors.Error t0) -> (Model.Term -> Either Errors.Error t1) -> Graph.Graph -> Model.Term -> Either Errors.Error (t0, t1)+pair kf vf graph term0 =+ Eithers.bind (Lexical.stripAndDereferenceTerm graph term0) (\term -> case term of+ Model.TermPair v0 -> Eithers.bind (kf (Pairs.first v0)) (\kVal -> Eithers.bind (vf (Pairs.second v0)) (\vVal -> Right (kVal, vVal)))+ _ -> Left (Errors.ErrorExtraction (Errors.ExtractionErrorUnexpectedShape (Errors.UnexpectedShapeError {+ Errors.unexpectedShapeErrorExpected = "pair",+ Errors.unexpectedShapeErrorActual = (PrintModel.term term)}))))++-- | Extract a record's fields from a term+record :: Model.Name -> Graph.Graph -> Model.Term -> Either Errors.Error [Model.Field]+record expected graph term0 =+ Eithers.bind (termRecord graph term0) (\record -> Logic.ifElse (Equality.equal (Model.recordTypeName record) expected) (Right (Model.recordFields record)) (Left (Errors.ErrorExtraction (Errors.ExtractionErrorUnexpectedShape (Errors.UnexpectedShapeError {+ Errors.unexpectedShapeErrorExpected = (Strings.concat2 "record of type " (Model.unName expected)),+ Errors.unexpectedShapeErrorActual = (Model.unName (Model.recordTypeName record))})))))++-- | Extract the field types from a record type+recordType :: t0 -> Model.Type -> Either Errors.Error [Model.FieldType]+recordType ename typ =++ let stripped = Strip.deannotateType typ+ in case stripped of+ Model.TypeRecord v0 -> Right v0+ _ -> Left (Errors.ErrorExtraction (Errors.ExtractionErrorUnexpectedShape (Errors.UnexpectedShapeError {+ Errors.unexpectedShapeErrorExpected = "record type",+ Errors.unexpectedShapeErrorActual = (PrintModel.type_ typ)})))++-- | Require a field from a record's field map and decode it+requireField :: String -> (t0 -> t1 -> Either Errors.DecodingError t2) -> M.Map Model.Name t1 -> t0 -> Either Errors.DecodingError t2+requireField fieldName decoder fieldMap g =+ Optionals.match (Maps.lookup (Model.Name fieldName) fieldMap) (Left (Errors.DecodingError (Strings.concat [+ "missing field ",+ fieldName,+ " in record"]))) (\fieldTerm -> decoder g fieldTerm)++-- | Extract a set of terms from a term+set :: Graph.Graph -> Model.Term -> Either Errors.Error (S.Set Model.Term)+set graph term =+ Eithers.bind (Lexical.stripAndDereferenceTerm graph term) (\stripped -> case stripped of+ Model.TermSet v0 -> Right v0+ _ -> Left (Errors.ErrorExtraction (Errors.ExtractionErrorUnexpectedShape (Errors.UnexpectedShapeError {+ Errors.unexpectedShapeErrorExpected = "set",+ Errors.unexpectedShapeErrorActual = (PrintModel.term stripped)}))))++-- | Extract a set of values from a term, mapping a function over each element+setOf :: Ord t0 => ((Model.Term -> Either Errors.Error t0) -> Graph.Graph -> Model.Term -> Either Errors.Error (S.Set t0))+setOf f graph term = Eithers.bind (set graph term) (\els -> Eithers.mapSet f els)++-- | Extract the element type from a set type+setType :: Model.Type -> Either Errors.Error Model.Type+setType typ =++ let stripped = Strip.deannotateType typ+ in case stripped of+ Model.TypeSet v0 -> Right v0+ _ -> Left (Errors.ErrorExtraction (Errors.ExtractionErrorUnexpectedShape (Errors.UnexpectedShapeError {+ Errors.unexpectedShapeErrorExpected = "set type",+ Errors.unexpectedShapeErrorActual = (PrintModel.type_ typ)})))++-- | Extract a string value from a term+string :: Graph.Graph -> Model.Term -> Either Errors.Error String+string graph t = Eithers.bind (literal graph t) (\l -> stringLiteral l)++-- | Extract a string literal from a Literal value+stringLiteral :: Model.Literal -> Either Errors.Error String+stringLiteral v =+ case v of+ Model.LiteralString v0 -> Right v0+ _ -> Left (Errors.ErrorExtraction (Errors.ExtractionErrorUnexpectedShape (Errors.UnexpectedShapeError {+ Errors.unexpectedShapeErrorExpected = "string",+ Errors.unexpectedShapeErrorActual = (PrintModel.literal v)})))++-- | Strip annotations and dereference variables, returning Either DecodingError Term+stripWithDecodingError :: Graph.Graph -> Model.Term -> Either Errors.DecodingError Model.Term+stripWithDecodingError g term =+ Eithers.bimap (\_e -> Errors.DecodingError (PrintErrors.error _e)) (\x -> x) (Lexical.stripAndDereferenceTermEither g term)++-- | Extract a record from a term+termRecord :: Graph.Graph -> Model.Term -> Either Errors.Error Model.Record+termRecord graph term0 =+ Eithers.bind (Lexical.stripAndDereferenceTerm graph term0) (\term -> case term of+ Model.TermRecord v0 -> Right v0+ _ -> Left (Errors.ErrorExtraction (Errors.ExtractionErrorUnexpectedShape (Errors.UnexpectedShapeError {+ Errors.unexpectedShapeErrorExpected = "record",+ Errors.unexpectedShapeErrorActual = (PrintModel.term term)}))))++-- | Convert a Record's fields to a Map from Name to Term+toFieldMap :: Model.Record -> M.Map Model.Name Model.Term+toFieldMap record = Maps.fromList (Lists.map (\f -> (Model.fieldName f, (Model.fieldTerm f))) (Model.recordFields record))++-- | Extract a 16-bit unsigned integer value from a term+uint16 :: Graph.Graph -> Model.Term -> Either Errors.Error Int+uint16 graph t = Eithers.bind (literal graph t) (\l -> Eithers.bind (integerLiteral l) (\i -> uint16Value i))++-- | Extract a uint16 value from an IntegerValue+uint16Value :: Model.IntegerValue -> Either Errors.Error Int+uint16Value v =+ case v of+ Model.IntegerValueUint16 v0 -> Right v0+ _ -> Left (Errors.ErrorExtraction (Errors.ExtractionErrorUnexpectedShape (Errors.UnexpectedShapeError {+ Errors.unexpectedShapeErrorExpected = "uint16",+ Errors.unexpectedShapeErrorActual = (PrintModel.integer v)})))++-- | Extract a 32-bit unsigned integer value from a term+uint32 :: Graph.Graph -> Model.Term -> Either Errors.Error I.Int64+uint32 graph t = Eithers.bind (literal graph t) (\l -> Eithers.bind (integerLiteral l) (\i -> uint32Value i))++-- | Extract a uint32 value from an IntegerValue+uint32Value :: Model.IntegerValue -> Either Errors.Error I.Int64+uint32Value v =+ case v of+ Model.IntegerValueUint32 v0 -> Right v0+ _ -> Left (Errors.ErrorExtraction (Errors.ExtractionErrorUnexpectedShape (Errors.UnexpectedShapeError {+ Errors.unexpectedShapeErrorExpected = "uint32",+ Errors.unexpectedShapeErrorActual = (PrintModel.integer v)})))++-- | Extract a 64-bit unsigned integer value from a term+uint64 :: Graph.Graph -> Model.Term -> Either Errors.Error Integer+uint64 graph t = Eithers.bind (literal graph t) (\l -> Eithers.bind (integerLiteral l) (\i -> uint64Value i))++-- | Extract a uint64 value from an IntegerValue+uint64Value :: Model.IntegerValue -> Either Errors.Error Integer+uint64Value v =+ case v of+ Model.IntegerValueUint64 v0 -> Right v0+ _ -> Left (Errors.ErrorExtraction (Errors.ExtractionErrorUnexpectedShape (Errors.UnexpectedShapeError {+ Errors.unexpectedShapeErrorExpected = "uint64",+ Errors.unexpectedShapeErrorActual = (PrintModel.integer v)})))++-- | Extract an 8-bit unsigned integer value from a term+uint8 :: Graph.Graph -> Model.Term -> Either Errors.Error I.Int16+uint8 graph t = Eithers.bind (literal graph t) (\l -> Eithers.bind (integerLiteral l) (\i -> uint8Value i))++-- | Extract a uint8 value from an IntegerValue+uint8Value :: Model.IntegerValue -> Either Errors.Error I.Int16+uint8Value v =+ case v of+ Model.IntegerValueUint8 v0 -> Right v0+ _ -> Left (Errors.ErrorExtraction (Errors.ExtractionErrorUnexpectedShape (Errors.UnexpectedShapeError {+ Errors.unexpectedShapeErrorExpected = "uint8",+ Errors.unexpectedShapeErrorActual = (PrintModel.integer v)})))++-- | Extract the field types from a union type+unionType :: t0 -> Model.Type -> Either Errors.Error [Model.FieldType]+unionType ename typ =++ let stripped = Strip.deannotateType typ+ in case stripped of+ Model.TypeUnion v0 -> Right v0+ _ -> Left (Errors.ErrorExtraction (Errors.ExtractionErrorUnexpectedShape (Errors.UnexpectedShapeError {+ Errors.unexpectedShapeErrorExpected = "union type",+ Errors.unexpectedShapeErrorActual = (PrintModel.type_ typ)})))++-- | Extract a unit value from a term+unit :: Model.Term -> Either Errors.Error ()+unit term =+ case term of+ Model.TermUnit -> Right ()+ _ -> Left (Errors.ErrorExtraction (Errors.ExtractionErrorUnexpectedShape (Errors.UnexpectedShapeError {+ Errors.unexpectedShapeErrorExpected = "unit",+ Errors.unexpectedShapeErrorActual = (PrintModel.term term)})))++-- | Extract a unit variant (a variant with an empty record value) from a union term+unitVariant :: Model.Name -> Graph.Graph -> Model.Term -> Either Errors.Error Model.Name+unitVariant tname graph term =+ Eithers.bind (injection tname graph term) (\field -> Eithers.bind (unit (Model.fieldTerm field)) (\ignored -> Right (Model.fieldName field)))++-- | Extract the wrapped value from a wrapped term+wrap :: Model.Name -> Graph.Graph -> Model.Term -> Either Errors.Error Model.Term+wrap expected graph term0 =+ Eithers.bind (Lexical.stripAndDereferenceTerm graph term0) (\term -> case term of+ Model.TermWrap v0 -> Logic.ifElse (Equality.equal (Model.unName (Model.wrappedTermTypeName v0)) (Model.unName expected)) (Right (Model.wrappedTermBody v0)) (Left (Errors.ErrorExtraction (Errors.ExtractionErrorUnexpectedShape (Errors.UnexpectedShapeError {+ Errors.unexpectedShapeErrorExpected = (Strings.concat2 "wrapper of type " (Model.unName expected)),+ Errors.unexpectedShapeErrorActual = (Model.unName (Model.wrappedTermTypeName v0))}))))+ _ -> Left (Errors.ErrorExtraction (Errors.ExtractionErrorUnexpectedShape (Errors.UnexpectedShapeError {+ Errors.unexpectedShapeErrorExpected = (Strings.concat2 (Strings.concat2 "wrap(" (Model.unName expected)) ")"),+ Errors.unexpectedShapeErrorActual = (PrintModel.term term)}))))++-- | Extract the wrapped type from a wrapper type+wrappedType :: t0 -> Model.Type -> Either Errors.Error Model.Type+wrappedType ename typ =++ let stripped = Strip.deannotateType typ+ in case stripped of+ Model.TypeWrap v0 -> Right v0+ _ -> Left (Errors.ErrorExtraction (Errors.ExtractionErrorUnexpectedShape (Errors.UnexpectedShapeError {+ Errors.unexpectedShapeErrorExpected = "wrapped type",+ Errors.unexpectedShapeErrorActual = (PrintModel.type_ typ)})))
@@ -0,0 +1,52 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Extraction and validation for hydra.core.util types++module Hydra.Core.Extract.Util where++import qualified Hydra.Core.Ast as Ast+import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Diff as Diff+import qualified Hydra.Core.Docs as Docs+import qualified Hydra.Core.Error.Checking as Checking+import qualified Hydra.Core.Error.File as ErrorFile+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Error.Packaging as ErrorPackaging+import qualified Hydra.Core.Error.System as ErrorSystem+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.Extract.Model as ExtractModel+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Json.Model as JsonModel+import qualified Hydra.Core.Overlay.Haskell.Lib.Eithers as Eithers+import qualified Hydra.Core.Overlay.Haskell.Lib.Equality as Equality+import qualified Hydra.Core.Overlay.Haskell.Lib.Logic as Logic+import qualified Hydra.Core.Markdown as Markdown+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Parsing as Parsing+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Print.Errors as PrintErrors+import qualified Hydra.Core.Query as Query+import qualified Hydra.Core.Regex as Regex+import qualified Hydra.Core.Relational as Relational+import qualified Hydra.Core.System as System+import qualified Hydra.Core.Tabular as Tabular+import qualified Hydra.Core.Testing as Testing+import qualified Hydra.Core.Time as Time+import qualified Hydra.Core.Topology as Topology+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Validation as Validation+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | Extract a comparison from a term+comparison :: t0 -> Graph.Graph -> Model.Term -> Either Errors.Error Util.Comparison+comparison cx graph term =+ Eithers.bind (ExtractModel.unitVariant (Model.Name "hydra.core.util.Comparison") graph term) (\fname -> Logic.ifElse (Equality.equal (Model.unName fname) "equalTo") (Right Util.ComparisonEqualTo) (Logic.ifElse (Equality.equal (Model.unName fname) "lessThan") (Right Util.ComparisonLessThan) (Logic.ifElse (Equality.equal (Model.unName fname) "greaterThan") (Right Util.ComparisonGreaterThan) (Left (Errors.ErrorExtraction (Errors.ExtractionErrorUnexpectedShape (Errors.UnexpectedShapeError {+ Errors.unexpectedShapeErrorExpected = "comparison",+ Errors.unexpectedShapeErrorActual = (Model.unName fname)})))))))
@@ -0,0 +1,89 @@+-- Note: this is an automatically generated file. Do not edit.++-- | A model for file-system paths and metadata. Several types here are drawn from the POSIX <sys/stat.h> specification; see https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/sys_stat.h.html++module Hydra.Core.File where++import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Time as Time+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void+import qualified Data.Int as I++-- | A file extension (without the dot), e.g. "json" or "py"+newtype FileExtension =+ FileExtension {+ unFileExtension :: String}+ deriving (Eq, Ord, Read, Show)++_FileExtension = Model.Name "hydra.core.file.FileExtension"++-- | A host file-system path; a POSIX "pathname" (XBD section 3.254), i.e. a string used to identify a file. Named FilePath rather than Pathname so that the kernel type is self-describing and distinct from Hydra's other notions of paths+newtype FilePath =+ FilePath {+ unFilePath :: String}+ deriving (Eq, Ord, Read, Show)++_FilePath = Model.Name "hydra.core.file.FilePath"++-- | Metadata about a file, based on the POSIX struct stat. Only the portable, cross-platform subset of struct stat is modeled here; the following Unix-specific fields are omitted for now: st_dev (device ID), st_ino (inode number), st_mode permission bits (only the file type bits are kept, as fileType), st_nlink (hard link count), st_uid (owner user ID), st_gid (owner group ID), st_rdev (device ID for special files), st_blksize (preferred I/O block size), and st_blocks (number of blocks allocated). See <sys/stat.h> (https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/sys_stat.h.html)+data FileStatus =+ FileStatus {+ -- | st_mode (file type bits) / the type of the file+ fileStatusFileType :: FileType,+ -- | st_size / the size of the file in bytes. Well-defined for regular files and symbolic links; implementation-defined for other file types+ fileStatusSize :: I.Int64,+ -- | st_mtim / the time of last data modification+ fileStatusModificationTime :: Time.Timespec,+ -- | st_atim / the time of last data access, if available. Optional, as it is unreliable or untracked on some filesystems and platforms (e.g. noatime mounts)+ fileStatusAccessTime :: (Maybe Time.Timespec),+ -- | st_ctim / the time of last file status change, if available. Optional, as this POSIX-specific notion does not map onto all platforms+ fileStatusStatusChangeTime :: (Maybe Time.Timespec)}+ deriving (Eq, Ord, Read, Show)++_FileStatus = Model.Name "hydra.core.file.FileStatus"++_FileStatus_fileType = Model.Name "fileType"++_FileStatus_size = Model.Name "size"++_FileStatus_modificationTime = Model.Name "modificationTime"++_FileStatus_accessTime = Model.Name "accessTime"++_FileStatus_statusChangeTime = Model.Name "statusChangeTime"++-- | An enumeration of POSIX file types, following the file type macros of <sys/stat.h>+data FileType =+ -- | S_IFBLK / block special: a block special file (e.g. a disk device)+ FileTypeBlock |+ -- | S_IFCHR / character special: a character special file (e.g. a terminal device)+ FileTypeCharacter |+ -- | S_IFDIR / directory: a directory+ FileTypeDirectory |+ -- | S_IFIFO / FIFO special: a named pipe (FIFO)+ FileTypeFifo |+ -- | S_IFREG / regular: a regular file+ FileTypeRegular |+ -- | S_IFLNK / symbolic link: a symbolic link+ FileTypeLink |+ -- | S_IFSOCK / socket: a socket+ FileTypeSocket+ deriving (Eq, Ord, Read, Show)++_FileType = Model.Name "hydra.core.file.FileType"++_FileType_block = Model.Name "block"++_FileType_character = Model.Name "character"++_FileType_directory = Model.Name "directory"++_FileType_fifo = Model.Name "fifo"++_FileType_regular = Model.Name "regular"++_FileType_link = Model.Name "link"++_FileType_socket = Model.Name "socket"
@@ -0,0 +1,241 @@+-- Note: this is an automatically generated file. Do not edit.++-- | String formatting types and functions.++module Hydra.Core.Formatting where++import qualified Hydra.Core.Ast as Ast+import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Diff as Diff+import qualified Hydra.Core.Docs as Docs+import qualified Hydra.Core.Error.Checking as Checking+import qualified Hydra.Core.Error.File as ErrorFile+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Error.Packaging as ErrorPackaging+import qualified Hydra.Core.Error.System as ErrorSystem+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Json.Model as JsonModel+import qualified Hydra.Core.Overlay.Haskell.Lib.Chars as Chars+import qualified Hydra.Core.Overlay.Haskell.Lib.Equality as Equality+import qualified Hydra.Core.Overlay.Haskell.Lib.Lists as Lists+import qualified Hydra.Core.Overlay.Haskell.Lib.Logic as Logic+import qualified Hydra.Core.Overlay.Haskell.Lib.Maps as Maps+import qualified Hydra.Core.Overlay.Haskell.Lib.Math as Math+import qualified Hydra.Core.Overlay.Haskell.Lib.Optionals as Optionals+import qualified Hydra.Core.Overlay.Haskell.Lib.Ordering as Ordering+import qualified Hydra.Core.Overlay.Haskell.Lib.Pairs as Pairs+import qualified Hydra.Core.Overlay.Haskell.Lib.Sets as Sets+import qualified Hydra.Core.Overlay.Haskell.Lib.Strings as Strings+import qualified Hydra.Core.Markdown as Markdown+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Parsing as Parsing+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Query as Query+import qualified Hydra.Core.Regex as Regex+import qualified Hydra.Core.Relational as Relational+import qualified Hydra.Core.System as System+import qualified Hydra.Core.Tabular as Tabular+import qualified Hydra.Core.Testing as Testing+import qualified Hydra.Core.Time as Time+import qualified Hydra.Core.Topology as Topology+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Validation as Validation+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void+import qualified Data.Set as S++-- | Capitalize the first letter of a string+capitalize :: String -> String+capitalize = mapFirstLetter Strings.toUpper++-- | Convert a string from one case convention to another+convertCase :: Util.CaseConvention -> Util.CaseConvention -> String -> String+convertCase from to original =++ let parts =++ let byCaps =++ let splitOnUppercase =+ \acc -> \c -> Lists.concat2 (Logic.ifElse (Chars.isUpper c) [+ []] []) (Optionals.withDefault acc (Optionals.map (\uc -> Lists.cons (Lists.cons c (Pairs.first uc)) (Pairs.second uc)) (Lists.uncons acc)))+ in (Lists.map Strings.fromList (Lists.foldl splitOnUppercase [+ []] (Lists.reverse (Strings.toList (decapitalize original)))))+ byUnderscores = Strings.splitOn "_" original+ byDashes = Strings.splitOn "-" original+ in case from of+ Util.CaseConventionCamel -> byCaps+ Util.CaseConventionPascal -> byCaps+ Util.CaseConventionLowerSnake -> byUnderscores+ Util.CaseConventionUpperSnake -> byUnderscores+ Util.CaseConventionUpperDashed -> byDashes+ in case to of+ Util.CaseConventionCamel -> decapitalize (Strings.concat (Lists.map (\arg_ -> capitalize (Strings.toLower arg_)) parts))+ Util.CaseConventionPascal -> Strings.concat (Lists.map (\arg_ -> capitalize (Strings.toLower arg_)) parts)+ Util.CaseConventionLowerSnake -> Strings.join "_" (Lists.map Strings.toLower parts)+ Util.CaseConventionUpperSnake -> Strings.join "_" (Lists.map Strings.toUpper parts)+ Util.CaseConventionUpperDashed -> Strings.join "-" (Lists.map Strings.toUpper parts)++-- | Convert a string from camel case (possibly with underscores) to lower snake case. Splits on underscores first, then converts each part from camel case.+convertCaseCamelOrUnderscoreToLowerSnake :: String -> String+convertCaseCamelOrUnderscoreToLowerSnake s =++ let parts = Strings.splitOn "_" s+ snakeParts = Lists.map (\p -> convertCaseCamelToLowerSnake p) parts+ in (Strings.join "_" snakeParts)++-- | Convert a string from camel case to lower snake case+convertCaseCamelToLowerSnake :: String -> String+convertCaseCamelToLowerSnake = convertCase Util.CaseConventionCamel Util.CaseConventionLowerSnake++-- | Convert a string from camel case to upper snake case+convertCaseCamelToUpperSnake :: String -> String+convertCaseCamelToUpperSnake = convertCase Util.CaseConventionCamel Util.CaseConventionUpperSnake++-- | Convert a string from pascal case to upper snake case+convertCasePascalToUpperSnake :: String -> String+convertCasePascalToUpperSnake = convertCase Util.CaseConventionPascal Util.CaseConventionUpperSnake++-- | Decapitalize the first letter of a string+decapitalize :: String -> String+decapitalize = mapFirstLetter Strings.toLower++-- | Escape reserved words by appending an underscore+escapeWithUnderscore :: S.Set String -> String -> String+escapeWithUnderscore reserved s = Logic.ifElse (Sets.member s reserved) (Strings.concat2 s "_") s++-- | Indent each line of a string with four spaces+indentLines :: String -> String+indentLines s =++ let indent = \l -> Strings.concat2 " " l+ in (unlines (Lists.map indent (lines s)))++-- | Format a string as a Java-style block comment+javaStyleComment :: String -> String+javaStyleComment s = Strings.concat2 (Strings.concat2 (Strings.concat2 "/**\n" " * ") s) "\n */"++-- | Split a string into lines on newline (U+000A); a trailing newline is consumed without producing an empty trailing element, and the empty string yields the empty list.+lines :: String -> [String]+lines s =+ Logic.ifElse (Strings.isEmpty s) [] (+ let parts = Strings.splitOn "\n" s+ in (Optionals.withDefault parts (Optionals.map (\lst -> Logic.ifElse (Strings.isEmpty lst) (Optionals.withDefault parts (Lists.init parts)) parts) (Lists.last parts))))++-- | A helper which maps the first letter of a string to another string+mapFirstLetter :: (String -> String) -> String -> String+mapFirstLetter mapping s =+ Logic.ifElse (Strings.isEmpty s) s (+ let list = Strings.toList s+ in (Optionals.withDefault s (Optionals.map (\uc ->+ let firstLetter = mapping (Strings.fromList (Lists.singleton (Pairs.first uc)))+ in (Strings.concat2 firstLetter (Strings.fromList (Pairs.second uc)))) (Lists.uncons list))))++-- | Replace sequences of non-alphanumeric characters with single underscores+nonAlnumToUnderscores :: String -> String+nonAlnumToUnderscores input =++ let isAlnum =+ \c -> Logic.or (Logic.and (Ordering.gte c 65) (Ordering.lte c 90)) (Logic.or (Logic.and (Ordering.gte c 97) (Ordering.lte c 122)) (Logic.and (Ordering.gte c 48) (Ordering.lte c 57)))+ replace =+ \p -> \c ->+ let s = Pairs.first p+ b = Pairs.second p+ in (Logic.ifElse (isAlnum c) (Lists.cons c s, False) (Logic.ifElse b (s, True) (Lists.cons 95 s, True)))+ result = Lists.foldl replace ([], False) (Strings.toList input)+ in (Strings.fromList (Lists.reverse (Pairs.first result)))++-- | Normalize a comment string for consistent output across coders+normalizeComment :: String -> String+normalizeComment s =++ let stripped = stripLeadingAndTrailingWhitespace s+ in (Logic.ifElse (Strings.isEmpty stripped) "" (+ let lastIdx = Math.sub (Strings.length stripped) 1+ appended = Strings.concat2 stripped "."+ in (Optionals.match (Strings.charAt lastIdx stripped) appended (\lastChar -> Logic.ifElse (Equality.equal lastChar 46) stripped appended))))++-- | Sanitize a string by replacing non-alphanumeric characters and escaping reserved words+sanitizeWithUnderscores :: S.Set String -> String -> String+sanitizeWithUnderscores reserved s = escapeWithUnderscore reserved (nonAlnumToUnderscores s)++-- | Format a list of elements as a bracketed, comma-separated string+showList :: (t0 -> String) -> [t0] -> String+showList f els =+ Strings.concat [+ "[",+ (Strings.join ", " (Lists.map f els)),+ "]"]++-- | Remove leading and trailing whitespace from a string+stripLeadingAndTrailingWhitespace :: String -> String+stripLeadingAndTrailingWhitespace s =+ Strings.fromList (Lists.dropWhile Chars.isSpace (Lists.reverse (Lists.dropWhile Chars.isSpace (Lists.reverse (Strings.toList s)))))++-- | Join a list of strings with newlines (U+000A), appending a newline after each element including the last; the empty list yields the empty string.+unlines :: [String] -> String+unlines xs = Strings.concat (Lists.map (\l -> Strings.concat2 l "\n") xs)++-- | Replace special characters with their alphanumeric aliases+withCharacterAliases :: String -> String+withCharacterAliases original =++ let aliases =+ Maps.fromList [+ (32, "sp"),+ (33, "excl"),+ (34, "quot"),+ (35, "num"),+ (36, "dollar"),+ (37, "percnt"),+ (38, "amp"),+ (39, "apos"),+ (40, "lpar"),+ (41, "rpar"),+ (42, "ast"),+ (43, "plus"),+ (44, "comma"),+ (45, "minus"),+ (46, "period"),+ (47, "sol"),+ (58, "colon"),+ (59, "semi"),+ (60, "lt"),+ (61, "equals"),+ (62, "gt"),+ (63, "quest"),+ (64, "commat"),+ (91, "lsqb"),+ (92, "bsol"),+ (93, "rsqb"),+ (94, "circ"),+ (95, "lowbar"),+ (96, "grave"),+ (123, "lcub"),+ (124, "verbar"),+ (125, "rcub"),+ (126, "tilde")]+ alias = \c -> Optionals.withDefault (Lists.singleton c) (Optionals.map Strings.toList (Maps.lookup c aliases))+ in (Strings.fromList (Lists.filter Chars.isAlphaNum (Lists.concat (Lists.map alias (Strings.toList original)))))++-- | A simple soft line wrap which is suitable for code comments+wrapLine :: Int -> String -> String+wrapLine maxlen input =++ let helper =+ \prev -> \rem ->+ let trunc = Lists.take maxlen rem+ spanResult =+ Lists.span (\c -> Logic.and (Logic.not (Equality.equal c 32)) (Logic.not (Equality.equal c 9))) (Lists.reverse trunc)+ prefix = Lists.reverse (Pairs.second spanResult)+ suffix = Lists.reverse (Pairs.first spanResult)+ in (Logic.ifElse (Ordering.lte (Lists.length rem) maxlen) (Lists.reverse (Lists.cons rem prev)) (Logic.ifElse (Lists.isEmpty prefix) (helper (Lists.cons trunc prev) (Lists.drop maxlen rem)) (Optionals.withDefault (helper (Lists.cons trunc prev) (Lists.drop maxlen rem)) (Optionals.map (\pfxInit -> helper (Lists.cons pfxInit prev) (Lists.concat2 suffix (Lists.drop maxlen rem))) (Lists.init prefix)))))+ in (Strings.fromList (Lists.join [+ 10] (helper [] (Strings.toList input))))
@@ -0,0 +1,103 @@+-- Note: this is an automatically generated file. Do not edit.++-- | The extension to graphs of Hydra's core type system (hydra.core.model)++module Hydra.Core.Graph where++import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Typing as Typing+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void+import qualified Data.Map as M+import qualified Data.Set as S++-- | A graph, or lexical environment which binds names to terms, types, primitives, and metadata+data Graph =+ Graph {+ -- | The terms bound by all term variables in scope+ graphBoundTerms :: (M.Map Model.Name Model.Term),+ -- | The type schemes of all term variables in scope+ graphBoundTypes :: (M.Map Model.Name Model.TypeScheme),+ -- | A mutable map from type variable names to their accumulated class constraints. This is populated during type inference when operations requiring Eq or Ord are encountered.+ graphClassConstraints :: (M.Map Model.Name Model.TypeVariableConstraints),+ -- | The set of term variables introduced by specifically by lambdas+ graphLambdaVariables :: (S.Set Model.Name),+ -- | Any additional metadata bound to term variables in scope+ graphMetadata :: (M.Map Model.Name Model.Term),+ -- | All primitive functions and constants by name+ graphPrimitives :: (M.Map Model.Name Primitive),+ -- | All schema types (type schemes) in scope+ graphSchemaTypes :: (M.Map Model.Name Model.TypeScheme),+ -- | The set of type variables introduced specifically by type lambdas+ graphTypeVariables :: (S.Set Model.Name)}++_Graph = Model.Name "hydra.core.graph.Graph"++_Graph_boundTerms = Model.Name "boundTerms"++_Graph_boundTypes = Model.Name "boundTypes"++_Graph_classConstraints = Model.Name "classConstraints"++_Graph_lambdaVariables = Model.Name "lambdaVariables"++_Graph_metadata = Model.Name "metadata"++_Graph_primitives = Model.Name "primitives"++_Graph_schemaTypes = Model.Name "schemaTypes"++_Graph_typeVariables = Model.Name "typeVariables"++-- | A library of primitive functions+data Library =+ Library {+ -- | A common prefix for all primitive function names in the library+ libraryName :: Packaging.ModuleName,+ -- | A preferred namespace prefix for function names in the library+ libraryPrefix :: String,+ -- | The primitives defined in this library+ libraryPrimitives :: [Primitive]}++_Library = Model.Name "hydra.core.graph.Library"++_Library_name = Model.Name "name"++_Library_prefix = Model.Name "prefix"++_Library_primitives = Model.Name "primitives"++-- | A built-in function or constant, consisting of the host-independent PrimitiveDefinition (name, signature, metadata) plus a host-specific implementation.+data Primitive =+ Primitive {+ -- | The host-independent declarative metadata for the primitive: name, description, signature, totality and purity flags, and an optional reference implementation.+ primitiveDefinition :: Packaging.PrimitiveDefinition,+ -- | A concrete, host-specific implementation of the primitive function: given the current graph, a mapping from a list of argument terms to a result term, or an error. Arguments are reduced and stripped of annotations by the interpreter before the implementation is invoked, so the implementation can pattern-match the argument terms directly; a higher-order primitive whose result shape is fixed by its data argument can return an unreduced applicative term and let the outer reducer fold it (no graph needed). The graph is retained for the higher-order primitives that must evaluate a function argument mid-computation (e.g. lists.filter): evaluating that function resolves primitive names against the graph's primitive table. The legacy `InferenceContext` parameter was vestigial and has been removed (https://github.com/CategoricalData/hydra/issues/446).+ primitiveImplementation :: (Graph -> [Model.Term] -> Either Errors.Error Model.Term)}++_Primitive = Model.Name "hydra.core.graph.Primitive"++_Primitive_definition = Model.Name "definition"++_Primitive_implementation = Model.Name "implementation"++-- | A type together with a coder for mapping terms into arguments for primitive functions, and mapping computed results into terms.+data TermCoder a =+ TermCoder {+ -- | The Hydra type of encoded terms+ termCoderType :: Model.Type,+ -- | An encode function from terms to native values+ termCoderEncode :: (Typing.InferenceContext -> Graph -> Model.Term -> Either Errors.Error a),+ -- | A decode function from native values to terms+ termCoderDecode :: (Typing.InferenceContext -> a -> Either Errors.Error Model.Term)}++_TermCoder = Model.Name "hydra.core.graph.TermCoder"++_TermCoder_type = Model.Name "type"++_TermCoder_encode = Model.Name "encode"++_TermCoder_decode = Model.Name "decode"
@@ -0,0 +1,525 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Functions for deep term rewriting operations involving hoisting subterms or bindings into enclosing let terms.++module Hydra.Core.Hoisting where++import qualified Hydra.Core.Ast as Ast+import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Diff as Diff+import qualified Hydra.Core.Docs as Docs+import qualified Hydra.Core.Environment as Environment+import qualified Hydra.Core.Error.Checking as Checking+import qualified Hydra.Core.Error.File as ErrorFile+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Error.Packaging as ErrorPackaging+import qualified Hydra.Core.Error.System as ErrorSystem+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Json.Model as JsonModel+import qualified Hydra.Core.Lexical as Lexical+import qualified Hydra.Core.Overlay.Haskell.Lib.Equality as Equality+import qualified Hydra.Core.Overlay.Haskell.Lib.Lists as Lists+import qualified Hydra.Core.Overlay.Haskell.Lib.Literals as Literals+import qualified Hydra.Core.Overlay.Haskell.Lib.Logic as Logic+import qualified Hydra.Core.Overlay.Haskell.Lib.Maps as Maps+import qualified Hydra.Core.Overlay.Haskell.Lib.Math as Math+import qualified Hydra.Core.Overlay.Haskell.Lib.Optionals as Optionals+import qualified Hydra.Core.Overlay.Haskell.Lib.Ordering as Ordering+import qualified Hydra.Core.Overlay.Haskell.Lib.Pairs as Pairs+import qualified Hydra.Core.Overlay.Haskell.Lib.Sets as Sets+import qualified Hydra.Core.Overlay.Haskell.Lib.Strings as Strings+import qualified Hydra.Core.Markdown as Markdown+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Parsing as Parsing+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Query as Query+import qualified Hydra.Core.Regex as Regex+import qualified Hydra.Core.Relational as Relational+import qualified Hydra.Core.Resolution as Resolution+import qualified Hydra.Core.Rewriting as Rewriting+import qualified Hydra.Core.Scoping as Scoping+import qualified Hydra.Core.Sorting as Sorting+import qualified Hydra.Core.Strip as Strip+import qualified Hydra.Core.Substitution as Substitution+import qualified Hydra.Core.System as System+import qualified Hydra.Core.Tabular as Tabular+import qualified Hydra.Core.Testing as Testing+import qualified Hydra.Core.Time as Time+import qualified Hydra.Core.Topology as Topology+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Validation as Validation+import qualified Hydra.Core.Variables as Variables+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void+import qualified Data.Set as S++-- | Augment bindings with new free variables introduced by substitution, wrapping with lambdas after any type lambdas.+augmentBindingsWithNewFreeVars :: Graph.Graph -> S.Set Model.Name -> [Model.Binding] -> ([Model.Binding], Typing.TermSubst)+augmentBindingsWithNewFreeVars cx boundVars bindings =++ let types = Maps.map Scoping.typeSchemeToFType (Graph.graphBoundTypes cx)+ wrapAfterTypeLambdas =+ \vars -> \term -> case term of+ Model.TermTypeLambda v0 -> Model.TermTypeLambda (Model.TypeLambda {+ Model.typeLambdaParameter = (Model.typeLambdaParameter v0),+ Model.typeLambdaBody = (wrapAfterTypeLambdas vars (Model.typeLambdaBody v0))})+ _ -> Lists.foldl (\t -> \p -> Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Pairs.first p),+ Model.lambdaDomain = (Pairs.second p),+ Model.lambdaBody = t})) term (Lists.reverse vars)+ augment =+ \b ->+ let freeVars = Sets.toList (Sets.intersection boundVars (Variables.freeVariablesInTerm (Model.bindingTerm b)))+ varTypePairs = Lists.map (\v -> (v, (Maps.lookup v types))) freeVars+ varTypes = Optionals.givens (Lists.map Pairs.second varTypePairs)+ newTypeScheme =+ Logic.ifElse (Equality.equal (Lists.length varTypes) (Lists.length varTypePairs)) (Optionals.map (\ts -> Model.TypeScheme {+ Model.typeSchemeVariables = (Model.typeSchemeVariables ts),+ Model.typeSchemeBody = (Lists.foldl (\acc -> \t -> Model.TypeFunction (Model.FunctionType {+ Model.functionTypeDomain = t,+ Model.functionTypeCodomain = acc})) (Model.typeSchemeBody ts) (Lists.reverse varTypes)),+ Model.typeSchemeConstraints = (Model.typeSchemeConstraints ts)}) (Model.bindingTypeScheme b)) (Model.bindingTypeScheme b)+ in (Logic.ifElse (Lists.isEmpty freeVars) (b, Nothing) (+ Model.Binding {+ Model.bindingName = (Model.bindingName b),+ Model.bindingTerm = (wrapAfterTypeLambdas varTypePairs (Model.bindingTerm b)),+ Model.bindingTypeScheme = newTypeScheme},+ (Just (+ Model.bindingName b,+ (Lists.foldl (\t -> \v -> Model.TermApplication (Model.Application {+ Model.applicationFunction = t,+ Model.applicationArgument = (Model.TermVariable v)})) (Model.TermVariable (Model.bindingName b)) freeVars)))))+ results = Lists.map augment bindings+ in (Lists.map Pairs.first results, (Typing.TermSubst (Maps.fromList (Optionals.givens (Lists.map Pairs.second results)))))++-- | Check if a binding has a polymorphic type (non-empty list of type scheme variables)+bindingIsPolymorphic :: Model.Binding -> Bool+bindingIsPolymorphic binding =+ Optionals.match (Model.bindingTypeScheme binding) False (\ts -> Logic.not (Lists.isEmpty (Model.typeSchemeVariables ts)))++-- | Check if a binding's type uses any type variables from the given Graph. Returns True if the free type variables in the binding's type intersect with the type variables in scope (graphTypeVariables).+bindingUsesContextTypeVars :: Graph.Graph -> Model.Binding -> Bool+bindingUsesContextTypeVars cx binding =+ Optionals.match (Model.bindingTypeScheme binding) False (\ts ->+ let freeInType = Variables.freeVariablesInType (Model.typeSchemeBody ts)+ contextTypeVars = Graph.graphTypeVariables cx+ in (Logic.not (Sets.isEmpty (Sets.intersection freeInType contextTypeVars))))++-- | Count the number of occurrences of a variable name in a term. Assumes no variable shadowing.+countVarOccurrences :: Model.Name -> Model.Term -> Int+countVarOccurrences name term =++ let childCount = Lists.foldl (\acc -> \t -> Math.add acc (countVarOccurrences name t)) 0 (Rewriting.subterms term)+ in case term of+ Model.TermVariable v0 -> Logic.ifElse (Equality.equal v0 name) (Math.add 1 childCount) childCount+ _ -> childCount++-- | Transform a let-term by pulling ALL let bindings to the top level. This is useful for targets like Java that don't support nested let expressions at all. If a hoisted binding captures lambda-bound variables from an enclosing scope, the binding is wrapped in lambdas for those variables, and references are replaced with applications. Note: Assumes no variable shadowing; use hydra.core.rewriting.unshadowVariables first.+hoistAllLetBindings :: Model.Let -> Model.Let+hoistAllLetBindings let0 =++ let emptyCx =+ Graph.Graph {+ Graph.graphBoundTerms = Maps.empty,+ Graph.graphBoundTypes = Maps.empty,+ Graph.graphClassConstraints = Maps.empty,+ Graph.graphLambdaVariables = Sets.empty,+ Graph.graphMetadata = Maps.empty,+ Graph.graphPrimitives = Maps.empty,+ Graph.graphSchemaTypes = Maps.empty,+ Graph.graphTypeVariables = Sets.empty}+ in (hoistLetBindingsWithPredicate (\_ -> True) shouldHoistAll emptyCx let0)++-- | Hoist case statements into local let bindings. This is useful for targets such as Python which only support case statements (match) at the top level. Case statements are hoisted only when they appear at non-top-level positions. Top level = root, or reachable through annotations, let body/binding, lambda bodies, or ONE application LHS. Once through an application LHS, lambda bodies no longer count as pass-through.+hoistCaseStatements :: Graph.Graph -> Model.Term -> Model.Term+hoistCaseStatements = hoistSubterms shouldHoistCaseStatement++-- | Hoist case statements into local let bindings for a list of bindings. This version operates prior to inference and uses an empty type context. It hoists case statements and their applied arguments into let bindings.+hoistCaseStatementsInGraph :: [Model.Binding] -> [Model.Binding]+hoistCaseStatementsInGraph bindings =++ let emptyTx =+ Graph.Graph {+ Graph.graphBoundTerms = Maps.empty,+ Graph.graphBoundTypes = Maps.empty,+ Graph.graphClassConstraints = Maps.empty,+ Graph.graphLambdaVariables = Sets.empty,+ Graph.graphMetadata = Maps.empty,+ Graph.graphPrimitives = Maps.empty,+ Graph.graphSchemaTypes = Maps.empty,+ Graph.graphTypeVariables = Sets.empty}+ term0 =+ Model.TermLet (Model.Let {+ Model.letBindings = bindings,+ Model.letBody = Model.TermUnit})+ term1 = hoistCaseStatements emptyTx term0+ in (Environment.termAsBindings term1)++-- | Transform a let-term by pulling polymorphic let bindings to the top level, using Graph. A binding is hoisted if: (1) It is polymorphic (has non-empty typeSchemeVariables), OR (2) Its type uses type variables from the Graph (i.e., from enclosing type lambdas). Bindings which are already at the top level are not hoisted. If a hoisted binding captures lambda-bound or let-bound variables from an enclosing scope, the binding is wrapped in lambdas for those variables, and references are replaced with applications. If a hoisted binding uses type variables from the context, those type variables are added to the binding's type scheme. Note: we assume that there is no variable shadowing; use hydra.core.rewriting.unshadowVariables first.+hoistLetBindingsWithContext :: (Model.Binding -> Bool) -> Graph.Graph -> Model.Let -> Model.Let+hoistLetBindingsWithContext isParentBinding cx let0 =+ hoistLetBindingsWithPredicate isParentBinding shouldHoistPolymorphic cx let0++-- | Transform a let-term by pulling let bindings to the top level. The isParentBinding predicate applies to top-level bindings and determines whether their subterm bindings are eligible for hoisting. The shouldHoistBinding predicate takes the Graph and a subterm binding, and returns True if the binding should be hoisted. This is useful for targets like Java that cannot have polymorphic definitions in arbitrary positions. The Graph provides information about type variables and lambda variables in scope. If a hoisted binding captures let-bound or lambda-bound variables from an enclosing scope, the binding is wrapped in lambdas for those variables, and references are replaced with applications. If a hoisted binding captures type variables from an enclosing type lambda scope, those type variables are added to the binding's type scheme, and references are replaced with type applications. Note: we assume that there is no variable shadowing; use hydra.core.rewriting.unshadowVariables first.+hoistLetBindingsWithPredicate :: (Model.Binding -> Bool) -> (Graph.Graph -> Model.Binding -> Bool) -> Graph.Graph -> Model.Let -> Model.Let+hoistLetBindingsWithPredicate isParentBinding shouldHoistBinding cx0 let0 =++ let hoistOne =+ \prefix -> \cx -> \pair -> \bindingWithCapturedVars ->+ let bindingAndReplacementPairs = Pairs.first pair+ alreadyUsedNames = Pairs.second pair+ b = Pairs.first bindingWithCapturedVars+ capturedTermVars = Pairs.second bindingWithCapturedVars+ types = Maps.map Scoping.typeSchemeToFType (Graph.graphBoundTypes cx)+ capturedTermVarTypePairs = Lists.map (\v -> (v, (Maps.lookup v types))) capturedTermVars+ capturedTermVarTypes =+ Lists.map (\typ -> Strip.deannotateTypeParameters typ) (Optionals.givens (Lists.map Pairs.second capturedTermVarTypePairs))+ freeInBindingType =+ Optionals.match (Model.bindingTypeScheme b) Sets.empty (\ts -> Variables.freeVariablesInType (Model.typeSchemeBody ts))+ freeInCapturedVarTypes = Sets.unions (Lists.map (\t -> Variables.freeVariablesInType t) capturedTermVarTypes)+ capturedTypeVars =+ Sets.toList (Sets.intersection (Graph.graphTypeVariables cx) (Sets.union freeInBindingType freeInCapturedVarTypes))+ globalBindingName =+ Lexical.chooseUniqueName alreadyUsedNames (Model.Name (Strings.concat2 prefix (Model.unName (Model.bindingName b))))+ newUsedNames = Sets.insert globalBindingName alreadyUsedNames+ newTypeScheme =+ Logic.ifElse (Equality.equal (Lists.length capturedTermVarTypes) (Lists.length capturedTermVarTypePairs)) (Optionals.map (\ts -> Model.TypeScheme {+ Model.typeSchemeVariables = (Lists.distinct (Lists.concat2 capturedTypeVars (Model.typeSchemeVariables ts))),+ Model.typeSchemeBody = (Lists.foldl (\t -> \a -> Model.TypeFunction (Model.FunctionType {+ Model.functionTypeDomain = a,+ Model.functionTypeCodomain = t})) (Model.typeSchemeBody ts) (Lists.reverse capturedTermVarTypes)),+ Model.typeSchemeConstraints = (Model.typeSchemeConstraints ts)}) (Model.bindingTypeScheme b)) Nothing+ strippedTerm = Strip.stripTypeLambdas (Model.bindingTerm b)+ termWithLambdas =+ Lists.foldl (\t -> \p -> Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Pairs.first p),+ Model.lambdaDomain = (Optionals.map (\dom -> Strip.deannotateTypeParameters dom) (Pairs.second p)),+ Model.lambdaBody = t})) strippedTerm (Lists.reverse capturedTermVarTypePairs)+ termWithTypeLambdas =+ Lists.foldl (\t -> \v -> Model.TermTypeLambda (Model.TypeLambda {+ Model.typeLambdaParameter = v,+ Model.typeLambdaBody = t})) termWithLambdas (Lists.reverse (Optionals.match newTypeScheme [] Model.typeSchemeVariables))+ withTypeApps =+ Lists.foldl (\t -> \v -> Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = t,+ Model.typeApplicationTermType = (Model.TypeVariable v)})) (Model.TermVariable globalBindingName) capturedTypeVars+ replacement =+ Lists.foldl (\t -> \v -> Model.TermApplication (Model.Application {+ Model.applicationFunction = t,+ Model.applicationArgument = (Model.TermVariable v)})) withTypeApps capturedTermVars+ newBindingAndReplacement =+ (+ Model.Binding {+ Model.bindingName = globalBindingName,+ Model.bindingTerm = termWithTypeLambdas,+ Model.bindingTypeScheme = newTypeScheme},+ replacement)+ newPairs = Lists.cons newBindingAndReplacement bindingAndReplacementPairs+ in (newPairs, newUsedNames)+ rewrite =+ \prefix -> \recurse -> \cx -> \bindingsAndNames -> \term ->+ let previouslyFinishedBindings = Pairs.first bindingsAndNames+ emptyBindingsAndNames = ([], (Pairs.second bindingsAndNames))+ result = recurse emptyBindingsAndNames term+ newBindingsAndNames = Pairs.first result+ bindingsSoFar = Pairs.first newBindingsAndNames+ alreadyUsedNames = Pairs.second newBindingsAndNames+ newTerm = Pairs.second result+ in case newTerm of+ Model.TermLet v0 ->+ let body = Model.letBody v0+ partitionPair = Lists.partition (shouldHoistBinding cx) (Model.letBindings v0)+ hoistUs = Pairs.first partitionPair+ keepUs = Pairs.second partitionPair+ hoistedBindingNames = Lists.map Model.bindingName hoistUs+ polyLetVariables =+ Sets.fromList (Lists.filter (\v -> Optionals.match (Optionals.map Scoping.typeSchemeToFType (Maps.lookup v (Graph.graphBoundTypes cx))) False Resolution.fTypeIsPolymorphic) (Sets.toList (Sets.difference (Sets.fromList (Maps.keys (Graph.graphBoundTerms cx))) (Graph.graphLambdaVariables cx))))+ boundTermVariables =+ Sets.union (Graph.graphLambdaVariables cx) (Sets.difference (Sets.fromList (Maps.keys (Graph.graphBoundTerms cx))) (Graph.graphLambdaVariables cx))+ freeVariablesInEachBinding =+ Lists.map (\b -> Sets.toList (Sets.intersection boundTermVariables (Variables.freeVariablesInTerm (Model.bindingTerm b)))) hoistUs+ bindingDependencies =+ Lists.map (\vars -> Lists.partition (\v -> Sets.member v (Sets.fromList hoistedBindingNames)) vars) freeVariablesInEachBinding+ bindingEdges = Lists.zip hoistedBindingNames (Lists.map Pairs.first bindingDependencies)+ bindingImmediateCapturedVars = Lists.zip hoistedBindingNames (Lists.map Pairs.second bindingDependencies)+ capturedVarsMap = Maps.fromList (Sorting.propagateTags bindingEdges bindingImmediateCapturedVars)+ bindingsWithCapturedVars =+ Lists.map (\b -> (+ b,+ (Optionals.match (Maps.lookup (Model.bindingName b) capturedVarsMap) [] (\vars -> Sets.toList (Sets.difference vars polyLetVariables))))) hoistUs+ hoistPairsAndNames = Lists.foldl (hoistOne prefix cx) ([], alreadyUsedNames) bindingsWithCapturedVars+ hoistPairs = Lists.reverse (Pairs.first hoistPairsAndNames)+ hoistedBindings = Lists.map Pairs.first hoistPairs+ replacements = Lists.map Pairs.second hoistPairs+ finalUsedNames = Pairs.second hoistPairsAndNames+ hoistNameReplacementPairs = Lists.zip (Lists.map Model.bindingName hoistUs) replacements+ hoistBindingMap = Maps.fromList (Lists.map (\b -> (Model.bindingName b, b)) hoistUs)+ isCacheable =+ \name ->+ let multiRef = Ordering.gte (countVarOccurrences name body) 2+ isPoly = Optionals.match (Maps.lookup name hoistBindingMap) False (\b -> bindingIsPolymorphic b)+ in (Logic.and multiRef (Logic.not isPoly))+ singleRefPairs = Lists.filter (\p -> Logic.not (isCacheable (Pairs.first p))) hoistNameReplacementPairs+ multiRefPairs = Lists.filter (\p -> isCacheable (Pairs.first p)) hoistNameReplacementPairs+ fullSubst = Typing.TermSubst (Maps.fromList hoistNameReplacementPairs)+ bodyOnlySubst = Typing.TermSubst (Maps.fromList singleRefPairs)+ bodySubst = Substitution.substituteInTerm bodyOnlySubst body+ cacheBindings =+ Lists.map (\p ->+ let origType = Optionals.match (Maps.lookup (Pairs.first p) hoistBindingMap) Nothing (\b -> Model.bindingTypeScheme b)+ in Model.Binding {+ Model.bindingName = (Pairs.first p),+ Model.bindingTerm = (Pairs.second p),+ Model.bindingTypeScheme = origType}) multiRefPairs+ bodyWithCache =+ Logic.ifElse (Lists.isEmpty cacheBindings) bodySubst (Model.TermLet (Model.Let {+ Model.letBindings = cacheBindings,+ Model.letBody = bodySubst}))+ keepUsSubst = Lists.map (Substitution.substituteInBinding fullSubst) keepUs+ hoistedBindingsSubst = Lists.map (Substitution.substituteInBinding fullSubst) hoistedBindings+ bindingsSoFarSubst = Lists.map (Substitution.substituteInBinding fullSubst) bindingsSoFar+ augmentResult = augmentBindingsWithNewFreeVars cx (Sets.difference boundTermVariables polyLetVariables) bindingsSoFarSubst+ bindingsSoFarAugmented = Pairs.first augmentResult+ augmentSubst = Pairs.second augmentResult+ hoistedBindingsFinal = Lists.map (Substitution.substituteInBinding augmentSubst) hoistedBindingsSubst+ bindingsSoFarFinal = Lists.map (Substitution.substituteInBinding augmentSubst) bindingsSoFarAugmented+ bodyFinal = Substitution.substituteInTerm augmentSubst bodyWithCache+ keepUsFinal = Lists.map (Substitution.substituteInBinding augmentSubst) keepUsSubst+ finalTerm =+ Logic.ifElse (Lists.isEmpty keepUsFinal) bodyFinal (Model.TermLet (Model.Let {+ Model.letBindings = keepUsFinal,+ Model.letBody = bodyFinal}))+ in (+ (+ Lists.concat [+ previouslyFinishedBindings,+ hoistedBindingsFinal,+ bindingsSoFarFinal],+ finalUsedNames),+ finalTerm)+ _ -> ((Lists.concat2 previouslyFinishedBindings bindingsSoFar, alreadyUsedNames), newTerm)+ cx1 = Scoping.extendGraphForLet (\c -> \b -> Nothing) cx0 let0+ forActiveBinding =+ \b ->+ let prefix = Strings.concat2 (Model.unName (Model.bindingName b)) "_"+ init = ([], (Sets.singleton (Model.bindingName b)))+ resultPair = Rewriting.rewriteAndFoldTermWithGraph (rewrite prefix) cx1 init (Model.bindingTerm b)+ resultBindings = Pairs.first (Pairs.first resultPair)+ resultTerm = Pairs.second resultPair+ in (Lists.cons (Model.Binding {+ Model.bindingName = (Model.bindingName b),+ Model.bindingTerm = resultTerm,+ Model.bindingTypeScheme = (Model.bindingTypeScheme b)}) resultBindings)+ forBinding = \b -> Logic.ifElse (isParentBinding b) (forActiveBinding b) [+ b]+ in Model.Let {+ Model.letBindings = (Lists.concat (Lists.map forBinding (Model.letBindings let0))),+ Model.letBody = (Model.letBody let0)}++-- | Transform a let-term by pulling all polymorphic let bindings to the top level. This is useful to ensure that polymorphic bindings are not nested within other terms, which is unsupported by certain targets such as Java. Polymorphic bindings are those with a non-empty list of type scheme variables. If a hoisted binding captures lambda-bound variables from an enclosing scope, the binding is wrapped in lambdas for those variables, and references are replaced with applications. Note: Assumes no variable shadowing; use hydra.core.rewriting.unshadowVariables first.+hoistPolymorphicLetBindings :: (Model.Binding -> Bool) -> Model.Let -> Model.Let+hoistPolymorphicLetBindings isParentBinding let0 =++ let emptyCx =+ Graph.Graph {+ Graph.graphBoundTerms = Maps.empty,+ Graph.graphBoundTypes = Maps.empty,+ Graph.graphClassConstraints = Maps.empty,+ Graph.graphLambdaVariables = Sets.empty,+ Graph.graphMetadata = Maps.empty,+ Graph.graphPrimitives = Maps.empty,+ Graph.graphSchemaTypes = Maps.empty,+ Graph.graphTypeVariables = Sets.empty}+ in (hoistLetBindingsWithPredicate isParentBinding shouldHoistPolymorphic emptyCx let0)++-- | Hoist subterms into local let bindings based on a path-aware predicate. The predicate receives a pair of (path, term) where path is the list of SubtermSteps from the root to the current term, and returns True if the term should be hoisted. For each let term found, the immediate subterms (binding values and body) are processed: matching subterms within each immediate subterm are collected and hoisted into a local let that wraps that immediate subterm. If a hoisted term contains free variables that are lambda-bound at an enclosing scope, the hoisted binding is wrapped in lambdas for those variables, and the reference is replaced with an application of those variables.+hoistSubterms :: (([Paths.SubtermStep], Model.Term) -> Bool) -> Graph.Graph -> Model.Term -> Model.Term+hoistSubterms shouldHoist cx0 term0 =++ let processImmediateSubterm =+ \cx -> \counter -> \namePrefix -> \pathPrefix -> \subterm ->+ let baselineLambdaVars = Graph.graphLambdaVariables cx+ collectAndReplace =+ \recurse -> \path -> \cxInner -> \acc -> \term ->+ let currentCounter = Pairs.first acc+ collectedBindings = Pairs.second acc+ in case term of+ Model.TermLet _ -> (acc, term)+ Model.TermTypeLambda _ -> (acc, term)+ _ ->+ let result = recurse acc term+ newAcc = Pairs.first result+ processedTerm = Pairs.second result+ newCounter = Pairs.first newAcc+ newBindings = Pairs.second newAcc+ fullPath = Lists.concat2 pathPrefix path+ in (Logic.ifElse (shouldHoist (fullPath, processedTerm)) (+ let proposedName =+ Model.Name (Strings.concat [+ "_hoist_",+ namePrefix,+ "_",+ (Literals.printInt32 newCounter)])+ existingNames = Sets.fromList (Lists.map (\b -> Model.bindingName b) newBindings)+ freeVarsInSubterm = Variables.freeVariablesInTerm subterm+ allReserved = Sets.union existingNames freeVarsInSubterm+ bindingName = Lexical.chooseUniqueName allReserved proposedName+ allLambdaVars = Graph.graphLambdaVariables cxInner+ newLambdaVars = Sets.difference allLambdaVars baselineLambdaVars+ freeVars = Variables.freeVariablesInTerm processedTerm+ capturedVars = Sets.toList (Sets.intersection newLambdaVars freeVars)+ typeMap = Maps.map Scoping.typeSchemeToFType (Graph.graphBoundTypes cxInner)+ wrappedTerm =+ Lists.foldl (\body -> \varName -> Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = varName,+ Model.lambdaDomain = (Maps.lookup varName typeMap),+ Model.lambdaBody = body})) processedTerm (Lists.reverse capturedVars)+ reference =+ Lists.foldl (\fn -> \varName -> Model.TermApplication (Model.Application {+ Model.applicationFunction = fn,+ Model.applicationArgument = (Model.TermVariable varName)})) (Model.TermVariable bindingName) capturedVars+ newBinding =+ Model.Binding {+ Model.bindingName = bindingName,+ Model.bindingTerm = wrappedTerm,+ Model.bindingTypeScheme = Nothing}+ in ((Math.add newCounter 1, (Lists.cons newBinding newBindings)), reference)) (newAcc, processedTerm))+ result = Rewriting.rewriteAndFoldTermWithGraphAndPath collectAndReplace cx (counter, []) subterm+ finalAcc = Pairs.first result+ transformedSubterm = Pairs.second result+ finalCounter = Pairs.first finalAcc+ bindings = Pairs.second finalAcc+ in (Logic.ifElse (Lists.isEmpty bindings) (finalCounter, transformedSubterm) (+ let localLet =+ Model.TermLet (Model.Let {+ Model.letBindings = (Lists.reverse bindings),+ Model.letBody = transformedSubterm})+ in (finalCounter, localLet)))+ processLetTerm =+ \cx -> \counter -> \path -> \lt ->+ let bindings = Model.letBindings lt+ body = Model.letBody lt+ processBinding =+ \acc -> \binding ->+ let namePrefix = Strings.join "_" (Strings.splitOn "." (Model.unName (Model.bindingName binding)))+ bindingPathPrefix = Lists.concat2 path [+ Paths.SubtermStepLetBinding (Model.bindingName binding)]+ result = processImmediateSubterm cx 1 namePrefix bindingPathPrefix (Model.bindingTerm binding)+ newValue = Pairs.second result+ newBinding =+ Model.Binding {+ Model.bindingName = (Model.bindingName binding),+ Model.bindingTerm = newValue,+ Model.bindingTypeScheme = (Model.bindingTypeScheme binding)}+ in (Lists.cons newBinding acc)+ newBindingsReversed = Lists.foldl processBinding [] bindings+ newBindings = Lists.reverse newBindingsReversed+ bodyPathPrefix = Lists.concat2 path [+ Paths.SubtermStepLetBody]+ firstBindingName =+ Optionals.match (Lists.head bindings) "body" (\b -> Strings.join "_" (Strings.splitOn "." (Model.unName (Model.bindingName b))))+ bodyPrefix = Strings.concat2 firstBindingName "_body"+ bodyResult = processImmediateSubterm cx 1 bodyPrefix bodyPathPrefix body+ newBody = Pairs.second bodyResult+ in (+ counter,+ (Model.TermLet (Model.Let {+ Model.letBindings = newBindings,+ Model.letBody = newBody})))+ rewrite =+ \recurse -> \path -> \cx -> \counter -> \term -> case term of+ Model.TermLet _ ->+ let recursed = recurse counter term+ newCounter = Pairs.first recursed+ recursedTerm = Pairs.second recursed+ in case recursedTerm of+ Model.TermLet v1 -> processLetTerm cx newCounter path v1+ _ -> (newCounter, recursedTerm)+ _ -> recurse counter term+ in (Pairs.second (Rewriting.rewriteAndFoldTermWithGraphAndPath rewrite cx0 1 term0))++-- | Check whether a SubtermStep is the applicationFunction step+isApplicationFunction :: Paths.SubtermStep -> Bool+isApplicationFunction acc =+ case acc of+ Paths.SubtermStepApplicationFunction -> True+ _ -> False++-- | Check whether a SubtermStep is the lambdaBody step+isLambdaBody :: Paths.SubtermStep -> Bool+isLambdaBody acc =+ case acc of+ Paths.SubtermStepLambdaBody -> True+ _ -> False++-- | Check if a term is a union elimination (case statement)+isUnionElimination :: Model.Term -> Bool+isUnionElimination term =+ case term of+ Model.TermCases _ -> True+ _ -> False++-- | Check if a term is an application of a union elimination (case statement applied to an argument)+isUnionEliminationApplication :: Model.Term -> Bool+isUnionEliminationApplication term =+ case term of+ Model.TermApplication v0 -> isUnionElimination (Strip.deannotateAndDetypeTerm (Model.applicationFunction v0))+ _ -> False++-- | Normalize a path for hoisting by treating immediately-applied lambdas as let bindings. Replaces [applicationFunction, lambdaBody, ...] with [letBody, ...].+normalizePathForHoisting :: [Paths.SubtermStep] -> [Paths.SubtermStep]+normalizePathForHoisting path =++ let go =+ \remaining -> Optionals.match (Lists.uncons remaining) remaining (\uc1 ->+ let first = Pairs.first uc1+ afterFirst = Pairs.second uc1+ in (Optionals.match (Lists.uncons afterFirst) remaining (\uc2 ->+ let second = Pairs.first uc2+ rest = Pairs.second uc2+ in (Logic.ifElse (Logic.and (isApplicationFunction first) (isLambdaBody second)) (Lists.cons Paths.SubtermStepLetBody (go rest)) (Lists.cons first (go afterFirst))))))+ in (go path)++-- | Predicate that always returns True, for hoisting all bindings unconditionally.+shouldHoistAll :: t0 -> t1 -> Bool+shouldHoistAll _ _2 = True++-- | Predicate for case statement hoisting. Returns True if term is a union elimination (bare case function) or a case statement application (union elimination applied to an argument) AND not at top level. Top level = reachable through annotations, let body/binding, lambda bodies, or ONE app LHS. Once through an app LHS, lambda bodies no longer pass through.+shouldHoistCaseStatement :: ([Paths.SubtermStep], Model.Term) -> Bool+shouldHoistCaseStatement pathAndTerm =++ let path = Pairs.first pathAndTerm+ term = Pairs.second pathAndTerm+ in (Logic.ifElse (Logic.not (Logic.or (isUnionElimination term) (isUnionEliminationApplication term))) False (+ let finalState = Lists.foldl (\st -> \acc -> updateHoistState acc st) (True, False) path+ in (Logic.not (Pairs.first finalState))))++-- | Predicate for hoisting polymorphic bindings. Returns True if the binding is polymorphic (has type scheme variables) or if its type uses any type variables from the Graph.+shouldHoistPolymorphic :: Graph.Graph -> Model.Binding -> Bool+shouldHoistPolymorphic cx binding = Logic.or (bindingIsPolymorphic binding) (bindingUsesContextTypeVars cx binding)++-- | Update hoisting state when traversing an accessor. State is (atTopLevel, usedAppLHS). Returns updated state.+updateHoistState :: Paths.SubtermStep -> (Bool, Bool) -> (Bool, Bool)+updateHoistState accessor state =++ let atTop = Pairs.first state+ usedApp = Pairs.second state+ in (Logic.ifElse (Logic.not atTop) (False, usedApp) (case accessor of+ Paths.SubtermStepAnnotatedBody -> (True, usedApp)+ Paths.SubtermStepLetBody -> (True, usedApp)+ Paths.SubtermStepLetBinding _ -> (True, usedApp)+ Paths.SubtermStepTypeApplicationBody -> (True, usedApp)+ Paths.SubtermStepTypeLambdaBody -> (True, usedApp)+ Paths.SubtermStepLambdaBody -> Logic.ifElse usedApp (False, True) (True, False)+ Paths.SubtermStepCasesCase _ -> Logic.ifElse usedApp (False, True) (True, False)+ Paths.SubtermStepCasesDefault -> Logic.ifElse usedApp (False, True) (True, False)+ Paths.SubtermStepApplicationFunction -> Logic.ifElse usedApp (False, True) (True, True)+ Paths.SubtermStepApplicationArgument -> (False, usedApp)+ _ -> (False, usedApp)))
@@ -0,0 +1,1179 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Type inference for Hydra: Hindley-Milner with elaboration to System F. Extends textbook Algorithm W with nominal types, explicit type abstraction and application, and class constraints. See the Inference wiki page for the full picture.++module Hydra.Core.Inference where++import qualified Hydra.Core.Annotations as Annotations+import qualified Hydra.Core.Ast as Ast+import qualified Hydra.Core.Checking as Checking+import qualified Hydra.Core.Classes as Classes+import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Diff as Diff+import qualified Hydra.Core.Docs as Docs+import qualified Hydra.Core.Error.Checking as ErrorChecking+import qualified Hydra.Core.Error.File as ErrorFile+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Error.Packaging as ErrorPackaging+import qualified Hydra.Core.Error.System as ErrorSystem+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.Extract.Model as ExtractModel+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Json.Model as JsonModel+import qualified Hydra.Core.Lexical as Lexical+import qualified Hydra.Core.Overlay.Haskell.Lib.Eithers as Eithers+import qualified Hydra.Core.Overlay.Haskell.Lib.Equality as Equality+import qualified Hydra.Core.Overlay.Haskell.Lib.Lists as Lists+import qualified Hydra.Core.Overlay.Haskell.Lib.Literals as Literals+import qualified Hydra.Core.Overlay.Haskell.Lib.Logic as Logic+import qualified Hydra.Core.Overlay.Haskell.Lib.Maps as Maps+import qualified Hydra.Core.Overlay.Haskell.Lib.Math as Math+import qualified Hydra.Core.Overlay.Haskell.Lib.Optionals as Optionals+import qualified Hydra.Core.Overlay.Haskell.Lib.Ordering as Ordering+import qualified Hydra.Core.Overlay.Haskell.Lib.Pairs as Pairs+import qualified Hydra.Core.Overlay.Haskell.Lib.Sets as Sets+import qualified Hydra.Core.Overlay.Haskell.Lib.Strings as Strings+import qualified Hydra.Core.Markdown as Markdown+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Names as Names+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Parsing as Parsing+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Print.Errors as PrintErrors+import qualified Hydra.Core.Print.Model as PrintModel+import qualified Hydra.Core.Print.Typing as PrintTyping+import qualified Hydra.Core.Query as Query+import qualified Hydra.Core.Reflect as Reflect+import qualified Hydra.Core.Regex as Regex+import qualified Hydra.Core.Relational as Relational+import qualified Hydra.Core.Resolution as Resolution+import qualified Hydra.Core.Rewriting as Rewriting+import qualified Hydra.Core.Scoping as Scoping+import qualified Hydra.Core.Sorting as Sorting+import qualified Hydra.Core.Substitution as Substitution+import qualified Hydra.Core.System as System+import qualified Hydra.Core.Tabular as Tabular+import qualified Hydra.Core.Testing as Testing+import qualified Hydra.Core.Time as Time+import qualified Hydra.Core.Topology as Topology+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Unification as Unification+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Validation as Validation+import qualified Hydra.Core.Variables as Variables+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void+import qualified Data.Map as M+import qualified Data.Set as S++-- | Return the element at the given index, or Left(Other) with the given description if out of range+atOrFail :: Int -> String -> [t0] -> Either Errors.Error t0+atOrFail i desc xs =+ Optionals.match (Lists.at i xs) (Left (Errors.ErrorOther (Errors.OtherError (Strings.concat2 "atOrFail: " desc)))) (\x -> Right x)++-- | Unify type constraints and check the substitution+bindConstraints :: Typing.InferenceContext -> Graph.Graph -> [Typing.TypeConstraint] -> Either Errors.Error Typing.TypeSubst+bindConstraints flowCx cx constraints =+ Eithers.bind (Eithers.bimap (\_e -> Errors.ErrorInference (Errors.InferenceErrorUnification (Errors.UnificationInferenceError {+ Errors.unificationInferenceErrorPath = (Paths.SubtermPath (Lists.reverse (Typing.inferenceContextTrace flowCx))),+ Errors.unificationInferenceErrorCause = _e}))) (\_a -> _a) (Unification.unifyTypeConstraints flowCx (Graph.graphSchemaTypes cx) constraints)) (\s -> Eithers.bind (Checking.checkTypeSubst flowCx cx s) (\_ -> Right s))++-- | Handle unbound type variables under a typed let binding. Variables appearing free in the binding's declared type (but not in schema types or the scheme's own quantified variables) are added to the scheme and the term is wrapped in matching TypeLambdas. Variables appearing only in the term body (at type-application or lambda-domain positions) are phantom — they have no external effect on the binding's type — and are substituted with hydra.core.model.Unit in the body rather than generalized. This keeps downstream stages from seeing vacuous foralls that target languages with non-polymorphic value bindings (e.g. Scala val) cannot express.+bindUnboundTypeVariables :: Graph.Graph -> Model.Term -> Model.Term+bindUnboundTypeVariables cx term0 =++ let svars = Sets.fromList (Maps.keys (Graph.graphSchemaTypes cx))+ rewrite =+ \recurse -> \term -> case term of+ Model.TermLet v0 ->+ let forBinding =+ \b ->+ let bname = Model.bindingName b+ bterm = Model.bindingTerm b+ in (Optionals.match (Model.bindingTypeScheme b) (Model.Binding {+ Model.bindingName = bname,+ Model.bindingTerm = (bindUnboundTypeVariables cx bterm),+ Model.bindingTypeScheme = Nothing}) (\ts ->+ let bvars = Sets.fromList (Model.typeSchemeVariables ts)+ excluded = Sets.union svars bvars+ inType = Sets.difference (Variables.freeVariablesInType (Model.typeSchemeBody ts)) excluded+ phantoms = Sets.difference (Variables.freeTypeVariablesInTerm bterm) (Sets.union excluded inType)+ phantomSubst = Typing.TypeSubst (Maps.fromList (Lists.map (\v -> (v, Model.TypeUnit)) (Sets.toList phantoms)))+ bterm1 = Substitution.substTypesInTerm phantomSubst bterm+ unbound = Sets.toList inType+ ts2 =+ Model.TypeScheme {+ Model.typeSchemeVariables = (Lists.concat2 (Model.typeSchemeVariables ts) unbound),+ Model.typeSchemeBody = (Model.typeSchemeBody ts),+ Model.typeSchemeConstraints = (Model.typeSchemeConstraints ts)}+ bterm2 =+ Lists.foldl (\t -> \v -> Model.TermTypeLambda (Model.TypeLambda {+ Model.typeLambdaParameter = v,+ Model.typeLambdaBody = t})) bterm1 unbound+ in Model.Binding {+ Model.bindingName = bname,+ Model.bindingTerm = bterm2,+ Model.bindingTypeScheme = (Just ts2)}))+ in (Model.TermLet (Model.Let {+ Model.letBindings = (Lists.map forBinding (Model.letBindings v0)),+ Model.letBody = (bindUnboundTypeVariables cx (Model.letBody v0))}))+ _ -> recurse term+ in (Rewriting.rewriteTerm rewrite term0)++-- | Fold a list of type variables over a term to build a type application term+buildTypeApplicationTerm :: [Model.Name] -> Model.Term -> Model.Term+buildTypeApplicationTerm tvars body =+ Lists.foldl (\t -> \v -> Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = t,+ Model.typeApplicationTermType = (Model.TypeVariable v)})) body tvars++-- | Check that every constrained type variable's final resolved type is an instance of each class it was constrained to.+dischargeClassConstraints :: Typing.InferenceContext -> Typing.TypeSubst -> M.Map Model.Name Model.TypeVariableConstraints -> Either Errors.Error ()+dischargeClassConstraints fcx subst constraints =++ let substMap = Typing.unTypeSubst subst+ checkOne =+ \pair ->+ let varName = Pairs.first pair+ varConstraints = Pairs.second pair+ in (Optionals.match (Maps.lookup varName substMap) (Right ()) (\resolvedType ->+ let checkClass =+ \classConstraint ->+ let className =+ case classConstraint of+ Model.TypeClassConstraintSimple v0 -> v0+ in (Logic.ifElse (Classes.classIsSatisfiedByType className resolvedType) (Right ()) (Left (Errors.ErrorInference (Errors.InferenceErrorOther (Errors.OtherInferenceError {+ Errors.otherInferenceErrorPath = (Paths.SubtermPath (Lists.reverse (Typing.inferenceContextTrace fcx))),+ Errors.otherInferenceErrorMessage = (Strings.concat [+ "Type ",+ (PrintModel.type_ resolvedType),+ " does not satisfy constraint ",+ (Model.unName className)])})))))+ in (Eithers.bind (Eithers.mapSet checkClass (Model.typeVariableConstraintsClasses varConstraints)) (\_ -> Right ()))))+ in (Eithers.bind (Eithers.mapList checkOne (Maps.toList constraints)) (\_ -> Right ()))++-- | Add (term variable, type scheme) pairs to the graph's bound types+extendContext :: [(Model.Name, Model.TypeScheme)] -> Graph.Graph -> Graph.Graph+extendContext pairs cx =+ Graph.Graph {+ Graph.graphBoundTerms = (Graph.graphBoundTerms cx),+ Graph.graphBoundTypes = (Maps.union (Maps.fromList pairs) (Graph.graphBoundTypes cx)),+ Graph.graphClassConstraints = (Graph.graphClassConstraints cx),+ Graph.graphLambdaVariables = (Graph.graphLambdaVariables cx),+ Graph.graphMetadata = (Graph.graphMetadata cx),+ Graph.graphPrimitives = (Graph.graphPrimitives cx),+ Graph.graphSchemaTypes = (Graph.graphSchemaTypes cx),+ Graph.graphTypeVariables = (Graph.graphTypeVariables cx)}++-- | Finalize an inferred term by checking for unbound type variables, then normalizing type variables+finalizeInferredTerm :: t0 -> Graph.Graph -> Model.Term -> Either Errors.Error Model.Term+finalizeInferredTerm flowCx cx term =++ let term2 = bindUnboundTypeVariables cx term+ in (Eithers.bind (Checking.checkForUnboundTypeVariables flowCx cx term2) (\_ -> Right (Variables.normalizeTypeVariablesInTerm term2)))++-- | Infer a term's type and map over the result+forInferredTerm :: Typing.InferenceContext -> Graph.Graph -> Model.Term -> String -> (Typing.InferenceResult -> t0) -> Either Errors.Error (t0, Typing.InferenceContext)+forInferredTerm fcx cx term desc f =+ Eithers.bind (inferTypeOfTerm fcx cx term desc) (\rp -> Right (f rp, (Typing.inferenceResultContext rp)))++-- | Get all free variables in a graph's bound types+freeVariablesInContext :: Graph.Graph -> S.Set Model.Name+freeVariablesInContext cx =+ Lists.foldl Sets.union Sets.empty (Lists.map Variables.freeVariablesInTypeSchemeSimple (Maps.elems (Graph.graphBoundTypes cx)))++-- | Generate a fresh type variable+freshVariableType :: Typing.InferenceContext -> (Model.Type, Typing.InferenceContext)+freshVariableType cx =++ let result = Names.freshName cx+ name = Pairs.first result+ cx2 = Pairs.second result+ in (Model.TypeVariable name, cx2)++-- | Generalize a type to a type scheme. Paper: inference.tex, gen() and rule Gen.+generalize :: Graph.Graph -> Model.Type -> Model.TypeScheme+generalize cx typ =++ let isTypeVarName =+ \name ->+ let parts = Strings.splitOn "." (Model.unName name)+ in (Ordering.lte (Lists.length parts) 1)+ vars =+ Lists.distinct (Lists.filter (\v -> Logic.and (isUnbound cx v) (isTypeVarName v)) (Variables.freeVariablesInTypeOrdered typ))+ allConstraints = Graph.graphClassConstraints cx+ relevantConstraints =+ Maps.fromList (Optionals.givens (Lists.map (\v -> Optionals.map (\meta -> (v, meta)) (Maps.lookup v allConstraints)) vars))+ in Model.TypeScheme {+ Model.typeSchemeVariables = vars,+ Model.typeSchemeBody = typ,+ Model.typeSchemeConstraints = relevantConstraints}++-- | Return the first element of a list, or Left(Other) with the given description if the list is empty+headOrFail :: String -> [t0] -> Either Errors.Error t0+headOrFail desc xs =+ Optionals.match (Lists.head xs) (Left (Errors.ErrorOther (Errors.OtherError (Strings.concat2 "headOrFail: " desc)))) (\x -> Right x)++-- | Infer types for all elements in a graph, using the provided ordered bindings. Returns both the inferred graph and the ordered inferred bindings. Paper: inference.tex, the SCC treatment of cycles (section introduction); the whole graph is one mutually recursive let.+inferGraphTypes :: Typing.InferenceContext -> [Model.Binding] -> Graph.Graph -> Either Errors.Error ((Graph.Graph, [Model.Binding]), Typing.InferenceContext)+inferGraphTypes fcx0 bindings0 g0 =++ let fcx = fcx0+ let0 =+ Model.Let {+ Model.letBindings = bindings0,+ Model.letBody = Model.TermUnit}+ fromLetTerm =+ \l ->+ let bindings = Model.letBindings l+ prims = Graph.graphPrimitives g0+ schemaTypes = Graph.graphSchemaTypes g0+ rawG = Lexical.buildGraph bindings Maps.empty prims+ g =+ Graph.Graph {+ Graph.graphBoundTerms = (Graph.graphBoundTerms rawG),+ Graph.graphBoundTypes = (Graph.graphBoundTypes rawG),+ Graph.graphClassConstraints = (Graph.graphClassConstraints rawG),+ Graph.graphLambdaVariables = (Graph.graphLambdaVariables rawG),+ Graph.graphMetadata = (Graph.graphMetadata rawG),+ Graph.graphPrimitives = (Graph.graphPrimitives rawG),+ Graph.graphSchemaTypes = schemaTypes,+ Graph.graphTypeVariables = (Graph.graphTypeVariables rawG)}+ in (g, bindings)+ in (Eithers.bind (inferTypeOfTerm fcx g0 (Model.TermLet let0) "graph term") (\result ->+ let fcx2 = Typing.inferenceResultContext result+ term = Typing.inferenceResultTerm result+ in (Eithers.bind (dischargeClassConstraints fcx2 (Typing.inferenceResultSubst result) (Typing.inferenceResultClassConstraints result)) (\_ -> Eithers.bind (finalizeInferredTerm fcx2 g0 term) (\finalized -> case finalized of+ Model.TermLet v0 -> Right (fromLetTerm v0, fcx2)+ Model.TermVariable _ -> Left (Errors.ErrorInference (Errors.InferenceErrorOther (Errors.OtherInferenceError {+ Errors.otherInferenceErrorPath = (Paths.SubtermPath (Lists.reverse (Typing.inferenceContextTrace fcx2))),+ Errors.otherInferenceErrorMessage = "Expected inferred graph as let term"}))))))))++-- | Infer the type of a term in a given inference context+inferInGraphContext :: Typing.InferenceContext -> Graph.Graph -> Model.Term -> Either Errors.Error Typing.InferenceResult+inferInGraphContext fcx cx term = inferTypeOfTerm fcx cx term "single term"++-- | Infer types for multiple terms, propagating class constraints from sub-expressions+inferMany :: Typing.InferenceContext -> Graph.Graph -> [(Model.Term, String)] -> Either Errors.Error (+ ([Model.Term], ([Model.Type], (Typing.TypeSubst, (M.Map Model.Name Model.TypeVariableConstraints)))),+ Typing.InferenceContext)+inferMany fcx cx pairs =++ let emptyResult = Right (([], ([], (Substitution.idTypeSubst, Maps.empty))), fcx)+ in (Optionals.match (Lists.uncons pairs) emptyResult (\pairsUc ->+ let headPair = Pairs.first pairsUc+ tl = Pairs.second pairsUc+ e = Pairs.first headPair+ desc = Pairs.second headPair+ in (Eithers.bind (inferTypeOfTerm fcx cx e desc) (\result1 ->+ let fcx2 = Typing.inferenceResultContext result1+ e1 = Typing.inferenceResultTerm result1+ t1 = Typing.inferenceResultType result1+ s1 = Typing.inferenceResultSubst result1+ c1 = Typing.inferenceResultClassConstraints result1+ in (Eithers.bind (inferMany fcx2 (Substitution.substInContext s1 cx) tl) (\rp2 ->+ let result2 = Pairs.first rp2+ fcx3 = Pairs.second rp2+ e2 = Pairs.first result2+ t2 = Pairs.first (Pairs.second result2)+ s2 = Pairs.first (Pairs.second (Pairs.second result2))+ c2 = Pairs.second (Pairs.second (Pairs.second result2))+ c1Subst = Substitution.substInClassConstraints s2 c1+ mergedConstraints = mergeClassConstraints c1Subst c2+ in (Right (+ (+ Lists.cons (Substitution.substTypesInTerm s2 e1) e2,+ (Lists.cons (Substitution.substInType s2 t1) t2, (Substitution.composeTypeSubst s1 s2, mergedConstraints))),+ fcx3))))))))++-- | Map a possibly untyped term to a fully typed term and its type+inferTypeOf :: Typing.InferenceContext -> Graph.Graph -> Model.Term -> Either Errors.Error ((Model.Term, Model.TypeScheme), Typing.InferenceContext)+inferTypeOf fcx cx term =++ let letTerm =+ Model.TermLet (Model.Let {+ Model.letBindings = [+ Model.Binding {+ Model.bindingName = (Model.Name "ignoredVariableName"),+ Model.bindingTerm = term,+ Model.bindingTypeScheme = Nothing}],+ Model.letBody = (Model.TermLiteral (Model.LiteralString "ignoredBody"))})+ in (Eithers.bind (inferTypeOfTerm fcx cx letTerm "infer type of term") (\result ->+ let fcx2 = Typing.inferenceResultContext result+ in (Eithers.bind (dischargeClassConstraints fcx2 (Typing.inferenceResultSubst result) (Typing.inferenceResultClassConstraints result)) (\_ -> Eithers.bind (finalizeInferredTerm fcx2 cx (Typing.inferenceResultTerm result)) (\finalized -> Eithers.bind (ExtractModel.let_ cx finalized) (\letResult ->+ let bindings = Model.letBindings letResult+ in (Logic.ifElse (Equality.equal 1 (Lists.length bindings)) (Eithers.bind (headOrFail "inferTypeOf: single binding expected" bindings) (\binding ->+ let term1 = Model.bindingTerm binding+ mts = Model.bindingTypeScheme binding+ in (Optionals.match mts (Left (Errors.ErrorInference (Errors.InferenceErrorOther (Errors.OtherInferenceError {+ Errors.otherInferenceErrorPath = (Paths.SubtermPath (Lists.reverse (Typing.inferenceContextTrace fcx2))),+ Errors.otherInferenceErrorMessage = "Expected a type scheme"})))) (\ts -> Right ((term1, ts), fcx2))))) (Left (Errors.ErrorInference (Errors.InferenceErrorOther (Errors.OtherInferenceError {+ Errors.otherInferenceErrorPath = (Paths.SubtermPath (Lists.reverse (Typing.inferenceContextTrace fcx2))),+ Errors.otherInferenceErrorMessage = (Strings.concat [+ "Expected a single binding with a type scheme, but got: ",+ (Literals.printInt32 (Lists.length bindings)),+ " bindings"])})))))))))))++-- | Infer the type of an annotated term (Either version). Paper: inference.tex, rule Ann.+inferTypeOfAnnotatedTerm :: Typing.InferenceContext -> Graph.Graph -> Model.AnnotatedTerm -> Either Errors.Error Typing.InferenceResult+inferTypeOfAnnotatedTerm fcx cx at =++ let term = Model.annotatedTermBody at+ ann = Model.annotatedTermAnnotation at+ fcxBody = Names.pushSubtermStep Paths.SubtermStepAnnotatedBody fcx+ in (Eithers.bind (inferTypeOfTerm fcxBody cx term "annotated term") (\result ->+ let fcx2 = Names.restoreTrace fcx (Typing.inferenceResultContext result)+ iterm = Typing.inferenceResultTerm result+ itype = Typing.inferenceResultType result+ isubst = Typing.inferenceResultSubst result+ iconstraints = Typing.inferenceResultClassConstraints result+ in (Right (Typing.InferenceResult {+ Typing.inferenceResultTerm = (Model.TermAnnotated (Model.AnnotatedTerm {+ Model.annotatedTermBody = iterm,+ Model.annotatedTermAnnotation = ann})),+ Typing.inferenceResultType = itype,+ Typing.inferenceResultSubst = isubst,+ Typing.inferenceResultClassConstraints = iconstraints,+ Typing.inferenceResultContext = fcx2}))))++-- | Infer the type of a function application (Either version). Paper: inference.tex, rule App (elaboration form).+inferTypeOfApplication :: Typing.InferenceContext -> Graph.Graph -> Model.Application -> Either Errors.Error Typing.InferenceResult+inferTypeOfApplication fcx0 cx app =++ let e0 = Model.applicationFunction app+ e1 = Model.applicationArgument app+ fcxFun = Names.pushSubtermStep Paths.SubtermStepApplicationFunction fcx0+ in (Eithers.bind (inferTypeOfTerm fcxFun cx e0 "lhs") (\lhsResult ->+ let fcx2 = Names.restoreTrace fcx0 (Typing.inferenceResultContext lhsResult)+ a = Typing.inferenceResultTerm lhsResult+ t0 = Typing.inferenceResultType lhsResult+ s0 = Typing.inferenceResultSubst lhsResult+ c0 = Typing.inferenceResultClassConstraints lhsResult+ fcxArg = Names.pushSubtermStep Paths.SubtermStepApplicationArgument fcx2+ in (Eithers.bind (inferTypeOfTerm fcxArg (Substitution.substInContext s0 cx) e1 "rhs") (\rhsResult ->+ let fcx3 = Names.restoreTrace fcx0 (Typing.inferenceResultContext rhsResult)+ b = Typing.inferenceResultTerm rhsResult+ t1 = Typing.inferenceResultType rhsResult+ s1 = Typing.inferenceResultSubst rhsResult+ c1 = Typing.inferenceResultClassConstraints rhsResult+ vResult = Names.freshName fcx3+ v = Pairs.first vResult+ fcx4 = Pairs.second vResult+ in (Eithers.bind (Eithers.bimap (\_e -> Errors.ErrorInference (Errors.InferenceErrorUnification (Errors.UnificationInferenceError {+ Errors.unificationInferenceErrorPath = (Paths.SubtermPath (Lists.reverse (Typing.inferenceContextTrace fcx4))),+ Errors.unificationInferenceErrorCause = _e}))) (\_a -> _a) (Unification.unifyTypes fcx4 (Graph.graphSchemaTypes cx) (Substitution.substInType s1 t0) (Model.TypeFunction (Model.FunctionType {+ Model.functionTypeDomain = t1,+ Model.functionTypeCodomain = (Model.TypeVariable v)})) "application lhs")) (\s2 -> Eithers.bind (Checking.checkTypeSubst fcx4 cx s2) (\_ ->+ let rExpr =+ Model.TermApplication (Model.Application {+ Model.applicationFunction = (Substitution.substTypesInTerm (Substitution.composeTypeSubst s1 s2) a),+ Model.applicationArgument = (Substitution.substTypesInTerm s2 b)})+ rType = Substitution.substInType s2 (Model.TypeVariable v)+ rSubst =+ Substitution.composeTypeSubstList [+ s0,+ s1,+ s2]+ c0Subst = Substitution.substInClassConstraints s2 (Substitution.substInClassConstraints s1 c0)+ c1Subst = Substitution.substInClassConstraints s2 c1+ rConstraints = mergeClassConstraints c0Subst c1Subst+ in (Right (Typing.InferenceResult {+ Typing.inferenceResultTerm = rExpr,+ Typing.inferenceResultType = rType,+ Typing.inferenceResultSubst = rSubst,+ Typing.inferenceResultClassConstraints = rConstraints,+ Typing.inferenceResultContext = fcx4})))))))))++-- | Infer the type of a case statement (Either version). Paper: inference.tex, rules Case and Case_d.+inferTypeOfCaseStatement :: Typing.InferenceContext -> Graph.Graph -> Model.CaseStatement -> Either Errors.Error Typing.InferenceResult+inferTypeOfCaseStatement fcx cx caseStmt =++ let tname = Model.caseStatementTypeName caseStmt+ dflt = Model.caseStatementDefault caseStmt+ match = Model.caseStatementCases caseStmt+ fnames = Lists.map Model.caseAlternativeName match+ in (Eithers.bind (Resolution.requireSchemaType fcx (Graph.graphSchemaTypes cx) tname) (\stRp ->+ let schemaType = Pairs.first stRp+ fcx2 = Pairs.second stRp+ svars = Model.typeSchemeVariables schemaType+ stype = Model.typeSchemeBody schemaType+ in (Eithers.bind (ExtractModel.unionType tname stype) (\sfields ->+ let fcxDflt = Names.pushSubtermStep Paths.SubtermStepCasesDefault fcx2+ in (Eithers.bind (Eithers.mapOptional (\t -> inferTypeOfTerm fcxDflt cx t (Strings.concat [+ "case ",+ (Model.unName tname),+ ".<default>"])) dflt) (\dfltRp ->+ let dfltResult = dfltRp+ fcx3 = Optionals.withDefault fcx2 (Optionals.map (\_r -> Names.restoreTrace fcx2 (Typing.inferenceResultContext _r)) dfltRp)+ in (Eithers.bind (inferMany fcx3 cx (Lists.map (\f -> (+ Model.caseAlternativeHandler f,+ (Strings.concat [+ "case ",+ (Model.unName tname),+ ".",+ (Model.unName (Model.caseAlternativeName f))]))) match)) (\caseRp ->+ let caseResults = Pairs.first caseRp+ fcx4 = Pairs.second caseRp+ iterms = Pairs.first caseResults+ itypes = Pairs.first (Pairs.second caseResults)+ isubst = Pairs.first (Pairs.second (Pairs.second caseResults))+ caseElemConstraints = Pairs.second (Pairs.second (Pairs.second caseResults))+ codvResult = Names.freshName fcx4+ codv = Pairs.first codvResult+ fcx5 = Pairs.second codvResult+ cod = Model.TypeVariable codv+ caseMap = Maps.fromList (Lists.map (\ft -> (Model.fieldTypeName ft, (Model.fieldTypeType ft))) sfields)+ dfltConstraints =+ Optionals.toList (Optionals.map (\r -> Typing.TypeConstraint {+ Typing.typeConstraintLeft = cod,+ Typing.typeConstraintRight = (Substitution.substInType isubst (Typing.inferenceResultType r)),+ Typing.typeConstraintComment = "match default"}) dfltResult)+ caseConstraints =+ Optionals.givens (Lists.zipWith (\fname -> \itype -> Optionals.map (\ftype -> Typing.TypeConstraint {+ Typing.typeConstraintLeft = itype,+ Typing.typeConstraintRight = (Model.TypeFunction (Model.FunctionType {+ Model.functionTypeDomain = ftype,+ Model.functionTypeCodomain = cod})),+ Typing.typeConstraintComment = "case type"}) (Maps.lookup fname caseMap)) fnames itypes)+ dfltClassConstraints = Optionals.withDefault Maps.empty (Optionals.map Typing.inferenceResultClassConstraints dfltResult)+ allElemConstraints = mergeClassConstraints caseElemConstraints dfltClassConstraints+ in (Eithers.bind (mapConstraints fcx5 cx (\subst -> yieldWithConstraints fcx5 (buildTypeApplicationTerm svars (Model.TermCases (Model.CaseStatement {+ Model.caseStatementTypeName = tname,+ Model.caseStatementDefault = (Optionals.map Typing.inferenceResultTerm dfltResult),+ Model.caseStatementCases = (Lists.zipWith (\n -> \t -> Model.CaseAlternative {+ Model.caseAlternativeName = n,+ Model.caseAlternativeHandler = t}) fnames iterms)}))) (Model.TypeFunction (Model.FunctionType {+ Model.functionTypeDomain = (Resolution.nominalApplication tname (Lists.map (\x -> Model.TypeVariable x) svars)),+ Model.functionTypeCodomain = cod})) (Substitution.composeTypeSubstList (Lists.concat [+ Optionals.toList (Optionals.map Typing.inferenceResultSubst dfltResult),+ [+ isubst,+ subst]])) (Substitution.substInClassConstraints subst allElemConstraints)) (Lists.concat [+ dfltConstraints,+ caseConstraints])) (\mcResult -> Right mcResult))))))))))++-- | Infer the type of a collection. The classNames parameter specifies type classes (e.g. ordering) that the element type variable must satisfy. Paper: inference.tex, shared implementation of the collection introduction rules (Lst_0/Lst_+, Set_0/Set_+).+inferTypeOfCollection :: Typing.InferenceContext -> Graph.Graph -> (Model.Type -> Model.Type) -> ([Model.Term] -> Model.Term) -> String -> S.Set Model.Name -> [Model.Term] -> Either Errors.Error Typing.InferenceResult+inferTypeOfCollection fcx cx typCons trmCons desc classNames els =++ let varResult = Names.freshName fcx+ var = Pairs.first varResult+ fcx2 = Pairs.second varResult+ classConstraints =+ Logic.ifElse (Sets.isEmpty classNames) Maps.empty (Maps.singleton var (Model.TypeVariableConstraints {+ Model.typeVariableConstraintsClasses = (Sets.map (\n -> Model.TypeClassConstraintSimple n) classNames)}))+ in (Logic.ifElse (Lists.isEmpty els) (Right (yieldWithConstraints fcx2 (buildTypeApplicationTerm [+ var] (trmCons [])) (typCons (Model.TypeVariable var)) Substitution.idTypeSubst classConstraints)) (Eithers.bind (inferMany fcx2 cx (Lists.zip els (Lists.map (\i -> Strings.concat [+ "#",+ (Literals.printInt32 i)]) (Math.range 1 (Math.add (Lists.length els) 1))))) (\resultsRp ->+ let results = Pairs.first resultsRp+ fcx3 = Pairs.second resultsRp+ terms = Pairs.first results+ types = Pairs.first (Pairs.second results)+ subst1 = Pairs.first (Pairs.second (Pairs.second results))+ elemConstraints = Pairs.second (Pairs.second (Pairs.second results))+ constraints =+ Lists.map (\t -> Typing.TypeConstraint {+ Typing.typeConstraintLeft = (Model.TypeVariable var),+ Typing.typeConstraintRight = t,+ Typing.typeConstraintComment = desc}) types+ allConstraints = mergeClassConstraints classConstraints elemConstraints+ in (Eithers.bind (mapConstraints fcx3 cx (\subst2 ->+ let iterm = trmCons terms+ itype = typCons (Model.TypeVariable var)+ isubst = Substitution.composeTypeSubst subst1 subst2+ in (yieldWithConstraints fcx3 iterm itype isubst (Substitution.substInClassConstraints subst2 allConstraints))) constraints) (\mcResult -> Right mcResult)))))++-- | Infer the type of an either value (Either version). Paper: inference.tex, rules Eith_L and Eith_R.+inferTypeOfEither :: Typing.InferenceContext -> Graph.Graph -> Either Model.Term Model.Term -> Either Errors.Error Typing.InferenceResult+inferTypeOfEither fcx cx e =+ Eithers.either (\l -> Eithers.bind (inferTypeOfTerm fcx cx l "either left value") (\r1 ->+ let fcx2 = Typing.inferenceResultContext r1+ iterm = Typing.inferenceResultTerm r1+ leftType = Typing.inferenceResultType r1+ subst = Typing.inferenceResultSubst r1+ fvResult = freshVariableType fcx2+ rightType = Pairs.first fvResult+ fcx3 = Pairs.second fvResult+ eitherTerm = Model.TermEither (Left iterm)+ termWithLeftType =+ Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = eitherTerm,+ Model.typeApplicationTermType = leftType})+ termWithBothTypes =+ Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = termWithLeftType,+ Model.typeApplicationTermType = rightType})+ eitherType =+ Model.TypeEither (Model.EitherType {+ Model.eitherTypeLeft = leftType,+ Model.eitherTypeRight = rightType})+ in (Right (yieldChecked fcx3 termWithBothTypes eitherType subst)))) (\r -> Eithers.bind (inferTypeOfTerm fcx cx r "either right value") (\r1 ->+ let fcx2 = Typing.inferenceResultContext r1+ iterm = Typing.inferenceResultTerm r1+ rightType = Typing.inferenceResultType r1+ subst = Typing.inferenceResultSubst r1+ fvResult = freshVariableType fcx2+ leftType = Pairs.first fvResult+ fcx3 = Pairs.second fvResult+ eitherTerm = Model.TermEither (Right iterm)+ termWithLeftType =+ Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = eitherTerm,+ Model.typeApplicationTermType = leftType})+ termWithBothTypes =+ Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = termWithLeftType,+ Model.typeApplicationTermType = rightType})+ eitherType =+ Model.TypeEither (Model.EitherType {+ Model.eitherTypeLeft = leftType,+ Model.eitherTypeRight = rightType})+ in (Right (yieldChecked fcx3 termWithBothTypes eitherType subst)))) e++-- | Infer the type of a union injection (Either version). Paper: inference.tex, rule Inj.+inferTypeOfInjection :: Typing.InferenceContext -> Graph.Graph -> Model.Injection -> Either Errors.Error Typing.InferenceResult+inferTypeOfInjection fcx cx injection =++ let tname = Model.injectionTypeName injection+ field = Model.injectionField injection+ fname = Model.fieldName field+ term = Model.fieldTerm field+ fcxInj = Names.pushSubtermStep (Paths.SubtermStepInjectField fname) fcx+ in (Eithers.bind (inferTypeOfTerm fcxInj cx term "injected term") (\result ->+ let fcx2 = Names.restoreTrace fcx (Typing.inferenceResultContext result)+ in (Eithers.bind (Resolution.requireSchemaType fcx2 (Graph.graphSchemaTypes cx) tname) (\stRp ->+ let schemaType = Pairs.first stRp+ fcx3 = Pairs.second stRp+ svars = Model.typeSchemeVariables schemaType+ stype = Model.typeSchemeBody schemaType+ iterm = Typing.inferenceResultTerm result+ ityp = Typing.inferenceResultType result+ isubst = Typing.inferenceResultSubst result+ iconstraints = Typing.inferenceResultClassConstraints result+ in (Eithers.bind (ExtractModel.unionType tname stype) (\sfields -> Eithers.bind (Resolution.findFieldType fcx3 fname sfields) (\ftyp -> Eithers.bind (mapConstraints fcx3 cx (\subst -> Logic.ifElse (Maps.isEmpty iconstraints) (yield fcx3 (buildTypeApplicationTerm svars (Model.TermInject (Model.Injection {+ Model.injectionTypeName = tname,+ Model.injectionField = Model.Field {+ Model.fieldName = fname,+ Model.fieldTerm = iterm}}))) (Resolution.nominalApplication tname (Lists.map (\x -> Model.TypeVariable x) svars)) (Substitution.composeTypeSubst isubst subst)) (yieldWithConstraints fcx3 (buildTypeApplicationTerm svars (Model.TermInject (Model.Injection {+ Model.injectionTypeName = tname,+ Model.injectionField = Model.Field {+ Model.fieldName = fname,+ Model.fieldTerm = iterm}}))) (Resolution.nominalApplication tname (Lists.map (\x -> Model.TypeVariable x) svars)) (Substitution.composeTypeSubst isubst subst) (Substitution.substInClassConstraints subst iconstraints))) [+ Typing.TypeConstraint {+ Typing.typeConstraintLeft = ftyp,+ Typing.typeConstraintRight = ityp,+ Typing.typeConstraintComment = "schema type of injected field"}]) (\mcResult -> Right mcResult))))))))++-- | Infer the type of a lambda function (Either version). Paper: inference.tex, rule Abs (elaboration form).+inferTypeOfLambda :: Typing.InferenceContext -> Graph.Graph -> Model.Lambda -> Either Errors.Error Typing.InferenceResult+inferTypeOfLambda fcx cx lambda =++ let var = Model.lambdaParameter lambda+ body = Model.lambdaBody lambda+ vdomResult = Names.freshName fcx+ vdom = Pairs.first vdomResult+ fcx2 = Pairs.second vdomResult+ dom = Model.TypeVariable vdom+ cx2 =+ extendContext [+ (+ var,+ Model.TypeScheme {+ Model.typeSchemeVariables = [],+ Model.typeSchemeBody = dom,+ Model.typeSchemeConstraints = Maps.empty})] cx+ fcxBody = Names.pushSubtermStep Paths.SubtermStepLambdaBody fcx2+ in (Eithers.bind (inferTypeOfTerm fcxBody cx2 body "lambda body") (\result ->+ let fcx3 = Names.restoreTrace fcx2 (Typing.inferenceResultContext result)+ iterm = Typing.inferenceResultTerm result+ icod = Typing.inferenceResultType result+ isubst = Typing.inferenceResultSubst result+ rdom = Substitution.substInType isubst dom+ rterm =+ Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = var,+ Model.lambdaDomain = (Just rdom),+ Model.lambdaBody = iterm})+ rtype =+ Model.TypeFunction (Model.FunctionType {+ Model.functionTypeDomain = rdom,+ Model.functionTypeCodomain = icod})+ vars =+ Sets.unions [+ Variables.freeVariablesInType rdom,+ (Variables.freeVariablesInType icod),+ (freeVariablesInContext (Substitution.substInContext isubst cx2))]+ cx3 = Substitution.substInContext isubst cx+ iconstraints = Substitution.substInClassConstraints isubst (Typing.inferenceResultClassConstraints result)+ in (Right (Typing.InferenceResult {+ Typing.inferenceResultTerm = rterm,+ Typing.inferenceResultType = rtype,+ Typing.inferenceResultSubst = isubst,+ Typing.inferenceResultClassConstraints = iconstraints,+ Typing.inferenceResultContext = fcx3}))))++-- | Normalize a let term before inferring its type (Either version). The bindings are partitioned into strongly connected components and reorganized as nested lets, one let per SCC, in dependency order. This is the standard Hindley-Milner treatment of mutual recursion: each SCC is generalized once at its boundary (sound, because nothing inside the cluster sees a polymorphic instance of its siblings), and acyclic bindings generalize individually as usual. Paper: inference.tex, the SCC treatment of cycles (section introduction) and the remark following the elaboration-form Let rule.+inferTypeOfLet :: Typing.InferenceContext -> Graph.Graph -> Model.Let -> Either Errors.Error Typing.InferenceResult+inferTypeOfLet fcx0 cx let0 =++ let fcx = fcx0+ bindings0 = Model.letBindings let0+ body0 = Model.letBody let0+ names = Lists.map Model.bindingName bindings0+ nameSet = Sets.fromList names+ toPair =+ \binding ->+ let name = Model.bindingName binding+ term = Model.bindingTerm binding+ in (name, (Lists.filter (\n -> Sets.member n nameSet) (Sets.toList (Variables.freeVariablesInTerm term))))+ adjList = Lists.map toPair bindings0+ groups = Sorting.topologicalSortComponents adjList+ bindingMap = Maps.fromList (Lists.zip names bindings0)+ createLet =+ \e -> \group -> Model.TermLet (Model.Let {+ Model.letBindings = (Optionals.givens (Lists.map (\n -> Maps.lookup n bindingMap) group)),+ Model.letBody = e})+ rewrittenLet = Lists.foldl createLet body0 (Lists.reverse groups)+ restoreLet =+ \iterm ->+ let helper =+ \level -> \bins -> \term ->+ let nonzero =+ \term2 -> case term2 of+ Model.TermLet v0 ->+ let bs = Model.letBindings v0+ letBody = Model.letBody v0+ in (helper (Math.sub level 1) (Lists.concat [+ bs,+ bins]) letBody)+ in (Logic.ifElse (Equality.equal level 0) (bins, term) (nonzero term))+ result = helper (Lists.length groups) [] iterm+ bindingList = Pairs.first result+ e = Pairs.second result+ bindingMap2 = Maps.fromList (Lists.map (\b -> (Model.bindingName b, b)) bindingList)+ in (Model.TermLet (Model.Let {+ Model.letBindings = (Optionals.givens (Lists.map (\n -> Maps.lookup n bindingMap2) names)),+ Model.letBody = e}))+ rewriteResult =+ \iresult ->+ let fcxR = Typing.inferenceResultContext iresult+ iterm = Typing.inferenceResultTerm iresult+ itype = Typing.inferenceResultType iresult+ isubst = Typing.inferenceResultSubst iresult+ iconstraints = Typing.inferenceResultClassConstraints iresult+ in Typing.InferenceResult {+ Typing.inferenceResultTerm = (restoreLet iterm),+ Typing.inferenceResultType = itype,+ Typing.inferenceResultSubst = isubst,+ Typing.inferenceResultClassConstraints = iconstraints,+ Typing.inferenceResultContext = fcxR}+ res =+ case rewrittenLet of+ Model.TermLet v0 -> inferTypeOfLetNormalized fcx cx v0+ _ -> inferTypeOfTerm fcx cx rewrittenLet "empty let term"+ in (Eithers.map rewriteResult res)++-- | Infer the type of a let (letrec) term which is already in a normal form (Either version). Paper: inference.tex, rule Let (elaboration form).+inferTypeOfLetNormalized :: Typing.InferenceContext -> Graph.Graph -> Model.Let -> Either Errors.Error Typing.InferenceResult+inferTypeOfLetNormalized fcx0 cx0 letTerm =++ let fcx = fcx0+ bins0 = Model.letBindings letTerm+ body0 = Model.letBody letTerm+ bnames = Lists.map Model.bindingName bins0+ bvarsResult = Names.freshNames (Lists.length bins0) fcx+ bvars = Pairs.first bvarsResult+ fcx2 = Pairs.second bvarsResult+ tbins0 = Lists.map (\x -> Model.TypeVariable x) bvars+ cx1 =+ extendContext (Lists.zip bnames (Lists.map (\t -> Model.TypeScheme {+ Model.typeSchemeVariables = [],+ Model.typeSchemeBody = t,+ Model.typeSchemeConstraints = Maps.empty}) tbins0)) cx0+ in (Eithers.bind (inferTypesOfTemporaryBindings fcx2 cx1 bins0) (\irRp ->+ let inferredResult = Pairs.first irRp+ fcx3 = Pairs.second irRp+ bterms1 = Pairs.first inferredResult+ tbins1 = Pairs.first (Pairs.second inferredResult)+ substAndConstraints = Pairs.second (Pairs.second inferredResult)+ s1 = Pairs.first substAndConstraints+ inferredConstraints = Pairs.second substAndConstraints+ in (Eithers.bind (Eithers.bimap (\_e -> Errors.ErrorInference (Errors.InferenceErrorUnification (Errors.UnificationInferenceError {+ Errors.unificationInferenceErrorPath = (Paths.SubtermPath (Lists.reverse (Typing.inferenceContextTrace fcx3))),+ Errors.unificationInferenceErrorCause = _e}))) (\_a -> _a) (Unification.unifyTypeLists fcx3 (Graph.graphSchemaTypes cx0) (Lists.map (Substitution.substInType s1) tbins0) tbins1 "temporary type bindings")) (\s2 -> Eithers.bind (Checking.checkTypeSubst fcx3 cx0 s2) (\_ ->+ let g2base = Substitution.substInContext (Substitution.composeTypeSubst s1 s2) cx0+ constraintsWithS2 = Substitution.substInClassConstraints s2 inferredConstraints+ composedSubst = Substitution.composeTypeSubst s1 s2+ originalBindingConstraints =+ Lists.foldl (\acc -> \b -> Optionals.match (Model.bindingTypeScheme b) acc (\ts -> mergeClassConstraints acc (Model.typeSchemeConstraints ts))) Maps.empty bins0+ originalConstraintsSubst = Substitution.substInClassConstraints composedSubst originalBindingConstraints+ allInferredConstraints = mergeClassConstraints constraintsWithS2 originalConstraintsSubst+ mergedConstraints = mergeClassConstraints (Graph.graphClassConstraints g2base) allInferredConstraints+ g2 =+ Graph.Graph {+ Graph.graphBoundTerms = (Graph.graphBoundTerms g2base),+ Graph.graphBoundTypes = (Graph.graphBoundTypes g2base),+ Graph.graphClassConstraints = mergedConstraints,+ Graph.graphLambdaVariables = (Graph.graphLambdaVariables g2base),+ Graph.graphMetadata = (Graph.graphMetadata g2base),+ Graph.graphPrimitives = (Graph.graphPrimitives g2base),+ Graph.graphSchemaTypes = (Graph.graphSchemaTypes g2base),+ Graph.graphTypeVariables = (Graph.graphTypeVariables g2base)}+ bterms1Subst = Lists.map (Substitution.substTypesInTerm s2) bterms1+ tsbins1 = Lists.zip bnames (Lists.map (\t -> generalize g2 (Substitution.substInType s2 t)) tbins1)+ fcx3Body = Names.pushSubtermStep Paths.SubtermStepLetBody fcx3+ in (Eithers.bind (inferTypeOfTerm fcx3Body (extendContext tsbins1 g2) body0 "let body") (\bodyResult ->+ let fcx4 = Names.restoreTrace fcx3 (Typing.inferenceResultContext bodyResult)+ body1 = Typing.inferenceResultTerm bodyResult+ tbody = Typing.inferenceResultType bodyResult+ sbody = Typing.inferenceResultSubst bodyResult+ st1 =+ Typing.TermSubst (Maps.fromList (Lists.map (\pair ->+ let name = Pairs.first pair+ ts = Pairs.second pair+ in (name, (buildTypeApplicationTerm (Model.typeSchemeVariables ts) (Model.TermVariable name)))) tsbins1))+ createBinding =+ \bindingPair ->+ let nameTsPair = Pairs.first bindingPair+ term = Pairs.second bindingPair+ name = Pairs.first nameTsPair+ ts = Pairs.second nameTsPair+ finalTs = Substitution.substInTypeScheme sbody ts+ typeLambdaTerm =+ Lists.foldl (\b -> \v -> Model.TermTypeLambda (Model.TypeLambda {+ Model.typeLambdaParameter = v,+ Model.typeLambdaBody = b})) (Substitution.substituteInTerm st1 term) (Lists.reverse (Model.typeSchemeVariables finalTs))+ in Model.Binding {+ Model.bindingName = name,+ Model.bindingTerm = (Substitution.substTypesInTerm (Substitution.composeTypeSubst sbody s2) typeLambdaTerm),+ Model.bindingTypeScheme = (Just finalTs)}+ bins1 = Lists.map createBinding (Lists.zip tsbins1 bterms1Subst)+ bodyConstraints = Substitution.substInClassConstraints sbody (Typing.inferenceResultClassConstraints bodyResult)+ bindingConstraintsSubst = Substitution.substInClassConstraints sbody constraintsWithS2+ allConstraints = mergeClassConstraints bindingConstraintsSubst bodyConstraints+ in (Right (Typing.InferenceResult {+ Typing.inferenceResultTerm = (Model.TermLet (Model.Let {+ Model.letBindings = bins1,+ Model.letBody = body1})),+ Typing.inferenceResultType = tbody,+ Typing.inferenceResultSubst = (Substitution.composeTypeSubstList [+ s1,+ s2,+ sbody]),+ Typing.inferenceResultClassConstraints = allConstraints,+ Typing.inferenceResultContext = fcx4})))))))))++-- | Infer the type of a list (Either version). Paper: inference.tex, rules Lst_0 and Lst_+.+inferTypeOfList :: Typing.InferenceContext -> Graph.Graph -> [Model.Term] -> Either Errors.Error Typing.InferenceResult+inferTypeOfList fcx cx =+ inferTypeOfCollection fcx cx (\x -> Model.TypeList x) (\x -> Model.TermList x) "list element" Sets.empty++-- | Infer the type of a literal. Paper: inference.tex, rule Lit.+inferTypeOfLiteral :: Typing.InferenceContext -> Model.Literal -> Typing.InferenceResult+inferTypeOfLiteral fcx lit =+ Typing.InferenceResult {+ Typing.inferenceResultTerm = (Model.TermLiteral lit),+ Typing.inferenceResultType = (Model.TypeLiteral (Reflect.literalType lit)),+ Typing.inferenceResultSubst = Substitution.idTypeSubst,+ Typing.inferenceResultClassConstraints = Maps.empty,+ Typing.inferenceResultContext = fcx}++-- | Infer the type of a map (Either version). Paper: inference.tex, rules Map_0 and Map_+.+inferTypeOfMap :: Typing.InferenceContext -> Graph.Graph -> M.Map Model.Term Model.Term -> Either Errors.Error Typing.InferenceResult+inferTypeOfMap fcx cx m =++ let kvarResult = Names.freshName fcx+ kvar = Pairs.first kvarResult+ fcx2 = Pairs.second kvarResult+ vvarResult = Names.freshName fcx2+ vvar = Pairs.first vvarResult+ fcx3 = Pairs.second vvarResult+ keyConstraints =+ Maps.singleton kvar (Model.TypeVariableConstraints {+ Model.typeVariableConstraintsClasses = (Sets.singleton (Model.TypeClassConstraintSimple (Model.Name "ordering")))})+ in (Logic.ifElse (Maps.isEmpty m) (Right (yieldWithConstraints fcx3 (buildTypeApplicationTerm [+ kvar,+ vvar] (Model.TermMap Maps.empty)) (Model.TypeMap (Model.MapType {+ Model.mapTypeKeys = (Model.TypeVariable kvar),+ Model.mapTypeValues = (Model.TypeVariable vvar)})) Substitution.idTypeSubst keyConstraints)) (Eithers.bind (inferMany fcx3 cx (Lists.map (\k -> (k, "map key")) (Maps.keys m))) (\kRp ->+ let kResults = Pairs.first kRp+ fcx4 = Pairs.second kRp+ kterms = Pairs.first kResults+ ktypes = Pairs.first (Pairs.second kResults)+ ksubst = Pairs.first (Pairs.second (Pairs.second kResults))+ kElemConstraints = Pairs.second (Pairs.second (Pairs.second kResults))+ in (Eithers.bind (inferMany fcx4 (Substitution.substInContext ksubst cx) (Lists.map (\v -> (v, "map value")) (Maps.elems m))) (\vRp ->+ let vResults = Pairs.first vRp+ fcx5 = Pairs.second vRp+ vterms = Pairs.first vResults+ vtypes = Pairs.first (Pairs.second vResults)+ vsubst = Pairs.first (Pairs.second (Pairs.second vResults))+ vElemConstraints = Pairs.second (Pairs.second (Pairs.second vResults))+ kcons =+ Lists.map (\t -> Typing.TypeConstraint {+ Typing.typeConstraintLeft = (Model.TypeVariable kvar),+ Typing.typeConstraintRight = t,+ Typing.typeConstraintComment = "map key"}) ktypes+ vcons =+ Lists.map (\t -> Typing.TypeConstraint {+ Typing.typeConstraintLeft = (Model.TypeVariable vvar),+ Typing.typeConstraintRight = t,+ Typing.typeConstraintComment = "map value"}) vtypes+ allMapConstraints = mergeClassConstraints keyConstraints (mergeClassConstraints kElemConstraints vElemConstraints)+ in (Eithers.bind (mapConstraints fcx5 cx (\subst -> yieldWithConstraints fcx5 (Model.TermMap (Maps.fromList (Lists.zip kterms vterms))) (Model.TypeMap (Model.MapType {+ Model.mapTypeKeys = (Model.TypeVariable kvar),+ Model.mapTypeValues = (Model.TypeVariable vvar)})) (Substitution.composeTypeSubstList [+ ksubst,+ vsubst,+ subst]) (Substitution.substInClassConstraints subst allMapConstraints)) (Lists.concat [+ kcons,+ vcons])) (\mcResult -> Right mcResult)))))))++-- | Infer the type of a Maybe value. Paper: inference.tex, rules Opt_0 and Opt_1.+inferTypeOfOptional :: Typing.InferenceContext -> Graph.Graph -> Maybe Model.Term -> Either Errors.Error Typing.InferenceResult+inferTypeOfOptional fcx cx m =++ let trmCons = \terms -> Model.TermOptional (Lists.head terms)+ in (inferTypeOfCollection fcx cx (\x -> Model.TypeOptional x) trmCons "optional element" Sets.empty (Optionals.match m [] Lists.singleton))++-- | Infer the type of a pair (Either version). Paper: inference.tex, rule Pair.+inferTypeOfPair :: Typing.InferenceContext -> Graph.Graph -> (Model.Term, Model.Term) -> Either Errors.Error Typing.InferenceResult+inferTypeOfPair fcx cx p =+ Eithers.bind (inferMany fcx cx [+ (Pairs.first p, "pair first element"),+ (Pairs.second p, "pair second element")]) (\rp ->+ let results = Pairs.first rp+ fcx2 = Pairs.second rp+ iterms = Pairs.first results+ itypes = Pairs.first (Pairs.second results)+ isubst = Pairs.first (Pairs.second (Pairs.second results))+ pairElemConstraints = Pairs.second (Pairs.second (Pairs.second results))+ in (Eithers.bind (atOrFail 0 "inferTypeOfPair ifst" iterms) (\ifst -> Eithers.bind (atOrFail 1 "inferTypeOfPair isnd" iterms) (\isnd -> Eithers.bind (atOrFail 0 "inferTypeOfPair tyFst" itypes) (\tyFst -> Eithers.bind (atOrFail 1 "inferTypeOfPair tySnd" itypes) (\tySnd ->+ let pairTerm = Model.TermPair (ifst, isnd)+ termWithTypes =+ Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = pairTerm,+ Model.typeApplicationTermType = tyFst})),+ Model.typeApplicationTermType = tySnd})+ in (Right (yieldWithConstraints fcx2 termWithTypes (Model.TypePair (Model.PairType {+ Model.pairTypeFirst = tyFst,+ Model.pairTypeSecond = tySnd})) isubst pairElemConstraints))))))))++-- | Infer the type of a record projection (Either version). Paper: inference.tex, rule Proj.+inferTypeOfProjection :: Typing.InferenceContext -> Graph.Graph -> Model.Projection -> Either Errors.Error Typing.InferenceResult+inferTypeOfProjection fcx cx proj =++ let tname = Model.projectionTypeName proj+ fname = Model.projectionFieldName proj+ in (Eithers.bind (Resolution.requireSchemaType fcx (Graph.graphSchemaTypes cx) tname) (\stRp ->+ let schemaType = Pairs.first stRp+ fcx2 = Pairs.second stRp+ svars = Model.typeSchemeVariables schemaType+ stype = Model.typeSchemeBody schemaType+ in (Eithers.bind (ExtractModel.recordType tname stype) (\sfields -> Eithers.bind (Resolution.findFieldType fcx2 fname sfields) (\ftyp -> Right (yield fcx2 (buildTypeApplicationTerm svars (Model.TermProject (Model.Projection {+ Model.projectionTypeName = tname,+ Model.projectionFieldName = fname}))) (Model.TypeFunction (Model.FunctionType {+ Model.functionTypeDomain = (Resolution.nominalApplication tname (Lists.map (\x -> Model.TypeVariable x) svars)),+ Model.functionTypeCodomain = ftyp})) Substitution.idTypeSubst))))))++-- | Infer the type of a record (Either version). Paper: inference.tex, rule Rec.+inferTypeOfRecord :: Typing.InferenceContext -> Graph.Graph -> Model.Record -> Either Errors.Error Typing.InferenceResult+inferTypeOfRecord fcx cx record =++ let tname = Model.recordTypeName record+ fields = Model.recordFields record+ fnames = Lists.map Model.fieldName fields+ in (Eithers.bind (Resolution.requireSchemaType fcx (Graph.graphSchemaTypes cx) tname) (\stRp ->+ let schemaType = Pairs.first stRp+ fcx2 = Pairs.second stRp+ in (Eithers.bind (inferMany fcx2 cx (Lists.map (\f -> (Model.fieldTerm f, (Strings.concat2 "field " (Model.unName (Model.fieldName f))))) fields)) (\rp ->+ let results = Pairs.first rp+ fcx3 = Pairs.second rp+ svars = Model.typeSchemeVariables schemaType+ stype = Model.typeSchemeBody schemaType+ iterms = Pairs.first results+ itypes = Pairs.first (Pairs.second results)+ isubst = Pairs.first (Pairs.second (Pairs.second results))+ recElemConstraints = Pairs.second (Pairs.second (Pairs.second results))+ ityp =+ Model.TypeRecord (Lists.zipWith (\n -> \t -> Model.FieldType {+ Model.fieldTypeName = n,+ Model.fieldTypeType = t}) fnames itypes)+ in (Eithers.bind (mapConstraints fcx3 cx (\subst -> yieldWithConstraints fcx3 (buildTypeApplicationTerm svars (Model.TermRecord (Model.Record {+ Model.recordTypeName = tname,+ Model.recordFields = (Lists.zipWith (\n -> \t -> Model.Field {+ Model.fieldName = n,+ Model.fieldTerm = t}) fnames iterms)}))) (Resolution.nominalApplication tname (Lists.map (\x -> Model.TypeVariable x) svars)) (Substitution.composeTypeSubst isubst subst) (Substitution.substInClassConstraints subst recElemConstraints)) [+ Typing.TypeConstraint {+ Typing.typeConstraintLeft = stype,+ Typing.typeConstraintRight = ityp,+ Typing.typeConstraintComment = "schema type of record"}]) (\mcResult -> Right mcResult))))))++-- | Infer the type of a set (Either version). Paper: inference.tex, rules Set_0 and Set_+.+inferTypeOfSet :: Typing.InferenceContext -> Graph.Graph -> S.Set Model.Term -> Either Errors.Error Typing.InferenceResult+inferTypeOfSet fcx cx s =+ inferTypeOfCollection fcx cx (\x -> Model.TypeSet x) (\terms -> Model.TermSet (Sets.fromList terms)) "set element" (Sets.singleton (Model.Name "ordering")) (Sets.toList s)++-- | Infer the type of a given term (Either version)+inferTypeOfTerm :: Typing.InferenceContext -> Graph.Graph -> Model.Term -> String -> Either Errors.Error Typing.InferenceResult+inferTypeOfTerm fcx cx term desc =++ let fcx2 = fcx+ in case term of+ Model.TermAnnotated v0 -> inferTypeOfAnnotatedTerm fcx2 cx v0+ Model.TermApplication v0 -> inferTypeOfApplication fcx2 cx v0+ Model.TermCases v0 -> inferTypeOfCaseStatement fcx2 cx v0+ Model.TermEither v0 -> inferTypeOfEither fcx2 cx v0+ Model.TermLambda v0 -> inferTypeOfLambda fcx2 cx v0+ Model.TermLet v0 -> inferTypeOfLet fcx2 cx v0+ Model.TermList v0 -> inferTypeOfList fcx2 cx v0+ Model.TermLiteral v0 -> Right (inferTypeOfLiteral fcx2 v0)+ Model.TermMap v0 -> inferTypeOfMap fcx2 cx v0+ Model.TermOptional v0 -> inferTypeOfOptional fcx2 cx v0+ Model.TermPair v0 -> inferTypeOfPair fcx2 cx v0+ Model.TermProject v0 -> inferTypeOfProjection fcx2 cx v0+ Model.TermRecord v0 -> inferTypeOfRecord fcx2 cx v0+ Model.TermSet v0 -> inferTypeOfSet fcx2 cx v0+ Model.TermTypeApplication v0 -> inferTypeOfTypeApplication fcx2 cx v0+ Model.TermTypeLambda v0 -> inferTypeOfTypeLambda fcx2 cx v0+ Model.TermInject v0 -> inferTypeOfInjection fcx2 cx v0+ Model.TermUnit -> Right (inferTypeOfUnit fcx2)+ Model.TermUnwrap v0 -> inferTypeOfUnwrap fcx2 cx v0+ Model.TermVariable v0 -> inferTypeOfVariable fcx2 cx v0+ Model.TermWrap v0 -> inferTypeOfWrappedTerm fcx2 cx v0++-- | Infer the type of a type application (Either version). Paper: inference.tex, type application terms in the elaborated Term grammar.+inferTypeOfTypeApplication :: Typing.InferenceContext -> Graph.Graph -> Model.TypeApplicationTerm -> Either Errors.Error Typing.InferenceResult+inferTypeOfTypeApplication fcx cx tt =++ let fcxBody = Names.pushSubtermStep Paths.SubtermStepTypeApplicationBody fcx+ in (Eithers.bind (inferTypeOfTerm fcxBody cx (Model.typeApplicationTermBody tt) "type application term") (\result ->+ let fcx2 = Names.restoreTrace fcx (Typing.inferenceResultContext result)+ in (Right (Typing.InferenceResult {+ Typing.inferenceResultTerm = (Typing.inferenceResultTerm result),+ Typing.inferenceResultType = (Typing.inferenceResultType result),+ Typing.inferenceResultSubst = (Typing.inferenceResultSubst result),+ Typing.inferenceResultClassConstraints = (Typing.inferenceResultClassConstraints result),+ Typing.inferenceResultContext = fcx2}))))++-- | Infer the type of a type abstraction (Either version). Paper: inference.tex, type abstraction terms in the elaborated Term grammar.+inferTypeOfTypeLambda :: Typing.InferenceContext -> Graph.Graph -> Model.TypeLambda -> Either Errors.Error Typing.InferenceResult+inferTypeOfTypeLambda fcx cx ta =++ let fcxBody = Names.pushSubtermStep Paths.SubtermStepTypeLambdaBody fcx+ in (Eithers.bind (inferTypeOfTerm fcxBody cx (Model.typeLambdaBody ta) "type abstraction") (\result ->+ let fcx2 = Names.restoreTrace fcx (Typing.inferenceResultContext result)+ in (Right (Typing.InferenceResult {+ Typing.inferenceResultTerm = (Typing.inferenceResultTerm result),+ Typing.inferenceResultType = (Typing.inferenceResultType result),+ Typing.inferenceResultSubst = (Typing.inferenceResultSubst result),+ Typing.inferenceResultClassConstraints = (Typing.inferenceResultClassConstraints result),+ Typing.inferenceResultContext = fcx2}))))++-- | The trivial inference rule for the unit term. Paper: inference.tex, rule Unit.+inferTypeOfUnit :: Typing.InferenceContext -> Typing.InferenceResult+inferTypeOfUnit fcx =+ Typing.InferenceResult {+ Typing.inferenceResultTerm = Model.TermUnit,+ Typing.inferenceResultType = Model.TypeUnit,+ Typing.inferenceResultSubst = Substitution.idTypeSubst,+ Typing.inferenceResultClassConstraints = Maps.empty,+ Typing.inferenceResultContext = fcx}++-- | Infer the type of an unwrap operation (Either version). Paper: inference.tex, rule Unwr.+inferTypeOfUnwrap :: Typing.InferenceContext -> Graph.Graph -> Model.Name -> Either Errors.Error Typing.InferenceResult+inferTypeOfUnwrap fcx cx tname =+ Eithers.bind (Resolution.requireSchemaType fcx (Graph.graphSchemaTypes cx) tname) (\stRp ->+ let schemaType = Pairs.first stRp+ fcx2 = Pairs.second stRp+ svars = Model.typeSchemeVariables schemaType+ stype = Model.typeSchemeBody schemaType+ in (Eithers.bind (ExtractModel.wrappedType tname stype) (\wtyp -> Right (yield fcx2 (buildTypeApplicationTerm svars (Model.TermUnwrap tname)) (Model.TypeFunction (Model.FunctionType {+ Model.functionTypeDomain = (Resolution.nominalApplication tname (Lists.map (\x -> Model.TypeVariable x) svars)),+ Model.functionTypeCodomain = wtyp})) Substitution.idTypeSubst))))++-- | Infer the type of a variable (Either version). Paper: inference.tex, rule Var (elaboration form), with rule Prim as the primitive-namespace fallback.+inferTypeOfVariable :: Typing.InferenceContext -> Graph.Graph -> Model.Name -> Either Errors.Error Typing.InferenceResult+inferTypeOfVariable fcx cx name =+ Optionals.match (Maps.lookup name (Graph.graphBoundTypes cx)) (Optionals.match (Optionals.map (\_p -> Scoping.termSignatureToTypeScheme (Packaging.primitiveDefinitionSignature (Graph.primitiveDefinition _p))) (Maps.lookup name (Graph.graphPrimitives cx))) (Left (Errors.ErrorResolution (Errors.ResolutionErrorNoSuchBinding (Errors.NoSuchBindingError {+ Errors.noSuchBindingErrorName = name})))) (\scheme ->+ let tsResult = Resolution.instantiateTypeScheme fcx scheme+ ts = Pairs.first tsResult+ fcx2 = Pairs.second tsResult+ constraints = Model.typeSchemeConstraints ts+ in (Right (yieldCheckedWithConstraints fcx2 (buildTypeApplicationTerm (Model.typeSchemeVariables ts) (Model.TermVariable name)) (Model.typeSchemeBody ts) Substitution.idTypeSubst constraints)))) (\scheme ->+ let tsResult = Resolution.instantiateTypeScheme fcx scheme+ ts = Pairs.first tsResult+ fcx2 = Pairs.second tsResult+ constraints = Model.typeSchemeConstraints ts+ in (Right (Typing.InferenceResult {+ Typing.inferenceResultTerm = (buildTypeApplicationTerm (Model.typeSchemeVariables ts) (Model.TermVariable name)),+ Typing.inferenceResultType = (Model.typeSchemeBody ts),+ Typing.inferenceResultSubst = Substitution.idTypeSubst,+ Typing.inferenceResultClassConstraints = constraints,+ Typing.inferenceResultContext = fcx2})))++-- | Infer the type of a wrapped term (Either version). Paper: inference.tex, rule Wrp.+inferTypeOfWrappedTerm :: Typing.InferenceContext -> Graph.Graph -> Model.WrappedTerm -> Either Errors.Error Typing.InferenceResult+inferTypeOfWrappedTerm fcx cx wt =++ let tname = Model.wrappedTermTypeName wt+ term = Model.wrappedTermBody wt+ in (Eithers.bind (Resolution.requireSchemaType fcx (Graph.graphSchemaTypes cx) tname) (\stRp ->+ let schemaType = Pairs.first stRp+ fcx2 = Pairs.second stRp+ fcxBody = Names.pushSubtermStep Paths.SubtermStepWrapBody fcx2+ in (Eithers.bind (inferTypeOfTerm fcxBody cx term "wrapped term") (\result ->+ let fcx3 = Names.restoreTrace fcx2 (Typing.inferenceResultContext result)+ svars = Model.typeSchemeVariables schemaType+ stype = Model.typeSchemeBody schemaType+ iterm = Typing.inferenceResultTerm result+ itype = Typing.inferenceResultType result+ isubst = Typing.inferenceResultSubst result+ ityp = Model.TypeWrap itype+ in (Eithers.bind (mapConstraints fcx3 cx (\subst -> yield fcx3 (buildTypeApplicationTerm svars (Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = tname,+ Model.wrappedTermBody = iterm}))) (Resolution.nominalApplication tname (Lists.map (\x -> Model.TypeVariable x) svars)) (Substitution.composeTypeSubst isubst subst)) [+ Typing.TypeConstraint {+ Typing.typeConstraintLeft = stype,+ Typing.typeConstraintRight = ityp,+ Typing.typeConstraintComment = "schema type of wrapper"}]) (\mcResult -> Right mcResult))))))++-- | Infer types for temporary let bindings (Either version)+inferTypesOfTemporaryBindings :: Typing.InferenceContext -> Graph.Graph -> [Model.Binding] -> Either Errors.Error (+ ([Model.Term], ([Model.Type], (Typing.TypeSubst, (M.Map Model.Name Model.TypeVariableConstraints)))),+ Typing.InferenceContext)+inferTypesOfTemporaryBindings fcx cx bins =++ let emptyResult = Right (([], ([], (Substitution.idTypeSubst, Maps.empty))), fcx)+ in (Optionals.match (Lists.uncons bins) emptyResult (\binsUc ->+ let binding = Pairs.first binsUc+ tl = Pairs.second binsUc+ k = Model.bindingName binding+ v = Model.bindingTerm binding+ fcxBind = Names.pushSubtermStep (Paths.SubtermStepLetBinding k) fcx+ in (Eithers.bind (inferTypeOfTerm fcxBind cx v (Strings.concat [+ "temporary let binding '",+ (Model.unName k),+ "'"])) (\result1 ->+ let fcx2 = Names.restoreTrace fcx (Typing.inferenceResultContext result1)+ j = Typing.inferenceResultTerm result1+ u_prime = Typing.inferenceResultType result1+ u = Typing.inferenceResultSubst result1+ c1Inferred = Typing.inferenceResultClassConstraints result1+ in (Eithers.bind (Optionals.match (Model.bindingTypeScheme binding) (Right Maps.empty) (\ts ->+ let tsResult = Resolution.instantiateTypeScheme fcx2 ts+ instantiatedTs = Pairs.first tsResult+ freshConstraints = Model.typeSchemeConstraints instantiatedTs+ in (Eithers.bind (Eithers.bimap (\_e -> Errors.ErrorInference (Errors.InferenceErrorUnification (Errors.UnificationInferenceError {+ Errors.unificationInferenceErrorPath = (Paths.SubtermPath (Lists.reverse (Typing.inferenceContextTrace fcx2))),+ Errors.unificationInferenceErrorCause = _e}))) (\_a -> _a) (Unification.unifyTypes fcx2 (Graph.graphSchemaTypes cx) (Model.typeSchemeBody instantiatedTs) u_prime "original binding type")) (\unifySubst -> Right (Substitution.substInClassConstraints unifySubst freshConstraints))))) (\originalBindingConstraints ->+ let c1 = mergeClassConstraints c1Inferred originalBindingConstraints+ in (Eithers.bind (inferTypesOfTemporaryBindings fcx2 (Substitution.substInContext u cx) tl) (\rp2 ->+ let result2 = Pairs.first rp2+ fcx3 = Pairs.second rp2+ h = Pairs.first result2+ r_prime = Pairs.first (Pairs.second result2)+ restPair = Pairs.second (Pairs.second result2)+ r = Pairs.first restPair+ c2 = Pairs.second restPair+ c1Subst = Substitution.substInClassConstraints r c1+ mergedConstraints = mergeClassConstraints c1Subst c2+ in (Right (+ (+ Lists.cons (Substitution.substTypesInTerm r j) h,+ (Lists.cons (Substitution.substInType r u_prime) r_prime, (Substitution.composeTypeSubst u r, mergedConstraints))),+ fcx3))))))))))++-- | Check if a variable is unbound in context+isUnbound :: Graph.Graph -> Model.Name -> Bool+isUnbound cx v =+ Logic.and (Logic.not (Sets.member v (freeVariablesInContext cx))) (Logic.not (Maps.member v (Graph.graphSchemaTypes cx)))++-- | Map over type constraints after unification+mapConstraints :: Typing.InferenceContext -> Graph.Graph -> (Typing.TypeSubst -> t0) -> [Typing.TypeConstraint] -> Either Errors.Error t0+mapConstraints flowCx cx f constraints =+ Eithers.bind (Eithers.bimap (\_e -> Errors.ErrorInference (Errors.InferenceErrorUnification (Errors.UnificationInferenceError {+ Errors.unificationInferenceErrorPath = (Paths.SubtermPath (Lists.reverse (Typing.inferenceContextTrace flowCx))),+ Errors.unificationInferenceErrorCause = _e}))) (\_a -> _a) (Unification.unifyTypeConstraints flowCx (Graph.graphSchemaTypes cx) constraints)) (\s -> Eithers.bind (Checking.checkTypeSubst flowCx cx s) (\_ -> Right (f s)))++-- | Merge two maps of class constraints. When both maps have constraints for the same variable, union the class sets.+mergeClassConstraints :: Ord t0 => (M.Map t0 Model.TypeVariableConstraints -> M.Map t0 Model.TypeVariableConstraints -> M.Map t0 Model.TypeVariableConstraints)+mergeClassConstraints m1 m2 =+ Lists.foldl (\acc -> \pair ->+ let k = Pairs.first pair+ v = Pairs.second pair+ in (Optionals.match (Maps.lookup k acc) (Maps.insert k v acc) (\existing ->+ let merged =+ Model.TypeVariableConstraints {+ Model.typeVariableConstraintsClasses = (Sets.union (Model.typeVariableConstraintsClasses existing) (Model.typeVariableConstraintsClasses v))}+ in (Maps.insert k merged acc)))) m1 (Maps.toList m2)++-- | Show an inference result for debugging+showInferenceResult :: Typing.InferenceResult -> String+showInferenceResult result =++ let term = Typing.inferenceResultTerm result+ typ = Typing.inferenceResultType result+ subst = Typing.inferenceResultSubst result+ in (Strings.concat [+ "{term=",+ (PrintModel.term term),+ ", type=",+ (PrintModel.type_ typ),+ ", subst=",+ (PrintTyping.typeSubst subst),+ "}"])++-- | Create an inference result with no class constraints+yield :: Typing.InferenceContext -> Model.Term -> Model.Type -> Typing.TypeSubst -> Typing.InferenceResult+yield fcx term typ subst =+ Typing.InferenceResult {+ Typing.inferenceResultTerm = (Substitution.substTypesInTerm subst term),+ Typing.inferenceResultType = (Substitution.substInType subst typ),+ Typing.inferenceResultSubst = subst,+ Typing.inferenceResultClassConstraints = Maps.empty,+ Typing.inferenceResultContext = fcx}++-- | Create a checked inference result+yieldChecked :: Typing.InferenceContext -> Model.Term -> Model.Type -> Typing.TypeSubst -> Typing.InferenceResult+yieldChecked fcx term typ subst =++ let iterm = Substitution.substTypesInTerm subst term+ itype = Substitution.substInType subst typ+ in Typing.InferenceResult {+ Typing.inferenceResultTerm = iterm,+ Typing.inferenceResultType = itype,+ Typing.inferenceResultSubst = subst,+ Typing.inferenceResultClassConstraints = Maps.empty,+ Typing.inferenceResultContext = fcx}++-- | Create a checked inference result with class constraints+yieldCheckedWithConstraints :: Typing.InferenceContext -> Model.Term -> Model.Type -> Typing.TypeSubst -> M.Map Model.Name Model.TypeVariableConstraints -> Typing.InferenceResult+yieldCheckedWithConstraints fcx term typ subst constraints =++ let iterm = Substitution.substTypesInTerm subst term+ itype = Substitution.substInType subst typ+ iconstraints = Substitution.substInClassConstraints subst constraints+ in Typing.InferenceResult {+ Typing.inferenceResultTerm = iterm,+ Typing.inferenceResultType = itype,+ Typing.inferenceResultSubst = subst,+ Typing.inferenceResultClassConstraints = iconstraints,+ Typing.inferenceResultContext = fcx}++-- | Create an inference result with class constraints+yieldWithConstraints :: Typing.InferenceContext -> Model.Term -> Model.Type -> Typing.TypeSubst -> M.Map Model.Name Model.TypeVariableConstraints -> Typing.InferenceResult+yieldWithConstraints fcx term typ subst constraints =+ Typing.InferenceResult {+ Typing.inferenceResultTerm = (Substitution.substTypesInTerm subst term),+ Typing.inferenceResultType = (Substitution.substInType subst typ),+ Typing.inferenceResultSubst = subst,+ Typing.inferenceResultClassConstraints = constraints,+ Typing.inferenceResultContext = fcx}
@@ -0,0 +1,3300 @@+-- Note: this is an automatically generated file. Do not edit.++-- | A module which provides a minimal typing environment for decoding other modules from JSON. This avoids certain problems with generating entire source modules into target languages like Java, which is subject to method size limits for large modules like hydra.core.model.++module Hydra.Core.Json.Bootstrap where++import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Error.Checking as Checking+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void+import qualified Data.Map as M++-- | A bootstrap typing environment for decoding modules from JSON. Maps each kernel type name to its encoded type, used to seed JSON decoding before the full kernel graph is available.+typesByName :: M.Map Model.Name Model.Type+typesByName =+ M.fromList [+ (+ Model.Name "hydra.core.coders.Adapter",+ (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeForall (Model.ForallType {+ Model.forallTypeParameter = (Model.Name "t1"),+ Model.forallTypeBody = (Model.TypeForall (Model.ForallType {+ Model.forallTypeParameter = (Model.Name "t2"),+ Model.forallTypeBody = (Model.TypeForall (Model.ForallType {+ Model.forallTypeParameter = (Model.Name "v1"),+ Model.forallTypeBody = (Model.TypeForall (Model.ForallType {+ Model.forallTypeParameter = (Model.Name "v2"),+ Model.forallTypeBody = (Model.TypeForall (Model.ForallType {+ Model.forallTypeParameter = (Model.Name "e"),+ Model.forallTypeBody = (Model.TypeRecord [+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "isLossy"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeLiteral Model.LiteralTypeBoolean),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "Whether information may be lost in the course of this adaptation")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "source"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "t1")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "The source type")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "target"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "t2")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "The target type")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "coder"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeApplication (Model.ApplicationType {+ Model.applicationTypeFunction = (Model.TypeApplication (Model.ApplicationType {+ Model.applicationTypeFunction = (Model.TypeApplication (Model.ApplicationType {+ Model.applicationTypeFunction = (Model.TypeVariable (Model.Name "hydra.core.coders.Coder")),+ Model.applicationTypeArgument = (Model.TypeVariable (Model.Name "v1"))})),+ Model.applicationTypeArgument = (Model.TypeVariable (Model.Name "v2"))})),+ Model.applicationTypeArgument = (Model.TypeVariable (Model.Name "e"))})),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "The coder for transforming instances of the source type to instances of the target type")))]))}))}])}))}))}))}))})),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "A two-level bidirectional encoder which adapts types to types and terms to terms")))]))}))),+ (+ Model.Name "hydra.core.coders.AdapterContext",+ (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeRecord [+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "graph"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.graph.Graph")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "The underlying graph of elements and primitives")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "language"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.coders.Language")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "The language being encoded or decoded")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "adapters"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeMap (Model.MapType {+ Model.mapTypeKeys = (Model.TypeVariable (Model.Name "hydra.core.model.Name")),+ Model.mapTypeValues = (Model.TypeApplication (Model.ApplicationType {+ Model.applicationTypeFunction = (Model.TypeApplication (Model.ApplicationType {+ Model.applicationTypeFunction = (Model.TypeApplication (Model.ApplicationType {+ Model.applicationTypeFunction = (Model.TypeApplication (Model.ApplicationType {+ Model.applicationTypeFunction = (Model.TypeApplication (Model.ApplicationType {+ Model.applicationTypeFunction = (Model.TypeVariable (Model.Name "hydra.core.coders.Adapter")),+ Model.applicationTypeArgument = (Model.TypeVariable (Model.Name "hydra.core.model.Type"))})),+ Model.applicationTypeArgument = (Model.TypeVariable (Model.Name "hydra.core.model.Type"))})),+ Model.applicationTypeArgument = (Model.TypeVariable (Model.Name "hydra.core.model.Term"))})),+ Model.applicationTypeArgument = (Model.TypeVariable (Model.Name "hydra.core.model.Term"))})),+ Model.applicationTypeArgument = (Model.TypeVariable (Model.Name "hydra.core.errors.Error"))}))})),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "A map of type names to adapters for those types")))]))}))}]),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "An evaluation context together with a source language and a target language")))]))}))),+ (+ Model.Name "hydra.core.coders.Bicoder",+ (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeForall (Model.ForallType {+ Model.forallTypeParameter = (Model.Name "t1"),+ Model.forallTypeBody = (Model.TypeForall (Model.ForallType {+ Model.forallTypeParameter = (Model.Name "t2"),+ Model.forallTypeBody = (Model.TypeForall (Model.ForallType {+ Model.forallTypeParameter = (Model.Name "v1"),+ Model.forallTypeBody = (Model.TypeForall (Model.ForallType {+ Model.forallTypeParameter = (Model.Name "v2"),+ Model.forallTypeBody = (Model.TypeForall (Model.ForallType {+ Model.forallTypeParameter = (Model.Name "e"),+ Model.forallTypeBody = (Model.TypeRecord [+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "encode"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeFunction (Model.FunctionType {+ Model.functionTypeDomain = (Model.TypeVariable (Model.Name "t1")),+ Model.functionTypeCodomain = (Model.TypeApplication (Model.ApplicationType {+ Model.applicationTypeFunction = (Model.TypeApplication (Model.ApplicationType {+ Model.applicationTypeFunction = (Model.TypeApplication (Model.ApplicationType {+ Model.applicationTypeFunction = (Model.TypeApplication (Model.ApplicationType {+ Model.applicationTypeFunction = (Model.TypeApplication (Model.ApplicationType {+ Model.applicationTypeFunction = (Model.TypeVariable (Model.Name "hydra.core.coders.Adapter")),+ Model.applicationTypeArgument = (Model.TypeVariable (Model.Name "t1"))})),+ Model.applicationTypeArgument = (Model.TypeVariable (Model.Name "t2"))})),+ Model.applicationTypeArgument = (Model.TypeVariable (Model.Name "v1"))})),+ Model.applicationTypeArgument = (Model.TypeVariable (Model.Name "v2"))})),+ Model.applicationTypeArgument = (Model.TypeVariable (Model.Name "e"))}))})),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "A function from source types to adapters")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "decode"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeFunction (Model.FunctionType {+ Model.functionTypeDomain = (Model.TypeVariable (Model.Name "t2")),+ Model.functionTypeCodomain = (Model.TypeApplication (Model.ApplicationType {+ Model.applicationTypeFunction = (Model.TypeApplication (Model.ApplicationType {+ Model.applicationTypeFunction = (Model.TypeApplication (Model.ApplicationType {+ Model.applicationTypeFunction = (Model.TypeApplication (Model.ApplicationType {+ Model.applicationTypeFunction = (Model.TypeApplication (Model.ApplicationType {+ Model.applicationTypeFunction = (Model.TypeVariable (Model.Name "hydra.core.coders.Adapter")),+ Model.applicationTypeArgument = (Model.TypeVariable (Model.Name "t2"))})),+ Model.applicationTypeArgument = (Model.TypeVariable (Model.Name "t1"))})),+ Model.applicationTypeArgument = (Model.TypeVariable (Model.Name "v2"))})),+ Model.applicationTypeArgument = (Model.TypeVariable (Model.Name "v1"))})),+ Model.applicationTypeArgument = (Model.TypeVariable (Model.Name "e"))}))})),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "A function from target types to adapters")))]))}))}])}))}))}))}))})),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "A two-level encoder and decoder, operating both at a type level and an instance (data) level")))]))}))),+ (+ Model.Name "hydra.core.coders.CaseConventions",+ (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeRecord [+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "constant"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.util.CaseConvention")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "Convention for compile-time constant names")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "directory"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.util.CaseConvention")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "Convention for each directory level in the emitted source tree")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "enumValue"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.util.CaseConvention")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "Convention for enum-variant value names")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "field"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.util.CaseConvention")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "Convention for record field names")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "file"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.util.CaseConvention")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "Convention for the source-file basename")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "module"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.util.CaseConvention")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "Convention for a single segment of a module name")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "term"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.util.CaseConvention")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "Convention for top-level term definitions (functions, module-level values)")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "termVariable"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.util.CaseConvention")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "Convention for locally-bound term names (lambda parameters, let-bindings)")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "type"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.util.CaseConvention")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "Convention for type names")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "typeVariable"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.util.CaseConvention")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "Convention for type-level variable names")))]))}))}]),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "Per-target case conventions for name forms that vary across emission targets")))]))}))),+ (+ Model.Name "hydra.core.coders.Coder",+ (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeForall (Model.ForallType {+ Model.forallTypeParameter = (Model.Name "v1"),+ Model.forallTypeBody = (Model.TypeForall (Model.ForallType {+ Model.forallTypeParameter = (Model.Name "v2"),+ Model.forallTypeBody = (Model.TypeForall (Model.ForallType {+ Model.forallTypeParameter = (Model.Name "e"),+ Model.forallTypeBody = (Model.TypeRecord [+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "encode"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeFunction (Model.FunctionType {+ Model.functionTypeDomain = (Model.TypeVariable (Model.Name "v1")),+ Model.functionTypeCodomain = (Model.TypeEither (Model.EitherType {+ Model.eitherTypeLeft = (Model.TypeVariable (Model.Name "e")),+ Model.eitherTypeRight = (Model.TypeVariable (Model.Name "v2"))}))})),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "A function which encodes a domain value to a codomain value, with the possibility of failure")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "decode"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeFunction (Model.FunctionType {+ Model.functionTypeDomain = (Model.TypeVariable (Model.Name "v2")),+ Model.functionTypeCodomain = (Model.TypeEither (Model.EitherType {+ Model.eitherTypeLeft = (Model.TypeVariable (Model.Name "e")),+ Model.eitherTypeRight = (Model.TypeVariable (Model.Name "v1"))}))})),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "A function which decodes a codomain value to a domain value, with the possibility of failure")))]))}))}])}))}))})),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "An encoder and decoder; a pair of partial functions between two types")))]))}))),+ (+ Model.Name "hydra.core.coders.CoderDirection",+ (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeUnion [+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "encode"),+ Model.fieldTypeType = Model.TypeUnit},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "decode"),+ Model.fieldTypeType = Model.TypeUnit}]),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "Indicates either the 'out' or the 'in' direction of a coder")))]))}))),+ (+ Model.Name "hydra.core.coders.Language",+ (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeRecord [+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "name"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.coders.LanguageName")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "The unique name of the language")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "constraints"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.coders.LanguageConstraints")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "Constraints which characterize the language's type and term grammars")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "supportedFeatures"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeSet (Model.TypeVariable (Model.Name "hydra.core.coders.LanguageFeature"))),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "Target-language or target-runtime capabilities the emitter may assume are available")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "caseConventions"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.coders.CaseConventions")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "Per-target case conventions for the various kinds of identifiers emitted by the coder")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "defaultFileExtension"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.file.FileExtension")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "Conventional file extension for emitted source files, without the leading dot (e.g. \"scala\", \"py\")")))]))}))}]),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "A named language together with its grammar constraints, capability profile, naming conventions, and conventional file extension")))]))}))),+ (+ Model.Name "hydra.core.coders.LanguageConstraints",+ (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeRecord [+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "literalVariants"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeSet (Model.TypeVariable (Model.Name "hydra.core.variants.LiteralVariant"))),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "All supported literal variants")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "floatTypes"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeSet (Model.TypeVariable (Model.Name "hydra.core.model.FloatType"))),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "All supported float types")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "integerTypes"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeSet (Model.TypeVariable (Model.Name "hydra.core.model.IntegerType"))),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "All supported integer types")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "termVariants"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeSet (Model.TypeVariable (Model.Name "hydra.core.variants.TermVariant"))),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "All supported term variants")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "typeVariants"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeSet (Model.TypeVariable (Model.Name "hydra.core.variants.TypeVariant"))),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "All supported type variants")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "types"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeFunction (Model.FunctionType {+ Model.functionTypeDomain = (Model.TypeVariable (Model.Name "hydra.core.model.Type")),+ Model.functionTypeCodomain = (Model.TypeLiteral Model.LiteralTypeBoolean)})),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "A logical set of types, as a predicate which tests a type for inclusion")))]))}))}]),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "A set of constraints on valid type and term expressions, characterizing a language")))]))}))),+ (+ Model.Name "hydra.core.coders.LanguageFeature",+ (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeUnion [+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "partialApplication"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = Model.TypeUnit,+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "The target runtime can invoke an n-ary function with fewer than n arguments without error. When absent, the emitter eta-expands partially-applied terms.")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "nestedCaseStatements"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = Model.TypeUnit,+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "The target runtime can handle deeply nested case statements without stack issues. When absent, the emitter hoists cases out into top-level helpers.")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "nestedPolymorphicLetBindings"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = Model.TypeUnit,+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "The target language permits polymorphic let-bindings in expression position. When absent, the emitter hoists polymorphic lets to top level.")))]))}))}]),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "A target-language or target-runtime capability the coder may rely on. Absence from a Language's supportedFeatures set means the emitter must work around the missing capability.")))]))}))),+ (+ Model.Name "hydra.core.coders.LanguageName",+ (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeWrap (Model.TypeLiteral Model.LiteralTypeString)),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "The unique name of a language")))]))}))),+ (+ Model.Name "hydra.core.coders.SymmetricAdapter",+ (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeForall (Model.ForallType {+ Model.forallTypeParameter = (Model.Name "t"),+ Model.forallTypeBody = (Model.TypeForall (Model.ForallType {+ Model.forallTypeParameter = (Model.Name "v"),+ Model.forallTypeBody = (Model.TypeForall (Model.ForallType {+ Model.forallTypeParameter = (Model.Name "e"),+ Model.forallTypeBody = (Model.TypeApplication (Model.ApplicationType {+ Model.applicationTypeFunction = (Model.TypeApplication (Model.ApplicationType {+ Model.applicationTypeFunction = (Model.TypeApplication (Model.ApplicationType {+ Model.applicationTypeFunction = (Model.TypeApplication (Model.ApplicationType {+ Model.applicationTypeFunction = (Model.TypeApplication (Model.ApplicationType {+ Model.applicationTypeFunction = (Model.TypeVariable (Model.Name "hydra.core.coders.Adapter")),+ Model.applicationTypeArgument = (Model.TypeVariable (Model.Name "t"))})),+ Model.applicationTypeArgument = (Model.TypeVariable (Model.Name "t"))})),+ Model.applicationTypeArgument = (Model.TypeVariable (Model.Name "v"))})),+ Model.applicationTypeArgument = (Model.TypeVariable (Model.Name "v"))})),+ Model.applicationTypeArgument = (Model.TypeVariable (Model.Name "e"))}))}))}))})),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "A bidirectional encoder which maps between the same type and term languages on either side")))]))}))),+ (+ Model.Name "hydra.core.coders.TraversalOrder",+ (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeUnion [+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "pre"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = Model.TypeUnit,+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "Pre-order traversal")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "post"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = Model.TypeUnit,+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "Post-order traversal")))]))}))}]),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "Specifies either a pre-order or post-order traversal")))]))}))),+ (+ Model.Name "hydra.core.coders.TypeAdapter",+ (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeFunction (Model.FunctionType {+ Model.functionTypeDomain = (Model.TypeVariable (Model.Name "hydra.core.coders.AdapterContext")),+ Model.functionTypeCodomain = (Model.TypeFunction (Model.FunctionType {+ Model.functionTypeDomain = (Model.TypeVariable (Model.Name "hydra.core.model.Type")),+ Model.functionTypeCodomain = (Model.TypeEither (Model.EitherType {+ Model.eitherTypeLeft = (Model.TypeLiteral Model.LiteralTypeString),+ Model.eitherTypeRight = (Model.TypeApplication (Model.ApplicationType {+ Model.applicationTypeFunction = (Model.TypeApplication (Model.ApplicationType {+ Model.applicationTypeFunction = (Model.TypeApplication (Model.ApplicationType {+ Model.applicationTypeFunction = (Model.TypeVariable (Model.Name "hydra.core.coders.SymmetricAdapter")),+ Model.applicationTypeArgument = (Model.TypeVariable (Model.Name "hydra.core.model.Type"))})),+ Model.applicationTypeArgument = (Model.TypeVariable (Model.Name "hydra.core.model.Term"))})),+ Model.applicationTypeArgument = (Model.TypeLiteral Model.LiteralTypeString)}))}))}))})),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "A function which maps a Hydra type to a symmetric adapter between types and terms")))]))}))),+ (+ Model.Name "hydra.core.errors.DecodingError",+ (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeWrap (Model.TypeLiteral Model.LiteralTypeString)),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "An error that occurred during decoding of a term")))]))}))),+ (+ Model.Name "hydra.core.errors.EmptyListError",+ (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = Model.TypeUnit,+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "An empty list was encountered where a non-empty list was required")))]))}))),+ (+ Model.Name "hydra.core.errors.Error",+ (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeUnion [+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "checking"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.error.checking.CheckingError")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "A type checking error")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "decoding"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.errors.DecodingError")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "An error that occurred during decoding of a term")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "duplicateBinding"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.error.model.DuplicateBindingError")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "A duplicate binding name error")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "duplicateField"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.error.model.DuplicateFieldError")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "A duplicate field name error")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "extraction"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.errors.ExtractionError")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "An error that occurred while extracting a value from a term")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "inference"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.errors.InferenceError")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "A type inference error")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "invalidLiteral"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.error.model.InvalidLiteralError")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "A literal value validation error")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "other"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.errors.OtherError")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "Any other error")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "resolution"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.errors.ResolutionError")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "A name-resolution error")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "undefinedField"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.error.model.UndefinedFieldError")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "A reference to an undefined field")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "undefinedTermVariable"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.error.model.UndefinedTermVariableError")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "A reference to an undefined term variable")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "untypedTermVariable"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.error.model.UntypedTermVariableError")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "A term variable whose type is not known")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "unexpectedTermVariant"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.error.model.UnexpectedTermVariantError")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "An unexpected term variant")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "unexpectedTypeVariant"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.error.model.UnexpectedTypeVariantError")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "An unexpected type variant")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "unification"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.errors.UnificationError")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "A type unification error")))]))}))}]),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "An error of any kind, with kernel errors particularly differentiated")))]))}))),+ (+ Model.Name "hydra.core.errors.ExtractionError",+ (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeUnion [+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "emptyList"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.errors.EmptyListError")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "An empty list was encountered where a non-empty list was required")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "multipleBindings"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.errors.MultipleBindingsError")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "Multiple let bindings were found with the same name")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "multipleFields"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.errors.MultipleFieldsError")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "Multiple record fields were found with the same field name")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "noMatchingField"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.errors.NoMatchingFieldError")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "No field with the expected name was found in a record")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "noSuchBinding"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.errors.NoSuchBindingError")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "No let binding with the expected name was found")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "notEnoughCases"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.errors.NotEnoughCasesError")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "A case statement did not contain enough cases to match the target")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "unexpectedShape"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.errors.UnexpectedShapeError")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "A term, type, literal, or other value had an unexpected shape")))]))}))}]),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "An error that occurred while extracting a typed value from a term")))]))}))),+ (+ Model.Name "hydra.core.errors.InferenceError",+ (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeUnion [+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "checking"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.error.checking.CheckingError")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "A type checking error encountered during inference")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "other"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.errors.OtherInferenceError")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "A generic inference error carrying a message and a subterm path. Placeholder arm; sites should migrate to typed variants.")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "unification"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.errors.UnificationInferenceError")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "A unification failure encountered while inferring types")))]))}))}]),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "An error that occurred during type inference")))]))}))),+ (+ Model.Name "hydra.core.errors.MultipleBindingsError",+ (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeRecord [+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "name"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.model.Name")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "The binding name which was duplicated")))]))}))}]),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "Multiple let bindings with the same name were found")))]))}))),+ (+ Model.Name "hydra.core.errors.MultipleFieldsError",+ (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeRecord [+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "fieldName"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.model.Name")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "The field name which appeared more than once")))]))}))}]),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "Multiple fields with the same name were found in a record")))]))}))),+ (+ Model.Name "hydra.core.errors.NoMatchingFieldError",+ (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeRecord [+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "fieldName"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.model.Name")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "The field name which was not found")))]))}))}]),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "No field with the expected name was present")))]))}))),+ (+ Model.Name "hydra.core.errors.NoSuchBindingError",+ (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeRecord [+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "name"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.model.Name")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "The binding name which was not found")))]))}))}]),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "No let binding with the expected name was present")))]))}))),+ (+ Model.Name "hydra.core.errors.NoSuchPrimitiveError",+ (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeRecord [+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "name"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.model.Name")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "The primitive name which was not found")))]))}))}]),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "No primitive function with the expected name was registered in the graph")))]))}))),+ (+ Model.Name "hydra.core.errors.NotEnoughCasesError",+ (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = Model.TypeUnit,+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "A case statement was missing a case for the requested variant")))]))}))),+ (+ Model.Name "hydra.core.errors.OtherError",+ (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeWrap (Model.TypeLiteral Model.LiteralTypeString)),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "Any other error")))]))}))),+ (+ Model.Name "hydra.core.errors.OtherInferenceError",+ (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeRecord [+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "path"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.paths.SubtermPath")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "The subterm path at which the error was observed")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "message"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeLiteral Model.LiteralTypeString),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "A human-readable error message")))]))}))}]),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "A generic inference error: message + subterm path")))]))}))),+ (+ Model.Name "hydra.core.errors.OtherResolutionError",+ (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeWrap (Model.TypeLiteral Model.LiteralTypeString)),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "A generic resolution error: message")))]))}))),+ (+ Model.Name "hydra.core.errors.ResolutionError",+ (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeUnion [+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "noSuchBinding"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.errors.NoSuchBindingError")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "No binding with the expected name was found in the graph")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "noSuchPrimitive"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.errors.NoSuchPrimitiveError")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "No primitive function with the expected name was found in the graph")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "noMatchingField"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.errors.NoMatchingFieldError")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "No field with the expected name was present in a record or case statement")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "other"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.errors.OtherResolutionError")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "A generic resolution error carrying a message")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "unexpectedShape"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.errors.UnexpectedShapeError")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "A term had a shape other than the one expected (e.g. a record, an injection)")))]))}))}]),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "An error that occurred while resolving a name, primitive, or record/union shape in a graph")))]))}))),+ (+ Model.Name "hydra.core.errors.UnexpectedShapeError",+ (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeRecord [+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "expected"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeLiteral Model.LiteralTypeString),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "A description of the expected shape")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "actual"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeLiteral Model.LiteralTypeString),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "A description of the shape actually encountered")))]))}))}]),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "A term, type, literal, or related value had a shape other than the one expected")))]))}))),+ (+ Model.Name "hydra.core.errors.UnificationError",+ (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeRecord [+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "leftType"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.model.Type")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "The left-hand type in the unification")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "rightType"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.model.Type")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "The right-hand type in the unification")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "message"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeLiteral Model.LiteralTypeString),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "A human-readable error message")))]))}))}]),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "An error that occurred during type unification")))]))}))),+ (+ Model.Name "hydra.core.errors.UnificationInferenceError",+ (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeRecord [+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "path"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.paths.SubtermPath")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "The subterm path at which the unification failure was observed")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "cause"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.errors.UnificationError")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "The underlying unification error")))]))}))}]),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "A unification failure at a specific subterm locus during inference")))]))}))),+ (+ Model.Name "hydra.core.graph.Graph",+ (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeRecord [+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "boundTerms"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeMap (Model.MapType {+ Model.mapTypeKeys = (Model.TypeVariable (Model.Name "hydra.core.model.Name")),+ Model.mapTypeValues = (Model.TypeVariable (Model.Name "hydra.core.model.Term"))})),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "The terms bound by all term variables in scope")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "boundTypes"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeMap (Model.MapType {+ Model.mapTypeKeys = (Model.TypeVariable (Model.Name "hydra.core.model.Name")),+ Model.mapTypeValues = (Model.TypeVariable (Model.Name "hydra.core.model.TypeScheme"))})),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "The type schemes of all term variables in scope")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "classConstraints"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeMap (Model.MapType {+ Model.mapTypeKeys = (Model.TypeVariable (Model.Name "hydra.core.model.Name")),+ Model.mapTypeValues = (Model.TypeVariable (Model.Name "hydra.core.model.TypeVariableConstraints"))})),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "A mutable map from type variable names to their accumulated class constraints. This is populated during type inference when operations requiring Eq or Ord are encountered.")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "lambdaVariables"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeSet (Model.TypeVariable (Model.Name "hydra.core.model.Name"))),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "The set of term variables introduced by specifically by lambdas")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "metadata"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeMap (Model.MapType {+ Model.mapTypeKeys = (Model.TypeVariable (Model.Name "hydra.core.model.Name")),+ Model.mapTypeValues = (Model.TypeVariable (Model.Name "hydra.core.model.Term"))})),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "Any additional metadata bound to term variables in scope")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "primitives"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeMap (Model.MapType {+ Model.mapTypeKeys = (Model.TypeVariable (Model.Name "hydra.core.model.Name")),+ Model.mapTypeValues = (Model.TypeVariable (Model.Name "hydra.core.graph.Primitive"))})),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "All primitive functions and constants by name")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "schemaTypes"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeMap (Model.MapType {+ Model.mapTypeKeys = (Model.TypeVariable (Model.Name "hydra.core.model.Name")),+ Model.mapTypeValues = (Model.TypeVariable (Model.Name "hydra.core.model.TypeScheme"))})),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "All schema types (type schemes) in scope")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "typeVariables"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeSet (Model.TypeVariable (Model.Name "hydra.core.model.Name"))),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "The set of type variables introduced specifically by type lambdas")))]))}))}]),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "A graph, or lexical environment which binds names to terms, types, primitives, and metadata")))]))}))),+ (+ Model.Name "hydra.core.graph.Library",+ (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeRecord [+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "name"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.packaging.ModuleName")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "A common prefix for all primitive function names in the library")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "prefix"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeLiteral Model.LiteralTypeString),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "A preferred namespace prefix for function names in the library")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "primitives"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeList (Model.TypeVariable (Model.Name "hydra.core.graph.Primitive"))),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "The primitives defined in this library")))]))}))}]),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "A library of primitive functions")))]))}))),+ (+ Model.Name "hydra.core.graph.Primitive",+ (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeRecord [+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "definition"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.packaging.PrimitiveDefinition")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "The host-independent declarative metadata for the primitive: name, description, signature, totality and purity flags, and an optional reference implementation.")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "implementation"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeFunction (Model.FunctionType {+ Model.functionTypeDomain = (Model.TypeVariable (Model.Name "hydra.core.graph.Graph")),+ Model.functionTypeCodomain = (Model.TypeFunction (Model.FunctionType {+ Model.functionTypeDomain = (Model.TypeList (Model.TypeVariable (Model.Name "hydra.core.model.Term"))),+ Model.functionTypeCodomain = (Model.TypeEither (Model.EitherType {+ Model.eitherTypeLeft = (Model.TypeVariable (Model.Name "hydra.core.errors.Error")),+ Model.eitherTypeRight = (Model.TypeVariable (Model.Name "hydra.core.model.Term"))}))}))})),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "A concrete, host-specific implementation of the primitive function: given the current graph, a mapping from a list of argument terms to a result term, or an error. Arguments are reduced and stripped of annotations by the interpreter before the implementation is invoked, so the implementation can pattern-match the argument terms directly; a higher-order primitive whose result shape is fixed by its data argument can return an unreduced applicative term and let the outer reducer fold it (no graph needed). The graph is retained for the higher-order primitives that must evaluate a function argument mid-computation (e.g. lists.filter): evaluating that function resolves primitive names against the graph's primitive table. The legacy `InferenceContext` parameter was vestigial and has been removed (https://github.com/CategoricalData/hydra/issues/446).")))]))}))}]),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "A built-in function or constant, consisting of the host-independent PrimitiveDefinition (name, signature, metadata) plus a host-specific implementation.")))]))}))),+ (+ Model.Name "hydra.core.graph.TermCoder",+ (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeForall (Model.ForallType {+ Model.forallTypeParameter = (Model.Name "a"),+ Model.forallTypeBody = (Model.TypeRecord [+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "type"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.model.Type")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "The Hydra type of encoded terms")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "encode"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeFunction (Model.FunctionType {+ Model.functionTypeDomain = (Model.TypeVariable (Model.Name "hydra.core.typing.InferenceContext")),+ Model.functionTypeCodomain = (Model.TypeFunction (Model.FunctionType {+ Model.functionTypeDomain = (Model.TypeVariable (Model.Name "hydra.core.graph.Graph")),+ Model.functionTypeCodomain = (Model.TypeFunction (Model.FunctionType {+ Model.functionTypeDomain = (Model.TypeVariable (Model.Name "hydra.core.model.Term")),+ Model.functionTypeCodomain = (Model.TypeEither (Model.EitherType {+ Model.eitherTypeLeft = (Model.TypeVariable (Model.Name "hydra.core.errors.Error")),+ Model.eitherTypeRight = (Model.TypeVariable (Model.Name "a"))}))}))}))})),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "An encode function from terms to native values")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "decode"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeFunction (Model.FunctionType {+ Model.functionTypeDomain = (Model.TypeVariable (Model.Name "hydra.core.typing.InferenceContext")),+ Model.functionTypeCodomain = (Model.TypeFunction (Model.FunctionType {+ Model.functionTypeDomain = (Model.TypeVariable (Model.Name "a")),+ Model.functionTypeCodomain = (Model.TypeEither (Model.EitherType {+ Model.eitherTypeLeft = (Model.TypeVariable (Model.Name "hydra.core.errors.Error")),+ Model.eitherTypeRight = (Model.TypeVariable (Model.Name "hydra.core.model.Term"))}))}))})),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "A decode function from native values to terms")))]))}))}])})),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "A type together with a coder for mapping terms into arguments for primitive functions, and mapping computed results into terms.")))]))}))),+ (+ Model.Name "hydra.core.model.AnnotatedTerm",+ (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeRecord [+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "body"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.model.Term")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "The term being annotated")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "annotation"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.model.Term")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "The annotation as a single term. By convention this is a map term (Name -> Term) so that multiple independent annotations can coexist, but applications are free to use any term shape.")))]))}))}]),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "A term together with an annotation")))]))}))),+ (+ Model.Name "hydra.core.model.AnnotatedType",+ (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeRecord [+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "body"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.model.Type")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "The type being annotated")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "annotation"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.model.Term")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "The annotation as a single term. By convention this is a map term (Name -> Term) so that multiple independent annotations can coexist, but applications are free to use any term shape.")))]))}))}]),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "A type together with an annotation")))]))}))),+ (+ Model.Name "hydra.core.model.Application",+ (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeRecord [+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "function"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.model.Term")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "The left-hand side of the application")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "argument"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.model.Term")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "The right-hand side of the application")))]))}))}]),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "A term which applies a function to an argument")))]))}))),+ (+ Model.Name "hydra.core.model.ApplicationType",+ (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeRecord [+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "function"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.model.Type")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "The left-hand side of the application")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "argument"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.model.Type")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "The right-hand side of the application")))]))}))}]),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "The type-level analog of an application term")))]))}))),+ (+ Model.Name "hydra.core.model.Binding",+ (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeRecord [+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "name"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.model.Name")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "The name of the bound variable")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "term"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.model.Term")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "The term to which the variable is bound")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "typeScheme"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeOptional (Model.TypeVariable (Model.Name "hydra.core.model.TypeScheme"))),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "The optional type scheme of the bound term")))]))}))}]),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "A field with an optional type scheme, used to bind variables to terms in a 'let' expression")))]))}))),+ (+ Model.Name "hydra.core.model.CaseAlternative",+ (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeRecord [+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "name"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.model.Name")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "The name of the union variant matched by this alternative")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "handler"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.model.Term")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "The handler applied to the matched variant's payload")))]))}))}]),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "A single alternative of a case statement (union elimination): the variant being matched, together with the term that handles it.")))]))}))),+ (+ Model.Name "hydra.core.model.CaseStatement",+ (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeRecord [+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "typeName"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.model.Name")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "The name of the union type")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "default"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeOptional (Model.TypeVariable (Model.Name "hydra.core.model.Term"))),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "An optional default case, used if none of the explicit cases match")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "cases"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeList (Model.TypeVariable (Model.Name "hydra.core.model.CaseAlternative"))),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "A list of case alternatives, one per union variant being handled")))]))}))}]),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "A union elimination; a case statement")))]))}))),+ (+ Model.Name "hydra.core.model.EitherType",+ (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeRecord [+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "left"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.model.Type")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "The 'left' alternative")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "right"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.model.Type")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "The 'right' alternative")))]))}))}]),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "A type which provides a choice between a 'left' type and a 'right' type")))]))}))),+ (+ Model.Name "hydra.core.model.Field",+ (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeRecord [+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "name"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.model.Name")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "The name of the field")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "term"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.model.Term")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "The value of the field")))]))}))}]),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "A name/term pair")))]))}))),+ (+ Model.Name "hydra.core.model.FieldType",+ (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeRecord [+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "name"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.model.Name")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "The name of the field")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "type"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.model.Type")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "The type of the field")))]))}))}]),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "A name/type pair")))]))}))),+ (+ Model.Name "hydra.core.model.FloatType",+ (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeUnion [+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "float32"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = Model.TypeUnit,+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "A 32-bit floating-point type")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "float64"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = Model.TypeUnit,+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "A 64-bit floating-point type")))]))}))}]),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "A floating-point type")))]))}))),+ (+ Model.Name "hydra.core.model.FloatValue",+ (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeUnion [+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "float32"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeLiteral (Model.LiteralTypeFloat Model.FloatTypeFloat32)),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "A 32-bit floating-point value")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "float64"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeLiteral (Model.LiteralTypeFloat Model.FloatTypeFloat64)),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "A 64-bit floating-point value")))]))}))}]),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "A floating-point literal value")))]))}))),+ (+ Model.Name "hydra.core.model.ForallType",+ (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeRecord [+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "parameter"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.model.Name")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "The variable which is bound by the lambda")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "body"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.model.Type")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "The body of the lambda")))]))}))}]),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "A universally quantified type; the System F equivalent of a type scheme, and the type-level equivalent of a lambda term.")))]))}))),+ (+ Model.Name "hydra.core.model.FunctionType",+ (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeRecord [+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "domain"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.model.Type")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "The domain (input) type of the function")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "codomain"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.model.Type")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "The codomain (output) type of the function")))]))}))}]),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "A function type, also known as an arrow type")))]))}))),+ (+ Model.Name "hydra.core.model.Injection",+ (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeRecord [+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "typeName"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.model.Name")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "The name of the union type")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "field"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.model.Field")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "The field being injected, including its name and value")))]))}))}]),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "An instance of a union type; i.e. a string-indexed generalization of inl() or inr()")))]))}))),+ (+ Model.Name "hydra.core.model.IntegerType",+ (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeUnion [+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "bigint"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = Model.TypeUnit,+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "An arbitrary-precision integer type")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "int8"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = Model.TypeUnit,+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "An 8-bit signed integer type")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "int16"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = Model.TypeUnit,+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "A 16-bit signed integer type")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "int32"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = Model.TypeUnit,+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "A 32-bit signed integer type")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "int64"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = Model.TypeUnit,+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "A 64-bit signed integer type")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "uint8"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = Model.TypeUnit,+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "An 8-bit unsigned integer type")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "uint16"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = Model.TypeUnit,+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "A 16-bit unsigned integer type")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "uint32"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = Model.TypeUnit,+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "A 32-bit unsigned integer type")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "uint64"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = Model.TypeUnit,+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "A 64-bit unsigned integer type")))]))}))}]),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "An integer type")))]))}))),+ (+ Model.Name "hydra.core.model.IntegerValue",+ (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeUnion [+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "bigint"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeLiteral (Model.LiteralTypeInteger Model.IntegerTypeBigint)),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "An arbitrary-precision integer value")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "int8"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeLiteral (Model.LiteralTypeInteger Model.IntegerTypeInt8)),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "An 8-bit signed integer value")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "int16"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeLiteral (Model.LiteralTypeInteger Model.IntegerTypeInt16)),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "A 16-bit signed integer value (short value)")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "int32"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeLiteral (Model.LiteralTypeInteger Model.IntegerTypeInt32)),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "A 32-bit signed integer value (int value)")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "int64"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeLiteral (Model.LiteralTypeInteger Model.IntegerTypeInt64)),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "A 64-bit signed integer value (long value)")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "uint8"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeLiteral (Model.LiteralTypeInteger Model.IntegerTypeUint8)),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "An 8-bit unsigned integer value (byte)")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "uint16"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeLiteral (Model.LiteralTypeInteger Model.IntegerTypeUint16)),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "A 16-bit unsigned integer value")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "uint32"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeLiteral (Model.LiteralTypeInteger Model.IntegerTypeUint32)),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "A 32-bit unsigned integer value (unsigned int)")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "uint64"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeLiteral (Model.LiteralTypeInteger Model.IntegerTypeUint64)),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "A 64-bit unsigned integer value (unsigned long)")))]))}))}]),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "An integer literal value")))]))}))),+ (+ Model.Name "hydra.core.model.Lambda",+ (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeRecord [+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "parameter"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.model.Name")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "The parameter of the lambda")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "domain"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeOptional (Model.TypeVariable (Model.Name "hydra.core.model.Type"))),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "An optional domain type for the lambda")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "body"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.model.Term")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "The body of the lambda")))]))}))}]),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "A function abstraction (lambda)")))]))}))),+ (+ Model.Name "hydra.core.model.Let",+ (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeRecord [+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "bindings"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeList (Model.TypeVariable (Model.Name "hydra.core.model.Binding"))),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "The list of variable bindings")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "body"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.model.Term")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "The body term in which the variables are bound")))]))}))}]),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "A set of (possibly recursive) 'let' bindings together with a body in which they are bound")))]))}))),+ (+ Model.Name "hydra.core.model.Literal",+ (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeUnion [+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "binary"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeLiteral Model.LiteralTypeBinary),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "A binary literal")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "boolean"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeLiteral Model.LiteralTypeBoolean),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "A boolean literal")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "decimal"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeLiteral Model.LiteralTypeDecimal),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "An arbitrary-precision decimal literal")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "float"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.model.FloatValue")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "A floating-point literal")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "integer"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.model.IntegerValue")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "An integer literal")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "string"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeLiteral Model.LiteralTypeString),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "A string literal")))]))}))}]),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "A term constant; an instance of a literal type")))]))}))),+ (+ Model.Name "hydra.core.model.LiteralType",+ (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeUnion [+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "binary"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = Model.TypeUnit,+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "The type of a binary (byte string) value")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "boolean"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = Model.TypeUnit,+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "The type of a boolean (true/false) value")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "decimal"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = Model.TypeUnit,+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "The type of an arbitrary-precision decimal value")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "float"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.model.FloatType")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "The type of a floating-point value")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "integer"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.model.IntegerType")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "The type of an integer value")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "string"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = Model.TypeUnit,+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "The type of a string value")))]))}))}]),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "Any of a fixed set of literal types, also called atomic types, base types, primitive types, or type constants")))]))}))),+ (+ Model.Name "hydra.core.model.MapType",+ (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeRecord [+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "keys"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.model.Type")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "The type of keys in the map")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "values"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.model.Type")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "The type of values in the map")))]))}))}]),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "A map type")))]))}))),+ (+ Model.Name "hydra.core.model.Name",+ (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeWrap (Model.TypeLiteral Model.LiteralTypeString)),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "A unique identifier in some context; a string-valued key")))]))}))),+ (+ Model.Name "hydra.core.model.PairType",+ (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeRecord [+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "first"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.model.Type")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "The first component of the pair")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "second"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.model.Type")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "The second component of the pair")))]))}))}]),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "A type which pairs a 'first' type and a 'second' type")))]))}))),+ (+ Model.Name "hydra.core.model.Projection",+ (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeRecord [+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "typeName"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.model.Name")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "The name of the record type")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "fieldName"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.model.Name")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "The name of the projected field")))]))}))}]),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "A record elimination; a projection")))]))}))),+ (+ Model.Name "hydra.core.model.Record",+ (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeRecord [+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "typeName"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.model.Name")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "The name of the record type")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "fields"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeList (Model.TypeVariable (Model.Name "hydra.core.model.Field"))),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "The fields of the record, as a list of name/term pairs")))]))}))}]),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "A record, or labeled tuple; a map of field names to terms")))]))}))),+ (+ Model.Name "hydra.core.model.Term",+ (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeUnion [+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "annotated"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.model.AnnotatedTerm")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "A term annotated with metadata")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "application"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.model.Application")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "A function application")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "cases"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.model.CaseStatement")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "A union elimination; a case statement")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "either"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeEither (Model.EitherType {+ Model.eitherTypeLeft = (Model.TypeVariable (Model.Name "hydra.core.model.Term")),+ Model.eitherTypeRight = (Model.TypeVariable (Model.Name "hydra.core.model.Term"))})),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "An either value")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "inject"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.model.Injection")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "An injection; an instance of a union type")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "lambda"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.model.Lambda")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "A function abstraction (lambda)")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "let"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.model.Let")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "A 'let' term, which binds variables to terms")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "list"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeList (Model.TypeVariable (Model.Name "hydra.core.model.Term"))),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "A list")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "literal"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.model.Literal")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "A literal value")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "map"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeMap (Model.MapType {+ Model.mapTypeKeys = (Model.TypeVariable (Model.Name "hydra.core.model.Term")),+ Model.mapTypeValues = (Model.TypeVariable (Model.Name "hydra.core.model.Term"))})),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "A map of keys to values")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "optional"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeOptional (Model.TypeVariable (Model.Name "hydra.core.model.Term"))),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "An optional value")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "pair"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypePair (Model.PairType {+ Model.pairTypeFirst = (Model.TypeVariable (Model.Name "hydra.core.model.Term")),+ Model.pairTypeSecond = (Model.TypeVariable (Model.Name "hydra.core.model.Term"))})),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "A pair (2-tuple)")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "project"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.model.Projection")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "A record elimination; a projection")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "record"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.model.Record")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "A record term")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "set"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeSet (Model.TypeVariable (Model.Name "hydra.core.model.Term"))),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "A set of values")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "typeApplication"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.model.TypeApplicationTerm")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "A System F type application term")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "typeLambda"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.model.TypeLambda")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "A System F type abstraction term")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "unit"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = Model.TypeUnit,+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "A unit value; a term with no value")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "unwrap"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.model.Name")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "An unwrap elimination; the inverse of a wrap. Given the name of a wrapper type, unwraps an instance of that type to its underlying body value.")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "variable"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.model.Name")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "A variable reference")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "wrap"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.model.WrappedTerm")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "A wrapped term; an instance of a wrapper type (newtype)")))]))}))}]),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "A data term")))]))}))),+ (+ Model.Name "hydra.core.model.Type",+ (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeUnion [+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "annotated"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.model.AnnotatedType")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "An annotated type")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "application"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.model.ApplicationType")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "A type application")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "effect"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.model.Type")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "An effectful computation which, when interpreted by a host application, may perform host interactions and produce a value of the given type")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "either"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.model.EitherType")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "An either (sum) type")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "forall"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.model.ForallType")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "A universally quantified (polymorphic) type")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "function"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.model.FunctionType")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "A function type")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "list"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.model.Type")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "A list type")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "literal"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.model.LiteralType")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "A literal type")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "map"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.model.MapType")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "A map type")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "optional"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.model.Type")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "An optional type")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "pair"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.model.PairType")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "A pair (2-tuple) type")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "record"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeList (Model.TypeVariable (Model.Name "hydra.core.model.FieldType"))),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "A record type")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "set"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.model.Type")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "A set type")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "union"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeList (Model.TypeVariable (Model.Name "hydra.core.model.FieldType"))),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "A union type with field names")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "unit"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = Model.TypeUnit,+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "The unit type \8212 the nullary conjunction; one inhabitant. Dual to `void`.")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "variable"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.model.Name")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "A type variable")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "void"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = Model.TypeUnit,+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "The void (uninhabited, or bottom) type \8212 the nullary disjunction; zero inhabitants. Dual to `unit`.")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "wrap"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.model.Type")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "A wrapped type (newtype). There is no corresponding `unwrap` variant at the type level: wrap is the introduction form, and a wrapper type's underlying body type is given by the `wrap` variant's argument.")))]))}))}]),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "A data type")))]))}))),+ (+ Model.Name "hydra.core.model.TypeApplicationTerm",+ (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeRecord [+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "body"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.model.Term")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "The term being applied to a type")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "type"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.model.Type")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "The type argument")))]))}))}]),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "A term applied to a type; a type application.")))]))}))),+ (+ Model.Name "hydra.core.model.TypeClassConstraint",+ (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeUnion [+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "simple"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.model.Name")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "A simple type class constraint, naming a single type class")))]))}))}]),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "A type class constraint on a type variable. Currently has only one variant, but designed to be forward-compatible with multi-parameter type classes and constraints on type expressions.")))]))}))),+ (+ Model.Name "hydra.core.model.TypeLambda",+ (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeRecord [+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "parameter"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.model.Name")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "The type variable introduced by the abstraction")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "body"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.model.Term")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "The body of the abstraction")))]))}))}]),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "A System F type abstraction term")))]))}))),+ (+ Model.Name "hydra.core.model.TypeScheme",+ (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeRecord [+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "variables"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeList (Model.TypeVariable (Model.Name "hydra.core.model.Name"))),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "The free type variables")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "body"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.model.Type")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "The type expression")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "constraints"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeMap (Model.MapType {+ Model.mapTypeKeys = (Model.TypeVariable (Model.Name "hydra.core.model.Name")),+ Model.mapTypeValues = (Model.TypeVariable (Model.Name "hydra.core.model.TypeVariableConstraints"))})),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "Constraints on type variables, including typeclass constraints. The map keys are type variable names; an empty map means no constraints.")))]))}))}]),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "A type expression together with free type variables occurring in the expression")))]))}))),+ (+ Model.Name "hydra.core.model.TypeVariableConstraints",+ (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeRecord [+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "classes"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeSet (Model.TypeVariable (Model.Name "hydra.core.model.TypeClassConstraint"))),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "The typeclass constraints on this type variable")))]))}))}]),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "Constraints associated with a type variable, including typeclass constraints")))]))}))),+ (+ Model.Name "hydra.core.model.WrappedTerm",+ (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeRecord [+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "typeName"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.model.Name")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "The name of the wrapper type")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "body"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.model.Term")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "The wrapped term")))]))}))}]),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "A term wrapped in a type name")))]))}))),+ (+ Model.Name "hydra.core.packaging.Definition",+ (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeUnion [+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "primitive"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.packaging.PrimitiveDefinition")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "A primitive definition")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "term"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.packaging.TermDefinition")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "A term definition")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "type"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.packaging.TypeDefinition")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "A type definition")))]))}))}]),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "A definition, which may be either a term, type, or primitive definition")))]))}))),+ (+ Model.Name "hydra.core.packaging.DefinitionReference",+ (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeUnion [+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "primitive"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.model.Name")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "A reference to a primitive definition, by name")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "term"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.model.Name")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "A reference to a term definition, by name")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "type"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.model.Name")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "A reference to a type definition, by name")))]))}))}]),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "A typed reference to a definition: a type, a term, or a primitive, identified by name")))]))}))),+ (+ Model.Name "hydra.core.packaging.DependencyScope",+ (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeUnion [+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "api"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = Model.TypeUnit,+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "A dependency exported transitively to consumers of this package (e.g. Gradle `api`, Cabal `build-depends`): present at both compile time and runtime, and visible downstream")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "runtime"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = Model.TypeUnit,+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "A dependency required at runtime but not at compile time")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "test"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = Model.TypeUnit,+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "A dependency required only to compile and run the package's tests")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "tool"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = Model.TypeUnit,+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "A build-tool-only dependency, used to generate or process sources at build time but not present in the compiled artifact (e.g. an ANTLR tool jar or an annotation processor)")))]))}))}]),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "The scope in which a package dependency is required. Relevant mainly to dependencies on third-party (non-Hydra) artifacts, where build systems distinguish compile-time, runtime, test-only, and build-tool-only dependencies. Hydra inter-package dependencies normally leave the scope unspecified.")))]))}))),+ (+ Model.Name "hydra.core.packaging.EntityMetadata",+ (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeRecord [+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "description"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeOptional (Model.TypeLiteral Model.LiteralTypeString)),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "An optional, concise one-line human-readable summary of the entity.")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "comments"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeList (Model.TypeLiteral Model.LiteralTypeString)),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "Zero or more long-form prose paragraphs: cross-cutting semantic conventions, caveats, and references that would otherwise be repeated across the entity's constituents.")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "seeAlso"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeList (Model.TypeVariable (Model.Name "hydra.core.packaging.EntityReference"))),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "Typed cross-references to related entities, for navigation and documentation.")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "lifecycle"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeOptional (Model.TypeVariable (Model.Name "hydra.core.packaging.LifecycleInfo"))),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "Optional version-lifecycle milestones for the entity.")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "provisions"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeList (Model.TypeVariable (Model.Name "hydra.core.packaging.Provision"))),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "Named normative provisions (requirements and recommendations) concerning this entity. Empty when the entity states none.")))]))}))}]),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "Documentation, lifecycle, and normative metadata attachable to a packaging entity (package, module, or definition). Bundling these fields in one type lets future metadata be added without changing the field shape of the entities that carry it.")))]))}))),+ (+ Model.Name "hydra.core.packaging.EntityReference",+ (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeUnion [+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "definition"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.packaging.DefinitionReference")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "A reference to a definition (type, term, or primitive), by name")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "module"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.packaging.ModuleName")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "A reference to a module, by name")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "package"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.packaging.PackageName")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "A reference to a package, by name")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "termExpr"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeLiteral Model.LiteralTypeString),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "An inline term expression in Hydra textual syntax")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "typeExpr"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeLiteral Model.LiteralTypeString),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "An inline type expression in Hydra textual syntax")))]))}))}]),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "A typed reference to a Hydra entity: a package, a module, a definition (by name), or an inline type or term expression in Hydra textual syntax.")))]))}))),+ (+ Model.Name "hydra.core.packaging.LifecycleInfo",+ (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeRecord [+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "availableSince"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeOptional (Model.TypeVariable (Model.Name "hydra.core.packaging.Version"))),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "The version in which the entity was introduced, if known.")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "deprecatedSince"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeOptional (Model.TypeVariable (Model.Name "hydra.core.packaging.Version"))),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "The version in which the entity was deprecated, if applicable.")))]))}))}]),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "Version-lifecycle milestones for a packaging entity. Each milestone is independently optional; further milestones (e.g. stableSince, removedSince) may be added without changing dependent types.")))]))}))),+ (+ Model.Name "hydra.core.packaging.Module",+ (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeRecord [+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "name"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.packaging.ModuleName")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "The name of the module, which is also the common prefix for all element names in the module")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "metadata"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeOptional (Model.TypeVariable (Model.Name "hydra.core.packaging.EntityMetadata"))),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "Optional documentation and lifecycle metadata for the module")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "dependencies"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeList (Model.TypeVariable (Model.Name "hydra.core.packaging.ModuleDependency"))),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "Any modules which this module directly depends on")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "definitions"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeList (Model.TypeVariable (Model.Name "hydra.core.packaging.Definition"))),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "The definitions in this module")))]))}))}]),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "A logical collection of elements sharing a common module name, having dependencies on zero or more other modules")))]))}))),+ (+ Model.Name "hydra.core.packaging.ModuleDependency",+ (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeRecord [+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "module"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.packaging.ModuleName")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "The name of the depended-on module")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "package"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeOptional (Model.TypeVariable (Model.Name "hydra.core.packaging.PackageName"))),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "The package providing the depended-on module, if disambiguation is required")))]))}))}]),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "A dependency on another module, identified by its name and (optionally) the package which provides it. When the package is omitted, the resolver searches all packages in scope; a duplicate module name across packages is a resolution error which can be disambiguated by naming the intended package explicitly.")))]))}))),+ (+ Model.Name "hydra.core.packaging.ModuleName",+ (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeWrap (Model.TypeLiteral Model.LiteralTypeString)),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "The unique name of a module; a prefix for the names of elements defined in the module.")))]))}))),+ (+ Model.Name "hydra.core.packaging.Package",+ (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeRecord [+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "name"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.packaging.PackageName")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "The name of the package")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "metadata"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeOptional (Model.TypeVariable (Model.Name "hydra.core.packaging.EntityMetadata"))),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "Optional documentation and lifecycle metadata for the package")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "dependencies"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeList (Model.TypeVariable (Model.Name "hydra.core.packaging.PackageDependency"))),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "The packages which this package depends on")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "modules"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeList (Model.TypeVariable (Model.Name "hydra.core.packaging.Module"))),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "The modules in this package")))]))}))}]),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "A package, which is a named collection of modules with metadata and dependencies")))]))}))),+ (+ Model.Name "hydra.core.packaging.PackageDependency",+ (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeRecord [+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "name"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.packaging.PackageName")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "The name of the depended-on package")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "version"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.packaging.VersionSpecifier")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "The version-range constraint on the depended-on package")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "scope"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeOptional (Model.TypeVariable (Model.Name "hydra.core.packaging.DependencyScope"))),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "The scope in which the dependency is required, if specified. Normally absent for Hydra inter-package dependencies; specified for third-party dependencies whose build scope (compile/runtime/test/tool) is significant.")))]))}))}]),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "A dependency on another package, identified by name and constrained by an optional version specifier")))]))}))),+ (+ Model.Name "hydra.core.packaging.PackageName",+ (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeWrap (Model.TypeLiteral Model.LiteralTypeString)),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "The unique name of a package, e.g. \"hydra-kernel\" or \"hydra-python\". For dependencies on third-party artifacts in ecosystems with a group/namespace component (notably Maven), the group and artifact are carried in a single name separated by a colon, e.g. \"org.eclipse.rdf4j:rdf4j-rio-ntriples\"; the consuming host splits on the colon to recover the group when emitting build configuration. Hydra package names contain no colon.")))]))}))),+ (+ Model.Name "hydra.core.packaging.PrimitiveDefinition",+ (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeRecord [+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "name"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.model.Name")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "The name of the primitive")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "metadata"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeOptional (Model.TypeVariable (Model.Name "hydra.core.packaging.EntityMetadata"))),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "Optional documentation and lifecycle metadata for the primitive.")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "signature"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.typing.TermSignature")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "The signature of the primitive. Always explicit, never inferred.")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "isPure"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeLiteral Model.LiteralTypeBoolean),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "Whether the primitive is pure (referentially transparent, no observable side effects). Normally true.")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "isTotal"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeLiteral Model.LiteralTypeBoolean),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "Whether the primitive is total (terminates on every input of its declared type). Normally true.")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "defaultImplementation"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeOptional (Model.TypeVariable (Model.Name "hydra.core.model.Term"))),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "An optional cross-compilable reference implementation of the primitive, expressed as a Hydra term. Used by interpreters lacking a native implementation and as a proof-friendly reference. Distinct from the per-host Primitive.implementation.")))]))}))}]),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "A primitive definition: the universal, host-independent declarative metadata for a primitive, including name, signature, documentation and lifecycle metadata, totality and purity flags, and an optional default implementation expressed as a Hydra term.")))]))}))),+ (+ Model.Name "hydra.core.packaging.Provision",+ (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeRecord [+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "name"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.model.Name")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "The fully-qualified name of the provision: the enclosing entity's name extended by one segment (e.g. hydra.core.lib.lists.concat.emptyLists). Composed at definition time by a helper that prefixes the entity's name, exactly as a definition's name is composed from its module's name -- so the author writes only the final segment, but the stored value is the full name.")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "kind"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.packaging.ProvisionKind")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "Whether this provision is a requirement or a recommendation.")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "statement"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeLiteral Model.LiteralTypeString),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "The normative statement itself, as markdown prose: the falsifiable claim.")))]))}))}]),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "A named normative statement concerning an entity: a single falsifiable condition a conforming implementation is measured against. Tests reference provisions by name.")))]))}))),+ (+ Model.Name "hydra.core.packaging.ProvisionKind",+ (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeUnion [+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "requirement"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = Model.TypeUnit,+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "A requirement: no deviation is permitted if conformance is to be claimed (MUST).")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "recommendation"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = Model.TypeUnit,+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "A recommendation: observed strictly by the Hydra kernel and codebase, but a downstream project may opt out (SHOULD).")))]))}))}]),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "Whether a provision is a requirement (a MUST: no deviation permitted for conformance) or a recommendation (a SHOULD: observed by the Hydra kernel, but a downstream project may opt out).")))]))}))),+ (+ Model.Name "hydra.core.packaging.TermDefinition",+ (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeRecord [+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "name"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.model.Name")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "The name of the term")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "metadata"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeOptional (Model.TypeVariable (Model.Name "hydra.core.packaging.EntityMetadata"))),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "Optional documentation and lifecycle metadata for the term definition")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "signature"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeOptional (Model.TypeVariable (Model.Name "hydra.core.typing.TermSignature"))),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "The optional signature of the term. When absent, the signature has yet to be inferred.")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "body"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.model.Term")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "The term being defined")))]))}))}]),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "A term-level definition, including a name, an optional signature, and a term")))]))}))),+ (+ Model.Name "hydra.core.packaging.TypeDefinition",+ (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeRecord [+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "name"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.model.Name")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "The name of the type")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "metadata"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeOptional (Model.TypeVariable (Model.Name "hydra.core.packaging.EntityMetadata"))),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "Optional documentation and lifecycle metadata for the type definition")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "body"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.model.TypeScheme")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "The type scheme being defined")))]))}))}]),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "A type-level definition, including a name and the type scheme")))]))}))),+ (+ Model.Name "hydra.core.packaging.Version",+ (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeWrap (Model.TypeLiteral Model.LiteralTypeString)),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "A version string, e.g. \"0.15\" or \"1.0.0\".")))]))}))),+ (+ Model.Name "hydra.core.packaging.VersionRange",+ (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeRecord [+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "lowerInclusive"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeOptional (Model.TypeVariable (Model.Name "hydra.core.packaging.Version"))),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "The inclusive lower bound, if any (the minimum acceptable version).")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "upperExclusive"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeOptional (Model.TypeVariable (Model.Name "hydra.core.packaging.Version"))),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "The exclusive upper bound, if any (versions strictly below this are acceptable).")))]))}))}]),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "A version range with an optional inclusive lower bound and an optional exclusive upper bound.")))]))}))),+ (+ Model.Name "hydra.core.packaging.VersionSpecifier",+ (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeUnion [+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "any"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = Model.TypeUnit,+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "Any version satisfies the dependency")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "exact"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.packaging.Version")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "Exactly the given version satisfies the dependency; used to pin a specific release")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "atLeast"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.packaging.Version")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "Any version greater than or equal to the given version (e.g. PyPI \">=7.0\")")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "range"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.packaging.VersionRange")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "A version range with an optional inclusive lower bound and optional exclusive upper bound (e.g. \">=3.7,<4.0\")")))]))}))}]),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "A specifier constraining acceptable versions of a dependency. Build systems render each variant into their own syntax (e.g. a range becomes \">=3.7,<4.0\" for PyPI or \"[3.7,4.0)\" for Maven). Further variants such as `caret` may be added without breaking consumers of the existing forms.")))]))}))),+ (+ Model.Name "hydra.core.typing.FunctionStructure",+ (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeForall (Model.ForallType {+ Model.forallTypeParameter = (Model.Name "env"),+ Model.forallTypeBody = (Model.TypeRecord [+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "typeParams"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeList (Model.TypeVariable (Model.Name "hydra.core.model.Name"))),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "Type parameters (from type lambdas)")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "params"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeList (Model.TypeVariable (Model.Name "hydra.core.model.Name"))),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "Value parameters (from lambdas)")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "bindings"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeList (Model.TypeVariable (Model.Name "hydra.core.model.Binding"))),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "Let bindings accumulated from the term")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "body"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.model.Term")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "The body term after removing all lambdas, lets, etc.")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "domains"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeList (Model.TypeVariable (Model.Name "hydra.core.model.Type"))),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "Domain types of the value parameters")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "codomain"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeOptional (Model.TypeVariable (Model.Name "hydra.core.model.Type"))),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "The return type of the function (if type inference succeeded)")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "environment"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "env")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "Updated environment after processing all bindings")))]))}))}])})),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "A structured representation of a function term's components, replacing ad-hoc tuples. This captures all the information extracted from peeling lambdas, type lambdas, lets, and type applications from a term.")))]))}))),+ (+ Model.Name "hydra.core.typing.InferenceContext",+ (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeRecord [+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "freshTypeVariableCount"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeLiteral (Model.LiteralTypeInteger Model.IntegerTypeInt32)),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "Counter used to generate distinct fresh type variables during inference")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "trace"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeList (Model.TypeVariable (Model.Name "hydra.core.paths.SubtermStep"))),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "The current subterm-path trace, accumulated backwards (head = most-recently-pushed step, corresponding to the deepest point in the descent). At the moment an inference error is constructed, the list is reversed and wrapped into a SubtermPath (root-to-leaf order) and stamped onto the error.")))]))}))}]),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "State threaded through type inference: the fresh type variable counter and the current subterm-path trace.")))]))}))),+ (+ Model.Name "hydra.core.typing.InferenceResult",+ (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeRecord [+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "term"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.model.Term")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "The term which was inferred")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "type"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.model.Type")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "The inferred type of the term")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "subst"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.typing.TypeSubst")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "The type substitution resulting from unification")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "classConstraints"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeMap (Model.MapType {+ Model.mapTypeKeys = (Model.TypeVariable (Model.Name "hydra.core.model.Name")),+ Model.mapTypeValues = (Model.TypeVariable (Model.Name "hydra.core.model.TypeVariableConstraints"))})),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "Class constraints discovered during inference (e.g., Ord constraints from Map.lookup)")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "context"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.typing.InferenceContext")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "The updated InferenceContext after inference (carries fresh-variable counter and trace)")))]))}))}]),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "The result of applying inference rules to a term.")))]))}))),+ (+ Model.Name "hydra.core.typing.Parameter",+ (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeRecord [+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "name"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.model.Name")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "The name of the parameter")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "description"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeOptional (Model.TypeLiteral Model.LiteralTypeString)),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "An optional human-readable description of the parameter")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "type"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.model.Type")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "The type of the parameter")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "isLazy"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeLiteral Model.LiteralTypeBoolean),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "Whether the parameter must be passed lazily (thunked) at call sites in hosts that distinguish strict from lazy evaluation")))]))}))}]),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "A named, typed parameter of a term, with optional human-readable description and a flag indicating whether the parameter requires lazy evaluation by hosts which support it.")))]))}))),+ (+ Model.Name "hydra.core.typing.Result",+ (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeRecord [+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "description"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeOptional (Model.TypeLiteral Model.LiteralTypeString)),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "An optional human-readable description of the result")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "type"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.model.Type")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "The type of the result")))]))}))}]),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "The result of a term, consisting of a type and an optional human-readable description.")))]))}))),+ (+ Model.Name "hydra.core.typing.TermSignature",+ (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeRecord [+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "typeParameters"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeList (Model.TypeVariable (Model.Name "hydra.core.typing.TypeParameter"))),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "The type parameters of the term, in order")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "parameters"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeList (Model.TypeVariable (Model.Name "hydra.core.typing.Parameter"))),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "The value parameters of the term, in order")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "result"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.typing.Result")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "The result of the term")))]))}))}]),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "A structured signature for a term: an ordered list of type parameters (with optional class constraints), an ordered list of value parameters, and a result. TermSignature is a richer view of TypeScheme: every TermSignature can be converted to a TypeScheme by erasing parameter names, descriptions, and laziness flags.")))]))}))),+ (+ Model.Name "hydra.core.typing.TermSubst",+ (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeWrap (Model.TypeMap (Model.MapType {+ Model.mapTypeKeys = (Model.TypeVariable (Model.Name "hydra.core.model.Name")),+ Model.mapTypeValues = (Model.TypeVariable (Model.Name "hydra.core.model.Term"))}))),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "A substitution of term variables for terms")))]))}))),+ (+ Model.Name "hydra.core.typing.TypeClass",+ (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeRecord [+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "description"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeLiteral Model.LiteralTypeString),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "A human-readable description of the type class")))]))}))}]),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "A type class identifier together with a human-readable description. Type classes are referenced as bare names (e.g. the local name \"equality\") in TypeVariableConstraints.classes; the canonical definitions live as term bindings under hydra.core.classes.")))]))}))),+ (+ Model.Name "hydra.core.typing.TypeConstraint",+ (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeRecord [+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "left"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.model.Type")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "The left-hand side of the constraint")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "right"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.model.Type")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "The right-hand side of the constraint")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "comment"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeLiteral Model.LiteralTypeString),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "A description of the type constraint which may be used for tracing or debugging")))]))}))}]),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "An assertion that two types can be unified into a single type")))]))}))),+ (+ Model.Name "hydra.core.typing.TypeParameter",+ (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeRecord [+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "name"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeVariable (Model.Name "hydra.core.model.Name")),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "The name of the type parameter")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "constraints"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeList (Model.TypeVariable (Model.Name "hydra.core.model.TypeClassConstraint"))),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "Any type class constraints on the type parameter")))]))}))}]),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "A type parameter of a term, with an optional list of type class constraints")))]))}))),+ (+ Model.Name "hydra.core.typing.TypeSubst",+ (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeWrap (Model.TypeMap (Model.MapType {+ Model.mapTypeKeys = (Model.TypeVariable (Model.Name "hydra.core.model.Name")),+ Model.mapTypeValues = (Model.TypeVariable (Model.Name "hydra.core.model.Type"))}))),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "A substitution of type variables for types")))]))}))),+ (+ Model.Name "hydra.core.util.CaseConvention",+ (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeUnion [+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "camel"),+ Model.fieldTypeType = Model.TypeUnit},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "pascal"),+ Model.fieldTypeType = Model.TypeUnit},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "lowerSnake"),+ Model.fieldTypeType = Model.TypeUnit},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "upperSnake"),+ Model.fieldTypeType = Model.TypeUnit},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "upperDashed"),+ Model.fieldTypeType = Model.TypeUnit}]),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "A naming convention for symbols, such as camelCase or snake_case")))]))}))),+ (+ Model.Name "hydra.core.util.Comparison",+ (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeUnion [+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "lessThan"),+ Model.fieldTypeType = Model.TypeUnit},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "equalTo"),+ Model.fieldTypeType = Model.TypeUnit},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "greaterThan"),+ Model.fieldTypeType = Model.TypeUnit}]),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "An equality judgement: less than, equal to, or greater than")))]))}))),+ (+ Model.Name "hydra.core.util.ModuleNames",+ (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeForall (Model.ForallType {+ Model.forallTypeParameter = (Model.Name "n"),+ Model.forallTypeBody = (Model.TypeRecord [+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "focus"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypePair (Model.PairType {+ Model.pairTypeFirst = (Model.TypeVariable (Model.Name "hydra.core.packaging.ModuleName")),+ Model.pairTypeSecond = (Model.TypeVariable (Model.Name "n"))})),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "The module name in focus, together with its associated value")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "mapping"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeMap (Model.MapType {+ Model.mapTypeKeys = (Model.TypeVariable (Model.Name "hydra.core.packaging.ModuleName")),+ Model.mapTypeValues = (Model.TypeVariable (Model.Name "n"))})),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "A mapping of module names to values")))]))}))}])})),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "A mapping from module names to values of type n, with a focus on one module name")))]))}))),+ (+ Model.Name "hydra.core.util.Precision",+ (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeUnion [+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "arbitrary"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = Model.TypeUnit,+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "Arbitrary precision")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "bits"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeLiteral (Model.LiteralTypeInteger Model.IntegerTypeInt32)),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "Precision to a specified number of bits")))]))}))}]),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "Numeric precision: arbitrary precision, or precision to a specified number of bits")))]))}))),+ (+ Model.Name "hydra.core.util.QualifiedName",+ (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeRecord [+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "moduleName"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeOptional (Model.TypeVariable (Model.Name "hydra.core.packaging.ModuleName"))),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "The optional module name")))]))}))},+ Model.FieldType {+ Model.fieldTypeName = (Model.Name "local"),+ Model.fieldTypeType = (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (Model.TypeLiteral Model.LiteralTypeString),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (Model.TermVariable (Model.Name "description"), (Model.TermLiteral (Model.LiteralString "The local name")))]))}))}]),+ Model.annotatedTypeAnnotation = (Model.TermMap (M.fromList [+ (+ Model.TermVariable (Model.Name "description"),+ (Model.TermLiteral (Model.LiteralString "A qualified name consisting of an optional module name together with a mandatory local name")))]))})))]
@@ -0,0 +1,373 @@+-- Note: this is an automatically generated file. Do not edit.++-- | JSON decoding for Hydra terms. Converts JSON Values to Terms using Either for error handling.++module Hydra.Core.Json.Decode where++import qualified Hydra.Core.Ast as Ast+import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Diff as Diff+import qualified Hydra.Core.Docs as Docs+import qualified Hydra.Core.Error.Checking as Checking+import qualified Hydra.Core.Error.File as ErrorFile+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Error.Packaging as ErrorPackaging+import qualified Hydra.Core.Error.System as ErrorSystem+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.Extract.Model as ExtractModel+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Json.Model as JsonModel+import qualified Hydra.Core.Overlay.Haskell.Lib.Eithers as Eithers+import qualified Hydra.Core.Overlay.Haskell.Lib.Equality as Equality+import qualified Hydra.Core.Overlay.Haskell.Lib.Lists as Lists+import qualified Hydra.Core.Overlay.Haskell.Lib.Literals as LibLiterals+import qualified Hydra.Core.Overlay.Haskell.Lib.Logic as Logic+import qualified Hydra.Core.Overlay.Haskell.Lib.Maps as Maps+import qualified Hydra.Core.Overlay.Haskell.Lib.Optionals as Optionals+import qualified Hydra.Core.Overlay.Haskell.Lib.Pairs as Pairs+import qualified Hydra.Core.Overlay.Haskell.Lib.Sets as Sets+import qualified Hydra.Core.Overlay.Haskell.Lib.Strings as Strings+import qualified Hydra.Core.Literals as Literals+import qualified Hydra.Core.Markdown as Markdown+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Parsing as Parsing+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Print.Model as PrintModel+import qualified Hydra.Core.Query as Query+import qualified Hydra.Core.Regex as Regex+import qualified Hydra.Core.Relational as Relational+import qualified Hydra.Core.Resolution as Resolution+import qualified Hydra.Core.Strip as Strip+import qualified Hydra.Core.Substitution as Substitution+import qualified Hydra.Core.System as System+import qualified Hydra.Core.Tabular as Tabular+import qualified Hydra.Core.Testing as Testing+import qualified Hydra.Core.Time as Time+import qualified Hydra.Core.Topology as Topology+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Validation as Validation+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void+import qualified Data.Map as M++-- | Decode a JSON value to a float term. Finite values arrive as JSON numbers; NaN/Inf/-0.0 arrive as JSON string sentinels. Float32 and Float64 are symmetric.+decodeFloat :: Model.FloatType -> JsonModel.Value -> Either String Model.Term+decodeFloat ft value =+ case ft of+ Model.FloatTypeFloat32 -> case value of+ JsonModel.ValueNumber v1 -> Right (Model.TermLiteral (Model.LiteralFloat (Model.FloatValueFloat32 (LibLiterals.decimalToFloat32 v1))))+ JsonModel.ValueString v1 -> Optionals.match (parseSpecialFloat32 v1) (Left (Strings.concat [+ "invalid float32 sentinel: ",+ v1])) (\v -> Right (Model.TermLiteral (Model.LiteralFloat (Model.FloatValueFloat32 v))))+ _ -> Left "expected number or special float string for float32"+ Model.FloatTypeFloat64 -> case value of+ JsonModel.ValueNumber v1 -> Right (Model.TermLiteral (Model.LiteralFloat (Model.FloatValueFloat64 (LibLiterals.decimalToFloat64 v1))))+ JsonModel.ValueString v1 -> Optionals.match (parseSpecialFloat v1) (Left (Strings.concat [+ "invalid float64 sentinel: ",+ v1])) (\v -> Right (Model.TermLiteral (Model.LiteralFloat (Model.FloatValueFloat64 v))))+ _ -> Left "expected number or special float string for float64"++-- | Decode a JSON value to an integer term. Small ints from numbers; large ints from strings.+decodeInteger :: Model.IntegerType -> JsonModel.Value -> Either String Model.Term+decodeInteger it value =+ case it of+ Model.IntegerTypeBigint ->+ let strResult = expectString value+ in (Eithers.either (\err -> Left err) (\s ->+ let parsed = LibLiterals.parseBigint s+ in (Optionals.match parsed (Left (Strings.concat [+ "invalid bigint: ",+ s])) (\v -> Right (Model.TermLiteral (Model.LiteralInteger (Model.IntegerValueBigint v)))))) strResult)+ Model.IntegerTypeInt64 ->+ let strResult = expectString value+ in (Eithers.either (\err -> Left err) (\s ->+ let parsed = LibLiterals.parseInt64 s+ in (Optionals.match parsed (Left (Strings.concat [+ "invalid int64: ",+ s])) (\v -> Right (Model.TermLiteral (Model.LiteralInteger (Model.IntegerValueInt64 v)))))) strResult)+ Model.IntegerTypeUint64 ->+ let strResult = expectString value+ in (Eithers.either (\err -> Left err) (\s ->+ let parsed = LibLiterals.parseUint64 s+ in (Optionals.match parsed (Left (Strings.concat [+ "invalid uint64: ",+ s])) (\v -> Right (Model.TermLiteral (Model.LiteralInteger (Model.IntegerValueUint64 v)))))) strResult)+ Model.IntegerTypeInt8 ->+ let numResult = expectNumber value+ in (Eithers.map (\n -> Model.TermLiteral (Model.LiteralInteger (Model.IntegerValueInt8 (LibLiterals.bigintToInt8 (LibLiterals.decimalToBigint n))))) numResult)+ Model.IntegerTypeInt16 ->+ let numResult = expectNumber value+ in (Eithers.map (\n -> Model.TermLiteral (Model.LiteralInteger (Model.IntegerValueInt16 (LibLiterals.bigintToInt16 (LibLiterals.decimalToBigint n))))) numResult)+ Model.IntegerTypeInt32 ->+ let numResult = expectNumber value+ in (Eithers.map (\n -> Model.TermLiteral (Model.LiteralInteger (Model.IntegerValueInt32 (LibLiterals.bigintToInt32 (LibLiterals.decimalToBigint n))))) numResult)+ Model.IntegerTypeUint8 ->+ let numResult = expectNumber value+ in (Eithers.map (\n -> Model.TermLiteral (Model.LiteralInteger (Model.IntegerValueUint8 (LibLiterals.bigintToUint8 (LibLiterals.decimalToBigint n))))) numResult)+ Model.IntegerTypeUint16 ->+ let numResult = expectNumber value+ in (Eithers.map (\n -> Model.TermLiteral (Model.LiteralInteger (Model.IntegerValueUint16 (LibLiterals.bigintToUint16 (LibLiterals.decimalToBigint n))))) numResult)+ Model.IntegerTypeUint32 -> case value of+ JsonModel.ValueNumber v1 -> Right (Model.TermLiteral (Model.LiteralInteger (Model.IntegerValueUint32 (LibLiterals.bigintToUint32 (LibLiterals.decimalToBigint v1)))))+ JsonModel.ValueString v1 ->+ let parsed = LibLiterals.parseUint32 v1+ in (Optionals.match parsed (Left (Strings.concat [+ "invalid uint32: ",+ v1])) (\v -> Right (Model.TermLiteral (Model.LiteralInteger (Model.IntegerValueUint32 v)))))+ _ -> Left "expected number or string for uint32"++-- | Decode a JSON value to a literal term+decodeLiteral :: Model.LiteralType -> JsonModel.Value -> Either String Model.Term+decodeLiteral lt value =+ case lt of+ Model.LiteralTypeBinary ->+ let strResult = expectString value+ in (Eithers.map (\s -> Model.TermLiteral (Model.LiteralBinary (LibLiterals.base64ToBinary s))) strResult)+ Model.LiteralTypeBoolean -> case value of+ JsonModel.ValueBoolean v1 -> Right (Model.TermLiteral (Model.LiteralBoolean v1))+ _ -> Left "expected boolean"+ Model.LiteralTypeDecimal -> case value of+ JsonModel.ValueNumber v1 -> Right (Model.TermLiteral (Model.LiteralDecimal v1))+ _ -> Left "expected number for decimal"+ Model.LiteralTypeFloat v0 -> decodeFloat v0 value+ Model.LiteralTypeInteger v0 -> decodeInteger v0 value+ Model.LiteralTypeString ->+ let strResult = expectString value+ in (Eithers.map (\s -> Model.TermLiteral (Model.LiteralString s)) strResult)++-- | Extract an array from a JSON value+expectArray :: JsonModel.Value -> Either String [JsonModel.Value]+expectArray value =+ case value of+ JsonModel.ValueArray v0 -> Right v0+ _ -> Left "expected array"++-- | Extract a number from a JSON value+expectNumber :: JsonModel.Value -> Either String Sci.Scientific+expectNumber value =+ case value of+ JsonModel.ValueNumber v0 -> Right v0+ _ -> Left "expected number"++-- | Extract an object from a JSON value as a name-keyed map. Field order is not preserved here; decoding looks fields up by name.+expectObject :: JsonModel.Value -> Either String (M.Map String JsonModel.Value)+expectObject value =+ case value of+ JsonModel.ValueObject v0 -> Right (Maps.fromList v0)+ _ -> Left "expected object"++-- | Extract a string from a JSON value+expectString :: JsonModel.Value -> Either String String+expectString value =+ case value of+ JsonModel.ValueString v0 -> Right v0+ _ -> Left "expected string"++-- | Decode a JSON value to a Hydra term given a type and type name. Returns Left for type mismatches. The compactMaps flag mirrors toJson's: it must be False for any caller reading the checked-in dist/json module-bootstrapping representation, since a byte-stable published-host decoder must be able to read that data unmodified.+fromJson :: M.Map Model.Name Model.Type -> Bool -> Model.Name -> Model.Type -> JsonModel.Value -> Either String Model.Term+fromJson types compactMaps tname typ value =++ let stripped = Strip.deannotateType typ+ reduceApp =+ \app ->+ let fn = Strip.deannotateType (Model.applicationTypeFunction app)+ arg = Model.applicationTypeArgument app+ in case fn of+ Model.TypeApplication v0 -> Eithers.either (\err -> Left err) (\reducedFn -> reduceApp (Model.ApplicationType {+ Model.applicationTypeFunction = reducedFn,+ Model.applicationTypeArgument = arg})) (reduceApp v0)+ Model.TypeForall v0 -> Right (Substitution.substInType (Substitution.singletonTypeSubst (Model.forallTypeParameter v0) arg) (Model.forallTypeBody v0))+ Model.TypeVariable v0 ->+ let lookedUp = Maps.lookup v0 types+ in (Optionals.match lookedUp (Left (Strings.concat [+ "unknown type variable: ",+ (Model.unName v0)])) (\resolvedFn -> reduceApp (Model.ApplicationType {+ Model.applicationTypeFunction = resolvedFn,+ Model.applicationTypeArgument = arg})))+ _ -> Left (Strings.concat [+ "cannot apply a non-parametric type: ",+ (PrintModel.type_ fn)])+ in case stripped of+ Model.TypeApplication v0 -> Eithers.either (\err -> Left err) (\reducedType -> fromJson types compactMaps tname reducedType value) (reduceApp v0)+ Model.TypeForall v0 -> fromJson types compactMaps tname (Model.forallTypeBody v0) value+ Model.TypeLiteral v0 -> decodeLiteral v0 value+ Model.TypeList v0 ->+ let decodeElem = \v -> fromJson types compactMaps tname v0 v+ in case value of+ JsonModel.ValueNull -> Right (Model.TermList [])+ _ -> Eithers.either (\err -> Left err) (\arr ->+ let decoded = Eithers.mapList decodeElem arr+ in (Eithers.map (\ts -> Model.TermList ts) decoded)) (expectArray value)+ Model.TypeSet v0 ->+ let decodeElem = \v -> fromJson types compactMaps tname v0 v+ in case value of+ JsonModel.ValueNull -> Right (Model.TermSet Sets.empty)+ _ -> Eithers.either (\err -> Left err) (\arr ->+ let decoded = Eithers.mapList decodeElem arr+ in (Eithers.map (\elems -> Model.TermSet (Sets.fromList elems)) decoded)) (expectArray value)+ Model.TypeOptional v0 ->+ let innerStripped = Strip.deannotateType v0+ isNestedMaybe =+ case innerStripped of+ Model.TypeOptional _ -> True+ _ -> False+ in (Logic.ifElse isNestedMaybe (+ let decodeJust =+ \arr -> Optionals.match (Lists.head arr) (Left "expected single-element array for Just") (\firstVal -> Eithers.map (\v -> Model.TermOptional (Just v)) (fromJson types compactMaps tname v0 firstVal))+ decodeMaybeArray =+ \arr ->+ let len = Lists.length arr+ in (Logic.ifElse (Equality.equal len 0) (Right (Model.TermOptional Nothing)) (Logic.ifElse (Equality.equal len 1) (decodeJust arr) (Left "expected single-element array for Just")))+ in case value of+ JsonModel.ValueNull -> Right (Model.TermOptional Nothing)+ JsonModel.ValueArray v1 -> decodeMaybeArray v1+ _ -> Left "expected null or single-element array for nested Maybe") (case value of+ JsonModel.ValueNull -> Right (Model.TermOptional Nothing)+ _ -> Eithers.map (\v -> Model.TermOptional (Just v)) (fromJson types compactMaps tname v0 value)))+ Model.TypeRecord v0 ->+ let objResult = expectObject value+ in (Eithers.either (\err -> Left err) (\obj ->+ let decodeField =+ \ft ->+ let fname = Model.fieldTypeName ft+ ftype = Model.fieldTypeType ft+ mval = Maps.lookup (Model.unName fname) obj+ defaultVal = JsonModel.ValueNull+ jsonVal = Optionals.withDefault defaultVal mval+ decoded = fromJson types compactMaps tname ftype jsonVal+ in (Eithers.map (\v -> Model.Field {+ Model.fieldName = fname,+ Model.fieldTerm = v}) decoded)+ decodedFields = Eithers.mapList decodeField v0+ in (Eithers.map (\fs -> Model.TermRecord (Model.Record {+ Model.recordTypeName = tname,+ Model.recordFields = fs})) decodedFields)) objResult)+ Model.TypeUnion v0 ->+ let decodeVariant =+ \key -> \val -> \ftype ->+ let jsonVal = Optionals.withDefault JsonModel.ValueNull val+ decoded = fromJson types compactMaps tname ftype jsonVal+ in (Eithers.map (\v -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = tname,+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name key),+ Model.fieldTerm = v}})) decoded)+ findAndDecode =+ \key -> \val -> \fts -> Optionals.match (Lists.find (\ft -> Equality.equal (Model.unName (Model.fieldTypeName ft)) key) fts) (Left (Strings.concat [+ "unknown variant: ",+ key])) (\ft -> decodeVariant key val (Model.fieldTypeType ft))+ decodeSingleKey =+ \obj -> Optionals.match (Lists.head (Maps.keys obj)) (Left "expected single-key object for union") (\k -> findAndDecode k (Maps.lookup k obj) v0)+ processUnion =+ \obj -> Logic.ifElse (Equality.equal (Lists.length (Maps.keys obj)) 1) (decodeSingleKey obj) (Left "expected single-key object for union")+ decodeCompactString =+ \s -> Optionals.match (Lists.find (\ft -> Equality.equal (Model.unName (Model.fieldTypeName ft)) s) v0) (Left (Strings.concat [+ "unknown variant: ",+ s])) (\ft ->+ let ftypeStripped = Strip.deannotateType (Model.fieldTypeType ft)+ in case ftypeStripped of+ Model.TypeUnit -> Right (Model.TermInject (Model.Injection {+ Model.injectionTypeName = tname,+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.Name s),+ Model.fieldTerm = Model.TermUnit}}))+ _ -> Left (Strings.concat [+ "compact string form requires unit-typed variant, got non-unit type for variant: ",+ s]))+ in case value of+ JsonModel.ValueString v1 -> decodeCompactString v1+ JsonModel.ValueObject v1 ->+ let objAsMap = Maps.fromList v1+ in (processUnion objAsMap)+ _ -> Left "expected string or object for union"+ Model.TypeUnit ->+ let objResult = expectObject value+ in (Eithers.map (\_2 -> Model.TermUnit) objResult)+ Model.TypeWrap v0 ->+ let decoded = fromJson types compactMaps tname v0 value+ in (Eithers.map (\v -> Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = tname,+ Model.wrappedTermBody = v})) decoded)+ Model.TypeMap v0 ->+ let keyType = Model.mapTypeKeys v0+ valType = Model.mapTypeValues v0+ compact = Logic.and compactMaps (Resolution.mapKeyResolvesToString types keyType)+ decodeArrayEntry =+ \entryJson ->+ let objResult = expectObject entryJson+ in (Eithers.either (\err -> Left err) (\entryObj ->+ let keyJson = Maps.lookup "key" entryObj+ valJson = Maps.lookup "value" entryObj+ in (Optionals.match keyJson (Left "missing key in map entry") (\kj -> Optionals.match valJson (Left "missing value in map entry") (\vj ->+ let decodedKey = fromJson types compactMaps tname keyType kj+ decodedVal = fromJson types compactMaps tname valType vj+ in (Eithers.either (\err -> Left err) (\k -> Eithers.map (\v -> (k, v)) decodedVal) decodedKey))))) objResult)+ decodeArrayForm =+ \arr ->+ let entries = Eithers.mapList decodeArrayEntry arr+ in (Eithers.map (\es -> Model.TermMap (Maps.fromList es)) entries)+ decodeCompactForm =+ \obj ->+ let rawKeys = Lists.map Pairs.first obj+ in (Logic.ifElse (Equality.equal (Lists.length rawKeys) (Lists.length (Lists.distinct rawKeys))) (+ let decodeCompactEntry =+ \kv ->+ let kStr = Pairs.first kv+ vJson = Pairs.second kv+ decodedKey = fromJson types compactMaps tname keyType (JsonModel.ValueString kStr)+ decodedVal = fromJson types compactMaps tname valType vJson+ in (Eithers.either (\err -> Left err) (\k -> Eithers.map (\v -> (k, v)) decodedVal) decodedKey)+ entries = Eithers.mapList decodeCompactEntry obj+ in (Eithers.map (\es -> Model.TermMap (Maps.fromList es)) entries)) (Left "duplicate key in compact map object"))+ in case value of+ JsonModel.ValueNull -> Right (Model.TermMap Maps.empty)+ JsonModel.ValueArray v1 -> decodeArrayForm v1+ JsonModel.ValueObject v1 -> Logic.ifElse compact (decodeCompactForm v1) (Left "expected array for map with non-string-resolving key type")+ _ -> Left "expected object or array for map"+ Model.TypePair v0 ->+ let firstType = Model.pairTypeFirst v0+ secondType = Model.pairTypeSecond v0+ objResult = expectObject value+ in (Eithers.either (\err -> Left err) (\obj ->+ let firstJson = Maps.lookup "first" obj+ secondJson = Maps.lookup "second" obj+ in (Optionals.match firstJson (Left "missing first in pair") (\fj -> Optionals.match secondJson (Left "missing second in pair") (\sj ->+ let decodedFirst = fromJson types compactMaps tname firstType fj+ decodedSecond = fromJson types compactMaps tname secondType sj+ in (Eithers.either (\err -> Left err) (\f -> Eithers.map (\s -> Model.TermPair (f, s)) decodedSecond) decodedFirst))))) objResult)+ Model.TypeEither v0 ->+ let leftType = Model.eitherTypeLeft v0+ rightType = Model.eitherTypeRight v0+ objResult = expectObject value+ in (Eithers.either (\err -> Left err) (\obj ->+ let leftJson = Maps.lookup "left" obj+ rightJson = Maps.lookup "right" obj+ in (Logic.ifElse (Logic.and (Optionals.isGiven leftJson) (Optionals.isGiven rightJson)) (Left "Either object must not carry both left and right keys") (Optionals.match leftJson (Optionals.match rightJson (Left "expected left or right in Either") (\rj ->+ let decoded = fromJson types compactMaps tname rightType rj+ in (Eithers.map (\v -> Model.TermEither (Right v)) decoded))) (\lj ->+ let decoded = fromJson types compactMaps tname leftType lj+ in (Eithers.map (\v -> Model.TermEither (Left v)) decoded))))) objResult)+ Model.TypeVariable v0 ->+ let lookedUp = Maps.lookup v0 types+ in (Optionals.match lookedUp (Left (Strings.concat [+ "unknown type variable: ",+ (Model.unName v0)])) (\resolvedType -> fromJson types compactMaps v0 resolvedType value))+ _ -> Left (Strings.concat [+ "unsupported type for JSON decoding: ",+ (PrintModel.type_ typ)])++-- | Parse an IEEE sentinel string (NaN, Infinity, -Infinity, -0.0) to a float64. Returns Nothing for unrecognized strings.+parseSpecialFloat :: String -> Maybe Double+parseSpecialFloat s =+ Logic.ifElse (Logic.or (Equality.equal s "NaN") (Logic.or (Equality.equal s "Infinity") (Logic.or (Equality.equal s "-Infinity") (Equality.equal s "-0.0")))) (LibLiterals.parseFloat64 s) Nothing++-- | Parse an IEEE sentinel string (NaN, Infinity, -Infinity, -0.0) to a float32. Returns Nothing for unrecognized strings.+parseSpecialFloat32 :: String -> Maybe Float+parseSpecialFloat32 s =+ Logic.ifElse (Logic.or (Equality.equal s "NaN") (Logic.or (Equality.equal s "Infinity") (Logic.or (Equality.equal s "-Infinity") (Equality.equal s "-0.0")))) (LibLiterals.parseFloat32 s) Nothing
@@ -0,0 +1,83 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Decoding functions for JSON data++module Hydra.Core.Json.Decoding where++import qualified Hydra.Core.Ast as Ast+import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Diff as Diff+import qualified Hydra.Core.Docs as Docs+import qualified Hydra.Core.Error.Checking as Checking+import qualified Hydra.Core.Error.File as ErrorFile+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Error.Packaging as ErrorPackaging+import qualified Hydra.Core.Error.System as ErrorSystem+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Json.Model as JsonModel+import qualified Hydra.Core.Overlay.Haskell.Lib.Eithers as Eithers+import qualified Hydra.Core.Overlay.Haskell.Lib.Maps as Maps+import qualified Hydra.Core.Overlay.Haskell.Lib.Optionals as Optionals+import qualified Hydra.Core.Overlay.Haskell.Lib.Strings as Strings+import qualified Hydra.Core.Markdown as Markdown+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Parsing as Parsing+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Query as Query+import qualified Hydra.Core.Regex as Regex+import qualified Hydra.Core.Relational as Relational+import qualified Hydra.Core.System as System+import qualified Hydra.Core.Tabular as Tabular+import qualified Hydra.Core.Testing as Testing+import qualified Hydra.Core.Time as Time+import qualified Hydra.Core.Topology as Topology+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Validation as Validation+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void+import qualified Data.Map as M++-- | Decode a JSON array using a decoder for elements+decodeArray :: (JsonModel.Value -> Either String t0) -> JsonModel.Value -> Either String [t0]+decodeArray decodeElem x =+ case x of+ JsonModel.ValueArray v0 -> Eithers.mapList decodeElem v0+ _ -> Left "expected an array"++-- | Decode a JSON boolean value+decodeBoolean :: JsonModel.Value -> Either String Bool+decodeBoolean x =+ case x of+ JsonModel.ValueBoolean v0 -> Right v0+ _ -> Left "expected a boolean"++-- | Decode a required field from a JSON object+decodeField :: (t0 -> Either String t1) -> String -> M.Map String t0 -> Either String t1+decodeField decodeValue name m =+ Eithers.bind (decodeOptionalField decodeValue name m) (\mf -> Optionals.match mf (Left (Strings.concat2 "missing field: " name)) (\f -> Right f))++-- | Decode a JSON object value to a name-keyed map. Field order is not preserved; decoding looks fields up by name.+decodeObject :: JsonModel.Value -> Either String (M.Map String JsonModel.Value)+decodeObject x =+ case x of+ JsonModel.ValueObject v0 -> Right (Maps.fromList v0)+ _ -> Left "expected an object"++-- | Decode an optional field from a JSON object+decodeOptionalField :: Ord t3 => ((t0 -> Either t1 t2) -> t3 -> M.Map t3 t0 -> Either t1 (Maybe t2))+decodeOptionalField decodeValue name m =+ Optionals.match (Maps.lookup name m) (Right Nothing) (\v -> Eithers.map (\x -> Just x) (decodeValue v))++-- | Decode a JSON string value+decodeString :: JsonModel.Value -> Either String String+decodeString x =+ case x of+ JsonModel.ValueString v0 -> Right v0+ _ -> Left "expected a string"
@@ -0,0 +1,344 @@+-- Note: this is an automatically generated file. Do not edit.++-- | JSON encoding for Hydra terms. Converts Terms to JSON Values using Either for error handling.++module Hydra.Core.Json.Encode where++import qualified Hydra.Core.Ast as Ast+import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Diff as Diff+import qualified Hydra.Core.Docs as Docs+import qualified Hydra.Core.Error.Checking as Checking+import qualified Hydra.Core.Error.File as ErrorFile+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Error.Packaging as ErrorPackaging+import qualified Hydra.Core.Error.System as ErrorSystem+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.Extract.Model as ExtractModel+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Json.Model as JsonModel+import qualified Hydra.Core.Overlay.Haskell.Lib.Eithers as Eithers+import qualified Hydra.Core.Overlay.Haskell.Lib.Equality as Equality+import qualified Hydra.Core.Overlay.Haskell.Lib.Lists as Lists+import qualified Hydra.Core.Overlay.Haskell.Lib.Literals as LibLiterals+import qualified Hydra.Core.Overlay.Haskell.Lib.Logic as Logic+import qualified Hydra.Core.Overlay.Haskell.Lib.Maps as Maps+import qualified Hydra.Core.Overlay.Haskell.Lib.Optionals as Optionals+import qualified Hydra.Core.Overlay.Haskell.Lib.Pairs as Pairs+import qualified Hydra.Core.Overlay.Haskell.Lib.Sets as Sets+import qualified Hydra.Core.Overlay.Haskell.Lib.Strings as Strings+import qualified Hydra.Core.Literals as Literals+import qualified Hydra.Core.Markdown as Markdown+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Parsing as Parsing+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Print.Model as PrintModel+import qualified Hydra.Core.Query as Query+import qualified Hydra.Core.Regex as Regex+import qualified Hydra.Core.Relational as Relational+import qualified Hydra.Core.Resolution as Resolution+import qualified Hydra.Core.Strip as Strip+import qualified Hydra.Core.Substitution as Substitution+import qualified Hydra.Core.System as System+import qualified Hydra.Core.Tabular as Tabular+import qualified Hydra.Core.Testing as Testing+import qualified Hydra.Core.Time as Time+import qualified Hydra.Core.Topology as Topology+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Validation as Validation+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void+import qualified Data.Map as M++-- | Encode a float value to JSON. Finite values become JSON numbers (shortest round-trip); IEEE specials (NaN/Inf/-0.0) become JSON strings. Float32 and Float64 are symmetric; the schema disambiguates precision on decode.+encodeFloat :: Model.FloatValue -> Either t0 JsonModel.Value+encodeFloat fv =+ case fv of+ Model.FloatValueFloat32 v0 ->+ let s = LibLiterals.printFloat32 v0+ in (Logic.ifElse (requiresJsonStringSentinel s) (Right (JsonModel.ValueString s)) (Right (JsonModel.ValueNumber (LibLiterals.float32ToDecimal v0))))+ Model.FloatValueFloat64 v0 ->+ let s = LibLiterals.printFloat64 v0+ in (Logic.ifElse (requiresJsonStringSentinel s) (Right (JsonModel.ValueString s)) (Right (JsonModel.ValueNumber (LibLiterals.float64ToDecimal v0))))++-- | Encode an integer value to JSON. Small ints use native numbers; large ints use strings.+encodeInteger :: Model.IntegerValue -> Either t0 JsonModel.Value+encodeInteger iv =+ case iv of+ Model.IntegerValueBigint v0 -> Right (JsonModel.ValueString (LibLiterals.printBigint v0))+ Model.IntegerValueInt64 v0 -> Right (JsonModel.ValueString (LibLiterals.printInt64 v0))+ Model.IntegerValueUint64 v0 -> Right (JsonModel.ValueString (LibLiterals.printUint64 v0))+ Model.IntegerValueInt8 v0 -> Right (JsonModel.ValueNumber (LibLiterals.bigintToDecimal (LibLiterals.int8ToBigint v0)))+ Model.IntegerValueInt16 v0 -> Right (JsonModel.ValueNumber (LibLiterals.bigintToDecimal (LibLiterals.int16ToBigint v0)))+ Model.IntegerValueInt32 v0 -> Right (JsonModel.ValueNumber (LibLiterals.bigintToDecimal (LibLiterals.int32ToBigint v0)))+ Model.IntegerValueUint8 v0 -> Right (JsonModel.ValueNumber (LibLiterals.bigintToDecimal (LibLiterals.uint8ToBigint v0)))+ Model.IntegerValueUint16 v0 -> Right (JsonModel.ValueNumber (LibLiterals.bigintToDecimal (LibLiterals.uint16ToBigint v0)))+ Model.IntegerValueUint32 v0 -> Right (JsonModel.ValueNumber (LibLiterals.bigintToDecimal (LibLiterals.uint32ToBigint v0)))++-- | Encode a Hydra literal to a JSON value+encodeLiteral :: Model.Literal -> Either t0 JsonModel.Value+encodeLiteral lit =+ case lit of+ Model.LiteralBinary v0 -> Right (JsonModel.ValueString (LibLiterals.binaryToBase64 v0))+ Model.LiteralBoolean v0 -> Right (JsonModel.ValueBoolean v0)+ Model.LiteralDecimal v0 -> Right (JsonModel.ValueNumber v0)+ Model.LiteralFloat v0 -> encodeFloat v0+ Model.LiteralInteger v0 -> encodeInteger v0+ Model.LiteralString v0 -> Right (JsonModel.ValueString v0)++-- | True for IEEE sentinel strings that JSON must escape as a string to preserve.+requiresJsonStringSentinel :: String -> Bool+requiresJsonStringSentinel s =+ Logic.or (Equality.equal s "NaN") (Logic.or (Equality.equal s "Infinity") (Logic.or (Equality.equal s "-Infinity") (Equality.equal s "-0.0")))++-- | Encode a Hydra term to a JSON value given a type and type name. Returns Left for unsupported constructs. The compactMaps flag enables the #624 compact object form for string-resolving map keys; it must be False for any caller that reads/writes the checked-in dist/json module-bootstrapping representation (moduleToJson, decodeModuleFromJson, verify-json-kernel), since that wire format is consumed by the published (pre-#624) host and must stay byte-stable. New callers encoding/decoding arbitrary values against a schema (e.g. hydra.build.format digests) may pass True.+toJson :: M.Map Model.Name Model.Type -> Bool -> Model.Name -> Model.Type -> Model.Term -> Either String JsonModel.Value+toJson types compactMaps tname typ term =++ let stripped = Strip.deannotateType typ+ strippedTerm = Strip.deannotateTerm term+ reduceApp =+ \app ->+ let fn = Strip.deannotateType (Model.applicationTypeFunction app)+ arg = Model.applicationTypeArgument app+ in case fn of+ Model.TypeApplication v0 -> Eithers.either (\err -> Left err) (\reducedFn -> reduceApp (Model.ApplicationType {+ Model.applicationTypeFunction = reducedFn,+ Model.applicationTypeArgument = arg})) (reduceApp v0)+ Model.TypeForall v0 -> Right (Substitution.substInType (Substitution.singletonTypeSubst (Model.forallTypeParameter v0) arg) (Model.forallTypeBody v0))+ Model.TypeVariable v0 ->+ let lookedUp = Maps.lookup v0 types+ in (Optionals.match lookedUp (Left (Strings.concat [+ "unknown type variable: ",+ (Model.unName v0)])) (\resolvedFn -> reduceApp (Model.ApplicationType {+ Model.applicationTypeFunction = resolvedFn,+ Model.applicationTypeArgument = arg})))+ _ -> Left (Strings.concat [+ "cannot apply a non-parametric type: ",+ (PrintModel.type_ fn)])+ in case stripped of+ Model.TypeApplication v0 -> Eithers.either (\err -> Left err) (\reducedType -> toJson types compactMaps tname reducedType term) (reduceApp v0)+ Model.TypeForall v0 -> toJson types compactMaps tname (Model.forallTypeBody v0) term+ Model.TypeLiteral _ -> case strippedTerm of+ Model.TermLiteral v1 -> encodeLiteral v1+ _ -> Left "expected literal term"+ Model.TypeList v0 -> case strippedTerm of+ Model.TermList v1 ->+ let results = Eithers.mapList (\t -> toJson types compactMaps tname v0 t) v1+ in (Eithers.map (\vs -> JsonModel.ValueArray vs) results)+ _ -> Left "expected list term"+ Model.TypeSet v0 -> case strippedTerm of+ Model.TermSet v1 ->+ let terms = Sets.toList v1+ results = Eithers.mapList (\t -> toJson types compactMaps tname v0 t) terms+ in (Eithers.map (\vs -> JsonModel.ValueArray vs) results)+ _ -> Left "expected set term"+ Model.TypeOptional v0 ->+ let innerStripped = Strip.deannotateType v0+ isNestedMaybe =+ case innerStripped of+ Model.TypeOptional _ -> True+ _ -> False+ in case strippedTerm of+ Model.TermOptional v1 -> Optionals.match v1 (Right JsonModel.ValueNull) (\v ->+ let encoded = toJson types compactMaps tname v0 v+ in (Logic.ifElse isNestedMaybe (Eithers.map (\ev -> JsonModel.ValueArray [+ ev]) encoded) encoded))+ _ -> Left "expected maybe term"+ Model.TypeRecord v0 -> case strippedTerm of+ Model.TermRecord v1 ->+ let isSimpleMaybe =+ \ftype -> case (Strip.deannotateType ftype) of+ Model.TypeOptional v2 -> case (Strip.deannotateType v2) of+ Model.TypeOptional _ -> False+ _ -> True+ _ -> False+ encodeFieldWithType =+ \ft -> \f ->+ let fname = Model.unName (Model.fieldName f)+ fterm = Model.fieldTerm f+ ftype = Model.fieldTypeType ft+ in (Logic.ifElse (isSimpleMaybe ftype) (case (Strip.deannotateTerm fterm) of+ Model.TermOptional v2 -> Optionals.match v2 (Right Nothing) (\v ->+ let innerType =+ case (Strip.deannotateType ftype) of+ Model.TypeOptional v3 -> v3+ _ -> ftype+ encoded = toJson types compactMaps tname innerType v+ in (Eithers.map (\ev -> Just (fname, ev)) encoded))+ _ -> Left "expected maybe term for optional field") (+ let encoded = toJson types compactMaps tname ftype fterm+ in (Eithers.map (\ev -> Just (fname, ev)) encoded)))+ fieldTypes = v0+ fields = Model.recordFields v1+ encodedPairs =+ Eithers.mapList (\ftf -> encodeFieldWithType (Pairs.first ftf) (Pairs.second ftf)) (Lists.zip fieldTypes fields)+ in (Eithers.map (\pairs -> JsonModel.ValueObject (Optionals.givens pairs)) encodedPairs)+ _ -> Left "expected record term"+ Model.TypeUnion v0 -> case strippedTerm of+ Model.TermInject v1 ->+ let field = Model.injectionField v1+ fname = Model.unName (Model.fieldName field)+ fterm = Model.fieldTerm field+ ftypeResult =+ Optionals.match (Lists.find (\ft -> Equality.equal (Model.unName (Model.fieldTypeName ft)) fname) v0) (Left (Strings.concat [+ "unknown variant: ",+ fname])) (\ft -> Right (Model.fieldTypeType ft))+ in (Eithers.either (\err -> Left err) (\ftype ->+ let ftypeStripped = Strip.deannotateType ftype+ isUnit =+ case ftypeStripped of+ Model.TypeUnit -> True+ _ -> False+ in (Logic.ifElse isUnit (Right (JsonModel.ValueString fname)) (+ let encodedUnion = toJson types compactMaps tname ftype fterm+ in (Eithers.map (\v -> JsonModel.ValueObject [+ (fname, v)]) encodedUnion)))) ftypeResult)+ _ -> Left "expected union term"+ Model.TypeUnit -> Right (JsonModel.ValueObject [])+ Model.TypeWrap v0 -> case strippedTerm of+ Model.TermWrap v1 -> toJson types compactMaps tname v0 (Model.wrappedTermBody v1)+ _ -> Left "expected wrapped term"+ Model.TypeMap v0 ->+ let keyType = Model.mapTypeKeys v0+ valType = Model.mapTypeValues v0+ compact = Logic.and compactMaps (Resolution.mapKeyResolvesToString types keyType)+ in case strippedTerm of+ Model.TermMap v1 -> Logic.ifElse compact (+ let encodeCompactEntry =+ \kv ->+ let k = Pairs.first kv+ v = Pairs.second kv+ encodedK = toJson types compactMaps tname keyType k+ encodedV = toJson types compactMaps tname valType v+ in (Eithers.either (\err -> Left err) (\ek ->+ let keyStrResult =+ case ek of+ JsonModel.ValueString v2 -> Right v2+ _ -> Left "internal error: string-resolving map key did not encode to a JSON string"+ in (Eithers.either (\err -> Left err) (\ks -> Eithers.map (\ev -> (ks, ev)) encodedV) keyStrResult)) encodedK)+ entries = Eithers.mapList encodeCompactEntry (Maps.toList v1)+ in (Eithers.map (\es -> JsonModel.ValueObject es) entries)) (+ let encodeEntry =+ \kv ->+ let k = Pairs.first kv+ v = Pairs.second kv+ encodedK = toJson types compactMaps tname keyType k+ encodedV = toJson types compactMaps tname valType v+ in (Eithers.either (\err -> Left err) (\ek -> Eithers.map (\ev -> JsonModel.ValueObject [+ ("key", ek),+ ("value", ev)]) encodedV) encodedK)+ entries = Eithers.mapList encodeEntry (Maps.toList v1)+ in (Eithers.map (\es -> JsonModel.ValueArray es) entries))+ _ -> Left "expected map term"+ Model.TypePair v0 ->+ let firstType = Model.pairTypeFirst v0+ secondType = Model.pairTypeSecond v0+ in case strippedTerm of+ Model.TermPair v1 ->+ let first = Pairs.first v1+ second = Pairs.second v1+ encodedFirst = toJson types compactMaps tname firstType first+ encodedSecond = toJson types compactMaps tname secondType second+ in (Eithers.either (\err -> Left err) (\ef -> Eithers.map (\es -> JsonModel.ValueObject [+ ("first", ef),+ ("second", es)]) encodedSecond) encodedFirst)+ _ -> Left "expected pair term"+ Model.TypeEither v0 ->+ let leftType = Model.eitherTypeLeft v0+ rightType = Model.eitherTypeRight v0+ in case strippedTerm of+ Model.TermEither v1 -> Eithers.either (\l ->+ let encodedL = toJson types compactMaps tname leftType l+ in (Eithers.map (\v -> JsonModel.ValueObject [+ ("left", v)]) encodedL)) (\r ->+ let encodedR = toJson types compactMaps tname rightType r+ in (Eithers.map (\v -> JsonModel.ValueObject [+ ("right", v)]) encodedR)) v1+ _ -> Left "expected either term"+ Model.TypeVariable v0 ->+ let lookedUp = Maps.lookup v0 types+ in (Optionals.match lookedUp (toJsonUntyped term) (\resolvedType -> toJson types compactMaps v0 resolvedType term))+ _ -> Left (Strings.concat [+ "unsupported type for JSON encoding: ",+ (PrintModel.type_ typ)])++-- | Encode a Hydra term to a JSON value without type information. Falls back to array-wrapped Maybe encoding.+toJsonUntyped :: Model.Term -> Either String JsonModel.Value+toJsonUntyped term =++ let stripped = Strip.deannotateTerm term+ in case stripped of+ Model.TermLiteral v0 -> encodeLiteral v0+ Model.TermList v0 ->+ let results = Eithers.mapList (\t -> toJsonUntyped t) v0+ in (Eithers.map (\vs -> JsonModel.ValueArray vs) results)+ Model.TermSet v0 ->+ let terms = Sets.toList v0+ results = Eithers.mapList (\t -> toJsonUntyped t) terms+ in (Eithers.map (\vs -> JsonModel.ValueArray vs) results)+ Model.TermOptional v0 -> Optionals.match v0 (Right JsonModel.ValueNull) (\v ->+ let encodedMaybe = toJsonUntyped v+ in (Eithers.map (\encoded -> JsonModel.ValueArray [+ encoded]) encodedMaybe))+ Model.TermRecord v0 ->+ let encodeField =+ \f ->+ let fname = Model.unName (Model.fieldName f)+ fterm = Model.fieldTerm f+ encodedField = toJsonUntyped fterm+ in (Eithers.map (\v -> (fname, v)) encodedField)+ fields = Model.recordFields v0+ encodedFields = Eithers.mapList encodeField fields+ in (Eithers.map (\fs -> JsonModel.ValueObject fs) encodedFields)+ Model.TermInject v0 ->+ let field = Model.injectionField v0+ fname = Model.unName (Model.fieldName field)+ fterm = Model.fieldTerm field+ ftermStripped = Strip.deannotateTerm fterm+ isUnit =+ case ftermStripped of+ Model.TermUnit -> True+ _ -> False+ in (Logic.ifElse isUnit (Right (JsonModel.ValueString fname)) (+ let encodedUnion = toJsonUntyped fterm+ in (Eithers.map (\v -> JsonModel.ValueObject [+ (fname, v)]) encodedUnion)))+ Model.TermUnit -> Right (JsonModel.ValueObject [])+ Model.TermWrap v0 -> toJsonUntyped (Model.wrappedTermBody v0)+ Model.TermMap v0 ->+ let encodeEntry =+ \kv ->+ let k = Pairs.first kv+ v = Pairs.second kv+ encodedK = toJsonUntyped k+ encodedV = toJsonUntyped v+ in (Eithers.either (\err -> Left err) (\ek -> Eithers.map (\ev -> JsonModel.ValueObject [+ ("key", ek),+ ("value", ev)]) encodedV) encodedK)+ entries = Eithers.mapList encodeEntry (Maps.toList v0)+ in (Eithers.map (\es -> JsonModel.ValueArray es) entries)+ Model.TermPair v0 ->+ let first = Pairs.first v0+ second = Pairs.second v0+ encodedFirst = toJsonUntyped first+ encodedSecond = toJsonUntyped second+ in (Eithers.either (\err -> Left err) (\ef -> Eithers.map (\es -> JsonModel.ValueObject [+ ("first", ef),+ ("second", es)]) encodedSecond) encodedFirst)+ Model.TermEither v0 -> Eithers.either (\l ->+ let encodedL = toJsonUntyped l+ in (Eithers.map (\v -> JsonModel.ValueObject [+ ("left", v)]) encodedL)) (\r ->+ let encodedR = toJsonUntyped r+ in (Eithers.map (\v -> JsonModel.ValueObject [+ ("right", v)]) encodedR)) v0+ _ -> Left (Strings.concat [+ "unsupported term variant for JSON encoding: ",+ (PrintModel.term term)])
@@ -0,0 +1,40 @@+-- Note: this is an automatically generated file. Do not edit.++-- | A JSON syntax model. See the BNF at https://www.json.org++module Hydra.Core.Json.Model where++import qualified Hydra.Core.Model as Model+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | A JSON value+data Value =+ -- | A JSON array+ ValueArray [Value] |+ -- | A boolean value+ ValueBoolean Bool |+ -- | JSON's null value+ ValueNull |+ -- | A numeric value+ ValueNumber Sci.Scientific |+ -- | A JSON object as an ordered list of key/value pairs. The ordering preserves the declaration order of the record from which the object was encoded, rather than alphabetizing keys. As a consequence, equality of Value objects is order-sensitive: two objects with the same pairs in a different order are equal as JSON, but not as Hydra Values.+ ValueObject [(String, Value)] |+ -- | A string value+ ValueString String+ deriving (Eq, Ord, Read, Show)++_Value = Model.Name "hydra.core.json.model.Value"++_Value_array = Model.Name "array"++_Value_boolean = Model.Name "boolean"++_Value_null = Model.Name "null"++_Value_number = Model.Name "number"++_Value_object = Model.Name "object"++_Value_string = Model.Name "string"
@@ -0,0 +1,156 @@+-- Note: this is an automatically generated file. Do not edit.++-- | JSON parser using Hydra parser combinators++module Hydra.Core.Json.Parser where++import qualified Hydra.Core.Ast as Ast+import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Diff as Diff+import qualified Hydra.Core.Docs as Docs+import qualified Hydra.Core.Error.Checking as Checking+import qualified Hydra.Core.Error.File as ErrorFile+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Error.Packaging as ErrorPackaging+import qualified Hydra.Core.Error.System as ErrorSystem+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Json.Model as JsonModel+import qualified Hydra.Core.Overlay.Haskell.Lib.Equality as Equality+import qualified Hydra.Core.Overlay.Haskell.Lib.Functions as Functions+import qualified Hydra.Core.Overlay.Haskell.Lib.Lists as Lists+import qualified Hydra.Core.Overlay.Haskell.Lib.Literals as Literals+import qualified Hydra.Core.Overlay.Haskell.Lib.Logic as Logic+import qualified Hydra.Core.Overlay.Haskell.Lib.Optionals as Optionals+import qualified Hydra.Core.Overlay.Haskell.Lib.Ordering as Ordering+import qualified Hydra.Core.Overlay.Haskell.Lib.Strings as Strings+import qualified Hydra.Core.Markdown as Markdown+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Parsers as Parsers+import qualified Hydra.Core.Parsing as Parsing+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Query as Query+import qualified Hydra.Core.Regex as Regex+import qualified Hydra.Core.Relational as Relational+import qualified Hydra.Core.System as System+import qualified Hydra.Core.Tabular as Tabular+import qualified Hydra.Core.Testing as Testing+import qualified Hydra.Core.Time as Time+import qualified Hydra.Core.Topology as Topology+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Validation as Validation+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void+import qualified Hydra.Core.Overlay.Haskell.Lib.Literals as Literals++-- | Parse a single digit (0-9)+digit :: Parsing.Parser Int+digit = Parsers.satisfy (\c -> Logic.and (Ordering.gte c 48) (Ordering.lte c 57))++-- | Parse one or more digits as a string+digits :: Parsing.Parser String+digits = Parsers.map Strings.fromList (Parsers.some digit)++-- | Parse a JSON array+jsonArray :: Parsing.Parser JsonModel.Value+jsonArray =+ Parsers.map (\x -> JsonModel.ValueArray x) (Parsers.between (token (Parsers.char 91)) (token (Parsers.char 93)) (Parsers.sepBy (Parsers.lazy (\_ -> jsonValue)) (token (Parsers.char 44))))++-- | Parse JSON boolean (true or false)+jsonBool :: Parsing.Parser JsonModel.Value+jsonBool =+ Parsers.alt (Parsers.map (\_ -> JsonModel.ValueBoolean True) (token (Parsers.string "true"))) (Parsers.map (\_ -> JsonModel.ValueBoolean False) (token (Parsers.string "false")))++-- | Parse a JSON escape sequence after the backslash+jsonEscapeChar :: Parsing.Parser Int+jsonEscapeChar =+ Parsers.choice [+ Parsers.map (\_ -> 34) (Parsers.char 34),+ (Parsers.map (\_ -> 92) (Parsers.char 92)),+ (Parsers.map (\_ -> 47) (Parsers.char 47)),+ (Parsers.map (\_ -> 8) (Parsers.char 98)),+ (Parsers.map (\_ -> 12) (Parsers.char 102)),+ (Parsers.map (\_ -> 10) (Parsers.char 110)),+ (Parsers.map (\_ -> 13) (Parsers.char 114)),+ (Parsers.map (\_ -> 9) (Parsers.char 116))]++-- | Parse the optional exponent part of a JSON number+jsonExponentPart :: Parsing.Parser (Maybe String)+jsonExponentPart =+ Parsers.optional (Parsers.bind (Parsers.satisfy (\c -> Logic.or (Equality.equal c 101) (Equality.equal c 69))) (\_ -> Parsers.bind (Parsers.optional (Parsers.satisfy (\c -> Logic.or (Equality.equal c 43) (Equality.equal c 45)))) (\sign -> Parsers.map (\digits -> Strings.concat2 (Strings.concat2 "e" (Optionals.match sign "" (\arg_ -> Strings.fromList (Lists.singleton arg_)))) digits) digits)))++-- | Parse the optional fractional part of a JSON number+jsonFractionPart :: Parsing.Parser (Maybe String)+jsonFractionPart = Parsers.optional (Parsers.bind (Parsers.char 46) (\_ -> Parsers.map (\d -> Strings.concat2 "." d) digits))++-- | Parse the integer part of a JSON number (optional minus, then digits)+jsonIntegerPart :: Parsing.Parser String+jsonIntegerPart =+ Parsers.bind (Parsers.optional (Parsers.char 45)) (\sign -> Parsers.bind digits (\digits -> Parsers.pure (Optionals.match sign digits (\_ -> Strings.concat2 "-" digits))))++-- | Parse a JSON object key-value pair+jsonKeyValue :: Parsing.Parser (String, JsonModel.Value)+jsonKeyValue =+ Parsers.bind (token (Parsers.bind (Parsers.char 34) (\_ -> Parsers.bind (Parsers.many jsonStringChar) (\chars -> Parsers.bind (Parsers.char 34) (\_2 -> Parsers.pure (Strings.fromList chars)))))) (\key -> Parsers.bind (token (Parsers.char 58)) (\_ -> Parsers.map (\v -> (key, v)) (Parsers.lazy (\_2 -> jsonValue))))++-- | Parse JSON null value+jsonNull :: Parsing.Parser JsonModel.Value+jsonNull = Parsers.map (\_ -> JsonModel.ValueNull) (token (Parsers.string "null"))++-- | Parse a JSON number (integer, decimal, or scientific notation)+jsonNumber :: Parsing.Parser JsonModel.Value+jsonNumber =+ token (Parsers.bind jsonIntegerPart (\intPart -> Parsers.bind jsonFractionPart (\fracPart -> Parsers.bind jsonExponentPart (\expPart ->+ let numStr =+ Strings.concat2 (Strings.concat2 intPart (Optionals.match fracPart "" Functions.identity)) (Optionals.match expPart "" Functions.identity)+ in (Parsers.pure (JsonModel.ValueNumber (Optionals.match (Literals.parseDecimal numStr) (Literals.stringToDecimal "0") Functions.identity)))))))++-- | Parse a JSON object+jsonObject :: Parsing.Parser JsonModel.Value+jsonObject =+ Parsers.map (\x -> JsonModel.ValueObject x) (Parsers.between (token (Parsers.char 123)) (token (Parsers.char 125)) (Parsers.sepBy jsonKeyValue (token (Parsers.char 44))))++-- | Parse a JSON string value+jsonString :: Parsing.Parser JsonModel.Value+jsonString =+ token (Parsers.bind (Parsers.char 34) (\_ -> Parsers.bind (Parsers.many jsonStringChar) (\chars -> Parsers.bind (Parsers.char 34) (\_2 -> Parsers.pure (JsonModel.ValueString (Strings.fromList chars))))))++-- | Parse a single character in a JSON string (handling escapes)+jsonStringChar :: Parsing.Parser Int+jsonStringChar =+ Parsers.alt (Parsers.bind (Parsers.char 92) (\_ -> jsonEscapeChar)) (Parsers.satisfy (\c -> Logic.and (Logic.not (Equality.equal c 34)) (Logic.not (Equality.equal c 92))))++-- | Parse any JSON value+jsonValue :: Parsing.Parser JsonModel.Value+jsonValue =+ Parsers.choice [+ jsonNull,+ jsonBool,+ jsonNumber,+ jsonString,+ jsonArray,+ jsonObject]++-- | Parse a JSON document from a string+parseJson :: String -> Parsing.ParseResult JsonModel.Value+parseJson input =+ Parsers.runParser (Parsers.bind whitespace (\_ -> Parsers.bind jsonValue (\v -> Parsers.bind whitespace (\_2 -> Parsers.bind Parsers.eof (\_3 -> Parsers.pure v))))) input++-- | Parse a token followed by optional whitespace+token :: Parsing.Parser t0 -> Parsing.Parser t0+token p = Parsers.bind p (\x -> Parsers.bind whitespace (\_ -> Parsers.pure x))++-- | Parse zero or more JSON whitespace characters (space, tab, newline, carriage return)+whitespace :: Parsing.Parser ()+whitespace =+ Parsers.map (\_ -> ()) (Parsers.many (Parsers.satisfy (\c -> Lists.foldl Logic.or False [+ Equality.equal c 32,+ (Equality.equal c 9),+ (Equality.equal c 10),+ (Equality.equal c 13)])))
@@ -0,0 +1,113 @@+-- Note: this is an automatically generated file. Do not edit.++-- | JSON serialization functions using the Hydra AST++module Hydra.Core.Json.Writer where++import qualified Hydra.Core.Ast as Ast+import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Diff as Diff+import qualified Hydra.Core.Docs as Docs+import qualified Hydra.Core.Error.Checking as Checking+import qualified Hydra.Core.Error.File as ErrorFile+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Error.Packaging as ErrorPackaging+import qualified Hydra.Core.Error.System as ErrorSystem+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Json.Model as JsonModel+import qualified Hydra.Core.Overlay.Haskell.Lib.Equality as Equality+import qualified Hydra.Core.Overlay.Haskell.Lib.Lists as Lists+import qualified Hydra.Core.Overlay.Haskell.Lib.Literals as Literals+import qualified Hydra.Core.Overlay.Haskell.Lib.Logic as Logic+import qualified Hydra.Core.Overlay.Haskell.Lib.Math as Math+import qualified Hydra.Core.Overlay.Haskell.Lib.Optionals as Optionals+import qualified Hydra.Core.Overlay.Haskell.Lib.Ordering as Ordering+import qualified Hydra.Core.Overlay.Haskell.Lib.Pairs as Pairs+import qualified Hydra.Core.Overlay.Haskell.Lib.Strings as Strings+import qualified Hydra.Core.Markdown as Markdown+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Parsing as Parsing+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Query as Query+import qualified Hydra.Core.Regex as Regex+import qualified Hydra.Core.Relational as Relational+import qualified Hydra.Core.Serialization as Serialization+import qualified Hydra.Core.System as System+import qualified Hydra.Core.Tabular as Tabular+import qualified Hydra.Core.Testing as Testing+import qualified Hydra.Core.Time as Time+import qualified Hydra.Core.Topology as Topology+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Validation as Validation+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | The colon operator used to separate keys and values in JSON objects+colonOp :: Ast.Op+colonOp =+ Ast.Op {+ Ast.opSymbol = (Ast.Symbol ":"),+ Ast.opPadding = Ast.Padding {+ Ast.paddingLeft = Ast.WsNone,+ Ast.paddingRight = Ast.WsSpace},+ Ast.opPrecedence = (Ast.Precedence 0),+ Ast.opAssociativity = Ast.AssociativityNone}++-- | Encode a byte (0..255) as a two-character lowercase hex string. Non-byte inputs yield placeholder '?' characters.+hexByte :: Int -> String+hexByte c =++ let nibble =+ \i -> Optionals.withDefault "?" (Optionals.map (\ch -> Strings.fromList (Lists.singleton ch)) (Strings.charAt i "0123456789abcdef"))+ hi = nibble (Optionals.withDefault 0 (Math.div c 16))+ lo = nibble (Optionals.withDefault 0 (Math.mod c 16))+ in (Strings.concat2 hi lo)++-- | Escape and quote a string for JSON output+jsonString :: String -> String+jsonString s =++ let hexEscape = \c -> Strings.concat2 "\\u00" (hexByte c)+ escape =+ \c -> Logic.ifElse (Equality.equal c 34) "\\\"" (Logic.ifElse (Equality.equal c 92) "\\\\" (Logic.ifElse (Equality.equal c 8) "\\b" (Logic.ifElse (Equality.equal c 12) "\\f" (Logic.ifElse (Equality.equal c 10) "\\n" (Logic.ifElse (Equality.equal c 13) "\\r" (Logic.ifElse (Equality.equal c 9) "\\t" (Logic.ifElse (Ordering.lt c 32) (hexEscape c) (Strings.fromList (Lists.singleton c)))))))))+ escaped = Strings.concat (Lists.map escape (Strings.toList s))+ in (Strings.concat2 (Strings.concat2 "\"" escaped) "\"")++-- | Convert a key-value pair to an AST expression+keyValueToExpr :: (String, JsonModel.Value) -> Ast.Expr+keyValueToExpr pair =++ let key = Pairs.first pair+ value = Pairs.second pair+ in (Serialization.ifx colonOp (Serialization.cst (jsonString key)) (valueToExpr value))++-- | Serialize a JSON value to a string+printJson :: JsonModel.Value -> String+printJson value = Serialization.printExpr (valueToExpr value)++-- | Convert a JSON value to an AST expression for serialization+valueToExpr :: JsonModel.Value -> Ast.Expr+valueToExpr value =+ case value of+ JsonModel.ValueArray v0 -> Serialization.bracketListAdaptive (Lists.map valueToExpr v0)+ JsonModel.ValueBoolean v0 -> Serialization.cst (Logic.ifElse v0 "true" "false")+ JsonModel.ValueNull -> Serialization.cst "null"+ JsonModel.ValueNumber v0 ->+ let rounded = Literals.decimalToBigint v0+ shown = Literals.printDecimal v0+ notExponential = Ordering.lte (Lists.length (Strings.splitOn "e" shown)) 1+ fracParts = Strings.splitOn "." shown+ frac = Optionals.withDefault "" (Lists.at 1 fracParts)+ isWhole =+ Logic.and notExponential (Logic.or (Ordering.lte (Lists.length fracParts) 1) (Strings.isEmpty (Strings.concat (Strings.splitOn "0" frac))))+ plain = Literals.printBigint rounded+ in (Serialization.cst (Logic.ifElse (Logic.and isWhole (Ordering.lte (Strings.length plain) (Strings.length shown))) plain shown))+ JsonModel.ValueObject v0 -> Serialization.bracesListAdaptive (Lists.map keyValueToExpr v0)+ JsonModel.ValueString v0 -> Serialization.cst (jsonString v0)
@@ -0,0 +1,85 @@+-- Note: this is an automatically generated file. Do not edit.++-- | YAML-to-JSON decoding. Converts YAML Nodes to JSON Values (may fail for non-JSON YAML), and YAML Nodes to Hydra Terms via JSON.++module Hydra.Core.Json.Yaml.Decode where++import qualified Hydra.Core.Ast as Ast+import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Diff as Diff+import qualified Hydra.Core.Docs as Docs+import qualified Hydra.Core.Error.Checking as Checking+import qualified Hydra.Core.Error.File as ErrorFile+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Error.Packaging as ErrorPackaging+import qualified Hydra.Core.Error.System as ErrorSystem+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Json.Decode as Decode+import qualified Hydra.Core.Json.Model as JsonModel+import qualified Hydra.Core.Overlay.Haskell.Lib.Eithers as Eithers+import qualified Hydra.Core.Overlay.Haskell.Lib.Literals as Literals+import qualified Hydra.Core.Overlay.Haskell.Lib.Maps as Maps+import qualified Hydra.Core.Overlay.Haskell.Lib.Pairs as Pairs+import qualified Hydra.Core.Markdown as Markdown+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Parsing as Parsing+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Query as Query+import qualified Hydra.Core.Regex as Regex+import qualified Hydra.Core.Relational as Relational+import qualified Hydra.Core.System as System+import qualified Hydra.Core.Tabular as Tabular+import qualified Hydra.Core.Testing as Testing+import qualified Hydra.Core.Time as Time+import qualified Hydra.Core.Topology as Topology+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Validation as Validation+import qualified Hydra.Core.Variants as Variants+import qualified Hydra.Core.Yaml.Model as YamlModel+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void+import qualified Data.Map as M++-- | Decode a YAML node to a Hydra term via JSON decoding.+fromYaml :: M.Map Model.Name Model.Type -> Model.Name -> Model.Type -> YamlModel.Node -> Either String Model.Term+fromYaml types tname typ node =++ let jsonResult = yamlToJson node+ in (Eithers.either (\err -> Left err) (\json -> Decode.fromJson types False tname typ json) jsonResult)++-- | Convert a YAML node to a JSON value. Fails for non-JSON YAML features (e.g. non-string mapping keys).+yamlToJson :: YamlModel.Node -> Either String JsonModel.Value+yamlToJson node =+ case node of+ YamlModel.NodeMapping v0 ->+ let convertEntry =+ \kv ->+ let keyNode = Pairs.first kv+ valNode = Pairs.second kv+ keyResult =+ case keyNode of+ YamlModel.NodeScalar v1 -> case v1 of+ YamlModel.ScalarStr v2 -> Right v2+ _ -> Left "non-string YAML mapping key"+ _ -> Left "non-scalar YAML mapping key"+ in (Eithers.either (\err -> Left err) (\key ->+ let valResult = yamlToJson valNode+ in (Eithers.map (\v -> (key, v)) valResult)) keyResult)+ entries = Eithers.mapList convertEntry (Maps.toList v0)+ in (Eithers.map (\es -> JsonModel.ValueObject es) entries)+ YamlModel.NodeScalar v0 -> case v0 of+ YamlModel.ScalarBool v1 -> Right (JsonModel.ValueBoolean v1)+ YamlModel.ScalarDecimal v1 -> Right (JsonModel.ValueNumber v1)+ YamlModel.ScalarFloat v1 -> Right (JsonModel.ValueNumber (Literals.float64ToDecimal v1))+ YamlModel.ScalarInt v1 -> Right (JsonModel.ValueNumber (Literals.bigintToDecimal v1))+ YamlModel.ScalarNull -> Right JsonModel.ValueNull+ YamlModel.ScalarStr v1 -> Right (JsonModel.ValueString v1)+ YamlModel.NodeSequence v0 ->+ let results = Eithers.mapList (\n -> yamlToJson n) v0+ in (Eithers.map (\vs -> JsonModel.ValueArray vs) results)
@@ -0,0 +1,62 @@+-- Note: this is an automatically generated file. Do not edit.++-- | JSON-to-YAML encoding. Converts JSON Values to YAML Nodes (always succeeds), and Hydra Terms to YAML Nodes via JSON.++module Hydra.Core.Json.Yaml.Encode where++import qualified Hydra.Core.Ast as Ast+import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Diff as Diff+import qualified Hydra.Core.Docs as Docs+import qualified Hydra.Core.Error.Checking as Checking+import qualified Hydra.Core.Error.File as ErrorFile+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Error.Packaging as ErrorPackaging+import qualified Hydra.Core.Error.System as ErrorSystem+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Json.Encode as Encode+import qualified Hydra.Core.Json.Model as JsonModel+import qualified Hydra.Core.Overlay.Haskell.Lib.Eithers as Eithers+import qualified Hydra.Core.Overlay.Haskell.Lib.Lists as Lists+import qualified Hydra.Core.Overlay.Haskell.Lib.Maps as Maps+import qualified Hydra.Core.Overlay.Haskell.Lib.Pairs as Pairs+import qualified Hydra.Core.Markdown as Markdown+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Parsing as Parsing+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Query as Query+import qualified Hydra.Core.Regex as Regex+import qualified Hydra.Core.Relational as Relational+import qualified Hydra.Core.System as System+import qualified Hydra.Core.Tabular as Tabular+import qualified Hydra.Core.Testing as Testing+import qualified Hydra.Core.Time as Time+import qualified Hydra.Core.Topology as Topology+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Validation as Validation+import qualified Hydra.Core.Variants as Variants+import qualified Hydra.Core.Yaml.Model as YamlModel+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void+import qualified Data.Map as M++-- | Convert a JSON value to a YAML node. Always succeeds since YAML is a superset of JSON.+jsonToYaml :: JsonModel.Value -> YamlModel.Node+jsonToYaml value =+ case value of+ JsonModel.ValueArray v0 -> YamlModel.NodeSequence (Lists.map (\v -> jsonToYaml v) v0)+ JsonModel.ValueBoolean v0 -> YamlModel.NodeScalar (YamlModel.ScalarBool v0)+ JsonModel.ValueNull -> YamlModel.NodeScalar YamlModel.ScalarNull+ JsonModel.ValueNumber v0 -> YamlModel.NodeScalar (YamlModel.ScalarDecimal v0)+ JsonModel.ValueObject v0 -> YamlModel.NodeMapping (Maps.fromList (Lists.map (\kv -> (YamlModel.NodeScalar (YamlModel.ScalarStr (Pairs.first kv)), (jsonToYaml (Pairs.second kv)))) v0))+ JsonModel.ValueString v0 -> YamlModel.NodeScalar (YamlModel.ScalarStr v0)++-- | Encode a Hydra term to a YAML node via JSON encoding.+toYaml :: M.Map Model.Name Model.Type -> Model.Name -> Model.Type -> Model.Term -> Either String YamlModel.Node+toYaml types tname typ term = Eithers.map (\v -> jsonToYaml v) (Encode.toJson types False tname typ term)
@@ -0,0 +1,80 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Language constraints for Hydra Core++module Hydra.Core.Languages where++import qualified Hydra.Core.Ast as Ast+import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Diff as Diff+import qualified Hydra.Core.Docs as Docs+import qualified Hydra.Core.Error.Checking as Checking+import qualified Hydra.Core.Error.File as ErrorFile+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Error.Packaging as ErrorPackaging+import qualified Hydra.Core.Error.System as ErrorSystem+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Json.Model as JsonModel+import qualified Hydra.Core.Overlay.Haskell.Lib.Sets as Sets+import qualified Hydra.Core.Markdown as Markdown+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Parsing as Parsing+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Query as Query+import qualified Hydra.Core.Reflect as Reflect+import qualified Hydra.Core.Regex as Regex+import qualified Hydra.Core.Relational as Relational+import qualified Hydra.Core.System as System+import qualified Hydra.Core.Tabular as Tabular+import qualified Hydra.Core.Testing as Testing+import qualified Hydra.Core.Time as Time+import qualified Hydra.Core.Topology as Topology+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Validation as Validation+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | Language constraints for Hydra Core, i.e. no constraints.+hydraLanguage :: Coders.Language+hydraLanguage =+ Coders.Language {+ Coders.languageName = (Coders.LanguageName "hydra.core.model"),+ Coders.languageConstraints = Coders.LanguageConstraints {+ Coders.languageConstraintsLiteralVariants = literalVariants,+ Coders.languageConstraintsFloatTypes = floatTypes,+ Coders.languageConstraintsIntegerTypes = integerTypes,+ Coders.languageConstraintsTermVariants = termVariants,+ Coders.languageConstraintsTypeVariants = typeVariants,+ Coders.languageConstraintsTypes = types},+ Coders.languageSupportedFeatures = (Sets.fromList [+ Coders.LanguageFeaturePartialApplication,+ Coders.LanguageFeatureNestedCaseStatements,+ Coders.LanguageFeatureNestedPolymorphicLetBindings]),+ Coders.languageCaseConventions = Coders.CaseConventions {+ Coders.caseConventionsConstant = Util.CaseConventionUpperSnake,+ Coders.caseConventionsDirectory = Util.CaseConventionPascal,+ Coders.caseConventionsEnumValue = Util.CaseConventionPascal,+ Coders.caseConventionsField = Util.CaseConventionCamel,+ Coders.caseConventionsFile = Util.CaseConventionPascal,+ Coders.caseConventionsModule = Util.CaseConventionLowerSnake,+ Coders.caseConventionsTerm = Util.CaseConventionCamel,+ Coders.caseConventionsTermVariable = Util.CaseConventionCamel,+ Coders.caseConventionsType = Util.CaseConventionPascal,+ Coders.caseConventionsTypeVariable = Util.CaseConventionCamel},+ Coders.languageDefaultFileExtension = (File.FileExtension "")}+ where+ literalVariants = Sets.fromList Reflect.literalVariants+ floatTypes = Sets.fromList Reflect.floatTypes+ integerTypes = Sets.fromList Reflect.integerTypes+ termVariants = Sets.fromList Reflect.termVariants+ typeVariants = Sets.fromList Reflect.typeVariants+ types =+ \t -> case t of+ _ -> True
@@ -0,0 +1,311 @@+-- Note: this is an automatically generated file. Do not edit.++-- | A module for lexical operations over graphs.++module Hydra.Core.Lexical where++import qualified Hydra.Core.Ast as Ast+import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Diff as Diff+import qualified Hydra.Core.Docs as Docs+import qualified Hydra.Core.Error.Checking as Checking+import qualified Hydra.Core.Error.File as ErrorFile+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Error.Packaging as ErrorPackaging+import qualified Hydra.Core.Error.System as ErrorSystem+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Json.Model as JsonModel+import qualified Hydra.Core.Overlay.Haskell.Lib.Eithers as Eithers+import qualified Hydra.Core.Overlay.Haskell.Lib.Equality as Equality+import qualified Hydra.Core.Overlay.Haskell.Lib.Lists as Lists+import qualified Hydra.Core.Overlay.Haskell.Lib.Literals as Literals+import qualified Hydra.Core.Overlay.Haskell.Lib.Logic as Logic+import qualified Hydra.Core.Overlay.Haskell.Lib.Maps as Maps+import qualified Hydra.Core.Overlay.Haskell.Lib.Math as Math+import qualified Hydra.Core.Overlay.Haskell.Lib.Optionals as Optionals+import qualified Hydra.Core.Overlay.Haskell.Lib.Ordering as Ordering+import qualified Hydra.Core.Overlay.Haskell.Lib.Pairs as Pairs+import qualified Hydra.Core.Overlay.Haskell.Lib.Sets as Sets+import qualified Hydra.Core.Overlay.Haskell.Lib.Strings as Strings+import qualified Hydra.Core.Markdown as Markdown+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Parsing as Parsing+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Print.Errors as PrintErrors+import qualified Hydra.Core.Print.Model as PrintModel+import qualified Hydra.Core.Query as Query+import qualified Hydra.Core.Regex as Regex+import qualified Hydra.Core.Relational as Relational+import qualified Hydra.Core.Scoping as Scoping+import qualified Hydra.Core.Strip as Strip+import qualified Hydra.Core.System as System+import qualified Hydra.Core.Tabular as Tabular+import qualified Hydra.Core.Testing as Testing+import qualified Hydra.Core.Time as Time+import qualified Hydra.Core.Topology as Topology+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Validation as Validation+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void+import qualified Data.Map as M+import qualified Data.Set as S++-- | Build a Graph from element bindings, environment, and primitives+buildGraph :: [Model.Binding] -> M.Map Model.Name (Maybe Model.Term) -> M.Map Model.Name Graph.Primitive -> Graph.Graph+buildGraph elements environment primitives =++ let elementTerms = Maps.fromList (Lists.map (\b -> (Model.bindingName b, (Model.bindingTerm b))) elements)+ letTerms =+ Maps.fromList (Optionals.mapOptional (\kv -> Optionals.map (\t -> (Pairs.first kv, t)) (Pairs.second kv)) (Maps.toList environment))+ mergedTerms = Maps.union elementTerms letTerms+ filteredTerms = Maps.filterWithKey (\k -> \_v -> Logic.not (Maps.member k primitives)) mergedTerms+ elementTypes =+ Maps.fromList (Optionals.givens (Lists.map (\b -> Optionals.map (\ts -> (Model.bindingName b, ts)) (Model.bindingTypeScheme b)) elements))+ filteredTypes = Maps.filterWithKey (\k -> \_v -> Logic.not (Maps.member k primitives)) elementTypes+ in Graph.Graph {+ Graph.graphBoundTerms = filteredTerms,+ Graph.graphBoundTypes = filteredTypes,+ Graph.graphClassConstraints = Maps.empty,+ Graph.graphLambdaVariables = (Sets.fromList (Maps.keys (Maps.filter (\mt -> Optionals.isNone mt) environment))),+ Graph.graphMetadata = Maps.empty,+ Graph.graphPrimitives = primitives,+ Graph.graphSchemaTypes = Maps.empty,+ Graph.graphTypeVariables = Sets.empty}++-- | Pick a name that does not collide with a reserved set, by appending a numeric suffix to the requested name when necessary+chooseUniqueName :: S.Set Model.Name -> Model.Name -> Model.Name+chooseUniqueName reserved name =++ let tryName =+ \index ->+ let candidate =+ Logic.ifElse (Equality.equal index 1) name (Model.Name (Strings.concat2 (Model.unName name) (Literals.printInt32 index)))+ in (Logic.ifElse (Sets.member candidate reserved) (tryName (Math.add index 1)) candidate)+ in (tryName 1)++-- | Resolve a schema type through a chain of zero or more typedefs+dereferenceSchemaType :: Model.Name -> M.Map Model.Name Model.TypeScheme -> Maybe Model.TypeScheme+dereferenceSchemaType name types =++ let forType =+ \t -> case t of+ Model.TypeAnnotated v0 -> forType (Model.annotatedTypeBody v0)+ Model.TypeForall v0 -> Optionals.map (\ts -> Model.TypeScheme {+ Model.typeSchemeVariables = (Lists.cons (Model.forallTypeParameter v0) (Model.typeSchemeVariables ts)),+ Model.typeSchemeBody = (Model.typeSchemeBody ts),+ Model.typeSchemeConstraints = (Model.typeSchemeConstraints ts)}) (forType (Model.forallTypeBody v0))+ Model.TypeVariable v0 -> dereferenceSchemaType v0 types+ _ -> Just (Model.TypeScheme {+ Model.typeSchemeVariables = [],+ Model.typeSchemeBody = t,+ Model.typeSchemeConstraints = Maps.empty})+ in (Optionals.bind (Maps.lookup name types) (\ts -> Optionals.map (\ts2 -> Model.TypeScheme {+ Model.typeSchemeVariables = (Lists.concat2 (Model.typeSchemeVariables ts) (Model.typeSchemeVariables ts2)),+ Model.typeSchemeBody = (Model.typeSchemeBody ts2),+ Model.typeSchemeConstraints = (Model.typeSchemeConstraints ts2)}) (forType (Model.typeSchemeBody ts))))++-- | Look up a binding by name in a graph, returning Either an error or the binding+dereferenceVariable :: Graph.Graph -> Model.Name -> Either Errors.Error Model.Binding+dereferenceVariable graph name =+ Optionals.match (lookupBinding graph name) (Left (Errors.ErrorResolution (Errors.ResolutionErrorNoSuchBinding (Errors.NoSuchBindingError {+ Errors.noSuchBindingErrorName = name})))) (\right_ -> Right right_)++-- | Create a graph from a parent graph, schema types, and list of element bindings+elementsToGraph :: Graph.Graph -> M.Map Model.Name Model.TypeScheme -> [Model.Binding] -> Graph.Graph+elementsToGraph parent schemaTypes elements =++ let prims = Graph.graphPrimitives parent+ g = buildGraph elements Maps.empty prims+ in Graph.Graph {+ Graph.graphBoundTerms = (Graph.graphBoundTerms g),+ Graph.graphBoundTypes = (Graph.graphBoundTypes g),+ Graph.graphClassConstraints = (Graph.graphClassConstraints g),+ Graph.graphLambdaVariables = (Graph.graphLambdaVariables g),+ Graph.graphMetadata = (Graph.graphMetadata g),+ Graph.graphPrimitives = (Graph.graphPrimitives g),+ Graph.graphSchemaTypes = schemaTypes,+ Graph.graphTypeVariables = (Graph.graphTypeVariables g)}++-- | An empty graph; no elements, no primitives, no schema.+emptyGraph :: Graph.Graph+emptyGraph =+ Graph.Graph {+ Graph.graphBoundTerms = Maps.empty,+ Graph.graphBoundTypes = Maps.empty,+ Graph.graphClassConstraints = Maps.empty,+ Graph.graphLambdaVariables = Sets.empty,+ Graph.graphMetadata = Maps.empty,+ Graph.graphPrimitives = Maps.empty,+ Graph.graphSchemaTypes = Maps.empty,+ Graph.graphTypeVariables = Sets.empty}++-- | An empty inference context; fresh-variable counter at zero and empty trace.+emptyInferenceContext :: Typing.InferenceContext+emptyInferenceContext =+ Typing.InferenceContext {+ Typing.inferenceContextFreshTypeVariableCount = 0,+ Typing.inferenceContextTrace = []}++-- | Extract the fields of a record or union type+fieldsOf :: Model.Type -> [Model.FieldType]+fieldsOf t =++ let stripped = Strip.deannotateType t+ in case stripped of+ Model.TypeForall v0 -> fieldsOf (Model.forallTypeBody v0)+ Model.TypeRecord v0 -> v0+ Model.TypeUnion v0 -> v0+ _ -> []++-- | Look up a field by name in a record's field map and decode its value, failing if the field is missing+getField :: M.Map Model.Name t0 -> Model.Name -> (t0 -> Either Errors.Error t1) -> Either Errors.Error t1+getField m fname decode =+ Optionals.match (Maps.lookup fname m) (Left (Errors.ErrorResolution (Errors.ResolutionErrorNoMatchingField (Errors.NoMatchingFieldError {+ Errors.noMatchingFieldErrorFieldName = fname})))) decode++-- | Reconstruct a list of Bindings from a Graph's boundTerms and boundTypes+graphToBindings :: Graph.Graph -> [Model.Binding]+graphToBindings g =+ Lists.map (\p ->+ let name = Pairs.first p+ term = Pairs.second p+ in Model.Binding {+ Model.bindingName = name,+ Model.bindingTerm = term,+ Model.bindingTypeScheme = (Maps.lookup name (Graph.graphBoundTypes g))}) (Maps.toList (Graph.graphBoundTerms g))++-- | Build a graph with primitives assembled from built-in and user-provided lists. User-provided primitives shadow built-in ones.+graphWithPrimitives :: [Graph.Primitive] -> [Graph.Primitive] -> Graph.Graph+graphWithPrimitives builtIn userProvided =++ let toMap = \ps -> Maps.fromList (Lists.map (\p -> (Packaging.primitiveDefinitionName (Graph.primitiveDefinition p), p)) ps)+ prims = Maps.union (toMap userProvided) (toMap builtIn)+ in (buildGraph [] Maps.empty prims)++-- | Look up a binding in a graph by name+lookupBinding :: Graph.Graph -> Model.Name -> Maybe Model.Binding+lookupBinding graph name =+ Optionals.map (\term -> Model.Binding {+ Model.bindingName = name,+ Model.bindingTerm = term,+ Model.bindingTypeScheme = (Maps.lookup name (Graph.graphBoundTypes graph))}) (Maps.lookup name (Graph.graphBoundTerms graph))++-- | Look up a primitive function in a graph by name+lookupPrimitive :: Graph.Graph -> Model.Name -> Maybe Graph.Primitive+lookupPrimitive graph name = Maps.lookup name (Graph.graphPrimitives graph)++-- | Look up a term by name in a graph+lookupTerm :: Graph.Graph -> Model.Name -> Maybe Model.Term+lookupTerm graph name = Maps.lookup name (Graph.graphBoundTerms graph)++-- | Match a term against an enum type, dispatching on the variant name to a value from the supplied list+matchEnum :: Graph.Graph -> Model.Name -> [(Model.Name, t0)] -> Model.Term -> Either Errors.Error t0+matchEnum graph tname pairs =+ matchUnion graph tname (Lists.map (\pair -> matchUnitField (Pairs.first pair) (Pairs.second pair)) pairs)++-- | Match a term against a record type and decode its fields, failing if the term is not a record+matchRecord :: t0 -> (M.Map Model.Name Model.Term -> Either Errors.Error t1) -> Model.Term -> Either Errors.Error t1+matchRecord graph decode term =++ let stripped = Strip.deannotateAndDetypeTerm term+ in case stripped of+ Model.TermRecord v0 -> decode (Maps.fromList (Lists.map (\field -> (Model.fieldName field, (Model.fieldTerm field))) (Model.recordFields v0)))+ _ -> Left (Errors.ErrorResolution (Errors.ResolutionErrorUnexpectedShape (Errors.UnexpectedShapeError {+ Errors.unexpectedShapeErrorExpected = "record",+ Errors.unexpectedShapeErrorActual = (PrintModel.term term)})))++-- | Match a term against a union type, dispatching on the injected variant to the appropriate decoder. Variable terms are dereferenced through the graph before matching.+matchUnion :: Graph.Graph -> Model.Name -> [(Model.Name, (Model.Term -> Either Errors.Error t0))] -> Model.Term -> Either Errors.Error t0+matchUnion graph tname pairs term =++ let stripped = Strip.deannotateAndDetypeTerm term+ mapping = Maps.fromList pairs+ in case stripped of+ Model.TermVariable v0 -> Eithers.bind (requireBinding graph v0) (\el -> matchUnion graph tname pairs (Model.bindingTerm el))+ Model.TermInject v0 ->+ let exp =++ let fname = Model.fieldName (Model.injectionField v0)+ val = Model.fieldTerm (Model.injectionField v0)+ in (Optionals.match (Maps.lookup fname mapping) (Left (Errors.ErrorResolution (Errors.ResolutionErrorNoMatchingField (Errors.NoMatchingFieldError {+ Errors.noMatchingFieldErrorFieldName = fname})))) (\f -> f val))+ in (Logic.ifElse (Equality.equal (Model.unName (Model.injectionTypeName v0)) (Model.unName tname)) exp (Left (Errors.ErrorResolution (Errors.ResolutionErrorUnexpectedShape (Errors.UnexpectedShapeError {+ Errors.unexpectedShapeErrorExpected = (Strings.concat2 "injection for type " (Model.unName tname)),+ Errors.unexpectedShapeErrorActual = (PrintModel.term term)})))))+ _ -> Left (Errors.ErrorResolution (Errors.ResolutionErrorUnexpectedShape (Errors.UnexpectedShapeError {+ Errors.unexpectedShapeErrorExpected = (Strings.concat2 "injection for type " (Model.unName tname)),+ Errors.unexpectedShapeErrorActual = (PrintModel.term stripped)})))++-- | Build a (fieldName, decoder) pair for a unit-valued union variant: the decoder ignores its argument and returns a fixed value+matchUnitField :: t0 -> t1 -> (t0, (t2 -> Either t3 t1))+matchUnitField fname x = (fname, (\ignored -> Right x))++-- | Look up a binding in a graph by name, failing with a list of available names if it is not found+requireBinding :: Graph.Graph -> Model.Name -> Either Errors.Error Model.Binding+requireBinding graph name =++ let showAll = False+ ellipsis =+ \strings -> Logic.ifElse (Logic.and (Ordering.gt (Lists.length strings) 3) (Logic.not showAll)) (Lists.concat2 (Lists.take 3 strings) [+ "..."]) strings+ errMsg =+ Strings.concat2 (Strings.concat2 (Strings.concat2 (Strings.concat2 "no such element: " (Model.unName name)) ". Available elements: {") (Strings.join ", " (ellipsis (Lists.map Model.unName (Maps.keys (Graph.graphBoundTerms graph)))))) "}"+ in (Optionals.match (lookupBinding graph name) (Left (Errors.ErrorResolution (Errors.ResolutionErrorOther (Errors.OtherResolutionError errMsg)))) (\x -> Right x))++-- | Look up a primitive in a graph by name, failing if it is not registered+requirePrimitive :: Graph.Graph -> Model.Name -> Either Errors.Error Graph.Primitive+requirePrimitive graph name =+ Optionals.match (lookupPrimitive graph name) (Left (Errors.ErrorResolution (Errors.ResolutionErrorNoSuchPrimitive (Errors.NoSuchPrimitiveError {+ Errors.noSuchPrimitiveErrorName = name})))) (\x -> Right x)++-- | Look up a primitive's type scheme in a graph by name, failing if the primitive is not registered+requirePrimitiveType :: Graph.Graph -> Model.Name -> Either Errors.Error Model.TypeScheme+requirePrimitiveType tx name =++ let mts =+ Optionals.map (\_p -> Scoping.termSignatureToTypeScheme (Packaging.primitiveDefinitionSignature (Graph.primitiveDefinition _p))) (Maps.lookup name (Graph.graphPrimitives tx))+ in (Optionals.match mts (Left (Errors.ErrorResolution (Errors.ResolutionErrorNoSuchPrimitive (Errors.NoSuchPrimitiveError {+ Errors.noSuchPrimitiveErrorName = name})))) (\ts -> Right ts))++-- | Resolve a name to a term in the graph, following variable references, and fail if the name is not bound+requireTerm :: Graph.Graph -> Model.Name -> Either Errors.Error Model.Term+requireTerm graph name =+ Optionals.match (resolveTerm graph name) (Left (Errors.ErrorResolution (Errors.ResolutionErrorNoSuchBinding (Errors.NoSuchBindingError {+ Errors.noSuchBindingErrorName = name})))) (\x -> Right x)++-- | TODO: distinguish between lambda-bound and let-bound variables+resolveTerm :: Graph.Graph -> Model.Name -> Maybe Model.Term+resolveTerm graph name =++ let recurse =+ \term ->+ let stripped = Strip.deannotateTerm term+ in case stripped of+ Model.TermVariable v0 -> resolveTerm graph v0+ _ -> Just term+ in (Optionals.match (lookupTerm graph name) Nothing recurse)++-- | Strip annotations and type lambdas/applications from a term, then follow variable references through the graph until a non-variable term is reached+stripAndDereferenceTerm :: Graph.Graph -> Model.Term -> Either Errors.Error Model.Term+stripAndDereferenceTerm graph term =++ let stripped = Strip.deannotateAndDetypeTerm term+ in case stripped of+ Model.TermVariable v0 -> Eithers.bind (requireTerm graph v0) (\t -> stripAndDereferenceTerm graph t)+ _ -> Right stripped++-- | Strip annotations and dereference variables, returning Either an error or the resolved term+stripAndDereferenceTermEither :: Graph.Graph -> Model.Term -> Either Errors.Error Model.Term+stripAndDereferenceTermEither graph term =++ let stripped = Strip.deannotateAndDetypeTerm term+ in case stripped of+ Model.TermVariable v0 -> Eithers.either (\left_ -> Left left_) (\binding -> stripAndDereferenceTermEither graph (Model.bindingTerm binding)) (dereferenceVariable graph v0)+ _ -> Right stripped
@@ -0,0 +1,270 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Primitives in the hydra.core.lib.chars module.++module Hydra.Core.Lib.Chars where++import qualified Hydra.Core.Ast as Ast+import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Diff as Diff+import qualified Hydra.Core.Docs as Docs+import qualified Hydra.Core.Error.Checking as Checking+import qualified Hydra.Core.Error.File as ErrorFile+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Error.Packaging as ErrorPackaging+import qualified Hydra.Core.Error.System as ErrorSystem+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Json.Model as JsonModel+import qualified Hydra.Core.Markdown as Markdown+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Parsing as Parsing+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Query as Query+import qualified Hydra.Core.Regex as Regex+import qualified Hydra.Core.Relational as Relational+import qualified Hydra.Core.System as System+import qualified Hydra.Core.Tabular as Tabular+import qualified Hydra.Core.Testing as Testing+import qualified Hydra.Core.Time as Time+import qualified Hydra.Core.Topology as Topology+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Validation as Validation+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++isAlpha :: Packaging.PrimitiveDefinition+isAlpha =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.chars.isAlpha"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Check whether a character is alphabetic."),+ Packaging.entityMetadataComments = [+ "True if the argument is a Unicode letter \8212 any of the general categories L* (Lu, Ll, Lt, Lm, Lo) \8212 and false otherwise.",+ "The argument is interpreted as a Unicode code point: arguments outside the valid code-point range [0, 0x10FFFF] yield an implementation-defined result (typically false).",+ "Alphabetic is broader than cased: letters in scripts without a case distinction are included. isAlphaNum is true whenever isAlpha is true.",+ "Total. Corresponds to Haskell's Data.Char.isAlpha :: Char -> Bool."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "char"),+ Typing.parameterDescription = (Just "the character to test, as a Unicode code point"),+ Typing.parameterType = (Model.TypeLiteral (Model.LiteralTypeInteger Model.IntegerTypeInt32)),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeLiteral Model.LiteralTypeBoolean)}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++isAlphaNum :: Packaging.PrimitiveDefinition+isAlphaNum =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.chars.isAlphaNum"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Check whether a character is alphanumeric."),+ Packaging.entityMetadataComments = [+ "True if the argument is a Unicode letter or digit, false otherwise.",+ "The argument is interpreted as a Unicode code point: arguments outside the valid code-point range [0, 0x10FFFF] yield an implementation-defined result (typically false).",+ "The classification is based on Unicode general categories (any of L*, Nd, Nl, No).",+ "Total. Corresponds to Haskell's Data.Char.isAlphaNum :: Char -> Bool."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "char"),+ Typing.parameterDescription = (Just "the character to test, as a Unicode code point"),+ Typing.parameterType = (Model.TypeLiteral (Model.LiteralTypeInteger Model.IntegerTypeInt32)),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeLiteral Model.LiteralTypeBoolean)}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++isDigit :: Packaging.PrimitiveDefinition+isDigit =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.chars.isDigit"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Check whether a character is an ASCII decimal digit."),+ Packaging.entityMetadataComments = [+ "True if the argument is one of the ten code points '0' through '9' (U+0030 to U+0039), and false otherwise.",+ "Unlike the other predicates in this module, this one is deliberately ASCII-only: decimal digits outside the ASCII range (general category Nd) are rejected here, though isAlphaNum accepts them.",+ "Total. Corresponds to Haskell's Data.Char.isDigit :: Char -> Bool."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "char"),+ Typing.parameterDescription = (Just "the character to test, as a Unicode code point"),+ Typing.parameterType = (Model.TypeLiteral (Model.LiteralTypeInteger Model.IntegerTypeInt32)),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeLiteral Model.LiteralTypeBoolean)}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++isLower :: Packaging.PrimitiveDefinition+isLower =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.chars.isLower"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Check whether a character is lowercase."),+ Packaging.entityMetadataComments = [+ "True if the argument is a Unicode lowercase letter (general category Ll), false otherwise.",+ "The argument is interpreted as a Unicode code point: arguments outside [0, 0x10FFFF] yield an implementation-defined result (typically false).",+ "Note that not every letter is classified as uppercase or lowercase (e.g. titlecase letters, modifier letters, and letters in scripts without a case distinction are neither).",+ "Total. Corresponds to Haskell's Data.Char.isLower :: Char -> Bool."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "char"),+ Typing.parameterDescription = (Just "the character to test, as a Unicode code point"),+ Typing.parameterType = (Model.TypeLiteral (Model.LiteralTypeInteger Model.IntegerTypeInt32)),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeLiteral Model.LiteralTypeBoolean)}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++isSpace :: Packaging.PrimitiveDefinition+isSpace =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.chars.isSpace"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Check whether a character is a whitespace character."),+ Packaging.entityMetadataComments = [+ "True if the argument is a Unicode whitespace character, false otherwise.",+ "The whitespace set follows Haskell's Data.Char.isSpace, which recognises U+0020 (space), U+0009 (tab), U+000A (line feed), U+000B (vertical tab), U+000C (form feed), U+000D (carriage return), U+00A0 (no-break space), and other Unicode characters with general category Zs, Zl, or Zp.",+ "Total. Corresponds to Haskell's Data.Char.isSpace :: Char -> Bool."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "char"),+ Typing.parameterDescription = (Just "the character to test, as a Unicode code point"),+ Typing.parameterType = (Model.TypeLiteral (Model.LiteralTypeInteger Model.IntegerTypeInt32)),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeLiteral Model.LiteralTypeBoolean)}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++isUpper :: Packaging.PrimitiveDefinition+isUpper =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.chars.isUpper"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Check whether a character is uppercase."),+ Packaging.entityMetadataComments = [+ "True if the argument is a Unicode uppercase letter (general category Lu), false otherwise.",+ "The argument is interpreted as a Unicode code point: arguments outside [0, 0x10FFFF] yield an implementation-defined result (typically false).",+ "Note that titlecase letters (Lt) are not classified as uppercase by this predicate.",+ "Total. Corresponds to Haskell's Data.Char.isUpper :: Char -> Bool."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "char"),+ Typing.parameterDescription = (Just "the character to test, as a Unicode code point"),+ Typing.parameterType = (Model.TypeLiteral (Model.LiteralTypeInteger Model.IntegerTypeInt32)),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeLiteral Model.LiteralTypeBoolean)}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++toLower :: Packaging.PrimitiveDefinition+toLower =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.chars.toLower"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Convert a character to lowercase."),+ Packaging.entityMetadataComments = [+ "Return the simple (one-to-one) Unicode lowercase mapping of the argument, or the argument itself if it has no lowercase mapping.",+ "This is a code-point-to-code-point mapping, so it does not handle the string-changing match of full Unicode case folding (e.g. U+00DF \"\223\" does not lowercase to \"ss\"; it returns itself).",+ "The argument is interpreted as a Unicode code point.",+ "Total. Corresponds to Haskell's Data.Char.toLower :: Char -> Char."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "char"),+ Typing.parameterDescription = (Just "the character to convert, as a Unicode code point"),+ Typing.parameterType = (Model.TypeLiteral (Model.LiteralTypeInteger Model.IntegerTypeInt32)),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeLiteral (Model.LiteralTypeInteger Model.IntegerTypeInt32))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++toUpper :: Packaging.PrimitiveDefinition+toUpper =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.chars.toUpper"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Convert a character to uppercase."),+ Packaging.entityMetadataComments = [+ "Return the simple (one-to-one) Unicode uppercase mapping of the argument, or the argument itself if it has no uppercase mapping.",+ "This is a code-point-to-code-point mapping, so it does not handle the string-changing match of full Unicode case folding (e.g. U+00DF \"\223\" does not uppercase to \"SS\"; it returns itself).",+ "The argument is interpreted as a Unicode code point.",+ "Total. Corresponds to Haskell's Data.Char.toUpper :: Char -> Char."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "char"),+ Typing.parameterDescription = (Just "the character to convert, as a Unicode code point"),+ Typing.parameterType = (Model.TypeLiteral (Model.LiteralTypeInteger Model.IntegerTypeInt32)),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeLiteral (Model.LiteralTypeInteger Model.IntegerTypeInt32))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}
@@ -0,0 +1,1472 @@+-- Note: this is an automatically generated file. Do not edit.++-- | A module which provides a single map from primitive names to their default, cross-compilable reference implementations, for primitives which declare one.++module Hydra.Core.Lib.Defaults where++import qualified Hydra.Core.Model as Model+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void+import qualified Data.Map as M++-- | A map from primitive name to default (cross-compilable) reference implementation, for primitives which declare one. Each value is an encoded (reified) term; decode it to recover the executable implementation.+defaultImplementations :: M.Map Model.Name Model.Term+defaultImplementations =+ M.fromList [+ (+ Model.Name "hydra.core.lib.eithers.apply",+ (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "ef"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "ex"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.eithers.bind")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "ef"))})),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "f"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.eithers.map")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "f"))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "ex"))}))}))}))}))}))),+ (+ Model.Name "hydra.core.lib.eithers.bimap",+ (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "f"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "g"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "e"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.eithers.either")),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "x"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermEither (Left (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "f")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "x"))}))))}))})),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "y"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermEither (Right (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "g")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "y"))}))))}))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "e"))}))}))}))}))),+ (+ Model.Name "hydra.core.lib.eithers.bind",+ (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "e"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "f"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.eithers.either")),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "x"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermEither (Left (Model.TermVariable (Model.Name "x"))))}))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "f"))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "e"))}))}))}))),+ (+ Model.Name "hydra.core.lib.eithers.compose",+ (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "f"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "g"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "x"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.eithers.bind")),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "f")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "x"))}))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "g"))}))}))}))}))),+ (+ Model.Name "hydra.core.lib.eithers.foldList",+ (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "f"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "acc0"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "xs"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.lists.foldl")),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "acc"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "el"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.eithers.bind")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "acc"))})),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "a"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "f")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "a"))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "el"))}))}))}))}))}))})),+ Model.applicationArgument = (Model.TermEither (Right (Model.TermVariable (Model.Name "acc0"))))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "xs"))}))}))}))}))),+ (+ Model.Name "hydra.core.lib.eithers.isLeft",+ (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "e"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.eithers.either")),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "_"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLiteral (Model.LiteralBoolean True))}))})),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "_"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLiteral (Model.LiteralBoolean False))}))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "e"))}))}))),+ (+ Model.Name "hydra.core.lib.eithers.isRight",+ (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "e"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.eithers.either")),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "_"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLiteral (Model.LiteralBoolean False))}))})),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "_"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLiteral (Model.LiteralBoolean True))}))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "e"))}))}))),+ (+ Model.Name "hydra.core.lib.eithers.lefts",+ (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "xs"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.lists.foldr")),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "e"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "acc"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.eithers.either")),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "l"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.lists.cons")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "l"))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "acc"))}))}))})),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "_"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermVariable (Model.Name "acc"))}))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "e"))}))}))}))})),+ Model.applicationArgument = (Model.TermList [])})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "xs"))}))}))),+ (+ Model.Name "hydra.core.lib.eithers.map",+ (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "f"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "e"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.eithers.either")),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "x"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermEither (Left (Model.TermVariable (Model.Name "x"))))}))})),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "y"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermEither (Right (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "f")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "y"))}))))}))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "e"))}))}))}))),+ (+ Model.Name "hydra.core.lib.eithers.mapList",+ (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "f"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "xs"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.lists.foldr")),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "x"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "acc"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.eithers.bind")),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "f")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "x"))}))})),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "y"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.eithers.map")),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "ys"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.lists.cons")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "y"))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "ys"))}))}))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "acc"))}))}))}))}))}))})),+ Model.applicationArgument = (Model.TermEither (Right (Model.TermList [])))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "xs"))}))}))}))),+ (+ Model.Name "hydra.core.lib.eithers.mapOptional",+ (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "f"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "m"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.optionals.match")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "m"))})),+ Model.applicationArgument = (Model.TermEither (Right (Model.TermOptional Nothing)))})),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "x"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.eithers.map")),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "y"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermOptional (Just (Model.TermVariable (Model.Name "y"))))}))})),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "f")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "x"))}))}))}))}))}))}))),+ (+ Model.Name "hydra.core.lib.eithers.mapSet",+ (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "f"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "s"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.eithers.map")),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "ys"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.sets.fromList")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "ys"))}))}))})),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.lists.foldr")),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "x"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "acc"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.eithers.bind")),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "f")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "x"))}))})),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "y"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.eithers.map")),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "ys"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.lists.cons")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "y"))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "ys"))}))}))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "acc"))}))}))}))}))}))})),+ Model.applicationArgument = (Model.TermEither (Right (Model.TermList [])))})),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.sets.toList")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "s"))}))}))}))}))}))),+ (+ Model.Name "hydra.core.lib.eithers.partition",+ (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "xs"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.lists.foldr")),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "e"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "acc"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.eithers.either")),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "l"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermPair (+ Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.lists.cons")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "l"))})),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.pairs.first")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "acc"))}))}),+ (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.pairs.second")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "acc"))}))))}))})),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "r"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermPair (+ Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.pairs.first")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "acc"))}),+ (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.lists.cons")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "r"))})),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.pairs.second")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "acc"))}))}))))}))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "e"))}))}))}))})),+ Model.applicationArgument = (Model.TermPair (Model.TermList [], (Model.TermList [])))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "xs"))}))}))),+ (+ Model.Name "hydra.core.lib.eithers.rights",+ (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "xs"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.lists.foldr")),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "e"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "acc"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.eithers.either")),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "_"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermVariable (Model.Name "acc"))}))})),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "r"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.lists.cons")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "r"))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "acc"))}))}))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "e"))}))}))}))})),+ Model.applicationArgument = (Model.TermList [])})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "xs"))}))}))),+ (+ Model.Name "hydra.core.lib.equality.notEqual",+ (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "x"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "y"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.logic.not")),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.equality.equal")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "x"))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "y"))}))}))}))}))),+ (+ Model.Name "hydra.core.lib.functions.compose",+ (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "g"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "f"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "x"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "g")),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "f")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "x"))}))}))}))}))}))),+ (+ Model.Name "hydra.core.lib.functions.const",+ (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "x"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "y"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermVariable (Model.Name "x"))}))}))),+ (+ Model.Name "hydra.core.lib.functions.flip",+ (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "f"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "x"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "y"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "f")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "y"))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "x"))}))}))}))}))),+ (+ Model.Name "hydra.core.lib.functions.identity",+ (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "x"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermVariable (Model.Name "x"))}))),+ (+ Model.Name "hydra.core.lib.lists.bind",+ (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "xs"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "f"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.lists.foldr")),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "x"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "acc"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.lists.concat2")),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "f")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "x"))}))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "acc"))}))}))}))})),+ Model.applicationArgument = (Model.TermList [])})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "xs"))}))}))}))),+ (+ Model.Name "hydra.core.lib.lists.dropWhile",+ (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "p"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "xs"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.pairs.second")),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.lists.span")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "p"))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "xs"))}))}))}))}))),+ (+ Model.Name "hydra.core.lib.lists.filter",+ (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "p"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "xs"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.lists.foldr")),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "x"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "acc"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.logic.ifElse")),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "p")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "x"))}))})),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.lists.cons")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "x"))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "acc"))}))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "acc"))}))}))}))})),+ Model.applicationArgument = (Model.TermList [])})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "xs"))}))}))}))),+ (+ Model.Name "hydra.core.lib.lists.find",+ (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "p"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "xs"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.lists.foldr")),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "x"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "acc"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.logic.ifElse")),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "p")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "x"))}))})),+ Model.applicationArgument = (Model.TermOptional (Just (Model.TermVariable (Model.Name "x"))))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "acc"))}))}))}))})),+ Model.applicationArgument = (Model.TermOptional Nothing)})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "xs"))}))}))}))),+ (+ Model.Name "hydra.core.lib.lists.partition",+ (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "p"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "xs"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.lists.foldr")),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "x"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "acc"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.logic.ifElse")),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "p")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "x"))}))})),+ Model.applicationArgument = (Model.TermPair (+ Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.lists.cons")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "x"))})),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.pairs.first")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "acc"))}))}),+ (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.pairs.second")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "acc"))}))))})),+ Model.applicationArgument = (Model.TermPair (+ Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.pairs.first")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "acc"))}),+ (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.lists.cons")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "x"))})),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.pairs.second")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "acc"))}))}))))}))}))}))})),+ Model.applicationArgument = (Model.TermPair (Model.TermList [], (Model.TermList [])))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "xs"))}))}))}))),+ (+ Model.Name "hydra.core.lib.lists.span",+ (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "p"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "xs"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.lists.foldl")),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "acc"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "x"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.logic.ifElse")),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.logic.and")),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.lists.isEmpty")),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.pairs.second")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "acc"))}))}))})),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "p")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "x"))}))}))})),+ Model.applicationArgument = (Model.TermPair (+ Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.lists.concat2")),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.pairs.first")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "acc"))}))})),+ Model.applicationArgument = (Model.TermList [+ Model.TermVariable (Model.Name "x")])}),+ (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.pairs.second")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "acc"))}))))})),+ Model.applicationArgument = (Model.TermPair (+ Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.pairs.first")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "acc"))}),+ (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.lists.concat2")),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.pairs.second")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "acc"))}))})),+ Model.applicationArgument = (Model.TermList [+ Model.TermVariable (Model.Name "x")])}))))}))}))}))})),+ Model.applicationArgument = (Model.TermPair (Model.TermList [], (Model.TermList [])))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "xs"))}))}))}))),+ (+ Model.Name "hydra.core.lib.lists.takeWhile",+ (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "p"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "xs"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.pairs.first")),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.lists.span")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "p"))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "xs"))}))}))}))}))),+ (+ Model.Name "hydra.core.lib.logic.and",+ (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "a"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "b"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.logic.ifElse")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "a"))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "b"))})),+ Model.applicationArgument = (Model.TermLiteral (Model.LiteralBoolean False))}))}))}))),+ (+ Model.Name "hydra.core.lib.logic.not",+ (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "a"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.logic.ifElse")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "a"))})),+ Model.applicationArgument = (Model.TermLiteral (Model.LiteralBoolean False))})),+ Model.applicationArgument = (Model.TermLiteral (Model.LiteralBoolean True))}))}))),+ (+ Model.Name "hydra.core.lib.logic.or",+ (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "a"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "b"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.logic.ifElse")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "a"))})),+ Model.applicationArgument = (Model.TermLiteral (Model.LiteralBoolean True))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "b"))}))}))}))),+ (+ Model.Name "hydra.core.lib.maps.alter",+ (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "f"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "k"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "m"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.optionals.match")),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "f")),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.maps.lookup")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "k"))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "m"))}))}))})),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.maps.delete")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "k"))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "m"))}))})),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "vNew"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.maps.insert")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "k"))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "vNew"))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "m"))}))}))}))}))}))}))),+ (+ Model.Name "hydra.core.lib.maps.bimap",+ (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "fk"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "fv"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "m"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.maps.fromList")),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.lists.map")),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "p"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermPair (+ Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "fk")),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.pairs.first")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "p"))}))}),+ (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "fv")),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.pairs.second")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "p"))}))}))))}))})),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.maps.toList")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "m"))}))}))}))}))}))}))),+ (+ Model.Name "hydra.core.lib.maps.filter",+ (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "p"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "m"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.maps.fromList")),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.lists.filter")),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "pr"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "p")),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.pairs.second")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "pr"))}))}))}))})),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.maps.toList")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "m"))}))}))}))}))}))),+ (+ Model.Name "hydra.core.lib.maps.filterWithKey",+ (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "p"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "m"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.maps.fromList")),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.lists.filter")),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "pr"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "p")),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.pairs.first")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "pr"))}))})),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.pairs.second")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "pr"))}))}))}))})),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.maps.toList")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "m"))}))}))}))}))}))),+ (+ Model.Name "hydra.core.lib.maps.findWithDefault",+ (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "def"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "k"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "m"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.optionals.withDefault")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "def"))})),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.maps.lookup")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "k"))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "m"))}))}))}))}))}))),+ (+ Model.Name "hydra.core.lib.maps.map",+ (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "f"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "m"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.maps.fromList")),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.lists.map")),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "p"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermPair (+ Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.pairs.first")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "p"))}),+ (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "f")),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.pairs.second")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "p"))}))}))))}))})),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.maps.toList")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "m"))}))}))}))}))}))),+ (+ Model.Name "hydra.core.lib.maps.mapKeys",+ (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "f"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "m"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.maps.fromList")),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.lists.map")),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "p"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermPair (+ Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "f")),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.pairs.first")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "p"))}))}),+ (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.pairs.second")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "p"))}))))}))})),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.maps.toList")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "m"))}))}))}))}))}))),+ (+ Model.Name "hydra.core.lib.math.odd",+ (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "x"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.logic.not")),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.math.even")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "x"))}))}))}))),+ (+ Model.Name "hydra.core.lib.optionals.apply",+ (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "mf"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "mx"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.optionals.bind")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "mf"))})),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "f"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.optionals.map")),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "x"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "f")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "x"))}))}))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "mx"))}))}))}))}))}))),+ (+ Model.Name "hydra.core.lib.optionals.bind",+ (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "m"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "f"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.optionals.match")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "m"))})),+ Model.applicationArgument = (Model.TermOptional Nothing)})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "f"))}))}))}))),+ (+ Model.Name "hydra.core.lib.optionals.compose",+ (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "f"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "g"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "x"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.optionals.bind")),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "f")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "x"))}))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "g"))}))}))}))}))),+ (+ Model.Name "hydra.core.lib.optionals.foldList",+ (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "f"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "acc"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "xs"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.lists.foldl")),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "m"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "y"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.optionals.bind")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "m"))})),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "x"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "f")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "x"))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "y"))}))}))}))}))}))})),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.optionals.given")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "acc"))}))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "xs"))}))}))}))}))),+ (+ Model.Name "hydra.core.lib.optionals.givens",+ (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "xs"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.lists.foldr")),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "m"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "acc"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.optionals.match")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "m"))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "acc"))})),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "v"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.lists.cons")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "v"))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "acc"))}))}))}))}))}))})),+ Model.applicationArgument = (Model.TermList [])})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "xs"))}))}))),+ (+ Model.Name "hydra.core.lib.optionals.isGiven",+ (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "m"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.optionals.match")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "m"))})),+ Model.applicationArgument = (Model.TermLiteral (Model.LiteralBoolean False))})),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "_"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLiteral (Model.LiteralBoolean True))}))}))}))),+ (+ Model.Name "hydra.core.lib.optionals.isNone",+ (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "m"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.optionals.match")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "m"))})),+ Model.applicationArgument = (Model.TermLiteral (Model.LiteralBoolean True))})),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "_"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLiteral (Model.LiteralBoolean False))}))}))}))),+ (+ Model.Name "hydra.core.lib.optionals.map",+ (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "f"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "m"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.optionals.match")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "m"))})),+ Model.applicationArgument = (Model.TermOptional Nothing)})),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "x"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermOptional (Just (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "f")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "x"))}))))}))}))}))}))),+ (+ Model.Name "hydra.core.lib.optionals.mapList",+ (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "f"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "xs"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.lists.foldr")),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "x"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "acc"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.optionals.bind")),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "f")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "x"))}))})),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "y"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.optionals.map")),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "ys"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.lists.cons")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "y"))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "ys"))}))}))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "acc"))}))}))}))}))}))})),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.optionals.given")),+ Model.applicationArgument = (Model.TermList [])}))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "xs"))}))}))}))),+ (+ Model.Name "hydra.core.lib.optionals.mapOptional",+ (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "f"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "xs"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.optionals.givens")),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.lists.map")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "f"))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "xs"))}))}))}))}))),+ (+ Model.Name "hydra.core.lib.optionals.mapSet",+ (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "f"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "s"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.optionals.map")),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "ys"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.sets.fromList")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "ys"))}))}))})),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.lists.foldr")),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "x"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "acc"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.optionals.bind")),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "f")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "x"))}))})),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "y"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.optionals.map")),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "ys"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.lists.cons")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "y"))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "ys"))}))}))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "acc"))}))}))}))}))}))})),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.optionals.given")),+ Model.applicationArgument = (Model.TermList [])}))})),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.sets.toList")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "s"))}))}))}))}))}))),+ (+ Model.Name "hydra.core.lib.optionals.toList",+ (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "m"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.optionals.match")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "m"))})),+ Model.applicationArgument = (Model.TermList [])})),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "x"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermList [+ Model.TermVariable (Model.Name "x")])}))}))}))),+ (+ Model.Name "hydra.core.lib.optionals.withDefault",+ (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "def"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "m"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.optionals.match")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "m"))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "def"))})),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "x"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermVariable (Model.Name "x"))}))}))}))}))),+ (+ Model.Name "hydra.core.lib.pairs.bimap",+ (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "f"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "g"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "p"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermPair (+ Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "f")),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.pairs.first")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "p"))}))}),+ (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "g")),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.pairs.second")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "p"))}))}))))}))}))}))),+ (+ Model.Name "hydra.core.lib.sets.difference",+ (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "s1"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "s2"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.lists.foldl")),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "acc"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "el"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.logic.ifElse")),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.sets.member")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "el"))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "s2"))}))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "acc"))})),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.sets.insert")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "el"))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "acc"))}))}))}))}))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "hydra.core.lib.sets.empty"))})),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.sets.toList")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "s1"))}))}))}))}))),+ (+ Model.Name "hydra.core.lib.sets.filter",+ (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "p"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "s"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.sets.fromList")),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.lists.filter")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "p"))})),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.sets.toList")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "s"))}))}))}))}))}))),+ (+ Model.Name "hydra.core.lib.sets.intersection",+ (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "s1"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "s2"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.lists.foldl")),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "acc"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "el"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.logic.ifElse")),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.sets.member")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "el"))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "s2"))}))})),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.sets.insert")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "el"))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "acc"))}))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "acc"))}))}))}))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "hydra.core.lib.sets.empty"))})),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.sets.toList")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "s1"))}))}))}))}))),+ (+ Model.Name "hydra.core.lib.sets.map",+ (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "f"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "s"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.sets.fromList")),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.lists.map")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "f"))})),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.sets.toList")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "s"))}))}))}))}))}))),+ (+ Model.Name "hydra.core.lib.sets.union",+ (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "s1"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "s2"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.lists.foldl")),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "acc"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "el"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.sets.insert")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "el"))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "acc"))}))}))}))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "s2"))})),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.sets.toList")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "s1"))}))}))}))}))),+ (+ Model.Name "hydra.core.lib.sets.unions",+ (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "ss"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.lists.foldl")),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "acc"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "s"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.sets.union")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "acc"))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "s"))}))}))}))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "hydra.core.lib.sets.empty"))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "ss"))}))})))]
@@ -0,0 +1,403 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Primitives in the hydra.core.lib.effects module.++module Hydra.Core.Lib.Effects where++import qualified Hydra.Core.Ast as Ast+import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Diff as Diff+import qualified Hydra.Core.Docs as Docs+import qualified Hydra.Core.Error.Checking as Checking+import qualified Hydra.Core.Error.File as ErrorFile+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Error.Packaging as ErrorPackaging+import qualified Hydra.Core.Error.System as ErrorSystem+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Json.Model as JsonModel+import qualified Hydra.Core.Markdown as Markdown+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Parsing as Parsing+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Query as Query+import qualified Hydra.Core.Regex as Regex+import qualified Hydra.Core.Relational as Relational+import qualified Hydra.Core.System as System+import qualified Hydra.Core.Tabular as Tabular+import qualified Hydra.Core.Testing as Testing+import qualified Hydra.Core.Time as Time+import qualified Hydra.Core.Topology as Topology+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Validation as Validation+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++apply :: Packaging.PrimitiveDefinition+apply =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.effects.apply"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Applicative apply for effects."),+ Packaging.entityMetadataComments = [+ "apply(ef, ex) describes an effectful computation which first interprets ef to produce a function, then interprets ex to produce an argument, and returns the result of applying the function to the argument."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "x"),+ Typing.typeParameterConstraints = []},+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "y"),+ Typing.typeParameterConstraints = []}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "ef"),+ Typing.parameterDescription = (Just "the effect producing the function to apply"),+ Typing.parameterType = (Model.TypeEffect (Model.TypeFunction (Model.FunctionType {+ Model.functionTypeDomain = (Model.TypeVariable (Model.Name "x")),+ Model.functionTypeCodomain = (Model.TypeVariable (Model.Name "y"))}))),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "ex"),+ Typing.parameterDescription = (Just "the effect producing the argument"),+ Typing.parameterType = (Model.TypeEffect (Model.TypeVariable (Model.Name "x"))),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeEffect (Model.TypeVariable (Model.Name "y")))}},+ Packaging.primitiveDefinitionIsPure = False,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++bind :: Packaging.PrimitiveDefinition+bind =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.effects.bind"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Sequence two effectful computations."),+ Packaging.entityMetadataComments = [+ "bind(e, f) describes an effectful computation which first interprets e, then passes its result to f to obtain the next effect.",+ "Host interpreters provide the operational meaning; Hydra uses the type effect<t> to keep the effect boundary explicit."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "x"),+ Typing.typeParameterConstraints = []},+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "y"),+ Typing.typeParameterConstraints = []}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "e"),+ Typing.parameterDescription = (Just "the effect to interpret first"),+ Typing.parameterType = (Model.TypeEffect (Model.TypeVariable (Model.Name "x"))),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "f"),+ Typing.parameterDescription = (Just "the function producing the next effect from e's result"),+ Typing.parameterType = (Model.TypeFunction (Model.FunctionType {+ Model.functionTypeDomain = (Model.TypeVariable (Model.Name "x")),+ Model.functionTypeCodomain = (Model.TypeEffect (Model.TypeVariable (Model.Name "y")))})),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeEffect (Model.TypeVariable (Model.Name "y")))}},+ Packaging.primitiveDefinitionIsPure = False,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++compose :: Packaging.PrimitiveDefinition+compose =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.effects.compose"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Kleisli composition for effects."),+ Packaging.entityMetadataComments = [+ "compose(f, g, x) describes an effectful computation equivalent to bind(f(x), g)."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "x"),+ Typing.typeParameterConstraints = []},+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "y"),+ Typing.typeParameterConstraints = []},+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "z"),+ Typing.typeParameterConstraints = []}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "f"),+ Typing.parameterDescription = (Just "the first effect-returning function"),+ Typing.parameterType = (Model.TypeFunction (Model.FunctionType {+ Model.functionTypeDomain = (Model.TypeVariable (Model.Name "x")),+ Model.functionTypeCodomain = (Model.TypeEffect (Model.TypeVariable (Model.Name "y")))})),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "g"),+ Typing.parameterDescription = (Just "the second effect-returning function"),+ Typing.parameterType = (Model.TypeFunction (Model.FunctionType {+ Model.functionTypeDomain = (Model.TypeVariable (Model.Name "y")),+ Model.functionTypeCodomain = (Model.TypeEffect (Model.TypeVariable (Model.Name "z")))})),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "x"),+ Typing.parameterDescription = (Just "the input to the composed computation"),+ Typing.parameterType = (Model.TypeVariable (Model.Name "x")),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeEffect (Model.TypeVariable (Model.Name "z")))}},+ Packaging.primitiveDefinitionIsPure = False,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++foldList :: Packaging.PrimitiveDefinition+foldList =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.effects.foldList"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Left-fold over a list with an effect-returning function."),+ Packaging.entityMetadataComments = [+ "foldList(f, acc0, xs) describes an effectful left fold over xs, sequencing applications of f from left to right."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "x"),+ Typing.typeParameterConstraints = []},+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "y"),+ Typing.typeParameterConstraints = []}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "f"),+ Typing.parameterDescription = (Just "the effect-returning combining function"),+ Typing.parameterType = (Model.TypeFunction (Model.FunctionType {+ Model.functionTypeDomain = (Model.TypeVariable (Model.Name "x")),+ Model.functionTypeCodomain = (Model.TypeFunction (Model.FunctionType {+ Model.functionTypeDomain = (Model.TypeVariable (Model.Name "y")),+ Model.functionTypeCodomain = (Model.TypeEffect (Model.TypeVariable (Model.Name "x")))}))})),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "acc0"),+ Typing.parameterDescription = (Just "the initial accumulator value"),+ Typing.parameterType = (Model.TypeVariable (Model.Name "x")),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "xs"),+ Typing.parameterDescription = (Just "the list to fold over"),+ Typing.parameterType = (Model.TypeList (Model.TypeVariable (Model.Name "y"))),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeEffect (Model.TypeVariable (Model.Name "x")))}},+ Packaging.primitiveDefinitionIsPure = False,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++map :: Packaging.PrimitiveDefinition+map =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.effects.map"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Map a pure function over the result of an effect."),+ Packaging.entityMetadataComments = [+ "map(f, e) describes an effectful computation which interprets e and applies f to its result.",+ "Equivalent to bind(e, \\x -> pure(f x))."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "x"),+ Typing.typeParameterConstraints = []},+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "y"),+ Typing.typeParameterConstraints = []}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "f"),+ Typing.parameterDescription = (Just "the pure function to apply to the effect's result"),+ Typing.parameterType = (Model.TypeFunction (Model.FunctionType {+ Model.functionTypeDomain = (Model.TypeVariable (Model.Name "x")),+ Model.functionTypeCodomain = (Model.TypeVariable (Model.Name "y"))})),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "e"),+ Typing.parameterDescription = (Just "the effect to interpret"),+ Typing.parameterType = (Model.TypeEffect (Model.TypeVariable (Model.Name "x"))),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeEffect (Model.TypeVariable (Model.Name "y")))}},+ Packaging.primitiveDefinitionIsPure = False,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++mapList :: Packaging.PrimitiveDefinition+mapList =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.effects.mapList"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Map an effect-returning function over a list."),+ Packaging.entityMetadataComments = [+ "mapList(f, xs) describes an effectful computation which applies f to each element of xs from left to right and collects the results."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "x"),+ Typing.typeParameterConstraints = []},+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "y"),+ Typing.typeParameterConstraints = []}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "f"),+ Typing.parameterDescription = (Just "the effect-returning function to apply to each element"),+ Typing.parameterType = (Model.TypeFunction (Model.FunctionType {+ Model.functionTypeDomain = (Model.TypeVariable (Model.Name "x")),+ Model.functionTypeCodomain = (Model.TypeEffect (Model.TypeVariable (Model.Name "y")))})),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "xs"),+ Typing.parameterDescription = (Just "the list to map over"),+ Typing.parameterType = (Model.TypeList (Model.TypeVariable (Model.Name "x"))),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeEffect (Model.TypeList (Model.TypeVariable (Model.Name "y"))))}},+ Packaging.primitiveDefinitionIsPure = False,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++mapOptional :: Packaging.PrimitiveDefinition+mapOptional =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.effects.mapOptional"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Map an effect-returning function over an optional."),+ Packaging.entityMetadataComments = [+ "mapOptional(f, m) describes an effectful computation which returns none when m is none, or applies f to the contained value and wraps the result in given."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "x"),+ Typing.typeParameterConstraints = []},+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "y"),+ Typing.typeParameterConstraints = []}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "f"),+ Typing.parameterDescription = (Just "the effect-returning function to apply to the contained value"),+ Typing.parameterType = (Model.TypeFunction (Model.FunctionType {+ Model.functionTypeDomain = (Model.TypeVariable (Model.Name "x")),+ Model.functionTypeCodomain = (Model.TypeEffect (Model.TypeVariable (Model.Name "y")))})),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "m"),+ Typing.parameterDescription = (Just "the optional to map over"),+ Typing.parameterType = (Model.TypeOptional (Model.TypeVariable (Model.Name "x"))),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeEffect (Model.TypeOptional (Model.TypeVariable (Model.Name "y"))))}},+ Packaging.primitiveDefinitionIsPure = False,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++mapSet :: Packaging.PrimitiveDefinition+mapSet =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.effects.mapSet"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Map an effect-returning function over a set."),+ Packaging.entityMetadataComments = [+ "mapSet(f, s) describes an effectful computation which applies f to each element of s, sequencing the effects in ascending element order (the order is normative, since the effects are observable), and collects the results as a set, deduplicated by the result type's ordering.",+ "Requires 'ordering' constraints on both element types (the set type contract)."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "x"),+ Typing.typeParameterConstraints = [+ Model.TypeClassConstraintSimple (Model.Name "ordering")]},+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "y"),+ Typing.typeParameterConstraints = [+ Model.TypeClassConstraintSimple (Model.Name "ordering")]}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "f"),+ Typing.parameterDescription = (Just "the effect-returning function to apply to each element"),+ Typing.parameterType = (Model.TypeFunction (Model.FunctionType {+ Model.functionTypeDomain = (Model.TypeVariable (Model.Name "x")),+ Model.functionTypeCodomain = (Model.TypeEffect (Model.TypeVariable (Model.Name "y")))})),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "s"),+ Typing.parameterDescription = (Just "the set to map over"),+ Typing.parameterType = (Model.TypeSet (Model.TypeVariable (Model.Name "x"))),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeEffect (Model.TypeSet (Model.TypeVariable (Model.Name "y"))))}},+ Packaging.primitiveDefinitionIsPure = False,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++pure :: Packaging.PrimitiveDefinition+pure =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.effects.pure"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Lift a pure value into an effect."),+ Packaging.entityMetadataComments = [+ "pure(x) describes an effectful computation which succeeds with x without requiring host interaction."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "x"),+ Typing.typeParameterConstraints = []}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "x"),+ Typing.parameterDescription = (Just "the pure value to lift into an effect"),+ Typing.parameterType = (Model.TypeVariable (Model.Name "x")),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeEffect (Model.TypeVariable (Model.Name "x")))}},+ Packaging.primitiveDefinitionIsPure = False,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}
@@ -0,0 +1,1181 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Primitives in the hydra.core.lib.eithers module.++module Hydra.Core.Lib.Eithers where++import qualified Hydra.Core.Ast as Ast+import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Diff as Diff+import qualified Hydra.Core.Docs as Docs+import qualified Hydra.Core.Error.Checking as Checking+import qualified Hydra.Core.Error.File as ErrorFile+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Error.Packaging as ErrorPackaging+import qualified Hydra.Core.Error.System as ErrorSystem+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Json.Model as JsonModel+import qualified Hydra.Core.Markdown as Markdown+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Parsing as Parsing+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Query as Query+import qualified Hydra.Core.Regex as Regex+import qualified Hydra.Core.Relational as Relational+import qualified Hydra.Core.System as System+import qualified Hydra.Core.Tabular as Tabular+import qualified Hydra.Core.Testing as Testing+import qualified Hydra.Core.Time as Time+import qualified Hydra.Core.Topology as Topology+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Validation as Validation+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++apply :: Packaging.PrimitiveDefinition+apply =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.eithers.apply"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Applicative apply for either: combine a function under either and an argument under either."),+ Packaging.entityMetadataComments = [+ "apply(ef, ex) returns right(f(x)) when ef is right(f) and ex is right(x).",+ "If either argument is a left, the result is that left; when both arguments are left, the first (function-side) left is returned \8212 first error wins, and ex is not consulted once ef is known to be a left.",+ "apply(ef, ex) is bind(ef, \\f -> map(f, ex)); this defining equation is the specification, and the default implementation.",+ "Total. Corresponds to Haskell's (<*>) :: Either a (b -> c) -> Either a b -> Either a c."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "x"),+ Typing.typeParameterConstraints = []},+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "y"),+ Typing.typeParameterConstraints = []},+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "z"),+ Typing.typeParameterConstraints = []}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "ef"),+ Typing.parameterDescription = (Just "the either containing the function to apply"),+ Typing.parameterType = (Model.TypeEither (Model.EitherType {+ Model.eitherTypeLeft = (Model.TypeVariable (Model.Name "x")),+ Model.eitherTypeRight = (Model.TypeFunction (Model.FunctionType {+ Model.functionTypeDomain = (Model.TypeVariable (Model.Name "y")),+ Model.functionTypeCodomain = (Model.TypeVariable (Model.Name "z"))}))})),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "ex"),+ Typing.parameterDescription = (Just "the either containing the argument"),+ Typing.parameterType = (Model.TypeEither (Model.EitherType {+ Model.eitherTypeLeft = (Model.TypeVariable (Model.Name "x")),+ Model.eitherTypeRight = (Model.TypeVariable (Model.Name "y"))})),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeEither (Model.EitherType {+ Model.eitherTypeLeft = (Model.TypeVariable (Model.Name "x")),+ Model.eitherTypeRight = (Model.TypeVariable (Model.Name "z"))}))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = (Just (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "ef"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "ex"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.eithers.bind")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "ef"))})),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "f"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.eithers.map")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "f"))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "ex"))}))}))}))}))})))}++bimap :: Packaging.PrimitiveDefinition+bimap =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.eithers.bimap"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Map over both sides of an either value."),+ Packaging.entityMetadataComments = [+ "bimap(f, g, e) applies f to the contained value if e is a Left, or g if e is a Right; the result retains the same Left/Right variant.",+ "Total. Corresponds to Haskell's Data.Bifunctor.bimap :: (a -> c) -> (b -> d) -> Either a b -> Either c d."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "x"),+ Typing.typeParameterConstraints = []},+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "y"),+ Typing.typeParameterConstraints = []},+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "z"),+ Typing.typeParameterConstraints = []},+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "w"),+ Typing.typeParameterConstraints = []}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "f"),+ Typing.parameterDescription = (Just "the function to apply to a Left value"),+ Typing.parameterType = (Model.TypeFunction (Model.FunctionType {+ Model.functionTypeDomain = (Model.TypeVariable (Model.Name "x")),+ Model.functionTypeCodomain = (Model.TypeVariable (Model.Name "z"))})),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "g"),+ Typing.parameterDescription = (Just "the function to apply to a Right value"),+ Typing.parameterType = (Model.TypeFunction (Model.FunctionType {+ Model.functionTypeDomain = (Model.TypeVariable (Model.Name "y")),+ Model.functionTypeCodomain = (Model.TypeVariable (Model.Name "w"))})),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "e"),+ Typing.parameterDescription = (Just "the either value to map over"),+ Typing.parameterType = (Model.TypeEither (Model.EitherType {+ Model.eitherTypeLeft = (Model.TypeVariable (Model.Name "x")),+ Model.eitherTypeRight = (Model.TypeVariable (Model.Name "y"))})),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeEither (Model.EitherType {+ Model.eitherTypeLeft = (Model.TypeVariable (Model.Name "z")),+ Model.eitherTypeRight = (Model.TypeVariable (Model.Name "w"))}))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = (Just (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "f"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "g"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "e"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.eithers.either")),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "x"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermEither (Left (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "f")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "x"))}))))}))})),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "y"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermEither (Right (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "g")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "y"))}))))}))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "e"))}))}))}))})))}++bind :: Packaging.PrimitiveDefinition+bind =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.eithers.bind"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Bind (flatMap) for either: if Right, apply the function; if Left, return unchanged."),+ Packaging.entityMetadataComments = [+ "bind(e, f) is the monadic bind for either with a fixed Left type: if e is Right v, the result is f(v); if e is Left x, the result is Left x with the Left type preserved.",+ "Used to chain computations that may fail with a common error type.",+ "Total. Corresponds to Haskell's (>>=) :: Either a b -> (b -> Either a c) -> Either a c."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "x"),+ Typing.typeParameterConstraints = []},+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "y"),+ Typing.typeParameterConstraints = []},+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "z"),+ Typing.typeParameterConstraints = []}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "e"),+ Typing.parameterDescription = (Just "the either value to bind"),+ Typing.parameterType = (Model.TypeEither (Model.EitherType {+ Model.eitherTypeLeft = (Model.TypeVariable (Model.Name "x")),+ Model.eitherTypeRight = (Model.TypeVariable (Model.Name "y"))})),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "f"),+ Typing.parameterDescription = (Just "the function to apply to a Right value"),+ Typing.parameterType = (Model.TypeFunction (Model.FunctionType {+ Model.functionTypeDomain = (Model.TypeVariable (Model.Name "y")),+ Model.functionTypeCodomain = (Model.TypeEither (Model.EitherType {+ Model.eitherTypeLeft = (Model.TypeVariable (Model.Name "x")),+ Model.eitherTypeRight = (Model.TypeVariable (Model.Name "z"))}))})),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeEither (Model.EitherType {+ Model.eitherTypeLeft = (Model.TypeVariable (Model.Name "x")),+ Model.eitherTypeRight = (Model.TypeVariable (Model.Name "z"))}))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = (Just (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "e"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "f"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.eithers.either")),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "x"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermEither (Left (Model.TermVariable (Model.Name "x"))))}))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "f"))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "e"))}))}))})))}++compose :: Packaging.PrimitiveDefinition+compose =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.eithers.compose"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Kleisli composition for either."),+ Packaging.entityMetadataComments = [+ "compose(f, g, x) is bind(f(x), g); this defining equation is the specification, and the default implementation.",+ "If either f(x) or the second stage produces a left, the result is that left.",+ "Total. Corresponds to Kleisli composition (>=>) specialised to Either with a fixed Left type."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "x"),+ Typing.typeParameterConstraints = []},+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "y"),+ Typing.typeParameterConstraints = []},+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "z"),+ Typing.typeParameterConstraints = []},+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "w"),+ Typing.typeParameterConstraints = []}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "f"),+ Typing.parameterDescription = (Just "the first Kleisli arrow to apply"),+ Typing.parameterType = (Model.TypeFunction (Model.FunctionType {+ Model.functionTypeDomain = (Model.TypeVariable (Model.Name "x")),+ Model.functionTypeCodomain = (Model.TypeEither (Model.EitherType {+ Model.eitherTypeLeft = (Model.TypeVariable (Model.Name "w")),+ Model.eitherTypeRight = (Model.TypeVariable (Model.Name "y"))}))})),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "g"),+ Typing.parameterDescription = (Just "the second Kleisli arrow to apply"),+ Typing.parameterType = (Model.TypeFunction (Model.FunctionType {+ Model.functionTypeDomain = (Model.TypeVariable (Model.Name "y")),+ Model.functionTypeCodomain = (Model.TypeEither (Model.EitherType {+ Model.eitherTypeLeft = (Model.TypeVariable (Model.Name "w")),+ Model.eitherTypeRight = (Model.TypeVariable (Model.Name "z"))}))})),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "x"),+ Typing.parameterDescription = (Just "the input value"),+ Typing.parameterType = (Model.TypeVariable (Model.Name "x")),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeEither (Model.EitherType {+ Model.eitherTypeLeft = (Model.TypeVariable (Model.Name "w")),+ Model.eitherTypeRight = (Model.TypeVariable (Model.Name "z"))}))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = (Just (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "f"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "g"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "x"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.eithers.bind")),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "f")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "x"))}))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "g"))}))}))}))})))}++either :: Packaging.PrimitiveDefinition+either =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.eithers.either"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Eliminate an either value by applying one of two functions."),+ Packaging.entityMetadataComments = [+ "either(f, g, e) returns f(x) if e is Left x and g(y) if e is Right y.",+ "The fundamental eliminator for the either type; every other primitive in this namespace can be derived from it.",+ "Total. Corresponds to Haskell's either :: (a -> c) -> (b -> c) -> Either a b -> c.",+ "Deprecated since 0.18. Use: cases."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = (Just (Packaging.LifecycleInfo {+ Packaging.lifecycleInfoAvailableSince = Nothing,+ Packaging.lifecycleInfoDeprecatedSince = (Just (Packaging.Version "0.18"))})),+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "x"),+ Typing.typeParameterConstraints = []},+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "y"),+ Typing.typeParameterConstraints = []},+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "z"),+ Typing.typeParameterConstraints = []}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "f"),+ Typing.parameterDescription = (Just "the function to apply to a Left value"),+ Typing.parameterType = (Model.TypeFunction (Model.FunctionType {+ Model.functionTypeDomain = (Model.TypeVariable (Model.Name "x")),+ Model.functionTypeCodomain = (Model.TypeVariable (Model.Name "z"))})),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "g"),+ Typing.parameterDescription = (Just "the function to apply to a Right value"),+ Typing.parameterType = (Model.TypeFunction (Model.FunctionType {+ Model.functionTypeDomain = (Model.TypeVariable (Model.Name "y")),+ Model.functionTypeCodomain = (Model.TypeVariable (Model.Name "z"))})),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "e"),+ Typing.parameterDescription = (Just "the either value to eliminate"),+ Typing.parameterType = (Model.TypeEither (Model.EitherType {+ Model.eitherTypeLeft = (Model.TypeVariable (Model.Name "x")),+ Model.eitherTypeRight = (Model.TypeVariable (Model.Name "y"))})),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeVariable (Model.Name "z"))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++foldList :: Packaging.PrimitiveDefinition+foldList =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.eithers.foldList"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Left-fold over a list with an Either-returning function, short-circuiting on Left."),+ Packaging.entityMetadataComments = [+ "foldList(f, acc0, xs) folds f over xs from the left, threading an accumulator of type a, where each application may fail with Left e: it iterates while f returns Right, propagates Left on the first failure, and returns Right (final accumulator) if all elements were processed.",+ "Corresponds to a short-circuiting variant of Haskell's foldM specialised to Either."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "x"),+ Typing.typeParameterConstraints = []},+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "y"),+ Typing.typeParameterConstraints = []},+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "z"),+ Typing.typeParameterConstraints = []}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "f"),+ Typing.parameterDescription = (Just "the Either-returning folding function"),+ Typing.parameterType = (Model.TypeFunction (Model.FunctionType {+ Model.functionTypeDomain = (Model.TypeVariable (Model.Name "x")),+ Model.functionTypeCodomain = (Model.TypeFunction (Model.FunctionType {+ Model.functionTypeDomain = (Model.TypeVariable (Model.Name "y")),+ Model.functionTypeCodomain = (Model.TypeEither (Model.EitherType {+ Model.eitherTypeLeft = (Model.TypeVariable (Model.Name "z")),+ Model.eitherTypeRight = (Model.TypeVariable (Model.Name "x"))}))}))})),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "acc0"),+ Typing.parameterDescription = (Just "the initial accumulator value"),+ Typing.parameterType = (Model.TypeVariable (Model.Name "x")),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "xs"),+ Typing.parameterDescription = (Just "the list to fold over"),+ Typing.parameterType = (Model.TypeList (Model.TypeVariable (Model.Name "y"))),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeEither (Model.EitherType {+ Model.eitherTypeLeft = (Model.TypeVariable (Model.Name "z")),+ Model.eitherTypeRight = (Model.TypeVariable (Model.Name "x"))}))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = (Just (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "f"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "acc0"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "xs"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.lists.foldl")),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "acc"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "el"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.eithers.bind")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "acc"))})),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "a"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "f")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "a"))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "el"))}))}))}))}))}))})),+ Model.applicationArgument = (Model.TermEither (Right (Model.TermVariable (Model.Name "acc0"))))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "xs"))}))}))}))})))}++isLeft :: Packaging.PrimitiveDefinition+isLeft =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.eithers.isLeft"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Check whether an either is a Left value."),+ Packaging.entityMetadataComments = [+ "True if the argument is a Left variant, false if a Right.",+ "Total. Corresponds to Haskell's Data.Either.isLeft :: Either a b -> Bool."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "x"),+ Typing.typeParameterConstraints = []},+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "y"),+ Typing.typeParameterConstraints = []}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "e"),+ Typing.parameterDescription = (Just "the either value to test"),+ Typing.parameterType = (Model.TypeEither (Model.EitherType {+ Model.eitherTypeLeft = (Model.TypeVariable (Model.Name "x")),+ Model.eitherTypeRight = (Model.TypeVariable (Model.Name "y"))})),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeLiteral Model.LiteralTypeBoolean)}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = (Just (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "e"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.eithers.either")),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "_"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLiteral (Model.LiteralBoolean True))}))})),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "_"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLiteral (Model.LiteralBoolean False))}))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "e"))}))})))}++isRight :: Packaging.PrimitiveDefinition+isRight =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.eithers.isRight"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Check whether an either is a Right value."),+ Packaging.entityMetadataComments = [+ "True if the argument is a Right variant, false if a Left.",+ "Total. Corresponds to Haskell's Data.Either.isRight :: Either a b -> Bool."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "x"),+ Typing.typeParameterConstraints = []},+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "y"),+ Typing.typeParameterConstraints = []}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "e"),+ Typing.parameterDescription = (Just "the either value to test"),+ Typing.parameterType = (Model.TypeEither (Model.EitherType {+ Model.eitherTypeLeft = (Model.TypeVariable (Model.Name "x")),+ Model.eitherTypeRight = (Model.TypeVariable (Model.Name "y"))})),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeLiteral Model.LiteralTypeBoolean)}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = (Just (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "e"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.eithers.either")),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "_"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLiteral (Model.LiteralBoolean False))}))})),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "_"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLiteral (Model.LiteralBoolean True))}))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "e"))}))})))}++left :: Packaging.PrimitiveDefinition+left =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.eithers.left"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Construct a left (error/exceptional) either value."),+ Packaging.entityMetadataComments = [+ "left(x) is Left x. The dual constructor to right, injecting into the Left (error/exceptional) side of an either.",+ "Total. Corresponds to Haskell's Left :: a -> Either a b."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "x"),+ Typing.typeParameterConstraints = []},+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "y"),+ Typing.typeParameterConstraints = []}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "x"),+ Typing.parameterDescription = (Just "the value to wrap as a Left"),+ Typing.parameterType = (Model.TypeVariable (Model.Name "x")),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeEither (Model.EitherType {+ Model.eitherTypeLeft = (Model.TypeVariable (Model.Name "x")),+ Model.eitherTypeRight = (Model.TypeVariable (Model.Name "y"))}))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++lefts :: Packaging.PrimitiveDefinition+lefts =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.eithers.lefts"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Extract all Left values from a list of either values."),+ Packaging.entityMetadataComments = [+ "lefts(xs) returns a list containing every Left value in xs, in original order, with Right values discarded.",+ "Total. Corresponds to Haskell's Data.Either.lefts :: [Either a b] -> [a]."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "x"),+ Typing.typeParameterConstraints = []},+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "y"),+ Typing.typeParameterConstraints = []}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "xs"),+ Typing.parameterDescription = (Just "the list of either values to extract Lefts from"),+ Typing.parameterType = (Model.TypeList (Model.TypeEither (Model.EitherType {+ Model.eitherTypeLeft = (Model.TypeVariable (Model.Name "x")),+ Model.eitherTypeRight = (Model.TypeVariable (Model.Name "y"))}))),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeList (Model.TypeVariable (Model.Name "x")))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = (Just (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "xs"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.lists.foldr")),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "e"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "acc"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.eithers.either")),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "l"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.lists.cons")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "l"))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "acc"))}))}))})),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "_"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermVariable (Model.Name "acc"))}))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "e"))}))}))}))})),+ Model.applicationArgument = (Model.TermList [])})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "xs"))}))})))}++map :: Packaging.PrimitiveDefinition+map =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.eithers.map"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Map a function over the Right side of an either (standard functor map)."),+ Packaging.entityMetadataComments = [+ "map(f, e) returns Right (f y) if e is Right y, or Left x unchanged if e is Left x.",+ "The functor instance for either; treats the Right variant as the focus and leaves the Left variant alone.",+ "Total. Corresponds to Haskell's fmap :: (a -> b) -> Either e a -> Either e b."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "x"),+ Typing.typeParameterConstraints = []},+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "y"),+ Typing.typeParameterConstraints = []},+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "z"),+ Typing.typeParameterConstraints = []}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "f"),+ Typing.parameterDescription = (Just "the function to apply to a Right value"),+ Typing.parameterType = (Model.TypeFunction (Model.FunctionType {+ Model.functionTypeDomain = (Model.TypeVariable (Model.Name "x")),+ Model.functionTypeCodomain = (Model.TypeVariable (Model.Name "y"))})),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "e"),+ Typing.parameterDescription = (Just "the either value to map over"),+ Typing.parameterType = (Model.TypeEither (Model.EitherType {+ Model.eitherTypeLeft = (Model.TypeVariable (Model.Name "z")),+ Model.eitherTypeRight = (Model.TypeVariable (Model.Name "x"))})),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeEither (Model.EitherType {+ Model.eitherTypeLeft = (Model.TypeVariable (Model.Name "z")),+ Model.eitherTypeRight = (Model.TypeVariable (Model.Name "y"))}))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = (Just (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "f"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "e"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.eithers.either")),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "x"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermEither (Left (Model.TermVariable (Model.Name "x"))))}))})),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "y"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermEither (Right (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "f")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "y"))}))))}))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "e"))}))}))})))}++mapList :: Packaging.PrimitiveDefinition+mapList =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.eithers.mapList"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Map a function returning either over a list, collecting results or short-circuiting on Left."),+ Packaging.entityMetadataComments = [+ "mapList(f, xs) applies f to each element of xs. If every application returns Right, the result is Right of the list of contained values, in original order. The first application that returns Left short-circuits the whole result to that Left.",+ "Total. Corresponds to Haskell's traverse :: (a -> Either e b) -> [a] -> Either e [b]."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "x"),+ Typing.typeParameterConstraints = []},+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "y"),+ Typing.typeParameterConstraints = []},+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "z"),+ Typing.typeParameterConstraints = []}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "f"),+ Typing.parameterDescription = (Just "the either-returning function to apply to each element"),+ Typing.parameterType = (Model.TypeFunction (Model.FunctionType {+ Model.functionTypeDomain = (Model.TypeVariable (Model.Name "x")),+ Model.functionTypeCodomain = (Model.TypeEither (Model.EitherType {+ Model.eitherTypeLeft = (Model.TypeVariable (Model.Name "z")),+ Model.eitherTypeRight = (Model.TypeVariable (Model.Name "y"))}))})),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "xs"),+ Typing.parameterDescription = (Just "the list to map over"),+ Typing.parameterType = (Model.TypeList (Model.TypeVariable (Model.Name "x"))),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeEither (Model.EitherType {+ Model.eitherTypeLeft = (Model.TypeVariable (Model.Name "z")),+ Model.eitherTypeRight = (Model.TypeList (Model.TypeVariable (Model.Name "y")))}))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = (Just (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "f"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "xs"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.lists.foldr")),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "x"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "acc"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.eithers.bind")),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "f")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "x"))}))})),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "y"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.eithers.map")),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "ys"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.lists.cons")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "y"))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "ys"))}))}))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "acc"))}))}))}))}))}))})),+ Model.applicationArgument = (Model.TermEither (Right (Model.TermList [])))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "xs"))}))}))})))}++mapOptional :: Packaging.PrimitiveDefinition+mapOptional =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.eithers.mapOptional"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Map a function returning either over an optional, or return Right none if none."),+ Packaging.entityMetadataComments = [+ "mapOptional(f, m) returns Right none if m is none; otherwise applies f to the contained value and returns the result with Right wrapped around given.",+ "Total. Corresponds to Haskell's traverse :: (a -> Either e b) -> Maybe a -> Either e (Maybe b)."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "x"),+ Typing.typeParameterConstraints = []},+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "y"),+ Typing.typeParameterConstraints = []},+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "z"),+ Typing.typeParameterConstraints = []}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "f"),+ Typing.parameterDescription = (Just "the either-returning function to apply to the contained value"),+ Typing.parameterType = (Model.TypeFunction (Model.FunctionType {+ Model.functionTypeDomain = (Model.TypeVariable (Model.Name "x")),+ Model.functionTypeCodomain = (Model.TypeEither (Model.EitherType {+ Model.eitherTypeLeft = (Model.TypeVariable (Model.Name "z")),+ Model.eitherTypeRight = (Model.TypeVariable (Model.Name "y"))}))})),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "m"),+ Typing.parameterDescription = (Just "the optional to map over"),+ Typing.parameterType = (Model.TypeOptional (Model.TypeVariable (Model.Name "x"))),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeEither (Model.EitherType {+ Model.eitherTypeLeft = (Model.TypeVariable (Model.Name "z")),+ Model.eitherTypeRight = (Model.TypeOptional (Model.TypeVariable (Model.Name "y")))}))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = (Just (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "f"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "m"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.optionals.match")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "m"))})),+ Model.applicationArgument = (Model.TermEither (Right (Model.TermOptional Nothing)))})),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "x"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.eithers.map")),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "y"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermOptional (Just (Model.TermVariable (Model.Name "y"))))}))})),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "f")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "x"))}))}))}))}))}))})))}++mapSet :: Packaging.PrimitiveDefinition+mapSet =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.eithers.mapSet"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Map a function returning either over a set, collecting results or short-circuiting on Left."),+ Packaging.entityMetadataComments = [+ "mapSet(f, s) applies f to each element of s in unspecified order. If every application returns Right, the result is Right of the set of contained values (deduplicated by the result type's ordering); the first application returning Left short-circuits the whole result to that Left.",+ "Requires an 'ordering' constraint on the input and output element types.",+ "Total. Corresponds to Haskell's traverse-style operation specialised to Set."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "x"),+ Typing.typeParameterConstraints = [+ Model.TypeClassConstraintSimple (Model.Name "ordering")]},+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "y"),+ Typing.typeParameterConstraints = [+ Model.TypeClassConstraintSimple (Model.Name "ordering")]},+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "z"),+ Typing.typeParameterConstraints = []}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "f"),+ Typing.parameterDescription = (Just "the either-returning function to apply to each element"),+ Typing.parameterType = (Model.TypeFunction (Model.FunctionType {+ Model.functionTypeDomain = (Model.TypeVariable (Model.Name "x")),+ Model.functionTypeCodomain = (Model.TypeEither (Model.EitherType {+ Model.eitherTypeLeft = (Model.TypeVariable (Model.Name "z")),+ Model.eitherTypeRight = (Model.TypeVariable (Model.Name "y"))}))})),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "s"),+ Typing.parameterDescription = (Just "the set to map over"),+ Typing.parameterType = (Model.TypeSet (Model.TypeVariable (Model.Name "x"))),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeEither (Model.EitherType {+ Model.eitherTypeLeft = (Model.TypeVariable (Model.Name "z")),+ Model.eitherTypeRight = (Model.TypeSet (Model.TypeVariable (Model.Name "y")))}))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = (Just (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "f"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "s"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.eithers.map")),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "ys"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.sets.fromList")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "ys"))}))}))})),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.lists.foldr")),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "x"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "acc"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.eithers.bind")),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "f")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "x"))}))})),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "y"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.eithers.map")),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "ys"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.lists.cons")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "y"))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "ys"))}))}))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "acc"))}))}))}))}))}))})),+ Model.applicationArgument = (Model.TermEither (Right (Model.TermList [])))})),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.sets.toList")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "s"))}))}))}))}))})))}++partition :: Packaging.PrimitiveDefinition+partition =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.eithers.partition"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Partition a list of either values into lefts and rights."),+ Packaging.entityMetadataComments = [+ "partition(xs) returns a pair (lefts, rights) where lefts contains every Left value from xs in original order and rights contains every Right value from xs in original order.",+ "Total. Corresponds to Haskell's Data.Either.partitionEithers :: [Either a b] -> ([a], [b])."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "x"),+ Typing.typeParameterConstraints = []},+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "y"),+ Typing.typeParameterConstraints = []}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "xs"),+ Typing.parameterDescription = (Just "the list of either values to partition"),+ Typing.parameterType = (Model.TypeList (Model.TypeEither (Model.EitherType {+ Model.eitherTypeLeft = (Model.TypeVariable (Model.Name "x")),+ Model.eitherTypeRight = (Model.TypeVariable (Model.Name "y"))}))),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypePair (Model.PairType {+ Model.pairTypeFirst = (Model.TypeList (Model.TypeVariable (Model.Name "x"))),+ Model.pairTypeSecond = (Model.TypeList (Model.TypeVariable (Model.Name "y")))}))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = (Just (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "xs"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.lists.foldr")),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "e"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "acc"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.eithers.either")),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "l"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermPair (+ Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.lists.cons")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "l"))})),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.pairs.first")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "acc"))}))}),+ (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.pairs.second")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "acc"))}))))}))})),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "r"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermPair (+ Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.pairs.first")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "acc"))}),+ (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.lists.cons")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "r"))})),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.pairs.second")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "acc"))}))}))))}))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "e"))}))}))}))})),+ Model.applicationArgument = (Model.TermPair (Model.TermList [], (Model.TermList [])))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "xs"))}))})))}++right :: Packaging.PrimitiveDefinition+right =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.eithers.right"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Construct a right (success/normal) either value."),+ Packaging.entityMetadataComments = [+ "right(x) is Right x. The dual constructor to left, injecting into the Right (success/normal) side of an either.",+ "Total. Corresponds to Haskell's Right :: b -> Either a b."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "x"),+ Typing.typeParameterConstraints = []},+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "y"),+ Typing.typeParameterConstraints = []}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "x"),+ Typing.parameterDescription = (Just "the value to wrap as a Right"),+ Typing.parameterType = (Model.TypeVariable (Model.Name "y")),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeEither (Model.EitherType {+ Model.eitherTypeLeft = (Model.TypeVariable (Model.Name "x")),+ Model.eitherTypeRight = (Model.TypeVariable (Model.Name "y"))}))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++rights :: Packaging.PrimitiveDefinition+rights =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.eithers.rights"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Extract all Right values from a list of either values."),+ Packaging.entityMetadataComments = [+ "rights(xs) returns a list containing every Right value in xs, in original order, with Left values discarded.",+ "Total. Corresponds to Haskell's Data.Either.rights :: [Either a b] -> [b]."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "x"),+ Typing.typeParameterConstraints = []},+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "y"),+ Typing.typeParameterConstraints = []}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "xs"),+ Typing.parameterDescription = (Just "the list of either values to extract Rights from"),+ Typing.parameterType = (Model.TypeList (Model.TypeEither (Model.EitherType {+ Model.eitherTypeLeft = (Model.TypeVariable (Model.Name "x")),+ Model.eitherTypeRight = (Model.TypeVariable (Model.Name "y"))}))),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeList (Model.TypeVariable (Model.Name "y")))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = (Just (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "xs"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.lists.foldr")),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "e"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "acc"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.eithers.either")),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "_"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermVariable (Model.Name "acc"))}))})),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "r"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.lists.cons")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "r"))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "acc"))}))}))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "e"))}))}))}))})),+ Model.applicationArgument = (Model.TermList [])})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "xs"))}))})))}
@@ -0,0 +1,127 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Primitives in the hydra.core.lib.equality module.++module Hydra.Core.Lib.Equality where++import qualified Hydra.Core.Ast as Ast+import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Diff as Diff+import qualified Hydra.Core.Docs as Docs+import qualified Hydra.Core.Error.Checking as Checking+import qualified Hydra.Core.Error.File as ErrorFile+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Error.Packaging as ErrorPackaging+import qualified Hydra.Core.Error.System as ErrorSystem+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Json.Model as JsonModel+import qualified Hydra.Core.Markdown as Markdown+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Parsing as Parsing+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Query as Query+import qualified Hydra.Core.Regex as Regex+import qualified Hydra.Core.Relational as Relational+import qualified Hydra.Core.System as System+import qualified Hydra.Core.Tabular as Tabular+import qualified Hydra.Core.Testing as Testing+import qualified Hydra.Core.Time as Time+import qualified Hydra.Core.Topology as Topology+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Validation as Validation+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++equal :: Packaging.PrimitiveDefinition+equal =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.equality.equal"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Check whether two values are equal."),+ Packaging.entityMetadataComments = [+ "equal(x, y) returns true if x and y are structurally equal under the type's notion of equality.",+ "Requires an 'equality' type-class constraint on the argument type, which is the closest Hydra equivalent to Haskell's Eq instance.",+ "Equality is reflexive, symmetric, and transitive (no NaN-style exception on floating-point: floating-point equality is provided per the underlying host's IEEE 754 comparison rules, so NaN /= NaN at the level of float64/float32).",+ "Total. Corresponds to Haskell's (==) :: Eq a => a -> a -> Bool."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "x"),+ Typing.typeParameterConstraints = [+ Model.TypeClassConstraintSimple (Model.Name "equality")]}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "x"),+ Typing.parameterDescription = (Just "the first value to compare"),+ Typing.parameterType = (Model.TypeVariable (Model.Name "x")),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "y"),+ Typing.parameterDescription = (Just "the second value to compare"),+ Typing.parameterType = (Model.TypeVariable (Model.Name "x")),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeLiteral Model.LiteralTypeBoolean)}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++notEqual :: Packaging.PrimitiveDefinition+notEqual =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.equality.notEqual"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Check whether two values are unequal."),+ Packaging.entityMetadataComments = [+ "notEqual(x, y) = logic.not(equal(x, y)); this defining equation is the specification, and the default implementation.",+ "Requires an 'equality' type-class constraint on the argument type.",+ "Total. Corresponds to Haskell's (/=) :: Eq a => a -> a -> Bool."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "x"),+ Typing.typeParameterConstraints = [+ Model.TypeClassConstraintSimple (Model.Name "equality")]}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "x"),+ Typing.parameterDescription = (Just "the first value to compare"),+ Typing.parameterType = (Model.TypeVariable (Model.Name "x")),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "y"),+ Typing.parameterDescription = (Just "the second value to compare"),+ Typing.parameterType = (Model.TypeVariable (Model.Name "x")),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeLiteral Model.LiteralTypeBoolean)}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = (Just (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "x"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "y"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.logic.not")),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.equality.equal")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "x"))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "y"))}))}))}))})))}
@@ -0,0 +1,452 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Primitives in the hydra.core.lib.files module.++module Hydra.Core.Lib.Files where++import qualified Hydra.Core.Ast as Ast+import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Diff as Diff+import qualified Hydra.Core.Docs as Docs+import qualified Hydra.Core.Error.Checking as Checking+import qualified Hydra.Core.Error.File as ErrorFile+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Error.Packaging as ErrorPackaging+import qualified Hydra.Core.Error.System as ErrorSystem+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Json.Model as JsonModel+import qualified Hydra.Core.Markdown as Markdown+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Parsing as Parsing+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Query as Query+import qualified Hydra.Core.Regex as Regex+import qualified Hydra.Core.Relational as Relational+import qualified Hydra.Core.System as System+import qualified Hydra.Core.Tabular as Tabular+import qualified Hydra.Core.Testing as Testing+import qualified Hydra.Core.Time as Time+import qualified Hydra.Core.Topology as Topology+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Validation as Validation+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++appendFile :: Packaging.PrimitiveDefinition+appendFile =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.files.appendFile"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Append bytes to the end of a file."),+ Packaging.entityMetadataComments = [+ "appendFile(path, contents) describes an effectful computation which attempts to append the raw bytes contents to the end of the file at path, creating the file if it does not exist. Unlike writeFile, existing contents are preserved. File I/O is byte-oriented; to append text, encode it to bytes first (e.g. via hydra.core.lib.text.encodeUtf8). A recoverable file-system failure is returned as left(error); success is returned as right(unit)."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "path"),+ Typing.parameterDescription = (Just "the path of the file to append to"),+ Typing.parameterType = (Model.TypeVariable (Model.Name "hydra.core.file.FilePath")),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "contents"),+ Typing.parameterDescription = (Just "the raw bytes to append"),+ Typing.parameterType = (Model.TypeLiteral Model.LiteralTypeBinary),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeEffect (Model.TypeEither (Model.EitherType {+ Model.eitherTypeLeft = (Model.TypeVariable (Model.Name "hydra.core.error.file.FileError")),+ Model.eitherTypeRight = Model.TypeUnit})))}},+ Packaging.primitiveDefinitionIsPure = False,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++copy :: Packaging.PrimitiveDefinition+copy =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.files.copy"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Copy a file, or a directory tree, to a destination path."),+ Packaging.entityMetadataComments = [+ "copy(recursive, source, destination) describes an effectful computation which attempts to copy source to destination. When recursive is false, source must be a single file. When recursive is true, source may be a directory, whose entire tree is copied. Copying is performed by the host operating system rather than by reading and rewriting contents, preserving binary data and avoiding a round trip through the language runtime. A recoverable file-system failure is returned as left(error); success is returned as right(unit).",+ "Deprecated since 0.18. Use: copyFile."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = (Just (Packaging.LifecycleInfo {+ Packaging.lifecycleInfoAvailableSince = Nothing,+ Packaging.lifecycleInfoDeprecatedSince = (Just (Packaging.Version "0.18"))})),+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "recursive"),+ Typing.parameterDescription = (Just "whether to copy a directory tree rather than a single file"),+ Typing.parameterType = (Model.TypeLiteral Model.LiteralTypeBoolean),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "source"),+ Typing.parameterDescription = (Just "the path to copy from"),+ Typing.parameterType = (Model.TypeVariable (Model.Name "hydra.core.file.FilePath")),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "destination"),+ Typing.parameterDescription = (Just "the path to copy to"),+ Typing.parameterType = (Model.TypeVariable (Model.Name "hydra.core.file.FilePath")),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeEffect (Model.TypeEither (Model.EitherType {+ Model.eitherTypeLeft = (Model.TypeVariable (Model.Name "hydra.core.error.file.FileError")),+ Model.eitherTypeRight = Model.TypeUnit})))}},+ Packaging.primitiveDefinitionIsPure = False,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++createDirectory :: Packaging.PrimitiveDefinition+createDirectory =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.files.createDirectory"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Create a directory."),+ Packaging.entityMetadataComments = [+ "createDirectory(recursive, path) describes an effectful computation which attempts to create a directory at path. When recursive is false this corresponds to POSIX mkdir: it fails if path already exists or if a parent is missing. When recursive is true, any missing parent directories are created as well (as with mkdir -p) and an already-existing directory is not an error. A recoverable file-system failure is returned as left(error); success is returned as right(unit)."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "recursive"),+ Typing.parameterDescription = (Just "whether to create missing parent directories as well"),+ Typing.parameterType = (Model.TypeLiteral Model.LiteralTypeBoolean),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "path"),+ Typing.parameterDescription = (Just "the path of the directory to create"),+ Typing.parameterType = (Model.TypeVariable (Model.Name "hydra.core.file.FilePath")),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeEffect (Model.TypeEither (Model.EitherType {+ Model.eitherTypeLeft = (Model.TypeVariable (Model.Name "hydra.core.error.file.FileError")),+ Model.eitherTypeRight = Model.TypeUnit})))}},+ Packaging.primitiveDefinitionIsPure = False,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++createSymlink :: Packaging.PrimitiveDefinition+createSymlink =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.files.createSymlink"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Create a symbolic link."),+ Packaging.entityMetadataComments = [+ "createSymlink(target, link) describes an effectful computation which attempts to create a symbolic link at link, pointing to target (POSIX symlink). target is stored verbatim; it may be a relative path, and it need not exist. There is no force flag: if link already exists (including as a dangling symbolic link), the computation fails with left(alreadyExists); a caller that wants replace-if-exists semantics should compose status(false, link), removeFile, and createSymlink. A missing parent directory yields left(notFound); a host or file system which refuses to create the link (e.g. an unprivileged process on Windows, or an unsupported file system) yields left(permissionDenied) or left(other) as appropriate. A recoverable file-system failure is returned as left(error); success is returned as right(unit)."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "target"),+ Typing.parameterDescription = (Just "the path that the new symbolic link will point to"),+ Typing.parameterType = (Model.TypeVariable (Model.Name "hydra.core.file.FilePath")),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "link"),+ Typing.parameterDescription = (Just "the path of the symbolic link to create"),+ Typing.parameterType = (Model.TypeVariable (Model.Name "hydra.core.file.FilePath")),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeEffect (Model.TypeEither (Model.EitherType {+ Model.eitherTypeLeft = (Model.TypeVariable (Model.Name "hydra.core.error.file.FileError")),+ Model.eitherTypeRight = Model.TypeUnit})))}},+ Packaging.primitiveDefinitionIsPure = False,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++exists :: Packaging.PrimitiveDefinition+exists =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.files.exists"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Test whether a path exists."),+ Packaging.entityMetadataComments = [+ "exists(path) describes an effectful computation which reports whether anything exists at path, whether a file, directory, or other type of file. It does not error when the path is absent; a missing path is reported as right(false). Use status to obtain the type of an existing path. A recoverable file-system failure is returned as left(error)."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "path"),+ Typing.parameterDescription = (Just "the path to test for existence"),+ Typing.parameterType = (Model.TypeVariable (Model.Name "hydra.core.file.FilePath")),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeEffect (Model.TypeEither (Model.EitherType {+ Model.eitherTypeLeft = (Model.TypeVariable (Model.Name "hydra.core.error.file.FileError")),+ Model.eitherTypeRight = (Model.TypeLiteral Model.LiteralTypeBoolean)})))}},+ Packaging.primitiveDefinitionIsPure = False,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++listDirectory :: Packaging.PrimitiveDefinition+listDirectory =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.files.listDirectory"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "List the immediate entries of a directory."),+ Packaging.entityMetadataComments = [+ "listDirectory(path) describes an effectful computation which returns the immediate entries of the directory at path, excluding the special entries \".\" and \"..\". The result is one level deep and is not ordered; to traverse a tree recursively, recurse using status. A recoverable file-system failure is returned as left(error)."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "path"),+ Typing.parameterDescription = (Just "the path of the directory to list"),+ Typing.parameterType = (Model.TypeVariable (Model.Name "hydra.core.file.FilePath")),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeEffect (Model.TypeEither (Model.EitherType {+ Model.eitherTypeLeft = (Model.TypeVariable (Model.Name "hydra.core.error.file.FileError")),+ Model.eitherTypeRight = (Model.TypeList (Model.TypeVariable (Model.Name "hydra.core.file.FilePath")))})))}},+ Packaging.primitiveDefinitionIsPure = False,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++readFile :: Packaging.PrimitiveDefinition+readFile =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.files.readFile"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Read the complete contents of a file as raw bytes."),+ Packaging.entityMetadataComments = [+ "readFile(path) describes an effectful computation which attempts to read the entire contents of the file at path as raw bytes, with no character decoding or newline translation. To interpret the result as text, decode it (e.g. via hydra.core.lib.text.decodeUtf8). A recoverable file-system failure is returned as left(error); success is returned as right(contents)."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "path"),+ Typing.parameterDescription = (Just "the path of the file to read"),+ Typing.parameterType = (Model.TypeVariable (Model.Name "hydra.core.file.FilePath")),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeEffect (Model.TypeEither (Model.EitherType {+ Model.eitherTypeLeft = (Model.TypeVariable (Model.Name "hydra.core.error.file.FileError")),+ Model.eitherTypeRight = (Model.TypeLiteral Model.LiteralTypeBinary)})))}},+ Packaging.primitiveDefinitionIsPure = False,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++readSymlink :: Packaging.PrimitiveDefinition+readSymlink =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.files.readSymlink"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Read the target of a symbolic link."),+ Packaging.entityMetadataComments = [+ "readSymlink(path) describes an effectful computation which attempts to read the target of the symbolic link at path (POSIX readlink). This is a single-hop, unresolved read: the target is returned exactly as stored, with no chain resolution or canonicalization; a relative target is returned relative, and a dangling target (one that does not exist) is returned as-is. To resolve a chain of links to a canonical path, compose repeated calls to readSymlink and status. A missing path yields left(notFound); a path which exists but is not a symbolic link yields left(invalidPath). A recoverable file-system failure is returned as left(error); success is returned as right(target)."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "path"),+ Typing.parameterDescription = (Just "the path of the symbolic link to read"),+ Typing.parameterType = (Model.TypeVariable (Model.Name "hydra.core.file.FilePath")),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeEffect (Model.TypeEither (Model.EitherType {+ Model.eitherTypeLeft = (Model.TypeVariable (Model.Name "hydra.core.error.file.FileError")),+ Model.eitherTypeRight = (Model.TypeVariable (Model.Name "hydra.core.file.FilePath"))})))}},+ Packaging.primitiveDefinitionIsPure = False,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++removeDirectory :: Packaging.PrimitiveDefinition+removeDirectory =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.files.removeDirectory"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Remove a directory."),+ Packaging.entityMetadataComments = [+ "removeDirectory(recursive, path) describes an effectful computation which attempts to remove the directory at path. When recursive is false this corresponds to POSIX rmdir: it fails unless the directory is empty. When recursive is true, the directory and its entire contents are removed (as with rm -r). Removal is performed by the host operating system rather than by walking and deleting entries individually. A recoverable file-system failure is returned as left(error); success is returned as right(unit)."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "recursive"),+ Typing.parameterDescription = (Just "whether to remove the directory's contents as well"),+ Typing.parameterType = (Model.TypeLiteral Model.LiteralTypeBoolean),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "path"),+ Typing.parameterDescription = (Just "the path of the directory to remove"),+ Typing.parameterType = (Model.TypeVariable (Model.Name "hydra.core.file.FilePath")),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeEffect (Model.TypeEither (Model.EitherType {+ Model.eitherTypeLeft = (Model.TypeVariable (Model.Name "hydra.core.error.file.FileError")),+ Model.eitherTypeRight = Model.TypeUnit})))}},+ Packaging.primitiveDefinitionIsPure = False,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++removeFile :: Packaging.PrimitiveDefinition+removeFile =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.files.removeFile"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Remove a file."),+ Packaging.entityMetadataComments = [+ "removeFile(path) describes an effectful computation which attempts to remove the file at path (POSIX unlink). A recoverable file-system failure is returned as left(error); success is returned as right(unit)."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "path"),+ Typing.parameterDescription = (Just "the path of the file to remove"),+ Typing.parameterType = (Model.TypeVariable (Model.Name "hydra.core.file.FilePath")),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeEffect (Model.TypeEither (Model.EitherType {+ Model.eitherTypeLeft = (Model.TypeVariable (Model.Name "hydra.core.error.file.FileError")),+ Model.eitherTypeRight = Model.TypeUnit})))}},+ Packaging.primitiveDefinitionIsPure = False,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++rename :: Packaging.PrimitiveDefinition+rename =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.files.rename"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Rename or move a file or directory."),+ Packaging.entityMetadataComments = [+ "rename(source, destination) describes an effectful computation which attempts to rename the file or directory at source to destination. When source and destination are on the same file system this is atomic (POSIX rename) and cannot be reproduced by a copy followed by a delete. A recoverable file-system failure is returned as left(error); success is returned as right(unit)."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "source"),+ Typing.parameterDescription = (Just "the path to rename from"),+ Typing.parameterType = (Model.TypeVariable (Model.Name "hydra.core.file.FilePath")),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "destination"),+ Typing.parameterDescription = (Just "the path to rename to"),+ Typing.parameterType = (Model.TypeVariable (Model.Name "hydra.core.file.FilePath")),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeEffect (Model.TypeEither (Model.EitherType {+ Model.eitherTypeLeft = (Model.TypeVariable (Model.Name "hydra.core.error.file.FileError")),+ Model.eitherTypeRight = Model.TypeUnit})))}},+ Packaging.primitiveDefinitionIsPure = False,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++status :: Packaging.PrimitiveDefinition+status =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.files.status"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Retrieve metadata about a file or directory."),+ Packaging.entityMetadataComments = [+ "status(followLinks, path) describes an effectful computation which retrieves metadata about the file system entry at path, including its type, size, and modification time. When followLinks is true, this corresponds to POSIX stat: if path is a symbolic link, the metadata describes the link's target, and a dangling link (whose target does not exist) yields left(notFound). When followLinks is false, this corresponds to POSIX lstat: the metadata describes the link itself, with fileType link, a size equal to the length of the stored target path, and the link's own timestamps; a dangling link is not an error in this mode. status(false, path) is the only way to observe fileType link; status(true, path) never produces it, since a followed link's metadata is always that of its (non-link) target. For paths that are not symbolic links, both modes report identical metadata. A path which does not exist yields left(notFound); other recoverable file-system failures are also returned as left(error). Use exists for a boolean presence check that does not error on absence."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "followLinks"),+ Typing.parameterDescription = (Just "whether to resolve symbolic links (true reproduces the previous, follow, behavior; false inspects the entry itself)"),+ Typing.parameterType = (Model.TypeLiteral Model.LiteralTypeBoolean),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "path"),+ Typing.parameterDescription = (Just "the path to retrieve metadata for"),+ Typing.parameterType = (Model.TypeVariable (Model.Name "hydra.core.file.FilePath")),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeEffect (Model.TypeEither (Model.EitherType {+ Model.eitherTypeLeft = (Model.TypeVariable (Model.Name "hydra.core.error.file.FileError")),+ Model.eitherTypeRight = (Model.TypeVariable (Model.Name "hydra.core.file.FileStatus"))})))}},+ Packaging.primitiveDefinitionIsPure = False,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++writeFile :: Packaging.PrimitiveDefinition+writeFile =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.files.writeFile"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Write raw bytes as the complete contents of a file."),+ Packaging.entityMetadataComments = [+ "writeFile(path, contents) describes an effectful computation which attempts to replace the file at path with the raw bytes contents, with no character encoding or newline translation. To write text, encode it to bytes first (e.g. via hydra.core.lib.text.encodeUtf8). A recoverable file-system failure is returned as left(error); success is returned as right(unit)."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "path"),+ Typing.parameterDescription = (Just "the path of the file to write"),+ Typing.parameterType = (Model.TypeVariable (Model.Name "hydra.core.file.FilePath")),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "contents"),+ Typing.parameterDescription = (Just "the raw bytes to write as the file's contents"),+ Typing.parameterType = (Model.TypeLiteral Model.LiteralTypeBinary),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeEffect (Model.TypeEither (Model.EitherType {+ Model.eitherTypeLeft = (Model.TypeVariable (Model.Name "hydra.core.error.file.FileError")),+ Model.eitherTypeRight = Model.TypeUnit})))}},+ Packaging.primitiveDefinitionIsPure = False,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}
@@ -0,0 +1,279 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Primitives in the hydra.core.lib.functions module.++module Hydra.Core.Lib.Functions where++import qualified Hydra.Core.Ast as Ast+import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Diff as Diff+import qualified Hydra.Core.Docs as Docs+import qualified Hydra.Core.Error.Checking as Checking+import qualified Hydra.Core.Error.File as ErrorFile+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Error.Packaging as ErrorPackaging+import qualified Hydra.Core.Error.System as ErrorSystem+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Json.Model as JsonModel+import qualified Hydra.Core.Markdown as Markdown+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Parsing as Parsing+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Query as Query+import qualified Hydra.Core.Regex as Regex+import qualified Hydra.Core.Relational as Relational+import qualified Hydra.Core.System as System+import qualified Hydra.Core.Tabular as Tabular+import qualified Hydra.Core.Testing as Testing+import qualified Hydra.Core.Time as Time+import qualified Hydra.Core.Topology as Topology+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Validation as Validation+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++absurd :: Packaging.PrimitiveDefinition+absurd =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.functions.absurd"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Eliminate a value of the uninhabited void type, producing any type."),+ Packaging.entityMetadataComments = [+ "absurd(v) is the unique function from void to any type t1; since void has no inhabitants, this function can never actually be applied in a well-typed program.",+ "Its purpose is to discharge an impossible branch in otherwise-total code, such as the left case of an either<void, a> that can never occur.",+ "The eliminator dual to the (nonexistent) introducer for void.",+ "Total, vacuously: there is no well-typed argument on which absurd could be called. Corresponds to Haskell's Data.Void.absurd :: Void -> a."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "t1"),+ Typing.typeParameterConstraints = []}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "v"),+ Typing.parameterDescription = (Just "a value of the void type; unreachable in any well-typed program"),+ Typing.parameterType = Model.TypeVoid,+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeVariable (Model.Name "t1"))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++compose :: Packaging.PrimitiveDefinition+compose =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.functions.compose"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Compose two functions."),+ Packaging.entityMetadataComments = [+ "compose(g, f, x) = g(f(x)); this defining equation is the specification.",+ "The outer function comes first: f is applied to x, and g is applied to the result.",+ "This is ordinary function composition, distinct from the Kleisli compose primitives of the monad modules.",+ "Total. Corresponds to Haskell's (.) :: (b -> c) -> (a -> b) -> a -> c."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "t1"),+ Typing.typeParameterConstraints = []},+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "t2"),+ Typing.typeParameterConstraints = []},+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "t3"),+ Typing.typeParameterConstraints = []}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "g"),+ Typing.parameterDescription = (Just "the outer function, applied to the result of f"),+ Typing.parameterType = (Model.TypeFunction (Model.FunctionType {+ Model.functionTypeDomain = (Model.TypeVariable (Model.Name "t2")),+ Model.functionTypeCodomain = (Model.TypeVariable (Model.Name "t3"))})),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "f"),+ Typing.parameterDescription = (Just "the inner function, applied to x first"),+ Typing.parameterType = (Model.TypeFunction (Model.FunctionType {+ Model.functionTypeDomain = (Model.TypeVariable (Model.Name "t1")),+ Model.functionTypeCodomain = (Model.TypeVariable (Model.Name "t2"))})),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "x"),+ Typing.parameterDescription = (Just "the argument to which f is applied"),+ Typing.parameterType = (Model.TypeVariable (Model.Name "t1")),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeVariable (Model.Name "t3"))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = (Just (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "g"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "f"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "x"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "g")),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "f")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "x"))}))}))}))}))})))}++const :: Packaging.PrimitiveDefinition+const =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.functions.const"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Return the first argument, ignoring the second."),+ Packaging.entityMetadataComments = [+ "const(x, y) = x; this defining equation is the specification.",+ "Partially applied, const(x) is the constant function which returns x on every input.",+ "Total. Corresponds to Haskell's const :: a -> b -> a."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "t1"),+ Typing.typeParameterConstraints = []},+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "t2"),+ Typing.typeParameterConstraints = []}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "x"),+ Typing.parameterDescription = (Just "the value to return"),+ Typing.parameterType = (Model.TypeVariable (Model.Name "t1")),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "y"),+ Typing.parameterDescription = (Just "the ignored second argument"),+ Typing.parameterType = (Model.TypeVariable (Model.Name "t2")),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeVariable (Model.Name "t1"))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = (Just (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "x"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "y"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermVariable (Model.Name "x"))}))})))}++flip :: Packaging.PrimitiveDefinition+flip =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.functions.flip"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Swap the argument order of a binary function."),+ Packaging.entityMetadataComments = [+ "flip(f, x, y) = f(y, x); this defining equation is the specification.",+ "Total. Corresponds to Haskell's flip :: (a -> b -> c) -> b -> a -> c."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "t1"),+ Typing.typeParameterConstraints = []},+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "t2"),+ Typing.typeParameterConstraints = []},+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "t3"),+ Typing.typeParameterConstraints = []}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "f"),+ Typing.parameterDescription = (Just "the binary function whose argument order is swapped"),+ Typing.parameterType = (Model.TypeFunction (Model.FunctionType {+ Model.functionTypeDomain = (Model.TypeVariable (Model.Name "t1")),+ Model.functionTypeCodomain = (Model.TypeFunction (Model.FunctionType {+ Model.functionTypeDomain = (Model.TypeVariable (Model.Name "t2")),+ Model.functionTypeCodomain = (Model.TypeVariable (Model.Name "t3"))}))})),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "x"),+ Typing.parameterDescription = (Just "the argument passed as f's second argument"),+ Typing.parameterType = (Model.TypeVariable (Model.Name "t2")),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "y"),+ Typing.parameterDescription = (Just "the argument passed as f's first argument"),+ Typing.parameterType = (Model.TypeVariable (Model.Name "t1")),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeVariable (Model.Name "t3"))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = (Just (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "f"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "x"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "y"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "f")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "y"))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "x"))}))}))}))})))}++identity :: Packaging.PrimitiveDefinition+identity =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.functions.identity"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Return the argument unchanged."),+ Packaging.entityMetadataComments = [+ "identity(x) = x; this defining equation is the specification. The polymorphic identity function.",+ "identity is the unit of compose: compose(identity, f) and compose(f, identity) are both f.",+ "Total. Corresponds to Haskell's id :: a -> a."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "t1"),+ Typing.typeParameterConstraints = []}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "x"),+ Typing.parameterDescription = (Just "the value to return unchanged"),+ Typing.parameterType = (Model.TypeVariable (Model.Name "t1")),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeVariable (Model.Name "t1"))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = (Just (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "x"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermVariable (Model.Name "x"))})))}
@@ -0,0 +1,94 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Primitives in the hydra.core.lib.hashing module.++module Hydra.Core.Lib.Hashing where++import qualified Hydra.Core.Ast as Ast+import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Diff as Diff+import qualified Hydra.Core.Docs as Docs+import qualified Hydra.Core.Error.Checking as Checking+import qualified Hydra.Core.Error.File as ErrorFile+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Error.Packaging as ErrorPackaging+import qualified Hydra.Core.Error.System as ErrorSystem+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Json.Model as JsonModel+import qualified Hydra.Core.Markdown as Markdown+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Parsing as Parsing+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Query as Query+import qualified Hydra.Core.Regex as Regex+import qualified Hydra.Core.Relational as Relational+import qualified Hydra.Core.System as System+import qualified Hydra.Core.Tabular as Tabular+import qualified Hydra.Core.Testing as Testing+import qualified Hydra.Core.Time as Time+import qualified Hydra.Core.Topology as Topology+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Validation as Validation+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++sha256 :: Packaging.PrimitiveDefinition+sha256 =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.hashing.sha256"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Compute the SHA-256 digest of a sequence of bytes."),+ Packaging.entityMetadataComments = [+ "sha256(bytes) returns the 32-byte SHA-256 digest of bytes. Total: hashing is pure and never fails.",+ "Pairs with hydra.core.lib.files.readFile, which returns raw bytes, to hash file contents."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "bytes"),+ Typing.parameterDescription = (Just "the sequence of bytes to hash"),+ Typing.parameterType = (Model.TypeLiteral Model.LiteralTypeBinary),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeLiteral Model.LiteralTypeBinary)}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++sha256Hex :: Packaging.PrimitiveDefinition+sha256Hex =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.hashing.sha256Hex"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Compute the SHA-256 digest of a sequence of bytes as a lowercase hex string."),+ Packaging.entityMetadataComments = [+ "sha256Hex(bytes) returns the SHA-256 digest of bytes as a 64-character lowercase hexadecimal string. Equivalent to hex-encoding the output of sha256. Total: hashing is pure and never fails.",+ "Pairs with hydra.core.lib.files.readFile, which returns raw bytes, to hash file contents."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "bytes"),+ Typing.parameterDescription = (Just "the sequence of bytes to hash"),+ Typing.parameterType = (Model.TypeLiteral Model.LiteralTypeBinary),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeLiteral Model.LiteralTypeString)}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}
@@ -0,0 +1,1790 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Primitives in the hydra.core.lib.lists module.++module Hydra.Core.Lib.Lists where++import qualified Hydra.Core.Ast as Ast+import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Diff as Diff+import qualified Hydra.Core.Docs as Docs+import qualified Hydra.Core.Error.Checking as Checking+import qualified Hydra.Core.Error.File as ErrorFile+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Error.Packaging as ErrorPackaging+import qualified Hydra.Core.Error.System as ErrorSystem+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Json.Model as JsonModel+import qualified Hydra.Core.Markdown as Markdown+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Parsing as Parsing+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Query as Query+import qualified Hydra.Core.Regex as Regex+import qualified Hydra.Core.Relational as Relational+import qualified Hydra.Core.System as System+import qualified Hydra.Core.Tabular as Tabular+import qualified Hydra.Core.Testing as Testing+import qualified Hydra.Core.Time as Time+import qualified Hydra.Core.Topology as Topology+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Validation as Validation+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++apply :: Packaging.PrimitiveDefinition+apply =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.lists.apply"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Apply a list of functions to a list of values (applicative style)."),+ Packaging.entityMetadataComments = [+ "apply(fs, xs) returns the list of all f x for f in fs and x in xs, in order: for each f in fs (outer loop), for each x in xs (inner loop).",+ "Equivalent to the applicative list instance.",+ "Total. Corresponds to Haskell's (<*>) :: [a -> b] -> [a] -> [b]."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "x"),+ Typing.typeParameterConstraints = []},+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "y"),+ Typing.typeParameterConstraints = []}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "fs"),+ Typing.parameterDescription = (Just "the list of functions to apply"),+ Typing.parameterType = (Model.TypeList (Model.TypeFunction (Model.FunctionType {+ Model.functionTypeDomain = (Model.TypeVariable (Model.Name "x")),+ Model.functionTypeCodomain = (Model.TypeVariable (Model.Name "y"))}))),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "xs"),+ Typing.parameterDescription = (Just "the list of values to apply them to"),+ Typing.parameterType = (Model.TypeList (Model.TypeVariable (Model.Name "x"))),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeList (Model.TypeVariable (Model.Name "y")))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++at :: Packaging.PrimitiveDefinition+at =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.lists.at"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Return the element at the given index, or Nothing if out of bounds."),+ Packaging.entityMetadataComments = [+ "at(i, xs) returns Just(xs[i]) if 0 <= i < length(xs), or Nothing otherwise.",+ "Total. Wraps the Haskell (!!) operator, which is partial, in maybe to make out-of-bounds total."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "x"),+ Typing.typeParameterConstraints = []}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "i"),+ Typing.parameterDescription = (Just "the index to look up"),+ Typing.parameterType = (Model.TypeLiteral (Model.LiteralTypeInteger Model.IntegerTypeInt32)),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "xs"),+ Typing.parameterDescription = (Just "the list to index into"),+ Typing.parameterType = (Model.TypeList (Model.TypeVariable (Model.Name "x"))),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeOptional (Model.TypeVariable (Model.Name "x")))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++bind :: Packaging.PrimitiveDefinition+bind =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.lists.bind"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Apply a function that returns lists to each element and flatten the results."),+ Packaging.entityMetadataComments = [+ "bind(xs, f) applies f to each element of xs and concatenates the resulting lists in order. Equivalent to concatMap.",+ "Total. Corresponds to Haskell's (>>=) :: [a] -> (a -> [b]) -> [b]."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "x"),+ Typing.typeParameterConstraints = []},+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "y"),+ Typing.typeParameterConstraints = []}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "xs"),+ Typing.parameterDescription = (Just "the list to bind over"),+ Typing.parameterType = (Model.TypeList (Model.TypeVariable (Model.Name "x"))),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "f"),+ Typing.parameterDescription = (Just "the function returning a list for each element"),+ Typing.parameterType = (Model.TypeFunction (Model.FunctionType {+ Model.functionTypeDomain = (Model.TypeVariable (Model.Name "x")),+ Model.functionTypeCodomain = (Model.TypeList (Model.TypeVariable (Model.Name "y")))})),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeList (Model.TypeVariable (Model.Name "y")))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = (Just (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "xs"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "f"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.lists.foldr")),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "x"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "acc"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.lists.concat2")),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "f")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "x"))}))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "acc"))}))}))}))})),+ Model.applicationArgument = (Model.TermList [])})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "xs"))}))}))})))}++compose :: Packaging.PrimitiveDefinition+compose =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.lists.compose"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Compose two functions that return lists (Kleisli composition in the list monad)."),+ Packaging.entityMetadataComments = [+ "compose(f, g, x) is bind(f(x), g); this defining equation is the specification. The results of applying g to each element of f(x) are concatenated in order.",+ "Total. Corresponds to Kleisli composition (>=>) in the list monad."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "x"),+ Typing.typeParameterConstraints = []},+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "y"),+ Typing.typeParameterConstraints = []},+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "z"),+ Typing.typeParameterConstraints = []}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "f"),+ Typing.parameterDescription = (Just "the first list-returning function"),+ Typing.parameterType = (Model.TypeFunction (Model.FunctionType {+ Model.functionTypeDomain = (Model.TypeVariable (Model.Name "x")),+ Model.functionTypeCodomain = (Model.TypeList (Model.TypeVariable (Model.Name "y")))})),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "g"),+ Typing.parameterDescription = (Just "the second list-returning function"),+ Typing.parameterType = (Model.TypeFunction (Model.FunctionType {+ Model.functionTypeDomain = (Model.TypeVariable (Model.Name "y")),+ Model.functionTypeCodomain = (Model.TypeList (Model.TypeVariable (Model.Name "z")))})),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "x"),+ Typing.parameterDescription = (Just "the input value"),+ Typing.parameterType = (Model.TypeVariable (Model.Name "x")),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeList (Model.TypeVariable (Model.Name "z")))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++concat :: Packaging.PrimitiveDefinition+concat =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.lists.concat"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Concatenate a list of lists."),+ Packaging.entityMetadataComments = [+ "concat(xss) returns the list obtained by appending all the lists in xss in order.",+ "Total. Corresponds to Haskell's concat :: [[a]] -> [a]."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "x"),+ Typing.typeParameterConstraints = []}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "xss"),+ Typing.parameterDescription = (Just "the list of lists to concatenate"),+ Typing.parameterType = (Model.TypeList (Model.TypeList (Model.TypeVariable (Model.Name "x")))),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeList (Model.TypeVariable (Model.Name "x")))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++concat2 :: Packaging.PrimitiveDefinition+concat2 =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.lists.concat2"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Concatenate two lists."),+ Packaging.entityMetadataComments = [+ "concat2(xs, ys) returns xs with ys appended.",+ "Total. Corresponds to Haskell's (++) :: [a] -> [a] -> [a]."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "x"),+ Typing.typeParameterConstraints = []}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "xs"),+ Typing.parameterDescription = (Just "the first list"),+ Typing.parameterType = (Model.TypeList (Model.TypeVariable (Model.Name "x"))),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "ys"),+ Typing.parameterDescription = (Just "the list to append"),+ Typing.parameterType = (Model.TypeList (Model.TypeVariable (Model.Name "x"))),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeList (Model.TypeVariable (Model.Name "x")))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++cons :: Packaging.PrimitiveDefinition+cons =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.lists.cons"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Prepend a value to a list."),+ Packaging.entityMetadataComments = [+ "cons(x, xs) returns a list whose head is x and whose tail is xs.",+ "Total. Corresponds to Haskell's (:) :: a -> [a] -> [a]."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "x"),+ Typing.typeParameterConstraints = []}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "x"),+ Typing.parameterDescription = (Just "the value to prepend"),+ Typing.parameterType = (Model.TypeVariable (Model.Name "x")),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "xs"),+ Typing.parameterDescription = (Just "the list to prepend to"),+ Typing.parameterType = (Model.TypeList (Model.TypeVariable (Model.Name "x"))),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeList (Model.TypeVariable (Model.Name "x")))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++distinct :: Packaging.PrimitiveDefinition+distinct =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.lists.distinct"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Remove duplicate elements from a list."),+ Packaging.entityMetadataComments = [+ "distinct(xs) returns the list of distinct elements of xs, in the order of their first occurrence.",+ "Requires an 'equality' constraint on the element type.",+ "Total. Corresponds to Haskell's Data.List.nub :: Eq a => [a] -> [a]."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "x"),+ Typing.typeParameterConstraints = [+ Model.TypeClassConstraintSimple (Model.Name "equality")]}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "xs"),+ Typing.parameterDescription = (Just "the list to deduplicate"),+ Typing.parameterType = (Model.TypeList (Model.TypeVariable (Model.Name "x"))),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeList (Model.TypeVariable (Model.Name "x")))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++drop :: Packaging.PrimitiveDefinition+drop =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.lists.drop"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Drop the first n elements from a list."),+ Packaging.entityMetadataComments = [+ "drop(n, xs) returns the suffix of xs after dropping the first n elements; if n is greater than or equal to length(xs) the result is the empty list; if n is non-positive the result is xs unchanged.",+ "Total. Corresponds to Haskell's drop :: Int -> [a] -> [a]."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "x"),+ Typing.typeParameterConstraints = []}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "n"),+ Typing.parameterDescription = (Just "the number of elements to drop"),+ Typing.parameterType = (Model.TypeLiteral (Model.LiteralTypeInteger Model.IntegerTypeInt32)),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "xs"),+ Typing.parameterDescription = (Just "the list to drop from"),+ Typing.parameterType = (Model.TypeList (Model.TypeVariable (Model.Name "x"))),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeList (Model.TypeVariable (Model.Name "x")))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++dropWhile :: Packaging.PrimitiveDefinition+dropWhile =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.lists.dropWhile"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Drop elements from the beginning of a list while the predicate is true."),+ Packaging.entityMetadataComments = [+ "dropWhile(p, xs) returns the suffix of xs starting at the first element for which p returns false. If p is true for every element, the result is the empty list.",+ "Total. Corresponds to Haskell's dropWhile :: (a -> Bool) -> [a] -> [a]."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "x"),+ Typing.typeParameterConstraints = []}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "p"),+ Typing.parameterDescription = (Just "the predicate to test each element"),+ Typing.parameterType = (Model.TypeFunction (Model.FunctionType {+ Model.functionTypeDomain = (Model.TypeVariable (Model.Name "x")),+ Model.functionTypeCodomain = (Model.TypeLiteral Model.LiteralTypeBoolean)})),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "xs"),+ Typing.parameterDescription = (Just "the list to drop from"),+ Typing.parameterType = (Model.TypeList (Model.TypeVariable (Model.Name "x"))),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeList (Model.TypeVariable (Model.Name "x")))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = (Just (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "p"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "xs"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.pairs.second")),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.lists.span")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "p"))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "xs"))}))}))}))})))}++filter :: Packaging.PrimitiveDefinition+filter =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.lists.filter"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Filter a list by a predicate."),+ Packaging.entityMetadataComments = [+ "filter(p, xs) returns the list of elements x in xs for which p(x) is true, in original order.",+ "Total. Corresponds to Haskell's filter :: (a -> Bool) -> [a] -> [a]."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "x"),+ Typing.typeParameterConstraints = []}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "p"),+ Typing.parameterDescription = (Just "the predicate to test each element"),+ Typing.parameterType = (Model.TypeFunction (Model.FunctionType {+ Model.functionTypeDomain = (Model.TypeVariable (Model.Name "x")),+ Model.functionTypeCodomain = (Model.TypeLiteral Model.LiteralTypeBoolean)})),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "xs"),+ Typing.parameterDescription = (Just "the list to filter"),+ Typing.parameterType = (Model.TypeList (Model.TypeVariable (Model.Name "x"))),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeList (Model.TypeVariable (Model.Name "x")))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = (Just (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "p"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "xs"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.lists.foldr")),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "x"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "acc"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.logic.ifElse")),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "p")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "x"))}))})),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.lists.cons")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "x"))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "acc"))}))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "acc"))}))}))}))})),+ Model.applicationArgument = (Model.TermList [])})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "xs"))}))}))})))}++find :: Packaging.PrimitiveDefinition+find =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.lists.find"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Find the first element matching a predicate."),+ Packaging.entityMetadataComments = [+ "find(p, xs) returns Just(x) where x is the first element of xs for which p(x) is true, or Nothing if no such element exists.",+ "Total. Corresponds to Haskell's find :: (a -> Bool) -> [a] -> Maybe a."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "x"),+ Typing.typeParameterConstraints = []}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "p"),+ Typing.parameterDescription = (Just "the predicate to test each element"),+ Typing.parameterType = (Model.TypeFunction (Model.FunctionType {+ Model.functionTypeDomain = (Model.TypeVariable (Model.Name "x")),+ Model.functionTypeCodomain = (Model.TypeLiteral Model.LiteralTypeBoolean)})),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "xs"),+ Typing.parameterDescription = (Just "the list to search"),+ Typing.parameterType = (Model.TypeList (Model.TypeVariable (Model.Name "x"))),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeOptional (Model.TypeVariable (Model.Name "x")))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = (Just (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "p"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "xs"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.lists.foldr")),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "x"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "acc"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.logic.ifElse")),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "p")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "x"))}))})),+ Model.applicationArgument = (Model.TermOptional (Just (Model.TermVariable (Model.Name "x"))))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "acc"))}))}))}))})),+ Model.applicationArgument = (Model.TermOptional Nothing)})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "xs"))}))}))})))}++foldList :: Packaging.PrimitiveDefinition+foldList =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.lists.foldList"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Left-fold a list in the list monad (a nondeterministic fold)."),+ Packaging.entityMetadataComments = [+ "foldList(f, acc0, xs) folds xs from the left, branching the accumulator over every result of the step function at each element: after each element the set of accumulators is replaced by all results of applying f to each current accumulator and that element.",+ "foldList(f, acc0, xs) is foldl(\\macc el -> bind(macc, \\acc -> f(acc, el)), singleton(acc0), xs); this defining equation is the specification. For the empty list the result is singleton(acc0).",+ "Total on finite inputs. The list-monad instance of the monadic left fold."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "x"),+ Typing.typeParameterConstraints = []},+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "y"),+ Typing.typeParameterConstraints = []}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "f"),+ Typing.parameterDescription = (Just "the branching step function"),+ Typing.parameterType = (Model.TypeFunction (Model.FunctionType {+ Model.functionTypeDomain = (Model.TypeVariable (Model.Name "x")),+ Model.functionTypeCodomain = (Model.TypeFunction (Model.FunctionType {+ Model.functionTypeDomain = (Model.TypeVariable (Model.Name "y")),+ Model.functionTypeCodomain = (Model.TypeList (Model.TypeVariable (Model.Name "x")))}))})),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "acc0"),+ Typing.parameterDescription = (Just "the initial accumulator"),+ Typing.parameterType = (Model.TypeVariable (Model.Name "x")),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "xs"),+ Typing.parameterDescription = (Just "the list to fold"),+ Typing.parameterType = (Model.TypeList (Model.TypeVariable (Model.Name "y"))),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeList (Model.TypeVariable (Model.Name "x")))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++foldl :: Packaging.PrimitiveDefinition+foldl =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.lists.foldl"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Left-fold a list with an accumulator."),+ Packaging.entityMetadataComments = [+ "foldl(f, acc0, xs) reduces xs left-associatively: foldl(f, acc0, [x1, x2, ..., xn]) = f(f(f(acc0, x1), x2), ..., xn). For the empty list the result is acc0.",+ "Strict in the accumulator on hosts where laziness would otherwise leak space.",+ "Total on finite inputs. Corresponds to Haskell's foldl' :: (b -> a -> b) -> b -> [a] -> b."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "y"),+ Typing.typeParameterConstraints = []},+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "x"),+ Typing.typeParameterConstraints = []}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "f"),+ Typing.parameterDescription = (Just "the step function combining accumulator and element"),+ Typing.parameterType = (Model.TypeFunction (Model.FunctionType {+ Model.functionTypeDomain = (Model.TypeVariable (Model.Name "y")),+ Model.functionTypeCodomain = (Model.TypeFunction (Model.FunctionType {+ Model.functionTypeDomain = (Model.TypeVariable (Model.Name "x")),+ Model.functionTypeCodomain = (Model.TypeVariable (Model.Name "y"))}))})),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "acc0"),+ Typing.parameterDescription = (Just "the initial accumulator"),+ Typing.parameterType = (Model.TypeVariable (Model.Name "y")),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "xs"),+ Typing.parameterDescription = (Just "the list to fold"),+ Typing.parameterType = (Model.TypeList (Model.TypeVariable (Model.Name "x"))),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeVariable (Model.Name "y"))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++foldr :: Packaging.PrimitiveDefinition+foldr =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.lists.foldr"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Right-fold a list with an accumulator."),+ Packaging.entityMetadataComments = [+ "foldr(f, acc0, xs) reduces xs right-associatively: foldr(f, acc0, [x1, ..., xn]) = f(x1, f(x2, ..., f(xn, acc0))). For the empty list the result is acc0.",+ "Total on finite inputs. Corresponds to Haskell's foldr :: (a -> b -> b) -> b -> [a] -> b."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "x"),+ Typing.typeParameterConstraints = []},+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "y"),+ Typing.typeParameterConstraints = []}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "f"),+ Typing.parameterDescription = (Just "the step function combining element and accumulator"),+ Typing.parameterType = (Model.TypeFunction (Model.FunctionType {+ Model.functionTypeDomain = (Model.TypeVariable (Model.Name "x")),+ Model.functionTypeCodomain = (Model.TypeFunction (Model.FunctionType {+ Model.functionTypeDomain = (Model.TypeVariable (Model.Name "y")),+ Model.functionTypeCodomain = (Model.TypeVariable (Model.Name "y"))}))})),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "acc0"),+ Typing.parameterDescription = (Just "the initial accumulator"),+ Typing.parameterType = (Model.TypeVariable (Model.Name "y")),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "xs"),+ Typing.parameterDescription = (Just "the list to fold"),+ Typing.parameterType = (Model.TypeList (Model.TypeVariable (Model.Name "x"))),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeVariable (Model.Name "y"))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++group :: Packaging.PrimitiveDefinition+group =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.lists.group"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Group consecutive equal elements."),+ Packaging.entityMetadataComments = [+ "group(xs) returns a list of lists obtained by grouping consecutive equal elements of xs together. Each inner list is non-empty and contains equal elements; the concatenation of the result equals xs.",+ "Equality is determined by the element type's 'equality' constraint.",+ "Total. Corresponds to Haskell's Data.List.group :: Eq a => [a] -> [[a]]."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "x"),+ Typing.typeParameterConstraints = [+ Model.TypeClassConstraintSimple (Model.Name "equality")]}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "xs"),+ Typing.parameterDescription = (Just "the list to group"),+ Typing.parameterType = (Model.TypeList (Model.TypeVariable (Model.Name "x"))),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeList (Model.TypeList (Model.TypeVariable (Model.Name "x"))))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++head :: Packaging.PrimitiveDefinition+head =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.lists.head"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Return the first element, or Nothing if the list is empty."),+ Packaging.entityMetadataComments = [+ "head(xs) returns Just(x) where x is the first element of xs, or Nothing if xs is empty.",+ "Total. Wraps Haskell's partial head in maybe."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "x"),+ Typing.typeParameterConstraints = []}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "xs"),+ Typing.parameterDescription = (Just "the list to take the head of"),+ Typing.parameterType = (Model.TypeList (Model.TypeVariable (Model.Name "x"))),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeOptional (Model.TypeVariable (Model.Name "x")))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++init :: Packaging.PrimitiveDefinition+init =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.lists.init"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Return all elements except the last, or Nothing if the list is empty."),+ Packaging.entityMetadataComments = [+ "init(xs) returns Just(ys) where ys is xs with its last element removed, or Nothing if xs is empty.",+ "Total. Wraps Haskell's partial init in maybe."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "x"),+ Typing.typeParameterConstraints = []}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "xs"),+ Typing.parameterDescription = (Just "the list to take the initial segment of"),+ Typing.parameterType = (Model.TypeList (Model.TypeVariable (Model.Name "x"))),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeOptional (Model.TypeList (Model.TypeVariable (Model.Name "x"))))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++intersperse :: Packaging.PrimitiveDefinition+intersperse =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.lists.intersperse"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Intersperse a value between consecutive elements of a list."),+ Packaging.entityMetadataComments = [+ "intersperse(sep, xs) returns xs with sep inserted between each pair of adjacent elements; for lists of length 0 or 1 the input is returned unchanged.",+ "Total. Corresponds to Haskell's intersperse :: a -> [a] -> [a]."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "x"),+ Typing.typeParameterConstraints = []}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "sep"),+ Typing.parameterDescription = (Just "the separator value to insert"),+ Typing.parameterType = (Model.TypeVariable (Model.Name "x")),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "xs"),+ Typing.parameterDescription = (Just "the list to intersperse into"),+ Typing.parameterType = (Model.TypeList (Model.TypeVariable (Model.Name "x"))),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeList (Model.TypeVariable (Model.Name "x")))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++isEmpty :: Packaging.PrimitiveDefinition+isEmpty =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.lists.isEmpty"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Test whether a list is empty."),+ Packaging.entityMetadataComments = [+ "isEmpty(xs) returns true iff xs is the empty list.",+ "Total. Corresponds to Haskell's null :: [a] -> Bool."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "x"),+ Typing.typeParameterConstraints = []}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "xs"),+ Typing.parameterDescription = (Just "the list to test"),+ Typing.parameterType = (Model.TypeList (Model.TypeVariable (Model.Name "x"))),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeLiteral Model.LiteralTypeBoolean)}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++join :: Packaging.PrimitiveDefinition+join =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.lists.join"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Intercalate a list of lists with a separator list between each."),+ Packaging.entityMetadataComments = [+ "join(sep, xss) returns the concatenation of xss with sep inserted between consecutive lists. Equivalent to concat(intersperse(sep, xss)).",+ "Total. Corresponds to Haskell's intercalate :: [a] -> [[a]] -> [a]."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "x"),+ Typing.typeParameterConstraints = []}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "sep"),+ Typing.parameterDescription = (Just "the separator list to insert"),+ Typing.parameterType = (Model.TypeList (Model.TypeVariable (Model.Name "x"))),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "xss"),+ Typing.parameterDescription = (Just "the list of lists to join"),+ Typing.parameterType = (Model.TypeList (Model.TypeList (Model.TypeVariable (Model.Name "x")))),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeList (Model.TypeVariable (Model.Name "x")))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++last :: Packaging.PrimitiveDefinition+last =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.lists.last"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Return the last element, or Nothing if the list is empty."),+ Packaging.entityMetadataComments = [+ "last(xs) returns Just(x) where x is the last element of xs, or Nothing if xs is empty.",+ "Total. Wraps Haskell's partial last in maybe."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "x"),+ Typing.typeParameterConstraints = []}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "xs"),+ Typing.parameterDescription = (Just "the list to take the last element of"),+ Typing.parameterType = (Model.TypeList (Model.TypeVariable (Model.Name "x"))),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeOptional (Model.TypeVariable (Model.Name "x")))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++length :: Packaging.PrimitiveDefinition+length =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.lists.length"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Return the length of a list."),+ Packaging.entityMetadataComments = [+ "length(xs) returns the number of elements in xs as an int32. Returns 0 for the empty list.",+ "Total on finite inputs; the int32 result overflows for lists longer than 2^31-1 elements.",+ "Corresponds to Haskell's length :: [a] -> Int (with narrowing to Int32)."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "x"),+ Typing.typeParameterConstraints = []}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "xs"),+ Typing.parameterDescription = (Just "the list to measure"),+ Typing.parameterType = (Model.TypeList (Model.TypeVariable (Model.Name "x"))),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeLiteral (Model.LiteralTypeInteger Model.IntegerTypeInt32))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++map :: Packaging.PrimitiveDefinition+map =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.lists.map"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Map a function over a list."),+ Packaging.entityMetadataComments = [+ "map(f, xs) returns the list of f(x) for each x in xs, in original order.",+ "Total. Corresponds to Haskell's map :: (a -> b) -> [a] -> [b] / fmap on lists."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "x"),+ Typing.typeParameterConstraints = []},+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "y"),+ Typing.typeParameterConstraints = []}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "f"),+ Typing.parameterDescription = (Just "the function to apply to each element"),+ Typing.parameterType = (Model.TypeFunction (Model.FunctionType {+ Model.functionTypeDomain = (Model.TypeVariable (Model.Name "x")),+ Model.functionTypeCodomain = (Model.TypeVariable (Model.Name "y"))})),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "xs"),+ Typing.parameterDescription = (Just "the list to map over"),+ Typing.parameterType = (Model.TypeList (Model.TypeVariable (Model.Name "x"))),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeList (Model.TypeVariable (Model.Name "y")))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++mapList :: Packaging.PrimitiveDefinition+mapList =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.lists.mapList"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Traverse a list in the list monad."),+ Packaging.entityMetadataComments = [+ "mapList(f, xs) returns all combinations obtainable by choosing one element from f(x) for each x in xs: each result list has the same length as xs, with its element at each position drawn from the corresponding f(x).",+ "Results appear in the lexicographic order of the choices, with the choice for the first element varying slowest. The number of results is the product of the lengths of the lists f(x); if f(x) is empty for any element, the result is the empty list; mapList(f, []) is singleton([]).",+ "Total on finite inputs. The list-monad instance of the traversal family."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "x"),+ Typing.typeParameterConstraints = []},+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "y"),+ Typing.typeParameterConstraints = []}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "f"),+ Typing.parameterDescription = (Just "the list-returning function to apply to each element"),+ Typing.parameterType = (Model.TypeFunction (Model.FunctionType {+ Model.functionTypeDomain = (Model.TypeVariable (Model.Name "x")),+ Model.functionTypeCodomain = (Model.TypeList (Model.TypeVariable (Model.Name "y")))})),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "xs"),+ Typing.parameterDescription = (Just "the list to traverse"),+ Typing.parameterType = (Model.TypeList (Model.TypeVariable (Model.Name "x"))),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeList (Model.TypeList (Model.TypeVariable (Model.Name "y"))))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++mapOptional :: Packaging.PrimitiveDefinition+mapOptional =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.lists.mapOptional"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Traverse an optional value in the list monad."),+ Packaging.entityMetadataComments = [+ "mapOptional(f, m) returns the single-element list containing none when m is none; for given(x) it returns given(y) for each element y of f(x), in order.",+ "Total on finite inputs. The list-monad instance of the traversal family, applied to the optional container."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "x"),+ Typing.typeParameterConstraints = []},+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "y"),+ Typing.typeParameterConstraints = []}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "f"),+ Typing.parameterDescription = (Just "the list-returning function to apply"),+ Typing.parameterType = (Model.TypeFunction (Model.FunctionType {+ Model.functionTypeDomain = (Model.TypeVariable (Model.Name "x")),+ Model.functionTypeCodomain = (Model.TypeList (Model.TypeVariable (Model.Name "y")))})),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "m"),+ Typing.parameterDescription = (Just "the optional value to traverse"),+ Typing.parameterType = (Model.TypeOptional (Model.TypeVariable (Model.Name "x"))),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeList (Model.TypeOptional (Model.TypeVariable (Model.Name "y"))))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++mapSet :: Packaging.PrimitiveDefinition+mapSet =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.lists.mapSet"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Traverse a set in the list monad."),+ Packaging.entityMetadataComments = [+ "mapSet(f, s) returns all sets obtainable by choosing one element from f(x) for each element x of s. Elements of s are traversed in ascending order, and results appear in the lexicographic order of the choices, with the choice for the least element varying slowest.",+ "A result set may have fewer elements than s when distinct choices coincide. If f(x) is empty for any element, the result is the empty list; for the empty set the result is the single-element list containing the empty set.",+ "Requires 'ordering' constraints on both element types (the set type contract)."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "x"),+ Typing.typeParameterConstraints = [+ Model.TypeClassConstraintSimple (Model.Name "ordering")]},+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "y"),+ Typing.typeParameterConstraints = [+ Model.TypeClassConstraintSimple (Model.Name "ordering")]}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "f"),+ Typing.parameterDescription = (Just "the list-returning function to apply to each element"),+ Typing.parameterType = (Model.TypeFunction (Model.FunctionType {+ Model.functionTypeDomain = (Model.TypeVariable (Model.Name "x")),+ Model.functionTypeCodomain = (Model.TypeList (Model.TypeVariable (Model.Name "y")))})),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "s"),+ Typing.parameterDescription = (Just "the set to traverse"),+ Typing.parameterType = (Model.TypeSet (Model.TypeVariable (Model.Name "x"))),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeList (Model.TypeSet (Model.TypeVariable (Model.Name "y"))))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++member :: Packaging.PrimitiveDefinition+member =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.lists.member"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Test whether an element is in a list."),+ Packaging.entityMetadataComments = [+ "member(x, xs) returns true iff some element of xs is equal to x.",+ "Requires an 'equality' constraint on the element type.",+ "Total. Corresponds to Haskell's elem :: Eq a => a -> [a] -> Bool."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "x"),+ Typing.typeParameterConstraints = [+ Model.TypeClassConstraintSimple (Model.Name "equality")]}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "x"),+ Typing.parameterDescription = (Just "the value to look for"),+ Typing.parameterType = (Model.TypeVariable (Model.Name "x")),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "xs"),+ Typing.parameterDescription = (Just "the list to search"),+ Typing.parameterType = (Model.TypeList (Model.TypeVariable (Model.Name "x"))),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeLiteral Model.LiteralTypeBoolean)}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++partition :: Packaging.PrimitiveDefinition+partition =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.lists.partition"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Partition a list into elements that satisfy a predicate and those that do not."),+ Packaging.entityMetadataComments = [+ "partition(p, xs) returns a pair (yes, no) where yes is the list of elements of xs for which p is true and no is the list of elements for which p is false, each preserving original order.",+ "Total. Corresponds to Haskell's partition :: (a -> Bool) -> [a] -> ([a], [a])."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "x"),+ Typing.typeParameterConstraints = []}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "p"),+ Typing.parameterDescription = (Just "the predicate to test each element"),+ Typing.parameterType = (Model.TypeFunction (Model.FunctionType {+ Model.functionTypeDomain = (Model.TypeVariable (Model.Name "x")),+ Model.functionTypeCodomain = (Model.TypeLiteral Model.LiteralTypeBoolean)})),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "xs"),+ Typing.parameterDescription = (Just "the list to partition"),+ Typing.parameterType = (Model.TypeList (Model.TypeVariable (Model.Name "x"))),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypePair (Model.PairType {+ Model.pairTypeFirst = (Model.TypeList (Model.TypeVariable (Model.Name "x"))),+ Model.pairTypeSecond = (Model.TypeList (Model.TypeVariable (Model.Name "x")))}))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = (Just (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "p"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "xs"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.lists.foldr")),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "x"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "acc"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.logic.ifElse")),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "p")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "x"))}))})),+ Model.applicationArgument = (Model.TermPair (+ Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.lists.cons")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "x"))})),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.pairs.first")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "acc"))}))}),+ (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.pairs.second")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "acc"))}))))})),+ Model.applicationArgument = (Model.TermPair (+ Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.pairs.first")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "acc"))}),+ (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.lists.cons")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "x"))})),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.pairs.second")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "acc"))}))}))))}))}))}))})),+ Model.applicationArgument = (Model.TermPair (Model.TermList [], (Model.TermList [])))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "xs"))}))}))})))}++replicate :: Packaging.PrimitiveDefinition+replicate =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.lists.replicate"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Build a list of n copies of a value."),+ Packaging.entityMetadataComments = [+ "replicate(n, x) returns a list of n copies of x; for n <= 0 the result is the empty list.",+ "Total. Corresponds to Haskell's replicate :: Int -> a -> [a]."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "x"),+ Typing.typeParameterConstraints = []}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "n"),+ Typing.parameterDescription = (Just "the number of copies"),+ Typing.parameterType = (Model.TypeLiteral (Model.LiteralTypeInteger Model.IntegerTypeInt32)),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "x"),+ Typing.parameterDescription = (Just "the value to replicate"),+ Typing.parameterType = (Model.TypeVariable (Model.Name "x")),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeList (Model.TypeVariable (Model.Name "x")))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++reverse :: Packaging.PrimitiveDefinition+reverse =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.lists.reverse"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Reverse a list."),+ Packaging.entityMetadataComments = [+ "reverse(xs) returns the elements of xs in reverse order.",+ "Total. Corresponds to Haskell's reverse :: [a] -> [a]."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "x"),+ Typing.typeParameterConstraints = []}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "xs"),+ Typing.parameterDescription = (Just "the list to reverse"),+ Typing.parameterType = (Model.TypeList (Model.TypeVariable (Model.Name "x"))),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeList (Model.TypeVariable (Model.Name "x")))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++singleton :: Packaging.PrimitiveDefinition+singleton =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.lists.singleton"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Construct a single-element list."),+ Packaging.entityMetadataComments = [+ "singleton(x) = [x].",+ "The constructor for a single-element list; useful point-free (e.g. map singleton xs).",+ "Total. Corresponds to Haskell's singleton :: a -> [a]."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "x"),+ Typing.typeParameterConstraints = []}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "x"),+ Typing.parameterDescription = (Just "the value to wrap in a single-element list"),+ Typing.parameterType = (Model.TypeVariable (Model.Name "x")),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeList (Model.TypeVariable (Model.Name "x")))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++sort :: Packaging.PrimitiveDefinition+sort =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.lists.sort"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Sort a list."),+ Packaging.entityMetadataComments = [+ "sort(xs) returns xs sorted in ascending order under the element type's ordering. Sort is stable: equal elements preserve their original relative order.",+ "Requires an 'ordering' constraint on the element type.",+ "Total. Corresponds to Haskell's Data.List.sort :: Ord a => [a] -> [a]."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "x"),+ Typing.typeParameterConstraints = [+ Model.TypeClassConstraintSimple (Model.Name "ordering")]}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "xs"),+ Typing.parameterDescription = (Just "the list to sort"),+ Typing.parameterType = (Model.TypeList (Model.TypeVariable (Model.Name "x"))),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeList (Model.TypeVariable (Model.Name "x")))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++sortBy :: Packaging.PrimitiveDefinition+sortBy =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.lists.sortBy"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Sort a list using a key-extraction function."),+ Packaging.entityMetadataComments = [+ "sortBy(f, xs) returns xs sorted in ascending order by f(x) for each element x. Sort is stable: elements with equal keys preserve their original relative order.",+ "Requires an 'ordering' constraint on the key type.",+ "Total. Corresponds to Haskell's Data.List.sortOn :: Ord b => (a -> b) -> [a] -> [a]."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "x"),+ Typing.typeParameterConstraints = []},+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "y"),+ Typing.typeParameterConstraints = [+ Model.TypeClassConstraintSimple (Model.Name "ordering")]}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "f"),+ Typing.parameterDescription = (Just "the key-extraction function"),+ Typing.parameterType = (Model.TypeFunction (Model.FunctionType {+ Model.functionTypeDomain = (Model.TypeVariable (Model.Name "x")),+ Model.functionTypeCodomain = (Model.TypeVariable (Model.Name "y"))})),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "xs"),+ Typing.parameterDescription = (Just "the list to sort"),+ Typing.parameterType = (Model.TypeList (Model.TypeVariable (Model.Name "x"))),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeList (Model.TypeVariable (Model.Name "x")))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++span :: Packaging.PrimitiveDefinition+span =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.lists.span"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Split a list at the first element where the predicate fails."),+ Packaging.entityMetadataComments = [+ "span(p, xs) returns a pair (ys, zs) where ys is the longest prefix of xs whose elements all satisfy p, and zs is the remainder of xs starting at the first element that fails p (or zs is empty if all elements satisfy p).",+ "Total. Corresponds to Haskell's span :: (a -> Bool) -> [a] -> ([a], [a])."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "x"),+ Typing.typeParameterConstraints = []}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "p"),+ Typing.parameterDescription = (Just "the predicate to test each element"),+ Typing.parameterType = (Model.TypeFunction (Model.FunctionType {+ Model.functionTypeDomain = (Model.TypeVariable (Model.Name "x")),+ Model.functionTypeCodomain = (Model.TypeLiteral Model.LiteralTypeBoolean)})),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "xs"),+ Typing.parameterDescription = (Just "the list to split"),+ Typing.parameterType = (Model.TypeList (Model.TypeVariable (Model.Name "x"))),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypePair (Model.PairType {+ Model.pairTypeFirst = (Model.TypeList (Model.TypeVariable (Model.Name "x"))),+ Model.pairTypeSecond = (Model.TypeList (Model.TypeVariable (Model.Name "x")))}))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = (Just (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "p"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "xs"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.lists.foldl")),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "acc"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "x"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.logic.ifElse")),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.logic.and")),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.lists.isEmpty")),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.pairs.second")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "acc"))}))}))})),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "p")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "x"))}))}))})),+ Model.applicationArgument = (Model.TermPair (+ Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.lists.concat2")),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.pairs.first")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "acc"))}))})),+ Model.applicationArgument = (Model.TermList [+ Model.TermVariable (Model.Name "x")])}),+ (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.pairs.second")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "acc"))}))))})),+ Model.applicationArgument = (Model.TermPair (+ Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.pairs.first")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "acc"))}),+ (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.lists.concat2")),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.pairs.second")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "acc"))}))})),+ Model.applicationArgument = (Model.TermList [+ Model.TermVariable (Model.Name "x")])}))))}))}))}))})),+ Model.applicationArgument = (Model.TermPair (Model.TermList [], (Model.TermList [])))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "xs"))}))}))})))}++tail :: Packaging.PrimitiveDefinition+tail =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.lists.tail"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Return all elements except the first, or Nothing if the list is empty."),+ Packaging.entityMetadataComments = [+ "tail(xs) returns Just(ys) where ys is xs with its first element removed, or Nothing if xs is empty.",+ "Total. Wraps Haskell's partial tail in maybe."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "x"),+ Typing.typeParameterConstraints = []}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "xs"),+ Typing.parameterDescription = (Just "the list to take the tail of"),+ Typing.parameterType = (Model.TypeList (Model.TypeVariable (Model.Name "x"))),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeOptional (Model.TypeList (Model.TypeVariable (Model.Name "x"))))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++take :: Packaging.PrimitiveDefinition+take =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.lists.take"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Take the first n elements of a list."),+ Packaging.entityMetadataComments = [+ "take(n, xs) returns the prefix of xs of length min(n, length(xs)); if n is non-positive the result is the empty list.",+ "Total. Corresponds to Haskell's take :: Int -> [a] -> [a]."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "x"),+ Typing.typeParameterConstraints = []}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "n"),+ Typing.parameterDescription = (Just "the number of elements to take"),+ Typing.parameterType = (Model.TypeLiteral (Model.LiteralTypeInteger Model.IntegerTypeInt32)),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "xs"),+ Typing.parameterDescription = (Just "the list to take from"),+ Typing.parameterType = (Model.TypeList (Model.TypeVariable (Model.Name "x"))),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeList (Model.TypeVariable (Model.Name "x")))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++takeWhile :: Packaging.PrimitiveDefinition+takeWhile =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.lists.takeWhile"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Take elements from the beginning of a list while a predicate holds."),+ Packaging.entityMetadataComments = [+ "takeWhile(p, xs) returns the longest prefix of xs whose elements all satisfy p. If p fails for the first element the result is the empty list; if p holds for every element the result is xs unchanged.",+ "dropWhile returns the complementary suffix, and span(p, xs) returns the pair of takeWhile(p, xs) and dropWhile(p, xs).",+ "Total. Corresponds to Haskell's takeWhile :: (a -> Bool) -> [a] -> [a]."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "x"),+ Typing.typeParameterConstraints = []}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "p"),+ Typing.parameterDescription = (Just "the predicate to test each element"),+ Typing.parameterType = (Model.TypeFunction (Model.FunctionType {+ Model.functionTypeDomain = (Model.TypeVariable (Model.Name "x")),+ Model.functionTypeCodomain = (Model.TypeLiteral Model.LiteralTypeBoolean)})),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "xs"),+ Typing.parameterDescription = (Just "the list to take from"),+ Typing.parameterType = (Model.TypeList (Model.TypeVariable (Model.Name "x"))),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeList (Model.TypeVariable (Model.Name "x")))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = (Just (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "p"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "xs"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.pairs.first")),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.lists.span")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "p"))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "xs"))}))}))}))})))}++transpose :: Packaging.PrimitiveDefinition+transpose =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.lists.transpose"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Transpose a list of lists."),+ Packaging.entityMetadataComments = [+ "transpose(xss) returns a list of lists where the i-th inner list contains the i-th element of every inner list of xss that has at least i+1 elements. Inner lists of differing lengths produce a ragged result rather than an error.",+ "Total. Corresponds to Haskell's Data.List.transpose :: [[a]] -> [[a]]."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "x"),+ Typing.typeParameterConstraints = []}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "xss"),+ Typing.parameterDescription = (Just "the list of lists to transpose"),+ Typing.parameterType = (Model.TypeList (Model.TypeList (Model.TypeVariable (Model.Name "x")))),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeList (Model.TypeList (Model.TypeVariable (Model.Name "x"))))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++uncons :: Packaging.PrimitiveDefinition+uncons =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.lists.uncons"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Decompose a list into its head and tail, or Nothing if empty."),+ Packaging.entityMetadataComments = [+ "uncons(xs) returns Just(head, tail) where head is the first element of xs and tail is the remaining list, or Nothing if xs is empty.",+ "Total. Corresponds to Haskell's Data.List.uncons :: [a] -> Maybe (a, [a])."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "x"),+ Typing.typeParameterConstraints = []}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "xs"),+ Typing.parameterDescription = (Just "the list to decompose"),+ Typing.parameterType = (Model.TypeList (Model.TypeVariable (Model.Name "x"))),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeOptional (Model.TypePair (Model.PairType {+ Model.pairTypeFirst = (Model.TypeVariable (Model.Name "x")),+ Model.pairTypeSecond = (Model.TypeList (Model.TypeVariable (Model.Name "x")))})))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++zip :: Packaging.PrimitiveDefinition+zip =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.lists.zip"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Zip two lists element-wise into pairs."),+ Packaging.entityMetadataComments = [+ "zip(xs, ys) returns the list of pairs (xs[i], ys[i]) for i from 0 to min(length(xs), length(ys))-1. The result has length equal to the shorter of the two inputs.",+ "Total. Corresponds to Haskell's zip :: [a] -> [b] -> [(a, b)]."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "x"),+ Typing.typeParameterConstraints = []},+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "y"),+ Typing.typeParameterConstraints = []}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "xs"),+ Typing.parameterDescription = (Just "the first list"),+ Typing.parameterType = (Model.TypeList (Model.TypeVariable (Model.Name "x"))),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "ys"),+ Typing.parameterDescription = (Just "the second list"),+ Typing.parameterType = (Model.TypeList (Model.TypeVariable (Model.Name "y"))),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeList (Model.TypePair (Model.PairType {+ Model.pairTypeFirst = (Model.TypeVariable (Model.Name "x")),+ Model.pairTypeSecond = (Model.TypeVariable (Model.Name "y"))})))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++zipWith :: Packaging.PrimitiveDefinition+zipWith =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.lists.zipWith"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Zip two lists with a combining function."),+ Packaging.entityMetadataComments = [+ "zipWith(f, xs, ys) returns the list of f(xs[i], ys[i]) for i from 0 to min(length(xs), length(ys))-1. The result has length equal to the shorter of the two inputs.",+ "Total. Corresponds to Haskell's zipWith :: (a -> b -> c) -> [a] -> [b] -> [c]."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "x"),+ Typing.typeParameterConstraints = []},+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "y"),+ Typing.typeParameterConstraints = []},+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "z"),+ Typing.typeParameterConstraints = []}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "f"),+ Typing.parameterDescription = (Just "the combining function"),+ Typing.parameterType = (Model.TypeFunction (Model.FunctionType {+ Model.functionTypeDomain = (Model.TypeVariable (Model.Name "x")),+ Model.functionTypeCodomain = (Model.TypeFunction (Model.FunctionType {+ Model.functionTypeDomain = (Model.TypeVariable (Model.Name "y")),+ Model.functionTypeCodomain = (Model.TypeVariable (Model.Name "z"))}))})),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "xs"),+ Typing.parameterDescription = (Just "the first list"),+ Typing.parameterType = (Model.TypeList (Model.TypeVariable (Model.Name "x"))),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "ys"),+ Typing.parameterDescription = (Just "the second list"),+ Typing.parameterType = (Model.TypeList (Model.TypeVariable (Model.Name "y"))),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeList (Model.TypeVariable (Model.Name "z")))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}
@@ -0,0 +1,1530 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Primitives in the hydra.core.lib.literals module.++module Hydra.Core.Lib.Literals where++import qualified Hydra.Core.Ast as Ast+import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Diff as Diff+import qualified Hydra.Core.Docs as Docs+import qualified Hydra.Core.Error.Checking as Checking+import qualified Hydra.Core.Error.File as ErrorFile+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Error.Packaging as ErrorPackaging+import qualified Hydra.Core.Error.System as ErrorSystem+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Json.Model as JsonModel+import qualified Hydra.Core.Markdown as Markdown+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Parsing as Parsing+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Query as Query+import qualified Hydra.Core.Regex as Regex+import qualified Hydra.Core.Relational as Relational+import qualified Hydra.Core.System as System+import qualified Hydra.Core.Tabular as Tabular+import qualified Hydra.Core.Testing as Testing+import qualified Hydra.Core.Time as Time+import qualified Hydra.Core.Topology as Topology+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Validation as Validation+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++base64ToBinary :: Packaging.PrimitiveDefinition+base64ToBinary =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.literals.base64ToBinary"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Decode a base64 ASCII string to binary data."),+ Packaging.entityMetadataComments = [+ "base64ToBinary(s) decodes the standard base64 (RFC 4648) ASCII string s and returns the resulting bytes as binary data.",+ "Inverse of binaryToBase64: base64ToBinary(binaryToBase64(b)) is b for every binary value. Behavior on strings which are not valid base64 is host-defined."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "s"),+ Typing.parameterDescription = (Just "the base64 string to decode"),+ Typing.parameterType = (Model.TypeLiteral Model.LiteralTypeString),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeLiteral Model.LiteralTypeBinary)}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++bigintToDecimal :: Packaging.PrimitiveDefinition+bigintToDecimal =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.literals.bigintToDecimal"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Convert a bigint to a decimal."),+ Packaging.entityMetadataComments = [+ "bigintToDecimal(x) returns the exact decimal representation of x. Since decimal is arbitrary-precision and bigint is also arbitrary-precision, the conversion is lossless.",+ "Total."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "x"),+ Typing.parameterDescription = (Just "the bigint to convert"),+ Typing.parameterType = (Model.TypeLiteral (Model.LiteralTypeInteger Model.IntegerTypeBigint)),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeLiteral Model.LiteralTypeDecimal)}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++bigintToInt16 :: Packaging.PrimitiveDefinition+bigintToInt16 =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.literals.bigintToInt16"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Convert a bigint to an int16 (truncating)."),+ Packaging.entityMetadataComments = [+ "bigintToInt16(x) returns x reduced modulo 2^16 and reinterpreted as a signed two's-complement int16. Values outside [-2^15, 2^15-1] wrap silently with no exception.",+ "Total."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "x"),+ Typing.parameterDescription = (Just "the bigint to convert"),+ Typing.parameterType = (Model.TypeLiteral (Model.LiteralTypeInteger Model.IntegerTypeBigint)),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeLiteral (Model.LiteralTypeInteger Model.IntegerTypeInt16))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++bigintToInt32 :: Packaging.PrimitiveDefinition+bigintToInt32 =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.literals.bigintToInt32"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Convert a bigint to an int32 (truncating)."),+ Packaging.entityMetadataComments = [+ "bigintToInt32(x) returns x reduced modulo 2^32 and reinterpreted as a signed two's-complement int32. Values outside [-2^31, 2^31-1] wrap silently with no exception.",+ "Total."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "x"),+ Typing.parameterDescription = (Just "the bigint to convert"),+ Typing.parameterType = (Model.TypeLiteral (Model.LiteralTypeInteger Model.IntegerTypeBigint)),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeLiteral (Model.LiteralTypeInteger Model.IntegerTypeInt32))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++bigintToInt64 :: Packaging.PrimitiveDefinition+bigintToInt64 =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.literals.bigintToInt64"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Convert a bigint to an int64 (truncating)."),+ Packaging.entityMetadataComments = [+ "bigintToInt64(x) returns x reduced modulo 2^64 and reinterpreted as a signed two's-complement int64. Values outside [-2^63, 2^63-1] wrap silently with no exception.",+ "Total."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "x"),+ Typing.parameterDescription = (Just "the bigint to convert"),+ Typing.parameterType = (Model.TypeLiteral (Model.LiteralTypeInteger Model.IntegerTypeBigint)),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeLiteral (Model.LiteralTypeInteger Model.IntegerTypeInt64))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++bigintToInt8 :: Packaging.PrimitiveDefinition+bigintToInt8 =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.literals.bigintToInt8"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Convert a bigint to an int8 (truncating)."),+ Packaging.entityMetadataComments = [+ "bigintToInt8(x) returns x reduced modulo 2^8 and reinterpreted as a signed two's-complement int8. Values outside [-128, 127] wrap silently with no exception.",+ "Total."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "x"),+ Typing.parameterDescription = (Just "the bigint to convert"),+ Typing.parameterType = (Model.TypeLiteral (Model.LiteralTypeInteger Model.IntegerTypeBigint)),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeLiteral (Model.LiteralTypeInteger Model.IntegerTypeInt8))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++bigintToUint16 :: Packaging.PrimitiveDefinition+bigintToUint16 =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.literals.bigintToUint16"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Convert a bigint to a uint16 (truncating)."),+ Packaging.entityMetadataComments = [+ "bigintToUint16(x) returns x reduced modulo 2^16 as an unsigned uint16. Values outside [0, 2^16-1] wrap silently with no exception.",+ "Total."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "x"),+ Typing.parameterDescription = (Just "the bigint to convert"),+ Typing.parameterType = (Model.TypeLiteral (Model.LiteralTypeInteger Model.IntegerTypeBigint)),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeLiteral (Model.LiteralTypeInteger Model.IntegerTypeUint16))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++bigintToUint32 :: Packaging.PrimitiveDefinition+bigintToUint32 =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.literals.bigintToUint32"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Convert a bigint to a uint32 (truncating)."),+ Packaging.entityMetadataComments = [+ "bigintToUint32(x) returns x reduced modulo 2^32 as an unsigned uint32. Values outside [0, 2^32-1] wrap silently with no exception.",+ "Total."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "x"),+ Typing.parameterDescription = (Just "the bigint to convert"),+ Typing.parameterType = (Model.TypeLiteral (Model.LiteralTypeInteger Model.IntegerTypeBigint)),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeLiteral (Model.LiteralTypeInteger Model.IntegerTypeUint32))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++bigintToUint64 :: Packaging.PrimitiveDefinition+bigintToUint64 =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.literals.bigintToUint64"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Convert a bigint to a uint64 (truncating)."),+ Packaging.entityMetadataComments = [+ "bigintToUint64(x) returns x reduced modulo 2^64 as an unsigned uint64. Values outside [0, 2^64-1] wrap silently with no exception.",+ "Total."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "x"),+ Typing.parameterDescription = (Just "the bigint to convert"),+ Typing.parameterType = (Model.TypeLiteral (Model.LiteralTypeInteger Model.IntegerTypeBigint)),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeLiteral (Model.LiteralTypeInteger Model.IntegerTypeUint64))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++bigintToUint8 :: Packaging.PrimitiveDefinition+bigintToUint8 =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.literals.bigintToUint8"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Convert a bigint to a uint8 (truncating)."),+ Packaging.entityMetadataComments = [+ "bigintToUint8(x) returns x reduced modulo 2^8 as an unsigned uint8. Values outside [0, 255] wrap silently with no exception.",+ "Total."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "x"),+ Typing.parameterDescription = (Just "the bigint to convert"),+ Typing.parameterType = (Model.TypeLiteral (Model.LiteralTypeInteger Model.IntegerTypeBigint)),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeLiteral (Model.LiteralTypeInteger Model.IntegerTypeUint8))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++binaryToBase64 :: Packaging.PrimitiveDefinition+binaryToBase64 =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.literals.binaryToBase64"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Encode binary data as a base64 ASCII string."),+ Packaging.entityMetadataComments = [+ "binaryToBase64(b) encodes the bytes of b using standard base64 (RFC 4648) and returns the result as an ASCII string.",+ "Total and round-trippable: base64ToBinary(binaryToBase64(b)) is b for every binary value. Use this to embed arbitrary binary data in a string context (e.g. a JSON value). For interpreting bytes as text, use hydra.core.lib.text.decodeUtf8 instead."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "b"),+ Typing.parameterDescription = (Just "the binary data to encode"),+ Typing.parameterType = (Model.TypeLiteral Model.LiteralTypeBinary),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeLiteral Model.LiteralTypeString)}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++binaryToBytes :: Packaging.PrimitiveDefinition+binaryToBytes =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.literals.binaryToBytes"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Convert binary data to a list of byte values."),+ Packaging.entityMetadataComments = [+ "binaryToBytes(b) returns the bytes of b as an int32 list with values in [0, 255], preserving byte order.",+ "The result list element type is int32 rather than uint8 because Hydra's primitive collections work most naturally with int32 indices.",+ "Total."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "b"),+ Typing.parameterDescription = (Just "the binary data to convert"),+ Typing.parameterType = (Model.TypeLiteral Model.LiteralTypeBinary),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeList (Model.TypeLiteral (Model.LiteralTypeInteger Model.IntegerTypeInt32)))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++decimalToBigint :: Packaging.PrimitiveDefinition+decimalToBigint =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.literals.decimalToBigint"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Convert a decimal to a bigint (truncating)."),+ Packaging.entityMetadataComments = [+ "decimalToBigint(x) returns x truncated toward zero. Fractional parts are discarded.",+ "Total."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "x"),+ Typing.parameterDescription = (Just "the decimal to convert"),+ Typing.parameterType = (Model.TypeLiteral Model.LiteralTypeDecimal),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeLiteral (Model.LiteralTypeInteger Model.IntegerTypeBigint))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++decimalToFloat32 :: Packaging.PrimitiveDefinition+decimalToFloat32 =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.literals.decimalToFloat32"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Convert a decimal to a float32."),+ Packaging.entityMetadataComments = [+ "decimalToFloat32(x) returns the IEEE 754 binary32 value closest to x under roundTiesToEven. Values outside the float32 representable range overflow to \177\8734. Subnormal precision loss is silent.",+ "Total."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "x"),+ Typing.parameterDescription = (Just "the decimal to convert"),+ Typing.parameterType = (Model.TypeLiteral Model.LiteralTypeDecimal),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeLiteral (Model.LiteralTypeFloat Model.FloatTypeFloat32))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++decimalToFloat64 :: Packaging.PrimitiveDefinition+decimalToFloat64 =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.literals.decimalToFloat64"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Convert a decimal to a float64."),+ Packaging.entityMetadataComments = [+ "decimalToFloat64(x) returns the IEEE 754 binary64 value closest to x under roundTiesToEven. Values outside the float64 representable range overflow to \177\8734. Subnormal precision loss is silent.",+ "Total."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "x"),+ Typing.parameterDescription = (Just "the decimal to convert"),+ Typing.parameterType = (Model.TypeLiteral Model.LiteralTypeDecimal),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeLiteral (Model.LiteralTypeFloat Model.FloatTypeFloat64))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++float32ToDecimal :: Packaging.PrimitiveDefinition+float32ToDecimal =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.literals.float32ToDecimal"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Convert a float32 to a decimal."),+ Packaging.entityMetadataComments = [+ "float32ToDecimal(x) returns the exact decimal representation of the binary32 value x. Special float32 values (\177\8734, NaN) have a host-defined decimal representation; finite values convert exactly since binary32 values are dyadic rationals.",+ "Total."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "x"),+ Typing.parameterDescription = (Just "the float32 to convert"),+ Typing.parameterType = (Model.TypeLiteral (Model.LiteralTypeFloat Model.FloatTypeFloat32)),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeLiteral Model.LiteralTypeDecimal)}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++float32ToFloat64 :: Packaging.PrimitiveDefinition+float32ToFloat64 =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.literals.float32ToFloat64"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Convert a float32 to a float64."),+ Packaging.entityMetadataComments = [+ "float32ToFloat64(x) returns the binary64 value with the same numeric value as x; \177\8734 and NaN pass through. The conversion is exact and lossless.",+ "Total."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "x"),+ Typing.parameterDescription = (Just "the float32 to convert"),+ Typing.parameterType = (Model.TypeLiteral (Model.LiteralTypeFloat Model.FloatTypeFloat32)),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeLiteral (Model.LiteralTypeFloat Model.FloatTypeFloat64))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++float64ToDecimal :: Packaging.PrimitiveDefinition+float64ToDecimal =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.literals.float64ToDecimal"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Convert a float64 to a decimal."),+ Packaging.entityMetadataComments = [+ "float64ToDecimal(x) returns the exact decimal representation of the binary64 value x. Special float64 values (\177\8734, NaN) have a host-defined decimal representation; finite values convert exactly since binary64 values are dyadic rationals.",+ "Total."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "x"),+ Typing.parameterDescription = (Just "the float64 to convert"),+ Typing.parameterType = (Model.TypeLiteral (Model.LiteralTypeFloat Model.FloatTypeFloat64)),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeLiteral Model.LiteralTypeDecimal)}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++float64ToFloat32 :: Packaging.PrimitiveDefinition+float64ToFloat32 =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.literals.float64ToFloat32"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Convert a float64 to a float32 (lossy)."),+ Packaging.entityMetadataComments = [+ "float64ToFloat32(x) returns the binary32 value closest to x under roundTiesToEven. Values outside the binary32 range overflow to \177\8734; subnormal precision loss is silent; NaN payload may be canonicalized by the host.",+ "Total."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "x"),+ Typing.parameterDescription = (Just "the float64 to convert"),+ Typing.parameterType = (Model.TypeLiteral (Model.LiteralTypeFloat Model.FloatTypeFloat64)),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeLiteral (Model.LiteralTypeFloat Model.FloatTypeFloat32))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++int16ToBigint :: Packaging.PrimitiveDefinition+int16ToBigint =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.literals.int16ToBigint"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Convert an int16 to a bigint."),+ Packaging.entityMetadataComments = [+ "int16ToBigint(x) returns the bigint with the same numeric value as x. The conversion is exact and lossless.",+ "Total."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "x"),+ Typing.parameterDescription = (Just "the int16 to convert"),+ Typing.parameterType = (Model.TypeLiteral (Model.LiteralTypeInteger Model.IntegerTypeInt16)),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeLiteral (Model.LiteralTypeInteger Model.IntegerTypeBigint))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++int32ToBigint :: Packaging.PrimitiveDefinition+int32ToBigint =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.literals.int32ToBigint"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Convert an int32 to a bigint."),+ Packaging.entityMetadataComments = [+ "int32ToBigint(x) returns the bigint with the same numeric value as x. The conversion is exact and lossless.",+ "Total."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "x"),+ Typing.parameterDescription = (Just "the int32 to convert"),+ Typing.parameterType = (Model.TypeLiteral (Model.LiteralTypeInteger Model.IntegerTypeInt32)),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeLiteral (Model.LiteralTypeInteger Model.IntegerTypeBigint))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++int64ToBigint :: Packaging.PrimitiveDefinition+int64ToBigint =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.literals.int64ToBigint"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Convert an int64 to a bigint."),+ Packaging.entityMetadataComments = [+ "int64ToBigint(x) returns the bigint with the same numeric value as x. The conversion is exact and lossless.",+ "Total."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "x"),+ Typing.parameterDescription = (Just "the int64 to convert"),+ Typing.parameterType = (Model.TypeLiteral (Model.LiteralTypeInteger Model.IntegerTypeInt64)),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeLiteral (Model.LiteralTypeInteger Model.IntegerTypeBigint))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++int8ToBigint :: Packaging.PrimitiveDefinition+int8ToBigint =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.literals.int8ToBigint"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Convert an int8 to a bigint."),+ Packaging.entityMetadataComments = [+ "int8ToBigint(x) returns the bigint with the same numeric value as x. The conversion is exact and lossless.",+ "Total."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "x"),+ Typing.parameterDescription = (Just "the int8 to convert"),+ Typing.parameterType = (Model.TypeLiteral (Model.LiteralTypeInteger Model.IntegerTypeInt8)),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeLiteral (Model.LiteralTypeInteger Model.IntegerTypeBigint))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++parseBigint :: Packaging.PrimitiveDefinition+parseBigint =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.literals.parseBigint"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Parse a string as a bigint."),+ Packaging.entityMetadataComments = [+ "parseBigint(s) returns Just(x) where x is the bigint parsed from s, or Nothing if s is not a valid bigint literal.",+ "Accepted syntax follows the Haskell Show/Read convention: an optional leading minus sign followed by a sequence of decimal digits. Whitespace is not stripped; leading or trailing whitespace causes parse failure.",+ "Total."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "s"),+ Typing.parameterDescription = (Just "the string to parse"),+ Typing.parameterType = (Model.TypeLiteral Model.LiteralTypeString),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeOptional (Model.TypeLiteral (Model.LiteralTypeInteger Model.IntegerTypeBigint)))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++parseBoolean :: Packaging.PrimitiveDefinition+parseBoolean =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.literals.parseBoolean"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Parse a string as a boolean."),+ Packaging.entityMetadataComments = [+ "parseBoolean(s) returns Just(true) for \"true\", Just(false) for \"false\", and Nothing for any other input (including \"True\"/\"False\" with capital initial letter on some hosts; behavior on capitalized forms is host-defined and should not be relied upon).",+ "Total."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "s"),+ Typing.parameterDescription = (Just "the string to parse"),+ Typing.parameterType = (Model.TypeLiteral Model.LiteralTypeString),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeOptional (Model.TypeLiteral Model.LiteralTypeBoolean))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++parseDecimal :: Packaging.PrimitiveDefinition+parseDecimal =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.literals.parseDecimal"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Parse a string as a decimal."),+ Packaging.entityMetadataComments = [+ "parseDecimal(s) returns Just(x) where x is the decimal parsed from s, or Nothing on parse failure.",+ "Accepted syntax is the standard decimal literal: an optional sign, an integer part, an optional fractional part, and an optional exponent (e.g. -1.5, 2e10, 0.0).",+ "Total."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "s"),+ Typing.parameterDescription = (Just "the string to parse"),+ Typing.parameterType = (Model.TypeLiteral Model.LiteralTypeString),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeOptional (Model.TypeLiteral Model.LiteralTypeDecimal))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++parseFloat32 :: Packaging.PrimitiveDefinition+parseFloat32 =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.literals.parseFloat32"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Parse a string as a float32."),+ Packaging.entityMetadataComments = [+ "parseFloat32(s) returns Just(x) where x is the IEEE 754 binary32 value closest to the number parsed from s under roundTiesToEven, or Nothing on parse failure.",+ "Accepted special-value literals (\"NaN\", \"Infinity\", \"-Infinity\", etc.) and their capitalization are host-defined.",+ "Total."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "s"),+ Typing.parameterDescription = (Just "the string to parse"),+ Typing.parameterType = (Model.TypeLiteral Model.LiteralTypeString),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeOptional (Model.TypeLiteral (Model.LiteralTypeFloat Model.FloatTypeFloat32)))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++parseFloat64 :: Packaging.PrimitiveDefinition+parseFloat64 =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.literals.parseFloat64"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Parse a string as a float64."),+ Packaging.entityMetadataComments = [+ "parseFloat64(s) returns Just(x) where x is the IEEE 754 binary64 value closest to the number parsed from s under roundTiesToEven, or Nothing on parse failure.",+ "Accepted special-value literals (\"NaN\", \"Infinity\", \"-Infinity\", etc.) and their capitalization are host-defined.",+ "Total."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "s"),+ Typing.parameterDescription = (Just "the string to parse"),+ Typing.parameterType = (Model.TypeLiteral Model.LiteralTypeString),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeOptional (Model.TypeLiteral (Model.LiteralTypeFloat Model.FloatTypeFloat64)))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++parseInt16 :: Packaging.PrimitiveDefinition+parseInt16 =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.literals.parseInt16"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Parse a string as an int16."),+ Packaging.entityMetadataComments = [+ "parseInt16(s) returns Just(x) where x is the int16 parsed from s, or Nothing if s is not a valid integer literal or the parsed value is outside [-2^15, 2^15-1].",+ "Total."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "s"),+ Typing.parameterDescription = (Just "the string to parse"),+ Typing.parameterType = (Model.TypeLiteral Model.LiteralTypeString),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeOptional (Model.TypeLiteral (Model.LiteralTypeInteger Model.IntegerTypeInt16)))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++parseInt32 :: Packaging.PrimitiveDefinition+parseInt32 =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.literals.parseInt32"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Parse a string as an int32."),+ Packaging.entityMetadataComments = [+ "parseInt32(s) returns Just(x) where x is the int32 parsed from s, or Nothing if s is not a valid integer literal or the parsed value is outside [-2^31, 2^31-1].",+ "Total."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "s"),+ Typing.parameterDescription = (Just "the string to parse"),+ Typing.parameterType = (Model.TypeLiteral Model.LiteralTypeString),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeOptional (Model.TypeLiteral (Model.LiteralTypeInteger Model.IntegerTypeInt32)))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++parseInt64 :: Packaging.PrimitiveDefinition+parseInt64 =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.literals.parseInt64"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Parse a string as an int64."),+ Packaging.entityMetadataComments = [+ "parseInt64(s) returns Just(x) where x is the int64 parsed from s, or Nothing if s is not a valid integer literal or the parsed value is outside [-2^63, 2^63-1].",+ "Total."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "s"),+ Typing.parameterDescription = (Just "the string to parse"),+ Typing.parameterType = (Model.TypeLiteral Model.LiteralTypeString),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeOptional (Model.TypeLiteral (Model.LiteralTypeInteger Model.IntegerTypeInt64)))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++parseInt8 :: Packaging.PrimitiveDefinition+parseInt8 =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.literals.parseInt8"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Parse a string as an int8."),+ Packaging.entityMetadataComments = [+ "parseInt8(s) returns Just(x) where x is the int8 parsed from s, or Nothing if s is not a valid integer literal or the parsed value is outside [-128, 127].",+ "Total."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "s"),+ Typing.parameterDescription = (Just "the string to parse"),+ Typing.parameterType = (Model.TypeLiteral Model.LiteralTypeString),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeOptional (Model.TypeLiteral (Model.LiteralTypeInteger Model.IntegerTypeInt8)))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++parseString :: Packaging.PrimitiveDefinition+parseString =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.literals.parseString"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Parse a string-literal token to a plain string (Just) or Nothing on parse failure."),+ Packaging.entityMetadataComments = [+ "parseString(s) parses s as a Haskell-syntax string literal token: an opening double-quote, escaped characters per the Haskell lexical grammar (backslash escapes for special characters and Unicode code points), and a closing double-quote. Returns Just of the decoded payload on success or Nothing on malformed input.",+ "Total. The inverse of printString."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "s"),+ Typing.parameterDescription = (Just "the string-literal token to parse"),+ Typing.parameterType = (Model.TypeLiteral Model.LiteralTypeString),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeOptional (Model.TypeLiteral Model.LiteralTypeString))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++parseUint16 :: Packaging.PrimitiveDefinition+parseUint16 =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.literals.parseUint16"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Parse a string as a uint16."),+ Packaging.entityMetadataComments = [+ "parseUint16(s) returns Just(x) where x is the uint16 parsed from s, or Nothing if s is not a valid non-negative integer literal or the parsed value is outside [0, 2^16-1].",+ "Total."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "s"),+ Typing.parameterDescription = (Just "the string to parse"),+ Typing.parameterType = (Model.TypeLiteral Model.LiteralTypeString),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeOptional (Model.TypeLiteral (Model.LiteralTypeInteger Model.IntegerTypeUint16)))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++parseUint32 :: Packaging.PrimitiveDefinition+parseUint32 =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.literals.parseUint32"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Parse a string as a uint32."),+ Packaging.entityMetadataComments = [+ "parseUint32(s) returns Just(x) where x is the uint32 parsed from s, or Nothing if s is not a valid non-negative integer literal or the parsed value is outside [0, 2^32-1].",+ "Total."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "s"),+ Typing.parameterDescription = (Just "the string to parse"),+ Typing.parameterType = (Model.TypeLiteral Model.LiteralTypeString),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeOptional (Model.TypeLiteral (Model.LiteralTypeInteger Model.IntegerTypeUint32)))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++parseUint64 :: Packaging.PrimitiveDefinition+parseUint64 =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.literals.parseUint64"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Parse a string as a uint64."),+ Packaging.entityMetadataComments = [+ "parseUint64(s) returns Just(x) where x is the uint64 parsed from s, or Nothing if s is not a valid non-negative integer literal or the parsed value is outside [0, 2^64-1].",+ "Total."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "s"),+ Typing.parameterDescription = (Just "the string to parse"),+ Typing.parameterType = (Model.TypeLiteral Model.LiteralTypeString),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeOptional (Model.TypeLiteral (Model.LiteralTypeInteger Model.IntegerTypeUint64)))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++parseUint8 :: Packaging.PrimitiveDefinition+parseUint8 =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.literals.parseUint8"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Parse a string as a uint8."),+ Packaging.entityMetadataComments = [+ "parseUint8(s) returns Just(x) where x is the uint8 parsed from s, or Nothing if s is not a valid non-negative integer literal or the parsed value is outside [0, 255].",+ "Total."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "s"),+ Typing.parameterDescription = (Just "the string to parse"),+ Typing.parameterType = (Model.TypeLiteral Model.LiteralTypeString),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeOptional (Model.TypeLiteral (Model.LiteralTypeInteger Model.IntegerTypeUint8)))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++printBigint :: Packaging.PrimitiveDefinition+printBigint =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.literals.printBigint"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Render a bigint as a string."),+ Packaging.entityMetadataComments = [+ "printBigint(x) returns the canonical decimal representation of x: an optional leading minus sign followed by decimal digits. No leading zeros are produced (except for the value 0 itself, which renders as \"0\").",+ "Total. The inverse of parseBigint."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "x"),+ Typing.parameterDescription = (Just "the bigint to render"),+ Typing.parameterType = (Model.TypeLiteral (Model.LiteralTypeInteger Model.IntegerTypeBigint)),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeLiteral Model.LiteralTypeString)}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++printBoolean :: Packaging.PrimitiveDefinition+printBoolean =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.literals.printBoolean"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Render a boolean as a string."),+ Packaging.entityMetadataComments = [+ "printBoolean(true) = \"true\"; printBoolean(false) = \"false\".",+ "Total. The inverse of parseBoolean."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "b"),+ Typing.parameterDescription = (Just "the boolean to render"),+ Typing.parameterType = (Model.TypeLiteral Model.LiteralTypeBoolean),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeLiteral Model.LiteralTypeString)}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++printDecimal :: Packaging.PrimitiveDefinition+printDecimal =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.literals.printDecimal"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Render a decimal as a string."),+ Packaging.entityMetadataComments = [+ "printDecimal(x) returns the canonical decimal representation of x as a string. The exact form (use of scientific notation, trailing zeros, etc.) is host-defined but always round-trips with parseDecimal.",+ "Total."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "x"),+ Typing.parameterDescription = (Just "the decimal to render"),+ Typing.parameterType = (Model.TypeLiteral Model.LiteralTypeDecimal),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeLiteral Model.LiteralTypeString)}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++printFloat32 :: Packaging.PrimitiveDefinition+printFloat32 =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.literals.printFloat32"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Render a float32 as a string."),+ Packaging.entityMetadataComments = [+ "printFloat32(x) returns a string representation of x. Finite values use the shortest decimal that round-trips through parseFloat32 back to x. Special values render as \"NaN\", \"Infinity\", or \"-Infinity\" (capitalization is host-defined).",+ "Total."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "x"),+ Typing.parameterDescription = (Just "the float32 to render"),+ Typing.parameterType = (Model.TypeLiteral (Model.LiteralTypeFloat Model.FloatTypeFloat32)),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeLiteral Model.LiteralTypeString)}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++printFloat64 :: Packaging.PrimitiveDefinition+printFloat64 =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.literals.printFloat64"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Render a float64 as a string."),+ Packaging.entityMetadataComments = [+ "printFloat64(x) returns a string representation of x. Finite values use the shortest decimal that round-trips through parseFloat64 back to x. Special values render as \"NaN\", \"Infinity\", or \"-Infinity\" (capitalization is host-defined).",+ "Total."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "x"),+ Typing.parameterDescription = (Just "the float64 to render"),+ Typing.parameterType = (Model.TypeLiteral (Model.LiteralTypeFloat Model.FloatTypeFloat64)),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeLiteral Model.LiteralTypeString)}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++printInt16 :: Packaging.PrimitiveDefinition+printInt16 =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.literals.printInt16"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Render an int16 as a string."),+ Packaging.entityMetadataComments = [+ "printInt16(x) returns the canonical decimal representation of x: an optional leading minus sign followed by decimal digits.",+ "Total. The inverse of parseInt16."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "x"),+ Typing.parameterDescription = (Just "the int16 to render"),+ Typing.parameterType = (Model.TypeLiteral (Model.LiteralTypeInteger Model.IntegerTypeInt16)),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeLiteral Model.LiteralTypeString)}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++printInt32 :: Packaging.PrimitiveDefinition+printInt32 =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.literals.printInt32"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Render an int32 as a string."),+ Packaging.entityMetadataComments = [+ "printInt32(x) returns the canonical decimal representation of x: an optional leading minus sign followed by decimal digits.",+ "Total. The inverse of parseInt32."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "x"),+ Typing.parameterDescription = (Just "the int32 to render"),+ Typing.parameterType = (Model.TypeLiteral (Model.LiteralTypeInteger Model.IntegerTypeInt32)),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeLiteral Model.LiteralTypeString)}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++printInt64 :: Packaging.PrimitiveDefinition+printInt64 =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.literals.printInt64"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Render an int64 as a string."),+ Packaging.entityMetadataComments = [+ "printInt64(x) returns the canonical decimal representation of x: an optional leading minus sign followed by decimal digits.",+ "Total. The inverse of parseInt64."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "x"),+ Typing.parameterDescription = (Just "the int64 to render"),+ Typing.parameterType = (Model.TypeLiteral (Model.LiteralTypeInteger Model.IntegerTypeInt64)),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeLiteral Model.LiteralTypeString)}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++printInt8 :: Packaging.PrimitiveDefinition+printInt8 =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.literals.printInt8"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Render an int8 as a string."),+ Packaging.entityMetadataComments = [+ "printInt8(x) returns the canonical decimal representation of x: an optional leading minus sign followed by decimal digits.",+ "Total. The inverse of parseInt8."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "x"),+ Typing.parameterDescription = (Just "the int8 to render"),+ Typing.parameterType = (Model.TypeLiteral (Model.LiteralTypeInteger Model.IntegerTypeInt8)),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeLiteral Model.LiteralTypeString)}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++printString :: Packaging.PrimitiveDefinition+printString =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.literals.printString"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Render a string as a string-literal token (escaped and quoted)."),+ Packaging.entityMetadataComments = [+ "printString(s) returns a Haskell-syntax string literal token representing s: an opening double-quote, the characters of s with special characters escaped (backslash sequences for control characters, quotes, and non-printable Unicode code points), and a closing double-quote.",+ "Total. The inverse of parseString."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "s"),+ Typing.parameterDescription = (Just "the string to render"),+ Typing.parameterType = (Model.TypeLiteral Model.LiteralTypeString),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeLiteral Model.LiteralTypeString)}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++printUint16 :: Packaging.PrimitiveDefinition+printUint16 =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.literals.printUint16"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Render a uint16 as a string."),+ Packaging.entityMetadataComments = [+ "printUint16(x) returns the canonical decimal representation of x.",+ "Total. The inverse of parseUint16."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "x"),+ Typing.parameterDescription = (Just "the uint16 to render"),+ Typing.parameterType = (Model.TypeLiteral (Model.LiteralTypeInteger Model.IntegerTypeUint16)),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeLiteral Model.LiteralTypeString)}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++printUint32 :: Packaging.PrimitiveDefinition+printUint32 =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.literals.printUint32"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Render a uint32 as a string."),+ Packaging.entityMetadataComments = [+ "printUint32(x) returns the canonical decimal representation of x.",+ "Total. The inverse of parseUint32."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "x"),+ Typing.parameterDescription = (Just "the uint32 to render"),+ Typing.parameterType = (Model.TypeLiteral (Model.LiteralTypeInteger Model.IntegerTypeUint32)),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeLiteral Model.LiteralTypeString)}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++printUint64 :: Packaging.PrimitiveDefinition+printUint64 =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.literals.printUint64"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Render a uint64 as a string."),+ Packaging.entityMetadataComments = [+ "printUint64(x) returns the canonical decimal representation of x.",+ "Total. The inverse of parseUint64."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "x"),+ Typing.parameterDescription = (Just "the uint64 to render"),+ Typing.parameterType = (Model.TypeLiteral (Model.LiteralTypeInteger Model.IntegerTypeUint64)),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeLiteral Model.LiteralTypeString)}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++printUint8 :: Packaging.PrimitiveDefinition+printUint8 =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.literals.printUint8"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Render a uint8 as a string."),+ Packaging.entityMetadataComments = [+ "printUint8(x) returns the canonical decimal representation of x.",+ "Total. The inverse of parseUint8."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "x"),+ Typing.parameterDescription = (Just "the uint8 to render"),+ Typing.parameterType = (Model.TypeLiteral (Model.LiteralTypeInteger Model.IntegerTypeUint8)),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeLiteral Model.LiteralTypeString)}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++uint16ToBigint :: Packaging.PrimitiveDefinition+uint16ToBigint =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.literals.uint16ToBigint"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Convert a uint16 to a bigint."),+ Packaging.entityMetadataComments = [+ "uint16ToBigint(x) returns the bigint with the same numeric value as x. The conversion is exact and lossless.",+ "Total."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "x"),+ Typing.parameterDescription = (Just "the uint16 to convert"),+ Typing.parameterType = (Model.TypeLiteral (Model.LiteralTypeInteger Model.IntegerTypeUint16)),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeLiteral (Model.LiteralTypeInteger Model.IntegerTypeBigint))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++uint32ToBigint :: Packaging.PrimitiveDefinition+uint32ToBigint =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.literals.uint32ToBigint"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Convert a uint32 to a bigint."),+ Packaging.entityMetadataComments = [+ "uint32ToBigint(x) returns the bigint with the same numeric value as x. The conversion is exact and lossless.",+ "Total."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "x"),+ Typing.parameterDescription = (Just "the uint32 to convert"),+ Typing.parameterType = (Model.TypeLiteral (Model.LiteralTypeInteger Model.IntegerTypeUint32)),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeLiteral (Model.LiteralTypeInteger Model.IntegerTypeBigint))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++uint64ToBigint :: Packaging.PrimitiveDefinition+uint64ToBigint =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.literals.uint64ToBigint"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Convert a uint64 to a bigint."),+ Packaging.entityMetadataComments = [+ "uint64ToBigint(x) returns the bigint with the same numeric value as x. The conversion is exact and lossless.",+ "Total."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "x"),+ Typing.parameterDescription = (Just "the uint64 to convert"),+ Typing.parameterType = (Model.TypeLiteral (Model.LiteralTypeInteger Model.IntegerTypeUint64)),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeLiteral (Model.LiteralTypeInteger Model.IntegerTypeBigint))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++uint8ToBigint :: Packaging.PrimitiveDefinition+uint8ToBigint =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.literals.uint8ToBigint"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Convert a uint8 to a bigint."),+ Packaging.entityMetadataComments = [+ "uint8ToBigint(x) returns the bigint with the same numeric value as x. The conversion is exact and lossless.",+ "Total."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "x"),+ Typing.parameterDescription = (Just "the uint8 to convert"),+ Typing.parameterType = (Model.TypeLiteral (Model.LiteralTypeInteger Model.IntegerTypeUint8)),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeLiteral (Model.LiteralTypeInteger Model.IntegerTypeBigint))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}
@@ -0,0 +1,207 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Primitives in the hydra.core.lib.logic module.++module Hydra.Core.Lib.Logic where++import qualified Hydra.Core.Ast as Ast+import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Diff as Diff+import qualified Hydra.Core.Docs as Docs+import qualified Hydra.Core.Error.Checking as Checking+import qualified Hydra.Core.Error.File as ErrorFile+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Error.Packaging as ErrorPackaging+import qualified Hydra.Core.Error.System as ErrorSystem+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Json.Model as JsonModel+import qualified Hydra.Core.Markdown as Markdown+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Parsing as Parsing+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Query as Query+import qualified Hydra.Core.Regex as Regex+import qualified Hydra.Core.Relational as Relational+import qualified Hydra.Core.System as System+import qualified Hydra.Core.Tabular as Tabular+import qualified Hydra.Core.Testing as Testing+import qualified Hydra.Core.Time as Time+import qualified Hydra.Core.Topology as Topology+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Validation as Validation+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++and :: Packaging.PrimitiveDefinition+and =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.logic.and"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Compute the logical AND of two boolean values."),+ Packaging.entityMetadataComments = [+ "and(p, q) returns true iff both p and q are true.",+ "Evaluation is strict in both arguments at the primitive level; for short-circuiting behavior, use ifElse.",+ "Total. Corresponds to Haskell's (&&) :: Bool -> Bool -> Bool (but without short-circuit evaluation)."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "p"),+ Typing.parameterDescription = (Just "the first boolean operand"),+ Typing.parameterType = (Model.TypeLiteral Model.LiteralTypeBoolean),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "q"),+ Typing.parameterDescription = (Just "the second boolean operand"),+ Typing.parameterType = (Model.TypeLiteral Model.LiteralTypeBoolean),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeLiteral Model.LiteralTypeBoolean)}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = (Just (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "a"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "b"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.logic.ifElse")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "a"))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "b"))})),+ Model.applicationArgument = (Model.TermLiteral (Model.LiteralBoolean False))}))}))})))}++ifElse :: Packaging.PrimitiveDefinition+ifElse =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.logic.ifElse"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Compute a conditional expression."),+ Packaging.entityMetadataComments = [+ "ifElse(p, t, f) returns t if p is true, or f if p is false.",+ "The unselected branch is not necessarily evaluated; ifElse is the standard way to express short-circuiting boolean logic and branching in Hydra.",+ "Total. Corresponds to Haskell's if/then/else."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "x"),+ Typing.typeParameterConstraints = []}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "p"),+ Typing.parameterDescription = (Just "the boolean condition"),+ Typing.parameterType = (Model.TypeLiteral Model.LiteralTypeBoolean),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "t"),+ Typing.parameterDescription = (Just "the value returned when p is true"),+ Typing.parameterType = (Model.TypeVariable (Model.Name "x")),+ Typing.parameterIsLazy = True},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "f"),+ Typing.parameterDescription = (Just "the value returned when p is false"),+ Typing.parameterType = (Model.TypeVariable (Model.Name "x")),+ Typing.parameterIsLazy = True}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeVariable (Model.Name "x"))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++not :: Packaging.PrimitiveDefinition+not =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.logic.not"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Compute the logical NOT of a boolean value."),+ Packaging.entityMetadataComments = [+ "not(p) returns false if p is true, or true if p is false.",+ "Total. Corresponds to Haskell's not :: Bool -> Bool."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "p"),+ Typing.parameterDescription = (Just "the boolean value to negate"),+ Typing.parameterType = (Model.TypeLiteral Model.LiteralTypeBoolean),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeLiteral Model.LiteralTypeBoolean)}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = (Just (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "a"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.logic.ifElse")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "a"))})),+ Model.applicationArgument = (Model.TermLiteral (Model.LiteralBoolean False))})),+ Model.applicationArgument = (Model.TermLiteral (Model.LiteralBoolean True))}))})))}++or :: Packaging.PrimitiveDefinition+or =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.logic.or"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Compute the logical OR of two boolean values."),+ Packaging.entityMetadataComments = [+ "or(p, q) returns true iff at least one of p and q is true.",+ "Evaluation is strict in both arguments at the primitive level; for short-circuiting behavior, use ifElse.",+ "Total. Corresponds to Haskell's (||) :: Bool -> Bool -> Bool (but without short-circuit evaluation)."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "p"),+ Typing.parameterDescription = (Just "the first boolean operand"),+ Typing.parameterType = (Model.TypeLiteral Model.LiteralTypeBoolean),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "q"),+ Typing.parameterDescription = (Just "the second boolean operand"),+ Typing.parameterType = (Model.TypeLiteral Model.LiteralTypeBoolean),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeLiteral Model.LiteralTypeBoolean)}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = (Just (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "a"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "b"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.logic.ifElse")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "a"))})),+ Model.applicationArgument = (Model.TermLiteral (Model.LiteralBoolean True))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "b"))}))}))})))}
@@ -0,0 +1,1227 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Primitives in the hydra.core.lib.maps module.++module Hydra.Core.Lib.Maps where++import qualified Hydra.Core.Ast as Ast+import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Diff as Diff+import qualified Hydra.Core.Docs as Docs+import qualified Hydra.Core.Error.Checking as Checking+import qualified Hydra.Core.Error.File as ErrorFile+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Error.Packaging as ErrorPackaging+import qualified Hydra.Core.Error.System as ErrorSystem+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Json.Model as JsonModel+import qualified Hydra.Core.Markdown as Markdown+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Parsing as Parsing+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Query as Query+import qualified Hydra.Core.Regex as Regex+import qualified Hydra.Core.Relational as Relational+import qualified Hydra.Core.System as System+import qualified Hydra.Core.Tabular as Tabular+import qualified Hydra.Core.Testing as Testing+import qualified Hydra.Core.Time as Time+import qualified Hydra.Core.Topology as Topology+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Validation as Validation+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++alter :: Packaging.PrimitiveDefinition+alter =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.maps.alter"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Alter a value at a key using a function which sees the optional current value."),+ Packaging.entityMetadataComments = [+ "alter(f, k, m) applies f to Just(v) when m contains key k with value v, or to Nothing when k is absent. If f returns Just(v'), the binding (k, v') is set in the result; if f returns Nothing, k is removed from the result.",+ "A single primitive that subsumes insert, delete, and adjust.",+ "Requires an 'ordering' constraint on the key type.",+ "Total. Corresponds to Haskell's Data.Map.alter :: Ord k => (Maybe v -> Maybe v) -> k -> Map k v -> Map k v."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "v"),+ Typing.typeParameterConstraints = []},+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "k"),+ Typing.typeParameterConstraints = [+ Model.TypeClassConstraintSimple (Model.Name "ordering")]}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "f"),+ Typing.parameterDescription = (Just "the update function, applied to the optional current value at the key"),+ Typing.parameterType = (Model.TypeFunction (Model.FunctionType {+ Model.functionTypeDomain = (Model.TypeOptional (Model.TypeVariable (Model.Name "v"))),+ Model.functionTypeCodomain = (Model.TypeOptional (Model.TypeVariable (Model.Name "v")))})),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "k"),+ Typing.parameterDescription = (Just "the key whose binding to alter"),+ Typing.parameterType = (Model.TypeVariable (Model.Name "k")),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "m"),+ Typing.parameterDescription = (Just "the map to update"),+ Typing.parameterType = (Model.TypeMap (Model.MapType {+ Model.mapTypeKeys = (Model.TypeVariable (Model.Name "k")),+ Model.mapTypeValues = (Model.TypeVariable (Model.Name "v"))})),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeMap (Model.MapType {+ Model.mapTypeKeys = (Model.TypeVariable (Model.Name "k")),+ Model.mapTypeValues = (Model.TypeVariable (Model.Name "v"))}))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = (Just (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "f"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "k"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "m"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.optionals.match")),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "f")),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.maps.lookup")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "k"))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "m"))}))}))})),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.maps.delete")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "k"))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "m"))}))})),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "vNew"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.maps.insert")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "k"))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "vNew"))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "m"))}))}))}))}))}))})))}++bimap :: Packaging.PrimitiveDefinition+bimap =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.maps.bimap"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Map functions over both the keys and values of a map."),+ Packaging.entityMetadataComments = [+ "bimap(fk, fv, m) returns a new map with key fk(k) and value fv(v) for each binding (k, v) in m.",+ "Key collisions after applying fk are resolved by keeping the last binding encountered (host may differ on collision policy if fk is not injective).",+ "Requires 'ordering' constraints on both the input and output key types.",+ "Total. Corresponds to a key-and-value lift of Haskell's Data.Map.fromList . map (\\(k,v) -> (fk k, fv v)) . toList."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "k1"),+ Typing.typeParameterConstraints = [+ Model.TypeClassConstraintSimple (Model.Name "ordering")]},+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "k2"),+ Typing.typeParameterConstraints = [+ Model.TypeClassConstraintSimple (Model.Name "ordering")]},+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "v1"),+ Typing.typeParameterConstraints = []},+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "v2"),+ Typing.typeParameterConstraints = []}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "fk"),+ Typing.parameterDescription = (Just "the function to apply to each key"),+ Typing.parameterType = (Model.TypeFunction (Model.FunctionType {+ Model.functionTypeDomain = (Model.TypeVariable (Model.Name "k1")),+ Model.functionTypeCodomain = (Model.TypeVariable (Model.Name "k2"))})),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "fv"),+ Typing.parameterDescription = (Just "the function to apply to each value"),+ Typing.parameterType = (Model.TypeFunction (Model.FunctionType {+ Model.functionTypeDomain = (Model.TypeVariable (Model.Name "v1")),+ Model.functionTypeCodomain = (Model.TypeVariable (Model.Name "v2"))})),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "m"),+ Typing.parameterDescription = (Just "the map to transform"),+ Typing.parameterType = (Model.TypeMap (Model.MapType {+ Model.mapTypeKeys = (Model.TypeVariable (Model.Name "k1")),+ Model.mapTypeValues = (Model.TypeVariable (Model.Name "v1"))})),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeMap (Model.MapType {+ Model.mapTypeKeys = (Model.TypeVariable (Model.Name "k2")),+ Model.mapTypeValues = (Model.TypeVariable (Model.Name "v2"))}))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = (Just (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "fk"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "fv"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "m"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.maps.fromList")),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.lists.map")),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "p"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermPair (+ Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "fk")),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.pairs.first")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "p"))}))}),+ (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "fv")),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.pairs.second")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "p"))}))}))))}))})),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.maps.toList")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "m"))}))}))}))}))}))})))}++delete :: Packaging.PrimitiveDefinition+delete =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.maps.delete"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Remove a key from a map."),+ Packaging.entityMetadataComments = [+ "delete(k, m) returns m with the binding for k removed; if k is not present, m is returned unchanged.",+ "Requires an 'ordering' constraint on the key type.",+ "Total. Corresponds to Haskell's Data.Map.delete :: Ord k => k -> Map k v -> Map k v."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "k"),+ Typing.typeParameterConstraints = [+ Model.TypeClassConstraintSimple (Model.Name "ordering")]},+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "v"),+ Typing.typeParameterConstraints = []}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "k"),+ Typing.parameterDescription = (Just "the key to remove"),+ Typing.parameterType = (Model.TypeVariable (Model.Name "k")),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "m"),+ Typing.parameterDescription = (Just "the map to remove the key from"),+ Typing.parameterType = (Model.TypeMap (Model.MapType {+ Model.mapTypeKeys = (Model.TypeVariable (Model.Name "k")),+ Model.mapTypeValues = (Model.TypeVariable (Model.Name "v"))})),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeMap (Model.MapType {+ Model.mapTypeKeys = (Model.TypeVariable (Model.Name "k")),+ Model.mapTypeValues = (Model.TypeVariable (Model.Name "v"))}))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++difference :: Packaging.PrimitiveDefinition+difference =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.maps.difference"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Compute the difference of two maps by key."),+ Packaging.entityMetadataComments = [+ "difference(m1, m2) returns the map containing exactly the bindings of m1 whose keys do not appear in m2. Only the key set of m2 matters; its values are ignored.",+ "The key-set analogue is hydra.core.lib.sets.difference.",+ "Requires an 'ordering' constraint on the key type.",+ "Total. Corresponds to Haskell's Data.Map.difference :: Ord k => Map k v -> Map k v -> Map k v."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "k"),+ Typing.typeParameterConstraints = [+ Model.TypeClassConstraintSimple (Model.Name "ordering")]},+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "v"),+ Typing.typeParameterConstraints = []}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "m1"),+ Typing.parameterDescription = (Just "the map whose bindings are retained"),+ Typing.parameterType = (Model.TypeMap (Model.MapType {+ Model.mapTypeKeys = (Model.TypeVariable (Model.Name "k")),+ Model.mapTypeValues = (Model.TypeVariable (Model.Name "v"))})),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "m2"),+ Typing.parameterDescription = (Just "the map whose keys are subtracted"),+ Typing.parameterType = (Model.TypeMap (Model.MapType {+ Model.mapTypeKeys = (Model.TypeVariable (Model.Name "k")),+ Model.mapTypeValues = (Model.TypeVariable (Model.Name "v"))})),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeMap (Model.MapType {+ Model.mapTypeKeys = (Model.TypeVariable (Model.Name "k")),+ Model.mapTypeValues = (Model.TypeVariable (Model.Name "v"))}))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++elems :: Packaging.PrimitiveDefinition+elems =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.maps.elems"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Return the values of a map (in key order)."),+ Packaging.entityMetadataComments = [+ "elems(m) returns the values of m as a list, ordered by their keys' ascending order.",+ "Requires an 'ordering' constraint on the key type.",+ "Total. Corresponds to Haskell's Data.Map.elems :: Map k v -> [v]."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "k"),+ Typing.typeParameterConstraints = [+ Model.TypeClassConstraintSimple (Model.Name "ordering")]},+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "v"),+ Typing.typeParameterConstraints = []}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "m"),+ Typing.parameterDescription = (Just "the map whose values to return"),+ Typing.parameterType = (Model.TypeMap (Model.MapType {+ Model.mapTypeKeys = (Model.TypeVariable (Model.Name "k")),+ Model.mapTypeValues = (Model.TypeVariable (Model.Name "v"))})),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeList (Model.TypeVariable (Model.Name "v")))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++empty :: Packaging.PrimitiveDefinition+empty =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.maps.empty"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "The empty map."),+ Packaging.entityMetadataComments = [+ "empty is the map with no bindings.",+ "Requires an 'ordering' constraint on the key type.",+ "Total. Corresponds to Haskell's Data.Map.empty :: Map k v."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "k"),+ Typing.typeParameterConstraints = [+ Model.TypeClassConstraintSimple (Model.Name "ordering")]},+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "v"),+ Typing.typeParameterConstraints = []}],+ Typing.termSignatureParameters = [],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeMap (Model.MapType {+ Model.mapTypeKeys = (Model.TypeVariable (Model.Name "k")),+ Model.mapTypeValues = (Model.TypeVariable (Model.Name "v"))}))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++filter :: Packaging.PrimitiveDefinition+filter =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.maps.filter"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Filter a map by value."),+ Packaging.entityMetadataComments = [+ "filter(p, m) returns the submap of m containing exactly the bindings (k, v) for which p(v) is true.",+ "Requires an 'ordering' constraint on the key type.",+ "Total. Corresponds to Haskell's Data.Map.filter :: (v -> Bool) -> Map k v -> Map k v."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "v"),+ Typing.typeParameterConstraints = []},+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "k"),+ Typing.typeParameterConstraints = [+ Model.TypeClassConstraintSimple (Model.Name "ordering")]}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "p"),+ Typing.parameterDescription = (Just "the predicate to test each value"),+ Typing.parameterType = (Model.TypeFunction (Model.FunctionType {+ Model.functionTypeDomain = (Model.TypeVariable (Model.Name "v")),+ Model.functionTypeCodomain = (Model.TypeLiteral Model.LiteralTypeBoolean)})),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "m"),+ Typing.parameterDescription = (Just "the map to filter"),+ Typing.parameterType = (Model.TypeMap (Model.MapType {+ Model.mapTypeKeys = (Model.TypeVariable (Model.Name "k")),+ Model.mapTypeValues = (Model.TypeVariable (Model.Name "v"))})),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeMap (Model.MapType {+ Model.mapTypeKeys = (Model.TypeVariable (Model.Name "k")),+ Model.mapTypeValues = (Model.TypeVariable (Model.Name "v"))}))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = (Just (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "p"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "m"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.maps.fromList")),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.lists.filter")),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "pr"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "p")),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.pairs.second")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "pr"))}))}))}))})),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.maps.toList")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "m"))}))}))}))}))})))}++filterWithKey :: Packaging.PrimitiveDefinition+filterWithKey =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.maps.filterWithKey"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Filter a map by key and value."),+ Packaging.entityMetadataComments = [+ "filterWithKey(p, m) returns the submap of m containing exactly the bindings (k, v) for which p(k, v) is true.",+ "Requires an 'ordering' constraint on the key type.",+ "Total. Corresponds to Haskell's Data.Map.filterWithKey :: (k -> v -> Bool) -> Map k v -> Map k v."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "k"),+ Typing.typeParameterConstraints = [+ Model.TypeClassConstraintSimple (Model.Name "ordering")]},+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "v"),+ Typing.typeParameterConstraints = []}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "p"),+ Typing.parameterDescription = (Just "the predicate to test each key and value"),+ Typing.parameterType = (Model.TypeFunction (Model.FunctionType {+ Model.functionTypeDomain = (Model.TypeVariable (Model.Name "k")),+ Model.functionTypeCodomain = (Model.TypeFunction (Model.FunctionType {+ Model.functionTypeDomain = (Model.TypeVariable (Model.Name "v")),+ Model.functionTypeCodomain = (Model.TypeLiteral Model.LiteralTypeBoolean)}))})),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "m"),+ Typing.parameterDescription = (Just "the map to filter"),+ Typing.parameterType = (Model.TypeMap (Model.MapType {+ Model.mapTypeKeys = (Model.TypeVariable (Model.Name "k")),+ Model.mapTypeValues = (Model.TypeVariable (Model.Name "v"))})),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeMap (Model.MapType {+ Model.mapTypeKeys = (Model.TypeVariable (Model.Name "k")),+ Model.mapTypeValues = (Model.TypeVariable (Model.Name "v"))}))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = (Just (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "p"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "m"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.maps.fromList")),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.lists.filter")),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "pr"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "p")),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.pairs.first")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "pr"))}))})),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.pairs.second")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "pr"))}))}))}))})),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.maps.toList")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "m"))}))}))}))}))})))}++findWithDefault :: Packaging.PrimitiveDefinition+findWithDefault =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.maps.findWithDefault"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Look up a value with a default if the key is absent."),+ Packaging.entityMetadataComments = [+ "findWithDefault(def, k, m) returns the value bound to k in m if k is present, or def otherwise. Equivalent to maybe(def, identity, lookup(k, m)).",+ "Requires an 'ordering' constraint on the key type.",+ "Total. Corresponds to Haskell's Data.Map.findWithDefault :: Ord k => v -> k -> Map k v -> v."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "v"),+ Typing.typeParameterConstraints = []},+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "k"),+ Typing.typeParameterConstraints = [+ Model.TypeClassConstraintSimple (Model.Name "ordering")]}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "def"),+ Typing.parameterDescription = (Just "the default value, returned when the key is absent"),+ Typing.parameterType = (Model.TypeVariable (Model.Name "v")),+ Typing.parameterIsLazy = True},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "k"),+ Typing.parameterDescription = (Just "the key to look up"),+ Typing.parameterType = (Model.TypeVariable (Model.Name "k")),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "m"),+ Typing.parameterDescription = (Just "the map to search"),+ Typing.parameterType = (Model.TypeMap (Model.MapType {+ Model.mapTypeKeys = (Model.TypeVariable (Model.Name "k")),+ Model.mapTypeValues = (Model.TypeVariable (Model.Name "v"))})),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeVariable (Model.Name "v"))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = (Just (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "def"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "k"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "m"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.optionals.withDefault")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "def"))})),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.maps.lookup")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "k"))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "m"))}))}))}))}))})))}++fromList :: Packaging.PrimitiveDefinition+fromList =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.maps.fromList"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Build a map from a list of key-value pairs."),+ Packaging.entityMetadataComments = [+ "fromList(xs) returns the map containing exactly the bindings in xs. If xs contains multiple entries for the same key, the last one wins (matching Haskell's fromList behavior).",+ "Requires an 'ordering' constraint on the key type.",+ "Total. Corresponds to Haskell's Data.Map.fromList :: Ord k => [(k, v)] -> Map k v."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "k"),+ Typing.typeParameterConstraints = [+ Model.TypeClassConstraintSimple (Model.Name "ordering")]},+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "v"),+ Typing.typeParameterConstraints = []}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "xs"),+ Typing.parameterDescription = (Just "the list of key-value pairs to build the map from"),+ Typing.parameterType = (Model.TypeList (Model.TypePair (Model.PairType {+ Model.pairTypeFirst = (Model.TypeVariable (Model.Name "k")),+ Model.pairTypeSecond = (Model.TypeVariable (Model.Name "v"))}))),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeMap (Model.MapType {+ Model.mapTypeKeys = (Model.TypeVariable (Model.Name "k")),+ Model.mapTypeValues = (Model.TypeVariable (Model.Name "v"))}))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++insert :: Packaging.PrimitiveDefinition+insert =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.maps.insert"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Insert a key-value pair into a map."),+ Packaging.entityMetadataComments = [+ "insert(k, v, m) returns m with the binding (k, v) added or updated. If k is already present, its value is overwritten.",+ "Requires an 'ordering' constraint on the key type.",+ "Total. Corresponds to Haskell's Data.Map.insert :: Ord k => k -> v -> Map k v -> Map k v."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "k"),+ Typing.typeParameterConstraints = [+ Model.TypeClassConstraintSimple (Model.Name "ordering")]},+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "v"),+ Typing.typeParameterConstraints = []}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "k"),+ Typing.parameterDescription = (Just "the key to insert"),+ Typing.parameterType = (Model.TypeVariable (Model.Name "k")),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "v"),+ Typing.parameterDescription = (Just "the value to bind to the key"),+ Typing.parameterType = (Model.TypeVariable (Model.Name "v")),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "m"),+ Typing.parameterDescription = (Just "the map to insert into"),+ Typing.parameterType = (Model.TypeMap (Model.MapType {+ Model.mapTypeKeys = (Model.TypeVariable (Model.Name "k")),+ Model.mapTypeValues = (Model.TypeVariable (Model.Name "v"))})),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeMap (Model.MapType {+ Model.mapTypeKeys = (Model.TypeVariable (Model.Name "k")),+ Model.mapTypeValues = (Model.TypeVariable (Model.Name "v"))}))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++intersection :: Packaging.PrimitiveDefinition+intersection =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.maps.intersection"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Compute the intersection of two maps by key."),+ Packaging.entityMetadataComments = [+ "intersection(m1, m2) returns the map containing exactly the bindings of m1 whose keys also appear in m2. On each common key the value is taken from m1; only the key set of m2 matters, and its values are ignored.",+ "The key-set analogue is hydra.core.lib.sets.intersection.",+ "Requires an 'ordering' constraint on the key type.",+ "Total. Corresponds to Haskell's Data.Map.intersection :: Ord k => Map k v -> Map k v -> Map k v."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "k"),+ Typing.typeParameterConstraints = [+ Model.TypeClassConstraintSimple (Model.Name "ordering")]},+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "v"),+ Typing.typeParameterConstraints = []}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "m1"),+ Typing.parameterDescription = (Just "the map whose bindings are retained"),+ Typing.parameterType = (Model.TypeMap (Model.MapType {+ Model.mapTypeKeys = (Model.TypeVariable (Model.Name "k")),+ Model.mapTypeValues = (Model.TypeVariable (Model.Name "v"))})),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "m2"),+ Typing.parameterDescription = (Just "the map whose key set is intersected"),+ Typing.parameterType = (Model.TypeMap (Model.MapType {+ Model.mapTypeKeys = (Model.TypeVariable (Model.Name "k")),+ Model.mapTypeValues = (Model.TypeVariable (Model.Name "v"))})),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeMap (Model.MapType {+ Model.mapTypeKeys = (Model.TypeVariable (Model.Name "k")),+ Model.mapTypeValues = (Model.TypeVariable (Model.Name "v"))}))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++isEmpty :: Packaging.PrimitiveDefinition+isEmpty =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.maps.isEmpty"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Test whether a map is empty."),+ Packaging.entityMetadataComments = [+ "isEmpty(m) returns true iff m has no bindings.",+ "Requires an 'ordering' constraint on the key type.",+ "Total. Corresponds to Haskell's Data.Map.null :: Map k v -> Bool."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "k"),+ Typing.typeParameterConstraints = [+ Model.TypeClassConstraintSimple (Model.Name "ordering")]},+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "v"),+ Typing.typeParameterConstraints = []}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "m"),+ Typing.parameterDescription = (Just "the map to test"),+ Typing.parameterType = (Model.TypeMap (Model.MapType {+ Model.mapTypeKeys = (Model.TypeVariable (Model.Name "k")),+ Model.mapTypeValues = (Model.TypeVariable (Model.Name "v"))})),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeLiteral Model.LiteralTypeBoolean)}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++keys :: Packaging.PrimitiveDefinition+keys =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.maps.keys"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Return the keys of a map (in key order)."),+ Packaging.entityMetadataComments = [+ "keys(m) returns the keys of m as a list, in ascending order.",+ "Requires an 'ordering' constraint on the key type.",+ "Total. Corresponds to Haskell's Data.Map.keys :: Map k v -> [k]."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "k"),+ Typing.typeParameterConstraints = [+ Model.TypeClassConstraintSimple (Model.Name "ordering")]},+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "v"),+ Typing.typeParameterConstraints = []}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "m"),+ Typing.parameterDescription = (Just "the map whose keys to return"),+ Typing.parameterType = (Model.TypeMap (Model.MapType {+ Model.mapTypeKeys = (Model.TypeVariable (Model.Name "k")),+ Model.mapTypeValues = (Model.TypeVariable (Model.Name "v"))})),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeList (Model.TypeVariable (Model.Name "k")))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++lookup :: Packaging.PrimitiveDefinition+lookup =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.maps.lookup"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Look up a value in a map by key, returning Nothing if absent."),+ Packaging.entityMetadataComments = [+ "lookup(k, m) returns Just(v) where v is the value bound to k in m, or Nothing if k is not present.",+ "Requires an 'ordering' constraint on the key type.",+ "Total. Corresponds to Haskell's Data.Map.lookup :: Ord k => k -> Map k v -> Maybe v."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "k"),+ Typing.typeParameterConstraints = [+ Model.TypeClassConstraintSimple (Model.Name "ordering")]},+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "v"),+ Typing.typeParameterConstraints = []}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "k"),+ Typing.parameterDescription = (Just "the key to look up"),+ Typing.parameterType = (Model.TypeVariable (Model.Name "k")),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "m"),+ Typing.parameterDescription = (Just "the map to search"),+ Typing.parameterType = (Model.TypeMap (Model.MapType {+ Model.mapTypeKeys = (Model.TypeVariable (Model.Name "k")),+ Model.mapTypeValues = (Model.TypeVariable (Model.Name "v"))})),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeOptional (Model.TypeVariable (Model.Name "v")))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++map :: Packaging.PrimitiveDefinition+map =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.maps.map"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Map a function over the values of a map."),+ Packaging.entityMetadataComments = [+ "map(f, m) returns a map with the same keys as m and value f(v) for each binding (k, v).",+ "Requires an 'ordering' constraint on the key type.",+ "Total. Corresponds to Haskell's Data.Map.map :: (v -> w) -> Map k v -> Map k w / fmap on Map."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "v1"),+ Typing.typeParameterConstraints = []},+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "v2"),+ Typing.typeParameterConstraints = []},+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "k"),+ Typing.typeParameterConstraints = [+ Model.TypeClassConstraintSimple (Model.Name "ordering")]}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "f"),+ Typing.parameterDescription = (Just "the function to apply to each value"),+ Typing.parameterType = (Model.TypeFunction (Model.FunctionType {+ Model.functionTypeDomain = (Model.TypeVariable (Model.Name "v1")),+ Model.functionTypeCodomain = (Model.TypeVariable (Model.Name "v2"))})),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "m"),+ Typing.parameterDescription = (Just "the map to transform"),+ Typing.parameterType = (Model.TypeMap (Model.MapType {+ Model.mapTypeKeys = (Model.TypeVariable (Model.Name "k")),+ Model.mapTypeValues = (Model.TypeVariable (Model.Name "v1"))})),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeMap (Model.MapType {+ Model.mapTypeKeys = (Model.TypeVariable (Model.Name "k")),+ Model.mapTypeValues = (Model.TypeVariable (Model.Name "v2"))}))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = (Just (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "f"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "m"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.maps.fromList")),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.lists.map")),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "p"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermPair (+ Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.pairs.first")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "p"))}),+ (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "f")),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.pairs.second")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "p"))}))}))))}))})),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.maps.toList")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "m"))}))}))}))}))})))}++mapKeys :: Packaging.PrimitiveDefinition+mapKeys =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.maps.mapKeys"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Map a function over the keys of a map."),+ Packaging.entityMetadataComments = [+ "mapKeys(f, m) returns a map where each binding (k, v) becomes (f(k), v). If f maps multiple keys to the same image, key collisions are resolved by keeping the binding with the greater original key (matching Haskell's mapKeys behavior).",+ "Requires 'ordering' constraints on both the input and output key types.",+ "Total. Corresponds to Haskell's Data.Map.mapKeys :: (Ord k1, Ord k2) => (k1 -> k2) -> Map k1 v -> Map k2 v."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "k1"),+ Typing.typeParameterConstraints = [+ Model.TypeClassConstraintSimple (Model.Name "ordering")]},+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "k2"),+ Typing.typeParameterConstraints = [+ Model.TypeClassConstraintSimple (Model.Name "ordering")]},+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "v"),+ Typing.typeParameterConstraints = []}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "f"),+ Typing.parameterDescription = (Just "the function to apply to each key"),+ Typing.parameterType = (Model.TypeFunction (Model.FunctionType {+ Model.functionTypeDomain = (Model.TypeVariable (Model.Name "k1")),+ Model.functionTypeCodomain = (Model.TypeVariable (Model.Name "k2"))})),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "m"),+ Typing.parameterDescription = (Just "the map to transform"),+ Typing.parameterType = (Model.TypeMap (Model.MapType {+ Model.mapTypeKeys = (Model.TypeVariable (Model.Name "k1")),+ Model.mapTypeValues = (Model.TypeVariable (Model.Name "v"))})),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeMap (Model.MapType {+ Model.mapTypeKeys = (Model.TypeVariable (Model.Name "k2")),+ Model.mapTypeValues = (Model.TypeVariable (Model.Name "v"))}))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = (Just (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "f"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "m"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.maps.fromList")),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.lists.map")),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "p"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermPair (+ Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "f")),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.pairs.first")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "p"))}))}),+ (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.pairs.second")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "p"))}))))}))})),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.maps.toList")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "m"))}))}))}))}))})))}++member :: Packaging.PrimitiveDefinition+member =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.maps.member"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Test whether a key is present in a map."),+ Packaging.entityMetadataComments = [+ "member(k, m) returns true iff k is a key in m.",+ "Requires an 'ordering' constraint on the key type.",+ "Total. Corresponds to Haskell's Data.Map.member :: Ord k => k -> Map k v -> Bool."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "k"),+ Typing.typeParameterConstraints = [+ Model.TypeClassConstraintSimple (Model.Name "ordering")]},+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "v"),+ Typing.typeParameterConstraints = []}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "k"),+ Typing.parameterDescription = (Just "the key to test for"),+ Typing.parameterType = (Model.TypeVariable (Model.Name "k")),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "m"),+ Typing.parameterDescription = (Just "the map to test"),+ Typing.parameterType = (Model.TypeMap (Model.MapType {+ Model.mapTypeKeys = (Model.TypeVariable (Model.Name "k")),+ Model.mapTypeValues = (Model.TypeVariable (Model.Name "v"))})),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeLiteral Model.LiteralTypeBoolean)}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++singleton :: Packaging.PrimitiveDefinition+singleton =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.maps.singleton"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Construct a map with a single key-value pair."),+ Packaging.entityMetadataComments = [+ "singleton(k, v) returns the map containing exactly the binding (k, v).",+ "Requires an 'ordering' constraint on the key type.",+ "Total. Corresponds to Haskell's Data.Map.singleton :: k -> v -> Map k v."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "k"),+ Typing.typeParameterConstraints = [+ Model.TypeClassConstraintSimple (Model.Name "ordering")]},+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "v"),+ Typing.typeParameterConstraints = []}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "k"),+ Typing.parameterDescription = (Just "the key of the single binding"),+ Typing.parameterType = (Model.TypeVariable (Model.Name "k")),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "v"),+ Typing.parameterDescription = (Just "the value of the single binding"),+ Typing.parameterType = (Model.TypeVariable (Model.Name "v")),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeMap (Model.MapType {+ Model.mapTypeKeys = (Model.TypeVariable (Model.Name "k")),+ Model.mapTypeValues = (Model.TypeVariable (Model.Name "v"))}))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++size :: Packaging.PrimitiveDefinition+size =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.maps.size"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Return the number of key-value pairs in a map."),+ Packaging.entityMetadataComments = [+ "size(m) returns the number of bindings in m as an int32.",+ "Requires an 'ordering' constraint on the key type.",+ "Total. Corresponds to Haskell's Data.Map.size :: Map k v -> Int (with narrowing to int32)."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "k"),+ Typing.typeParameterConstraints = [+ Model.TypeClassConstraintSimple (Model.Name "ordering")]},+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "v"),+ Typing.typeParameterConstraints = []}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "m"),+ Typing.parameterDescription = (Just "the map whose bindings to count"),+ Typing.parameterType = (Model.TypeMap (Model.MapType {+ Model.mapTypeKeys = (Model.TypeVariable (Model.Name "k")),+ Model.mapTypeValues = (Model.TypeVariable (Model.Name "v"))})),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeLiteral (Model.LiteralTypeInteger Model.IntegerTypeInt32))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++toList :: Packaging.PrimitiveDefinition+toList =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.maps.toList"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Convert a map to a list of key-value pairs (in key order)."),+ Packaging.entityMetadataComments = [+ "toList(m) returns the bindings of m as a list of (key, value) pairs, in ascending key order.",+ "Requires an 'ordering' constraint on the key type.",+ "Total. Corresponds to Haskell's Data.Map.toList :: Map k v -> [(k, v)]."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "k"),+ Typing.typeParameterConstraints = [+ Model.TypeClassConstraintSimple (Model.Name "ordering")]},+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "v"),+ Typing.typeParameterConstraints = []}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "m"),+ Typing.parameterDescription = (Just "the map to convert"),+ Typing.parameterType = (Model.TypeMap (Model.MapType {+ Model.mapTypeKeys = (Model.TypeVariable (Model.Name "k")),+ Model.mapTypeValues = (Model.TypeVariable (Model.Name "v"))})),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeList (Model.TypePair (Model.PairType {+ Model.pairTypeFirst = (Model.TypeVariable (Model.Name "k")),+ Model.pairTypeSecond = (Model.TypeVariable (Model.Name "v"))})))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++union :: Packaging.PrimitiveDefinition+union =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.maps.union"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Compute the union of two maps; the first map's bindings take precedence on key collision."),+ Packaging.entityMetadataComments = [+ "union(m1, m2) returns the map containing all bindings from m1 plus the bindings of m2 whose keys are not in m1. On key collision, the binding from m1 is preferred.",+ "Requires an 'ordering' constraint on the key type.",+ "Total. Corresponds to Haskell's Data.Map.union :: Ord k => Map k v -> Map k v -> Map k v."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "k"),+ Typing.typeParameterConstraints = [+ Model.TypeClassConstraintSimple (Model.Name "ordering")]},+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "v"),+ Typing.typeParameterConstraints = []}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "m1"),+ Typing.parameterDescription = (Just "the map whose bindings take precedence"),+ Typing.parameterType = (Model.TypeMap (Model.MapType {+ Model.mapTypeKeys = (Model.TypeVariable (Model.Name "k")),+ Model.mapTypeValues = (Model.TypeVariable (Model.Name "v"))})),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "m2"),+ Typing.parameterDescription = (Just "the map whose remaining bindings are added"),+ Typing.parameterType = (Model.TypeMap (Model.MapType {+ Model.mapTypeKeys = (Model.TypeVariable (Model.Name "k")),+ Model.mapTypeValues = (Model.TypeVariable (Model.Name "v"))})),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeMap (Model.MapType {+ Model.mapTypeKeys = (Model.TypeVariable (Model.Name "k")),+ Model.mapTypeValues = (Model.TypeVariable (Model.Name "v"))}))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++unions :: Packaging.PrimitiveDefinition+unions =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.maps.unions"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Compute the left-biased union of a list of maps."),+ Packaging.entityMetadataComments = [+ "unions(ms) returns the map containing every binding of every map in ms; when a key occurs in more than one map, the binding from the earliest such map in the list wins.",+ "unions(ms) is equivalent to folding union over ms from the left, starting from empty; unions([]) is empty, and the bias matches union and hydra.core.lib.sets.unions.",+ "Requires an 'ordering' constraint on the key type.",+ "Total. Corresponds to Haskell's Data.Map.unions :: Ord k => [Map k v] -> Map k v."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "k"),+ Typing.typeParameterConstraints = [+ Model.TypeClassConstraintSimple (Model.Name "ordering")]},+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "v"),+ Typing.typeParameterConstraints = []}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "ms"),+ Typing.parameterDescription = (Just "the list of maps to combine"),+ Typing.parameterType = (Model.TypeList (Model.TypeMap (Model.MapType {+ Model.mapTypeKeys = (Model.TypeVariable (Model.Name "k")),+ Model.mapTypeValues = (Model.TypeVariable (Model.Name "v"))}))),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeMap (Model.MapType {+ Model.mapTypeKeys = (Model.TypeVariable (Model.Name "k")),+ Model.mapTypeValues = (Model.TypeVariable (Model.Name "v"))}))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}
@@ -0,0 +1,1374 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Primitives in the hydra.core.lib.math module.++module Hydra.Core.Lib.Math where++import qualified Hydra.Core.Ast as Ast+import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Diff as Diff+import qualified Hydra.Core.Docs as Docs+import qualified Hydra.Core.Error.Checking as Checking+import qualified Hydra.Core.Error.File as ErrorFile+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Error.Packaging as ErrorPackaging+import qualified Hydra.Core.Error.System as ErrorSystem+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Json.Model as JsonModel+import qualified Hydra.Core.Markdown as Markdown+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Parsing as Parsing+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Query as Query+import qualified Hydra.Core.Regex as Regex+import qualified Hydra.Core.Relational as Relational+import qualified Hydra.Core.System as System+import qualified Hydra.Core.Tabular as Tabular+import qualified Hydra.Core.Testing as Testing+import qualified Hydra.Core.Time as Time+import qualified Hydra.Core.Topology as Topology+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Validation as Validation+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++abs :: Packaging.PrimitiveDefinition+abs =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.math.abs"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Numeric absolute value."),+ Packaging.entityMetadataComments = [+ "Constraint-polymorphic absolute value over any type with a 'numeric' instance. The per-type semantics live in the instance: for fixed-width signed integers the result is total but not injective at the boundary (abs(minBound) = minBound, e.g. abs(-2147483648) = -2147483648 for int32, because +2147483648 is not representable); for unsigned integers and bigint the result is the input itself or its arithmetic negation, whichever is non-negative; for floating-point it clears the sign bit per IEEE 754 \2677.5.1 (abs(\2832) = +0, abs(NaN) is NaN).",+ "Requires a 'numeric' type-class constraint on the argument type.",+ "Corresponds to Haskell's abs :: Num a => a -> a."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "x"),+ Typing.typeParameterConstraints = [+ Model.TypeClassConstraintSimple (Model.Name "numeric")]}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "arg0"),+ Typing.parameterDescription = Nothing,+ Typing.parameterType = (Model.TypeVariable (Model.Name "x")),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeVariable (Model.Name "x"))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++acos :: Packaging.PrimitiveDefinition+acos =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.math.acos"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "The arc cosine of a floating-point number."),+ Packaging.entityMetadataComments = [+ "Principal value of the inverse cosine, in radians. The result is in [0, \960].",+ "For arguments outside the domain [-1, +1] (including \177\8734), the result is NaN. acos(NaN) is NaN.",+ "Corresponds to the IEEE 754 \2681.2 acos operation and to Haskell's acos :: Double -> Double."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "x"),+ Typing.parameterDescription = (Just "the cosine value whose arc cosine is computed"),+ Typing.parameterType = (Model.TypeLiteral (Model.LiteralTypeFloat Model.FloatTypeFloat64)),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeLiteral (Model.LiteralTypeFloat Model.FloatTypeFloat64))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++acosh :: Packaging.PrimitiveDefinition+acosh =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.math.acosh"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "The hyperbolic arc cosine of a floating-point number."),+ Packaging.entityMetadataComments = [+ "Principal value of the inverse hyperbolic cosine. The result is in [0, +\8734).",+ "For arguments less than 1 the result is NaN; acosh(1) = +0; acosh(+\8734) = +\8734; acosh(NaN) is NaN.",+ "Corresponds to the IEEE 754 \2681.2 acosh operation and to Haskell's acosh :: Double -> Double."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "x"),+ Typing.parameterDescription = (Just "the value whose inverse hyperbolic cosine is computed"),+ Typing.parameterType = (Model.TypeLiteral (Model.LiteralTypeFloat Model.FloatTypeFloat64)),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeLiteral (Model.LiteralTypeFloat Model.FloatTypeFloat64))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++add :: Packaging.PrimitiveDefinition+add =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.math.add"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Numeric addition."),+ Packaging.entityMetadataComments = [+ "Constraint-polymorphic addition over any type with a 'numeric' instance. The per-type semantics live in the instance: two's-complement wraparound for fixed-width integers (e.g. int32 addition reduces x + y modulo 2^32 and reinterprets as signed, wrapping silently on overflow), IEEE 754 round-to-nearest for floating-point, and arbitrary precision for bigint.",+ "Requires a 'numeric' type-class constraint on the argument type, which is the closest Hydra equivalent to Haskell's Num instance.",+ "The operation is total. Corresponds to Haskell's (+) :: Num a => a -> a -> a."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "x"),+ Typing.typeParameterConstraints = [+ Model.TypeClassConstraintSimple (Model.Name "numeric")]}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "arg0"),+ Typing.parameterDescription = Nothing,+ Typing.parameterType = (Model.TypeVariable (Model.Name "x")),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "arg1"),+ Typing.parameterDescription = Nothing,+ Typing.parameterType = (Model.TypeVariable (Model.Name "x")),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeVariable (Model.Name "x"))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++addFloat64 :: Packaging.PrimitiveDefinition+addFloat64 =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.math.addFloat64"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Floating-point addition."),+ Packaging.entityMetadataComments = [+ "IEEE 754 binary64 addition. The result is the value of x + y rounded to the nearest representable float64 under the roundTiesToEven rounding-direction attribute.",+ "Adding infinities of opposite sign (+\8734 + -\8734 or -\8734 + +\8734) produces a NaN; adding any value to NaN produces a NaN. The sum of two zeros is +0, except (-0) + (-0) = -0.",+ "The operation is total: it never raises, but it may produce NaN. Corresponds to the IEEE 754 \2677.4.1 addition operation and to Haskell's (+) :: Double -> Double -> Double.",+ "Deprecated since 0.18. Use: hydra.core.lib.math.add."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = (Just (Packaging.LifecycleInfo {+ Packaging.lifecycleInfoAvailableSince = Nothing,+ Packaging.lifecycleInfoDeprecatedSince = (Just (Packaging.Version "0.18"))})),+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "x"),+ Typing.parameterDescription = (Just "the first addend"),+ Typing.parameterType = (Model.TypeLiteral (Model.LiteralTypeFloat Model.FloatTypeFloat64)),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "y"),+ Typing.parameterDescription = (Just "the second addend"),+ Typing.parameterType = (Model.TypeLiteral (Model.LiteralTypeFloat Model.FloatTypeFloat64)),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeLiteral (Model.LiteralTypeFloat Model.FloatTypeFloat64))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++asin :: Packaging.PrimitiveDefinition+asin =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.math.asin"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "The arc sine of a floating-point number."),+ Packaging.entityMetadataComments = [+ "Principal value of the inverse sine, in radians. The result is in [-\960/2, +\960/2].",+ "For arguments outside the domain [-1, +1] (including \177\8734), the result is NaN; asin(\2832) = \2832; asin(NaN) is NaN.",+ "Corresponds to the IEEE 754 \2681.2 asin operation and to Haskell's asin :: Double -> Double."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "x"),+ Typing.parameterDescription = (Just "the sine value whose arc sine is computed"),+ Typing.parameterType = (Model.TypeLiteral (Model.LiteralTypeFloat Model.FloatTypeFloat64)),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeLiteral (Model.LiteralTypeFloat Model.FloatTypeFloat64))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++asinh :: Packaging.PrimitiveDefinition+asinh =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.math.asinh"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "The hyperbolic arc sine of a floating-point number."),+ Packaging.entityMetadataComments = [+ "Principal value of the inverse hyperbolic sine. Defined for all finite reals; asinh(\2832) = \2832; asinh(\177\8734) = \177\8734; asinh(NaN) is NaN.",+ "Corresponds to the IEEE 754 \2681.2 asinh operation and to Haskell's asinh :: Double -> Double."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "x"),+ Typing.parameterDescription = (Just "the value whose inverse hyperbolic sine is computed"),+ Typing.parameterType = (Model.TypeLiteral (Model.LiteralTypeFloat Model.FloatTypeFloat64)),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeLiteral (Model.LiteralTypeFloat Model.FloatTypeFloat64))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++atan :: Packaging.PrimitiveDefinition+atan =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.math.atan"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "The arc tangent of a floating-point number."),+ Packaging.entityMetadataComments = [+ "Principal value of the inverse tangent, in radians. The result is in (-\960/2, +\960/2); atan(\2832) = \2832; atan(\177\8734) = \177\960/2; atan(NaN) is NaN.",+ "Corresponds to the IEEE 754 \2681.2 atan operation and to Haskell's atan :: Double -> Double."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "x"),+ Typing.parameterDescription = (Just "the tangent value whose arc tangent is computed"),+ Typing.parameterType = (Model.TypeLiteral (Model.LiteralTypeFloat Model.FloatTypeFloat64)),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeLiteral (Model.LiteralTypeFloat Model.FloatTypeFloat64))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++atan2 :: Packaging.PrimitiveDefinition+atan2 =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.math.atan2"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "The two-argument arc tangent (atan2)."),+ Packaging.entityMetadataComments = [+ "atan2(y, x) returns the angle in radians, in (-\960, +\960], from the positive x-axis to the point (x, y), using the signs of both arguments to determine the quadrant.",+ "Special match follow IEEE 754 \2681.2: atan2(\2832, +x>0) = \2832; atan2(\2832, -x<0) = \177\960; atan2(\177y>0, 0) = \177\960/2; atan2(\177y, +\8734) = \2832; atan2(\177y, -\8734) = \177\960; atan2(\177\8734, finite) = \177\960/2; atan2(\177\8734, +\8734) = \177\960/4; atan2(\177\8734, -\8734) = \2835\960/4; atan2 of any NaN argument is NaN.",+ "Corresponds to Haskell's atan2 :: Double -> Double -> Double."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "y"),+ Typing.parameterDescription = (Just "the ordinate (y-coordinate)"),+ Typing.parameterType = (Model.TypeLiteral (Model.LiteralTypeFloat Model.FloatTypeFloat64)),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "x"),+ Typing.parameterDescription = (Just "the abscissa (x-coordinate)"),+ Typing.parameterType = (Model.TypeLiteral (Model.LiteralTypeFloat Model.FloatTypeFloat64)),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeLiteral (Model.LiteralTypeFloat Model.FloatTypeFloat64))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++atanh :: Packaging.PrimitiveDefinition+atanh =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.math.atanh"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "The hyperbolic arc tangent of a floating-point number."),+ Packaging.entityMetadataComments = [+ "Principal value of the inverse hyperbolic tangent. Defined for arguments in (-1, +1); atanh(\2833) = \177\8734 (with division-by-zero exception in IEEE 754); arguments outside [-1, +1] produce NaN; atanh(\2832) = \2832; atanh(NaN) is NaN.",+ "Corresponds to the IEEE 754 \2681.2 atanh operation and to Haskell's atanh :: Double -> Double."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "x"),+ Typing.parameterDescription = (Just "the value whose inverse hyperbolic tangent is computed"),+ Typing.parameterType = (Model.TypeLiteral (Model.LiteralTypeFloat Model.FloatTypeFloat64)),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeLiteral (Model.LiteralTypeFloat Model.FloatTypeFloat64))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++ceiling :: Packaging.PrimitiveDefinition+ceiling =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.math.ceiling"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "The smallest integer greater than or equal to the argument, as a float."),+ Packaging.entityMetadataComments = [+ "The smallest integer value not less than the argument, returned as a float64. Equivalent to IEEE 754 \2677.3.1 roundToIntegralTowardPositive: ceiling(\2832) = \2832; ceiling(\177\8734) = \177\8734; ceiling(NaN) is NaN; the sign of a negative result is preserved when rounding to zero (e.g. ceiling(-0.5) = -0).",+ "Note that the return type is float64, not an integer type, so the result can exceed the integer range.",+ "Corresponds to Haskell's fromIntegral . ceiling :: Double -> Double."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "x"),+ Typing.parameterDescription = (Just "the value to round up toward positive infinity"),+ Typing.parameterType = (Model.TypeLiteral (Model.LiteralTypeFloat Model.FloatTypeFloat64)),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeLiteral (Model.LiteralTypeFloat Model.FloatTypeFloat64))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++cos :: Packaging.PrimitiveDefinition+cos =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.math.cos"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "The cosine of a floating-point number."),+ Packaging.entityMetadataComments = [+ "Cosine of an angle in radians, correctly rounded for finite arguments. The result is in [-1, +1]; cos(\2832) = 1; cos(\177\8734) is NaN (with invalid-operation exception in IEEE 754); cos(NaN) is NaN.",+ "Corresponds to the IEEE 754 \2681.2 cos operation and to Haskell's cos :: Double -> Double."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "x"),+ Typing.parameterDescription = (Just "the angle in radians"),+ Typing.parameterType = (Model.TypeLiteral (Model.LiteralTypeFloat Model.FloatTypeFloat64)),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeLiteral (Model.LiteralTypeFloat Model.FloatTypeFloat64))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++cosh :: Packaging.PrimitiveDefinition+cosh =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.math.cosh"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "The hyperbolic cosine of a floating-point number."),+ Packaging.entityMetadataComments = [+ "Hyperbolic cosine. The result is in [1, +\8734]; cosh(\2832) = 1; cosh(\177\8734) = +\8734; cosh(NaN) is NaN. Large-magnitude arguments overflow to +\8734.",+ "Corresponds to the IEEE 754 \2681.2 cosh operation and to Haskell's cosh :: Double -> Double."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "x"),+ Typing.parameterDescription = (Just "the value whose hyperbolic cosine is computed"),+ Typing.parameterType = (Model.TypeLiteral (Model.LiteralTypeFloat Model.FloatTypeFloat64)),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeLiteral (Model.LiteralTypeFloat Model.FloatTypeFloat64))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++div :: Packaging.PrimitiveDefinition+div =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.math.div"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Integral division, or Nothing if dividing by zero."),+ Packaging.entityMetadataComments = [+ "Constraint-polymorphic total integer division over any type with an 'integral' instance: div(x, y) returns Just(x divided by y, rounded toward negative infinity) when y is non-zero, and Nothing when y = 0.",+ "The division rounds toward negative infinity (floor), so for example div(-7, 2) = Just(-4).",+ "For fixed-width signed integers, the boundary case div(minBound, -1) wraps to minBound (the two's-complement overflow), since the mathematical result is not representable at that width.",+ "Requires an 'integral' type-class constraint on the argument type.",+ "Corresponds to Haskell's div :: Integral a => a -> a -> a, wrapped in maybe to make the zero-divisor case total."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "x"),+ Typing.typeParameterConstraints = [+ Model.TypeClassConstraintSimple (Model.Name "integral")]}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "x"),+ Typing.parameterDescription = (Just "the dividend"),+ Typing.parameterType = (Model.TypeVariable (Model.Name "x")),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "y"),+ Typing.parameterDescription = (Just "the divisor"),+ Typing.parameterType = (Model.TypeVariable (Model.Name "x")),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeOptional (Model.TypeVariable (Model.Name "x")))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++divide :: Packaging.PrimitiveDefinition+divide =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.math.divide"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Floating-point division."),+ Packaging.entityMetadataComments = [+ "Constraint-polymorphic division over any type with a 'fractional' instance (float32, float64). IEEE 754 division: the result is x / y correctly rounded (roundTiesToEven) for finite y \8800 0.",+ "The operation is total via IEEE sentinels rather than an optional codomain: for finite nonzero x, x / \2832 = \177\8734 (sign = XOR of the operand signs); \2832 / \2832 and \177\8734 / \177\8734 are NaN; \177\8734 / finite = \177\8734 (sign XOR); finite / \177\8734 = \2832 (sign XOR); NaN propagates unconditionally.",+ "Requires a 'fractional' type-class constraint on the argument type.",+ "Corresponds to Haskell's (/) :: Fractional a => a -> a -> a."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "x"),+ Typing.typeParameterConstraints = [+ Model.TypeClassConstraintSimple (Model.Name "fractional")]}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "arg0"),+ Typing.parameterDescription = Nothing,+ Typing.parameterType = (Model.TypeVariable (Model.Name "x")),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "arg1"),+ Typing.parameterDescription = Nothing,+ Typing.parameterType = (Model.TypeVariable (Model.Name "x")),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeVariable (Model.Name "x"))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++e :: Packaging.PrimitiveDefinition+e =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.math.e"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Euler's constant (the base of the natural logarithm)."),+ Packaging.entityMetadataComments = [+ "The mathematical constant e \8776 2.718281828459045, the base of the natural logarithm, as the nearest representable float64. Equal to exp(1).",+ "Corresponds to Haskell's exp 1 :: Double."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeLiteral (Model.LiteralTypeFloat Model.FloatTypeFloat64))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++even :: Packaging.PrimitiveDefinition+even =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.math.even"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Test whether a value is even."),+ Packaging.entityMetadataComments = [+ "Constraint-polymorphic parity test over any type with an 'integral' instance: true if the argument is divisible by 2 (i.e. x mod 2 = 0), false otherwise.",+ "Total on all integral inputs including negative numbers and signed minBound (parity is preserved by two's-complement wraparound).",+ "Requires an 'integral' type-class constraint on the argument type.",+ "Corresponds to Haskell's even :: Integral a => a -> Bool."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "x"),+ Typing.typeParameterConstraints = [+ Model.TypeClassConstraintSimple (Model.Name "integral")]}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "x"),+ Typing.parameterDescription = (Just "the value to test for evenness"),+ Typing.parameterType = (Model.TypeVariable (Model.Name "x")),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeLiteral Model.LiteralTypeBoolean)}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++exp :: Packaging.PrimitiveDefinition+exp =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.math.exp"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "The exponential function."),+ Packaging.entityMetadataComments = [+ "The exponential function: exp(x) = e^x. exp(\2832) = 1; exp(-\8734) = +0; exp(+\8734) = +\8734; exp(NaN) is NaN. Large positive arguments overflow to +\8734; large negative arguments underflow to +0.",+ "Corresponds to the IEEE 754 \2681.2 exp operation and to Haskell's exp :: Double -> Double."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "x"),+ Typing.parameterDescription = (Just "the exponent"),+ Typing.parameterType = (Model.TypeLiteral (Model.LiteralTypeFloat Model.FloatTypeFloat64)),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeLiteral (Model.LiteralTypeFloat Model.FloatTypeFloat64))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++floor :: Packaging.PrimitiveDefinition+floor =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.math.floor"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "The largest integer less than or equal to the argument, as a float."),+ Packaging.entityMetadataComments = [+ "The largest integer value not greater than the argument, returned as a float64. Equivalent to IEEE 754 \2677.3.1 roundToIntegralTowardNegative: floor(\2832) = \2832; floor(\177\8734) = \177\8734; floor(NaN) is NaN.",+ "Note that the return type is float64, not an integer type, so the result can exceed the integer range.",+ "Corresponds to Haskell's fromIntegral . floor :: Double -> Double."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "x"),+ Typing.parameterDescription = (Just "the value to round down toward negative infinity"),+ Typing.parameterType = (Model.TypeLiteral (Model.LiteralTypeFloat Model.FloatTypeFloat64)),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeLiteral (Model.LiteralTypeFloat Model.FloatTypeFloat64))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++log :: Packaging.PrimitiveDefinition+log =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.math.log"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "The natural logarithm."),+ Packaging.entityMetadataComments = [+ "The natural (base-e) logarithm. log(1) = +0; log(+0) = log(-0) = -\8734 (with division-by-zero exception in IEEE 754); log(x) for x < 0 is NaN (with invalid-operation exception); log(+\8734) = +\8734; log(NaN) is NaN.",+ "Corresponds to the IEEE 754 \2681.2 log operation and to Haskell's log :: Double -> Double."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "x"),+ Typing.parameterDescription = (Just "the value whose natural logarithm is computed"),+ Typing.parameterType = (Model.TypeLiteral (Model.LiteralTypeFloat Model.FloatTypeFloat64)),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeLiteral (Model.LiteralTypeFloat Model.FloatTypeFloat64))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++logBase :: Packaging.PrimitiveDefinition+logBase =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.math.logBase"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Logarithm of the second argument in the base of the first."),+ Packaging.entityMetadataComments = [+ "logBase(b, x) computes the logarithm of x in base b, equivalent to log(x) / log(b).",+ "Inherits the special-case behavior of log for each argument (NaN propagation, sign of zeros, division by zero on log of a zero, NaN on negative arguments).",+ "Corresponds to Haskell's logBase :: Double -> Double -> Double."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "b"),+ Typing.parameterDescription = (Just "the logarithm base"),+ Typing.parameterType = (Model.TypeLiteral (Model.LiteralTypeFloat Model.FloatTypeFloat64)),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "x"),+ Typing.parameterDescription = (Just "the value whose logarithm is computed"),+ Typing.parameterType = (Model.TypeLiteral (Model.LiteralTypeFloat Model.FloatTypeFloat64)),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeLiteral (Model.LiteralTypeFloat Model.FloatTypeFloat64))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++mod :: Packaging.PrimitiveDefinition+mod =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.math.mod"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Integral modulus, or Nothing if dividing by zero."),+ Packaging.entityMetadataComments = [+ "Constraint-polymorphic total integer modulus over any type with an 'integral' instance: mod(x, y) returns Just(x mod y) when y is non-zero, and Nothing when y = 0.",+ "The result satisfies the identity x = (div(x, y) result) * y + (mod(x, y) result), so the sign of the result matches the sign of y (Knuth-style floor division). For example mod(-7, 2) = Just(1).",+ "Requires an 'integral' type-class constraint on the argument type.",+ "Corresponds to Haskell's mod :: Integral a => a -> a -> a, wrapped in maybe to make the zero-divisor case total."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "x"),+ Typing.typeParameterConstraints = [+ Model.TypeClassConstraintSimple (Model.Name "integral")]}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "x"),+ Typing.parameterDescription = (Just "the dividend"),+ Typing.parameterType = (Model.TypeVariable (Model.Name "x")),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "y"),+ Typing.parameterDescription = (Just "the divisor"),+ Typing.parameterType = (Model.TypeVariable (Model.Name "x")),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeOptional (Model.TypeVariable (Model.Name "x")))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++mul :: Packaging.PrimitiveDefinition+mul =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.math.mul"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Numeric multiplication."),+ Packaging.entityMetadataComments = [+ "Constraint-polymorphic multiplication over any type with a 'numeric' instance. The per-type semantics live in the instance: two's-complement wraparound for fixed-width integers (e.g. int32 multiplication reduces x * y modulo 2^32 and reinterprets as signed, wrapping silently on overflow), IEEE 754 round-to-nearest for floating-point, and arbitrary precision for bigint.",+ "Requires a 'numeric' type-class constraint on the argument type.",+ "The operation is total. Corresponds to Haskell's (*) :: Num a => a -> a -> a."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "x"),+ Typing.typeParameterConstraints = [+ Model.TypeClassConstraintSimple (Model.Name "numeric")]}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "arg0"),+ Typing.parameterDescription = Nothing,+ Typing.parameterType = (Model.TypeVariable (Model.Name "x")),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "arg1"),+ Typing.parameterDescription = Nothing,+ Typing.parameterType = (Model.TypeVariable (Model.Name "x")),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeVariable (Model.Name "x"))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++mulFloat64 :: Packaging.PrimitiveDefinition+mulFloat64 =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.math.mulFloat64"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Floating-point multiplication."),+ Packaging.entityMetadataComments = [+ "IEEE 754 binary64 multiplication. The result is the value of x * y rounded to the nearest representable float64 under the roundTiesToEven rounding-direction attribute.",+ "Multiplying 0 by \177\8734 (in either order) produces a NaN (with invalid-operation exception in IEEE 754); multiplying any value by NaN produces a NaN. The result's sign is the XOR of the operand signs (\2832 * \2832 = \2832 accordingly).",+ "The operation is total: it never raises, but it may produce NaN or \177\8734. Corresponds to the IEEE 754 \2677.4.1 multiplication operation and to Haskell's (*) :: Double -> Double -> Double.",+ "Deprecated since 0.18. Use: hydra.core.lib.math.mul."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = (Just (Packaging.LifecycleInfo {+ Packaging.lifecycleInfoAvailableSince = Nothing,+ Packaging.lifecycleInfoDeprecatedSince = (Just (Packaging.Version "0.18"))})),+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "x"),+ Typing.parameterDescription = (Just "the first factor"),+ Typing.parameterType = (Model.TypeLiteral (Model.LiteralTypeFloat Model.FloatTypeFloat64)),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "y"),+ Typing.parameterDescription = (Just "the second factor"),+ Typing.parameterType = (Model.TypeLiteral (Model.LiteralTypeFloat Model.FloatTypeFloat64)),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeLiteral (Model.LiteralTypeFloat Model.FloatTypeFloat64))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++negate :: Packaging.PrimitiveDefinition+negate =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.math.negate"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Numeric negation."),+ Packaging.entityMetadataComments = [+ "Constraint-polymorphic arithmetic negation over any type with a 'numeric' instance. The per-type semantics live in the instance: for fixed-width integers the result is 0 - x reduced modulo 2^32 and reinterpreted as signed (total but not injective at the boundary: negate(minBound) = minBound, because +2147483648 is not representable in int32); for floating-point it flips the sign bit per IEEE 754 \2677.5.1.",+ "Requires a 'numeric' type-class constraint on the argument type.",+ "Corresponds to Haskell's negate :: Num a => a -> a."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "x"),+ Typing.typeParameterConstraints = [+ Model.TypeClassConstraintSimple (Model.Name "numeric")]}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "arg0"),+ Typing.parameterDescription = Nothing,+ Typing.parameterType = (Model.TypeVariable (Model.Name "x")),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeVariable (Model.Name "x"))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++negateFloat64 :: Packaging.PrimitiveDefinition+negateFloat64 =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.math.negateFloat64"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Negate a floating-point number."),+ Packaging.entityMetadataComments = [+ "Sign reversal of a float64. Equivalent to IEEE 754 \2677.5.1 negate: flips the sign bit, so negate(\2832) = \2832 (sign flips), negate(\177\8734) = \177\8734 (sign flips), and negate(NaN) is a NaN (sign may flip; payload preserved).",+ "This is a bit-level operation that does not raise any floating-point exception. Corresponds to Haskell's negate :: Double -> Double.",+ "Deprecated since 0.18. Use: hydra.core.lib.math.negate."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = (Just (Packaging.LifecycleInfo {+ Packaging.lifecycleInfoAvailableSince = Nothing,+ Packaging.lifecycleInfoDeprecatedSince = (Just (Packaging.Version "0.18"))})),+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "x"),+ Typing.parameterDescription = (Just "the value to negate"),+ Typing.parameterType = (Model.TypeLiteral (Model.LiteralTypeFloat Model.FloatTypeFloat64)),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeLiteral (Model.LiteralTypeFloat Model.FloatTypeFloat64))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++odd :: Packaging.PrimitiveDefinition+odd =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.math.odd"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Test whether a value is odd."),+ Packaging.entityMetadataComments = [+ "Constraint-polymorphic parity test over any type with an 'integral' instance: true if the argument is not divisible by 2 (i.e. x mod 2 \8800 0), false otherwise.",+ "Total on all integral inputs including negative numbers and signed minBound. Requires an 'integral' type-class constraint on the argument type.",+ "Corresponds to Haskell's odd :: Integral a => a -> Bool."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "x"),+ Typing.typeParameterConstraints = [+ Model.TypeClassConstraintSimple (Model.Name "integral")]}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "x"),+ Typing.parameterDescription = (Just "the value to test for oddness"),+ Typing.parameterType = (Model.TypeVariable (Model.Name "x")),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeLiteral Model.LiteralTypeBoolean)}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = (Just (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "x"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.logic.not")),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.math.even")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "x"))}))}))})))}++pi :: Packaging.PrimitiveDefinition+pi =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.math.pi"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "The mathematical constant pi."),+ Packaging.entityMetadataComments = [+ "The mathematical constant \960 \8776 3.141592653589793, the ratio of a circle's circumference to its diameter, as the nearest representable float64.",+ "Corresponds to Haskell's pi :: Double."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeLiteral (Model.LiteralTypeFloat Model.FloatTypeFloat64))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++pow :: Packaging.PrimitiveDefinition+pow =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.math.pow"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Raise the first argument to the power of the second."),+ Packaging.entityMetadataComments = [+ "pow(x, y) = x^y.",+ "Follows the IEEE 754 \2681.2 pow operation: pow(\2832, y) for y < 0 is \177\8734 (with division-by-zero exception); pow(\2832, y) for y > 0 is \2832 if y is an odd integer, else +0; pow(1, y) = 1 for any y including NaN; pow(x, \2832) = 1 for any x including NaN; pow(x, y) for negative x and non-integer y is NaN (with invalid-operation exception); pow(\177\8734, y) follows the limits in the usual way. Otherwise the result is x^y rounded to the nearest representable float64.",+ "Corresponds to Haskell's (**) :: Double -> Double -> Double."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "x"),+ Typing.parameterDescription = (Just "the base"),+ Typing.parameterType = (Model.TypeLiteral (Model.LiteralTypeFloat Model.FloatTypeFloat64)),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "y"),+ Typing.parameterDescription = (Just "the exponent"),+ Typing.parameterType = (Model.TypeLiteral (Model.LiteralTypeFloat Model.FloatTypeFloat64)),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeLiteral (Model.LiteralTypeFloat Model.FloatTypeFloat64))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++range :: Packaging.PrimitiveDefinition+range =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.math.range"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Construct the half-open integer range from the first argument up to (but excluding) the second."),+ Packaging.entityMetadataComments = [+ "range(a, b) returns the list [a, a+1, ..., b-1]. The range is inclusive of the lower bound and exclusive of the upper bound; if a >= b the result is the empty list (i.e. the range does not count downward, and an empty range is the natural result of equal bounds). The length of the result is max(0, b - a).",+ "Does not directly correspond to Haskell's enumFromTo :: Int32 -> Int32 -> [Int32] (which is inclusive of both bounds, i.e. [a..b]); range(a, b) is equivalent to [a .. b-1]. This matches the half-open convention of Python's range, Rust's a..b, Go, and Java's IntStream.range."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "a"),+ Typing.parameterDescription = (Just "the inclusive lower bound of the range"),+ Typing.parameterType = (Model.TypeLiteral (Model.LiteralTypeInteger Model.IntegerTypeInt32)),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "b"),+ Typing.parameterDescription = (Just "the exclusive upper bound of the range"),+ Typing.parameterType = (Model.TypeLiteral (Model.LiteralTypeInteger Model.IntegerTypeInt32)),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeList (Model.TypeLiteral (Model.LiteralTypeInteger Model.IntegerTypeInt32)))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++rem :: Packaging.PrimitiveDefinition+rem =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.math.rem"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Integral remainder, or Nothing if dividing by zero."),+ Packaging.entityMetadataComments = [+ "Constraint-polymorphic total integer remainder over any type with an 'integral' instance: rem(x, y) returns Just(x rem y) when y is non-zero, and Nothing when y = 0.",+ "The result satisfies x = (truncate(x / y)) * y + (rem(x, y) result), so the sign of the result matches the sign of x (truncated division, C-style remainder). For example rem(-7, 2) = Just(-1).",+ "For fixed-width signed integers, the boundary case rem(minBound, -1) is 0 (no overflow, since the quotient overflow is absorbed by div, not rem).",+ "Requires an 'integral' type-class constraint on the argument type.",+ "Corresponds to Haskell's rem :: Integral a => a -> a -> a, wrapped in maybe to make the zero-divisor case total."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "x"),+ Typing.typeParameterConstraints = [+ Model.TypeClassConstraintSimple (Model.Name "integral")]}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "x"),+ Typing.parameterDescription = (Just "the dividend"),+ Typing.parameterType = (Model.TypeVariable (Model.Name "x")),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "y"),+ Typing.parameterDescription = (Just "the divisor"),+ Typing.parameterType = (Model.TypeVariable (Model.Name "x")),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeOptional (Model.TypeVariable (Model.Name "x")))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++round :: Packaging.PrimitiveDefinition+round =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.math.round"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Round a floating-point number to the nearest integer-valued float."),+ Packaging.entityMetadataComments = [+ "Round to the nearest integer value, returned as a float64, with ties rounded to the nearest even integer (banker's rounding). Equivalent to IEEE 754 \2677.3.1 roundToIntegralTiesToEven: round(\2832) = \2832; round(\177\8734) = \177\8734; round(NaN) is NaN.",+ "Note that the return type is float64, not an integer type, so the result can exceed the integer range.",+ "Corresponds to Haskell's fromIntegral . round :: Double -> Double."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "x"),+ Typing.parameterDescription = (Just "the value to round to the nearest integer"),+ Typing.parameterType = (Model.TypeLiteral (Model.LiteralTypeFloat Model.FloatTypeFloat64)),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeLiteral (Model.LiteralTypeFloat Model.FloatTypeFloat64))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++roundFloat32 :: Packaging.PrimitiveDefinition+roundFloat32 =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.math.roundFloat32"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Round a float32 to the given number of decimal places."),+ Packaging.entityMetadataComments = [+ "roundFloat32(n, x) rounds the float32 value x to n decimal places using round-half-to-even. The result is the nearest float32 representation of x rounded to that decimal precision; if the exact decimal-rounded value is not representable in float32 (the usual case), the closest float32 is returned.",+ "Special values pass through: roundFloat32(n, \2832) = \2832; roundFloat32(n, \177\8734) = \177\8734; roundFloat32(n, NaN) is NaN.",+ "Negative n is supported in principle (rounding to powers of ten above 1); host implementations may differ on out-of-range n."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "n"),+ Typing.parameterDescription = (Just "the number of decimal places to round to"),+ Typing.parameterType = (Model.TypeLiteral (Model.LiteralTypeInteger Model.IntegerTypeInt32)),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "x"),+ Typing.parameterDescription = (Just "the float32 value to round"),+ Typing.parameterType = (Model.TypeLiteral (Model.LiteralTypeFloat Model.FloatTypeFloat32)),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeLiteral (Model.LiteralTypeFloat Model.FloatTypeFloat32))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++roundFloat64 :: Packaging.PrimitiveDefinition+roundFloat64 =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.math.roundFloat64"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Round a float64 to the given number of decimal places."),+ Packaging.entityMetadataComments = [+ "roundFloat64(n, x) rounds the float64 value x to n decimal places using round-half-to-even. The result is the nearest float64 representation of x rounded to that decimal precision; if the exact decimal-rounded value is not representable in float64 (the usual case), the closest float64 is returned.",+ "Special values pass through: roundFloat64(n, \2832) = \2832; roundFloat64(n, \177\8734) = \177\8734; roundFloat64(n, NaN) is NaN.",+ "Negative n is supported in principle (rounding to powers of ten above 1); host implementations may differ on out-of-range n."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "n"),+ Typing.parameterDescription = (Just "the number of decimal places to round to"),+ Typing.parameterType = (Model.TypeLiteral (Model.LiteralTypeInteger Model.IntegerTypeInt32)),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "x"),+ Typing.parameterDescription = (Just "the float64 value to round"),+ Typing.parameterType = (Model.TypeLiteral (Model.LiteralTypeFloat Model.FloatTypeFloat64)),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeLiteral (Model.LiteralTypeFloat Model.FloatTypeFloat64))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++signum :: Packaging.PrimitiveDefinition+signum =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.math.signum"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Numeric sign."),+ Packaging.entityMetadataComments = [+ "Constraint-polymorphic sign function over any type with a 'numeric' instance. For integer types, signum(x) returns -1 if x < 0, 0 if x = 0, and 1 if x > 0 (same width as the argument); unsigned integers return only 0 or 1. The function satisfies abs(x) * signum(x) = x for all integer instances except signed minBound (where the identity fails because +maxBound+1 is not representable).",+ "For floating-point, signum(x) returns \2833.0 for nonzero finite or infinite x (per IEEE 754 \2677.5.1); signum(\2832) = \2832 (the sign of the input zero is preserved, not collapsed to a single zero); signum(NaN) is NaN. A naive three-branch implementation (positive/negative/else- zero) gets both of these float match wrong and must not be used.",+ "Requires a 'numeric' type-class constraint on the argument type.",+ "Corresponds to Haskell's signum :: Num a => a -> a."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "x"),+ Typing.typeParameterConstraints = [+ Model.TypeClassConstraintSimple (Model.Name "numeric")]}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "arg0"),+ Typing.parameterDescription = Nothing,+ Typing.parameterType = (Model.TypeVariable (Model.Name "x")),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeVariable (Model.Name "x"))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++sin :: Packaging.PrimitiveDefinition+sin =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.math.sin"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "The sine of a floating-point number."),+ Packaging.entityMetadataComments = [+ "Sine of an angle in radians, correctly rounded for finite arguments. The result is in [-1, +1]; sin(\2832) = \2832; sin(\177\8734) is NaN (with invalid-operation exception in IEEE 754); sin(NaN) is NaN.",+ "Corresponds to the IEEE 754 \2681.2 sin operation and to Haskell's sin :: Double -> Double."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "x"),+ Typing.parameterDescription = (Just "the angle in radians"),+ Typing.parameterType = (Model.TypeLiteral (Model.LiteralTypeFloat Model.FloatTypeFloat64)),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeLiteral (Model.LiteralTypeFloat Model.FloatTypeFloat64))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++sinh :: Packaging.PrimitiveDefinition+sinh =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.math.sinh"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "The hyperbolic sine of a floating-point number."),+ Packaging.entityMetadataComments = [+ "Hyperbolic sine. sinh(\2832) = \2832; sinh(\177\8734) = \177\8734; sinh(NaN) is NaN. Large-magnitude arguments overflow to \177\8734.",+ "Corresponds to the IEEE 754 \2681.2 sinh operation and to Haskell's sinh :: Double -> Double."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "x"),+ Typing.parameterDescription = (Just "the value whose hyperbolic sine is computed"),+ Typing.parameterType = (Model.TypeLiteral (Model.LiteralTypeFloat Model.FloatTypeFloat64)),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeLiteral (Model.LiteralTypeFloat Model.FloatTypeFloat64))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++sqrt :: Packaging.PrimitiveDefinition+sqrt =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.math.sqrt"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "The non-negative square root of a floating-point number."),+ Packaging.entityMetadataComments = [+ "IEEE 754 binary64 square root. The result is the value of \8730x correctly rounded to the nearest representable float64 under roundTiesToEven.",+ "sqrt(+0) = +0; sqrt(-0) = -0 (sign preserved); sqrt(x) for x < 0 (including -\8734) is NaN (with invalid-operation exception); sqrt(+\8734) = +\8734; sqrt(NaN) is NaN.",+ "Corresponds to the IEEE 754 \2677.4.1 squareRoot operation and to Haskell's sqrt :: Double -> Double."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "x"),+ Typing.parameterDescription = (Just "the value whose square root is computed"),+ Typing.parameterType = (Model.TypeLiteral (Model.LiteralTypeFloat Model.FloatTypeFloat64)),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeLiteral (Model.LiteralTypeFloat Model.FloatTypeFloat64))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++sub :: Packaging.PrimitiveDefinition+sub =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.math.sub"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Numeric subtraction."),+ Packaging.entityMetadataComments = [+ "Constraint-polymorphic subtraction over any type with a 'numeric' instance. The per-type semantics live in the instance: two's-complement wraparound for fixed-width integers (e.g. int32 subtraction reduces x - y modulo 2^32 and reinterprets as signed, wrapping silently on overflow), IEEE 754 round-to-nearest for floating-point, and arbitrary precision for bigint.",+ "Requires a 'numeric' type-class constraint on the argument type.",+ "The operation is total. Corresponds to Haskell's (-) :: Num a => a -> a -> a."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "x"),+ Typing.typeParameterConstraints = [+ Model.TypeClassConstraintSimple (Model.Name "numeric")]}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "arg0"),+ Typing.parameterDescription = Nothing,+ Typing.parameterType = (Model.TypeVariable (Model.Name "x")),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "arg1"),+ Typing.parameterDescription = Nothing,+ Typing.parameterType = (Model.TypeVariable (Model.Name "x")),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeVariable (Model.Name "x"))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++subFloat64 :: Packaging.PrimitiveDefinition+subFloat64 =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.math.subFloat64"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Floating-point subtraction."),+ Packaging.entityMetadataComments = [+ "IEEE 754 binary64 subtraction, defined as x + (-y). The result is correctly rounded to the nearest representable float64 under roundTiesToEven.",+ "Subtracting infinities of the same sign (+\8734 - +\8734 or -\8734 - -\8734) produces a NaN; subtracting any value involving NaN produces a NaN. The difference of two equal finite values is +0 (or -0 under round-toward-negative, which is not the default).",+ "The operation is total: it never raises, but it may produce NaN. Corresponds to the IEEE 754 \2677.4.1 subtraction operation and to Haskell's (-) :: Double -> Double -> Double.",+ "Deprecated since 0.18. Use: hydra.core.lib.math.sub."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = (Just (Packaging.LifecycleInfo {+ Packaging.lifecycleInfoAvailableSince = Nothing,+ Packaging.lifecycleInfoDeprecatedSince = (Just (Packaging.Version "0.18"))})),+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "x"),+ Typing.parameterDescription = (Just "the minuend"),+ Typing.parameterType = (Model.TypeLiteral (Model.LiteralTypeFloat Model.FloatTypeFloat64)),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "y"),+ Typing.parameterDescription = (Just "the subtrahend"),+ Typing.parameterType = (Model.TypeLiteral (Model.LiteralTypeFloat Model.FloatTypeFloat64)),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeLiteral (Model.LiteralTypeFloat Model.FloatTypeFloat64))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++tan :: Packaging.PrimitiveDefinition+tan =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.math.tan"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "The tangent of a floating-point number."),+ Packaging.entityMetadataComments = [+ "Tangent of an angle in radians, correctly rounded for finite arguments. tan(\2832) = \2832; near odd multiples of \960/2 the result has large magnitude but remains finite (no exception is raised); tan(\177\8734) is NaN (with invalid-operation exception in IEEE 754); tan(NaN) is NaN.",+ "Corresponds to the IEEE 754 \2681.2 tan operation and to Haskell's tan :: Double -> Double."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "x"),+ Typing.parameterDescription = (Just "the angle in radians"),+ Typing.parameterType = (Model.TypeLiteral (Model.LiteralTypeFloat Model.FloatTypeFloat64)),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeLiteral (Model.LiteralTypeFloat Model.FloatTypeFloat64))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++tanh :: Packaging.PrimitiveDefinition+tanh =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.math.tanh"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "The hyperbolic tangent of a floating-point number."),+ Packaging.entityMetadataComments = [+ "Hyperbolic tangent. The result is in [-1, +1]; tanh(\2832) = \2832; tanh(\177\8734) = \2833; tanh(NaN) is NaN.",+ "Corresponds to the IEEE 754 \2681.2 tanh operation and to Haskell's tanh :: Double -> Double."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "x"),+ Typing.parameterDescription = (Just "the value whose hyperbolic tangent is computed"),+ Typing.parameterType = (Model.TypeLiteral (Model.LiteralTypeFloat Model.FloatTypeFloat64)),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeLiteral (Model.LiteralTypeFloat Model.FloatTypeFloat64))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++truncate :: Packaging.PrimitiveDefinition+truncate =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.math.truncate"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Truncate a floating-point number toward zero, as a float."),+ Packaging.entityMetadataComments = [+ "Round toward zero (truncate the fractional part), returned as a float64. Equivalent to IEEE 754 \2677.3.1 roundToIntegralTowardZero: truncate(\2832) = \2832; truncate(\177\8734) = \177\8734; truncate(NaN) is NaN; sign of the result matches the sign of the argument (so truncate(-0.7) = -0, truncate(+0.7) = +0).",+ "Note that the return type is float64, not an integer type, so the result can exceed the integer range.",+ "Corresponds to Haskell's fromIntegral . truncate :: Double -> Double."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "x"),+ Typing.parameterDescription = (Just "the value to truncate toward zero"),+ Typing.parameterType = (Model.TypeLiteral (Model.LiteralTypeFloat Model.FloatTypeFloat64)),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeLiteral (Model.LiteralTypeFloat Model.FloatTypeFloat64))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}
@@ -0,0 +1,903 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Primitives in the hydra.core.lib.optionals module.++module Hydra.Core.Lib.Optionals where++import qualified Hydra.Core.Ast as Ast+import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Diff as Diff+import qualified Hydra.Core.Docs as Docs+import qualified Hydra.Core.Error.Checking as Checking+import qualified Hydra.Core.Error.File as ErrorFile+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Error.Packaging as ErrorPackaging+import qualified Hydra.Core.Error.System as ErrorSystem+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Json.Model as JsonModel+import qualified Hydra.Core.Markdown as Markdown+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Parsing as Parsing+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Query as Query+import qualified Hydra.Core.Regex as Regex+import qualified Hydra.Core.Relational as Relational+import qualified Hydra.Core.System as System+import qualified Hydra.Core.Tabular as Tabular+import qualified Hydra.Core.Testing as Testing+import qualified Hydra.Core.Time as Time+import qualified Hydra.Core.Topology as Topology+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Validation as Validation+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++apply :: Packaging.PrimitiveDefinition+apply =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.optionals.apply"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Applicative apply for optionals: combine an optional function and an optional argument."),+ Packaging.entityMetadataComments = [+ "apply(mf, mx) returns given(f x) when mf is given(f) and mx is given(x), and none if either is none.",+ "The applicative apply for optionals; threads a function-in-context with a value-in-context.",+ "Total. Corresponds to Haskell's (<*>) :: Maybe (a -> b) -> Maybe a -> Maybe b."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "x"),+ Typing.typeParameterConstraints = []},+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "y"),+ Typing.typeParameterConstraints = []}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "mf"),+ Typing.parameterDescription = (Just "the optional function"),+ Typing.parameterType = (Model.TypeOptional (Model.TypeFunction (Model.FunctionType {+ Model.functionTypeDomain = (Model.TypeVariable (Model.Name "x")),+ Model.functionTypeCodomain = (Model.TypeVariable (Model.Name "y"))}))),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "mx"),+ Typing.parameterDescription = (Just "the optional argument"),+ Typing.parameterType = (Model.TypeOptional (Model.TypeVariable (Model.Name "x"))),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeOptional (Model.TypeVariable (Model.Name "y")))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = (Just (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "mf"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "mx"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.optionals.bind")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "mf"))})),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "f"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.optionals.map")),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "x"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "f")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "x"))}))}))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "mx"))}))}))}))}))})))}++bind :: Packaging.PrimitiveDefinition+bind =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.optionals.bind"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Monadic bind for optionals."),+ Packaging.entityMetadataComments = [+ "bind(m, f) returns f(x) when m is given(x), and none when m is none.",+ "The monadic bind for optionals; used to chain computations that may be absent.",+ "Total. Corresponds to Haskell's (>>=) :: Maybe a -> (a -> Maybe b) -> Maybe b."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "x"),+ Typing.typeParameterConstraints = []},+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "y"),+ Typing.typeParameterConstraints = []}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "m"),+ Typing.parameterDescription = (Just "the optional value to bind"),+ Typing.parameterType = (Model.TypeOptional (Model.TypeVariable (Model.Name "x"))),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "f"),+ Typing.parameterDescription = (Just "the continuation to apply to the contained value"),+ Typing.parameterType = (Model.TypeFunction (Model.FunctionType {+ Model.functionTypeDomain = (Model.TypeVariable (Model.Name "x")),+ Model.functionTypeCodomain = (Model.TypeOptional (Model.TypeVariable (Model.Name "y")))})),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeOptional (Model.TypeVariable (Model.Name "y")))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = (Just (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "m"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "f"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.optionals.match")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "m"))})),+ Model.applicationArgument = (Model.TermOptional Nothing)})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "f"))}))}))})))}++compose :: Packaging.PrimitiveDefinition+compose =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.optionals.compose"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Kleisli composition for optionals."),+ Packaging.entityMetadataComments = [+ "compose(f, g, x) returns the Kleisli composition of f and g applied to x: bind(f(x), g).",+ "If either f or the second stage produces none, the result is none.",+ "Total. Corresponds to Haskell's Kleisli composition for Maybe, (>=>) :: (a -> Maybe b) -> (b -> Maybe c) -> a -> Maybe c."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "x"),+ Typing.typeParameterConstraints = []},+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "y"),+ Typing.typeParameterConstraints = []},+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "z"),+ Typing.typeParameterConstraints = []}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "f"),+ Typing.parameterDescription = (Just "the first Kleisli arrow"),+ Typing.parameterType = (Model.TypeFunction (Model.FunctionType {+ Model.functionTypeDomain = (Model.TypeVariable (Model.Name "x")),+ Model.functionTypeCodomain = (Model.TypeOptional (Model.TypeVariable (Model.Name "y")))})),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "g"),+ Typing.parameterDescription = (Just "the second Kleisli arrow"),+ Typing.parameterType = (Model.TypeFunction (Model.FunctionType {+ Model.functionTypeDomain = (Model.TypeVariable (Model.Name "y")),+ Model.functionTypeCodomain = (Model.TypeOptional (Model.TypeVariable (Model.Name "z")))})),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "x"),+ Typing.parameterDescription = (Just "the value to apply the composition to"),+ Typing.parameterType = (Model.TypeVariable (Model.Name "x")),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeOptional (Model.TypeVariable (Model.Name "z")))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = (Just (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "f"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "g"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "x"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.optionals.bind")),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "f")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "x"))}))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "g"))}))}))}))})))}++foldList :: Packaging.PrimitiveDefinition+foldList =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.optionals.foldList"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Left-fold over a list with an optional-returning function, short-circuiting on none."),+ Packaging.entityMetadataComments = [+ "foldList(f, acc, xs) folds f over xs from the left, iterating while each application yields given, and returns none as soon as any step yields none. If every element is processed, the result is given of the final accumulator.",+ "foldList(f, acc, xs) is lists.foldl(\\m y -> bind(m, \\x -> f(x, y)), given(acc), xs); this defining equation is the specification, and the default implementation.",+ "Total. Corresponds to a short-circuiting foldM specialised to Maybe."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "x"),+ Typing.typeParameterConstraints = []},+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "y"),+ Typing.typeParameterConstraints = []}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "f"),+ Typing.parameterDescription = (Just "the optional-returning step function"),+ Typing.parameterType = (Model.TypeFunction (Model.FunctionType {+ Model.functionTypeDomain = (Model.TypeVariable (Model.Name "x")),+ Model.functionTypeCodomain = (Model.TypeFunction (Model.FunctionType {+ Model.functionTypeDomain = (Model.TypeVariable (Model.Name "y")),+ Model.functionTypeCodomain = (Model.TypeOptional (Model.TypeVariable (Model.Name "x")))}))})),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "acc"),+ Typing.parameterDescription = (Just "the initial accumulator"),+ Typing.parameterType = (Model.TypeVariable (Model.Name "x")),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "xs"),+ Typing.parameterDescription = (Just "the list to fold over"),+ Typing.parameterType = (Model.TypeList (Model.TypeVariable (Model.Name "y"))),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeOptional (Model.TypeVariable (Model.Name "x")))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = (Just (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "f"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "acc"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "xs"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.lists.foldl")),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "m"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "y"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.optionals.bind")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "m"))})),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "x"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "f")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "x"))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "y"))}))}))}))}))}))})),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.optionals.given")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "acc"))}))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "xs"))}))}))}))})))}++given :: Packaging.PrimitiveDefinition+given =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.optionals.given"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Wrap a value in given."),+ Packaging.entityMetadataComments = [+ "given(x) is the optional value containing x.",+ "The constructor for the present case of an optional value.",+ "Total. Corresponds to Haskell's Just :: a -> Maybe a."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "x"),+ Typing.typeParameterConstraints = []}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "x"),+ Typing.parameterDescription = (Just "the value to wrap in given"),+ Typing.parameterType = (Model.TypeVariable (Model.Name "x")),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeOptional (Model.TypeVariable (Model.Name "x")))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++givens :: Packaging.PrimitiveDefinition+givens =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.optionals.givens"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Concatenate optionals, keeping only the present values."),+ Packaging.entityMetadataComments = [+ "givens(xs) returns the list of contained values from given elements of xs, in original order; none elements are discarded.",+ "Total. Corresponds to Haskell's Data.Maybe.catMaybes :: [Maybe a] -> [a]."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "x"),+ Typing.typeParameterConstraints = []}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "xs"),+ Typing.parameterDescription = (Just "the list of optionals to concatenate"),+ Typing.parameterType = (Model.TypeList (Model.TypeOptional (Model.TypeVariable (Model.Name "x")))),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeList (Model.TypeVariable (Model.Name "x")))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = (Just (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "xs"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.lists.foldr")),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "m"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "acc"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.optionals.match")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "m"))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "acc"))})),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "v"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.lists.cons")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "v"))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "acc"))}))}))}))}))}))})),+ Model.applicationArgument = (Model.TermList [])})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "xs"))}))})))}++isGiven :: Packaging.PrimitiveDefinition+isGiven =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.optionals.isGiven"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Test whether an optional is present (given)."),+ Packaging.entityMetadataComments = [+ "isGiven(m) returns true iff m is a given variant.",+ "Total. Corresponds to Haskell's Data.Maybe.isJust :: Maybe a -> Bool."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "x"),+ Typing.typeParameterConstraints = []}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "m"),+ Typing.parameterDescription = (Just "the optional to test"),+ Typing.parameterType = (Model.TypeOptional (Model.TypeVariable (Model.Name "x"))),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeLiteral Model.LiteralTypeBoolean)}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = (Just (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "m"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.optionals.match")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "m"))})),+ Model.applicationArgument = (Model.TermLiteral (Model.LiteralBoolean False))})),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "_"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLiteral (Model.LiteralBoolean True))}))}))})))}++isNone :: Packaging.PrimitiveDefinition+isNone =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.optionals.isNone"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Test whether an optional is absent (none)."),+ Packaging.entityMetadataComments = [+ "isNone(m) returns true iff m is the none variant.",+ "Total. Corresponds to Haskell's Data.Maybe.isNothing :: Maybe a -> Bool."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "x"),+ Typing.typeParameterConstraints = []}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "m"),+ Typing.parameterDescription = (Just "the optional to test"),+ Typing.parameterType = (Model.TypeOptional (Model.TypeVariable (Model.Name "x"))),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeLiteral Model.LiteralTypeBoolean)}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = (Just (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "m"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.optionals.match")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "m"))})),+ Model.applicationArgument = (Model.TermLiteral (Model.LiteralBoolean True))})),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "_"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLiteral (Model.LiteralBoolean False))}))}))})))}++map :: Packaging.PrimitiveDefinition+map =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.optionals.map"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Map a function over an optional."),+ Packaging.entityMetadataComments = [+ "map(f, m) returns given(f x) when m is given(x), and none when m is none.",+ "The functor instance for optionals.",+ "Total. Corresponds to Haskell's fmap :: (a -> b) -> Maybe a -> Maybe b."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "x"),+ Typing.typeParameterConstraints = []},+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "y"),+ Typing.typeParameterConstraints = []}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "f"),+ Typing.parameterDescription = (Just "the function to apply to the contained value"),+ Typing.parameterType = (Model.TypeFunction (Model.FunctionType {+ Model.functionTypeDomain = (Model.TypeVariable (Model.Name "x")),+ Model.functionTypeCodomain = (Model.TypeVariable (Model.Name "y"))})),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "m"),+ Typing.parameterDescription = (Just "the optional to map over"),+ Typing.parameterType = (Model.TypeOptional (Model.TypeVariable (Model.Name "x"))),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeOptional (Model.TypeVariable (Model.Name "y")))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = (Just (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "f"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "m"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.optionals.match")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "m"))})),+ Model.applicationArgument = (Model.TermOptional Nothing)})),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "x"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermOptional (Just (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "f")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "x"))}))))}))}))}))})))}++mapList :: Packaging.PrimitiveDefinition+mapList =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.optionals.mapList"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Traverse a list in the optional monad."),+ Packaging.entityMetadataComments = [+ "mapList(f, xs) applies f to each element of xs. If every application yields given, the result is given of the list of contained values, in their original order. The result is none as soon as any application yields none.",+ "Total. Corresponds to Haskell's traverse :: (a -> Maybe b) -> [a] -> Maybe [b]."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "x"),+ Typing.typeParameterConstraints = []},+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "y"),+ Typing.typeParameterConstraints = []}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "f"),+ Typing.parameterDescription = (Just "the optional-returning function to apply to each element"),+ Typing.parameterType = (Model.TypeFunction (Model.FunctionType {+ Model.functionTypeDomain = (Model.TypeVariable (Model.Name "x")),+ Model.functionTypeCodomain = (Model.TypeOptional (Model.TypeVariable (Model.Name "y")))})),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "xs"),+ Typing.parameterDescription = (Just "the list to traverse"),+ Typing.parameterType = (Model.TypeList (Model.TypeVariable (Model.Name "x"))),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeOptional (Model.TypeList (Model.TypeVariable (Model.Name "y"))))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = (Just (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "f"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "xs"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.lists.foldr")),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "x"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "acc"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.optionals.bind")),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "f")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "x"))}))})),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "y"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.optionals.map")),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "ys"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.lists.cons")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "y"))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "ys"))}))}))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "acc"))}))}))}))}))}))})),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.optionals.given")),+ Model.applicationArgument = (Model.TermList [])}))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "xs"))}))}))})))}++mapOptional :: Packaging.PrimitiveDefinition+mapOptional =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.optionals.mapOptional"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Map a partial function over a list, keeping only the present results."),+ Packaging.entityMetadataComments = [+ "mapOptional(f, xs) applies f to each element of xs and returns the list of contained values from given results in original order; none results are discarded.",+ "Total. Corresponds to Haskell's Data.Maybe.mapMaybe :: (a -> Maybe b) -> [a] -> [b].",+ "Deprecated since 0.18. Use: hydra.core.lib.lists.mapGivens."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = (Just (Packaging.LifecycleInfo {+ Packaging.lifecycleInfoAvailableSince = Nothing,+ Packaging.lifecycleInfoDeprecatedSince = (Just (Packaging.Version "0.18"))})),+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "x"),+ Typing.typeParameterConstraints = []},+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "y"),+ Typing.typeParameterConstraints = []}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "f"),+ Typing.parameterDescription = (Just "the partial function to apply to each element"),+ Typing.parameterType = (Model.TypeFunction (Model.FunctionType {+ Model.functionTypeDomain = (Model.TypeVariable (Model.Name "x")),+ Model.functionTypeCodomain = (Model.TypeOptional (Model.TypeVariable (Model.Name "y")))})),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "xs"),+ Typing.parameterDescription = (Just "the list to map over"),+ Typing.parameterType = (Model.TypeList (Model.TypeVariable (Model.Name "x"))),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeList (Model.TypeVariable (Model.Name "y")))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = (Just (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "f"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "xs"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.optionals.givens")),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.lists.map")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "f"))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "xs"))}))}))}))})))}++mapSet :: Packaging.PrimitiveDefinition+mapSet =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.optionals.mapSet"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Traverse a set in the optional monad."),+ Packaging.entityMetadataComments = [+ "mapSet(f, s) applies f to each element of s. If every application yields given, the result is given of the set of contained values, deduplicated by the result type's ordering. The result is none as soon as any application yields none.",+ "Requires 'ordering' constraints on both element types (the set type contract).",+ "Total. Corresponds to a traverse-style operation specialised to Set in the Maybe monad."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "x"),+ Typing.typeParameterConstraints = [+ Model.TypeClassConstraintSimple (Model.Name "ordering")]},+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "y"),+ Typing.typeParameterConstraints = [+ Model.TypeClassConstraintSimple (Model.Name "ordering")]}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "f"),+ Typing.parameterDescription = (Just "the optional-returning function to apply to each element"),+ Typing.parameterType = (Model.TypeFunction (Model.FunctionType {+ Model.functionTypeDomain = (Model.TypeVariable (Model.Name "x")),+ Model.functionTypeCodomain = (Model.TypeOptional (Model.TypeVariable (Model.Name "y")))})),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "s"),+ Typing.parameterDescription = (Just "the set to traverse"),+ Typing.parameterType = (Model.TypeSet (Model.TypeVariable (Model.Name "x"))),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeOptional (Model.TypeSet (Model.TypeVariable (Model.Name "y"))))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = (Just (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "f"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "s"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.optionals.map")),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "ys"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.sets.fromList")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "ys"))}))}))})),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.lists.foldr")),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "x"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "acc"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.optionals.bind")),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "f")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "x"))}))})),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "y"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.optionals.map")),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "ys"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.lists.cons")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "y"))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "ys"))}))}))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "acc"))}))}))}))}))}))})),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.optionals.given")),+ Model.applicationArgument = (Model.TermList [])}))})),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.sets.toList")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "s"))}))}))}))}))})))}++match :: Packaging.PrimitiveDefinition+match =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.optionals.match"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "The fundamental eliminator for the optional type, scrutinee-first."),+ Packaging.entityMetadataComments = [+ "match(m, def, f) returns f(x) when m is given(x), and def when m is none.",+ "The fundamental eliminator for the optional type; every other primitive in this namespace can be derived from it. The optional value is the first argument, matching the convention for case-statement-like elimination.",+ "Total. Argument order is (m, def, f) rather than Haskell's maybe :: (def, f, m)."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "x"),+ Typing.typeParameterConstraints = []},+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "y"),+ Typing.typeParameterConstraints = []}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "m"),+ Typing.parameterDescription = (Just "the optional value to eliminate"),+ Typing.parameterType = (Model.TypeOptional (Model.TypeVariable (Model.Name "x"))),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "def"),+ Typing.parameterDescription = (Just "the value to return when the optional is none"),+ Typing.parameterType = (Model.TypeVariable (Model.Name "y")),+ Typing.parameterIsLazy = True},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "f"),+ Typing.parameterDescription = (Just "the function to apply to the contained value when the optional is given"),+ Typing.parameterType = (Model.TypeFunction (Model.FunctionType {+ Model.functionTypeDomain = (Model.TypeVariable (Model.Name "x")),+ Model.functionTypeCodomain = (Model.TypeVariable (Model.Name "y"))})),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeVariable (Model.Name "y"))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++toList :: Packaging.PrimitiveDefinition+toList =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.optionals.toList"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Convert an optional to a list: given x maps to [x], none to []."),+ Packaging.entityMetadataComments = [+ "toList(m) returns [x] when m is given(x), and the empty list when m is none.",+ "Total. Corresponds to Haskell's Data.Maybe.maybeToList :: Maybe a -> [a]."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "x"),+ Typing.typeParameterConstraints = []}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "m"),+ Typing.parameterDescription = (Just "the optional to convert"),+ Typing.parameterType = (Model.TypeOptional (Model.TypeVariable (Model.Name "x"))),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeList (Model.TypeVariable (Model.Name "x")))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = (Just (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "m"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.optionals.match")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "m"))})),+ Model.applicationArgument = (Model.TermList [])})),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "x"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermList [+ Model.TermVariable (Model.Name "x")])}))}))})))}++withDefault :: Packaging.PrimitiveDefinition+withDefault =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.optionals.withDefault"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Return the value contained in an optional, falling back to a default if absent."),+ Packaging.entityMetadataComments = [+ "withDefault(def, m) returns x when m is given(x), and def when m is none.",+ "Total. Corresponds to Haskell's Data.Maybe.fromMaybe :: a -> Maybe a -> a."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "x"),+ Typing.typeParameterConstraints = []}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "def"),+ Typing.parameterDescription = (Just "the default value to return when the optional is none"),+ Typing.parameterType = (Model.TypeVariable (Model.Name "x")),+ Typing.parameterIsLazy = True},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "m"),+ Typing.parameterDescription = (Just "the optional to unwrap"),+ Typing.parameterType = (Model.TypeOptional (Model.TypeVariable (Model.Name "x"))),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeVariable (Model.Name "x"))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = (Just (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "def"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "m"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.optionals.match")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "m"))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "def"))})),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "x"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermVariable (Model.Name "x"))}))}))}))})))}
@@ -0,0 +1,339 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Primitives in the hydra.core.lib.ordering module.++module Hydra.Core.Lib.Ordering where++import qualified Hydra.Core.Ast as Ast+import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Diff as Diff+import qualified Hydra.Core.Docs as Docs+import qualified Hydra.Core.Error.Checking as Checking+import qualified Hydra.Core.Error.File as ErrorFile+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Error.Packaging as ErrorPackaging+import qualified Hydra.Core.Error.System as ErrorSystem+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Json.Model as JsonModel+import qualified Hydra.Core.Markdown as Markdown+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Parsing as Parsing+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Query as Query+import qualified Hydra.Core.Regex as Regex+import qualified Hydra.Core.Relational as Relational+import qualified Hydra.Core.System as System+import qualified Hydra.Core.Tabular as Tabular+import qualified Hydra.Core.Testing as Testing+import qualified Hydra.Core.Time as Time+import qualified Hydra.Core.Topology as Topology+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Validation as Validation+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++compare :: Packaging.PrimitiveDefinition+compare =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.ordering.compare"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Compare two values and return a Comparison."),+ Packaging.entityMetadataComments = [+ "compare(x, y) returns the hydra.core.util.Comparison value that classifies the relationship between x and y under the type's ordering: LessThan if x < y, EqualTo if x == y, GreaterThan if x > y.",+ "The result type's three-valued tag is the canonical primitive comparison; the boolean comparators (lt/lte/gt/gte) are derivable from it.",+ "Requires an 'ordering' type-class constraint on the argument type, which is the closest Hydra equivalent to Haskell's Ord instance.",+ "Since: 0.18 (moved from hydra.core.lib.equality.compare).",+ "Total. Corresponds to Haskell's compare :: Ord a => a -> a -> Ordering."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "x"),+ Typing.typeParameterConstraints = [+ Model.TypeClassConstraintSimple (Model.Name "ordering")]}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "x"),+ Typing.parameterDescription = (Just "the first value to compare"),+ Typing.parameterType = (Model.TypeVariable (Model.Name "x")),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "y"),+ Typing.parameterDescription = (Just "the second value to compare"),+ Typing.parameterType = (Model.TypeVariable (Model.Name "x")),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeVariable (Model.Name "hydra.core.util.Comparison"))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++gt :: Packaging.PrimitiveDefinition+gt =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.ordering.gt"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Check whether the first value is greater than the second."),+ Packaging.entityMetadataComments = [+ "gt(x, y) returns true iff x > y under the type's ordering.",+ "Requires an 'ordering' constraint on the argument type.",+ "Since: 0.18 (moved from hydra.core.lib.equality.gt).",+ "Total. Corresponds to Haskell's (>) :: Ord a => a -> a -> Bool."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "x"),+ Typing.typeParameterConstraints = [+ Model.TypeClassConstraintSimple (Model.Name "ordering")]}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "x"),+ Typing.parameterDescription = (Just "the first value to compare"),+ Typing.parameterType = (Model.TypeVariable (Model.Name "x")),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "y"),+ Typing.parameterDescription = (Just "the second value to compare"),+ Typing.parameterType = (Model.TypeVariable (Model.Name "x")),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeLiteral Model.LiteralTypeBoolean)}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++gte :: Packaging.PrimitiveDefinition+gte =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.ordering.gte"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Check whether the first value is greater than or equal to the second."),+ Packaging.entityMetadataComments = [+ "gte(x, y) returns true iff x >= y under the type's ordering.",+ "Requires an 'ordering' constraint on the argument type.",+ "Since: 0.18 (moved from hydra.core.lib.equality.gte).",+ "Total. Corresponds to Haskell's (>=) :: Ord a => a -> a -> Bool."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "x"),+ Typing.typeParameterConstraints = [+ Model.TypeClassConstraintSimple (Model.Name "ordering")]}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "x"),+ Typing.parameterDescription = (Just "the first value to compare"),+ Typing.parameterType = (Model.TypeVariable (Model.Name "x")),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "y"),+ Typing.parameterDescription = (Just "the second value to compare"),+ Typing.parameterType = (Model.TypeVariable (Model.Name "x")),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeLiteral Model.LiteralTypeBoolean)}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++lt :: Packaging.PrimitiveDefinition+lt =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.ordering.lt"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Check whether the first value is less than the second."),+ Packaging.entityMetadataComments = [+ "lt(x, y) returns true iff x < y under the type's ordering.",+ "Requires an 'ordering' constraint on the argument type.",+ "Since: 0.18 (moved from hydra.core.lib.equality.lt).",+ "Total. Corresponds to Haskell's (<) :: Ord a => a -> a -> Bool."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "x"),+ Typing.typeParameterConstraints = [+ Model.TypeClassConstraintSimple (Model.Name "ordering")]}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "x"),+ Typing.parameterDescription = (Just "the first value to compare"),+ Typing.parameterType = (Model.TypeVariable (Model.Name "x")),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "y"),+ Typing.parameterDescription = (Just "the second value to compare"),+ Typing.parameterType = (Model.TypeVariable (Model.Name "x")),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeLiteral Model.LiteralTypeBoolean)}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++lte :: Packaging.PrimitiveDefinition+lte =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.ordering.lte"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Check whether the first value is less than or equal to the second."),+ Packaging.entityMetadataComments = [+ "lte(x, y) returns true iff x <= y under the type's ordering.",+ "Requires an 'ordering' constraint on the argument type.",+ "Since: 0.18 (moved from hydra.core.lib.equality.lte).",+ "Total. Corresponds to Haskell's (<=) :: Ord a => a -> a -> Bool."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "x"),+ Typing.typeParameterConstraints = [+ Model.TypeClassConstraintSimple (Model.Name "ordering")]}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "x"),+ Typing.parameterDescription = (Just "the first value to compare"),+ Typing.parameterType = (Model.TypeVariable (Model.Name "x")),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "y"),+ Typing.parameterDescription = (Just "the second value to compare"),+ Typing.parameterType = (Model.TypeVariable (Model.Name "x")),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeLiteral Model.LiteralTypeBoolean)}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++max :: Packaging.PrimitiveDefinition+max =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.ordering.max"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Return the maximum of two values."),+ Packaging.entityMetadataComments = [+ "max(x, y) returns the larger of x and y under the type's ordering; if x == y, it returns y (matching Haskell's convention).",+ "Requires an 'ordering' constraint on the argument type.",+ "Since: 0.18 (moved from hydra.core.lib.equality.max).",+ "Total. Corresponds to Haskell's max :: Ord a => a -> a -> a."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "x"),+ Typing.typeParameterConstraints = [+ Model.TypeClassConstraintSimple (Model.Name "ordering")]}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "x"),+ Typing.parameterDescription = (Just "the first value to compare"),+ Typing.parameterType = (Model.TypeVariable (Model.Name "x")),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "y"),+ Typing.parameterDescription = (Just "the second value to compare"),+ Typing.parameterType = (Model.TypeVariable (Model.Name "x")),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeVariable (Model.Name "x"))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = (Just (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "x"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "y"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.logic.ifElse")),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.ordering.gte")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "x"))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "y"))}))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "x"))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "y"))}))}))})))}++min :: Packaging.PrimitiveDefinition+min =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.ordering.min"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Return the minimum of two values."),+ Packaging.entityMetadataComments = [+ "min(x, y) returns the smaller of x and y under the type's ordering; if x == y, it returns x (matching Haskell's convention).",+ "Requires an 'ordering' constraint on the argument type.",+ "Since: 0.18 (moved from hydra.core.lib.equality.min).",+ "Total. Corresponds to Haskell's min :: Ord a => a -> a -> a."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "x"),+ Typing.typeParameterConstraints = [+ Model.TypeClassConstraintSimple (Model.Name "ordering")]}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "x"),+ Typing.parameterDescription = (Just "the first value to compare"),+ Typing.parameterType = (Model.TypeVariable (Model.Name "x")),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "y"),+ Typing.parameterDescription = (Just "the second value to compare"),+ Typing.parameterType = (Model.TypeVariable (Model.Name "x")),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeVariable (Model.Name "x"))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = (Just (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "x"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "y"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.logic.ifElse")),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.ordering.lte")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "x"))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "y"))}))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "x"))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "y"))}))}))})))}
@@ -0,0 +1,227 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Primitives in the hydra.core.lib.pairs module.++module Hydra.Core.Lib.Pairs where++import qualified Hydra.Core.Ast as Ast+import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Diff as Diff+import qualified Hydra.Core.Docs as Docs+import qualified Hydra.Core.Error.Checking as Checking+import qualified Hydra.Core.Error.File as ErrorFile+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Error.Packaging as ErrorPackaging+import qualified Hydra.Core.Error.System as ErrorSystem+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Json.Model as JsonModel+import qualified Hydra.Core.Markdown as Markdown+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Parsing as Parsing+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Query as Query+import qualified Hydra.Core.Regex as Regex+import qualified Hydra.Core.Relational as Relational+import qualified Hydra.Core.System as System+import qualified Hydra.Core.Tabular as Tabular+import qualified Hydra.Core.Testing as Testing+import qualified Hydra.Core.Time as Time+import qualified Hydra.Core.Topology as Topology+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Validation as Validation+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++bimap :: Packaging.PrimitiveDefinition+bimap =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.pairs.bimap"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Map over both elements of a pair."),+ Packaging.entityMetadataComments = [+ "bimap(f, g, p) returns a new pair (f(first(p)), g(second(p))). The bifunctor map for pairs.",+ "Total. Corresponds to Haskell's Data.Bifunctor.bimap :: (a -> c) -> (b -> d) -> (a, b) -> (c, d)."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "a"),+ Typing.typeParameterConstraints = []},+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "b"),+ Typing.typeParameterConstraints = []},+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "c"),+ Typing.typeParameterConstraints = []},+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "d"),+ Typing.typeParameterConstraints = []}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "f"),+ Typing.parameterDescription = (Just "the function applied to the first element"),+ Typing.parameterType = (Model.TypeFunction (Model.FunctionType {+ Model.functionTypeDomain = (Model.TypeVariable (Model.Name "a")),+ Model.functionTypeCodomain = (Model.TypeVariable (Model.Name "c"))})),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "g"),+ Typing.parameterDescription = (Just "the function applied to the second element"),+ Typing.parameterType = (Model.TypeFunction (Model.FunctionType {+ Model.functionTypeDomain = (Model.TypeVariable (Model.Name "b")),+ Model.functionTypeCodomain = (Model.TypeVariable (Model.Name "d"))})),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "p"),+ Typing.parameterDescription = (Just "the pair to map over"),+ Typing.parameterType = (Model.TypePair (Model.PairType {+ Model.pairTypeFirst = (Model.TypeVariable (Model.Name "a")),+ Model.pairTypeSecond = (Model.TypeVariable (Model.Name "b"))})),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypePair (Model.PairType {+ Model.pairTypeFirst = (Model.TypeVariable (Model.Name "c")),+ Model.pairTypeSecond = (Model.TypeVariable (Model.Name "d"))}))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = (Just (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "f"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "g"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "p"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermPair (+ Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "f")),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.pairs.first")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "p"))}))}),+ (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "g")),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.pairs.second")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "p"))}))}))))}))}))})))}++first :: Packaging.PrimitiveDefinition+first =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.pairs.first"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Get the first element of a pair."),+ Packaging.entityMetadataComments = [+ "first(p) returns the first component of the pair p.",+ "Total. Corresponds to Haskell's fst :: (a, b) -> a."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "a"),+ Typing.typeParameterConstraints = []},+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "b"),+ Typing.typeParameterConstraints = []}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "p"),+ Typing.parameterDescription = (Just "the pair whose first element is returned"),+ Typing.parameterType = (Model.TypePair (Model.PairType {+ Model.pairTypeFirst = (Model.TypeVariable (Model.Name "a")),+ Model.pairTypeSecond = (Model.TypeVariable (Model.Name "b"))})),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeVariable (Model.Name "a"))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++pair :: Packaging.PrimitiveDefinition+pair =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.pairs.pair"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Construct a pair from two values."),+ Packaging.entityMetadataComments = [+ "pair(x, y) returns the pair (x, y).",+ "The type-free pair constructor, useful point-free (e.g. zipWith(pair, xs, ys)).",+ "Total. Corresponds to Haskell's (,) :: a -> b -> (a, b)."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "a"),+ Typing.typeParameterConstraints = []},+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "b"),+ Typing.typeParameterConstraints = []}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "x"),+ Typing.parameterDescription = (Just "the first element"),+ Typing.parameterType = (Model.TypeVariable (Model.Name "a")),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "y"),+ Typing.parameterDescription = (Just "the second element"),+ Typing.parameterType = (Model.TypeVariable (Model.Name "b")),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypePair (Model.PairType {+ Model.pairTypeFirst = (Model.TypeVariable (Model.Name "a")),+ Model.pairTypeSecond = (Model.TypeVariable (Model.Name "b"))}))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++second :: Packaging.PrimitiveDefinition+second =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.pairs.second"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Get the second element of a pair."),+ Packaging.entityMetadataComments = [+ "second(p) returns the second component of the pair p.",+ "Total. Corresponds to Haskell's snd :: (a, b) -> b."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "a"),+ Typing.typeParameterConstraints = []},+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "b"),+ Typing.typeParameterConstraints = []}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "p"),+ Typing.parameterDescription = (Just "the pair whose second element is returned"),+ Typing.parameterType = (Model.TypePair (Model.PairType {+ Model.pairTypeFirst = (Model.TypeVariable (Model.Name "a")),+ Model.pairTypeSecond = (Model.TypeVariable (Model.Name "b"))})),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeVariable (Model.Name "b"))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}
@@ -0,0 +1,251 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Primitives in the hydra.core.lib.regex module.++module Hydra.Core.Lib.Regex where++import qualified Hydra.Core.Ast as Ast+import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Diff as Diff+import qualified Hydra.Core.Docs as Docs+import qualified Hydra.Core.Error.Checking as Checking+import qualified Hydra.Core.Error.File as ErrorFile+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Error.Packaging as ErrorPackaging+import qualified Hydra.Core.Error.System as ErrorSystem+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Json.Model as JsonModel+import qualified Hydra.Core.Markdown as Markdown+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Parsing as Parsing+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Query as Query+import qualified Hydra.Core.Regex as Regex+import qualified Hydra.Core.Relational as Relational+import qualified Hydra.Core.System as System+import qualified Hydra.Core.Tabular as Tabular+import qualified Hydra.Core.Testing as Testing+import qualified Hydra.Core.Time as Time+import qualified Hydra.Core.Topology as Topology+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Validation as Validation+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++find :: Packaging.PrimitiveDefinition+find =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.regex.find"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Find the first regex match within a string, returning the matched substring if any."),+ Packaging.entityMetadataComments = [+ "find(pat, s) returns Just(t) where t is the leftmost-longest substring of s matching pat, or Nothing if pat does not match anywhere in s.",+ "Pattern syntax and semantics are Hydra-defined and translingual; see docs/specification/regex.md.",+ "Total; a pattern that does not parse under the Hydra regex grammar is treated as not matching anywhere, the same as a well-formed pattern with no match."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "pat"),+ Typing.parameterDescription = (Just "the regex pattern to search for"),+ Typing.parameterType = (Model.TypeLiteral Model.LiteralTypeString),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "s"),+ Typing.parameterDescription = (Just "the string to search within"),+ Typing.parameterType = (Model.TypeLiteral Model.LiteralTypeString),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeOptional (Model.TypeLiteral Model.LiteralTypeString))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++findAll :: Packaging.PrimitiveDefinition+findAll =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.regex.findAll"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Find all non-overlapping regex matches within a string."),+ Packaging.entityMetadataComments = [+ "findAll(pat, s) returns the list of all leftmost-longest, non-overlapping matches of pat in s, in the order they appear. Returns the empty list if pat does not match anywhere.",+ "Pattern syntax and semantics are Hydra-defined and translingual; see docs/specification/regex.md.",+ "Total; an unparseable pattern yields the empty list, the same as a well-formed pattern with no matches."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "pat"),+ Typing.parameterDescription = (Just "the regex pattern to search for"),+ Typing.parameterType = (Model.TypeLiteral Model.LiteralTypeString),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "s"),+ Typing.parameterDescription = (Just "the string to search within"),+ Typing.parameterType = (Model.TypeLiteral Model.LiteralTypeString),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeList (Model.TypeLiteral Model.LiteralTypeString))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++matches :: Packaging.PrimitiveDefinition+matches =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.regex.matches"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Test whether a regex matches an entire string."),+ Packaging.entityMetadataComments = [+ "matches(pat, s) returns true iff pat matches the whole of s (anchored at both ends; a match of a proper substring of s does not suffice). To test whether pat matches anywhere within s, use find.",+ "Pattern syntax and semantics are Hydra-defined and translingual; see docs/specification/regex.md.",+ "Total; an unparseable pattern yields false, the same as a well-formed pattern with no match."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "pat"),+ Typing.parameterDescription = (Just "the regex pattern to test"),+ Typing.parameterType = (Model.TypeLiteral Model.LiteralTypeString),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "s"),+ Typing.parameterDescription = (Just "the string to test against"),+ Typing.parameterType = (Model.TypeLiteral Model.LiteralTypeString),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeLiteral Model.LiteralTypeBoolean)}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++replace :: Packaging.PrimitiveDefinition+replace =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.regex.replace"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Replace the first regex match in a string with a replacement string."),+ Packaging.entityMetadataComments = [+ "replace(pat, repl, s) returns s with the first leftmost-longest match of pat replaced by repl. If pat does not match, s is returned unchanged.",+ "Replacement-string syntax (capture-group references such as $1 or \\\\1, literal escapes) is host-defined.",+ "Pattern syntax and semantics are Hydra-defined and translingual; see docs/specification/regex.md.",+ "Total; an unparseable pattern leaves s unchanged, the same as a well-formed pattern with no match."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "pat"),+ Typing.parameterDescription = (Just "the regex pattern to match"),+ Typing.parameterType = (Model.TypeLiteral Model.LiteralTypeString),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "repl"),+ Typing.parameterDescription = (Just "the replacement string"),+ Typing.parameterType = (Model.TypeLiteral Model.LiteralTypeString),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "s"),+ Typing.parameterDescription = (Just "the string to operate on"),+ Typing.parameterType = (Model.TypeLiteral Model.LiteralTypeString),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeLiteral Model.LiteralTypeString)}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++replaceAll :: Packaging.PrimitiveDefinition+replaceAll =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.regex.replaceAll"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Replace all non-overlapping regex matches in a string with a replacement string."),+ Packaging.entityMetadataComments = [+ "replaceAll(pat, repl, s) returns s with every leftmost-longest, non-overlapping match of pat replaced by repl. If pat does not match anywhere, s is returned unchanged.",+ "Replacement-string syntax is host-defined; see replace for the caveat.",+ "Pattern syntax and semantics are Hydra-defined and translingual; see docs/specification/regex.md.",+ "Total; an unparseable pattern leaves s unchanged, the same as a well-formed pattern with no match."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "pat"),+ Typing.parameterDescription = (Just "the regex pattern to match"),+ Typing.parameterType = (Model.TypeLiteral Model.LiteralTypeString),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "repl"),+ Typing.parameterDescription = (Just "the replacement string"),+ Typing.parameterType = (Model.TypeLiteral Model.LiteralTypeString),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "s"),+ Typing.parameterDescription = (Just "the string to operate on"),+ Typing.parameterType = (Model.TypeLiteral Model.LiteralTypeString),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeLiteral Model.LiteralTypeString)}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++split :: Packaging.PrimitiveDefinition+split =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.regex.split"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Split a string by occurrences of a regex pattern."),+ Packaging.entityMetadataComments = [+ "split(pat, s) returns the list of substrings of s obtained by splitting on every leftmost-longest, non-overlapping match of pat.",+ "Trailing empty splits are host-defined (some engines retain them, some discard them; for portable code, do not rely on the trailing-empty behavior).",+ "Pattern syntax and semantics are Hydra-defined and translingual; see docs/specification/regex.md.",+ "Total; an unparseable pattern yields the single-element list containing s, the same as a well-formed pattern with no match."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "pat"),+ Typing.parameterDescription = (Just "the regex pattern to split on"),+ Typing.parameterType = (Model.TypeLiteral Model.LiteralTypeString),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "s"),+ Typing.parameterDescription = (Just "the string to split"),+ Typing.parameterType = (Model.TypeLiteral Model.LiteralTypeString),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeList (Model.TypeLiteral Model.LiteralTypeString))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}
@@ -0,0 +1,702 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Primitives in the hydra.core.lib.sets module.++module Hydra.Core.Lib.Sets where++import qualified Hydra.Core.Ast as Ast+import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Diff as Diff+import qualified Hydra.Core.Docs as Docs+import qualified Hydra.Core.Error.Checking as Checking+import qualified Hydra.Core.Error.File as ErrorFile+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Error.Packaging as ErrorPackaging+import qualified Hydra.Core.Error.System as ErrorSystem+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Json.Model as JsonModel+import qualified Hydra.Core.Markdown as Markdown+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Parsing as Parsing+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Query as Query+import qualified Hydra.Core.Regex as Regex+import qualified Hydra.Core.Relational as Relational+import qualified Hydra.Core.System as System+import qualified Hydra.Core.Tabular as Tabular+import qualified Hydra.Core.Testing as Testing+import qualified Hydra.Core.Time as Time+import qualified Hydra.Core.Topology as Topology+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Validation as Validation+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++delete :: Packaging.PrimitiveDefinition+delete =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.sets.delete"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Remove an element from a set."),+ Packaging.entityMetadataComments = [+ "delete(x, s) returns s with x removed; if x is not in s, s is returned unchanged.",+ "Requires an 'ordering' constraint on the element type.",+ "Total. Corresponds to Haskell's Data.Set.delete :: Ord a => a -> Set a -> Set a."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "x"),+ Typing.typeParameterConstraints = [+ Model.TypeClassConstraintSimple (Model.Name "ordering")]}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "x"),+ Typing.parameterDescription = (Just "the element to remove"),+ Typing.parameterType = (Model.TypeVariable (Model.Name "x")),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "s"),+ Typing.parameterDescription = (Just "the set to remove the element from"),+ Typing.parameterType = (Model.TypeSet (Model.TypeVariable (Model.Name "x"))),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeSet (Model.TypeVariable (Model.Name "x")))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++difference :: Packaging.PrimitiveDefinition+difference =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.sets.difference"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Compute the difference of two sets: elements in the first that are not in the second."),+ Packaging.entityMetadataComments = [+ "difference(s1, s2) returns the set of elements that are in s1 but not in s2.",+ "Requires an 'ordering' constraint on the element type.",+ "Total. Corresponds to Haskell's Data.Set.difference :: Ord a => Set a -> Set a -> Set a."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "x"),+ Typing.typeParameterConstraints = [+ Model.TypeClassConstraintSimple (Model.Name "ordering")]}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "s1"),+ Typing.parameterDescription = (Just "the set to subtract from"),+ Typing.parameterType = (Model.TypeSet (Model.TypeVariable (Model.Name "x"))),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "s2"),+ Typing.parameterDescription = (Just "the set of elements to remove"),+ Typing.parameterType = (Model.TypeSet (Model.TypeVariable (Model.Name "x"))),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeSet (Model.TypeVariable (Model.Name "x")))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = (Just (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "s1"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "s2"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.lists.foldl")),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "acc"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "el"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.logic.ifElse")),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.sets.member")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "el"))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "s2"))}))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "acc"))})),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.sets.insert")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "el"))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "acc"))}))}))}))}))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "hydra.core.lib.sets.empty"))})),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.sets.toList")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "s1"))}))}))}))})))}++empty :: Packaging.PrimitiveDefinition+empty =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.sets.empty"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "The empty set."),+ Packaging.entityMetadataComments = [+ "empty is the set with no elements.",+ "Requires an 'ordering' constraint on the element type.",+ "Total. Corresponds to Haskell's Data.Set.empty :: Set a."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "x"),+ Typing.typeParameterConstraints = [+ Model.TypeClassConstraintSimple (Model.Name "ordering")]}],+ Typing.termSignatureParameters = [],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeSet (Model.TypeVariable (Model.Name "x")))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++filter :: Packaging.PrimitiveDefinition+filter =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.sets.filter"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Filter a set by a predicate."),+ Packaging.entityMetadataComments = [+ "filter(p, s) returns the subset of s containing exactly the elements x for which p(x) is true.",+ "Requires an 'ordering' constraint on the element type.",+ "Total. Corresponds to Haskell's Data.Set.filter :: (a -> Bool) -> Set a -> Set a."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "x"),+ Typing.typeParameterConstraints = [+ Model.TypeClassConstraintSimple (Model.Name "ordering")]}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "predicate"),+ Typing.parameterDescription = (Just "the predicate to test each element"),+ Typing.parameterType = (Model.TypeFunction (Model.FunctionType {+ Model.functionTypeDomain = (Model.TypeVariable (Model.Name "x")),+ Model.functionTypeCodomain = (Model.TypeLiteral Model.LiteralTypeBoolean)})),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "s"),+ Typing.parameterDescription = (Just "the set to filter"),+ Typing.parameterType = (Model.TypeSet (Model.TypeVariable (Model.Name "x"))),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeSet (Model.TypeVariable (Model.Name "x")))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = (Just (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "p"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "s"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.sets.fromList")),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.lists.filter")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "p"))})),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.sets.toList")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "s"))}))}))}))}))})))}++fromList :: Packaging.PrimitiveDefinition+fromList =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.sets.fromList"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Construct a set from a list of elements (duplicates removed)."),+ Packaging.entityMetadataComments = [+ "fromList(xs) returns the set containing exactly the distinct elements of xs; duplicates are discarded.",+ "Requires an 'ordering' constraint on the element type.",+ "Total. Corresponds to Haskell's Data.Set.fromList :: Ord a => [a] -> Set a."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "x"),+ Typing.typeParameterConstraints = [+ Model.TypeClassConstraintSimple (Model.Name "ordering")]}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "xs"),+ Typing.parameterDescription = (Just "the list of elements to build the set from"),+ Typing.parameterType = (Model.TypeList (Model.TypeVariable (Model.Name "x"))),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeSet (Model.TypeVariable (Model.Name "x")))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++insert :: Packaging.PrimitiveDefinition+insert =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.sets.insert"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Add an element to a set."),+ Packaging.entityMetadataComments = [+ "insert(x, s) returns s with x added; if x is already in s, s is returned unchanged.",+ "Requires an 'ordering' constraint on the element type.",+ "Total. Corresponds to Haskell's Data.Set.insert :: Ord a => a -> Set a -> Set a."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "x"),+ Typing.typeParameterConstraints = [+ Model.TypeClassConstraintSimple (Model.Name "ordering")]}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "x"),+ Typing.parameterDescription = (Just "the element to add"),+ Typing.parameterType = (Model.TypeVariable (Model.Name "x")),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "s"),+ Typing.parameterDescription = (Just "the set to add the element to"),+ Typing.parameterType = (Model.TypeSet (Model.TypeVariable (Model.Name "x"))),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeSet (Model.TypeVariable (Model.Name "x")))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++intersection :: Packaging.PrimitiveDefinition+intersection =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.sets.intersection"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Compute the intersection of two sets: elements present in both."),+ Packaging.entityMetadataComments = [+ "intersection(s1, s2) returns the set of elements present in both s1 and s2.",+ "Requires an 'ordering' constraint on the element type.",+ "Total. Corresponds to Haskell's Data.Set.intersection :: Ord a => Set a -> Set a -> Set a."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "x"),+ Typing.typeParameterConstraints = [+ Model.TypeClassConstraintSimple (Model.Name "ordering")]}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "s1"),+ Typing.parameterDescription = (Just "the first set"),+ Typing.parameterType = (Model.TypeSet (Model.TypeVariable (Model.Name "x"))),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "s2"),+ Typing.parameterDescription = (Just "the second set"),+ Typing.parameterType = (Model.TypeSet (Model.TypeVariable (Model.Name "x"))),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeSet (Model.TypeVariable (Model.Name "x")))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = (Just (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "s1"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "s2"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.lists.foldl")),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "acc"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "el"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.logic.ifElse")),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.sets.member")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "el"))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "s2"))}))})),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.sets.insert")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "el"))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "acc"))}))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "acc"))}))}))}))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "hydra.core.lib.sets.empty"))})),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.sets.toList")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "s1"))}))}))}))})))}++isEmpty :: Packaging.PrimitiveDefinition+isEmpty =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.sets.isEmpty"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Test whether a set is empty."),+ Packaging.entityMetadataComments = [+ "isEmpty(s) returns true iff s has no elements.",+ "Requires an 'ordering' constraint on the element type.",+ "Total. Corresponds to Haskell's Data.Set.null :: Set a -> Bool."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "x"),+ Typing.typeParameterConstraints = [+ Model.TypeClassConstraintSimple (Model.Name "ordering")]}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "s"),+ Typing.parameterDescription = (Just "the set to test for emptiness"),+ Typing.parameterType = (Model.TypeSet (Model.TypeVariable (Model.Name "x"))),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeLiteral Model.LiteralTypeBoolean)}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++map :: Packaging.PrimitiveDefinition+map =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.sets.map"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Map a function over a set."),+ Packaging.entityMetadataComments = [+ "map(f, s) returns the set of f(x) for each x in s. Elements that f maps to the same image are deduplicated by the result type's ordering.",+ "Requires 'ordering' constraints on both the input and output element types.",+ "Total. Corresponds to Haskell's Data.Set.map :: (Ord a, Ord b) => (a -> b) -> Set a -> Set b."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "x"),+ Typing.typeParameterConstraints = [+ Model.TypeClassConstraintSimple (Model.Name "ordering")]},+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "y"),+ Typing.typeParameterConstraints = [+ Model.TypeClassConstraintSimple (Model.Name "ordering")]}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "f"),+ Typing.parameterDescription = (Just "the function to apply to each element"),+ Typing.parameterType = (Model.TypeFunction (Model.FunctionType {+ Model.functionTypeDomain = (Model.TypeVariable (Model.Name "x")),+ Model.functionTypeCodomain = (Model.TypeVariable (Model.Name "y"))})),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "s"),+ Typing.parameterDescription = (Just "the set to map over"),+ Typing.parameterType = (Model.TypeSet (Model.TypeVariable (Model.Name "x"))),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeSet (Model.TypeVariable (Model.Name "y")))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = (Just (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "f"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "s"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.sets.fromList")),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.lists.map")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "f"))})),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.sets.toList")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "s"))}))}))}))}))})))}++member :: Packaging.PrimitiveDefinition+member =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.sets.member"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Test whether an element is in a set."),+ Packaging.entityMetadataComments = [+ "member(x, s) returns true iff x is an element of s.",+ "Requires an 'ordering' constraint on the element type.",+ "Total. Corresponds to Haskell's Data.Set.member :: Ord a => a -> Set a -> Bool."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "x"),+ Typing.typeParameterConstraints = [+ Model.TypeClassConstraintSimple (Model.Name "ordering")]}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "x"),+ Typing.parameterDescription = (Just "the element to test for membership"),+ Typing.parameterType = (Model.TypeVariable (Model.Name "x")),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "s"),+ Typing.parameterDescription = (Just "the set to test against"),+ Typing.parameterType = (Model.TypeSet (Model.TypeVariable (Model.Name "x"))),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeLiteral Model.LiteralTypeBoolean)}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++singleton :: Packaging.PrimitiveDefinition+singleton =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.sets.singleton"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Construct a set containing a single element."),+ Packaging.entityMetadataComments = [+ "singleton(x) returns the set containing exactly the element x.",+ "Requires an 'ordering' constraint on the element type.",+ "Total. Corresponds to Haskell's Data.Set.singleton :: a -> Set a."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "x"),+ Typing.typeParameterConstraints = [+ Model.TypeClassConstraintSimple (Model.Name "ordering")]}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "x"),+ Typing.parameterDescription = (Just "the single element of the set"),+ Typing.parameterType = (Model.TypeVariable (Model.Name "x")),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeSet (Model.TypeVariable (Model.Name "x")))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++size :: Packaging.PrimitiveDefinition+size =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.sets.size"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Return the number of elements in a set."),+ Packaging.entityMetadataComments = [+ "size(s) returns the number of elements in s as an int32.",+ "Requires an 'ordering' constraint on the element type.",+ "Total. Corresponds to Haskell's Data.Set.size :: Set a -> Int (with narrowing to int32)."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "x"),+ Typing.typeParameterConstraints = [+ Model.TypeClassConstraintSimple (Model.Name "ordering")]}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "s"),+ Typing.parameterDescription = (Just "the set whose size is returned"),+ Typing.parameterType = (Model.TypeSet (Model.TypeVariable (Model.Name "x"))),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeLiteral (Model.LiteralTypeInteger Model.IntegerTypeInt32))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++toList :: Packaging.PrimitiveDefinition+toList =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.sets.toList"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Convert a set to a list (in ascending order)."),+ Packaging.entityMetadataComments = [+ "toList(s) returns the elements of s as a list, in ascending order under the element type's ordering.",+ "Requires an 'ordering' constraint on the element type.",+ "Total. Corresponds to Haskell's Data.Set.toAscList :: Set a -> [a]."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "x"),+ Typing.typeParameterConstraints = [+ Model.TypeClassConstraintSimple (Model.Name "ordering")]}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "s"),+ Typing.parameterDescription = (Just "the set to convert to a list"),+ Typing.parameterType = (Model.TypeSet (Model.TypeVariable (Model.Name "x"))),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeList (Model.TypeVariable (Model.Name "x")))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++union :: Packaging.PrimitiveDefinition+union =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.sets.union"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Compute the union of two sets: elements in either."),+ Packaging.entityMetadataComments = [+ "union(s1, s2) returns the set of elements that are in s1 or in s2 (or both).",+ "Requires an 'ordering' constraint on the element type.",+ "Total. Corresponds to Haskell's Data.Set.union :: Ord a => Set a -> Set a -> Set a."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "x"),+ Typing.typeParameterConstraints = [+ Model.TypeClassConstraintSimple (Model.Name "ordering")]}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "s1"),+ Typing.parameterDescription = (Just "the first set"),+ Typing.parameterType = (Model.TypeSet (Model.TypeVariable (Model.Name "x"))),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "s2"),+ Typing.parameterDescription = (Just "the second set"),+ Typing.parameterType = (Model.TypeSet (Model.TypeVariable (Model.Name "x"))),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeSet (Model.TypeVariable (Model.Name "x")))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = (Just (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "s1"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "s2"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.lists.foldl")),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "acc"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "el"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.sets.insert")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "el"))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "acc"))}))}))}))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "s2"))})),+ Model.applicationArgument = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.sets.toList")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "s1"))}))}))}))})))}++unions :: Packaging.PrimitiveDefinition+unions =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.sets.unions"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Compute the union of a list of sets."),+ Packaging.entityMetadataComments = [+ "unions(ss) returns the union of every set in ss. Equivalent to folding union over ss starting from empty.",+ "Requires an 'ordering' constraint on the element type.",+ "Total. Corresponds to Haskell's Data.Set.unions :: Ord a => [Set a] -> Set a."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Model.Name "x"),+ Typing.typeParameterConstraints = [+ Model.TypeClassConstraintSimple (Model.Name "ordering")]}],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "ss"),+ Typing.parameterDescription = (Just "the list of sets to union together"),+ Typing.parameterType = (Model.TypeList (Model.TypeSet (Model.TypeVariable (Model.Name "x")))),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeSet (Model.TypeVariable (Model.Name "x")))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = (Just (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "ss"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.lists.foldl")),+ Model.applicationArgument = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "acc"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.Name "s"),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.lib.sets.union")),+ Model.applicationArgument = (Model.TermVariable (Model.Name "acc"))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "s"))}))}))}))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "hydra.core.lib.sets.empty"))})),+ Model.applicationArgument = (Model.TermVariable (Model.Name "ss"))}))})))}
@@ -0,0 +1,364 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Primitives in the hydra.core.lib.strings module.++module Hydra.Core.Lib.Strings where++import qualified Hydra.Core.Ast as Ast+import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Diff as Diff+import qualified Hydra.Core.Docs as Docs+import qualified Hydra.Core.Error.Checking as Checking+import qualified Hydra.Core.Error.File as ErrorFile+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Error.Packaging as ErrorPackaging+import qualified Hydra.Core.Error.System as ErrorSystem+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Json.Model as JsonModel+import qualified Hydra.Core.Markdown as Markdown+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Parsing as Parsing+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Query as Query+import qualified Hydra.Core.Regex as Regex+import qualified Hydra.Core.Relational as Relational+import qualified Hydra.Core.System as System+import qualified Hydra.Core.Tabular as Tabular+import qualified Hydra.Core.Testing as Testing+import qualified Hydra.Core.Time as Time+import qualified Hydra.Core.Topology as Topology+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Validation as Validation+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++charAt :: Packaging.PrimitiveDefinition+charAt =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.strings.charAt"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Get the Unicode code point of the character at a specific index, returning Nothing if out of bounds."),+ Packaging.entityMetadataComments = [+ "charAt(i, s) returns Just(c) where c is the Unicode code point at position i in s, or Nothing if i is negative or i >= length(s).",+ "Total."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "i"),+ Typing.parameterDescription = (Just "the index of the character to retrieve"),+ Typing.parameterType = (Model.TypeLiteral (Model.LiteralTypeInteger Model.IntegerTypeInt32)),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "s"),+ Typing.parameterDescription = (Just "the string to index into"),+ Typing.parameterType = (Model.TypeLiteral Model.LiteralTypeString),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeOptional (Model.TypeLiteral (Model.LiteralTypeInteger Model.IntegerTypeInt32)))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++concat :: Packaging.PrimitiveDefinition+concat =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.strings.concat"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Concatenate a list of strings into a single string."),+ Packaging.entityMetadataComments = [+ "concat(xs) returns the string formed by concatenating every string in xs in order.",+ "Total. Corresponds to Haskell's concat :: [String] -> String."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "xs"),+ Typing.parameterDescription = (Just "the list of strings to concatenate"),+ Typing.parameterType = (Model.TypeList (Model.TypeLiteral Model.LiteralTypeString)),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeLiteral Model.LiteralTypeString)}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++concat2 :: Packaging.PrimitiveDefinition+concat2 =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.strings.concat2"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Concatenate two strings."),+ Packaging.entityMetadataComments = [+ "concat2(s, t) returns the concatenation of s and t.",+ "Total. Corresponds to Haskell's (++) :: String -> String -> String."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "s"),+ Typing.parameterDescription = (Just "the first string"),+ Typing.parameterType = (Model.TypeLiteral Model.LiteralTypeString),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "t"),+ Typing.parameterDescription = (Just "the second string"),+ Typing.parameterType = (Model.TypeLiteral Model.LiteralTypeString),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeLiteral Model.LiteralTypeString)}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++fromList :: Packaging.PrimitiveDefinition+fromList =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.strings.fromList"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Convert a list of Unicode code points to a string."),+ Packaging.entityMetadataComments = [+ "fromList(cs) returns the string whose characters are the Unicode code points in cs, in order.",+ "Code points outside the valid Unicode range [0, 0x10FFFF] yield a host-defined result (typically substitution with U+FFFD or truncation of the bits).",+ "Total. The inverse of toList."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "cs"),+ Typing.parameterDescription = (Just "the list of Unicode code points to convert"),+ Typing.parameterType = (Model.TypeList (Model.TypeLiteral (Model.LiteralTypeInteger Model.IntegerTypeInt32))),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeLiteral Model.LiteralTypeString)}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++isEmpty :: Packaging.PrimitiveDefinition+isEmpty =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.strings.isEmpty"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Check whether a string is empty."),+ Packaging.entityMetadataComments = [+ "isEmpty(s) returns true iff s is the empty string.",+ "Total. Corresponds to Haskell's null :: String -> Bool."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "s"),+ Typing.parameterDescription = (Just "the string to test for emptiness"),+ Typing.parameterType = (Model.TypeLiteral Model.LiteralTypeString),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeLiteral Model.LiteralTypeBoolean)}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++join :: Packaging.PrimitiveDefinition+join =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.strings.join"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Join a list of strings with a separator between each element."),+ Packaging.entityMetadataComments = [+ "join(sep, xs) returns the strings in xs concatenated with sep inserted between each pair of adjacent strings; for the empty list the result is the empty string, and for a singleton list the result is the single string.",+ "Total. Corresponds to Haskell's Data.List.intercalate :: String -> [String] -> String."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "sep"),+ Typing.parameterDescription = (Just "the separator to insert between elements"),+ Typing.parameterType = (Model.TypeLiteral Model.LiteralTypeString),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "xs"),+ Typing.parameterDescription = (Just "the list of strings to join"),+ Typing.parameterType = (Model.TypeList (Model.TypeLiteral Model.LiteralTypeString)),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeLiteral Model.LiteralTypeString)}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++length :: Packaging.PrimitiveDefinition+length =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.strings.length"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Return the length of a string."),+ Packaging.entityMetadataComments = [+ "length(s) returns the number of Unicode code points in s as an int32.",+ "Note: this is the code-point count, not the byte count or the grapheme-cluster count, so a four-byte UTF-8 character counts as one and an emoji built from multiple code points counts as the number of code points it uses.",+ "Total on strings shorter than 2^31-1 code points."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "s"),+ Typing.parameterDescription = (Just "the string to measure"),+ Typing.parameterType = (Model.TypeLiteral Model.LiteralTypeString),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeLiteral (Model.LiteralTypeInteger Model.IntegerTypeInt32))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++splitOn :: Packaging.PrimitiveDefinition+splitOn =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.strings.splitOn"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Split a string on a delimiter string."),+ Packaging.entityMetadataComments = [+ "splitOn(sep, s) returns the list of substrings of s obtained by splitting on every occurrence of the non-empty delimiter sep. Adjacent or boundary delimiters produce empty-string elements in the result.",+ "Behavior when sep is empty is host-defined and should not be relied upon.",+ "Total. Corresponds to Haskell's Data.List.Split.splitOn :: String -> String -> [String]."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "sep"),+ Typing.parameterDescription = (Just "the delimiter to split on"),+ Typing.parameterType = (Model.TypeLiteral Model.LiteralTypeString),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Model.Name "s"),+ Typing.parameterDescription = (Just "the string to split"),+ Typing.parameterType = (Model.TypeLiteral Model.LiteralTypeString),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeList (Model.TypeLiteral Model.LiteralTypeString))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++toList :: Packaging.PrimitiveDefinition+toList =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.strings.toList"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Convert a string to a list of Unicode code points."),+ Packaging.entityMetadataComments = [+ "toList(s) returns the list of Unicode code points making up s, in order. Each code point is represented as an int32.",+ "Total. The inverse of fromList."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "s"),+ Typing.parameterDescription = (Just "the string to convert"),+ Typing.parameterType = (Model.TypeLiteral Model.LiteralTypeString),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeList (Model.TypeLiteral (Model.LiteralTypeInteger Model.IntegerTypeInt32)))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++toLower :: Packaging.PrimitiveDefinition+toLower =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.strings.toLower"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Convert a string to lowercase."),+ Packaging.entityMetadataComments = [+ "toLower(s) returns s with each character replaced by its Unicode simple (one-to-one) lowercase mapping, or itself if it has no lowercase mapping.",+ "This is a code-point-by-code-point operation, so it does not handle the string-changing match of full Unicode case folding (e.g. U+00DF \"\223\" does not lowercase to \"ss\"; it returns itself).",+ "For text intended for human-readable display in locales with non-trivial case mappings, prefer a host-specific full case-folding API.",+ "Total."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "s"),+ Typing.parameterDescription = (Just "the string to convert to lowercase"),+ Typing.parameterType = (Model.TypeLiteral Model.LiteralTypeString),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeLiteral Model.LiteralTypeString)}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++toUpper :: Packaging.PrimitiveDefinition+toUpper =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.strings.toUpper"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Convert a string to uppercase."),+ Packaging.entityMetadataComments = [+ "toUpper(s) returns s with each character replaced by its Unicode simple (one-to-one) uppercase mapping, or itself if it has no uppercase mapping.",+ "This is a code-point-by-code-point operation, so it does not handle the string-changing match of full Unicode case folding (e.g. U+00DF \"\223\" does not uppercase to \"SS\"; it returns itself).",+ "For text intended for human-readable display in locales with non-trivial case mappings, prefer a host-specific full case-folding API.",+ "Total."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "s"),+ Typing.parameterDescription = (Just "the string to convert to uppercase"),+ Typing.parameterType = (Model.TypeLiteral Model.LiteralTypeString),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeLiteral Model.LiteralTypeString)}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}
@@ -0,0 +1,266 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Primitives in the hydra.core.lib.system module.++module Hydra.Core.Lib.System where++import qualified Hydra.Core.Ast as Ast+import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Diff as Diff+import qualified Hydra.Core.Docs as Docs+import qualified Hydra.Core.Error.Checking as Checking+import qualified Hydra.Core.Error.File as ErrorFile+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Error.Packaging as ErrorPackaging+import qualified Hydra.Core.Error.System as ErrorSystem+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Json.Model as JsonModel+import qualified Hydra.Core.Markdown as Markdown+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Parsing as Parsing+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Query as Query+import qualified Hydra.Core.Regex as Regex+import qualified Hydra.Core.Relational as Relational+import qualified Hydra.Core.System as System+import qualified Hydra.Core.Tabular as Tabular+import qualified Hydra.Core.Testing as Testing+import qualified Hydra.Core.Time as Time+import qualified Hydra.Core.Topology as Topology+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Validation as Validation+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++execute :: Packaging.PrimitiveDefinition+execute =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.system.execute"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Run a program to completion and capture its result."),+ Packaging.entityMetadataComments = [+ "execute(command) describes an effectful computation which runs the program described by command to completion and returns its result. This is the POSIX \"execute a command\" operation at the posix_spawn / system() altitude (https://pubs.opengroup.org/onlinepubs/9799919799/functions/posix_spawn.html, https://pubs.opengroup.org/onlinepubs/9799919799/functions/system.html): the child is spawned, Hydra waits for it (POSIX waitpid), and standard output and standard error are captured as raw bytes. Output is byte-oriented, with no character decoding or newline translation; decode it to text via hydra.core.lib.text.decodeUtf8. A child that runs and exits with a non-zero status (POSIX WEXITSTATUS) is returned as right(result) with that StatusCode, following the XCU section 2.8.2 exit-status convention. Only a failure to launch -- for example POSIX ENOENT, EACCES, or a bad working directory -- is returned as left(error). Unlike the shell system(), no intermediate shell is invoked; command.program is executed directly (as the execvp family does), so shell syntax in arguments is not interpreted."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "command"),+ Typing.parameterDescription = (Just "the program and arguments to run"),+ Typing.parameterType = (Model.TypeVariable (Model.Name "hydra.core.system.Command")),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeEffect (Model.TypeEither (Model.EitherType {+ Model.eitherTypeLeft = (Model.TypeVariable (Model.Name "hydra.core.error.system.SystemError")),+ Model.eitherTypeRight = (Model.TypeVariable (Model.Name "hydra.core.system.ProcessResult"))})))}},+ Packaging.primitiveDefinitionIsPure = False,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++exit :: Packaging.PrimitiveDefinition+exit =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.system.exit"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Terminate the current process with a status code."),+ Packaging.entityMetadataComments = [+ "exit(code) describes an effectful computation which terminates the current process immediately with the given status, exactly as the POSIX exit() function (XSH, https://pubs.opengroup.org/onlinepubs/9799919799/functions/exit.html). The status is reported to the parent through wait(); by the XCU section 2.8.2 convention, 0 denotes success and non-zero denotes failure. This computation does not return, so subsequent effects in a sequence are not performed."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "code"),+ Typing.parameterDescription = (Just "the status code to terminate the process with"),+ Typing.parameterType = (Model.TypeVariable (Model.Name "hydra.core.system.StatusCode")),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeEffect Model.TypeUnit)}},+ Packaging.primitiveDefinitionIsPure = False,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++getEnvironment :: Packaging.PrimitiveDefinition+getEnvironment =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.system.getEnvironment"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Get the full set of environment variables."),+ Packaging.entityMetadataComments = [+ "getEnvironment describes an effectful computation which returns the entire environment of the current process -- the POSIX environment list environ (XBD section 8, Environment Variables, https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/V1_chap08.html) -- as a map from variable name to value. POSIX represents each entry as a \"name=value\" string; this primitive splits each at the first '=' into an EnvironmentVariable key and a string value. This computation does not fail; an empty environment yields an empty map."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeEffect (Model.TypeMap (Model.MapType {+ Model.mapTypeKeys = (Model.TypeVariable (Model.Name "hydra.core.system.EnvironmentVariable")),+ Model.mapTypeValues = (Model.TypeLiteral Model.LiteralTypeString)})))}},+ Packaging.primitiveDefinitionIsPure = False,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++getEnvironmentVariable :: Packaging.PrimitiveDefinition+getEnvironmentVariable =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.system.getEnvironmentVariable"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Look up a single environment variable by name."),+ Packaging.entityMetadataComments = [+ "getEnvironmentVariable(name) describes an effectful computation which returns the value of the environment variable name, or none if it is not present -- the POSIX getenv() function (XSH, https://pubs.opengroup.org/onlinepubs/9799919799/functions/getenv.html). A variable that is present but set to the empty string is returned as given(\"\"), distinct from the none that POSIX getenv signals with a null pointer. This computation does not fail."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "name"),+ Typing.parameterDescription = (Just "the name of the environment variable to look up"),+ Typing.parameterType = (Model.TypeVariable (Model.Name "hydra.core.system.EnvironmentVariable")),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeEffect (Model.TypeOptional (Model.TypeLiteral Model.LiteralTypeString)))}},+ Packaging.primitiveDefinitionIsPure = False,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++getTime :: Packaging.PrimitiveDefinition+getTime =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.system.getTime"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Get the current wall-clock time."),+ Packaging.entityMetadataComments = [+ "getTime describes an effectful computation which returns the current wall-clock time as a Timespec (seconds and nanoseconds since the Unix Epoch) -- the POSIX clock_gettime() function with the CLOCK_REALTIME clock (XSH, https://pubs.opengroup.org/onlinepubs/9799919799/functions/clock_gettime.html). The actual resolution is implementation- and platform-defined and may be coarser than nanoseconds. As with CLOCK_REALTIME, the clock is not monotonic: it can jump or move backwards when the host's wall clock is adjusted. This computation does not fail."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeEffect (Model.TypeVariable (Model.Name "hydra.core.time.Timespec")))}},+ Packaging.primitiveDefinitionIsPure = False,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++getWorkingDirectory :: Packaging.PrimitiveDefinition+getWorkingDirectory =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.system.getWorkingDirectory"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Get the current working directory."),+ Packaging.entityMetadataComments = [+ "getWorkingDirectory describes an effectful computation which returns the absolute pathname of the current working directory -- the POSIX getcwd() function (XSH, https://pubs.opengroup.org/onlinepubs/9799919799/functions/getcwd.html) -- as a FilePath. A recoverable failure (for example POSIX EACCES, or the working directory having been removed) is returned as left(error); success is returned as right(path)."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeEffect (Model.TypeEither (Model.EitherType {+ Model.eitherTypeLeft = (Model.TypeVariable (Model.Name "hydra.core.error.system.SystemError")),+ Model.eitherTypeRight = (Model.TypeVariable (Model.Name "hydra.core.file.FilePath"))})))}},+ Packaging.primitiveDefinitionIsPure = False,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++readStdin :: Packaging.PrimitiveDefinition+readStdin =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.system.readStdin"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Read the complete contents of standard input as raw bytes."),+ Packaging.entityMetadataComments = [+ "readStdin describes an effectful computation which reads standard input (POSIX file descriptor 0) until end-of-file and returns the complete contents as raw bytes, with no character decoding or newline translation -- the POSIX read() function (XSH, https://pubs.opengroup.org/onlinepubs/9799919799/functions/read.html) applied repeatedly to fd 0 until it signals end-of-file. To interpret the result as text, decode it (e.g. via hydra.core.lib.text.decodeUtf8). A recoverable I/O failure is returned as left(error); success is returned as right(contents), including the empty byte string if stdin is closed or empty."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeEffect (Model.TypeEither (Model.EitherType {+ Model.eitherTypeLeft = (Model.TypeVariable (Model.Name "hydra.core.error.system.SystemError")),+ Model.eitherTypeRight = (Model.TypeLiteral Model.LiteralTypeBinary)})))}},+ Packaging.primitiveDefinitionIsPure = False,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++writeStderr :: Packaging.PrimitiveDefinition+writeStderr =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.system.writeStderr"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Write raw bytes to standard error."),+ Packaging.entityMetadataComments = [+ "writeStderr(bytes) describes an effectful computation which writes bytes to standard error (POSIX file descriptor 2), with no character encoding or newline translation -- the POSIX write() function (XSH, https://pubs.opengroup.org/onlinepubs/9799919799/functions/write.html) applied repeatedly to fd 2 until all bytes are written. To write text, encode it first (e.g. via hydra.core.lib.text.encodeUtf8). A recoverable I/O failure (for example a closed pipe, POSIX EPIPE) is returned as left(error); success is returned as right(unit)."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "bytes"),+ Typing.parameterDescription = (Just "the raw bytes to write to standard error"),+ Typing.parameterType = (Model.TypeLiteral Model.LiteralTypeBinary),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeEffect (Model.TypeEither (Model.EitherType {+ Model.eitherTypeLeft = (Model.TypeVariable (Model.Name "hydra.core.error.system.SystemError")),+ Model.eitherTypeRight = Model.TypeUnit})))}},+ Packaging.primitiveDefinitionIsPure = False,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++writeStdout :: Packaging.PrimitiveDefinition+writeStdout =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.system.writeStdout"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Write raw bytes to standard output."),+ Packaging.entityMetadataComments = [+ "writeStdout(bytes) describes an effectful computation which writes bytes to standard output (POSIX file descriptor 1), with no character encoding or newline translation -- the POSIX write() function (XSH, https://pubs.opengroup.org/onlinepubs/9799919799/functions/write.html) applied repeatedly to fd 1 until all bytes are written. To write text, encode it first (e.g. via hydra.core.lib.text.encodeUtf8). A recoverable I/O failure (for example a closed pipe, POSIX EPIPE) is returned as left(error); success is returned as right(unit)."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "bytes"),+ Typing.parameterDescription = (Just "the raw bytes to write to standard output"),+ Typing.parameterType = (Model.TypeLiteral Model.LiteralTypeBinary),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeEffect (Model.TypeEither (Model.EitherType {+ Model.eitherTypeLeft = (Model.TypeVariable (Model.Name "hydra.core.error.system.SystemError")),+ Model.eitherTypeRight = Model.TypeUnit})))}},+ Packaging.primitiveDefinitionIsPure = False,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}
@@ -0,0 +1,96 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Primitives in the hydra.core.lib.text module.++module Hydra.Core.Lib.Text where++import qualified Hydra.Core.Ast as Ast+import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Diff as Diff+import qualified Hydra.Core.Docs as Docs+import qualified Hydra.Core.Error.Checking as Checking+import qualified Hydra.Core.Error.File as ErrorFile+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Error.Packaging as ErrorPackaging+import qualified Hydra.Core.Error.System as ErrorSystem+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Json.Model as JsonModel+import qualified Hydra.Core.Markdown as Markdown+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Parsing as Parsing+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Query as Query+import qualified Hydra.Core.Regex as Regex+import qualified Hydra.Core.Relational as Relational+import qualified Hydra.Core.System as System+import qualified Hydra.Core.Tabular as Tabular+import qualified Hydra.Core.Testing as Testing+import qualified Hydra.Core.Time as Time+import qualified Hydra.Core.Topology as Topology+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Validation as Validation+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++decodeUtf8 :: Packaging.PrimitiveDefinition+decodeUtf8 =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.text.decodeUtf8"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Decode a sequence of bytes as UTF-8 text."),+ Packaging.entityMetadataComments = [+ "decodeUtf8(bytes) attempts to interpret bytes as a UTF-8 encoded string. A byte sequence which is not valid UTF-8 yields left(message), where message is a host-provided description of the decoding failure; a successful decode yields right(text).",+ "Pairs with hydra.core.lib.files.readFile, which returns raw bytes."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "bytes"),+ Typing.parameterDescription = (Just "the byte sequence to decode as UTF-8"),+ Typing.parameterType = (Model.TypeLiteral Model.LiteralTypeBinary),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeEither (Model.EitherType {+ Model.eitherTypeLeft = (Model.TypeLiteral Model.LiteralTypeString),+ Model.eitherTypeRight = (Model.TypeLiteral Model.LiteralTypeString)}))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++encodeUtf8 :: Packaging.PrimitiveDefinition+encodeUtf8 =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Model.Name "hydra.core.lib.text.encodeUtf8"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Encode text as a sequence of UTF-8 bytes."),+ Packaging.entityMetadataComments = [+ "encodeUtf8(text) returns the UTF-8 encoding of text as raw bytes. Total: every Hydra string is valid Unicode and therefore always encodes.",+ "Pairs with hydra.core.lib.files.writeFile, which expects raw bytes."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing,+ Packaging.entityMetadataProvisions = []})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Model.Name "text"),+ Typing.parameterDescription = (Just "the text to encode as UTF-8"),+ Typing.parameterType = (Model.TypeLiteral Model.LiteralTypeString),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Model.TypeLiteral Model.LiteralTypeBinary)}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}
@@ -0,0 +1,69 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Conversion functions for literal values.++module Hydra.Core.Literals where++import qualified Hydra.Core.Ast as Ast+import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Diff as Diff+import qualified Hydra.Core.Docs as Docs+import qualified Hydra.Core.Error.Checking as Checking+import qualified Hydra.Core.Error.File as ErrorFile+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Error.Packaging as ErrorPackaging+import qualified Hydra.Core.Error.System as ErrorSystem+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Json.Model as JsonModel+import qualified Hydra.Core.Overlay.Haskell.Lib.Literals as Literals+import qualified Hydra.Core.Markdown as Markdown+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Parsing as Parsing+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Query as Query+import qualified Hydra.Core.Regex as Regex+import qualified Hydra.Core.Relational as Relational+import qualified Hydra.Core.System as System+import qualified Hydra.Core.Tabular as Tabular+import qualified Hydra.Core.Testing as Testing+import qualified Hydra.Core.Time as Time+import qualified Hydra.Core.Topology as Topology+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Validation as Validation+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | Convert a bigint to an integer value of a given type (note: lossy)+bigintToIntegerValue :: Model.IntegerType -> Integer -> Model.IntegerValue+bigintToIntegerValue it bi =+ case it of+ Model.IntegerTypeBigint -> Model.IntegerValueBigint bi+ Model.IntegerTypeInt8 -> Model.IntegerValueInt8 (Literals.bigintToInt8 bi)+ Model.IntegerTypeInt16 -> Model.IntegerValueInt16 (Literals.bigintToInt16 bi)+ Model.IntegerTypeInt32 -> Model.IntegerValueInt32 (Literals.bigintToInt32 bi)+ Model.IntegerTypeInt64 -> Model.IntegerValueInt64 (Literals.bigintToInt64 bi)+ Model.IntegerTypeUint8 -> Model.IntegerValueUint8 (Literals.bigintToUint8 bi)+ Model.IntegerTypeUint16 -> Model.IntegerValueUint16 (Literals.bigintToUint16 bi)+ Model.IntegerTypeUint32 -> Model.IntegerValueUint32 (Literals.bigintToUint32 bi)+ Model.IntegerTypeUint64 -> Model.IntegerValueUint64 (Literals.bigintToUint64 bi)++-- | Convert an integer value of any precision to a bigint+integerValueToBigint :: Model.IntegerValue -> Integer+integerValueToBigint x =+ case x of+ Model.IntegerValueBigint v0 -> v0+ Model.IntegerValueInt8 v0 -> Literals.int8ToBigint v0+ Model.IntegerValueInt16 v0 -> Literals.int16ToBigint v0+ Model.IntegerValueInt32 v0 -> Literals.int32ToBigint v0+ Model.IntegerValueInt64 v0 -> Literals.int64ToBigint v0+ Model.IntegerValueUint8 v0 -> Literals.uint8ToBigint v0+ Model.IntegerValueUint16 v0 -> Literals.uint16ToBigint v0+ Model.IntegerValueUint32 v0 -> Literals.uint32ToBigint v0+ Model.IntegerValueUint64 v0 -> Literals.uint64ToBigint v0
@@ -0,0 +1,218 @@+-- Note: this is an automatically generated file. Do not edit.++-- | A Markdown document model, used as the target representation for generated documentation++module Hydra.Core.Markdown where++import qualified Hydra.Core.Model as Model+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | A block-level Markdown element+data Block =+ -- | A fenced code block+ BlockCodeBlock CodeBlock |+ -- | An ordered or unordered list+ BlockList List |+ -- | A paragraph of inline content+ BlockParagraph Paragraph |+ -- | Raw, verbatim passthrough content (e.g. an HTML comment), emitted with no escaping or reformatting. Used for constructs the rest of the Block union cannot represent, such as the generated-file notice banner at the top of a generated page.+ BlockRaw String |+ -- | A heading followed by its own block content, nested to form a document outline+ BlockSection Section |+ -- | A table+ BlockTable Table+ deriving (Eq, Ord, Read, Show)++_Block = Model.Name "hydra.core.markdown.Block"++_Block_codeBlock = Model.Name "codeBlock"++_Block_list = Model.Name "list"++_Block_paragraph = Model.Name "paragraph"++_Block_raw = Model.Name "raw"++_Block_section = Model.Name "section"++_Block_table = Model.Name "table"++-- | A fenced code block+data CodeBlock =+ CodeBlock {+ -- | The optional language tag used for syntax highlighting, e.g. "haskell"+ codeBlockLanguage :: (Maybe String),+ -- | The literal text content of the code block+ codeBlockContent :: String}+ deriving (Eq, Ord, Read, Show)++_CodeBlock = Model.Name "hydra.core.markdown.CodeBlock"++_CodeBlock_language = Model.Name "language"++_CodeBlock_content = Model.Name "content"++-- | A complete Markdown document+data Document =+ Document {+ -- | The document's top-level title, rendered as an H1 heading+ documentTitle :: String,+ -- | The block-level content of the document, following the title+ documentContent :: [Block]}+ deriving (Eq, Ord, Read, Show)++_Document = Model.Name "hydra.core.markdown.Document"++_Document_title = Model.Name "title"++_Document_content = Model.Name "content"++-- | A section heading+data Heading =+ Heading {+ -- | The heading level, where 1 corresponds to an H1 heading; levels increase with nesting depth+ headingLevel :: Int,+ -- | The inline content of the heading+ headingContent :: [Inline],+ -- | An optional explicit anchor identifier for linking directly to this heading. Headings can usually derive an anchor from their rendered text, but an explicit anchor is provided for cases (e.g. renderer-specific slug rules) where that derivation is ambiguous or undesired.+ headingAnchor :: (Maybe String)}+ deriving (Eq, Ord, Read, Show)++_Heading = Model.Name "hydra.core.markdown.Heading"++_Heading_level = Model.Name "level"++_Heading_content = Model.Name "content"++_Heading_anchor = Model.Name "anchor"++-- | An inline Markdown element+data Inline =+ -- | An inline code span+ InlineCode String |+ -- | Emphasized (italicized) text+ InlineEmphasis [Inline] |+ -- | A hyperlink+ InlineLink Link |+ -- | Strongly emphasized (bolded) text+ InlineStrong [Inline] |+ -- | A raw text fragment+ InlineText String+ deriving (Eq, Ord, Read, Show)++_Inline = Model.Name "hydra.core.markdown.Inline"++_Inline_code = Model.Name "code"++_Inline_emphasis = Model.Name "emphasis"++_Inline_link = Model.Name "link"++_Inline_strong = Model.Name "strong"++_Inline_text = Model.Name "text"++-- | A hyperlink+data Link =+ Link {+ -- | The visible link text+ linkText :: [Inline],+ -- | The link target, either a URL or a relative path+ linkTarget :: String}+ deriving (Eq, Ord, Read, Show)++_Link = Model.Name "hydra.core.markdown.Link"++_Link_text = Model.Name "text"++_Link_target = Model.Name "target"++-- | An ordered or unordered list+data List =+ List {+ -- | Whether the list is numbered (ordered) rather than bulleted (unordered)+ listOrdered :: Bool,+ -- | The items of the list+ listItems :: [ListItem]}+ deriving (Eq, Ord, Read, Show)++_List = Model.Name "hydra.core.markdown.List"++_List_ordered = Model.Name "ordered"++_List_items = Model.Name "items"++-- | A single item of a list+newtype ListItem =+ ListItem {+ unListItem :: [Block]}+ deriving (Eq, Ord, Read, Show)++_ListItem = Model.Name "hydra.core.markdown.ListItem"++-- | A paragraph of inline content+data Paragraph =+ Paragraph {+ -- | The inline content of the paragraph+ paragraphContent :: [Inline],+ -- | An optional explicit anchor identifier for linking directly to this paragraph. Needed for elements such as rendered provisions, which are bold-led prose within a paragraph rather than a heading, so they carry no heading-derived anchor of their own.+ paragraphAnchor :: (Maybe String)}+ deriving (Eq, Ord, Read, Show)++_Paragraph = Model.Name "hydra.core.markdown.Paragraph"++_Paragraph_content = Model.Name "content"++_Paragraph_anchor = Model.Name "anchor"++-- | A heading followed by its own block content, nested to form a document outline+data Section =+ Section {+ -- | The section's heading+ sectionHeading :: Heading,+ -- | The block-level content of the section, following the heading+ sectionContent :: [Block],+ -- | An optional explicit anchor identifier for linking directly to this section, distinct from the heading's own anchor (a section's anchor identifies the section as a whole; a heading's identifies the heading line specifically).+ sectionAnchor :: (Maybe String)}+ deriving (Eq, Ord, Read, Show)++_Section = Model.Name "hydra.core.markdown.Section"++_Section_heading = Model.Name "heading"++_Section_content = Model.Name "content"++_Section_anchor = Model.Name "anchor"++-- | A table, consisting of a header row and any number of data rows+data Table =+ Table {+ -- | The header row of the table+ tableHeader :: TableRow,+ -- | The data rows of the table+ tableRows :: [TableRow]}+ deriving (Eq, Ord, Read, Show)++_Table = Model.Name "hydra.core.markdown.Table"++_Table_header = Model.Name "header"++_Table_rows = Model.Name "rows"++-- | A single cell of a table row+newtype TableCell =+ TableCell {+ unTableCell :: [Inline]}+ deriving (Eq, Ord, Read, Show)++_TableCell = Model.Name "hydra.core.markdown.TableCell"++-- | A single row of a table+newtype TableRow =+ TableRow {+ unTableRow :: [TableCell]}+ deriving (Eq, Ord, Read, Show)++_TableRow = Model.Name "hydra.core.markdown.TableRow"
@@ -0,0 +1,743 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Hydra's core data model, consisting of the fundamental hydra.core.model.Term type and all of its dependencies.++module Hydra.Core.Model where++import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void+import qualified Data.ByteString as B+import qualified Data.Int as I+import qualified Data.Map as M+import qualified Data.Set as S++-- | A term together with an annotation+data AnnotatedTerm =+ AnnotatedTerm {+ -- | The term being annotated+ annotatedTermBody :: Term,+ -- | The annotation as a single term. By convention this is a map term (Name -> Term) so that multiple independent annotations can coexist, but applications are free to use any term shape.+ annotatedTermAnnotation :: Term}+ deriving (Eq, Ord, Read, Show)++_AnnotatedTerm = Name "hydra.core.model.AnnotatedTerm"++_AnnotatedTerm_body = Name "body"++_AnnotatedTerm_annotation = Name "annotation"++-- | A type together with an annotation+data AnnotatedType =+ AnnotatedType {+ -- | The type being annotated+ annotatedTypeBody :: Type,+ -- | The annotation as a single term. By convention this is a map term (Name -> Term) so that multiple independent annotations can coexist, but applications are free to use any term shape.+ annotatedTypeAnnotation :: Term}+ deriving (Eq, Ord, Read, Show)++_AnnotatedType = Name "hydra.core.model.AnnotatedType"++_AnnotatedType_body = Name "body"++_AnnotatedType_annotation = Name "annotation"++-- | A term which applies a function to an argument+data Application =+ Application {+ -- | The left-hand side of the application+ applicationFunction :: Term,+ -- | The right-hand side of the application+ applicationArgument :: Term}+ deriving (Eq, Ord, Read, Show)++_Application = Name "hydra.core.model.Application"++_Application_function = Name "function"++_Application_argument = Name "argument"++-- | The type-level analog of an application term+data ApplicationType =+ ApplicationType {+ -- | The left-hand side of the application+ applicationTypeFunction :: Type,+ -- | The right-hand side of the application+ applicationTypeArgument :: Type}+ deriving (Eq, Ord, Read, Show)++_ApplicationType = Name "hydra.core.model.ApplicationType"++_ApplicationType_function = Name "function"++_ApplicationType_argument = Name "argument"++-- | A field with an optional type scheme, used to bind variables to terms in a 'let' expression+data Binding =+ Binding {+ -- | The name of the bound variable+ bindingName :: Name,+ -- | The term to which the variable is bound+ bindingTerm :: Term,+ -- | The optional type scheme of the bound term+ bindingTypeScheme :: (Maybe TypeScheme)}+ deriving (Eq, Ord, Read, Show)++_Binding = Name "hydra.core.model.Binding"++_Binding_name = Name "name"++_Binding_term = Name "term"++_Binding_typeScheme = Name "typeScheme"++-- | A single alternative of a case statement (union elimination): the variant being matched, together with the term that handles it.+data CaseAlternative =+ CaseAlternative {+ -- | The name of the union variant matched by this alternative+ caseAlternativeName :: Name,+ -- | The handler applied to the matched variant's payload+ caseAlternativeHandler :: Term}+ deriving (Eq, Ord, Read, Show)++_CaseAlternative = Name "hydra.core.model.CaseAlternative"++_CaseAlternative_name = Name "name"++_CaseAlternative_handler = Name "handler"++-- | A union elimination; a case statement+data CaseStatement =+ CaseStatement {+ -- | The name of the union type+ caseStatementTypeName :: Name,+ -- | An optional default case, used if none of the explicit cases match+ caseStatementDefault :: (Maybe Term),+ -- | A list of case alternatives, one per union variant being handled+ caseStatementCases :: [CaseAlternative]}+ deriving (Eq, Ord, Read, Show)++_CaseStatement = Name "hydra.core.model.CaseStatement"++_CaseStatement_typeName = Name "typeName"++_CaseStatement_default = Name "default"++_CaseStatement_cases = Name "cases"++-- | A type which provides a choice between a 'left' type and a 'right' type+data EitherType =+ EitherType {+ -- | The 'left' alternative+ eitherTypeLeft :: Type,+ -- | The 'right' alternative+ eitherTypeRight :: Type}+ deriving (Eq, Ord, Read, Show)++_EitherType = Name "hydra.core.model.EitherType"++_EitherType_left = Name "left"++_EitherType_right = Name "right"++-- | A name/term pair+data Field =+ Field {+ -- | The name of the field+ fieldName :: Name,+ -- | The value of the field+ fieldTerm :: Term}+ deriving (Eq, Ord, Read, Show)++_Field = Name "hydra.core.model.Field"++_Field_name = Name "name"++_Field_term = Name "term"++-- | A name/type pair+data FieldType =+ FieldType {+ -- | The name of the field+ fieldTypeName :: Name,+ -- | The type of the field+ fieldTypeType :: Type}+ deriving (Eq, Ord, Read, Show)++_FieldType = Name "hydra.core.model.FieldType"++_FieldType_name = Name "name"++_FieldType_type = Name "type"++-- | A floating-point type+data FloatType =+ -- | A 32-bit floating-point type+ FloatTypeFloat32 |+ -- | A 64-bit floating-point type+ FloatTypeFloat64+ deriving (Eq, Ord, Read, Show)++_FloatType = Name "hydra.core.model.FloatType"++_FloatType_float32 = Name "float32"++_FloatType_float64 = Name "float64"++-- | A floating-point literal value+data FloatValue =+ -- | A 32-bit floating-point value+ FloatValueFloat32 Float |+ -- | A 64-bit floating-point value+ FloatValueFloat64 Double+ deriving (Eq, Ord, Read, Show)++_FloatValue = Name "hydra.core.model.FloatValue"++_FloatValue_float32 = Name "float32"++_FloatValue_float64 = Name "float64"++-- | A universally quantified type; the System F equivalent of a type scheme, and the type-level equivalent of a lambda term.+data ForallType =+ ForallType {+ -- | The variable which is bound by the lambda+ forallTypeParameter :: Name,+ -- | The body of the lambda+ forallTypeBody :: Type}+ deriving (Eq, Ord, Read, Show)++_ForallType = Name "hydra.core.model.ForallType"++_ForallType_parameter = Name "parameter"++_ForallType_body = Name "body"++-- | A function type, also known as an arrow type+data FunctionType =+ FunctionType {+ -- | The domain (input) type of the function+ functionTypeDomain :: Type,+ -- | The codomain (output) type of the function+ functionTypeCodomain :: Type}+ deriving (Eq, Ord, Read, Show)++_FunctionType = Name "hydra.core.model.FunctionType"++_FunctionType_domain = Name "domain"++_FunctionType_codomain = Name "codomain"++-- | An instance of a union type; i.e. a string-indexed generalization of inl() or inr()+data Injection =+ Injection {+ -- | The name of the union type+ injectionTypeName :: Name,+ -- | The field being injected, including its name and value+ injectionField :: Field}+ deriving (Eq, Ord, Read, Show)++_Injection = Name "hydra.core.model.Injection"++_Injection_typeName = Name "typeName"++_Injection_field = Name "field"++-- | An integer type+data IntegerType =+ -- | An arbitrary-precision integer type+ IntegerTypeBigint |+ -- | An 8-bit signed integer type+ IntegerTypeInt8 |+ -- | A 16-bit signed integer type+ IntegerTypeInt16 |+ -- | A 32-bit signed integer type+ IntegerTypeInt32 |+ -- | A 64-bit signed integer type+ IntegerTypeInt64 |+ -- | An 8-bit unsigned integer type+ IntegerTypeUint8 |+ -- | A 16-bit unsigned integer type+ IntegerTypeUint16 |+ -- | A 32-bit unsigned integer type+ IntegerTypeUint32 |+ -- | A 64-bit unsigned integer type+ IntegerTypeUint64+ deriving (Eq, Ord, Read, Show)++_IntegerType = Name "hydra.core.model.IntegerType"++_IntegerType_bigint = Name "bigint"++_IntegerType_int8 = Name "int8"++_IntegerType_int16 = Name "int16"++_IntegerType_int32 = Name "int32"++_IntegerType_int64 = Name "int64"++_IntegerType_uint8 = Name "uint8"++_IntegerType_uint16 = Name "uint16"++_IntegerType_uint32 = Name "uint32"++_IntegerType_uint64 = Name "uint64"++-- | An integer literal value+data IntegerValue =+ -- | An arbitrary-precision integer value+ IntegerValueBigint Integer |+ -- | An 8-bit signed integer value+ IntegerValueInt8 I.Int8 |+ -- | A 16-bit signed integer value (short value)+ IntegerValueInt16 I.Int16 |+ -- | A 32-bit signed integer value (int value)+ IntegerValueInt32 Int |+ -- | A 64-bit signed integer value (long value)+ IntegerValueInt64 I.Int64 |+ -- | An 8-bit unsigned integer value (byte)+ IntegerValueUint8 I.Int16 |+ -- | A 16-bit unsigned integer value+ IntegerValueUint16 Int |+ -- | A 32-bit unsigned integer value (unsigned int)+ IntegerValueUint32 I.Int64 |+ -- | A 64-bit unsigned integer value (unsigned long)+ IntegerValueUint64 Integer+ deriving (Eq, Ord, Read, Show)++_IntegerValue = Name "hydra.core.model.IntegerValue"++_IntegerValue_bigint = Name "bigint"++_IntegerValue_int8 = Name "int8"++_IntegerValue_int16 = Name "int16"++_IntegerValue_int32 = Name "int32"++_IntegerValue_int64 = Name "int64"++_IntegerValue_uint8 = Name "uint8"++_IntegerValue_uint16 = Name "uint16"++_IntegerValue_uint32 = Name "uint32"++_IntegerValue_uint64 = Name "uint64"++-- | A function abstraction (lambda)+data Lambda =+ Lambda {+ -- | The parameter of the lambda+ lambdaParameter :: Name,+ -- | An optional domain type for the lambda+ lambdaDomain :: (Maybe Type),+ -- | The body of the lambda+ lambdaBody :: Term}+ deriving (Eq, Ord, Read, Show)++_Lambda = Name "hydra.core.model.Lambda"++_Lambda_parameter = Name "parameter"++_Lambda_domain = Name "domain"++_Lambda_body = Name "body"++-- | A set of (possibly recursive) 'let' bindings together with a body in which they are bound+data Let =+ Let {+ -- | The list of variable bindings+ letBindings :: [Binding],+ -- | The body term in which the variables are bound+ letBody :: Term}+ deriving (Eq, Ord, Read, Show)++_Let = Name "hydra.core.model.Let"++_Let_bindings = Name "bindings"++_Let_body = Name "body"++-- | A term constant; an instance of a literal type+data Literal =+ -- | A binary literal+ LiteralBinary B.ByteString |+ -- | A boolean literal+ LiteralBoolean Bool |+ -- | An arbitrary-precision decimal literal+ LiteralDecimal Sci.Scientific |+ -- | A floating-point literal+ LiteralFloat FloatValue |+ -- | An integer literal+ LiteralInteger IntegerValue |+ -- | A string literal+ LiteralString String+ deriving (Eq, Ord, Read, Show)++_Literal = Name "hydra.core.model.Literal"++_Literal_binary = Name "binary"++_Literal_boolean = Name "boolean"++_Literal_decimal = Name "decimal"++_Literal_float = Name "float"++_Literal_integer = Name "integer"++_Literal_string = Name "string"++-- | Any of a fixed set of literal types, also called atomic types, base types, primitive types, or type constants+data LiteralType =+ -- | The type of a binary (byte string) value+ LiteralTypeBinary |+ -- | The type of a boolean (true/false) value+ LiteralTypeBoolean |+ -- | The type of an arbitrary-precision decimal value+ LiteralTypeDecimal |+ -- | The type of a floating-point value+ LiteralTypeFloat FloatType |+ -- | The type of an integer value+ LiteralTypeInteger IntegerType |+ -- | The type of a string value+ LiteralTypeString+ deriving (Eq, Ord, Read, Show)++_LiteralType = Name "hydra.core.model.LiteralType"++_LiteralType_binary = Name "binary"++_LiteralType_boolean = Name "boolean"++_LiteralType_decimal = Name "decimal"++_LiteralType_float = Name "float"++_LiteralType_integer = Name "integer"++_LiteralType_string = Name "string"++-- | A map type+data MapType =+ MapType {+ -- | The type of keys in the map+ mapTypeKeys :: Type,+ -- | The type of values in the map+ mapTypeValues :: Type}+ deriving (Eq, Ord, Read, Show)++_MapType = Name "hydra.core.model.MapType"++_MapType_keys = Name "keys"++_MapType_values = Name "values"++-- | A unique identifier in some context; a string-valued key+newtype Name =+ Name {+ unName :: String}+ deriving (Eq, Ord, Read, Show)++_Name = Name "hydra.core.model.Name"++-- | A type which pairs a 'first' type and a 'second' type+data PairType =+ PairType {+ -- | The first component of the pair+ pairTypeFirst :: Type,+ -- | The second component of the pair+ pairTypeSecond :: Type}+ deriving (Eq, Ord, Read, Show)++_PairType = Name "hydra.core.model.PairType"++_PairType_first = Name "first"++_PairType_second = Name "second"++-- | A record elimination; a projection+data Projection =+ Projection {+ -- | The name of the record type+ projectionTypeName :: Name,+ -- | The name of the projected field+ projectionFieldName :: Name}+ deriving (Eq, Ord, Read, Show)++_Projection = Name "hydra.core.model.Projection"++_Projection_typeName = Name "typeName"++_Projection_fieldName = Name "fieldName"++-- | A record, or labeled tuple; a map of field names to terms+data Record =+ Record {+ -- | The name of the record type+ recordTypeName :: Name,+ -- | The fields of the record, as a list of name/term pairs+ recordFields :: [Field]}+ deriving (Eq, Ord, Read, Show)++_Record = Name "hydra.core.model.Record"++_Record_typeName = Name "typeName"++_Record_fields = Name "fields"++-- | A data term+data Term =+ -- | A term annotated with metadata+ TermAnnotated AnnotatedTerm |+ -- | A function application+ TermApplication Application |+ -- | A union elimination; a case statement+ TermCases CaseStatement |+ -- | An either value+ TermEither (Either Term Term) |+ -- | An injection; an instance of a union type+ TermInject Injection |+ -- | A function abstraction (lambda)+ TermLambda Lambda |+ -- | A 'let' term, which binds variables to terms+ TermLet Let |+ -- | A list+ TermList [Term] |+ -- | A literal value+ TermLiteral Literal |+ -- | A map of keys to values+ TermMap (M.Map Term Term) |+ -- | An optional value+ TermOptional (Maybe Term) |+ -- | A pair (2-tuple)+ TermPair (Term, Term) |+ -- | A record elimination; a projection+ TermProject Projection |+ -- | A record term+ TermRecord Record |+ -- | A set of values+ TermSet (S.Set Term) |+ -- | A System F type application term+ TermTypeApplication TypeApplicationTerm |+ -- | A System F type abstraction term+ TermTypeLambda TypeLambda |+ -- | A unit value; a term with no value+ TermUnit |+ -- | An unwrap elimination; the inverse of a wrap. Given the name of a wrapper type, unwraps an instance of that type to its underlying body value.+ TermUnwrap Name |+ -- | A variable reference+ TermVariable Name |+ -- | A wrapped term; an instance of a wrapper type (newtype)+ TermWrap WrappedTerm+ deriving (Eq, Ord, Read, Show)++_Term = Name "hydra.core.model.Term"++_Term_annotated = Name "annotated"++_Term_application = Name "application"++_Term_cases = Name "cases"++_Term_either = Name "either"++_Term_inject = Name "inject"++_Term_lambda = Name "lambda"++_Term_let = Name "let"++_Term_list = Name "list"++_Term_literal = Name "literal"++_Term_map = Name "map"++_Term_optional = Name "optional"++_Term_pair = Name "pair"++_Term_project = Name "project"++_Term_record = Name "record"++_Term_set = Name "set"++_Term_typeApplication = Name "typeApplication"++_Term_typeLambda = Name "typeLambda"++_Term_unit = Name "unit"++_Term_unwrap = Name "unwrap"++_Term_variable = Name "variable"++_Term_wrap = Name "wrap"++-- | A data type+data Type =+ -- | An annotated type+ TypeAnnotated AnnotatedType |+ -- | A type application+ TypeApplication ApplicationType |+ -- | An effectful computation which, when interpreted by a host application, may perform host interactions and produce a value of the given type+ TypeEffect Type |+ -- | An either (sum) type+ TypeEither EitherType |+ -- | A universally quantified (polymorphic) type+ TypeForall ForallType |+ -- | A function type+ TypeFunction FunctionType |+ -- | A list type+ TypeList Type |+ -- | A literal type+ TypeLiteral LiteralType |+ -- | A map type+ TypeMap MapType |+ -- | An optional type+ TypeOptional Type |+ -- | A pair (2-tuple) type+ TypePair PairType |+ -- | A record type+ TypeRecord [FieldType] |+ -- | A set type+ TypeSet Type |+ -- | A union type with field names+ TypeUnion [FieldType] |+ -- | The unit type — the nullary conjunction; one inhabitant. Dual to `void`.+ TypeUnit |+ -- | A type variable+ TypeVariable Name |+ -- | The void (uninhabited, or bottom) type — the nullary disjunction; zero inhabitants. Dual to `unit`.+ TypeVoid |+ -- | A wrapped type (newtype). There is no corresponding `unwrap` variant at the type level: wrap is the introduction form, and a wrapper type's underlying body type is given by the `wrap` variant's argument.+ TypeWrap Type+ deriving (Eq, Ord, Read, Show)++_Type = Name "hydra.core.model.Type"++_Type_annotated = Name "annotated"++_Type_application = Name "application"++_Type_effect = Name "effect"++_Type_either = Name "either"++_Type_forall = Name "forall"++_Type_function = Name "function"++_Type_list = Name "list"++_Type_literal = Name "literal"++_Type_map = Name "map"++_Type_optional = Name "optional"++_Type_pair = Name "pair"++_Type_record = Name "record"++_Type_set = Name "set"++_Type_union = Name "union"++_Type_unit = Name "unit"++_Type_variable = Name "variable"++_Type_void = Name "void"++_Type_wrap = Name "wrap"++-- | A term applied to a type; a type application.+data TypeApplicationTerm =+ TypeApplicationTerm {+ -- | The term being applied to a type+ typeApplicationTermBody :: Term,+ -- | The type argument+ typeApplicationTermType :: Type}+ deriving (Eq, Ord, Read, Show)++_TypeApplicationTerm = Name "hydra.core.model.TypeApplicationTerm"++_TypeApplicationTerm_body = Name "body"++_TypeApplicationTerm_type = Name "type"++-- | A type class constraint on a type variable. Currently has only one variant, but designed to be forward-compatible with multi-parameter type classes and constraints on type expressions.+data TypeClassConstraint =+ -- | A simple type class constraint, naming a single type class+ TypeClassConstraintSimple Name+ deriving (Eq, Ord, Read, Show)++_TypeClassConstraint = Name "hydra.core.model.TypeClassConstraint"++_TypeClassConstraint_simple = Name "simple"++-- | A System F type abstraction term+data TypeLambda =+ TypeLambda {+ -- | The type variable introduced by the abstraction+ typeLambdaParameter :: Name,+ -- | The body of the abstraction+ typeLambdaBody :: Term}+ deriving (Eq, Ord, Read, Show)++_TypeLambda = Name "hydra.core.model.TypeLambda"++_TypeLambda_parameter = Name "parameter"++_TypeLambda_body = Name "body"++-- | A type expression together with free type variables occurring in the expression+data TypeScheme =+ TypeScheme {+ -- | The free type variables+ typeSchemeVariables :: [Name],+ -- | The type expression+ typeSchemeBody :: Type,+ -- | Constraints on type variables, including typeclass constraints. The map keys are type variable names; an empty map means no constraints.+ typeSchemeConstraints :: (M.Map Name TypeVariableConstraints)}+ deriving (Eq, Ord, Read, Show)++_TypeScheme = Name "hydra.core.model.TypeScheme"++_TypeScheme_variables = Name "variables"++_TypeScheme_body = Name "body"++_TypeScheme_constraints = Name "constraints"++-- | Constraints associated with a type variable, including typeclass constraints+data TypeVariableConstraints =+ TypeVariableConstraints {+ -- | The typeclass constraints on this type variable+ typeVariableConstraintsClasses :: (S.Set TypeClassConstraint)}+ deriving (Eq, Ord, Read, Show)++_TypeVariableConstraints = Name "hydra.core.model.TypeVariableConstraints"++_TypeVariableConstraints_classes = Name "classes"++-- | A term wrapped in a type name+data WrappedTerm =+ WrappedTerm {+ -- | The name of the wrapper type+ wrappedTermTypeName :: Name,+ -- | The wrapped term+ wrappedTermBody :: Term}+ deriving (Eq, Ord, Read, Show)++_WrappedTerm = Name "hydra.core.model.WrappedTerm"++_WrappedTerm_typeName = Name "typeName"++_WrappedTerm_body = Name "body"
@@ -0,0 +1,227 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Functions for working with qualified names.++module Hydra.Core.Names where++import qualified Hydra.Core.Annotations as Annotations+import qualified Hydra.Core.Ast as Ast+import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Constants as Constants+import qualified Hydra.Core.Diff as Diff+import qualified Hydra.Core.Docs as Docs+import qualified Hydra.Core.Error.Checking as Checking+import qualified Hydra.Core.Error.File as ErrorFile+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Error.Packaging as ErrorPackaging+import qualified Hydra.Core.Error.System as ErrorSystem+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Formatting as Formatting+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Json.Model as JsonModel+import qualified Hydra.Core.Overlay.Haskell.Lib.Equality as Equality+import qualified Hydra.Core.Overlay.Haskell.Lib.Lists as Lists+import qualified Hydra.Core.Overlay.Haskell.Lib.Literals as Literals+import qualified Hydra.Core.Overlay.Haskell.Lib.Logic as Logic+import qualified Hydra.Core.Overlay.Haskell.Lib.Maps as Maps+import qualified Hydra.Core.Overlay.Haskell.Lib.Math as Math+import qualified Hydra.Core.Overlay.Haskell.Lib.Optionals as Optionals+import qualified Hydra.Core.Overlay.Haskell.Lib.Pairs as Pairs+import qualified Hydra.Core.Overlay.Haskell.Lib.Sets as Sets+import qualified Hydra.Core.Overlay.Haskell.Lib.Strings as Strings+import qualified Hydra.Core.Markdown as Markdown+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Parsing as Parsing+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Query as Query+import qualified Hydra.Core.Regex as Regex+import qualified Hydra.Core.Relational as Relational+import qualified Hydra.Core.System as System+import qualified Hydra.Core.Tabular as Tabular+import qualified Hydra.Core.Testing as Testing+import qualified Hydra.Core.Time as Time+import qualified Hydra.Core.Topology as Topology+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Validation as Validation+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void+import qualified Data.Map as M+import qualified Data.Set as S++-- | Pick a string label that does not collide with a reserved set, by appending a numeric suffix when necessary+chooseUniqueLabel :: S.Set String -> String -> String+chooseUniqueLabel reserved label =++ let tryLabel =+ \index ->+ let candidate = Logic.ifElse (Equality.equal index 1) label (Strings.concat2 label (Literals.printInt32 index))+ in (Logic.ifElse (Sets.member candidate reserved) (tryLabel (Math.add index 1)) candidate)+ in (tryLabel 1)++-- | Given a mapping of namespaces to prefixes, convert a name to a compact string representation+compactName :: M.Map Packaging.ModuleName String -> Model.Name -> String+compactName namespaces name =++ let qualName = qualifyName name+ mns = Util.qualifiedNameModuleName qualName+ local = Util.qualifiedNameLocal qualName+ in (Optionals.match mns (Model.unName name) (\ns -> Optionals.match (Maps.lookup ns namespaces) local (\pre -> Strings.concat [+ pre,+ ":",+ local])))++-- | Compose a provision's fully-qualified name from its enclosing entity's name and its local segment+composeProvisionName :: Model.Name -> String -> Model.Name+composeProvisionName entityName localName =+ Model.Name (Strings.concat [+ Model.unName entityName,+ ".",+ localName])++-- | Generate a binding name for a derived function from a type/term name, given the category's namespace segments+derivedBindingName :: [String] -> t0 -> Model.Name -> Model.Name+derivedBindingName categoryPrefix alwaysDropFirst n =+ derivedDefinitionName categoryPrefix alwaysDropFirst False n (Formatting.decapitalize (localNameOf n))++-- | Generate a derived element name from a source name's namespace and an explicit local name+derivedDefinitionName :: [String] -> t0 -> Bool -> Model.Name -> String -> Model.Name+derivedDefinitionName categoryPrefix _alwaysDropFirst prefixWhenNoNamespace n localName =++ let localResult = Model.Name localName+ prefixedResult = Model.Name (Strings.join "." (Lists.concat2 categoryPrefix [+ localName]))+ noNamespaceResult = Logic.ifElse prefixWhenNoNamespace prefixedResult localResult+ in (Optionals.match (Lists.init (Strings.splitOn "." (Model.unName n))) noNamespaceResult (\nsParts -> Optionals.match (Lists.uncons nsParts) noNamespaceResult (\_nsHeadTail ->+ let root = Lists.take 2 nsParts+ rest = Lists.drop 2 nsParts+ in (Model.Name (Strings.join "." (Lists.concat2 root (Lists.concat2 categoryPrefix (Lists.concat2 rest [+ localName]))))))))++-- | Generate a derived module name by inserting the category after the package root (hydra.<pkgroot>)+derivedModuleName :: [String] -> t0 -> Packaging.ModuleName -> Packaging.ModuleName+derivedModuleName categoryPrefix _alwaysDropFirst ns =++ let parts = Strings.splitOn "." (Packaging.unModuleName ns)+ root = Lists.take 2 parts+ rest = Lists.drop 2 parts+ in (Packaging.ModuleName (Strings.join "." (Lists.concat2 root (Lists.concat2 categoryPrefix rest))))++-- | Generate a fresh type variable name, threading InferenceContext+freshName :: Typing.InferenceContext -> (Model.Name, Typing.InferenceContext)+freshName cx =++ let count = Typing.inferenceContextFreshTypeVariableCount cx+ in (+ normalTypeVariable count,+ Typing.InferenceContext {+ Typing.inferenceContextFreshTypeVariableCount = (Math.add count 1),+ Typing.inferenceContextTrace = (Typing.inferenceContextTrace cx)})++-- | Generate multiple fresh type variable names, threading InferenceContext+freshNames :: Int -> Typing.InferenceContext -> ([Model.Name], Typing.InferenceContext)+freshNames n cx =++ let go =+ \acc -> \_ ->+ let names = Pairs.first acc+ cx0 = Pairs.second acc+ result = freshName cx0+ name = Pairs.first result+ cx1 = Pairs.second result+ in (Lists.concat2 names (Lists.singleton name), cx1)+ in (Lists.foldl go ([], cx) (Lists.replicate n ()))++-- | Extract the local part of a name+localNameOf :: Model.Name -> String+localNameOf arg_ = Util.qualifiedNameLocal (qualifyName arg_)++-- | Extract the module name of a name, if any+moduleNameOf :: Model.Name -> Maybe Packaging.ModuleName+moduleNameOf arg_ = Util.qualifiedNameModuleName (qualifyName arg_)++-- | Convert a module name to a file path with the given case convention and file extension+moduleNameToFilePath :: Util.CaseConvention -> File.FileExtension -> Packaging.ModuleName -> String+moduleNameToFilePath caseConv ext ns =++ let parts = Lists.map (Formatting.convertCase Util.CaseConventionCamel caseConv) (Strings.splitOn "." (Packaging.unModuleName ns))+ in (Strings.concat2 (Strings.concat2 (Strings.join "/" parts) ".") (File.unFileExtension ext))++-- | Convert a name to file path, given case conventions for namespaces and local names, and assuming '/' as the file path separator+nameToFilePath :: Util.CaseConvention -> Util.CaseConvention -> File.FileExtension -> Model.Name -> String+nameToFilePath nsConv localConv ext name =++ let qualName = qualifyName name+ ns = Util.qualifiedNameModuleName qualName+ local = Util.qualifiedNameLocal qualName+ nsToFilePath =+ \nsArg -> Strings.join "/" (Lists.map (\part -> Formatting.convertCase Util.CaseConventionCamel nsConv part) (Strings.splitOn "." (Packaging.unModuleName nsArg)))+ prefix = Optionals.match ns "" (\n -> Strings.concat2 (nsToFilePath n) "/")+ suffix = Formatting.convertCase Util.CaseConventionPascal localConv local+ in (Strings.concat [+ prefix,+ suffix,+ ".",+ (File.unFileExtension ext)])++-- | Convert a name to UPPER-DASHED display form, splitting on '.' and joining with '-'+nameToUpperDashed :: Model.Name -> String+nameToUpperDashed name =++ let parts =+ Lists.map (Formatting.convertCase Util.CaseConventionCamel Util.CaseConventionUpperDashed) (Strings.splitOn "." (Model.unName name))+ in (Strings.join "-" parts)++-- | Type variable naming convention follows Haskell: t0, t1, etc.+normalTypeVariable :: Int -> Model.Name+normalTypeVariable i = Model.Name (Strings.concat2 "t" (Literals.printInt32 i))++-- | Prepend a SubtermStep to the InferenceContext's trace. The trace is accumulated backwards as inference descends through subterms; at error-emission time the list is reversed and wrapped into a SubtermPath stamped onto the error.+pushSubtermStep :: Paths.SubtermStep -> Typing.InferenceContext -> Typing.InferenceContext+pushSubtermStep step cx =+ Typing.InferenceContext {+ Typing.inferenceContextFreshTypeVariableCount = (Typing.inferenceContextFreshTypeVariableCount cx),+ Typing.inferenceContextTrace = (Lists.cons step (Typing.inferenceContextTrace cx))}++-- | Construct a qualified (dot-separated) name+qname :: Packaging.ModuleName -> String -> Model.Name+qname ns name =+ Model.Name (Strings.concat [+ Packaging.unModuleName ns,+ ".",+ name])++-- | Split a dot-separated name into a namespace and local name+qualifyName :: Model.Name -> Util.QualifiedName+qualifyName name =++ let parts = Lists.reverse (Strings.splitOn "." (Model.unName name))+ in (Optionals.match (Lists.uncons parts) (Util.QualifiedName {+ Util.qualifiedNameModuleName = Nothing,+ Util.qualifiedNameLocal = (Model.unName name)}) (\uc ->+ let localName = Pairs.first uc+ restReversed = Pairs.second uc+ in (Logic.ifElse (Lists.isEmpty restReversed) (Util.QualifiedName {+ Util.qualifiedNameModuleName = Nothing,+ Util.qualifiedNameLocal = (Model.unName name)}) (Util.QualifiedName {+ Util.qualifiedNameModuleName = (Just (Packaging.ModuleName (Strings.join "." (Lists.reverse restReversed)))),+ Util.qualifiedNameLocal = localName}))))++-- | Restore the original trace from baseCx, while keeping the freshTypeVariableCount from newCx. Used between sibling sub-inferences (e.g. application LHS vs RHS) so that an error in the second sibling doesn't include the first sibling's trace path. Returns a new InferenceContext.+restoreTrace :: Typing.InferenceContext -> Typing.InferenceContext -> Typing.InferenceContext+restoreTrace baseCx newCx =+ Typing.InferenceContext {+ Typing.inferenceContextFreshTypeVariableCount = (Typing.inferenceContextFreshTypeVariableCount newCx),+ Typing.inferenceContextTrace = (Typing.inferenceContextTrace baseCx)}++-- | Convert a qualified name to a dot-separated name+unqualifyName :: Util.QualifiedName -> Model.Name+unqualifyName qname =++ let prefix = Optionals.match (Util.qualifiedNameModuleName qname) "" (\n -> Strings.concat2 (Packaging.unModuleName n) ".")+ in (Model.Name (Strings.concat2 prefix (Util.qualifiedNameLocal qname)))
@@ -0,0 +1,52 @@+{-# LANGUAGE FlexibleInstances #-}+{-# LANGUAGE FunctionalDependencies #-}++-- | Type class for implicit coercion to TypedTerm+-- This allows TypedTerm, TypedBinding, and String to be used where a TypedTerm is expected,+-- while preserving phantom type information.++module Hydra.Core.Overlay.Haskell.AsTerm where++import Hydra.Core.Model+import Hydra.Core.Packaging+import Hydra.Core.Typed+++-- | Type class for implicit coercion to TypedTerm, preserving phantom types+-- TypedTerm passes through unchanged, TypedBinding becomes a variable reference+-- The functional dependency ensures that the input type determines the phantom type+class AsTerm f a | f -> a where+ asTerm :: f -> TypedTerm a++instance AsTerm (TypedTerm a) a where+ asTerm = id++instance AsTerm (TypedBinding a) a where+ asTerm (TypedBinding name _) = TypedTerm (TermVariable name)++instance AsTerm (TypedTermDefinition a) a where+ asTerm (TypedTermDefinition name _) = TypedTerm (TermVariable name)++instance AsTerm String String where+ asTerm s = TypedTerm $ TermLiteral $ LiteralString s++instance AsTerm Int Int where+ asTerm i = TypedTerm $ TermLiteral $ LiteralInteger $ IntegerValueInt32 i+++-- | Type class for types from which a kernel-level 'Name' can be statically extracted.+-- Used by Phantoms primitives like 'inject', 'match', 'project', 'record', 'unwrap', 'wrap'+-- to accept either a bare 'Name' or any name-typed binding/definition where the 'Name'+-- is known at construction time. Distinct from 'AsTerm' (which can lift arbitrary+-- @TypedTerm Name@ values, but those don't yield a static 'Name').+class AsName n where+ asName :: n -> Name++instance AsName Name where+ asName = id++instance AsName (TypedBinding Name) where+ asName (TypedBinding name _) = name++instance AsName (TypedTermDefinition Name) where+ asName (TypedTermDefinition name _) = name
@@ -0,0 +1,25 @@+{-# LANGUAGE FlexibleInstances #-}++-- | Type class for implicit coercion to Type+-- This allows Type, TypeDefinition, and String to be used where a Type is expected++module Hydra.Core.Overlay.Haskell.AsType where++import Hydra.Core.Model+import Hydra.Core.Packaging+++-- | Type class for implicit coercion to Type+-- This allows Type, TypeDefinition, and String to be used where a Type is expected+class AsType a where+ asType :: a -> Type++instance AsType Type where+ asType = id++-- | A TypeDefinition is referenced as a type variable bearing its name.+instance AsType TypeDefinition where+ asType = TypeVariable . typeDefinitionName++instance AsType String where+ asType s = TypeVariable (Name s)
@@ -0,0 +1,76 @@+-- | A bootstrapping DSL, used for Hydra's inner core models++module Hydra.Core.Overlay.Haskell.Bootstrap (+ module Hydra.Core.Overlay.Haskell.AsType,+ bootstrapGraph,+ datatype,+ descriptionMetadata,+ qualify,+ qualifiedDep,+ typeref,+ defineType,+ unqualifiedDep,+) where++import Hydra.Core.Util+import Hydra.Core.Constants+import Hydra.Core.Model+import Hydra.Core.Overlay.Haskell.AsType+import Hydra.Core.Graph+import Hydra.Core.Lexical+import Hydra.Core.Annotations+import Hydra.Core.Packaging+import Hydra.Core.Overlay.Haskell.Libraries++import qualified Data.List as L+import qualified Data.Map as M+import qualified Data.Set as S+++-- | An empty graph (no elements, no schema, but with primitive functions) which is used for bootstrapping Hydra Core+bootstrapGraph :: Graph+bootstrapGraph = Graph {+ graphBoundTerms = M.empty,+ graphBoundTypes = M.empty,+ graphClassConstraints = M.empty,+ graphLambdaVariables = S.empty,+ graphMetadata = M.empty,+ graphPrimitives = M.fromList $ fmap (\p -> (primitiveDefinitionName (primitiveDefinition p), p)) (L.concat (libraryPrimitives <$> standardLibraries)),+ graphSchemaTypes = M.empty,+ graphTypeVariables = S.empty}++-- | Define a type in a namespace, producing a TypeDefinition directly.+datatype :: ModuleName -> String -> Type -> TypeDefinition+datatype gname lname typ = TypeDefinition {+ typeDefinitionName = qualify gname (Name lname),+ typeDefinitionMetadata = Nothing,+ typeDefinitionBody = TypeScheme {+ typeSchemeVariables = [],+ typeSchemeBody = typ,+ typeSchemeConstraints = M.empty}}++-- | Define a type in a namespace+defineType :: ModuleName -> String -> Type -> TypeDefinition+defineType = datatype++-- | A module dependency qualified by the providing package, for disambiguation.+-- Not yet used, but retained for forthcoming package-qualified dependency resolution.+qualifiedDep :: PackageName -> ModuleName -> ModuleDependency+qualifiedDep pkg ns = ModuleDependency ns (Just pkg)++qualify :: ModuleName -> Name -> Name+qualify (ModuleName gname) (Name lname) = Name $ gname ++ "." ++ lname++typeref :: ModuleName -> String -> Type+typeref ns = TypeVariable . qualify ns . Name++-- | An unqualified module dependency (package omitted; resolver searches all packages in scope)+unqualifiedDep :: ModuleName -> ModuleDependency+unqualifiedDep ns = ModuleDependency ns Nothing++-- | Wrap an optional description string as entity metadata carrying only that description.+-- Used to migrate the former Module/Package `description` field into the `metadata` field+-- without data loss; a Nothing description yields no metadata.+descriptionMetadata :: Maybe String -> Maybe EntityMetadata+descriptionMetadata Nothing = Nothing+descriptionMetadata desc = Just (EntityMetadata desc [] [] Nothing [])
@@ -0,0 +1,85 @@+-- | A DSL which is used as a basis for some of the other DSLs++module Hydra.Core.Overlay.Haskell.Dsl.Annotations where++import Hydra.Core.Model+import Hydra.Core.Util+import Hydra.Core.Constants+import Hydra.Core.Annotations+import Hydra.Core.Overlay.Haskell.AsType+import Hydra.Core.Formatting+import Hydra.Core.Overlay.Haskell.Dsl.Terms as Terms+import qualified Hydra.Core.Overlay.Haskell.Dsl.Types as Types++import qualified Data.Map as M+import qualified Data.Maybe as Y+++annotateTerm :: Name -> Y.Maybe Term -> Term -> Term+annotateTerm = setTermAnnotation++annotateType :: Name -> Y.Maybe Term -> Type -> Type+annotateType = setTypeAnnotation++bounded :: Maybe Int -> Maybe Int -> Type -> Type+bounded min max = annotMin . annotMax+ where+ annotMax t = Y.maybe t (`setMaxLength` t) max+ annotMin t = Y.maybe t (`setMinLength` t) min++boundedList :: AsType a => Maybe Int -> Maybe Int -> a -> Type+boundedList min max et = bounded min max $ Types.list (asType et)++boundedMap :: (AsType a, AsType b) => Maybe Int -> Maybe Int -> a -> b -> Type+boundedMap min max kt vt = bounded min max $ Types.map (asType kt) (asType vt)++boundedSet :: AsType a => Maybe Int -> Maybe Int -> a -> Type+boundedSet min max et = bounded min max $ Types.set (asType et)++boundedString :: Maybe Int -> Maybe Int -> Type+boundedString min max = bounded min max Types.string++dataDoc :: String -> Term -> Term+dataDoc s = setTermDescription (Just s)++deprecated :: AsType a => a -> Type+deprecated = setTypeAnnotation keyDeprecated (Just $ Terms.boolean True) . asType++doc :: AsType a => String -> a -> Type+doc s = setTypeDescription (Just s) . asType++doc70 :: AsType a => String -> a -> Type+doc70 = doc . wrapLine 70++doc80 :: AsType a => String -> a -> Type+doc80 = doc . wrapLine 80++exclude :: AsType a => a -> Type+exclude = setTypeAnnotation keyExclude (Just $ Terms.boolean True) . asType++minLengthList :: AsType a => Int -> a -> Type+minLengthList len = boundedList (Just len) Nothing++nonemptyList :: AsType a => a -> Type+nonemptyList = minLengthList 1++nonemptyMap :: (AsType a, AsType b) => a -> b -> Type+nonemptyMap = boundedMap (Just 1) Nothing++note :: AsType a => String -> a -> Type+note s = doc $ "Note: " ++ s++preserveFieldName :: AsType a => a -> Type+preserveFieldName = setTypeAnnotation keyPreserveFieldName (Just $ Terms.boolean True) . asType++see :: AsType a => String -> a -> Type+see s = doc $ "See " ++ s++setMaxLength :: Int -> Type -> Type+setMaxLength m = setTypeAnnotation keyMaxLength (Just $ Terms.int32 m)++setMinLength :: Int -> Type -> Type+setMinLength m = setTypeAnnotation keyMinLength (Just $ Terms.int32 m)++twoOrMoreList :: AsType a => a -> Type+twoOrMoreList = boundedList (Just 2) Nothing
@@ -0,0 +1,28 @@+-- | A basis for other DSLs which deal with term-encoded expressions.++module Hydra.Core.Overlay.Haskell.Dsl.Base (+ module Hydra.Core.Overlay.Haskell.Dsl.Phantoms,+ module Hydra.Core.Overlay.Haskell.Dsl.Base,+ module Hydra.Core.Overlay.Haskell.Libraries,+) where++import Hydra.Kernel+import Hydra.Core.Overlay.Haskell.Dsl.Phantoms(asTerm, AsTerm(..), definitionInModule, el, firstClassType, opt)+import qualified Hydra.Core.Overlay.Haskell.Dsl.Terms as Terms+import qualified Hydra.Core.Overlay.Haskell.Dsl.Meta.Core as Core+import Hydra.Core.Overlay.Haskell.Libraries++import qualified Data.Map as M+import qualified Data.Maybe as Y+++infixr 0 >:+(>:) :: String -> a -> (TypedTerm Name, a)+n >: d = (name n, d)++infixr 0 >>:+(>>:) :: Name -> a -> (TypedTerm Name, a)+n >>: d = (Core.nameLift n, d)++name :: String -> TypedTerm Name+name s = Core.nameLift $ Name s
@@ -0,0 +1,15 @@+{-# LANGUAGE FlexibleInstances #-}++-- | Common IsString instances for Term and Type, enabling OverloadedStrings++module Hydra.Core.Overlay.Haskell.Dsl.Common where++import Hydra.Core.Model+import Hydra.Core.Typed++import Data.String(IsString(..))+++instance IsString Type where fromString = TypeVariable . Name+instance IsString Term where fromString = TermLiteral . LiteralString+instance IsString (TypedTerm a) where fromString = TypedTerm . TermLiteral . LiteralString
@@ -0,0 +1,172 @@+-- | A domain-specific language for constructing Hydra terms in Haskell.+--+-- This DSL provides helpers for constructing "deep" terms - i.e., terms that+-- represent Hydra terms as data (Term values), as opposed to the shallow DSL+-- that works at the Haskell level.+module Hydra.Core.Overlay.Haskell.Dsl.Deep.Core where++import Hydra.Kernel+import Hydra.Core.Overlay.Haskell.Dsl.Terms (ToPrimName(..))+import qualified Hydra.Core.Overlay.Haskell.Dsl.Meta.Core as Core+import qualified Hydra.Core.Overlay.Haskell.Dsl.Phantoms as P++import qualified Data.Char as C+import qualified Data.List as L+import qualified Data.Map as M+import qualified Data.Set as S+++--------------------------------------------------------------------------------+-- Application operators+--------------------------------------------------------------------------------++-- | Apply a function term to an argument term (infix operator, alias)+(@@@) :: TypedTerm Term -> TypedTerm Term -> TypedTerm Term+fun @@@ arg = apply fun arg++-- | Apply a function term to an argument term+apply :: TypedTerm Term -> TypedTerm Term -> TypedTerm Term+apply lhs rhs = Core.termApplication $ Core.application lhs rhs++--------------------------------------------------------------------------------+-- Case statements and pattern matching+--------------------------------------------------------------------------------++cases :: Name -> TypedTerm Term -> TypedTerm (Maybe Term) -> [TypedTerm CaseAlternative] -> TypedTerm Term+cases tname arg dflt alts = match tname dflt alts @@@ arg++-- | Create a field (e.g. for injection payloads)+field :: Name -> TypedTerm Term -> TypedTerm Field+field fname body = Core.field (Core.nameLift fname) body++-- | Create a case alternative (a variant tag together with its handler) for case matching+caseAlternative :: Name -> TypedTerm Term -> TypedTerm CaseAlternative+caseAlternative aname handler = Core.caseAlternative (Core.nameLift aname) handler++-- | Create a union case statement with optional default case+match :: Name -> TypedTerm (Maybe Term) -> [TypedTerm CaseAlternative] -> TypedTerm Term+match tname dflt alts = Core.termCases $+ Core.caseStatement+ (Core.nameLift tname)+ dflt+ (P.list alts)++--------------------------------------------------------------------------------+-- Functions and lambdas+--------------------------------------------------------------------------------++constant :: TypedTerm Term -> TypedTerm Term+constant = lambda ignoredVariable++-- | Create a lambda term with a variable name and body+lambda :: String -> TypedTerm Term -> TypedTerm Term+lambda v body = Core.termLambda $ Core.lambda (Core.name (P.string v)) P.nothing $ body++-- | Create a lambda term with a dynamic parameter name, optional domain, and body+lambdaTyped :: TypedTerm Name -> TypedTerm (Maybe Type) -> TypedTerm Term -> TypedTerm Term+lambdaTyped name domain body = Core.termLambda $ Core.lambda name domain body++-- | Create a reference to a primitive function.+-- Uses termVariable; the name resolves via graphPrimitives fallthrough.+primitive :: ToPrimName n => n -> TypedTerm Term+primitive = Core.termVariable . Core.nameLift . toPrimName++-- TODO: this is probably equivalent to `primitive`.+-- | Create a reference to a primitive function using encodedName+-- (for primitives that need namespace encoding)+primitiveEncoded :: ToPrimName n => n -> TypedTerm Term+primitiveEncoded = Core.termVariable . P.encodedName . toPrimName++--------------------------------------------------------------------------------+-- Projections and eliminations+--------------------------------------------------------------------------------++-- | Create a record field projection+project :: Name -> Name -> TypedTerm Term+project tname fname = Core.termProject $+ Core.projection (Core.nameLift tname) (Core.nameLift fname)++unwrap :: Name -> TypedTerm Term+unwrap name = unwrapDynamic (Core.nameLift name)++-- | Create an unwrap elimination for a wrapped type+unwrapDynamic :: TypedTerm Name -> TypedTerm Term+unwrapDynamic tname = Core.termUnwrap tname++--------------------------------------------------------------------------------+-- Literals and basic terms+--------------------------------------------------------------------------------++-- | Create a string literal term+string :: TypedTerm String -> TypedTerm Term+string s = Core.termLiteral $ Core.literalString s++-- | Create a unit term+unit :: TypedTerm Term+unit = Core.termUnit++-- | Create a variable reference term+var :: String -> TypedTerm Term+var s = Core.termVariable $ Core.name $ P.string s++--------------------------------------------------------------------------------+-- Compound terms (records, unions, wraps, lists)+--------------------------------------------------------------------------------++-- | Create an Either term (left or right)+either :: TypedTerm (Either Term Term) -> TypedTerm Term+either e = Core.termEither e++-- | Create a union injection term+injection :: Name -> TypedTerm Field -> TypedTerm Term+injection tname fld = Core.termInject $ Core.injection (Core.nameLift tname) fld++-- | Create a Just term+just :: TypedTerm Term -> TypedTerm Term+just (TypedTerm t) = TypedTerm $ TermOptional $ Just t++left :: TypedTerm Term -> TypedTerm Term+left (TypedTerm t) = Core.termEither $ TypedTerm $ TermEither $ Left t++-- | Create a single let binding+letn :: String -> TypedTerm Term -> TypedTerm Term -> TypedTerm Term+letn name value body = lets [(name, value)] body++-- | Create a let expression with bindings and a body+-- Each binding is a (name, term) pair+lets :: [(String, TypedTerm Term)] -> TypedTerm Term -> TypedTerm Term+lets bindings body = Core.termLet $ Core.let_+ (P.list [Core.binding (Core.name (P.string n)) t P.nothing | (n, t) <- bindings])+ body++-- | Create a list term from a list of terms+list :: TypedTerm [Term] -> TypedTerm Term+list terms = Core.termList terms++map :: TypedTerm (M.Map Term Term) -> TypedTerm Term+map terms = Core.termMap terms++-- | Create a Nothing term+nothing :: TypedTerm Term+nothing = TypedTerm $ TermOptional Nothing++pair :: TypedTerm Term -> TypedTerm Term -> TypedTerm Term+pair (TypedTerm first) (TypedTerm second) = Core.termPair $ TypedTerm $ TermPair (first, second)++-- | Create a record term with a type name and fields+record :: Name -> [TypedTerm Field] -> TypedTerm Term+record tname fields = Core.termRecord $ Core.record (Core.nameLift tname) (P.list fields)++ref :: TypedTermDefinition a -> TypedTerm Term+ref (TypedTermDefinition name _) = Core.termVariable $ Core.nameLift name++right :: TypedTerm Term -> TypedTerm Term+right (TypedTerm t) = Core.termEither $ TypedTerm $ TermEither $ Right t++-- | Create a wrap term with a type name and body+wrap :: Name -> TypedTerm Term -> TypedTerm Term+wrap tname body = Core.termWrap $ Core.wrappedTerm (Core.nameLift tname) body++-- | Create a wrap term with a dynamic type name (TypedTerm Name)+wrapDynamic :: TypedTerm Name -> TypedTerm Term -> TypedTerm Term+wrapDynamic tname body = Core.termWrap $ Core.wrappedTerm tname body
@@ -0,0 +1,131 @@+-- | Deep term DSL for the hydra.core.lib.math library.+--+-- These helpers construct Term-valued representations of math primitive+-- applications (TypedTerm Term), as opposed to the shallow DSL in+-- Hydra.Core.Overlay.Haskell.Lib.Math which works at the Haskell value level (TypedTerm Double, etc.).++module Hydra.Core.Overlay.Haskell.Dsl.Deep.Lib.Math where++import Hydra.Kernel+import qualified Hydra.Core.Overlay.Haskell.Dsl.Meta.Core as Core+import Hydra.Core.Overlay.Haskell.Dsl.Phantoms (encodedName)+import Hydra.Core.Overlay.Haskell.Dsl.Terms (ToPrimName(..))+import qualified Hydra.Core.Overlay.Haskell.Dsl.Prims as Prims+import qualified Hydra.Core.Lib.Math as DefMath+++-- | Apply a unary math primitive to a deep term+apply1 :: ToPrimName n => n -> TypedTerm Term -> TypedTerm Term+apply1 n arg = Core.termApplication $ Core.application (Core.termVariable $ encodedName $ toPrimName n) arg++-- | Apply a binary math primitive to two deep terms+apply2 :: ToPrimName n => n -> TypedTerm Term -> TypedTerm Term -> TypedTerm Term+apply2 n a b = Core.termApplication $ Core.application+ (Core.termApplication $ Core.application (Core.termVariable $ encodedName $ toPrimName n) a)+ b++-- | Reference a math primitive as a deep term (for use as a first-class value)+ref :: ToPrimName n => n -> TypedTerm Term+ref = Core.termVariable . encodedName . toPrimName+++-- Unary functions++abs :: TypedTerm Term -> TypedTerm Term+abs = apply1 (Prims.primName DefMath.abs)++acos :: TypedTerm Term -> TypedTerm Term+acos = apply1 (Prims.primName DefMath.acos)++acosh :: TypedTerm Term -> TypedTerm Term+acosh = apply1 (Prims.primName DefMath.acosh)++asin :: TypedTerm Term -> TypedTerm Term+asin = apply1 (Prims.primName DefMath.asin)++asinh :: TypedTerm Term -> TypedTerm Term+asinh = apply1 (Prims.primName DefMath.asinh)++atan :: TypedTerm Term -> TypedTerm Term+atan = apply1 (Prims.primName DefMath.atan)++atanh :: TypedTerm Term -> TypedTerm Term+atanh = apply1 (Prims.primName DefMath.atanh)++ceiling :: TypedTerm Term -> TypedTerm Term+ceiling = apply1 (Prims.primName DefMath.ceiling)++cos :: TypedTerm Term -> TypedTerm Term+cos = apply1 (Prims.primName DefMath.cos)++cosh :: TypedTerm Term -> TypedTerm Term+cosh = apply1 (Prims.primName DefMath.cosh)++exp :: TypedTerm Term -> TypedTerm Term+exp = apply1 (Prims.primName DefMath.exp)++floor :: TypedTerm Term -> TypedTerm Term+floor = apply1 (Prims.primName DefMath.floor)++log :: TypedTerm Term -> TypedTerm Term+log = apply1 (Prims.primName DefMath.log)++negate :: TypedTerm Term -> TypedTerm Term+negate = apply1 (Prims.primName DefMath.negate)++negateFloat64 :: TypedTerm Term -> TypedTerm Term+negateFloat64 = apply1 (Prims.primName DefMath.negateFloat64)++round :: TypedTerm Term -> TypedTerm Term+round = apply1 (Prims.primName DefMath.round)++signum :: TypedTerm Term -> TypedTerm Term+signum = apply1 (Prims.primName DefMath.signum)++sin :: TypedTerm Term -> TypedTerm Term+sin = apply1 (Prims.primName DefMath.sin)++sinh :: TypedTerm Term -> TypedTerm Term+sinh = apply1 (Prims.primName DefMath.sinh)++sqrt :: TypedTerm Term -> TypedTerm Term+sqrt = apply1 (Prims.primName DefMath.sqrt)++tan :: TypedTerm Term -> TypedTerm Term+tan = apply1 (Prims.primName DefMath.tan)++tanh :: TypedTerm Term -> TypedTerm Term+tanh = apply1 (Prims.primName DefMath.tanh)++truncate :: TypedTerm Term -> TypedTerm Term+truncate = apply1 (Prims.primName DefMath.truncate)+++-- Binary functions++add :: TypedTerm Term -> TypedTerm Term -> TypedTerm Term+add = apply2 (Prims.primName DefMath.add)++addFloat64 :: TypedTerm Term -> TypedTerm Term -> TypedTerm Term+addFloat64 = apply2 (Prims.primName DefMath.addFloat64)++atan2 :: TypedTerm Term -> TypedTerm Term -> TypedTerm Term+atan2 = apply2 (Prims.primName DefMath.atan2)++logBase :: TypedTerm Term -> TypedTerm Term -> TypedTerm Term+logBase = apply2 (Prims.primName DefMath.logBase)++mul :: TypedTerm Term -> TypedTerm Term -> TypedTerm Term+mul = apply2 (Prims.primName DefMath.mul)++mulFloat64 :: TypedTerm Term -> TypedTerm Term -> TypedTerm Term+mulFloat64 = apply2 (Prims.primName DefMath.mulFloat64)++pow :: TypedTerm Term -> TypedTerm Term -> TypedTerm Term+pow = apply2 (Prims.primName DefMath.pow)++sub :: TypedTerm Term -> TypedTerm Term -> TypedTerm Term+sub = apply2 (Prims.primName DefMath.sub)++subFloat64 :: TypedTerm Term -> TypedTerm Term -> TypedTerm Term+subFloat64 = apply2 (Prims.primName DefMath.subFloat64)
@@ -0,0 +1,86 @@+-- | A DSL for Hydra literal types in Haskell++module Hydra.Core.Overlay.Haskell.Dsl.LiteralTypes where++import Hydra.Core.Model+++-- | Arbitrary-precision integer type+-- Example: bigint+bigint :: LiteralType+bigint = LiteralTypeInteger IntegerTypeBigint++-- | Binary data type+-- Example: binary+binary :: LiteralType+binary = LiteralTypeBinary++-- | Boolean type+-- Example: boolean+boolean :: LiteralType+boolean = LiteralTypeBoolean++-- | Create a floating point type with the specified precision+-- Example: float FloatTypeFloat32+float :: FloatType -> LiteralType+float = LiteralTypeFloat++-- | 32-bit floating point type+-- Example: float32+float32 :: LiteralType+float32 = float FloatTypeFloat32++-- | 64-bit floating point type+-- Example: float64+float64 :: LiteralType+float64 = float FloatTypeFloat64++-- | 16-bit signed integer type+-- Example: int16+int16 :: LiteralType+int16 = integer IntegerTypeInt16++-- | 32-bit signed integer type+-- Example: int32+int32 :: LiteralType+int32 = integer IntegerTypeInt32++-- | 64-bit signed integer type+-- Example: int64+int64 :: LiteralType+int64 = integer IntegerTypeInt64++-- | 8-bit signed integer type+-- Example: int8+int8 :: LiteralType+int8 = integer IntegerTypeInt8++-- | Create an integer type with the specified bit width+-- Example: integer IntegerTypeInt32+integer :: IntegerType -> LiteralType+integer = LiteralTypeInteger++-- | String type+-- Example: string+string :: LiteralType+string = LiteralTypeString++-- | 16-bit unsigned integer type+-- Example: uint16+uint16 :: LiteralType+uint16 = integer IntegerTypeUint16++-- | 32-bit unsigned integer type+-- Example: uint32+uint32 :: LiteralType+uint32 = integer IntegerTypeUint32++-- | 64-bit unsigned integer type+-- Example: uint64+uint64 :: LiteralType+uint64 = integer IntegerTypeUint64++-- | 8-bit unsigned integer type+-- Example: uint8+uint8 :: LiteralType+uint8 = integer IntegerTypeUint8
@@ -0,0 +1,95 @@+-- | A DSL for constructing Hydra literal values in Haskell++module Hydra.Core.Overlay.Haskell.Dsl.Literals where++import Hydra.Core.Model++import Data.Int+import qualified Data.ByteString as B+import qualified Data.Scientific as Sci+++-- | Create an arbitrary-precision integer literal+-- Example: bigint 9223372036854775808+bigint :: Integer -> Literal+bigint = integer . IntegerValueBigint . fromIntegral++-- | Create a binary data literal+-- Example: binary (B.pack [0x48, 0x65, 0x6C, 0x6C, 0x6F])+binary :: B.ByteString -> Literal+binary = LiteralBinary++-- | Create a boolean literal+-- Example: boolean True+boolean :: Bool -> Literal+boolean = LiteralBoolean++-- | Create an arbitrary-precision decimal literal+-- Example: decimal (Sci.scientific 314159265359 (-11))+decimal :: Sci.Scientific -> Literal+decimal = LiteralDecimal++-- | Create a floating-point literal with specified precision+-- Example: float (FloatValueFloat32 3.14)+float :: FloatValue -> Literal+float = LiteralFloat++-- | Create a 32-bit floating point literal+-- Example: float32 3.14+float32 :: Float -> Literal+float32 = float . FloatValueFloat32++-- | Create a 64-bit floating point literal+-- Example: float64 3.14159265359+float64 :: Double -> Literal+float64 = float . FloatValueFloat64++-- | Create a 16-bit signed integer literal+-- Example: int16 32767+int16 :: Int16 -> Literal+int16 = integer . IntegerValueInt16 . fromIntegral++-- | Create a 32-bit signed integer literal+-- Example: int32 42+int32 :: Int -> Literal+int32 = integer . IntegerValueInt32++-- | Create a 64-bit signed integer literal+-- Example: int64 9223372036854775807+int64 :: Int64 -> Literal+int64 = integer . IntegerValueInt64 . fromIntegral++-- | Create an 8-bit signed integer literal+-- Example: int8 127+int8 :: Int8 -> Literal+int8 = integer . IntegerValueInt8 . fromIntegral++-- | Create an integer literal with specified bit width+-- Example: integer (IntegerValueInt32 42)+integer :: IntegerValue -> Literal+integer = LiteralInteger++-- | Create a string literal+-- Example: string "hello world"+string :: String -> Literal+string = LiteralString++-- | Create a 16-bit unsigned integer literal+-- Example: uint16 65535+uint16 :: Int -> Literal+uint16 = integer . IntegerValueUint16 . fromIntegral++-- | Create a 32-bit unsigned integer literal+-- Example: uint32 4294967295+uint32 :: Int64 -> Literal+uint32 = integer . IntegerValueUint32 . fromIntegral++-- | Create a 64-bit unsigned integer literal+-- Example: uint64 18446744073709551615+uint64 :: Integer -> Literal+uint64 = integer . IntegerValueUint64 . fromIntegral++-- | Create an 8-bit unsigned integer literal+-- Example: uint8 255+uint8 :: Int16 -> Literal+uint8 = integer . IntegerValueUint8 . fromIntegral
@@ -0,0 +1,61 @@+{-# LANGUAGE FlexibleContexts #-}+{-# LANGUAGE ScopedTypeVariables #-}++-- | Haskell-specific convenience layer over the generated Hydra.Core.Dsl.Model module.+-- Re-exports all generated DSL functions and adds AsTerm-flexible overrides+-- for functions commonly called with TypedBinding arguments.++module Hydra.Core.Overlay.Haskell.Dsl.Meta.Core (+ module Hydra.Core.Dsl.Model,+ module Hydra.Core.Overlay.Haskell.Dsl.Meta.Core,+ nameLift,+) where++import Hydra.Kernel+import Hydra.Core.Overlay.Haskell.AsTerm+import Hydra.Core.Overlay.Haskell.Dsl.Phantoms (nameLift, var, (~>))+import Hydra.Core.Dsl.Model hiding (binding, injection, typeVariable)+import qualified Hydra.Core.Dsl.Model as Gen++-- For helpers+import qualified Hydra.Core.Dsl.Lib.Equality as Equality+import qualified Hydra.Core.Dsl.Lib.Lists as Lists+import qualified Hydra.Core.Dsl.Lib.Logic as Logic++import qualified Data.Map as M+import Prelude hiding (map, product)+++-- | AsTerm-flexible overrides of generated functions.+-- These allow passing TypedBinding values where TypedTerm is expected.++binding :: AsTerm t Term => TypedTerm Name -> t -> TypedTerm (Maybe TypeScheme) -> TypedTerm Binding+binding n t ts = Gen.binding n (asTerm t) ts++equalNameList_ :: TypedTerm [Name] -> TypedTerm [Name] -> TypedTerm Bool+equalNameList_ lefts rights = Logic.and+ (Equality.equal (Lists.length lefts) (Lists.length rights))+ (ands $ Lists.zipWith equalName lefts rights)+ where+ equalName = "left" ~> "right" ~> Equality.equal+ (Gen.unName (var "left" :: TypedTerm Name))+ (Gen.unName (var "right" :: TypedTerm Name))+ -- Fold a list of booleans with logical AND (True for the empty list).+ -- The generated Hydra.Core.Dsl.Lib.Logic has no 'ands' helper, so fold inline.+ ands bools = Lists.foldl ("acc" ~> "x" ~> Logic.and (var "acc") (var "x")) true bools+ true = TypedTerm (TermLiteral (LiteralBoolean True)) :: TypedTerm Bool++equalName_ :: TypedTerm Name -> TypedTerm Name -> TypedTerm Bool+equalName_ left right = Equality.equal (Gen.unName left) (Gen.unName right)++false :: TypedTerm Term+false = termLiteral $ literalBoolean $ TypedTerm $ TermLiteral $ LiteralBoolean False++injection :: AsTerm t Name => t -> TypedTerm Field -> TypedTerm Injection+injection n f = Gen.injection (asTerm n) f++typeVariable :: AsTerm t Name => t -> TypedTerm Type+typeVariable n = Gen.typeVariable (asTerm n)+++-- | Non-standard helpers (used in kernel source modules)
@@ -0,0 +1,39 @@+{-# LANGUAGE ScopedTypeVariables #-}++-- | Haskell-specific convenience layer over the generated Hydra.Core.Dsl.Graph module.+-- Re-exports all generated DSL functions and adds non-standard helpers.++module Hydra.Core.Overlay.Haskell.Dsl.Meta.Graph (+ module Hydra.Core.Dsl.Graph,+ module Hydra.Core.Overlay.Haskell.Dsl.Meta.Graph,+) where++import Hydra.Kernel+import Hydra.Core.Overlay.Haskell.Dsl.Phantoms+import Hydra.Core.Dsl.Graph++import qualified Hydra.Core.Dsl.Lib.Maps as Maps+import qualified Hydra.Core.Dsl.Lib.Sets as Sets+++-- | Non-standard helpers++comparisonEqualTo :: TypedTerm Comparison+comparisonEqualTo = injectUnit _Comparison _Comparison_equalTo++comparisonGreaterThan :: TypedTerm Comparison+comparisonGreaterThan = injectUnit _Comparison _Comparison_greaterThan++comparisonLessThan :: TypedTerm Comparison+comparisonLessThan = injectUnit _Comparison _Comparison_lessThan++emptyGraph :: TypedTerm Graph+emptyGraph = graph+ Maps.empty -- boundTerms+ Maps.empty -- boundTypes+ Maps.empty -- classConstraints+ Sets.empty -- lambdaVariables+ Maps.empty -- metadata+ Maps.empty -- primitives+ Maps.empty -- schemaTypes+ Sets.empty -- typeVariables
@@ -0,0 +1,80 @@+-- | A DSL for constructing literal terms using Haskell's built-in datatypes++module Hydra.Core.Overlay.Haskell.Dsl.Meta.Literals where++import Hydra.Core.Typed+import qualified Hydra.Core.Overlay.Haskell.Dsl.Terms as Terms++import Data.Int+import qualified Data.ByteString as B+import qualified Data.Scientific as Sci+++-- Binary is now properly represented as ByteString+type Binary = B.ByteString++bigint :: Integer -> TypedTerm Integer+bigint = TypedTerm . Terms.bigint++binary :: Binary -> TypedTerm Binary+binary = TypedTerm . Terms.binary++bool :: Bool -> TypedTerm Bool+bool = TypedTerm . Terms.boolean++boolean :: Bool -> TypedTerm Bool+boolean = bool++char :: Char -> TypedTerm Int+char = TypedTerm . Terms.char++decimal :: Sci.Scientific -> TypedTerm Sci.Scientific+decimal = TypedTerm . Terms.decimal++double :: Double -> TypedTerm Double+double = float64++false :: TypedTerm Bool+false = bool False++float :: Float -> TypedTerm Float+float = float32++float32 :: Float -> TypedTerm Float+float32 = TypedTerm . Terms.float32++float64 :: Double -> TypedTerm Double+float64 = TypedTerm . Terms.float64++int :: Int -> TypedTerm Int+int = int32++int16 :: Int16 -> TypedTerm Int16+int16 = TypedTerm . Terms.int16++int32 :: Int -> TypedTerm Int+int32 = TypedTerm . Terms.int32++int64 :: Int64 -> TypedTerm Int64+int64 = TypedTerm . Terms.int64++int8 :: Int8 -> TypedTerm Int8+int8 = TypedTerm . Terms.int8++string :: String -> TypedTerm String+string = TypedTerm . Terms.string++true :: TypedTerm Bool+true = bool True++uint16 :: Int -> TypedTerm Int+uint16 = TypedTerm . Terms.uint16++uint32 :: Int64 -> TypedTerm Int64+uint32 = TypedTerm . Terms.uint32++uint64 :: Integer -> TypedTerm Integer+uint64 = TypedTerm . Terms.uint64++uint8 :: Int16 -> TypedTerm Int16+uint8 = TypedTerm . Terms.uint8
@@ -0,0 +1,14 @@+-- | DSL helpers for constructing tabular (relational) schemas++module Hydra.Core.Overlay.Haskell.Dsl.Meta.Tabular where++import Hydra.Core.Model+import Hydra.Core.Relational+import Hydra.Core.Tabular+++columnType :: String -> Type -> ColumnType+columnType name typ = ColumnType (ColumnName name) typ++tableType :: String -> [ColumnType] -> TableType+tableType name columns = TableType (RelationName name) columns
@@ -0,0 +1,529 @@+{-# LANGUAGE FlexibleContexts #-}+{-# LANGUAGE ScopedTypeVariables #-}++-- | A domain-specific language for constructing term-encoded Hydra terms in Haskell;+-- these functions enable you to build terms (programs) which build terms.+module Hydra.Core.Overlay.Haskell.Dsl.Meta.Terms (+ module Hydra.Core.Overlay.Haskell.Dsl.Base,+ module Hydra.Core.Overlay.Haskell.Dsl.Meta.Terms,+) where++import Hydra.Kernel+import qualified Hydra.Core.Overlay.Haskell.Dsl.Terms as Terms+import qualified Hydra.Core.Overlay.Haskell.Dsl.Meta.Core as Core+import qualified Hydra.Core.Encode.Model as EncodeCore+import Hydra.Core.Overlay.Haskell.Dsl.Base+import qualified Hydra.Core.Overlay.Haskell.Dsl.Phantoms as Phantoms+import qualified Hydra.Core.Dsl.Lib.Maps as Maps++import qualified Data.ByteString as B+import qualified Data.List as L+import qualified Data.Map as M+import qualified Data.Scientific as Sci+import qualified Data.Set as S+import qualified Data.Maybe as Y+import Data.Int+import Prelude hiding (map, product, sum)+++-- Operators++-- | Function composition operator for term-encoded terms: f <.> g creates a function that applies g then f+-- Example: var "stringLength" <.> var "toString"+(<.>) :: TypedTerm Term -> TypedTerm Term -> TypedTerm Term+f <.> g = compose f g++-- | Function application operator for term-encoded terms+-- Example: fun @@ arg+(@@) :: TypedTerm Term -> TypedTerm Term -> TypedTerm Term+f @@ x = apply f x++-- | Attach a map of annotations to a term-encoded term, wrapping the map as a+-- TermMap annotation per Hydra's convention (#386). Each Name key is lifted+-- to a TermVariable in the resulting TermMap.+-- Distinct from 'Phantoms.annot' (which attaches a single annotation by key).+-- Example: annots (Phantoms.map M.empty) (int32 42)+annots :: TypedTerm (M.Map Name Term) -> TypedTerm Term -> TypedTerm Term+annots annMap term = Core.termAnnotated $ Core.annotatedTerm term (annotationMapToTerm annMap)++-- | Create a term-encoded annotated term (term with type annotations).+-- The map argument is wrapped as a TermMap annotation per Hydra's convention.+-- Example: annotated (int32 42) (Phantoms.map M.empty)+annotated :: TypedTerm Term -> TypedTerm (M.Map Name Term) -> TypedTerm Term+annotated term annMap = Core.termAnnotated $ Core.annotatedTerm term (annotationMapToTerm annMap)++-- | Lift a term-encoded Map<Name, Term> to a term-encoded TermMap with each+-- Name key wrapped as a TermVariable. The canonical encoding for Hydra's+-- annotation map convention after #386.+annotationMapToTerm :: TypedTerm (M.Map Name Term) -> TypedTerm Term+annotationMapToTerm m = Core.termMap+ (Maps.mapKeys (Phantoms.lambda "n" (Core.termVariable (Phantoms.var "n"))) m)++annotatedTerm :: TypedTerm Term -> TypedTerm Term -> TypedTerm Term+annotatedTerm body ann = inject (Core.nameLift _Term) "annotated" $ record (Core.nameLift _AnnotatedTerm) [+ _AnnotatedTerm_body>>: body,+ _AnnotatedTerm_annotation>>: ann]++-- | Apply a term-encoded function to a term-encoded argument+-- Example: apply (var "add") (int32 1)+apply :: TypedTerm Term -> TypedTerm Term -> TypedTerm Term+apply func arg = Core.termApplication $ Core.application func arg++-- | Create a term-encoded unlimited precision integer+-- Example: bigint 42+bigint :: Integer -> TypedTerm Term+bigint = bigintLift . TypedTerm . Terms.bigint++-- | Lift a TypedTerm Integer to a term-encoded bigint literal+-- Example: bigintLift (varPhantom "x" :: TypedTerm Integer)+bigintLift :: TypedTerm Integer -> TypedTerm Term+bigintLift = Core.termLiteral . Core.literalInteger . Core.integerValueBigint++-- | Create a term-encoded binary (byte string) literal+-- Example: binary (B.pack [0x48, 0x65, 0x6C, 0x6C, 0x6F])+binary :: B.ByteString -> TypedTerm Term+binary = binaryLift . TypedTerm . Terms.binary++-- | Lift a TypedTerm ByteString to a term-encoded binary literal+binaryLift :: TypedTerm B.ByteString -> TypedTerm Term+binaryLift = Core.termLiteral . Core.literalBinary++-- | Create a term-encoded boolean literal+-- Example: boolean True+boolean :: Bool -> TypedTerm Term+boolean = booleanLift . TypedTerm . Terms.boolean++-- | Lift a TypedTerm Bool to a term-encoded boolean literal+-- Example: booleanLift $ Phantoms.true+booleanLift :: TypedTerm Bool -> TypedTerm Term+booleanLift = Core.termLiteral . Core.literalBoolean++-- | Create a meta-level term encoding a boolean literal+-- Example: booleanTerm True creates a term that *represents* the boolean True+booleanTerm :: Bool -> TypedTerm Term+booleanTerm b = inject (Core.nameLift _Term) "literal" $ inject (Core.nameLift _Literal) "boolean" $ boolean b++-- | Create a term-encoded character literal via int32+-- Example: char 'A'+char :: Char -> TypedTerm Term+char = int32 . ord+ where+ ord = fromEnum++-- | Convert a Comparison enum value to a term-encoded term+-- Example: comparison ComparisonEqualTo+comparison :: Comparison -> TypedTerm Term+comparison t = case t of+ ComparisonEqualTo -> Phantoms.injectUnit _Comparison _Comparison_equalTo+ ComparisonLessThan -> Phantoms.injectUnit _Comparison _Comparison_lessThan+ ComparisonGreaterThan -> Phantoms.injectUnit _Comparison _Comparison_greaterThan+++-- | Term-encoded function composition (apply g then f)+-- Example: compose f g creates a function that applies g then f+compose :: TypedTerm Term -> TypedTerm Term -> TypedTerm Term+compose f g = lambda "arg_" $ f @@ (g @@ var "arg_")++-- | Create a term-encoded constant function that always returns the same term-encoded value+-- Example: constant (int32 42)+constant :: TypedTerm Term -> TypedTerm Term+constant = lambda ignoredVariable++-- | Create a term-encoded arbitrary-precision exact decimal literal+-- Example: decimal 42+decimal :: Sci.Scientific -> TypedTerm Term+decimal = decimalLift . TypedTerm . Terms.decimal++-- | Lift a TypedTerm Scientific to a term-encoded decimal literal+decimalLift :: TypedTerm Sci.Scientific -> TypedTerm Term+decimalLift = Core.termLiteral . Core.literalDecimal++-- | Term-encoded boolean false literal+false :: TypedTerm Term+false = boolean False++-- | Create a term-encoded field with the given name and term-encoded value+-- Example: field "age" (int32 30)+field :: String -> TypedTerm Term -> TypedTerm Field+field s = Core.field (name s)++-- | Create a term-encoded floating-point literal with specified precision+-- Example: float (FloatValueFloat32 3.14)+float :: TypedTerm FloatValue -> TypedTerm Term+float = Core.termLiteral . Core.literalFloat++-- | Create a term-encoded 32-bit floating point literal+-- Example: float32 3.14+float32 :: Float -> TypedTerm Term+float32 = float32Lift . TypedTerm . Terms.float32++-- | Lift a TypedTerm Float to a term-encoded float32 literal+-- Example: float32Lift (varPhantom "x" :: TypedTerm Float)+float32Lift :: TypedTerm Float -> TypedTerm Term+float32Lift = Core.termLiteral . Core.literalFloat . Core.floatValueFloat32++-- | Create a term-encoded 64-bit floating point literal+-- Example: float64 3.14159+float64 :: Double -> TypedTerm Term+float64 = float64Lift . TypedTerm . Terms.float64++-- | Lift a TypedTerm Float to a term-encoded float64 literal+-- Example: float64Lift (varPhantom "x" :: TypedTerm Float)+float64Lift :: TypedTerm Double -> TypedTerm Term+float64Lift = Core.termLiteral . Core.literalFloat . Core.floatValueFloat64++-- | Term-encoded identity function+-- Example: identity+identity :: TypedTerm Term+identity = lambda "x_" $ var "x_"++-- | Create a term-encoded union injection+-- Example: inject (name "Result") "success" (int32 42)+inject :: AsTerm t Name => t -> String -> TypedTerm Term -> TypedTerm Term+inject tname fname = Core.termInject . Core.injection (asTerm tname) . Core.field (name fname)++injectPhantom :: Name -> Name -> TypedTerm Term -> TypedTerm Term+injectPhantom tname fname term = Core.termInject $ Core.injection (Core.nameLift tname) $ Core.field (Core.nameLift fname) term++injectUnit :: AsTerm t Name => t -> String -> TypedTerm Term+injectUnit tname fname = inject tname fname unit++injectUnitPhantom :: Name -> Name -> TypedTerm Term+injectUnitPhantom tname fname = injectPhantom tname fname Core.termUnit++-- | Create a term-encoded 16-bit signed integer literal+-- Example: int16 32767+int16 :: Int16 -> TypedTerm Term+int16 = int16Lift . TypedTerm . Terms.int16++-- | Lift a TypedTerm Int16 to a term-encoded int16 literal+-- Example: int16Lift (varPhantom "x" :: TypedTerm Int16)+int16Lift :: TypedTerm Int16 -> TypedTerm Term+int16Lift = Core.termLiteral . Core.literalInteger . Core.integerValueInt16++-- | Create a meta-level term encoding a 16-bit signed integer literal+-- Example: int16Term 100 creates a term that *represents* the int16 literal 100+int16Term :: Int16 -> TypedTerm Term+int16Term n = inject (Core.nameLift _Term) "literal" $+ inject (Core.nameLift _Literal) "integer" $+ inject (Core.nameLift _IntegerValue) "int16" $ int16 n++-- | Create a term-encoded 32-bit signed integer literal+-- Example: int32 42+int32 :: Int -> TypedTerm Term+int32 = int32Lift . TypedTerm . Terms.int32++-- | Lift a TypedTerm Int to a term-encoded int32 literal+-- Example: int32Lift (varPhantom "x" :: TypedTerm Int)+int32Lift :: TypedTerm Int -> TypedTerm Term+int32Lift = Core.termLiteral . Core.literalInteger . Core.integerValueInt32++-- | Create a meta-level term encoding a 32-bit signed integer literal+-- Example: int32Term 42 creates a term that *represents* the int32 literal 42+int32Term :: Int -> TypedTerm Term+int32Term n = inject (Core.nameLift _Term) "literal" $+ inject (Core.nameLift _Literal) "integer" $+ inject (Core.nameLift _IntegerValue) "int32" $ int32 n++-- | Create a term-encoded 64-bit signed integer literal+-- Example: int64 9223372036854775807+int64 :: Int64 -> TypedTerm Term+int64 = int64Lift . TypedTerm . Terms.int64++-- | Lift a TypedTerm Int64 to a term-encoded int64 literal+-- Example: int64Lift (varPhantom "x" :: TypedTerm Int64)+int64Lift :: TypedTerm Int64 -> TypedTerm Term+int64Lift = Core.termLiteral . Core.literalInteger . Core.integerValueInt64++-- | Create a meta-level term encoding a 64-bit signed integer literal+-- Example: int64Term 137 creates a term that *represents* the int64 literal 137+int64Term :: Int64 -> TypedTerm Term+int64Term n = inject (Core.nameLift _Term) "literal" $+ inject (Core.nameLift _Literal) "integer" $+ inject (Core.nameLift _IntegerValue) "int64" $ int64 n++-- | Create a term-encoded 8-bit signed integer literal+-- Example: int8 127+int8 :: Int8 -> TypedTerm Term+int8 = int8Lift . TypedTerm . Terms.int8++-- | Lift a TypedTerm Int8 to a term-encoded int8 literal+-- Example: int8Lift (varPhantom "x" :: TypedTerm Int8)+int8Lift :: TypedTerm Int8 -> TypedTerm Term+int8Lift = Core.termLiteral . Core.literalInteger . Core.integerValueInt8++-- | Create a term-encoded integer literal with specified bit width+-- Example: integer (IntegerValueInt32 42)+integer :: TypedTerm IntegerValue -> TypedTerm Term+integer = Core.termLiteral . Core.literalInteger++-- | Create a term-encoded 'Just' optional value+-- Example: just (string "found")+just :: TypedTerm Term -> TypedTerm (Maybe Term)+just = Phantoms.just++-- | Create a term-encoded lambda function with one parameter+-- Example: lambda "x" (var "add" @@ var "x" @@ int32 1)+lambda :: String -> TypedTerm Term -> TypedTerm Term+lambda var body = Core.termLambda $ Core.lambda (name var) Phantoms.nothing body++-- | Create a term-encoded lambda with a type annotation+-- Example: lambdaTyped "x" T.int32 (var "x")+lambdaTyped :: String -> TypedTerm Type -> TypedTerm Term -> TypedTerm Term+lambdaTyped param dom body = Core.termLambda $ Core.lambda (name param) (Phantoms.just dom) body++-- | Create a term-encoded multi-parameter lambda function (curried form)+-- Example: lambdas ["x", "y"] (var "add" @@ var "x" @@ var "y")+lambdas :: [String] -> TypedTerm Term -> TypedTerm Term+lambdas params body = case params of+ [] -> body+ (h:rest) -> Core.termLambda $ Core.lambda (name h) Phantoms.nothing $ lambdas rest body++-- | Create a term-encoded left either value+-- Example: left (string "error")+left :: TypedTerm Term -> TypedTerm Term+left t = Core.termEither $ Phantoms.left t++-- | Create a term-encoded let expression with multiple bindings+-- Example: lets ["x">: int32 1, "y">: int32 2] (var "add" @@ var "x" @@ var "y")+lets :: [(TypedTerm Name, TypedTerm Term)] -> TypedTerm Term -> TypedTerm Term+lets pairs body = Core.termLet $ Core.let_ (Phantoms.list $ toBinding pairs) body+ where+ toBinding = fmap (\(n, t) -> Core.binding n t Phantoms.nothing)++-- | Create a term-encoded let expression with type annotations on bindings+-- Example: letsTyped [("x", int32 1, T.mono T.int32)] (var "x")+letsTyped :: [(String, TypedTerm Term, TypedTerm TypeScheme)] -> TypedTerm Term -> TypedTerm Term+letsTyped bindings body = Core.termLet $ Core.let_ (Phantoms.list $ toBinding bindings) body+ where+ toBinding = fmap (\(n, t, ts) -> Core.binding (name n) t (Phantoms.just ts))++-- | Create a term-encoded list+-- Example: list [int32 1, int32 2, int32 3]+list :: [TypedTerm Term] -> TypedTerm Term+list = Core.termList . Phantoms.list++-- | Create a term-encoded literal from a Literal value+-- Example: literal (LiteralInteger (IntegerValueInt32 42))+literal :: TypedTerm Literal -> TypedTerm Term+literal = Core.termLiteral++-- | Create a term-encoded map/dictionary+-- Example: map (fromList [(string "key", int32 42)])+map :: TypedTerm (M.Map Term Term) -> TypedTerm Term+map = Core.termMap++mapTerm1 :: TypedTerm (M.Map Term Term) -> TypedTerm Term+mapTerm1 m = inject (Core.nameLift _Term) "map" $ Core.termMap m++-- | Create a term-encoded pattern match on a union+-- Example: match (name "Result") nothing ["success">: int32 42, "error">: string "fail"]+match :: AsTerm t Name => t -> TypedTerm (Maybe Term) -> [(TypedTerm Name, TypedTerm Term)] -> TypedTerm Term+match tname def pairs = Core.termCases+ $ Core.caseStatement (asTerm tname) def $ Phantoms.list $ toCaseAlternative pairs+ where+ toCaseAlternative = fmap (\(n, t) -> Core.caseAlternative n t)++--meta :: TypedTerm a -> TypedTerm Term+--meta (TypedTerm term) = TypedTerm $ EncodeCore.term term++metaref :: TypedTermDefinition a -> TypedTerm Term+metaref (TypedTermDefinition name _) = Core.termVariable $ Core.nameLift name++-- | Create a meta-level term encoding a Name+-- Example: nameTerm "foo" creates a term that *represents* the name "foo"+nameTerm :: String -> TypedTerm Term+nameTerm s = wrap (Core.nameLift _Name) $ string s++-- | Create a term-encoded 'Nothing' optional value+nothing :: TypedTerm (Maybe Term)+nothing = Phantoms.nothing++-- | Create a term-encoded optional value from a Maybe+-- Example: optional (just (int32 42))+optional :: TypedTerm (Maybe Term) -> TypedTerm Term+optional = Core.termOptional++-- | Create a term-encoded pair+-- Example: pair (string "name") (int32 42)+pair :: TypedTerm Term -> TypedTerm Term -> TypedTerm Term+pair t1 t2 = Core.termPair $ Phantoms.pair t1 t2++-- | Create a term-encoded reference to a primitive function.+-- Uses termVariable; the name resolves via graphPrimitives fallthrough.+-- Example: primitive DefStrings.length+primitive :: Terms.ToPrimName n => n -> TypedTerm Term+primitive = Core.termVariable . TypedTerm . EncodeCore.name . Terms.toPrimName++-- | Create a term-encoded field projection function+-- Example: project (name "Person") (name "firstName")+project :: (AsTerm t Name, AsTerm f Name) => t -> f -> TypedTerm Term+project tname fname = Core.termProject+ $ Core.projection (asTerm tname) (asTerm fname)++-- | Create a term-encoded record with named fields+-- Example: record (name "Person") ["name">: string "John", "age">: int32 30]+record :: AsTerm t Name => t -> [(TypedTerm Name, TypedTerm Term)] -> TypedTerm Term+record name pairs = Core.termRecord $ Core.record (asTerm name) $ Phantoms.list (toField <$> pairs)+ where+ toField (n, t) = Core.field n t++recordLift :: Name -> [(TypedTerm Name, TypedTerm Term)] -> TypedTerm Term+recordLift name pairs = record (TypedTerm $ EncodeCore.name name) pairs++-- | Create a term-encoded right either value+-- Example: right (int32 42)+right :: TypedTerm Term -> TypedTerm Term+right t = Core.termEither $ Phantoms.right t++-- | Create a term-encoded set+-- Example: set [string "a", string "b", string "c"]+set :: [TypedTerm Term] -> TypedTerm Term+set els = Core.termSet $ TypedTerm $ TermSet $ S.fromList (unTypedTerm <$> els)++-- | Create a term-encoded string literal+-- Example: string "hello world"+string :: String -> TypedTerm Term+string = stringLift . TypedTerm . Terms.string++-- | Lift a TypedTerm String to a term-encoded string literal+-- Example: stringLift $ Phantoms.string "hello world"+stringLift :: TypedTerm String -> TypedTerm Term+stringLift = Core.termLiteral . Core.literalString++stringTerm :: String -> TypedTerm Term+stringTerm s = inject (Core.nameLift _Term) "literal" $ inject (Core.nameLift _Literal) "string" $ string s++-- | Create a term-encoded 3-tuple using nested pairs+-- Example: triple (int32 1) (string "test") (boolean True)+triple :: TypedTerm Term -> TypedTerm Term -> TypedTerm Term -> TypedTerm Term+triple t1 t2 t3 = pair t1 (pair t2 t3)++-- | Term-encoded boolean true literal+true :: TypedTerm Term+true = boolean True++-- | Create a term-encoded tuple with multiple components using nested pairs+-- Example: tuple [string "name", int32 42, boolean True]+tuple :: [TypedTerm Term] -> TypedTerm Term+tuple [] = unit+tuple [a] = a+tuple [a, b] = pair a b+tuple (a:rest) = pair a (tuple rest)++-- | Create a term-encoded 2-tuple (same as pair)+-- Example: tuple2 (string "name") (int32 42)+tuple2 :: TypedTerm Term -> TypedTerm Term -> TypedTerm Term+tuple2 = pair++-- | Create a term-encoded 4-tuple using nested pairs+-- Example: tuple4 (int32 1) (string "test") (boolean True) (float32 3.14)+tuple4 :: TypedTerm Term -> TypedTerm Term -> TypedTerm Term -> TypedTerm Term -> TypedTerm Term+tuple4 t1 t2 t3 t4 = pair t1 (pair t2 (pair t3 t4))++-- | Create a term-encoded 5-tuple using nested pairs+-- Example: tuple5 (int32 1) (string "a") (boolean True) (float32 3.14) (int32 42)+tuple5 :: TypedTerm Term -> TypedTerm Term -> TypedTerm Term -> TypedTerm Term -> TypedTerm Term -> TypedTerm Term+tuple5 t1 t2 t3 t4 t5 = pair t1 (pair t2 (pair t3 (pair t4 t5)))++-- | Create a term-encoded type application+-- Example: tyapp (list []) T.int32+tyapp :: TypedTerm Term -> TypedTerm Type -> TypedTerm Term+tyapp term typ = Core.termTypeApplication $ Core.typeApplicationTerm term typ++-- | Apply multiple type arguments to a term+-- Example: tyapps (pair (int32 1) (string "a")) [T.int32, T.string]+tyapps :: TypedTerm Term -> [TypedTerm Type] -> TypedTerm Term+tyapps = L.foldl tyapp++-- | Create a term-encoded type lambda (System F)+-- Example: tylam "t0" (lambda "x" $ var "x")+tylam :: String -> TypedTerm Term -> TypedTerm Term+tylam var body = Core.termTypeLambda $ Core.typeLambda (name var) body++-- | Create multiple term-encoded type lambdas+-- Example: tylams ["t0", "t1"] (lambda "x" $ var "x")+tylams :: [String] -> TypedTerm Term -> TypedTerm Term+tylams vars body = L.foldl (\b v -> Core.termTypeLambda $ Core.typeLambda (name v) b) body $ L.reverse vars++-- | Apply type arguments to a polymorphic term (same as tyapps)+-- Example: typeApplication (list []) [T.int32]+typeApplication :: TypedTerm Term -> [TypedTerm Type] -> TypedTerm Term+typeApplication = tyapps++-- | Create term-encoded type lambda(s) (same as tylams)+-- Example: typeLambda ["t0"] (lambda "x" $ var "x")+typeLambda :: [String] -> TypedTerm Term -> TypedTerm Term+typeLambda = tylams++-- | Create a term-encoded 16-bit unsigned integer literal+-- Example: uint16 65535+uint16 :: Int -> TypedTerm Term+uint16 = uint16Lift . TypedTerm . Terms.uint16++-- | Lift a TypedTerm Int to a term-encoded uint16 literal+-- Example: uint16Lift (varPhantom "x" :: TypedTerm Int)+uint16Lift :: TypedTerm Int -> TypedTerm Term+uint16Lift = Core.termLiteral . Core.literalInteger . Core.integerValueUint16++-- | Create a term-encoded 32-bit unsigned integer literal+-- Example: uint32 4294967295+uint32 :: Int64 -> TypedTerm Term+uint32 = uint32Lift . TypedTerm . Terms.uint32++-- | Lift a TypedTerm Int64 to a term-encoded uint32 literal+uint32Lift :: TypedTerm Int64 -> TypedTerm Term+uint32Lift = Core.termLiteral . Core.literalInteger . Core.integerValueUint32++-- | Create a term-encoded 64-bit unsigned integer literal+-- Example: uint64 18446744073709551615+uint64 :: Integer -> TypedTerm Term+uint64 = uint64Lift . TypedTerm . Terms.uint64++-- | Lift a TypedTerm Integer to a term-encoded uint64 literal+-- Example: uint64Lift (varPhantom "x" :: TypedTerm Integer)+uint64Lift :: TypedTerm Integer -> TypedTerm Term+uint64Lift = Core.termLiteral . Core.literalInteger . Core.integerValueUint64++-- | Create a term-encoded 8-bit unsigned integer literal+-- Example: uint8 255+uint8 :: Int16 -> TypedTerm Term+uint8 = uint8Lift . TypedTerm . Terms.uint8++uint8Lift :: TypedTerm Int16 -> TypedTerm Term+uint8Lift = Core.termLiteral . Core.literalInteger . Core.integerValueUint8++-- | Create a term-encoded unit value+-- Example: unit+unit :: TypedTerm Term+unit = Core.termUnit++-- | Create a term-encoded unwrap function for a wrapped type+-- Example: unwrap (name "Email")+unwrap :: AsTerm t Name => t -> TypedTerm Term+unwrap = Core.termUnwrap . asTerm++-- | Create a term-encoded variable reference from a string+-- Example: var "x"+var :: String -> TypedTerm Term+var = Core.termVariable . name++-- | Create a term-encoded variable reference from a Name+-- Example: varName (Name "x")+varName :: Name -> TypedTerm Term+varName (Name n) = Core.termVariable $ TypedTerm $ Terms.string n++-- | Create a phantom-typed variable reference from a Name+-- Example: varNamePhantom (Name "x") :: TypedTerm Int+varNamePhantom :: Name -> TypedTerm a+varNamePhantom = TypedTerm . TermVariable++-- | Maps a string to a phantom-typed variable term+-- Example: varPhantom "x" :: TypedTerm Int+varPhantom :: String -> TypedTerm a+varPhantom = TypedTerm . TermVariable . Name++-- | Create a term-encoded wrapped term (newtype)+-- Example: wrap (name "Email") (string "user@example.com")+wrap :: AsTerm t Name => t -> TypedTerm Term -> TypedTerm Term+wrap n = Core.termWrap . Core.wrappedTerm (asTerm n)
@@ -0,0 +1,626 @@+{-# LANGUAGE FlexibleContexts #-}+{-# LANGUAGE ScopedTypeVariables #-}++-- | Meta-DSL for constructing test-related terms+-- TODO: merge with Hydra.Core.Dsl.Tests++module Hydra.Core.Overlay.Haskell.Dsl.Meta.Testing (+ module Hydra.Core.Dsl.Testing,+ module Hydra.Core.Overlay.Haskell.Dsl.Meta.Testing,+) where++import Hydra.Core.Dsl.Testing hiding (+ effectfulTestCase,+ tag, testCaseEffectful, testCaseUniversal, testCaseWithMetadata,+ testCaseWithMetadataCase, testCaseWithMetadataDescription,+ testCaseWithMetadataName, testCaseWithMetadataProvisions, testCaseWithMetadataTags, testGroup,+ universalTestCase, unTag)+import Hydra.Kernel+import Hydra.Core.Error.Model (InvalidTermError)+import Hydra.Core.Error.Packaging (InvalidModuleError, InvalidPackageError)+import Hydra.Core.Testing as Testing+import Hydra.Core.Overlay.Haskell.Dsl.Phantoms as Phantoms hiding ((++))+import qualified Hydra.Core.Dsl.Lib.Eithers as Eithers+import qualified Hydra.Core.Dsl.Lib.Lists as Lists+import qualified Hydra.Core.Dsl.Lib.Optionals as Optionals+import qualified Hydra.Core.Dsl.Lib.Pairs as Pairs+import qualified Hydra.Core.Dsl.Lib.Strings as Strings+import qualified Hydra.Core.Overlay.Haskell.Dsl.Meta.Terms as MetaTerms+import Hydra.Core.Overlay.Haskell.Dsl.Terms (ToPrimName)+import qualified Hydra.Core.Overlay.Haskell.Dsl.Meta.Types as T+import qualified Data.Set as S+import qualified Hydra.Core.Dsl.Validation as Validation++import qualified Data.Int as I+import qualified Data.List as L+import qualified Data.Map as M++type Int32 = I.Int32+++tag_disabled = Tag "disabled"+tag_disabledForScala = Tag "disabledForScala"+-- | Marks a test case as scale-distinct-sensitive (e.g. "1.10" != "1.1"): it only passes+-- on hosts whose Literal.decimal carries a real scale field. Read by the JSON->target+-- drivers (bootstrap-from-json/Main.hs, TransformJsonToTarget.java) together with the+-- target Language's literalVariants to decide whether to drop the case for that target.+tag_scaleDistinct = Tag "scaleDistinct"++alphaConvertRef :: TypedTerm (Name -> Name -> Term -> Term)+alphaConvertRef = TypedTerm $ TermVariable $ Name "hydra.core.reduction.alphaConvert"++betaReduceTypeRef :: TypedTerm (InferenceContext -> Graph -> Type -> Either Error Type)+betaReduceTypeRef = TypedTerm $ TermVariable $ Name "hydra.core.reduction.betaReduceType"++-- | Refs for hydra.core.validate.packaging validators and their show functions.+checkConflictingModuleNamesRef :: TypedTerm (Package -> Maybe InvalidPackageError)+checkConflictingModuleNamesRef = TypedTerm $ TermVariable $ Name "hydra.core.validate.packaging.checkConflictingModuleNames"++checkConflictingVariantNamesRef :: TypedTerm (Module -> Maybe InvalidModuleError)+checkConflictingVariantNamesRef = TypedTerm $ TermVariable $ Name "hydra.core.validate.packaging.checkConflictingVariantNames"++checkDefinitionDocumentationRef :: TypedTerm (Module -> Maybe InvalidModuleError)+checkDefinitionDocumentationRef = TypedTerm $ TermVariable $ Name "hydra.core.validate.packaging.checkDefinitionDocumentation"++checkDefinitionModuleNamesRef :: TypedTerm (Module -> Maybe InvalidModuleError)+checkDefinitionModuleNamesRef = TypedTerm $ TermVariable $ Name "hydra.core.validate.packaging.checkDefinitionModuleNames"++checkDefinitionNameConventionRef :: TypedTerm (Module -> Maybe InvalidModuleError)+checkDefinitionNameConventionRef = TypedTerm $ TermVariable $ Name "hydra.core.validate.packaging.checkDefinitionNameConvention"++checkDefinitionOrderingRef :: TypedTerm (Module -> Maybe InvalidModuleError)+checkDefinitionOrderingRef = TypedTerm $ TermVariable $ Name "hydra.core.validate.packaging.checkDefinitionOrdering"++checkDuplicateDefinitionNamesRef :: TypedTerm (Module -> Maybe InvalidModuleError)+checkDuplicateDefinitionNamesRef = TypedTerm $ TermVariable $ Name "hydra.core.validate.packaging.checkDuplicateDefinitionNames"++checkDuplicateModuleNamesRef :: TypedTerm (Package -> Maybe InvalidPackageError)+checkDuplicateModuleNamesRef = TypedTerm $ TermVariable $ Name "hydra.core.validate.packaging.checkDuplicateModuleNames"++checkModuleNameConventionRef :: TypedTerm (Module -> Maybe InvalidModuleError)+checkModuleNameConventionRef = TypedTerm $ TermVariable $ Name "hydra.core.validate.packaging.checkModuleNameConvention"++checkModulePartitionRef :: TypedTerm ([(String, [ModuleName])] -> [InvalidPackageError])+checkModulePartitionRef = TypedTerm $ TermVariable $ Name "hydra.core.validate.packaging.checkModulePartition"++checkNestedModuleNamesRef :: TypedTerm (Package -> Maybe InvalidPackageError)+checkNestedModuleNamesRef = TypedTerm $ TermVariable $ Name "hydra.core.validate.packaging.checkNestedModuleNames"++checkPackageNameConventionRef :: TypedTerm (Package -> Maybe InvalidPackageError)+checkPackageNameConventionRef = TypedTerm $ TermVariable $ Name "hydra.core.validate.packaging.checkPackageNameConvention"++checkUndeclaredDependenciesRef :: TypedTerm (M.Map Name ModuleName -> S.Set Name -> Module -> [InvalidPackageError])+checkUndeclaredDependenciesRef = TypedTerm $ TermVariable $ Name "hydra.core.validate.packaging.checkUndeclaredDependencies"++undeclaredDependencyOwnersRef :: TypedTerm ([Module] -> M.Map Name ModuleName)+undeclaredDependencyOwnersRef = TypedTerm $ TermVariable $ Name "hydra.core.validate.packaging.undeclaredDependencyOwners"++-- | Type checking test: infers the type and compares with expected.+checkTest :: String -> [Tag] -> TypedTerm Term -> TypedTerm Term -> TypedTerm Type -> TypedTerm TestCaseWithMetadata+checkTest name tags input _outputTerm outputType = testCaseWithMetadata (Phantoms.string name)+ (testCaseUniversal $ universalTestCase+ (retype $ Eithers.either+ (Phantoms.lambda "e" (Phantoms.string "<<inference error>>"))+ (Phantoms.lambda "result"+ (showTypeRef @@ (typeSchemeToFTypeRef @@ Pairs.second (Pairs.first (Phantoms.var "result")))))+ (inferTypeOfRef @@ testContextRef @@ testGraphRef @@ input))+ (retype $ showTypeRef @@ outputType))+ nothing (Phantoms.list $ tag . unTag <$> tags)+ where+ retype :: TypedTerm x -> TypedTerm String+ retype (TypedTerm t) = TypedTerm t++evalCase :: String -> TypedTerm Term -> TypedTerm Term -> TypedTerm TestCaseWithMetadata+evalCase cname input output = evalCaseWithTags cname [] input output++-- | Create a universal test case that evaluates a Term via reduceTerm and compares the result.+evalCaseWithTags :: String -> [Tag] -> TypedTerm Term -> TypedTerm Term -> TypedTerm TestCaseWithMetadata+evalCaseWithTags cname tags input output = testCaseWithMetadata (Phantoms.string cname)+ (testCaseUniversal $ universalTestCase+ (retype $ Eithers.either+ (Phantoms.lambda "e" (Phantoms.string "<<eval error>>"))+ (Phantoms.lambda "t" (showTermRef @@ Phantoms.var "t"))+ (reduceTermRef @@ testContextRef @@ testGraphRef @@ true @@ input))+ (retype $ showTermRef @@ output))+ nothing (Phantoms.list $ tag . unTag <$> tags)+ where+ retype :: TypedTerm x -> TypedTerm String+ retype (TypedTerm t) = TypedTerm t++-- | Create a universal test case for an expression with a show function+evalPair :: String -> TypedTerm (t -> String) -> TypedTerm t -> TypedTerm t -> TypedTerm TestCaseWithMetadata+evalPair cname showFn logicalActual logicalExpected = universalCase cname+ (retype $ showFn @@ logicalActual) (retype $ showFn @@ logicalExpected)+ where+ retype :: TypedTerm x -> TypedTerm String+ retype (TypedTerm t) = TypedTerm t++-- | evalPair with tags+evalPairWithTags :: String -> [Tag] -> TypedTerm (t -> String) -> TypedTerm t -> TypedTerm t -> TypedTerm TestCaseWithMetadata+evalPairWithTags cname tags showFn logicalActual logicalExpected = testCaseWithMetadata (Phantoms.string cname)+ (testCaseUniversal $ universalTestCase (retype $ showFn @@ logicalActual) (retype $ showFn @@ logicalExpected))+ nothing (Phantoms.list $ tag . unTag <$> tags)+ where+ retype :: TypedTerm x -> TypedTerm String+ retype (TypedTerm t) = TypedTerm t++expectFailure :: AsTerm t Term => Int -> [Tag] -> t -> TypedTerm TestCaseWithMetadata+expectFailure i tags term = infFailureTest ("#" ++ show i) tags (asTerm term)++expectMono :: AsTerm t Term => Int -> [Tag] -> t -> TypedTerm Type -> TypedTerm TestCaseWithMetadata+expectMono i tags term typ = infTest ("#" ++ show i) tags (asTerm term) $ T.mono typ++expectPoly :: AsTerm t Term => Int -> [Tag] -> t -> [String] -> TypedTerm Type -> TypedTerm TestCaseWithMetadata+expectPoly i tags term params typ = infTest ("#" ++ show i) tags (asTerm term) $ T.poly params typ++expectPolyConstrained :: AsTerm t Term => Int -> [Tag] -> t -> [String] -> [(String, [String])] -> TypedTerm Type -> TypedTerm TestCaseWithMetadata+expectPolyConstrained i tags term params constraints typ = infTest ("#" ++ show i) tags (asTerm term) $ T.polyConstrained params constraints typ++groupRef = MetaTerms.varNamePhantom . bindingName++-- | Inference failure test: expects inference to fail.+infFailureTest :: String -> [Tag] -> TypedTerm Term -> TypedTerm TestCaseWithMetadata+infFailureTest name tags term = testCaseWithMetadata (Phantoms.string name)+ (testCaseUniversal $ universalTestCase+ (retype $ Eithers.either+ (Phantoms.lambda "e" (Phantoms.string "FAIL"))+ (Phantoms.lambda "result" (Strings.concat2 (Phantoms.string "unexpected: ")+ (showTypeSchemeRef @@ Pairs.second (Pairs.first (Phantoms.var "result")))))+ (inferTypeOfRef @@ testContextRef @@ testGraphRef @@ term))+ (Phantoms.string "FAIL"))+ nothing (Phantoms.list $ tag . unTag <$> tags)+ where+ retype :: TypedTerm x -> TypedTerm String+ retype (TypedTerm t) = TypedTerm t++-- | Inference test: infer type and compare with expected type scheme.+infTest :: String -> [Tag] -> TypedTerm Term -> TypedTerm TypeScheme -> TypedTerm TestCaseWithMetadata+infTest name tags term ts = testCaseWithMetadata (Phantoms.string name)+ (testCaseUniversal $ universalTestCase+ (retype $ Eithers.either+ (Phantoms.lambda "e" (Strings.concat2 (Phantoms.string "INFERENCE ERROR: ") (Phantoms.string "failed")))+ (Phantoms.lambda "result"+ (showTypeSchemeRef @@ Pairs.second (Pairs.first (Phantoms.var "result"))))+ (inferTypeOfRef @@ testContextRef @@ testGraphRef @@ term))+ (retype $ showTypeSchemeRef @@ ts))+ nothing (Phantoms.list $ tag . unTag <$> tags)+ where+ retype :: TypedTerm x -> TypedTerm String+ retype (TypedTerm t) = TypedTerm t++isDisabled tcase = tag_disabled `L.elem` Testing.testCaseWithMetadataTags tcase++-- | Idempotence test: infer the type of a term twice in succession (infer . infer), and assert that+-- the second pass reproduces the same elaborated term and type as the first. Both passes are already+-- normalized by 'inferTypeOf' (via 'finalizeInferredTerm'), so a plain string comparison of the two+-- (term, type scheme) pairs is sufficient -- no additional alpha-equivalence step is needed.+idempotenceCase :: AsTerm t Term => String -> [Tag] -> t -> TypedTerm TestCaseWithMetadata+idempotenceCase name tags term = testCaseWithMetadata (Phantoms.string name)+ (testCaseUniversal $ universalTestCase (retype secondPassDescription) (retype firstPassDescription))+ nothing (Phantoms.list $ tag . unTag <$> tags)+ where+ retype :: TypedTerm x -> TypedTerm String+ retype (TypedTerm t) = TypedTerm t++ infer1 = inferTypeOfRef @@ testContextRef @@ testGraphRef @@ (asTerm term)++ describeResult = Phantoms.lambda "result" (describeInferenceOutput+ (Pairs.first (Pairs.first (Phantoms.var "result")))+ (Pairs.second (Pairs.first (Phantoms.var "result"))))++ onFailure msg = Phantoms.lambda "e" (Strings.concat2 (Phantoms.string msg) (Phantoms.string "failed"))++ firstPassDescription = Eithers.either (onFailure "INFERENCE ERROR (pass 1): ") describeResult infer1++ secondPassDescription = Eithers.either (onFailure "INFERENCE ERROR (pass 1): ") (Phantoms.lambda "result"+ (Eithers.either (onFailure "INFERENCE ERROR (pass 2): ") describeResult+ (inferTypeOfRef @@ testContextRef @@ testGraphRef @@ Pairs.first (Pairs.first (Phantoms.var "result")))))+ infer1++ describeInferenceOutput :: TypedTerm Term -> TypedTerm TypeScheme -> TypedTerm String+ describeInferenceOutput t ts = Strings.concat $ Phantoms.list [+ showTermRef @@ t,+ Phantoms.string " :: ",+ showTypeSchemeRef @@ ts]++inferTypeOfRef :: TypedTerm (InferenceContext -> Graph -> Term -> Either Error ((Term, TypeScheme), InferenceContext))+inferTypeOfRef = TypedTerm $ TermVariable $ Name "hydra.core.inference.inferTypeOf"++-- | Reference to the kernel-default core validation profile (term + type+-- rules; 'singleVariantUnion' classified as a warning, everything else+-- as an error; maxErrors=1).+kernelDefaultCoreProfileRef :: TypedTerm ValidationProfile+kernelDefaultCoreProfileRef = TypedTerm $ TermVariable $ Name "hydra.core.validate.model.kernelDefaultCoreProfile"++-- | Reference to the kernel-default packaging validation profile (every+-- per-module and per-package check classified as an error; maxErrors=1).+kernelDefaultPackagingProfileRef :: TypedTerm ValidationProfile+kernelDefaultPackagingProfileRef = TypedTerm $ TermVariable $ Name "hydra.core.validate.packaging.kernelDefaultPackagingProfile"++-- | Reference to the kernel-strict 'kernelModule' convenience wrapper+-- (Maybe-returning, applies 'kernelDefaultPackagingProfile' internally).+-- Used by the kernelModule orchestrator tests in+-- 'Sources/Test/Validate/Packaging.hs'.+kernelModuleRef :: TypedTerm (Module -> Maybe InvalidModuleError)+kernelModuleRef = TypedTerm $ TermVariable $ Name "hydra.core.validate.packaging.kernelModule"++-- | Reference to the kernel-strict 'kernelPackage' convenience wrapper.+kernelPackageRef :: TypedTerm (Package -> Maybe InvalidPackageError)+kernelPackageRef = TypedTerm $ TermVariable $ Name "hydra.core.validate.packaging.kernelPackage"++mapTerm :: [(TypedTerm Term, TypedTerm Term)] -> TypedTerm Term+mapTerm pairs = TypedTerm $ TermInject $ Injection _Term $ Field _Term_map $ TermMap $ M.fromList [(unTypedTerm k, unTypedTerm v) | (k, v) <- pairs]++mapTermEmpty :: TypedTerm (M.Map k v)+mapTermEmpty = TypedTerm $ TermMap M.empty++-- | Type checking test where term doesn't change (just check the inferred type)+noChange :: String -> TypedTerm Term -> TypedTerm Type -> TypedTerm TestCaseWithMetadata+noChange name term typ = checkTest name [] term term typ++noTags :: TypedTerm [Tag]+noTags = Phantoms.list ([] :: [TypedTerm Tag])++primCase :: ToPrimName n => String -> n -> [TypedTerm Term] -> TypedTerm Term -> TypedTerm TestCaseWithMetadata+primCase cname prim args output = primCaseWithTags cname [] prim args output++primCaseWithTags :: ToPrimName n => String -> [Tag] -> n -> [TypedTerm Term] -> TypedTerm Term -> TypedTerm TestCaseWithMetadata+primCaseWithTags cname tags prim args output = evalCaseWithTags cname tags input output+ where+ input = L.foldl (MetaTerms.@@) (MetaTerms.primitive prim) args++reduceTermRef :: TypedTerm (InferenceContext -> Graph -> Bool -> Term -> Either Error Term)+reduceTermRef = TypedTerm $ TermVariable $ Name "hydra.core.reduction.reduceTerm"++removeTypesFromTermRef :: TypedTerm (Term -> Term)+removeTypesFromTermRef = TypedTerm $ TermVariable $ Name "hydra.core.strip.removeTypesFromTerm"++showInvalidModuleErrorRef :: TypedTerm (InvalidModuleError -> String)+showInvalidModuleErrorRef = TypedTerm $ TermVariable $ Name "hydra.core.print.error.packaging.invalidModuleError"++showInvalidPackageErrorRef :: TypedTerm (InvalidPackageError -> String)+showInvalidPackageErrorRef = TypedTerm $ TermVariable $ Name "hydra.core.print.error.packaging.invalidPackageError"++showInvalidTermErrorRef :: TypedTerm (InvalidTermError -> String)+showInvalidTermErrorRef = TypedTerm $ TermVariable $ Name "hydra.core.print.error.model.invalidTermError"++showTermRef :: TypedTerm (Term -> String)+showTermRef = TypedTerm $ TermVariable $ Name "hydra.core.print.model.term"++showTypeRef :: TypedTerm (Type -> String)+showTypeRef = TypedTerm $ TermVariable $ Name "hydra.core.print.model.type"++showTypeSchemeRef :: TypedTerm (TypeScheme -> String)+showTypeSchemeRef = TypedTerm $ TermVariable $ Name "hydra.core.print.model.typeScheme"++-- | evalPair for String-typed expressions (identity show)+stringEvalPair :: String -> TypedTerm String -> TypedTerm String -> TypedTerm TestCaseWithMetadata+stringEvalPair cname = evalPair cname (Phantoms.lambda "s" (Phantoms.var "s"))++subgroup :: AsTerm t TestCaseWithMetadata => String -> [t] -> TypedTerm TestGroup+subgroup name match = tgroup name Nothing [] (asTerm <$> match)++supergroup :: AsTerm t TestGroup => String -> [t] -> TypedTerm TestGroup+supergroup name subgroups = tgroup name Nothing (asTerm <$> subgroups) []++tag :: String -> TypedTerm Tag+tag = Phantoms.wrap _Tag . Phantoms.string++testContextRef :: TypedTerm InferenceContext+testContextRef = TypedTerm $ TermVariable $ Name "hydra.core.test.testGraph.testContext"++-- | References to kernel functions (avoids circular imports)+testGraphRef :: TypedTerm Graph+testGraphRef = TypedTerm $ TermVariable $ Name "hydra.core.test.testGraph.testGraph"++tgroup :: String -> Maybe String -> [TypedTerm TestGroup] -> [TypedTerm TestCaseWithMetadata] -> TypedTerm TestGroup+tgroup name mdesc subgroups match = testGroup (Phantoms.string name) (opt (Phantoms.string <$> mdesc)) (Phantoms.list subgroups) (Phantoms.list match)++typeSchemeToFTypeRef :: TypedTerm (TypeScheme -> Type)+typeSchemeToFTypeRef = TypedTerm $ TermVariable $ Name "hydra.core.scoping.typeSchemeToFType"++universalCase :: String -> TypedTerm a -> TypedTerm b -> TypedTerm TestCaseWithMetadata+universalCase cname actual expected = universalCaseWithTags cname [] actual expected++universalCaseWithTags :: String -> [Tag] -> TypedTerm a -> TypedTerm b -> TypedTerm TestCaseWithMetadata+universalCaseWithTags cname tags actual expected = testCaseWithMetadata (Phantoms.string cname)+ (testCaseUniversal $ universalTestCase (retype actual) (retype expected))+ nothing (Phantoms.list $ tag . unTag <$> tags)+ where+ retype :: TypedTerm x -> TypedTerm String+ retype (TypedTerm t) = TypedTerm t++-- | Create an effectful test case: 'actual' is an effect<string>-typed term that the test runner+-- interprets (within a per-case empty temporary directory) to a result string; 'expected' is a+-- string-typed term. As with universalCase, both are passed bare and codegen wraps them as the+-- unit-thunk fields of EffectfulTestCase.+effectfulCase :: String -> TypedTerm a -> TypedTerm b -> TypedTerm TestCaseWithMetadata+effectfulCase cname actual expected = effectfulCaseWithTags cname [] actual expected++effectfulCaseWithTags :: String -> [Tag] -> TypedTerm a -> TypedTerm b -> TypedTerm TestCaseWithMetadata+effectfulCaseWithTags cname tags actual expected = testCaseWithMetadata (Phantoms.string cname)+ (testCaseEffectful $ effectfulTestCase (retype actual) (retype expected))+ nothing (Phantoms.list $ tag . unTag <$> tags)+ where+ retype :: TypedTerm x -> TypedTerm String+ retype (TypedTerm t) = TypedTerm t++-- | Reference to the profile-aware core term validator. Used by+-- 'validateCoreTermCase' (with 'kernelDefaultCoreProfileRef'-applied,+-- head-extracted to preserve the legacy 'Maybe E' shape) and by+-- 'validateCoreTermCaseWithProfile' (with an explicit profile).+validateCoreTermProfiledRef :: TypedTerm (ValidationProfile -> Bool -> Graph -> Term -> ValidationResult InvalidTermError)+validateCoreTermProfiledRef = TypedTerm $ TermVariable $ Name "hydra.core.validate.model.term"++-- | Reference to the profile-aware packaging module validator. Used by+-- 'validatePackagingModuleCaseWithProfile' directly.+validatePackagingModuleProfiledRef :: TypedTerm (ValidationProfile -> ValidationResult InvalidModuleError -> Module -> ValidationResult InvalidModuleError)+validatePackagingModuleProfiledRef = TypedTerm $ TermVariable $ Name "hydra.core.validate.packaging.module"++-- | Reference to the profile-aware packaging package validator. Returns a+-- 'ValidationResult InvalidPackageError'; used by+-- 'validatePackagingPackageCaseWithProfile'.+validatePackagingPackageProfiledRef :: TypedTerm (ValidationProfile -> ValidationResult InvalidPackageError -> Package -> ValidationResult InvalidPackageError)+validatePackagingPackageProfiledRef = TypedTerm $ TermVariable $ Name "hydra.core.validate.packaging.package"++----------------------------------------++-- | Convenience function for creating alpha conversion test cases+alphaCase :: String -> TypedTerm Term -> TypedTerm Name -> TypedTerm Name -> TypedTerm Term -> TypedTerm TestCaseWithMetadata+alphaCase cname term oldVar newVar result = universalCase cname+ (retype $ showTermRef @@ (alphaConvertRef @@ oldVar @@ newVar @@ term))+ (retype $ showTermRef @@ result)+ where+ retype :: TypedTerm x -> TypedTerm String+ retype (TypedTerm t) = TypedTerm t++encodedTestGroupToBinding :: ModuleName -> String -> TypedTerm TestGroup -> Binding+encodedTestGroupToBinding ns lname group = Binding name (unTypedTerm group)+ $ Just $ TypeScheme [] typ M.empty+ where+ name = unqualifyName $ QualifiedName (Just ns) lname+ typ = TypeVariable _TestGroup++-- | Render a 'ValidationResult InvalidModuleError' as a string of the form+-- "errors=[s1;s2] warnings=[w1]". Counterpart of 'showValidationResultTerm'+-- for module-level findings.+showValidationResultModule :: TypedTerm (ValidationResult InvalidModuleError) -> TypedTerm String+showValidationResultModule vr = retype $+ Strings.concat2+ (Strings.concat2 (Phantoms.string "errors=[") $+ Strings.concat2 (Strings.join (Phantoms.string ";") $+ Lists.map (Phantoms.lambda "e" $ showInvalidModuleErrorRef @@ Phantoms.var "e")+ (Validation.validationResultErrors vr))+ (Phantoms.string "]"))+ (Strings.concat2 (Phantoms.string " warnings=[") $+ Strings.concat2 (Strings.join (Phantoms.string ";") $+ Lists.map (Phantoms.lambda "w" $ showInvalidModuleErrorRef @@ Phantoms.var "w")+ (Validation.validationResultWarnings vr))+ (Phantoms.string "]"))+ where+ retype :: TypedTerm x -> TypedTerm String+ retype (TypedTerm t) = TypedTerm t++-- | Render a 'ValidationResult InvalidPackageError' as a string. Package-level+-- counterpart of 'showValidationResultTerm'.+showValidationResultPackage :: TypedTerm (ValidationResult InvalidPackageError) -> TypedTerm String+showValidationResultPackage vr = retype $+ Strings.concat2+ (Strings.concat2 (Phantoms.string "errors=[") $+ Strings.concat2 (Strings.join (Phantoms.string ";") $+ Lists.map (Phantoms.lambda "e" $ showInvalidPackageErrorRef @@ Phantoms.var "e")+ (Validation.validationResultErrors vr))+ (Phantoms.string "]"))+ (Strings.concat2 (Phantoms.string " warnings=[") $+ Strings.concat2 (Strings.join (Phantoms.string ";") $+ Lists.map (Phantoms.lambda "w" $ showInvalidPackageErrorRef @@ Phantoms.var "w")+ (Validation.validationResultWarnings vr))+ (Phantoms.string "]"))+ where+ retype :: TypedTerm x -> TypedTerm String+ retype (TypedTerm t) = TypedTerm t++-- | Profile-aware variant of 'validatePackagingModuleCase'. Calls+-- 'hydra.core.validate.packaging.module'' (the new orchestrator) starting from+-- an empty 'ValidationResult' and compares the full result shape against+-- the expected.+validatePackagingModuleCaseWithProfile+ :: String+ -> TypedTerm ValidationProfile+ -> TypedTerm Module+ -> TypedTerm (ValidationResult InvalidModuleError)+ -> TypedTerm TestCaseWithMetadata+validatePackagingModuleCaseWithProfile cname profile input expected = universalCase cname+ (showValidationResultModule+ (validatePackagingModuleProfiledRef @@ profile @@ emptyResultModule @@ input))+ (showValidationResultModule expected)+ where+ emptyResultModule :: TypedTerm (ValidationResult InvalidModuleError)+ emptyResultModule = Validation.validationResult+ (Phantoms.list ([] :: [TypedTerm InvalidModuleError]))+ (Phantoms.list ([] :: [TypedTerm InvalidModuleError]))++-- | Profile-aware variant of 'validatePackagingPackageCase'.+validatePackagingPackageCaseWithProfile+ :: String+ -> TypedTerm ValidationProfile+ -> TypedTerm Package+ -> TypedTerm (ValidationResult InvalidPackageError)+ -> TypedTerm TestCaseWithMetadata+validatePackagingPackageCaseWithProfile cname profile input expected = universalCase cname+ (showValidationResultPackage+ (validatePackagingPackageProfiledRef @@ profile @@ emptyResultPackage @@ input))+ (showValidationResultPackage expected)+ where+ emptyResultPackage :: TypedTerm (ValidationResult InvalidPackageError)+ emptyResultPackage = Validation.validationResult+ (Phantoms.list ([] :: [TypedTerm InvalidPackageError]))+ (Phantoms.list ([] :: [TypedTerm InvalidPackageError]))++-- | Render a 'ValidationResult InvalidTermError' as a string of the form+-- "errors=[s1;s2] warnings=[w1]". Used to compare actual vs expected+-- 'ValidationResult' values in profile-aware test cases.+showValidationResultTerm :: TypedTerm (ValidationResult InvalidTermError) -> TypedTerm String+showValidationResultTerm vr = retype $+ Strings.concat2+ (Strings.concat2 (Phantoms.string "errors=[") $+ Strings.concat2 (Strings.join (Phantoms.string ";") $+ Lists.map (Phantoms.lambda "e" $ showInvalidTermErrorRef @@ Phantoms.var "e")+ (Validation.validationResultErrors vr))+ (Phantoms.string "]"))+ (Strings.concat2 (Phantoms.string " warnings=[") $+ Strings.concat2 (Strings.join (Phantoms.string ";") $+ Lists.map (Phantoms.lambda "w" $ showInvalidTermErrorRef @@ Phantoms.var "w")+ (Validation.validationResultWarnings vr))+ (Phantoms.string "]"))+ where+ retype :: TypedTerm x -> TypedTerm String+ retype (TypedTerm t) = TypedTerm t++-- | Profile-aware variant of 'validateCoreTermCase'. Compares the full+-- 'ValidationResult' shape — both errors and warnings — against the+-- expected, allowing the caller to specify any profile (not just the+-- kernel default). Use for tests that exercise multi-error+-- accumulation, warning vs error classification, or rule disabling.+validateCoreTermCaseWithProfile+ :: String+ -> TypedTerm ValidationProfile+ -> TypedTerm Bool+ -> TypedTerm Term+ -> TypedTerm (ValidationResult InvalidTermError)+ -> TypedTerm TestCaseWithMetadata+validateCoreTermCaseWithProfile cname profile typed input expected = universalCase cname+ (showValidationResultTerm+ (validateCoreTermProfiledRef @@ profile @@ typed @@ testGraphRef @@ input))+ (showValidationResultTerm expected)++testCaseEffectful :: TypedTerm EffectfulTestCase -> TypedTerm TestCase+testCaseEffectful = inject _TestCase _TestCase_effectful++testCaseUniversal :: TypedTerm UniversalTestCase -> TypedTerm TestCase+testCaseUniversal = inject _TestCase _TestCase_universal++testCaseWithMetadata :: TypedTerm String -> TypedTerm TestCase -> TypedTerm (Maybe String) -> TypedTerm [Tag] -> TypedTerm TestCaseWithMetadata+testCaseWithMetadata name tcase description tags = testCaseWithMetadataAndProvisions name tcase description tags (list ([] :: [TypedTerm Name]))++testCaseWithMetadataAndProvisions :: TypedTerm String -> TypedTerm TestCase -> TypedTerm (Maybe String) -> TypedTerm [Tag] -> TypedTerm [Name] -> TypedTerm TestCaseWithMetadata+testCaseWithMetadataAndProvisions name tcase description tags provisions = Phantoms.record _TestCaseWithMetadata [+ _TestCaseWithMetadata_name>>: name,+ _TestCaseWithMetadata_case>>: tcase,+ _TestCaseWithMetadata_description>>: description,+ _TestCaseWithMetadata_tags>>: tags,+ _TestCaseWithMetadata_provisions>>: provisions]++testCaseWithMetadataCase :: TypedTerm (TestCaseWithMetadata -> TestCase)+testCaseWithMetadataCase = Phantoms.project _TestCaseWithMetadata _TestCaseWithMetadata_case++testCaseWithMetadataDescription :: TypedTerm (TestCaseWithMetadata -> Maybe String)+testCaseWithMetadataDescription = Phantoms.project _TestCaseWithMetadata _TestCaseWithMetadata_description++testCaseWithMetadataName :: TypedTerm (TestCaseWithMetadata -> String)+testCaseWithMetadataName = Phantoms.project _TestCaseWithMetadata _TestCaseWithMetadata_name++testCaseWithMetadataProvisions :: TypedTerm (TestCaseWithMetadata -> [Name])+testCaseWithMetadataProvisions = Phantoms.project _TestCaseWithMetadata _TestCaseWithMetadata_provisions++testCaseWithMetadataTags :: TypedTerm (TestCaseWithMetadata -> [Tag])+testCaseWithMetadataTags = Phantoms.project _TestCaseWithMetadata _TestCaseWithMetadata_tags++testGroup :: TypedTerm String -> TypedTerm (Maybe String) -> TypedTerm [TestGroup] -> TypedTerm [TestCaseWithMetadata] -> TypedTerm TestGroup+testGroup name description subgroups match = Phantoms.record _TestGroup [+ _TestGroup_name>>: name,+ _TestGroup_description>>: description,+ _TestGroup_subgroups>>: subgroups,+ _TestGroup_cases>>: match]++-- | Convenience function for creating type reduction test cases+typeRedCase :: String -> TypedTerm Type -> TypedTerm Type -> TypedTerm TestCaseWithMetadata+typeRedCase cname input output = universalCase cname+ (retype $ Eithers.either+ (Phantoms.lambda "e" (Phantoms.string "<<type reduction error>>"))+ (Phantoms.lambda "t" (showTypeRef @@ Phantoms.var "t"))+ (betaReduceTypeRef @@ testContextRef @@ testGraphRef @@ input))+ (retype $ showTypeRef @@ output)+ where+ retype :: TypedTerm x -> TypedTerm String+ retype (TypedTerm t) = TypedTerm t++-- | Build a 'UniversalTestCase' from two string-producing expressions.+-- Each expression is wrapped in a unit-lambda so its evaluation is deferred+-- until the runner forces the thunk inside its per-test timing bracket. See+-- issue #311: without thunking, eagerly-evaluated hosts (Scala, the four+-- complete Lisps) compute 'actual'/'expected' at test-data load time, before+-- any timer starts, and report zero elapsed time.+universalTestCase :: TypedTerm String -> TypedTerm String -> TypedTerm UniversalTestCase+universalTestCase actual expected = Phantoms.record _UniversalTestCase [+ _UniversalTestCase_actual Phantoms.>>: thunk actual,+ _UniversalTestCase_expected Phantoms.>>: thunk expected]+ where+ thunk :: TypedTerm String -> TypedTerm (() -> String)+ thunk body = Phantoms.lambda "_" body++-- | Build an EffectfulTestCase from a bare effect<string> term (the action) and a bare string term+-- (the expected value); both are wrapped as unit-thunk fields, mirroring universalTestCase.+effectfulTestCase :: TypedTerm String -> TypedTerm String -> TypedTerm EffectfulTestCase+effectfulTestCase actual expected = Phantoms.record _EffectfulTestCase [+ _EffectfulTestCase_actual Phantoms.>>: thunk actual,+ _EffectfulTestCase_expected Phantoms.>>: thunk expected]+ where+ thunk :: TypedTerm String -> TypedTerm (() -> String)+ thunk body = Phantoms.lambda "_" body++-- | Convenience function for creating validation test cases. Drives the+-- profile-aware 'hydra.core.validate.model.term' with the kernel-default core+-- profile and head-extracts the resulting errors list — preserving the+-- legacy 'Maybe InvalidTermError' shape that existing test data uses.+-- Tests that need to assert multi-error accumulation, warning+-- classification, or rule disabling should use+-- 'validateCoreTermCaseWithProfile' instead.+validateCoreTermCase :: String -> TypedTerm Bool -> TypedTerm Term -> TypedTerm (Maybe InvalidTermError) -> TypedTerm TestCaseWithMetadata+validateCoreTermCase cname typed input expected = universalCase cname+ (retype $ Optionals.match+ (Lists.head $ Validation.validationResultErrors $+ validateCoreTermProfiledRef @@ kernelDefaultCoreProfileRef @@ typed @@ testGraphRef @@ input)+ (Phantoms.string "valid")+ (Phantoms.lambda "e" (showInvalidTermErrorRef @@ Phantoms.var "e")))+ (retype $ Optionals.match+ expected+ (Phantoms.string "valid")+ (Phantoms.lambda "e" (showInvalidTermErrorRef @@ Phantoms.var "e")))+ where+ retype :: TypedTerm x -> TypedTerm String+ retype (TypedTerm t) = TypedTerm t++-- | Convenience function for creating module-validation test cases.+-- Applies a packaging-level Module validator to an input module and compares+-- the result against the expected Maybe InvalidModuleError.+validatePackagingModuleCase :: String -> TypedTerm (Module -> Maybe InvalidModuleError) -> TypedTerm Module -> TypedTerm (Maybe InvalidModuleError) -> TypedTerm TestCaseWithMetadata+validatePackagingModuleCase cname validator input expected = universalCase cname+ (retype $ Optionals.match+ (validator @@ input)+ (Phantoms.string "valid")+ (Phantoms.lambda "e" (showInvalidModuleErrorRef @@ Phantoms.var "e")))+ (retype $ Optionals.match+ expected+ (Phantoms.string "valid")+ (Phantoms.lambda "e" (showInvalidModuleErrorRef @@ Phantoms.var "e")))+ where+ retype :: TypedTerm x -> TypedTerm String+ retype (TypedTerm t) = TypedTerm t++-- | Convenience function for creating package-validation test cases.+-- Applies a packaging-level Package validator to an input package and compares+-- the result against the expected Maybe InvalidPackageError.+validatePackagingPackageCase :: String -> TypedTerm (Package -> Maybe InvalidPackageError) -> TypedTerm Package -> TypedTerm (Maybe InvalidPackageError) -> TypedTerm TestCaseWithMetadata+validatePackagingPackageCase cname validator input expected = universalCase cname+ (retype $ Optionals.match+ (validator @@ input)+ (Phantoms.string "valid")+ (Phantoms.lambda "e" (showInvalidPackageErrorRef @@ Phantoms.var "e")))+ (retype $ Optionals.match+ expected+ (Phantoms.string "valid")+ (Phantoms.lambda "e" (showInvalidPackageErrorRef @@ Phantoms.var "e")))+ where+ retype :: TypedTerm x -> TypedTerm String+ retype (TypedTerm t) = TypedTerm t
@@ -0,0 +1,299 @@+-- | A domain-specific language for constructing term-encoded Hydra types in Haskell;+-- these functions enable you to build terms (programs) which build types.++{-# LANGUAGE FlexibleContexts #-}+{-# LANGUAGE ScopedTypeVariables #-}++module Hydra.Core.Overlay.Haskell.Dsl.Meta.Types (+ module Hydra.Core.Overlay.Haskell.Dsl.Base,+ module Hydra.Core.Overlay.Haskell.Dsl.Meta.Types,+) where++import Hydra.Kernel+import Hydra.Core.Overlay.Haskell.AsTerm+import qualified Hydra.Core.Overlay.Haskell.Dsl.Phantoms as Phantoms+import qualified Hydra.Core.Dsl.Lib.Maps as Maps+import Hydra.Core.Overlay.Haskell.Dsl.Meta.Core as Core hiding (name, unName)+import Hydra.Core.Overlay.Haskell.Dsl.Base++import qualified Data.List as L+import qualified Data.Map as M+import qualified Data.Maybe as Y+import qualified Data.Set as S+import Prelude hiding (either, map, maybe, product, sum)+++-- Operators++-- | Type application operator+-- Example: typeConstructor @@ typeArg+(@@) :: TypedTerm Type -> TypedTerm Type -> TypedTerm Type+(@@) = apply++-- | Function type constructor operator+-- Example: int32 --> string+(-->) :: TypedTerm Type -> TypedTerm Type -> TypedTerm Type+(-->) = function+++-- | Attach an annotation map to a term-encoded type, wrapping the map as a+-- TermMap annotation per Hydra's convention (#386). Each Name key is lifted+-- to a TermVariable.+-- Example: annot annotationMap myType+annot :: TypedTerm (M.Map Name Term) -> TypedTerm Type -> TypedTerm Type+annot ann typ = typeAnnotated $ annotatedType typ+ (Core.termMap (Maps.mapKeys (Phantoms.lambda "n" (Core.termVariable (Phantoms.var "n"))) ann))++-- | Apply a term-encoded type to a type argument+-- Example: apply (var "Maybe") int32+apply :: TypedTerm Type -> TypedTerm Type -> TypedTerm Type+apply l r = typeApplication $ applicationType l r++applys :: TypedTerm Type -> [TypedTerm Type] -> TypedTerm Type+applys t ts = L.foldl apply t ts++-- | Create a term-encoded arbitrary-precision integer type+-- Example: bigint+bigint :: TypedTerm Type+bigint = typeLiteral $ literalTypeInteger integerTypeBigint++-- | Create a term-encoded binary type+-- Example: binary+binary :: TypedTerm Type+binary = typeLiteral literalTypeBinary++-- | Create a term-encoded boolean type+-- Example: boolean+boolean :: TypedTerm Type+boolean = typeLiteral literalTypeBoolean++-- | Create a term-encoded arbitrary-precision decimal type+-- Example: decimal+decimal :: TypedTerm Type+decimal = typeLiteral literalTypeDecimal++-- | Create a term-encoded either type+-- Example: either_ string int32+either_ :: TypedTerm Type -> TypedTerm Type -> TypedTerm Type+either_ l r = typeEither $ eitherType l r++-- | Create a term-encoded enum type with the given variant names (conventionally in camelCase)+-- Example: enum (name "Color") ["red", "green", "blue"]+-- Accepts TypedTerm Name or TypedBinding Name (via AsTerm)+enum :: AsTerm t Name => t -> [String] -> TypedTerm Type+enum tname names = union tname $ (\n -> (name n, unit)) <$> names++-- | Create a term-encoded field with the given name and type+-- Example: field "age" int32+field :: String -> TypedTerm Type -> TypedTerm FieldType+field s = fieldType (name s)++-- | Create a term-encoded FloatType representation+-- Example: float FloatTypeFloat64+float :: FloatType -> TypedTerm FloatType+float t = Phantoms.injectUnit _FloatType $ case t of+ FloatTypeFloat32 -> _FloatType_float32+ FloatTypeFloat64 -> _FloatType_float64++-- | Create a term-encoded 32-bit floating point type+-- Example: float32+float32 :: TypedTerm Type+float32 = typeLiteral $ literalTypeFloat $ float FloatTypeFloat32++-- | Create a term-encoded 64-bit floating point type+-- Example: float64+float64 :: TypedTerm Type+float64 = typeLiteral $ literalTypeFloat $ float FloatTypeFloat64++-- | Create a term-encoded universal quantification (polymorphic type)+-- Example: forAll "a" (var "a" --> var "a")+forAll :: String -> TypedTerm Type -> TypedTerm Type+forAll var body = typeForall $ forallType (name var) body++forAlls :: [String] -> TypedTerm Type -> TypedTerm Type+forAlls vs body = L.foldr forAll body vs++-- | Create a term-encoded function type+-- Example: function int32 string+function :: TypedTerm Type -> TypedTerm Type -> TypedTerm Type+function dom cod = typeFunction $ functionType dom cod++-- | Create a term-encoded multi-parameter function type+-- Example: functionMany [int32, string, boolean]+functionMany :: [TypedTerm Type] -> TypedTerm Type+functionMany types = case types of+ [t] -> t+ t:ts -> function t $ functionMany ts++-- | Create a term-encoded 16-bit signed integer type+-- Example: int16+int16 :: TypedTerm Type+int16 = typeLiteral $ literalTypeInteger integerTypeInt16++-- | Create a term-encoded 32-bit signed integer type+-- Example: int32+int32 :: TypedTerm Type+int32 = typeLiteral $ literalTypeInteger integerTypeInt32++-- | Create a term-encoded 64-bit signed integer type+-- Example: int64+int64 :: TypedTerm Type+int64 = typeLiteral $ literalTypeInteger integerTypeInt64++-- | Create a term-encoded 8-bit signed integer type+-- Example: int8+int8 :: TypedTerm Type+int8 = typeLiteral $ literalTypeInteger integerTypeInt8++-- | Create a term-encoded IntegerType representation+-- Example: integer IntegerTypeInt32+integer :: IntegerType -> TypedTerm IntegerType+integer t = Phantoms.injectUnit _IntegerType $ case t of+ IntegerTypeBigint -> _IntegerType_bigint+ IntegerTypeInt8 -> _IntegerType_int8+ IntegerTypeInt16 -> _IntegerType_int16+ IntegerTypeInt32 -> _IntegerType_int32+ IntegerTypeInt64 -> _IntegerType_int64+ IntegerTypeUint8 -> _IntegerType_uint8+ IntegerTypeUint16 -> _IntegerType_uint16+ IntegerTypeUint32 -> _IntegerType_uint32+ IntegerTypeUint64 -> _IntegerType_uint64++-- | Create a term-encoded list type+-- Example: list string+list :: TypedTerm Type -> TypedTerm Type+list = typeList++-- | Create a term-encoded literal type from a LiteralType value+-- Example: literal (literalTypeInteger integerTypeInt32)+literal :: TypedTerm LiteralType -> TypedTerm Type+literal = typeLiteral++-- | Create a term-encoded map/dictionary type+-- Example: map string int32+map :: TypedTerm Type -> TypedTerm Type -> TypedTerm Type+map k v = typeMap $ mapType k v++-- | Create a term-encoded monomorphic type scheme+-- Example: mono int32+mono :: TypedTerm Type -> TypedTerm TypeScheme+mono t = Phantoms.record _TypeScheme [+ Phantoms.field _TypeScheme_variables $ Phantoms.list ([] :: [TypedTerm Name]),+ Phantoms.field _TypeScheme_body t,+ Phantoms.field _TypeScheme_constraints (Phantoms.map M.empty)]++-- | Term-encoded non-negative 32-bit integer type+-- Currently an alias for int32; intended for semantic annotation+-- In future versions, this may include validation constraints+-- Example: nonNegativeInt32+nonNegativeInt32 :: TypedTerm Type+nonNegativeInt32 = Hydra.Core.Overlay.Haskell.Dsl.Meta.Types.int32++-- | Create a term-encoded optional (nullable) type+-- Example: optional string+optional :: TypedTerm Type -> TypedTerm Type+optional = typeOptional++-- | Create a term-encoded pair type+-- Example: pair string int32+pair :: TypedTerm Type -> TypedTerm Type -> TypedTerm Type+pair first second = Core.typePair $ Core.pairType first second++-- | Create a term-encoded polymorphic type scheme+-- Example: poly ["a", "b"] (var "a" --> var "b")+poly :: [String] -> TypedTerm Type -> TypedTerm TypeScheme+poly params t = Phantoms.record _TypeScheme [+ Phantoms.field _TypeScheme_variables (Phantoms.list (name <$> params)),+ Phantoms.field _TypeScheme_body t,+ Phantoms.field _TypeScheme_constraints (Phantoms.map M.empty)]++-- | Create a term-encoded polymorphic type scheme with class constraints+-- Example: polyConstrained ["k", "v"] [("k", ["ordering"])] (map (var "k") (var "v"))+polyConstrained :: [String] -> [(String, [String])] -> TypedTerm Type -> TypedTerm TypeScheme+polyConstrained params constraints t = Phantoms.record _TypeScheme [+ Phantoms.field _TypeScheme_variables (Phantoms.list (name <$> params)),+ Phantoms.field _TypeScheme_body t,+ Phantoms.field _TypeScheme_constraints constraintsTerm]+ where+ constraintsTerm = Phantoms.map $ M.fromList+ [(name v, Core.typeVariableConstraints (Phantoms.set (Core.typeClassConstraintSimple . name <$> classes)))+ | (v, classes) <- constraints]++-- | Create a term-encoded product type (tuple) with multiple components using nested pairs+-- Example: product [string, int32, boolean]+product :: [TypedTerm Type] -> TypedTerm Type+product [] = unit+product [a] = a+product [a, b] = pair a b+product (a:rest) = pair a (product rest)++-- | Create a term-encoded record type with named fields+-- Example: record (name "Person") ["name">: string, "age">: int32]+-- Note: the name parameter is now ignored; record types no longer carry a type name+record :: AsTerm t Name => t -> [(TypedTerm Name, TypedTerm Type)] -> TypedTerm Type+record _n pairs = typeRecord $ Phantoms.list (toField <$> pairs)+ where+ toField (fn, t) = fieldType fn t++-- | Create a term-encoded set type+-- Example: set string+set :: TypedTerm Type -> TypedTerm Type+set = typeSet++-- | Create a term-encoded string type+-- Example: string+string :: TypedTerm Type+string = typeLiteral literalTypeString++-- | Create a term-encoded 16-bit unsigned integer type+-- Example: uint16+uint16 :: TypedTerm Type+uint16 = typeLiteral $ literalTypeInteger integerTypeUint16++-- | Create a term-encoded 32-bit unsigned integer type+-- Example: uint32+uint32 :: TypedTerm Type+uint32 = typeLiteral $ literalTypeInteger integerTypeUint32++-- | Create a term-encoded 64-bit unsigned integer type+-- Example: uint64+uint64 :: TypedTerm Type+uint64 = typeLiteral $ literalTypeInteger integerTypeUint64++-- | Create a term-encoded 8-bit unsigned integer type+-- Example: uint8+uint8 :: TypedTerm Type+uint8 = typeLiteral $ literalTypeInteger integerTypeUint8++-- | Create a term-encoded union type with named variants+-- Example: union (name "Result") ["success">: int32, "error">: string]+-- Note: the name parameter is now ignored; union types no longer carry a type name+union :: AsTerm t Name => t -> [(TypedTerm Name, TypedTerm Type)] -> TypedTerm Type+union _n pairs = typeUnion $ Phantoms.list (toField <$> pairs)+ where+ toField (fn, ft) = fieldType fn ft++-- | Term-encoded unit type (empty record type)+-- Example: unit+unit :: TypedTerm Type+unit = typeUnit++-- | Create a term-encoded type variable (alias for 'variable')+-- Example: var "a"+var :: String -> TypedTerm Type+var = variable++-- | Create a term-encoded type variable+-- Example: variable "a"+variable :: String -> TypedTerm Type+variable = typeVariable . name++-- | Term-encoded void type (uninhabited / bottom type)+-- Example: void+void :: TypedTerm Type+void = typeVoid++-- | Create a term-encoded wrapped type (newtype)+-- Note: the name parameter is now ignored; wrapped types no longer carry a type name+wrap :: AsTerm t Name => t -> TypedTerm Type -> TypedTerm Type+wrap _n t = typeWrap t
@@ -0,0 +1,68 @@+-- | Haskell-specific convenience layer over the generated Hydra.Core.Dsl.Variants module.+-- Adds Haskell enum -> TypedTerm converter functions.++module Hydra.Core.Overlay.Haskell.Dsl.Meta.Variants (+ module Hydra.Core.Dsl.Variants,+ module Hydra.Core.Overlay.Haskell.Dsl.Meta.Variants,+) where++import Hydra.Kernel+import Hydra.Core.Overlay.Haskell.Dsl.Phantoms+import Hydra.Core.Dsl.Variants+++-- | Convert a Haskell LiteralVariant to a TypedTerm+literalVariant :: LiteralVariant -> TypedTerm LiteralVariant+literalVariant v = injectUnit _LiteralVariant $ case v of+ LiteralVariantBinary -> _LiteralVariant_binary+ LiteralVariantBoolean -> _LiteralVariant_boolean+ LiteralVariantDecimal -> _LiteralVariant_decimal+ LiteralVariantFloat -> _LiteralVariant_float+ LiteralVariantInteger -> _LiteralVariant_integer+ LiteralVariantString -> _LiteralVariant_string++-- | Convert a Haskell TermVariant to a TypedTerm+termVariant :: TermVariant -> TypedTerm TermVariant+termVariant v = injectUnit _TermVariant $ case v of+ TermVariantAnnotated -> _TermVariant_annotated+ TermVariantApplication -> _TermVariant_application+ TermVariantCases -> _TermVariant_cases+ TermVariantEither -> _TermVariant_either+ TermVariantLambda -> _TermVariant_lambda+ TermVariantLet -> _TermVariant_let+ TermVariantList -> _TermVariant_list+ TermVariantLiteral -> _TermVariant_literal+ TermVariantMap -> _TermVariant_map+ TermVariantOptional -> _TermVariant_optional+ TermVariantPair -> _TermVariant_pair+ TermVariantProject -> _TermVariant_project+ TermVariantRecord -> _TermVariant_record+ TermVariantSet -> _TermVariant_set+ TermVariantTypeLambda -> _TermVariant_typeLambda+ TermVariantTypeApplication -> _TermVariant_typeApplication+ TermVariantInject -> _TermVariant_inject+ TermVariantUnit -> _TermVariant_unit+ TermVariantUnwrap -> _TermVariant_unwrap+ TermVariantVariable -> _TermVariant_variable+ TermVariantWrap -> _TermVariant_wrap++-- | Convert a Haskell TypeVariant to a TypedTerm+typeVariant :: TypeVariant -> TypedTerm TypeVariant+typeVariant v = injectUnit _TypeVariant $ case v of+ TypeVariantAnnotated -> _TypeVariant_annotated+ TypeVariantApplication -> _TypeVariant_application+ TypeVariantEither -> _TypeVariant_either+ TypeVariantFunction -> _TypeVariant_function+ TypeVariantForall -> _TypeVariant_forall+ TypeVariantList -> _TypeVariant_list+ TypeVariantLiteral -> _TypeVariant_literal+ TypeVariantMap -> _TypeVariant_map+ TypeVariantOptional -> _TypeVariant_optional+ TypeVariantPair -> _TypeVariant_pair+ TypeVariantRecord -> _TypeVariant_record+ TypeVariantSet -> _TypeVariant_set+ TypeVariantUnion -> _TypeVariant_union+ TypeVariantUnit -> _TypeVariant_unit+ TypeVariantVariable -> _TypeVariant_variable+ TypeVariantVoid -> _TypeVariant_void+ TypeVariantWrap -> _TypeVariant_wrap
@@ -0,0 +1,564 @@+{-# LANGUAGE FlexibleContexts #-}++-- | Term-level DSL which makes use of phantom types. Use this DSL for defining programs as opposed to data type definitions.+-- The phantom types provide static type checking in Haskell prior to Hydra's runtime type checking.+module Hydra.Core.Overlay.Haskell.Dsl.Phantoms (+ module Hydra.Core.Overlay.Haskell.Dsl.Phantoms,+ module Hydra.Core.Overlay.Haskell.Dsl.Meta.Literals,+ module Hydra.Core.Overlay.Haskell.AsTerm,+) where++import Hydra.Kernel+import Hydra.Core.Overlay.Haskell.AsTerm+import Hydra.Core.Overlay.Haskell.Dsl.Common+import Hydra.Core.Overlay.Haskell.Dsl.Meta.Literals+import qualified Hydra.Core.Overlay.Haskell.Dsl.Annotations as Ann+import qualified Hydra.Core.Overlay.Haskell.Dsl.Terms as Terms+import qualified Hydra.Core.Print.Model as PrintCore+import Hydra.Core.Encoding (encodeBindingName)+import Hydra.Core.Decoding (decodeBindingName)++import Prelude hiding ((++))+import qualified Data.List as L+import qualified Data.Map as M+import qualified Data.Set as S+import qualified Hydra.Core.Overlay.Haskell.Dsl.Prims as Prims+import qualified Hydra.Core.Lib.Eithers as DefEithers+import qualified Hydra.Core.Lib.Lists as DefLists+import qualified Hydra.Core.Lib.Math as DefMath+import qualified Hydra.Core.Lib.Optionals as DefOptionals+import qualified Hydra.Core.Lib.Strings as DefStrings+++-- Operators++infixr 0 ~>+(~>) :: String -> TypedTerm x -> TypedTerm (a -> b)+name ~> body = lambda name body++infixl 1 <~+(<~) :: String -> TypedTerm a -> TypedTerm b -> TypedTerm b+name <~ value = let1 name value++infixl 1 <<~+(<<~) :: AsTerm t (Either e a) => String -> t -> TypedTerm (Either e b) -> TypedTerm (Either e b)+name <<~ def = eitherBind name (asTerm def)++-- | Function composition operator: f <.> g creates a function that applies g then f+-- Example: toString <.> increment+-- Accepts TypedTerm or TypedBinding for both operands (via AsTerm)+(<.>) :: (AsTerm f (b -> c), AsTerm g (a -> b)) => f -> g -> TypedTerm (a -> c)+f <.> g = compose (asTerm f) (asTerm g)++-- | Function application operator: function @@ argument+-- Example: add @@ int32 1+-- Accepts TypedTerm or TypedBinding for both operands (via AsTerm)+(@@) :: (AsTerm f (a -> b), AsTerm g a) => f -> g -> TypedTerm b+fun @@ arg = apply (asTerm fun) (asTerm arg)++(++) :: (AsTerm f String, AsTerm g String) => f -> g -> TypedTerm String+f ++ g = primitive2 (Prims.primName DefStrings.concat2) (asTerm f) (asTerm g)++-- | Field definition operator for records: name>: value+-- Example: "name">: string "John"+-- Accepts TypedTerm or TypedBinding (via AsTerm)+infixr 0 >:+(>:) :: AsTerm t a => String -> t -> Field+name>: term = Field (Name name) (unTypedTerm $ asTerm term)++-- | Field definition operator with pre-constructed name: fname>>: value+-- Example: _Person_name>>: string "John"+-- Accepts TypedTerm or TypedBinding (via AsTerm)+infixr 0 >>:+(>>:) :: AsTerm t a => Name -> t -> Field+fname >>: d = field fname (asTerm d)++-- | Add an annotation to a term+-- Example: annot (Name "deprecated") (Just (boolean True)) myFunction+annot :: Name -> Maybe Term -> TypedTerm a -> TypedTerm a+annot key mvalue (TypedTerm term) = TypedTerm $ Ann.annotateTerm key mvalue term++-- | Apply a function to an argument+-- Example: apply (var "add") (int32 1)+apply :: TypedTerm (a -> b) -> TypedTerm a -> TypedTerm b+apply (TypedTerm lhs) (TypedTerm rhs) = TypedTerm $ Terms.apply lhs rhs++++-- | Create an unapplied pattern match on a union term+-- Example: cases (Name "Result") (Just $ string "what?") ["success">: string "yay", "error">: string "boo"]+-- See also: 'match'+cases :: AsName n => n -> Maybe (TypedTerm b) -> [Field] -> TypedTerm (a -> b)+cases n dflt fields = TypedTerm $ Terms.match (asName n) (unTypedTerm <$> dflt) fields++-- | Compose two functions (g then f)+-- Example: compose (var "stringLength") (var "toString")+-- Accepts TypedTerm or TypedBinding for both operands (via AsTerm)+compose :: (AsTerm f (b -> c), AsTerm g (a -> b)) => f -> g -> TypedTerm (a -> c)+compose f g = TypedTerm $ Terms.compose (unTypedTerm $ asTerm f) (unTypedTerm $ asTerm g)++-- | Create a constant function that always returns the same value+-- Example: constant true+-- Accepts TypedTerm or TypedBinding (via AsTerm)+constant :: AsTerm t a => t -> TypedTerm (b -> a)+constant t = TypedTerm $ Terms.constant (unTypedTerm $ asTerm t)++-- | Get a reference to a decoder function in hydra.core.decode.model for a given type name+-- The decoder takes a graph context and a term, returning either a decoding error or the decoded value+decoderFor :: Name -> TypedTerm (Graph -> Term -> Prelude.Either DecodingError a)+decoderFor typeName = var $ unName $ decodeBindingName typeName++-- | Create a definition in a module+-- Example: definitionInModule myModule "addInts" (lambda "x" (lambda "y" (add @@ var "x" @@ var "y")))+definitionInModule :: Module -> String -> TypedTerm a -> TypedTermDefinition a+definitionInModule mod = definitionInModuleName $ moduleName mod++-- | Create a definition in a namespace+-- Example: definitionInModuleName (ModuleName "com.example") "addInts" myFunction+definitionInModuleName :: ModuleName -> String -> TypedTerm a -> TypedTermDefinition a+definitionInModuleName ns lname = TypedTermDefinition $ unqualifyName $ QualifiedName (Just ns) lname++-- | Add documentation to a term+-- Example: doc "Adds two integers" addFunction+-- Accepts TypedTerm or TypedBinding (via AsTerm)+doc :: AsTerm t a => String -> t -> TypedTerm a+doc s t = TypedTerm $ setTermDescription (Just s) (unTypedTerm $ asTerm t)++-- | Add documentation with line wrapping at the specified width+-- Example: docWrapped 80 "This is a long documentation string that will be wrapped..." myFunction+docWrapped :: Int -> String -> TypedTerm a -> TypedTerm a+docWrapped len = doc . wrapLine len++-- | Bind over Either: extracts the Right value into a variable, short-circuiting on Left+eitherBind :: AsTerm t (Either e a) => String -> t -> TypedTerm (Either e b) -> TypedTerm (Either e b)+eitherBind v def body = primitive2 (Prims.primName DefEithers.bind) (asTerm def) $ lambda v $ body++-- | Convert a typed element to an untyped element (legacy name, prefer 'toBinding')+-- Example: el (definitionInModule myModule "addInts" myFunction)+el :: TypedBinding a -> Binding+el = toBinding++encodedBinary :: TypedTerm String -> TypedTerm Term+encodedBinary = encodedLiteral . inject _Literal _Literal_binary++encodedBoolean :: TypedTerm Bool -> TypedTerm Term+encodedBoolean = encodedLiteral . inject _Literal _Literal_boolean++encodedCase :: AsTerm t (a -> Term) => Name -> Name -> t -> Field+encodedCase tname fname enc = field fname $ "v" ~> encodedVariant tname fname (enc @@ var "v")++encodedEither :: TypedTerm (Prelude.Either a b) -> TypedTerm Term+encodedEither = inject _Term _Term_either++encodedField :: Name -> TypedTerm Term -> TypedTerm Term+encodedField fname term = encodedFieldRaw (encodedName fname) term++encodedFieldRaw :: TypedTerm Name -> TypedTerm Term -> TypedTerm Term+encodedFieldRaw (TypedTerm fname) (TypedTerm term) = TypedTerm $ Terms.record _Field [+ Field _Field_name fname,+ Field _Field_term term]++encodedFloatValue :: TypedTerm FloatValue -> TypedTerm Term+encodedFloatValue = encodedLiteral . inject _Literal _Literal_float++encodedInjection :: Name -> Name -> TypedTerm Term -> TypedTerm Term+encodedInjection tname fname term = TypedTerm $ Terms.record _Injection [+ field _Injection_typeName $ encodedName tname,+ field _Injection_field $ encodedField fname term]++encodedInt32 :: TypedTerm Int -> TypedTerm Term+encodedInt32 v = encodedIntegerValue $ inject _IntegerValue _IntegerValue_int32 v++encodedIntegerValue :: TypedTerm IntegerValue -> TypedTerm Term+encodedIntegerValue = encodedLiteral . inject _Literal _Literal_integer++encodedList :: TypedTerm [a] -> TypedTerm Term+encodedList = inject _Term _Term_list++encodedLiteral :: TypedTerm Literal -> TypedTerm Term+encodedLiteral = inject _Term _Term_literal++encodedMap :: TypedTerm (M.Map k v) -> TypedTerm Term+encodedMap = inject _Term _Term_map++encodedName :: Name -> TypedTerm Name+encodedName = wrap _Name . string . unName++encodedOptional :: TypedTerm (Maybe a) -> TypedTerm Term+encodedOptional = inject _Term _Term_optional++encodedPair :: TypedTerm (a, b) -> TypedTerm Term+encodedPair = inject _Term _Term_pair++encodedRecord :: Name -> [Field] -> TypedTerm Term+encodedRecord tname fields = TypedTerm $ Terms.inject _Term _Term_record $ Terms.record _Record [+ field _Record_typeName $ encodedName tname,+ field _Record_fields $ list (encField <$> fields)]+ where+ encField (Field fname term) = encodedField fname $ TypedTerm term++encodedSet :: TypedTerm (S.Set a) -> TypedTerm Term+encodedSet = inject _Term _Term_set++encodedString :: TypedTerm String -> TypedTerm Term+encodedString = encodedLiteral . inject _Literal _Literal_string++encodedUnion :: TypedTerm Term -> TypedTerm Term+encodedUnion = inject _Term _Term_inject++encodedUnit :: TypedTerm Term+encodedUnit = injectUnit _Term _Term_unit++encodedVariant :: Name -> Name -> TypedTerm Term -> TypedTerm Term+encodedVariant tname fname term = encodedUnion $ encodedInjection tname fname term++encodedWrappedTerm :: Name -> TypedTerm Term -> TypedTerm Term+encodedWrappedTerm name = encodedWrappedTermRaw (encodedName name)++encodedWrappedTermRaw :: TypedTerm Name -> TypedTerm Term -> TypedTerm Term+encodedWrappedTermRaw (TypedTerm name) (TypedTerm term) = TypedTerm $ Terms.inject _Term _Term_wrap $ Terms.record _WrappedTerm [+ Field _WrappedTerm_typeName name,+ Field _WrappedTerm_body term]++-- | Get a reference to an encoder function in hydra.core.encode.model for a given type name+encoderFor :: Name -> TypedTerm (a -> Term)+encoderFor typeName = var $ unName $ encodeBindingName typeName++-- | Create a field with the given name and value+-- Example: field (Name "age") (int32 30)+field :: Name -> TypedTerm a -> Field+field fname (TypedTerm val) = Field fname val++-- | Mark a type as first-class+-- Example: firstClassType (record ...)+firstClassType :: TypedTerm Type -> TypedTerm Type+firstClassType typ = annot keyFirstClassType (Just $ Terms.boolean True) typ++-- | Create a fold function to process lists+-- Example: fold (lambda "acc" (lambda "x" (add @@ var "acc" @@ var "x")))+fold :: AsTerm t (b -> a -> b) => t -> TypedTerm (b -> [a] -> b)+fold f = (primitive (Prims.primName DefLists.foldl)) @@ asTerm f++-- | Identity function that returns its argument unchanged+-- Example: identity+identity :: TypedTerm (a -> a)+identity = TypedTerm Terms.identity++-- | Create a union injection+-- Example: inject (Name "Result") (Name "success") (string "ok")+inject :: (AsName t, AsName f) => t -> f -> TypedTerm a -> TypedTerm b+inject n fn (TypedTerm term) = TypedTerm $ Terms.inject (asName n) (asName fn) term++-- | Create a function that injects its argument into a union variant+-- Example: injectLambda (Name "Result") (Name "success")+injectLambda :: Name -> Name -> TypedTerm (a -> b)+injectLambda name fname = lambda "injected_" $ inject name fname $ var "injected_"++-- | Create a unit variant of a union+-- Example: injectUnit (Name "Result") (Name "success")+injectUnit :: (AsName t, AsName f) => t -> f -> TypedTerm a+injectUnit n fn = TypedTerm $ Terms.inject (asName n) (asName fn) Terms.unit++-- | Create a 'Just' optional value+-- Example: just (string "found")+-- Accepts TypedTerm or TypedBinding (via AsTerm)+just :: AsTerm t a => t -> TypedTerm (Maybe a)+just t = TypedTerm $ Terms.just (unTypedTerm $ asTerm t)++-- | Function that wraps a value in 'Just'+-- Example: just_ @@ myValue+just_ :: TypedTerm (a -> Maybe a)+just_ = TypedTerm $ Terms.lambda "just_" $ Terms.just $ Terms.var "just_"++-- | Create a lambda function with one parameter+-- Example: lambda "x" (var "add" @@ var "x" @@ int32 1)+lambda :: String -> TypedTerm x -> TypedTerm (a -> b)+lambda v (TypedTerm body) = TypedTerm $ Terms.lambda v body++-- | Create a multi-parameter lambda function+-- Example: lambdas ["x", "y"] (add @@ var "x" @@ var "y")+lambdas :: [String] -> TypedTerm x -> TypedTerm (a -> b)+lambdas params (TypedTerm body) = TypedTerm $ Terms.lambdas params body++-- | Create a 'Left' either value+-- Example: left (string "error")+left :: TypedTerm a -> TypedTerm (Either a b)+left (TypedTerm term) = TypedTerm $ Terms.left term++-- | Function that wraps a value in 'Left'+-- Example: left_ @@ myValue+left_ :: TypedTerm (a -> Either a b)+left_ = TypedTerm $ Terms.lambda "left_" $ Terms.left $ Terms.var "left_"++let1 :: String -> TypedTerm a -> TypedTerm b -> TypedTerm b+let1 name (TypedTerm value) (TypedTerm env) = TypedTerm $ TermLet $ Let [Binding (Name name) value Nothing] env++-- | Create a let expression with multiple bindings+-- Example: lets ["x">: int32 1, "y">: int32 2] (var "add" @@ var "x" @@ var "y")+lets :: [Field] -> TypedTerm a -> TypedTerm a+lets fields (TypedTerm env) = TypedTerm $ TermLet $ Let (toBinding <$> fields) env+ where+ toBinding (Field name value) = Binding name value Nothing++-- | Create a list of terms+-- Example: list [int32 1, int32 2, int32 3]+-- Accepts TypedTerm or TypedBinding elements (via AsTerm)+list :: AsTerm t a => [t] -> TypedTerm [a]+list els = TypedTerm $ Terms.list (unTypedTerm . asTerm <$> els)++-- | Create a map/dictionary term+-- Example: map (M.fromList [(string "a", int32 1), (string "b", int32 2)])+map :: M.Map (TypedTerm a) (TypedTerm b) -> TypedTerm (M.Map a b)+map = TypedTerm . Terms.map . M.fromList . fmap fromTypedTerm . M.toList+ where+ fromTypedTerm (TypedTerm k, TypedTerm v) = (k, v)++-- | Apply a named case match to an argument+-- Example: match resultTypeName myResult Nothing [onSuccess, onError]+-- See also: 'cases'+match :: AsName n => n -> TypedTerm a -> Maybe (TypedTerm b) -> [Field] -> TypedTerm b+match n arg dflt fields = TypedTerm $ Terms.apply (Terms.match (asName n) (unTypedTerm <$> dflt) fields) (unTypedTerm arg)++-- | Lift a Haskell Name value to a phantom-typed TypedTerm Name+nameLift :: Name -> TypedTerm Name+nameLift (Name n) = wrap _Name $ string n++-- | Create a 'Nothing' optional value+-- Example: nothing+nothing :: TypedTerm (Maybe a)+nothing = TypedTerm Terms.nothing++-- | Create an optional value from a Maybe+-- Example: opt (Just myValue)+opt :: Maybe (TypedTerm a) -> TypedTerm (Maybe a)+opt mc = TypedTerm $ Terms.optional (unTypedTerm <$> mc)++optCases :: AsTerm f (a -> b) => TypedTerm (Maybe a) -> TypedTerm b -> f -> TypedTerm b+optCases arg ifNothing ifJust = primitive3 (Name "hydra.core.lib.optionals.match") arg ifNothing (asTerm ifJust)++-- | Create a pair+-- Example: pair (string "age") (int32 32)+-- Accepts TypedTerm or TypedBinding (via AsTerm)+pair :: (AsTerm t1 a, AsTerm t2 b) => t1 -> t2 -> TypedTerm (a, b)+pair l r = TypedTerm $ Terms.pair (unTypedTerm $ asTerm l) (unTypedTerm $ asTerm r)++-- | Primitive function by name+-- Example: primitive (Name "hydra.core.lib.strings.length")+primitive :: Terms.ToPrimName n => n -> TypedTerm a+primitive = TypedTerm . Terms.primitive++-- | Apply a primitive function to one argument+-- Example: primitive1 DefMath.abs (int32 (-5))+primitive1 :: Terms.ToPrimName n => n -> TypedTerm a -> TypedTerm b+primitive1 n (TypedTerm a) = TypedTerm $ Terms.primitive n Terms.@@ a++-- | Apply a primitive function to two arguments+-- Example: primitive2 DefMath.add (int32 2) (int32 3)+primitive2 :: Terms.ToPrimName n => n -> TypedTerm a -> TypedTerm b -> TypedTerm c+primitive2 n (TypedTerm a) (TypedTerm b) = TypedTerm $ Terms.primitive n Terms.@@ a Terms.@@ b++-- | Apply a primitive function to three arguments+-- Example: primitive3 DefStrings.replace (string "hello") (string "e") (string "a")+primitive3 :: Terms.ToPrimName n => n -> TypedTerm a -> TypedTerm b -> TypedTerm c -> TypedTerm d+primitive3 n (TypedTerm a) (TypedTerm b) (TypedTerm c) = TypedTerm $ Terms.primitive n Terms.@@ a Terms.@@ b Terms.@@ c++-- | Extract a field from a record+-- Example: project (Name "Person") (Name "name")+project :: (AsName t, AsName f) => t -> f -> TypedTerm (a -> b)+project n fn = TypedTerm $ Terms.project (asName n) (asName fn)++-- | Create a record with named fields+-- Example: record (Name "Person") [field (Name "name") (string "John"), field (Name "age") (int32 30)]+record :: AsName n => n -> [Field] -> TypedTerm a+record n fields = TypedTerm $ Terms.record (asName n) fields++-- | Reify a Haskell-level meta-function over phantom-typed terms into a first-class+-- term-level function. See also 'reify2' for the binary form.+-- Example: @reify Literals.printInt32@ has type @TypedTerm (Int -> String)@+reify :: (TypedTerm a -> TypedTerm b) -> TypedTerm (a -> b)+reify f = case (unTypedTerm $ f $ var "x") of+ TermApplication (Application lhs _) -> TypedTerm lhs+ TermEither (Prelude.Left _) -> lambda "x" $ TypedTerm $ TermEither $ Prelude.Left $ Terms.var "x"+ TermEither (Prelude.Right _) -> lambda "x" $ TypedTerm $ TermEither $ Prelude.Right $ Terms.var "x"+ TermOptional (Just _) -> primitive (Prims.primName DefOptionals.given)+ TermInject (Injection tname (Field fname _)) -> lambda "x" $ inject tname fname $ var "x"+ TermWrap (WrappedTerm tname _) -> lambda "x" $ wrap tname $ var "x"++-- | Reify a binary Haskell-level meta-function over phantom-typed terms into a+-- first-class term-level function. See also 'reify' for the unary form.+-- Example: @reify2 (\\x y -> Maths.add x (Maths.mul x y))@+reify2 :: (TypedTerm a -> TypedTerm b -> TypedTerm c) -> TypedTerm (a -> b -> c)+reify2 f = case (unTypedTerm $ f (var "x") (var "y")) of+ TermApplication (Application (TermApplication (Application lhs _)) _) -> TypedTerm lhs+ t -> TypedTerm $ Terms.string $ "unexpected term as binary function: " <> PrintCore.term t++++-- | Create a 'Right' either value+-- Example: right (int32 42)+right :: TypedTerm b -> TypedTerm (Either a b)+right (TypedTerm term) = TypedTerm $ Terms.right term++-- | Function that wraps a value in 'Right'+-- Example: right_ @@ myValue+right_ :: TypedTerm (b -> Either a b)+right_ = TypedTerm $ Terms.lambda "right_" $ Terms.right $ Terms.var "right_"++-- | Create a set of terms+-- Example: set [string "a", string "b", string "c"]+set :: [TypedTerm a] -> TypedTerm (S.Set a)+set = TypedTerm . Terms.set . S.fromList . fmap unTypedTerm++-- | Convert a typed binding to an untyped Binding for use in module element lists+-- Example: toBinding functionArity+toBinding :: TypedBinding a -> Binding+toBinding (TypedBinding name (TypedTerm term)) = Binding name term Nothing++-- | Convert a phantom-typed term definition to a Definition for use in module definition lists+-- Example: toDefinition functionArity+toDefinition :: TypedTermDefinition a -> Definition+toDefinition (TypedTermDefinition name (TypedTerm term)) = DefinitionTerm $ TermDefinition name Nothing Nothing term++-- | Define a primitive (no default implementation) within a module.+-- Analogous to 'definitionInModule' for term definitions.+-- Example: define = primitiveInModule module_+primitiveInModule :: Module -> String -> String -> TermSignature -> [String] -> PrimitiveDefinition+primitiveInModule mod localName description sig comments =+ PrimitiveDefinition+ (unqualifyName (QualifiedName (Just (moduleName mod)) localName))+ (primitiveMetadata description comments)+ sig True True Nothing++-- | Define a primitive with a default implementation within a module.+-- Example: defineWithDefault = primitiveWithDefaultInModule module_+primitiveWithDefaultInModule :: Module -> String -> String -> TermSignature -> [String] -> TypedTerm a -> PrimitiveDefinition+primitiveWithDefaultInModule mod localName description sig comments (TypedTerm impl) =+ (primitiveInModule mod localName description sig comments) { primitiveDefinitionDefaultImplementation = Just impl }++-- | Stamp a primitive as deprecated since the given version, pointing at its replacement.+-- Sets @LifecycleInfo.deprecatedSince@ in the primitive's entity metadata and records the+-- replacement as a @Use:@ comment, so the deprecation is both machine-checkable (the stamp)+-- and legible in the generated documentation (the comment). See the compatibility specification+-- (docs/specification/compatibility.md §3) for the deprecation policy.+-- Example: member = deprecatedSince "0.18" "hydra.core.lib.lists.member" $ define "elem" ...+deprecatedSince :: String -> String -> PrimitiveDefinition -> PrimitiveDefinition+deprecatedSince ver useReplacement pd =+ pd {primitiveDefinitionMetadata = Just meta'}+ where+ lifecycle = LifecycleInfo Nothing (Just (Version ver))+ useComment = L.concat ["Deprecated since ", ver, ". Use: ", useReplacement, "."]+ meta' = case primitiveDefinitionMetadata pd of+ Just m -> m {+ entityMetadataComments = L.concat [entityMetadataComments m, [useComment]],+ entityMetadataLifecycle = Just lifecycle}+ Nothing -> EntityMetadata Nothing [useComment] [] (Just lifecycle) []++-- | Define an impure primitive (no default implementation) within a module.+-- Example: defineImpure = impurePrimitiveInModule module_+impurePrimitiveInModule :: Module -> String -> String -> TermSignature -> [String] -> PrimitiveDefinition+impurePrimitiveInModule mod localName description sig comments =+ (primitiveInModule mod localName description sig comments) { primitiveDefinitionIsPure = False }++-- | Convert a TypeScheme to a TermSignature. Exported for use in primitive modules.+-- Example: sig $ TypeScheme [] (Types.boolean Types.~> Types.boolean) mempty+sig :: TypeScheme -> TermSignature+sig = typeSchemeToTermSignature++-- | Convert a TypeScheme to a TermSignature with lazy parameters at the given (0-based) positions.+-- Coders that distinguish strict from lazy evaluation thunk exactly these arguments.+-- Example: lazySig [1, 2] $ TypeScheme [Name "x"] (Types.boolean Types.~> ...) mempty+lazySig :: [Int] -> TypeScheme -> TermSignature+lazySig idxs ts = markLazyParams idxs (sig ts)++-- | Mark parameters at the given (0-based) positions as lazy in a TermSignature.+markLazyParams :: [Int] -> TermSignature -> TermSignature+markLazyParams idxs ts = ts {+ termSignatureParameters =+ zipWith (\i p -> if i `elem` idxs then p {parameterIsLazy = True} else p)+ [0..] (termSignatureParameters ts)}++-- | Convert a TypeScheme to a TermSignature, replacing the synthesized @arg0, arg1, ...@ parameter+-- names and empty descriptions with an authored @(name, description)@ pair per value parameter.+-- Arity-checked: fails immediately if the number of pairs does not match the number of value+-- parameters peeled from the type (this catches signature/name drift at DSL-load time).+-- Example: sigWithParams [("x", "the value to compare"), ("y", "the value to compare against")] $+-- TypeScheme [Name "x"] (tx ~> tx ~> boolean) mempty+sigWithParams :: [(String, String)] -> TypeScheme -> TermSignature+sigWithParams pairs ts =+ let s = sig ts+ params = termSignatureParameters s+ n = L.length params+ m = L.length pairs+ in if m /= n+ then error (L.concat ["sigWithParams: ", show m, " (name, description) pair(s) provided for a ",+ show n, "-parameter signature"])+ else s {+ termSignatureParameters =+ zipWith+ (\p (nm, desc) -> p {+ parameterName = Name nm,+ parameterDescription = if L.null desc then Nothing else Just desc})+ params pairs}++-- | Build the entity metadata for a primitive from its (always-present) one-line description and+-- long-form comments. Each comments element is one logical observation, kept distinct rather than concatenated.+primitiveMetadata :: String -> [String] -> Maybe EntityMetadata+primitiveMetadata description comments =+ Just (EntityMetadata (Just description) comments [] Nothing [])++-- | Convert a phantom-typed term definition to a primitive Definition, using the term body as the+-- declarative default implementation.+-- Example: toPrimitive "logical AND" andSig [] and_+toPrimitive :: String -> TermSignature -> [String] -> TypedTermDefinition a -> Definition+toPrimitive description s comments (TypedTermDefinition name (TypedTerm term)) =+ DefinitionPrimitive $ PrimitiveDefinition name (primitiveMetadata description comments) s True True (Just term)++-- | Convert a Name to a primitive Definition with no default implementation.+-- Example: toPrimitiveNoDefault "Current UNIX time, in seconds" sig (Name "hydra.core.lib.math.currentUnixTimeSeconds") []+toPrimitiveNoDefault :: String -> TermSignature -> Name -> [String] -> Definition+toPrimitiveNoDefault description s name comments =+ DefinitionPrimitive $ PrimitiveDefinition name (primitiveMetadata description comments) s True True Nothing++-- | Convert a Name to an impure primitive Definition.+toImpurePrimitive :: String -> TermSignature -> Name -> [String] -> Definition+toImpurePrimitive description s name comments =+ DefinitionPrimitive $ PrimitiveDefinition name (primitiveMetadata description comments) s False True Nothing++-- | Convert a typed binding to a term Definition for use in module definition lists+-- Example: toTermDefinition functionArity+toTermDefinition :: TypedBinding a -> Definition+toTermDefinition (TypedBinding name (TypedTerm term)) = DefinitionTerm $ TermDefinition name Nothing Nothing term+++triple :: TypedTerm a -> TypedTerm b -> TypedTerm c -> TypedTerm (a, b, c)+triple (TypedTerm a) (TypedTerm b) (TypedTerm c) = TypedTerm $ Terms.triple a b c++tuple4 :: TypedTerm a -> TypedTerm b -> TypedTerm c -> TypedTerm d -> TypedTerm (a, b, c, d)+tuple4 (TypedTerm a) (TypedTerm b) (TypedTerm c) (TypedTerm d) = TypedTerm $ Terms.tuple4 a b c d++tuple5 :: TypedTerm a -> TypedTerm b -> TypedTerm c -> TypedTerm d -> TypedTerm e -> TypedTerm (a, b, c, d, e)+tuple5 (TypedTerm a) (TypedTerm b) (TypedTerm c) (TypedTerm d) (TypedTerm e) = TypedTerm $ Terms.tuple5 a b c d e++-- | Unit value (empty record)+unit :: TypedTerm a+unit = TypedTerm Terms.unit++-- | Unsafe phantom type cast. Used during bootstrap when changing Module field types.+unsafeCast :: TypedTerm a -> TypedTerm b+unsafeCast (TypedTerm t) = TypedTerm t++-- | Create an unwrap function for a wrapped type+-- Example: unwrap (Name "Email")+unwrap :: AsName n => n -> TypedTerm (a -> b)+unwrap = TypedTerm . Terms.unwrap . asName++-- | Create a variable reference+-- Example: var "x"+var :: String -> TypedTerm a+var v = TypedTerm $ Terms.var v++-- | Create a wrapped term (instance of a newtype)+-- Example: wrap (Name "Email") (string "user@example.com")+-- Note: the phantom types provide no guarantee of type safety in this case+wrap :: AsName n => n -> TypedTerm a -> TypedTerm b+wrap n (TypedTerm term) = TypedTerm $ Terms.wrap (asName n) term
@@ -0,0 +1,382 @@+{-# LANGUAGE FlexibleInstances #-} -- for IsString with nontrivial parameters++-- | A DSL for constructing primitive function definitions+module Hydra.Core.Overlay.Haskell.Dsl.Prims where++import Hydra.Core.Model+import Hydra.Core.Graph+import Hydra.Core.Packaging+import Hydra.Core.Scoping (typeSchemeToTermSignature)+import Hydra.Core.Util+import qualified Hydra.Core.Encode.Model as EncodeCore+import qualified Hydra.Core.Decode.Model as DecodeCore+import qualified Hydra.Core.Extract.Model as ExtractCore+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Errors as Error+import qualified Hydra.Core.Extract.Util as ExtractUtil+import qualified Hydra.Core.Overlay.Haskell.Dsl.Terms as Terms+import Hydra.Core.Overlay.Haskell.Dsl.Terms (ToPrimName(..))+import qualified Hydra.Core.Overlay.Haskell.Dsl.Types as Types+import qualified Hydra.Core.Print.Model as PrintCore++import Data.Int+import qualified Data.ByteString as B+import qualified Data.List as L+import qualified Data.Map as M+import qualified Data.Scientific as Sci+import qualified Data.Set as S+import qualified Data.Maybe as Y+import Hydra.Core.Strip (removeTermAnnotations)+import Hydra.Core.Lexical (emptyInferenceContext)+import Data.String(IsString(..))+import Data.Either (Either)++-- | Placeholder InferenceContext for the TermCoder encode/decode machinery used inside the prim*+-- wrappers. Since #446, a Primitive's implementation carrier no longer threads the InferenceContext:+-- coders use it only for error context (otherErr ignores it) and decode (which doesn't consult it),+-- so an empty cx is sufficient and correct. The Graph, by contrast, is still threaded through the+-- carrier and passed to the coders, because the higher-order primitives that evaluate a function+-- argument (via functionWithReduce) need the live graph to resolve primitive names.+primCx :: Typing.InferenceContext+primCx = emptyInferenceContext++bigint :: TermCoder Integer+bigint = TermCoder Types.bigint encode decode+ where+ encode _cx g = ExtractCore.bigint g+ decode _cx = Right . Terms.bigint++binary :: TermCoder B.ByteString+binary = TermCoder Types.binary encode decode+ where+ encode _cx g = ExtractCore.binary g+ decode _cx = Right . Terms.binary++boolean :: TermCoder Bool+boolean = TermCoder Types.boolean encode decode+ where+ encode _cx g = ExtractCore.boolean g+ decode _cx = Right . Terms.boolean++instance IsString (TermCoder Term) where fromString = variable++comparison :: TermCoder Comparison+comparison = TermCoder (TypeVariable _Comparison) encode decode+ where+ encode _cx g = ExtractUtil.comparison _cx g+ decode _cx = Right . Terms.comparison++decimal :: TermCoder Sci.Scientific+decimal = TermCoder Types.decimal encode decode+ where+ encode _cx g = ExtractCore.decimal g+ decode _cx = Right . Terms.decimal++-- | The qualified name of a primitive, read from its PrimitiveDefinition. A short+-- contextual alias for 'primitiveDefinitionName', used by DSL source modules to+-- reference primitive names via the generated Hydra.Lib.* definition modules (e.g.+-- @primName Math.acos@) instead of hand-maintained name constants.+primName :: PrimitiveDefinition -> Name+primName = primitiveDefinitionName++-- 'ToPrimName' (used by prim0/prim1/prim2/prim3 below to accept a generated PrimitiveDefinition+-- directly, e.g. @prim2 DefMath.add ...@) is defined in 'Hydra.Overlay.Haskell.Dsl.Terms' to avoid an import cycle+-- and re-exported here for the registry/DSL modules.++-- | Convert a TypeScheme to a TermSignature. A convenience alias for+-- typeSchemeToTermSignature, used by primitive-declaration source modules.+sig :: TypeScheme -> Typing.TermSignature+sig = typeSchemeToTermSignature++-- | Mark the value parameters at the given (0-based) positions of a primitive's+-- signature as lazy. Used at the prim*-based registration sites in+-- Hydra.Core.Overlay.Haskell.Libraries to record which arguments coders must thunk in hosts+-- that distinguish strict from lazy evaluation (issue #391). The kernel DSL+-- sources (Hydra.Sources.Kernel.Lib.*) carry the same flags via lazySig; this+-- keeps the Haskell-host bootstrapGraph in agreement with the JSON.+lazyArgs :: [Int] -> Primitive -> Primitive+lazyArgs idxs p = p { primitiveDefinition = markLazyDef (primitiveDefinition p) }+ where+ markLazyDef d = d {+ primitiveDefinitionSignature = markLazySig (primitiveDefinitionSignature d) }+ markLazySig s = s {+ Typing.termSignatureParameters =+ zipWith markParam [0..] (Typing.termSignatureParameters s) }+ markParam i param =+ if i `elem` idxs then param { Typing.parameterIsLazy = True } else param++either_ :: TermCoder x -> TermCoder y -> TermCoder (Prelude.Either x y)+either_ xCoder yCoder = TermCoder (Types.either_ (termCoderType xCoder) (termCoderType yCoder)) encode decode+ where+ encode cx g term = case term of+ TermEither (Prelude.Left l) -> Prelude.Left <$> termCoderEncode xCoder cx g l+ TermEither (Prelude.Right r) -> Prelude.Right <$> termCoderEncode yCoder cx g r+ _ -> Left $ otherErr cx $ "expected either term, got: " ++ show term+ decode cx ev = case ev of+ Prelude.Left x -> do+ xTerm <- termCoderDecode xCoder cx x+ return $ Terms.left xTerm+ Prelude.Right y -> do+ yTerm <- termCoderDecode yCoder cx y+ return $ Terms.right yTerm++float32 :: TermCoder Float+float32 = TermCoder Types.float32 encode decode+ where+ encode _cx g = ExtractCore.float32 g+ decode _cx = Right . Terms.float32++float64 :: TermCoder Double+float64 = TermCoder Types.float64 encode decode+ where+ encode _cx g = ExtractCore.float64 g+ decode _cx = Right . Terms.float64++floatType :: TermCoder FloatType+floatType = TermCoder (TypeVariable _FloatType) encode decode+ where+ encode _cx g term = case DecodeCore.floatType g term of+ Left err -> Left $ Error.ErrorDecoding err+ Right v -> Right v+ decode _cx = Right . EncodeCore.floatType++floatValue :: TermCoder FloatValue+floatValue = TermCoder (TypeVariable _FloatValue) encode decode+ where+ encode _cx g = ExtractCore.floatValue g+ decode _cx = Right . Terms.float++function :: TermCoder x -> TermCoder y -> TermCoder (x -> y)+function dom cod = TermCoder (Types.function (termCoderType dom) (termCoderType cod)) encode decode+ where+ encode cx _g term = Left $ otherErr cx $ "cannot encode term to a function: " ++ PrintCore.term term+ decode cx _val = Left $ otherErr cx "cannot decode functions to terms"++-- | A graph-free TermCoder for function types (issue #446). Instead of calling the reducer to+-- evaluate the application eagerly, the bridged native function builds an UNREDUCED application+-- term @apply funTerm argTerm@ and lets the interpreter's outer @reduce@ fold it. This is the+-- replacement for @functionWithReduce@ for the higher-order primitives whose result shape is+-- fixed by the (already-reduced) data argument's spine — i.e. those that never need to inspect+-- the reduced value of a per-element application mid-computation. It threads no InferenceContext+-- or Graph, which is what lets the @Primitive.implementation@ carrier drop those parameters.+--+-- Only the encode side is defined (functions are never decoded back to terms), matching+-- @functionWithReduce@. dom/cod are the term coders for the argument and result; for the+-- higher-order primitives this is always the identity @term@/@variable@ coder, so a bridged+-- @Term -> Term@ is @\\argTerm -> TermApplication (Application funTerm argTerm)@.+functionDeferred :: TermCoder x -> TermCoder y -> TermCoder (x -> y)+functionDeferred dom cod = TermCoder (Types.function (termCoderType dom) (termCoderType cod)) encode decode+ where+ encode cx g funTerm = Right $ \x ->+ let argTerm = case termCoderDecode dom cx x of+ Left _ -> error "functionDeferred: failed to decode argument"+ Right t -> t+ resultTerm = TermApplication (Application funTerm argTerm)+ in case termCoderEncode cod cx g resultTerm of+ Left _ -> error "functionDeferred: failed to encode result"+ Right v -> v+ decode cx _val = Left $ otherErr cx "cannot decode functions to terms"++-- | A TermCoder for function types, using a reducer to bridge term-level functions to native functions.+-- The reducer is called to evaluate function application at the term level.+-- Failures in reduction or encoding/decoding will result in a runtime error.+functionWithReduce :: (Typing.InferenceContext -> Graph -> Term -> Either Error.Error Term) -> TermCoder x -> TermCoder y -> TermCoder (x -> y)+functionWithReduce reduce dom cod = TermCoder (Types.function (termCoderType dom) (termCoderType cod)) encode decode+ where+ encode cx g funTerm = Right $ \x ->+ let argTerm = case termCoderDecode dom cx x of+ Left _ -> error "functionWithReduce: failed to encode argument"+ Right t -> t+ resultTerm = case reduce cx g (TermApplication (Application funTerm argTerm)) of+ Left _ -> error "functionWithReduce: failed to reduce application"+ Right t -> t+ in case termCoderEncode cod cx g resultTerm of+ Left _ -> error "functionWithReduce: failed to decode result"+ Right v -> v+ decode cx _val = Left $ otherErr cx "cannot decode functions to terms"++int16 :: TermCoder Int16+int16 = TermCoder Types.int16 encode decode+ where+ encode _cx g = ExtractCore.int16 g+ decode _cx = Right . Terms.int16++int32 :: TermCoder Int+int32 = TermCoder Types.int32 encode decode+ where+ encode _cx g = ExtractCore.int32 g+ decode _cx = Right . Terms.int32++int64 :: TermCoder Int64+int64 = TermCoder Types.int64 encode decode+ where+ encode _cx g = ExtractCore.int64 g+ decode _cx = Right . Terms.int64++int8 :: TermCoder Int8+int8 = TermCoder Types.int8 encode decode+ where+ encode _cx g = ExtractCore.int8 g+ decode _cx = Right . Terms.int8++integerType :: TermCoder IntegerType+integerType = TermCoder (TypeVariable _IntegerType) encode decode+ where+ encode _cx g term = case DecodeCore.integerType g term of+ Left err -> Left $ Error.ErrorDecoding err+ Right v -> Right v+ decode _cx = Right . EncodeCore.integerType++integerValue :: TermCoder IntegerValue+integerValue = TermCoder (TypeVariable _IntegerValue) encode decode+ where+ encode _cx g = ExtractCore.integerValue g+ decode _cx = Right . Terms.integer++list :: TermCoder x -> TermCoder [x]+list els = TermCoder (Types.list $ termCoderType els) encode decode+ where+ encode cx g = ExtractCore.listOf (termCoderEncode els cx g) g+ decode cx l = Terms.list <$> mapM (termCoderDecode els cx) l++literal :: TermCoder Literal+literal = TermCoder (TypeVariable _Literal) encode decode+ where+ encode _cx g = ExtractCore.literal g+ decode _cx = Right . Terms.literal++literalType :: TermCoder LiteralType+literalType = TermCoder (TypeVariable _LiteralType) encode decode+ where+ encode _cx g term = case DecodeCore.literalType g term of+ Left err -> Left $ Error.ErrorDecoding err+ Right v -> Right v+ decode _cx = Right . EncodeCore.literalType++map :: Ord k => TermCoder k -> TermCoder v -> TermCoder (M.Map k v)+map keys values = TermCoder (Types.map (termCoderType keys) (termCoderType values)) encode decode+ where+ encode cx g = ExtractCore.map (termCoderEncode keys cx g) (termCoderEncode values cx g) g+ decode cx m = Terms.map . M.fromList <$> mapM decodePair (M.toList m)+ where+ decodePair (k, v) = do+ ke <- termCoderDecode keys cx k+ ve <- termCoderDecode values cx v+ return (ke, ve)++optional :: TermCoder x -> TermCoder (Y.Maybe x)+optional mel = TermCoder (Types.optional $ termCoderType mel) encode decode+ where+ encode cx g = ExtractCore.optionalTerm (termCoderEncode mel cx g) g+ decode cx mv = Terms.optional <$> case mv of+ Nothing -> pure Nothing+ Just v -> Just <$> termCoderDecode mel cx v++-- | A helper to create an Error from a string message and context+otherErr :: Typing.InferenceContext -> String -> Error.Error+otherErr _cx msg = Error.ErrorOther (Error.OtherError msg)++pair :: TermCoder x -> TermCoder y -> TermCoder (x, y)+pair xCoder yCoder = TermCoder (Types.pair (termCoderType xCoder) (termCoderType yCoder)) encode decode+ where+ encode cx g = ExtractCore.pair (termCoderEncode xCoder cx g) (termCoderEncode yCoder cx g) g+ decode cx (x, y) = do+ xTerm <- termCoderDecode xCoder cx x+ yTerm <- termCoderDecode yCoder cx y+ return $ Terms.pair xTerm yTerm++-- The prim0..prim3 registration helpers take the primitive's authoritative, translingual+-- 'PrimitiveDefinition' (from the generated Hydra.Lib.* modules, e.g. @DefMath.add@) and use its+-- signature verbatim as the single source of truth for the primitive's type — including class+-- constraints, parameter laziness, and metadata. The 'TermCoder' arguments now serve ONLY the+-- runtime marshalling of the implementation (term<->native encode/decode); their 'termCoderType'+-- no longer contributes to the primitive's declared type. This removes the former divergence risk+-- between the hand-written registration type and the generated definition (#566).++prim0 :: PrimitiveDefinition -> x -> TermCoder x -> Primitive+prim0 def value output = Primitive def impl+ where+ impl _g _args = termCoderDecode output primCx value++prim1 :: PrimitiveDefinition -> (x -> y) -> TermCoder x -> TermCoder y -> Primitive+prim1 def compute input1 output = Primitive def impl+ where+ impl g args = do+ ExtractCore.nArgs (primitiveDefinitionName def) 1 args+ arg1 <- termCoderEncode input1 primCx g (args !! 0)+ termCoderDecode output primCx $ compute arg1++prim2 :: PrimitiveDefinition -> (x -> y -> z) -> TermCoder x -> TermCoder y -> TermCoder z -> Primitive+prim2 def compute input1 input2 output = Primitive def impl+ where+ impl g args = do+ ExtractCore.nArgs (primitiveDefinitionName def) 2 args+ arg1 <- termCoderEncode input1 primCx g (args !! 0)+ arg2 <- termCoderEncode input2 primCx g (args !! 1)+ termCoderDecode output primCx $ compute arg1 arg2++prim3 :: PrimitiveDefinition -> (w -> x -> y -> z) -> TermCoder w -> TermCoder x -> TermCoder y -> TermCoder z -> Primitive+prim3 def compute input1 input2 input3 output = Primitive def impl+ where+ impl g args = do+ ExtractCore.nArgs (primitiveDefinitionName def) 3 args+ arg1 <- termCoderEncode input1 primCx g (args !! 0)+ arg2 <- termCoderEncode input2 primCx g (args !! 1)+ arg3 <- termCoderEncode input3 primCx g (args !! 2)+ termCoderDecode output primCx $ compute arg1 arg2 arg3++set :: Ord x => TermCoder x -> TermCoder (S.Set x)+set els = TermCoder (Types.set $ termCoderType els) encode decode+ where+ encode cx g = ExtractCore.setOf (termCoderEncode els cx g) g+ decode cx s = Terms.set . S.fromList <$> mapM (termCoderDecode els cx) (S.toList s)++string :: TermCoder String+string = TermCoder Types.string encode decode+ where+ encode _cx g = ExtractCore.string g+ decode _cx = Right . Terms.string++term :: TermCoder Term+term = TermCoder (TypeVariable _Term) encode decode+ where+ encode _cx _g = Right+ decode _cx = Right++type_ :: TermCoder Type+type_ = TermCoder (TypeVariable _Type) encode decode+ where+ encode _cx g t = case DecodeCore.type_ g t of+ Left err -> Left $ Error.ErrorDecoding err+ Right v -> Right v+ decode _cx = Right . EncodeCore.type_++uint16 :: TermCoder Int+uint16 = TermCoder Types.uint16 encode decode+ where+ encode _cx g = ExtractCore.uint16 g+ decode _cx = Right . Terms.uint16++uint32 :: TermCoder Int64+uint32 = TermCoder Types.uint32 encode decode+ where+ encode _cx g = ExtractCore.uint32 g+ decode _cx = Right . Terms.uint32++uint64 :: TermCoder Integer+uint64 = TermCoder Types.uint64 encode decode+ where+ encode _cx g = ExtractCore.uint64 g+ decode _cx = Right . Terms.uint64++uint8 :: TermCoder Int16+uint8 = TermCoder Types.uint8 encode decode+ where+ encode _cx g = ExtractCore.uint8 g+ decode _cx = Right . Terms.uint8++variable :: String -> TermCoder Term+variable v = TermCoder (Types.var v) encode decode+ where+ encode _cx _g = Right+ decode _cx = Right
@@ -0,0 +1,403 @@+{-# LANGUAGE FlexibleInstances #-}++-- | A domain-specific language for constructing Hydra terms in Haskell.+module Hydra.Core.Overlay.Haskell.Dsl.Terms where++import Hydra.Core.Constants+import Hydra.Core.Model+import Hydra.Core.Graph+import Hydra.Core.Packaging (PrimitiveDefinition, primitiveDefinitionName)+import Hydra.Core.Util+import Hydra.Core.Overlay.Haskell.Dsl.Common+import qualified Hydra.Core.Overlay.Haskell.Dsl.Literals as Literals++import Prelude hiding (map, product)+import Data.Int+import qualified Data.ByteString as B+import qualified Data.Char as C+import qualified Data.List as L+import qualified Data.Map as M+import qualified Data.Scientific as Sci+import qualified Data.Set as S+++-- | Function composition operator: f <.> g creates a function that applies g then f+-- Example: var "stringLength" <.> var "toString"+(<.>) :: Term -> Term -> Term+f <.> g = compose f g++-- | Term application operator: function @@ argument+-- Example: var "add" @@ int32 1+(@@) :: Term -> Term -> Term+fun @@ arg = apply fun arg++-- | Field definition operator: name>: value+-- Example: "name">: string "John"+infixr 0 >:+(>:) :: String -> Term -> Field+name>: term = field name term++-- | Attach an annotation map to a term, wrapping the map as a TermMap per+-- Hydra's convention (#386 — annotation is now a Term, not a Map<Name, Term>).+-- Each Name key is lifted to a TermVariable.+-- Example: annot (M.fromList [(Name "comment", string "A User ID")]) (var "userId")+annot :: M.Map Name Term -> Term -> Term+annot ann term = TermAnnotated $ AnnotatedTerm term (annotationMapAsTerm ann)++-- | Attach an annotation map to a term (alternative argument order).+-- Example: annotated (var "userId") (M.fromList [(Name "comment", string "A User ID")])+annotated :: Term -> M.Map Name Term -> Term+annotated term ann = TermAnnotated $ AnnotatedTerm term (annotationMapAsTerm ann)++-- | Wrap a Map<Name, Term> as a TermMap annotation. Each Name key becomes a+-- TermVariable key. The canonical encoding for Hydra's annotation map+-- convention (#386).+annotationMapAsTerm :: M.Map Name Term -> Term+annotationMapAsTerm = TermMap . M.mapKeys TermVariable++-- | Apply a function term to an argument+-- Example: apply (var "capitalize") (string "arthur")+apply :: Term -> Term -> Term+apply fun arg = TermApplication $ Application fun arg++-- | Create a bigint literal+-- Example: bigint 9223372036854775808+bigint :: Integer -> Term+bigint = literal . Literals.bigint++-- | Create a binary data literal from a ByteString.+-- Example: binary (B.pack [0x48, 0x65, 0x00, 0xff, 0x20, 0x7a, 0x1b, 0x80])+binary :: B.ByteString -> Term+binary = literal . Literals.binary++-- | Create a boolean literal+-- Example: boolean True+boolean :: Bool -> Term+boolean = literal . Literals.boolean++char :: Char -> Term+char = int32 . C.ord++comparison :: Comparison -> Term+comparison t = case t of+ ComparisonEqualTo -> injectUnit _Comparison _Comparison_equalTo+ ComparisonLessThan -> injectUnit _Comparison _Comparison_lessThan+ ComparisonGreaterThan -> injectUnit _Comparison _Comparison_greaterThan++-- | Compose two functions (apply g then f) to create a new function+-- Example: compose (var "stringLength") (var "toString")+-- This creates a function equivalent to \x -> stringLength(toString(x))+-- Function composition applies right-to-left: (f ∘ g)(x) = f(g(x))+compose :: Term -> Term -> Term+compose f g = lambda "arg_" $ apply f (apply g $ var "arg_")++-- | Create a constant function that always returns the same value+-- Example: constant true+constant :: Term -> Term+constant = lambda ignoredVariable++-- | Create an arbitrary-precision decimal literal.+-- Example: decimal (Sci.scientific 314159265359 (-11))+decimal :: Sci.Scientific -> Term+decimal = literal . Literals.decimal++-- | Boolean false literal+false :: Term+false = boolean False++-- | Create a field with the given name and value+-- Example: field "age" (int32 30)+field :: String -> Term -> Field+field n = Field (Name n)++-- | First element projection function for pairs+first :: Term+first = primitive $ Name "hydra.core.lib.pairs.first"++-- | Create a floating-point literal with specified precision+-- Example: float (FloatValueFloat32 3.14)+float :: FloatValue -> Term+float = literal . Literals.float++-- | Create a float32 literal+-- Example: float32 3.14+float32 :: Float -> Term+float32 = literal . Literals.float32++-- | Create a float64 literal+-- Example: float64 3.14159265359+float64 :: Double -> Term+float64 = literal . Literals.float64++-- | Identity function+identity :: Term+identity = lambda "x_" $ var "x_"++-- | Create a union value by injecting a value into a specific variant+-- Example: inject (Name "Result") (Name "success") (int32 42)+-- This creates a "Result" union with the "success" variant containing value 42+-- Use this to construct values of union types at runtime+inject :: Name -> Name -> Term -> Term+inject tname fname term = TermInject $ Injection tname $ Field fname term++-- | Create a unit variant of a union (convenience function)+-- Example: injectUnit (Name "Result") (Name "success")+-- Equivalent to inject but automatically uses unit as the value+injectUnit :: Name -> Name -> Term+injectUnit tname fname = inject tname fname unit++-- | Create an int16 literal+-- Example: int16 32767+int16 :: Int16 -> Term+int16 = literal . Literals.int16++-- | Create an int32 literal+-- Example: int32 42+int32 :: Int -> Term+int32 = literal . Literals.int32++-- | Create an int64 literal+-- Example: int64 9223372036854775807+int64 :: Int64 -> Term+int64 = literal . Literals.int64++-- | Create an int8 literal+-- Example: int8 127+int8 :: Int8 -> Term+int8 = literal . Literals.int8++-- | Create an integer literal with specified bit width+-- Example: integer (IntegerValueInt32 42)+integer :: IntegerValue -> Term+integer = literal . Literals.integer++-- | Create a 'Just' optional value+-- Example: just (string "found")+just :: Term -> Term+just = optional . Just++-- | Create a lambda function with one parameter+-- Example: lambda "x" (var "x" @@ int32 1)+lambda :: String -> Term -> Term+lambda param body = TermLambda $ Lambda (Name param) Nothing body++-- | Create a lambda function with a given domain+-- Example: lambdaTyped "x" Types.int32 (list [var "x"])+lambdaTyped :: String -> Type -> Term -> Term+lambdaTyped param dom body = TermLambda $ Lambda (Name param) (Just dom) body++-- | Create a multi-parameter lambda function (curried)+-- Example: lambdas ["x", "y"] (var "add" @@ var "x" @@ var "y")+-- This creates the function \x.\y.add x y+lambdas :: [String] -> Term -> Term+lambdas params body = case params of+ [] -> body+ (h:r) -> lambda h $ lambdas r body++-- | Create a 'Left' either value+-- Example: left (string "error")+left :: Term -> Term+left term = TermEither (Left term)++-- | Create a let term with any number of bindings+-- Example: lets ["x">: int32 1, "y">: int32 2] (pair (var "x") (var "y"))+lets :: [Field] -> Term -> Term+lets bindings env = TermLet $ Let (toBinding <$> bindings) env+ where+ toBinding (Field name value) = Binding name value Nothing++letsTyped :: [(String, Term, TypeScheme)] -> Term -> Term+letsTyped bindings env = TermLet $ Let (toBinding <$> bindings) env+ where+ toBinding (name, value, ts) = Binding (Name name) value (Just ts)++-- | Create a list of terms+-- Example: list [int32 1, int32 2, int32 3]+list :: [Term] -> Term+list = TermList++-- | Create a term from a literal value+-- Example: literal (LiteralString "hello")+literal :: Literal -> Term+literal = TermLiteral++-- | Create a map/dictionary term+-- Example: map (M.fromList [(string "January", int32 31), (string "February", int32 28)])+map :: M.Map Term Term -> Term+map = TermMap++-- | Create a pattern match on a union type+-- Example: match (Name "Result") (Just (string "unknown"))+-- ["success">: lambda "s" (var "processSuccess" @@ var "s"),+-- "error">: lambda "e" (var "handleError" @@ var "e")]+-- This allows handling different cases of a union type with specific logic for each variant.+-- The optional second parameter provides a default case for any unmatched variants.+match :: Name -> Maybe Term -> [Field] -> Term+match tname def fields = TermCases $ CaseStatement tname def (fieldToCaseAlternative <$> fields)+ where+ -- The DSL builds case alternatives via the same >>: operator used for record/union+ -- fields, so call sites still pass [Field]; convert each to a CaseAlternative here.+ fieldToCaseAlternative (Field fname fterm) = CaseAlternative fname fterm++-- | Create a 'Nothing' optional value+nothing :: Term+nothing = optional Nothing++-- | Create a Maybe (nullable) term+-- Example: optional (Just (string "found"))+optional :: Maybe Term -> Term+optional = TermOptional++-- | Create a pair+-- Example: pair (string "name") (int32 42)+pair :: Term -> Term -> Term+pair a b = TermPair (a, b)++-- | Create a reference to a primitive function.+-- | Things that name a primitive. Lets the term/DSL helpers take a generated+-- 'PrimitiveDefinition' directly (@primitive DefStrings.toUpper@) — keeping the def-modules the+-- single source of truth for primitive names (#473) — while still accepting a raw 'Name'.+-- Defined here (the lowest DSL module) so 'Hydra.Overlay.Haskell.Dsl.Prims', 'Hydra.Overlay.Haskell.Dsl.Typed.Terms', and+-- 'Hydra.Overlay.Haskell.Dsl.Typed.Phantoms' can all share one class without an import cycle.+class ToPrimName a where+ toPrimName :: a -> Name++instance ToPrimName Name where+ toPrimName = id++instance ToPrimName PrimitiveDefinition where+ toPrimName = primitiveDefinitionName++-- Uses TermVariable; the name resolves via graphPrimitives fallthrough.+-- Example: primitive DefStrings.length+primitive :: ToPrimName n => n -> Term+primitive = TermVariable . toPrimName++-- | Create a field projection function+-- Example: project (Name "Person") (Name "firstName")+project :: Name -> Name -> Term+project tname fname = TermProject $ Projection tname fname++-- | Create a record with named fields of the specified type+-- Example: record (Name "Person") [+-- "name">: string "John",+-- "age">: int32 30,+-- "email">: string "john@example.com"]+-- Records are products of named fields with values that can be accessed by field name+record :: Name -> [Field] -> Term+record tname fields = TermRecord $ Record tname fields++-- | Create a 'Right' either value+-- Example: right (int32 42)+right :: Term -> Term+right term = TermEither (Right term)++-- | Second element projection function for pairs+second :: Term+second = primitive $ Name "hydra.core.lib.pairs.second"++-- | Create a set of terms+-- Example: set (S.fromList [string "a", string "b", string "c"])+set :: S.Set Term -> Term+set = TermSet++-- | Create a string literal+-- Example: string "hello world"+string :: String -> Term+string = TermLiteral . LiteralString++triple :: Term -> Term -> Term -> Term+triple a b c = pair a (pair b c)++-- | Boolean true literal+true :: Term+true = boolean True++-- | Create a tuple using nested pairs (deprecated: use pair directly)+-- Example: tuple2 a b creates pair a b+-- Example: tuple3 a b c creates pair a (pair b c)+tuple :: [Term] -> Term+tuple [] = unit+tuple [a] = a+tuple [a, b] = pair a b+tuple (a:rest) = pair a (tuple rest)++-- | Create a 2-tuple (same as pair)+tuple2 :: Term -> Term -> Term+tuple2 = pair++tuple3 :: Term -> Term -> Term -> Term+tuple3 a b c = pair a (pair b c)++tuple4 :: Term -> Term -> Term -> Term -> Term+tuple4 a b c d = pair a (pair b (pair c d))++tuple5 :: Term -> Term -> Term -> Term -> Term -> Term+tuple5 a b c d e = pair a (pair b (pair c (pair d e)))++tyapp :: Term -> Type -> Term+tyapp term typ = TermTypeApplication $ TypeApplicationTerm term typ++tyapps = typeApplication++tylam :: String -> Term -> Term+tylam var body = TermTypeLambda $ TypeLambda (Name var) body++tylams :: [String] -> Term -> Term+tylams vars body = L.foldl (\b v -> TermTypeLambda $ TypeLambda (Name v) b) body $ L.reverse vars++-- | Apply type arguments to a polymorphic term+-- Example: typeApplication (var "map") [Types.int32, Types.string]+-- This instantiates a polymorphic function with concrete types.+-- For instance, if 'map' has type 'forall a b. (a -> b) -> list a -> list b',+-- the example would instantiate it to '(int32 -> string) -> list int32 -> list string'.+typeApplication :: Term -> [Type] -> Term+typeApplication term types = L.foldl (\t ty -> TermTypeApplication $ TypeApplicationTerm t ty) term types++-- | Create a type abstraction (universal quantification)+-- Example: typeLambda [Name "a", Name "b"] (lambdaTyped "f" (Types.function (Types.var "a") (Types.var "b"))+-- (lambdaTyped "x" (Types.var "a") (var "f" @@ var "x")))+-- This creates a polymorphic term with type variables.+-- The example creates a higher-order function with type 'forall a b. (a -> b) -> a -> b',+-- which is the polymorphic apply function that works for any types a and b.+typeLambda :: [Name] -> Term -> Term+typeLambda vars body = L.foldl (\b v -> TermTypeLambda $ TypeLambda v b) body vars++-- | Create a uint16 literal+-- Example: uint16 65535+uint16 :: Int -> Term+uint16 = literal . Literals.uint16++-- | Create a uint32 literal+-- Example: uint32 4294967295+uint32 :: Int64 -> Term+uint32 = literal . Literals.uint32++-- | Create a uint64 literal+-- Example: uint64 18446744073709551615+uint64 :: Integer -> Term+uint64 = literal . Literals.uint64++-- | Create a uint8 literal+-- Example: uint8 255+uint8 :: Int16 -> Term+uint8 = literal . Literals.uint8++-- | Unit value (empty record)+unit :: Term+unit = TermUnit++-- | Create an unwrap function for a wrapped type+-- Example: unwrap (Name "Email")+unwrap :: Name -> Term+unwrap = TermUnwrap++-- | Create a variable reference+-- Example: var "x"+var :: String -> Term+var = TermVariable . Name++-- | Create a wrapped term+-- Example: wrap (Name "Email") (string "user@example.com")+wrap :: Name -> Term -> Term+wrap name term = TermWrap $ WrappedTerm name term
@@ -0,0 +1,29 @@+-- | Convenience functions for writing Hydra test cases++module Hydra.Core.Overlay.Haskell.Dsl.Tests (+ module Hydra.Core.Testing,+ module Hydra.Core.Overlay.Haskell.Libraries,+ module Hydra.Core.Overlay.Haskell.Dsl.Terms,+ module Hydra.Core.Overlay.Haskell.Dsl.Tests,+) where++import Hydra.Core.Model+import Hydra.Core.Testing+import Hydra.Core.Overlay.Haskell.Libraries+import Hydra.Core.Overlay.Haskell.Dsl.Terms++import qualified Data.List as L+import qualified Data.Set as S+++intList :: [Int] -> Term+intList els = list (int32 <$> els)++intListList :: [[Int]] -> Term+intListList lists = list (intList <$> lists)++stringList :: [String] -> Term+stringList els = list (string <$> els)++stringSet :: S.Set String -> Term+stringSet strings = set $ S.fromList $ string <$> S.toList strings
@@ -0,0 +1,271 @@+-- | A domain-specific language for constructing Hydra types in Haskell.+module Hydra.Core.Overlay.Haskell.Dsl.Types where++import Prelude hiding (product)++import Hydra.Core.Model+import Hydra.Core.Overlay.Haskell.AsType+import Hydra.Core.Overlay.Haskell.Dsl.Common+import qualified Hydra.Core.Overlay.Haskell.Dsl.Terms as Terms++import qualified Data.List as L+import qualified Data.Map as M+import qualified Data.Set as S+++-- Operators++-- | Function type constructor with infix syntax+-- Example: int32 ~> string+-- Use this for more readable function type definitions+infixr 0 ~>+(~>) :: (AsType a, AsType b) => a -> b -> Type+dom ~> cod = function (asType dom) (asType cod)++-- | Function type constructor with infix syntax (deprecated, use ~> instead)+-- Example: int32 --> string+infixr 0 -->+(-->) :: (AsType a, AsType b) => a -> b -> Type+dom --> cod = function (asType dom) (asType cod)++-- | Type application operator+-- Example: list @@ int32+(@@) :: (AsType a, AsType b) => a -> b -> Type+fun @@ arg = apply (asType fun) (asType arg)++-- | Field definition operator+-- Example: "name">: string+infixr 0 >:+(>:) :: AsType a => String -> a -> FieldType+name>: typ = field name (asType typ)+++-- | Attach an annotation map to a type, wrapping the map as a TermMap per+-- Hydra's convention (#386 — annotation is now a Term, not a Map<Name, Term>).+-- Example: annot (M.fromList [(Name "min", int32 0), (Name "max", int32 100)]) int32+annot :: AsType a => M.Map Name Term -> a -> Type+annot ann typ = TypeAnnotated $ AnnotatedType (asType typ) (Terms.annotationMapAsTerm ann)++-- | Apply a type to a type argument+-- Example: apply (var "f") int32+apply :: (AsType a, AsType b) => a -> b -> Type+apply lhs rhs = TypeApplication (ApplicationType (asType lhs) (asType rhs))++-- | Apply a type to multiple type arguments+-- Example: applys (var "Either") [string, int32]+applys :: AsType a => a -> [Type] -> Type+applys t ts = L.foldl apply (asType t) ts++-- | Arbitrary-precision integer type+bigint :: Type+bigint = integer IntegerTypeBigint++-- | Binary data type+binary :: Type+binary = literal LiteralTypeBinary++-- | Boolean type+boolean :: Type+boolean = literal LiteralTypeBoolean++-- | Arbitrary-precision decimal type+decimal :: Type+decimal = literal LiteralTypeDecimal++-- | Create an either type (a choice between two types)+-- Example: either_ string int32+either_ :: (AsType a, AsType b) => a -> b -> Type+either_ left right = TypeEither $ EitherType (asType left) (asType right)++-- | Create an effect type (a computation producing a value of the given type)+-- Example: effect (either_ fileError string)+effect :: AsType a => a -> Type+effect = TypeEffect . asType++-- | Create an enum type with the given variant names (conventionally in camelCase)+-- Example: enum ["red", "green", "blue"]+enum :: [String] -> Type+enum names = union $ (`field` unit) <$> names++-- | Create a field with the given name and type+-- Example: field "age" int32+field :: AsType a => String -> a -> FieldType+field fn t = FieldType (Name fn) (asType t)++-- | Create a floating point type with the specified precision+-- Example: float FloatTypeFloat32+float :: FloatType -> Type+float = literal . LiteralTypeFloat++-- | 32-bit floating point type+float32 :: Type+float32 = float FloatTypeFloat32++-- | 64-bit floating point type+float64 :: Type+float64 = float FloatTypeFloat64++-- | Create a universally quantified type (polymorphic type) with a singe variable+-- Example: forAll "a" (var "a" --> var "a")+-- This creates the polymorphic identity function type: ∀a. a -> a+-- Universal quantification introduces type variables that can be used in the body+forAll :: AsType a => String -> a -> Type+forAll v body = TypeForall $ ForallType (Name v) (asType body)++-- | Universal quantification with multiple variables+-- Example: forAlls ["a", "b"] (var "a" --> var "b")+forAlls :: AsType a => [String] -> a -> Type+forAlls vs body = L.foldr forAll (asType body) vs++-- | Create a function type+-- Example: function int32 string+function :: (AsType a, AsType b) => a -> b -> Type+function dom cod = TypeFunction $ FunctionType (asType dom) (asType cod)++-- | Create an n-ary function type+-- Example: functionMany [int32, string, boolean]+functionMany :: [Type] -> Type+functionMany ts = L.foldl (\cod dom -> function dom cod) (L.head r) (L.tail r)+ where+ r = L.reverse ts++-- | 16-bit signed integer type+int16 :: Type+int16 = integer IntegerTypeInt16++-- | 32-bit signed integer type+int32 :: Type+int32 = integer IntegerTypeInt32++-- | 64-bit signed integer type+int64 :: Type+int64 = integer IntegerTypeInt64++-- | 8-bit signed integer type+int8 :: Type+int8 = integer IntegerTypeInt8++-- | Create an integer type with the specified bit width+-- Example: integer IntegerTypeInt32+integer :: IntegerType -> Type+integer = literal . LiteralTypeInteger++-- | List type+-- Example: list string+list :: AsType a => a -> Type+list = TypeList . asType++-- | Literal primitive type+-- Example: literal LiteralTypeString+literal :: LiteralType -> Type+literal = TypeLiteral++-- | Map/dictionary type with key and value types+-- Example: map string int32+map :: (AsType a, AsType b) => a -> b -> Type+map keys vals = TypeMap $ MapType (asType keys) (asType vals)++-- | Create a monomorphic type scheme+-- Example: mono int32+mono :: AsType a => a -> TypeScheme+mono t = TypeScheme [] (asType t) M.empty++-- | Non-negative 32-bit integer type+-- Currently an alias for int32; intended for semantic annotation+-- In future versions, this may include validation constraints+nonNegativeInt32 :: Type+nonNegativeInt32 = int32++-- | Optional (nullable) type+-- Example: optional string+optional :: AsType a => a -> Type+optional = TypeOptional . asType++-- | Create a pair type+-- Example: pair string int32+pair :: (AsType a, AsType b) => a -> b -> Type+pair first second = TypePair $ PairType (asType first) (asType second)++-- | Create a polymorphic type scheme with explicit type variables+-- Example: poly ["a", "b"] (var "a" --> var "b")+-- This represents a type forall a b. a -> b that can be instantiated with different types+poly :: AsType a => [String] -> a -> TypeScheme+poly vs t = TypeScheme (Name <$> vs) (asType t) M.empty++-- | Create a polymorphic type scheme with explicit type variables and constraints+-- Example: polyConstrained [("a", [Name "hydra.core.model.Eq"])] (var "a" --> var "a" --> boolean)+-- This represents a type forall a. (Eq a) => a -> a -> Boolean+polyConstrained :: AsType a => [(String, [Name])] -> a -> TypeScheme+polyConstrained vsWithConstraints t = TypeScheme vars (asType t) constraintMap+ where+ vars = Name . fst <$> vsWithConstraints+ constraintMap = M.fromList+ [(Name v, TypeVariableConstraints (S.fromList (TypeClassConstraintSimple <$> classes))) | (v, classes) <- vsWithConstraints, not (L.null classes)]++-- | Create a product type using nested pairs (deprecated: use pair directly)+-- Example: product [string, int32, boolean] creates pair string (pair int32 boolean)+product :: [Type] -> Type+product [] = unit+product [a] = a+product [a, b] = pair a b+product (a:rest) = pair a (product rest)++-- | Create a record type with the given fields+-- Example: record ["name">: string, "age">: int32]+record :: [FieldType] -> Type+record = TypeRecord++-- | Set type+-- Example: set string+set :: AsType a => a -> Type+set = TypeSet . asType++-- | String type+string :: Type+string = literal LiteralTypeString++-- | 16-bit unsigned integer type+uint16 :: Type+uint16 = integer IntegerTypeUint16++-- | 32-bit unsigned integer type+uint32 :: Type+uint32 = integer IntegerTypeUint32++-- | 64-bit unsigned integer type+uint64 :: Type+uint64 = integer IntegerTypeUint64++-- | 8-bit unsigned integer type+uint8 :: Type+uint8 = integer IntegerTypeUint8++-- | Create a union type with the given variants+-- Example: union ["success">: int32, "failure">: string]+-- This creates a tagged union type (sum type with named variants)+-- Similar to sum [int32, string] but with named branches+union :: [FieldType] -> Type+union = TypeUnion++-- | Unit type (empty record type)+unit :: Type+unit = TypeUnit++-- | Create a type variable with the given name (alias for 'variable')+-- Example: var "a"+var :: String -> Type+var = variable++-- | Create a type variable with the given name+-- Example: variable "a"+variable :: String -> Type+variable = TypeVariable . Name++-- | Void type (uninhabited / bottom type)+void :: Type+void = TypeVoid++-- | Create a wrapped type (newtype) with a provided base type+-- Example: wrap string+wrap :: AsType a => a -> Type+wrap = TypeWrap . asType
@@ -0,0 +1,39 @@+-- | Haskell implementations of hydra.core.lib.chars primitives.+-- All functions operate on Unicode code points (Int) rather than Char.++module Hydra.Core.Overlay.Haskell.Lib.Chars where++import qualified Data.Char as C+++-- | Check whether a character is alphabetic.+isAlpha :: Int -> Bool+isAlpha = C.isAlpha . C.chr++-- | Check whether a character is alphanumeric.+isAlphaNum :: Int -> Bool+isAlphaNum = C.isAlphaNum . C.chr++-- | Check whether a character is an ASCII decimal digit.+isDigit :: Int -> Bool+isDigit = C.isDigit . C.chr++-- | Check whether a character is lowercase.+isLower :: Int -> Bool+isLower = C.isLower . C.chr++-- | Check whether a character is a whitespace character.+isSpace :: Int -> Bool+isSpace = C.isSpace . C.chr++-- | Check whether a character is uppercase.+isUpper :: Int -> Bool+isUpper = C.isUpper . C.chr++-- | Convert a character to lowercase.+toLower :: Int -> Int+toLower = C.ord . C.toLower . C.chr++-- | Convert a character to uppercase.+toUpper :: Int -> Int+toUpper = C.ord . C.toUpper . C.chr
@@ -0,0 +1,49 @@+-- | Haskell implementations of hydra.core.lib.effects primitives++module Hydra.Core.Overlay.Haskell.Lib.Effects where++import qualified Control.Monad as CM+import qualified Data.Set as S+import Prelude hiding (foldl, map, pure)+import qualified Prelude as P+++-- | Applicative apply for effects.+apply :: IO (a -> b) -> IO a -> IO b+apply = (P.<*>)++-- | Sequence two effectful computations.+bind :: IO a -> (a -> IO b) -> IO b+bind = (P.>>=)++-- | Kleisli composition for effects.+compose :: (a -> IO b) -> (b -> IO c) -> a -> IO c+compose f g = \x -> f x P.>>= g++-- | Left-fold over a list with an effect-returning function. (Alias of foldl.)+foldList :: (a -> b -> IO a) -> a -> [b] -> IO a+foldList = CM.foldM++-- | Left-fold over a list with an effect-returning function.+foldl :: (a -> b -> IO a) -> a -> [b] -> IO a+foldl = CM.foldM++-- | Map a pure function over the result of an effect.+map :: (a -> b) -> IO a -> IO b+map = P.fmap++-- | Map an effect-returning function over a list.+mapList :: (a -> IO b) -> [a] -> IO [b]+mapList = CM.mapM++-- | Map an effect-returning function over an optional.+mapOptional :: (a -> IO b) -> Maybe a -> IO (Maybe b)+mapOptional = CM.mapM++-- | Map an effect-returning function over a set.+mapSet :: Ord b => (a -> IO b) -> S.Set a -> IO (S.Set b)+mapSet f s = P.fmap S.fromList (CM.mapM f (S.toList s))++-- | Lift a pure value into an effect.+pure :: a -> IO a+pure = P.pure
@@ -0,0 +1,78 @@+-- | Haskell implementations of hydra.core.lib.eithers primitives++module Hydra.Core.Overlay.Haskell.Lib.Eithers where++import Prelude hiding (either, map)+import qualified Control.Monad as CM+import qualified Data.Bifunctor as BF+import qualified Data.Either as E+import qualified Data.Set as S+++-- | Applicative apply for Either: combine a function under Either and an argument under Either.+apply :: Either a (b -> c) -> Either a b -> Either a c+apply ef ex = bind ef (\f -> map f ex)++-- | Map over both sides of an Either value.+bimap :: (a -> c) -> (b -> d) -> Either a b -> Either c d+bimap = BF.bimap++-- | Bind (flatMap) for Either: if Right, apply the function; if Left, return unchanged.+bind :: Either a b -> (b -> Either a c) -> Either a c+bind = (>>=)++-- | Kleisli composition for Either.+compose :: (a -> Either e b) -> (b -> Either e c) -> a -> Either e c+compose f g x = bind (f x) g++-- | Eliminate an Either value by applying one of two functions.+either :: (a -> c) -> (b -> c) -> Either a b -> c+either = E.either++-- | Left-fold over a list with an Either-returning function, short-circuiting on Left.+foldList :: (a -> b -> Either c a) -> a -> [b] -> Either c a+foldList = CM.foldM++-- | Check if an Either is a Left value.+isLeft :: Either a b -> Bool+isLeft = E.isLeft++-- | Check if an Either is a Right value.+isRight :: Either a b -> Bool+isRight = E.isRight++-- | Construct a Left (error/exceptional) Either value.+left :: a -> Either a b+left = Left++-- | Extract all Left values from a list of Eithers.+lefts :: [Either a b] -> [a]+lefts = E.lefts++-- | Map a function over the Right side of an Either (standard functor map).+map :: (a -> b) -> Either c a -> Either c b+map = fmap++-- | Map a function returning Either over a list, collecting results or short-circuiting on Left.+mapList :: (a -> Either c b) -> [a] -> Either c [b]+mapList = CM.mapM++-- | Map a function returning Either over an optional, or return Right Nothing if Nothing.+mapOptional :: (a -> Either c b) -> Maybe a -> Either c (Maybe b)+mapOptional = CM.mapM++-- | Map a function returning Either over a Set, collecting results or short-circuiting on Left.+mapSet :: Ord b => (a -> Either c b) -> S.Set a -> Either c (S.Set b)+mapSet f s = fmap S.fromList (CM.mapM f (S.toList s))++-- | Partition a list of Eithers into lefts and rights.+partition :: [Either a b] -> ([a], [b])+partition = E.partitionEithers++-- | Construct a Right (success/normal) Either value.+right :: b -> Either a b+right = Right++-- | Extract all Right values from a list of Eithers.+rights :: [Either a b] -> [b]+rights = E.rights
@@ -0,0 +1,12 @@+-- | Haskell implementations of hydra.core.lib.equality primitives.++module Hydra.Core.Overlay.Haskell.Lib.Equality where+++-- | Check if two values are equal.+equal :: Eq a => a -> a -> Bool+equal = (==)++-- | Check if two values are unequal.+notEqual :: Eq a => a -> a -> Bool+notEqual = (/=)
@@ -0,0 +1,138 @@+-- | Haskell implementations of hydra.core.lib.files primitives++module Hydra.Core.Overlay.Haskell.Lib.Files where++import qualified Control.Exception as E+import qualified Data.ByteString as BS+import qualified Hydra.Core.Error.File as FileError+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Time as Time+import qualified System.Directory as Dir+import qualified System.IO.Error as IOE+import qualified System.Posix.Files as Posix+import System.Posix.Types (EpochTime(..))+import Foreign.C.Types (CTime(..))+import Prelude hiding (appendFile, readFile, writeFile)+++appendFile :: File.FilePath -> BS.ByteString -> IO (Either FileError.FileError ())+appendFile path contents =+ withFileError path $ BS.appendFile (File.unFilePath path) contents++copy :: Bool -> File.FilePath -> File.FilePath -> IO (Either FileError.FileError ())+copy recursive source destination =+ withFileError source $+ if recursive+ then copyDirectoryRecursive (File.unFilePath source) (File.unFilePath destination)+ else Dir.copyFile (File.unFilePath source) (File.unFilePath destination)++createDirectory :: Bool -> File.FilePath -> IO (Either FileError.FileError ())+createDirectory recursive path =+ withFileError path $+ if recursive+ then Dir.createDirectoryIfMissing True (File.unFilePath path)+ else Dir.createDirectory (File.unFilePath path)++createSymlink :: File.FilePath -> File.FilePath -> IO (Either FileError.FileError ())+createSymlink target link =+ withFileError link $ Posix.createSymbolicLink (File.unFilePath target) (File.unFilePath link)++exists :: File.FilePath -> IO (Either FileError.FileError Bool)+exists path =+ withFileError path $ Dir.doesPathExist (File.unFilePath path)++listDirectory :: File.FilePath -> IO (Either FileError.FileError [File.FilePath])+listDirectory path =+ withFileError path $+ fmap (fmap File.FilePath) (Dir.listDirectory (File.unFilePath path))++readFile :: File.FilePath -> IO (Either FileError.FileError BS.ByteString)+readFile path =+ withFileError path $ BS.readFile (File.unFilePath path)++readSymlink :: File.FilePath -> IO (Either FileError.FileError File.FilePath)+readSymlink path =+ withFileError path $ do+ isLink <- Posix.isSymbolicLink <$> Posix.getSymbolicLinkStatus (File.unFilePath path)+ if isLink+ then File.FilePath <$> Posix.readSymbolicLink (File.unFilePath path)+ else E.throwIO (IOE.mkIOError IOE.illegalOperationErrorType "readSymlink" Nothing+ (Just (File.unFilePath path)))++removeDirectory :: Bool -> File.FilePath -> IO (Either FileError.FileError ())+removeDirectory recursive path =+ withFileError path $+ if recursive+ then Dir.removeDirectoryRecursive (File.unFilePath path)+ else Dir.removeDirectory (File.unFilePath path)++removeFile :: File.FilePath -> IO (Either FileError.FileError ())+removeFile path =+ withFileError path $ Dir.removeFile (File.unFilePath path)++rename :: File.FilePath -> File.FilePath -> IO (Either FileError.FileError ())+rename source destination =+ withFileError source $ Dir.renamePath (File.unFilePath source) (File.unFilePath destination)++status :: Bool -> File.FilePath -> IO (Either FileError.FileError File.FileStatus)+status followLinks path =+ withFileError path $ do+ let p = File.unFilePath path+ getStatus = if followLinks then Posix.getFileStatus else Posix.getSymbolicLinkStatus+ st <- getStatus p+ pure File.FileStatus {+ File.fileStatusFileType = posixFileType st,+ File.fileStatusSize = fromIntegral (Posix.fileSize st),+ File.fileStatusModificationTime = epochToTimespec (Posix.modificationTime st),+ File.fileStatusAccessTime = Just (epochToTimespec (Posix.accessTime st)),+ File.fileStatusStatusChangeTime = Just (epochToTimespec (Posix.statusChangeTime st))}++writeFile :: File.FilePath -> BS.ByteString -> IO (Either FileError.FileError ())+writeFile path contents =+ withFileError path $ BS.writeFile (File.unFilePath path) contents++-- Helpers (not primitives)++withFileError :: File.FilePath -> IO a -> IO (Either FileError.FileError a)+withFileError path action =+ E.catch (Right <$> action) $ \e ->+ pure $ Left $ classify path (e :: IOError)++classify :: File.FilePath -> IOError -> FileError.FileError+classify path e+ | IOE.isAlreadyExistsError e = FileError.FileErrorAlreadyExists path+ | IOE.isDoesNotExistError e = FileError.FileErrorNotFound path+ | IOE.isPermissionError e = FileError.FileErrorPermissionDenied path+ | IOE.isIllegalOperation e = FileError.FileErrorInvalidPath (IOE.ioeGetErrorString e)+ | otherwise = FileError.FileErrorOther (IOE.ioeGetErrorString e)++-- | Classify a POSIX file status's file type as a hydra.core.file.FileType.+posixFileType :: Posix.FileStatus -> File.FileType+posixFileType st+ | Posix.isSymbolicLink st = File.FileTypeLink+ | Posix.isDirectory st = File.FileTypeDirectory+ | Posix.isRegularFile st = File.FileTypeRegular+ | Posix.isBlockDevice st = File.FileTypeBlock+ | Posix.isCharacterDevice st = File.FileTypeCharacter+ | Posix.isNamedPipe st = File.FileTypeFifo+ | Posix.isSocket st = File.FileTypeSocket+ | otherwise = File.FileTypeRegular++-- | Convert a POSIX EpochTime (whole seconds since the Unix Epoch; sub-second resolution is not+-- exposed by the portable "unix" API) to a hydra.core.time.Timespec.+epochToTimespec :: EpochTime -> Time.Timespec+epochToTimespec (CTime secs) =+ Time.Timespec {+ Time.timespecSeconds = fromIntegral secs,+ Time.timespecNanoseconds = 0}++-- | Recursively copy a directory tree from source to destination.+copyDirectoryRecursive :: FilePath -> FilePath -> IO ()+copyDirectoryRecursive source destination = do+ isDir <- Dir.doesDirectoryExist source+ if isDir+ then do+ Dir.createDirectoryIfMissing True destination+ entries <- Dir.listDirectory source+ mapM_ (\name -> copyDirectoryRecursive (source ++ "/" ++ name) (destination ++ "/" ++ name)) entries+ else Dir.copyFile source destination
@@ -0,0 +1,26 @@+-- | Haskell implementations of hydra.core.lib.functions primitives.++module Hydra.Core.Overlay.Haskell.Lib.Functions where++import qualified Prelude as P+++-- | Eliminate a value of the uninhabited void type. Unreachable in any well-typed program.+absurd :: a -> b+absurd _ = P.error "hydra.core.lib.functions.absurd: void has no inhabitants"++-- | Compose two functions: compose g f x = g (f x).+compose :: (b -> c) -> (a -> b) -> a -> c+compose g f = \x -> g (f x)++-- | Return the first argument, ignoring the second.+const :: a -> b -> a+const x _ = x++-- | Swap the argument order of a binary function.+flip :: (a -> b -> c) -> b -> a -> c+flip f x y = f y x++-- | Return the argument unchanged.+identity :: a -> a+identity = P.id
@@ -0,0 +1,16 @@+-- | Haskell implementations of hydra.core.lib.hashing primitives++module Hydra.Core.Overlay.Haskell.Lib.Hashing where++import qualified Data.ByteString as BS+import qualified Data.ByteString.Lazy as BL+import qualified Data.Digest.Pure.SHA as SHA+++-- | Compute the SHA-256 digest of a sequence of bytes, returning the 32-byte digest.+sha256 :: BS.ByteString -> BS.ByteString+sha256 = BL.toStrict . SHA.bytestringDigest . SHA.sha256 . BL.fromStrict++-- | Compute the SHA-256 digest of a sequence of bytes as a 64-character lowercase hex string.+sha256Hex :: BS.ByteString -> String+sha256Hex = SHA.showDigest . SHA.sha256 . BL.fromStrict
@@ -0,0 +1,194 @@+-- | Haskell implementations of hydra.core.lib.lists primitives++module Hydra.Core.Overlay.Haskell.Lib.Lists where++import Prelude hiding (compose, head, init, last, map, tail, takeWhile)+import Hydra.Core.Util+import Hydra.Core.Model+import Hydra.Core.Graph+import qualified Hydra.Core.Overlay.Haskell.Dsl.Terms as Terms++import qualified Control.Monad as CM+import qualified Data.List as L+import qualified Data.Set as S+++-- | Apply a list of functions to a list of values (applicative style).+apply :: [a -> b] -> [a] -> [b]+apply = (<*>)++-- | Return the element at the given index, or Nothing if out of bounds. (Alias of maybeAt.)+at :: Int -> [a] -> Maybe a+at i l+ | i < 0 || i >= L.length l = Nothing+ | otherwise = Just (l !! i)++-- | Apply a function that returns lists to each element and flatten results.+bind :: [a] -> (a -> [b]) -> [b]+bind = (>>=)++-- | Compose two list-returning functions (Kleisli composition in the list monad).+compose :: (a -> [b]) -> (b -> [c]) -> a -> [c]+compose f g x = f x >>= g++-- | Concatenate a list of lists.+concat :: [[a]] -> [a]+concat = L.concat++-- | Concatenate two lists.+concat2 :: [a] -> [a] -> [a]+concat2 l1 l2 = l1 ++ l2++-- | Prepend a value to a list.+cons :: a -> [a] -> [a]+cons = (:)++-- | Remove duplicate elements from a list. (Alias of nub.)+distinct :: Eq a => [a] -> [a]+distinct = L.nub++-- | Drop the first n elements from a list.+drop :: Int -> [a] -> [a]+drop = L.drop++-- | Drop elements from the beginning of a list while predicate is true.+dropWhile :: (a -> Bool) -> [a] -> [a]+dropWhile = L.dropWhile++-- | Filter a list based on a predicate.+filter :: (a -> Bool) -> [a] -> [a]+filter = L.filter++-- | Find the first element matching a predicate.+find :: (a -> Bool) -> [a] -> Maybe a+find = L.find++-- | Left-fold a list in the list monad (a nondeterministic fold).+foldList :: (a -> b -> [a]) -> a -> [b] -> [a]+foldList = CM.foldM++-- | Fold a list from the left.+-- Strict left fold. Lazy foldl can pile up thunks for accumulator types+-- that are field-update records (e.g. PythonModuleMetadata in+-- Hydra.Python.Coder.extendMetaForTerm), causing pathological wallclock+-- in the Python coder's gatherMetadata pass. Use foldl' to evaluate+-- each accumulator step strictly.+foldl :: (b -> a -> b) -> b -> [a] -> b+foldl = L.foldl'++-- | Fold a list from the right.+foldr :: (a -> b -> b) -> b -> [a] -> b+foldr = L.foldr++-- | Group consecutive equal elements.+group :: Eq a => [a] -> [[a]]+group = L.group++-- | Return the first element, or Nothing if the list is empty. (Alias of maybeHead.)+head :: [a] -> Maybe a+head [] = Nothing+head (x:_) = Just x++-- | Return all elements except the last, or Nothing if the list is empty. (Alias of maybeInit.)+init :: [a] -> Maybe [a]+init [] = Nothing+init xs = Just (L.init xs)++-- | Intercalate a list of lists with a separator list between each. (Alias of intercalate.)+join :: [a] -> [[a]] -> [a]+join = L.intercalate++-- | Intersperse a value between elements of a list.+intersperse :: a -> [a] -> [a]+intersperse = L.intersperse++-- | Get the length of a list.+length :: [a] -> Int+length = L.length++-- | Map a function over a list.+map :: (a -> b) -> [a] -> [b]+map = fmap++-- | Traverse a list in the list monad.+mapList :: (a -> [b]) -> [a] -> [[b]]+mapList = CM.mapM++-- | Traverse an optional value in the list monad.+mapOptional :: (a -> [b]) -> Maybe a -> [Maybe b]+mapOptional = traverse++-- | Traverse a set in the list monad.+mapSet :: Ord b => (a -> [b]) -> S.Set a -> [S.Set b]+mapSet f s = fmap S.fromList (CM.mapM f (S.toList s))++-- | Return the last element, or Nothing if the list is empty. (Alias of maybeLast.)+last :: [a] -> Maybe a+last [] = Nothing+last xs = Just (L.last xs)++-- | Test whether an element is in a list. (Alias of elem.)+member :: Eq a => a -> [a] -> Bool+member = L.elem++-- | Check if a list is empty.+isEmpty :: [a] -> Bool+isEmpty = L.null++-- | Partition a list into elements that satisfy a predicate and elements that do not.+partition :: (a -> Bool) -> [a] -> ([a], [a])+partition = L.partition++-- | Create a list with n copies of a value.+replicate :: Int -> a -> [a]+replicate = L.replicate++-- | Reverse a list.+reverse :: [a] -> [a]+reverse = L.reverse++-- | Create a single-element list.+singleton :: a -> [a]+singleton e = [e]++-- | Sort a list.+sort :: Ord a => [a] -> [a]+sort = L.sort++-- | Sort a list based on a key function. (Alias of sortOn.)+sortBy :: Ord b => (a -> b) -> [a] -> [a]+sortBy = L.sortOn++-- | Split a list at the first element where predicate fails.+span :: (a -> Bool) -> [a] -> ([a], [a])+span = L.span++-- | Return all elements except the first, or Nothing if the list is empty. (Alias of maybeTail.)+tail :: [a] -> Maybe [a]+tail [] = Nothing+tail (_:xs) = Just xs++-- | Take the first n elements from a list.+take :: Int -> [a] -> [a]+take = L.take++-- | Take elements from the beginning of a list while a predicate holds.+takeWhile :: (a -> Bool) -> [a] -> [a]+takeWhile = L.takeWhile++-- | Transpose a list of lists.+transpose :: [[a]] -> [[a]]+transpose = L.transpose++-- | Decompose a list into its head and tail, returning Nothing if the list is empty.+uncons :: [a] -> Maybe (a, [a])+uncons [] = Nothing+uncons (x:xs) = Just (x, xs)++-- | Zip two lists into pairs.+zip :: [a] -> [b] -> [(a, b)]+zip = L.zip++-- | Zip two lists with a combining function.+zipWith :: (a -> b -> c) -> [a] -> [b] -> [c]+zipWith = L.zipWith
@@ -0,0 +1,308 @@+-- | Haskell implementations of hydra.core.lib.literals primitives++module Hydra.Core.Overlay.Haskell.Lib.Literals where++import Data.Int+import Data.Scientific (Scientific, toRealFloat, fromFloatDigits)+import Text.Read (readMaybe)+import qualified Data.ByteString as B+import qualified Data.ByteString.Base64 as B64+import qualified Data.Scientific as Sci+import qualified Data.Text as T+import qualified Data.Text.Encoding as TE++-- | Convert a bigint (Integer) to a decimal (Scientific).+bigintToDecimal :: Integer -> Scientific+bigintToDecimal n = Sci.scientific n 0++-- | Convert a bigint (Integer) to an int8.+bigintToInt8 :: Integer -> Int8+bigintToInt8 = fromIntegral++-- | Convert a bigint (Integer) to an int16.+bigintToInt16 :: Integer -> Int16+bigintToInt16 = fromIntegral++-- | Convert a bigint (Integer) to an int32. Result type is Int (not Int32) because+-- Hydra's Int32 term is represented natively as Int -- but Int is host-word-sized+-- (64-bit here), so narrow explicitly through the genuinely-32-bit Int32 type first+-- to get two's-complement wraparound, then widen back to Int.+bigintToInt32 :: Integer -> Int+bigintToInt32 = fromIntegral . (fromIntegral :: Integer -> Int32)++-- | Convert a bigint (Integer) to an int64.+bigintToInt64 :: Integer -> Int64+bigintToInt64 = fromIntegral++-- | Convert a bigint (Integer) to a uint8.+bigintToUint8 :: Integer -> Int16+bigintToUint8 = fromIntegral++-- | Convert a bigint (Integer) to a uint16.+bigintToUint16 :: Integer -> Int+bigintToUint16 = fromIntegral++-- | Convert a bigint (Integer) to a uint32.+bigintToUint32 :: Integer -> Int64+bigintToUint32 = fromIntegral++-- | Convert a bigint (Integer) to a uint64.+bigintToUint64 :: Integer -> Integer+bigintToUint64 = id++-- | Convert binary to a list of byte values (0-255).+binaryToBytes :: B.ByteString -> [Int]+binaryToBytes = fmap fromIntegral . B.unpack++-- | Convert a decimal (Scientific) to a bigint (Integer) using banker's rounding+-- (round half to even), matching Haskell's 'round' and the BigDecimal/BigInt behavior+-- in the other Hydra hosts.+decimalToBigint :: Scientific -> Integer+decimalToBigint = round++-- | Convert a decimal (Scientific) to a float32 (Float). May lose precision.+decimalToFloat32 :: Scientific -> Float+decimalToFloat32 = toRealFloat++-- | Convert a decimal (Scientific) to a float64 (Double). May lose precision.+decimalToFloat64 :: Scientific -> Double+decimalToFloat64 = toRealFloat++-- | Convert binary to string by base64 encoding.+binaryToBase64 :: B.ByteString -> String+binaryToBase64 = T.unpack . TE.decodeUtf8 . B64.encode++-- | Convert a float32 (Float) to a decimal (Scientific).+float32ToDecimal :: Float -> Scientific+float32ToDecimal = fromFloatDigits++-- | Convert a float32 (Float) to a float64 (Double).+-- Preserves IEEE special values (NaN, +/-Infinity); plain realToFrac+-- routes through Rational and collapses Inf to maxFinite (~3.4028e38).+float32ToFloat64 :: Float -> Double+float32ToFloat64 x+ | isNaN x = 0/0+ | isInfinite x = if x < 0 then -1/0 else 1/0+ | otherwise = realToFrac x++-- | Convert a float64 (Double) to a decimal (Scientific).+float64ToDecimal :: Double -> Scientific+float64ToDecimal = fromFloatDigits++-- | Convert a float64 (Double) to a float32 (Float). May lose precision.+-- IEEE special values are preserved; for finite values, realToFrac+-- (which converts via Rational) is used.+float64ToFloat32 :: Double -> Float+float64ToFloat32 x+ | isNaN x = 0/0+ | isInfinite x = if x < 0 then -1/0 else 1/0+ | otherwise = realToFrac x++-- | Convert an int8 to a bigint (Integer).+int8ToBigint :: Int8 -> Integer+int8ToBigint = fromIntegral++-- | Convert an int16 to a bigint (Integer).+int16ToBigint :: Int16 -> Integer+int16ToBigint = fromIntegral++-- | Convert an int32 to a bigint (Integer).+int32ToBigint :: Int -> Integer+int32ToBigint = fromIntegral++-- | Convert an int64 to a bigint (Integer).+int64ToBigint :: Int64 -> Integer+int64ToBigint = fromIntegral++-- | Parse a string to a bigint (Integer).+parseBigint :: String -> Maybe Integer+parseBigint s = readMaybe s :: Maybe Integer++-- | Parse a string to a boolean.+parseBoolean :: String -> Maybe Bool+parseBoolean s = if s == "true" then Just True+ else if s == "false" then Just False+ else Nothing++-- | Parse a string to a decimal (Scientific).+parseDecimal :: String -> Maybe Scientific+parseDecimal s = readMaybe s :: Maybe Scientific++-- | Parse a string to a float32 (Float).+parseFloat32 :: String -> Maybe Float+parseFloat32 s = readMaybe s :: Maybe Float++-- | Parse a string to a float64 (Double).+parseFloat64 :: String -> Maybe Double+parseFloat64 s = readMaybe s :: Maybe Double++-- | Parse a string to an int16 (-32768 to 32767).+parseInt16 :: String -> Maybe Int16+parseInt16 s = do+ n <- readMaybe s :: Maybe Integer+ if n >= -32768 && n <= 32767 then Just (fromIntegral n) else Nothing++-- | Parse a string to an int32.+parseInt32 :: String -> Maybe Int+parseInt32 s = readMaybe s :: Maybe Int++-- | Parse a string to an int64.+parseInt64 :: String -> Maybe Int64+parseInt64 s = readMaybe s :: Maybe Int64++-- | Parse a string to an int8 (-128 to 127).+parseInt8 :: String -> Maybe Int8+parseInt8 s = do+ n <- readMaybe s :: Maybe Integer+ if n >= -128 && n <= 127 then Just (fromIntegral n) else Nothing++-- | Parse a string literal.+parseString :: String -> Maybe String+parseString s = readMaybe s :: Maybe String++-- Note: Hydra uses wider signed types to represent unsigned values without overflow+-- Uint8 -> Int16, Uint16 -> Int, Uint32 -> Int64, Uint64 -> Integer+-- The parse functions parse as unsigned and validate the range++-- | Parse a string to a uint16 (0 to 65535).+parseUint16 :: String -> Maybe Int+parseUint16 s = do+ n <- readMaybe s :: Maybe Integer+ if n >= 0 && n <= 65535 then Just (fromIntegral n) else Nothing++-- | Parse a string to a uint32 (0 to 4294967295).+parseUint32 :: String -> Maybe Int64+parseUint32 s = do+ n <- readMaybe s :: Maybe Integer+ if n >= 0 && n <= 4294967295 then Just (fromIntegral n) else Nothing++-- | Parse a string to a uint64 (0 to 18446744073709551615).+parseUint64 :: String -> Maybe Integer+parseUint64 s = do+ n <- readMaybe s :: Maybe Integer+ if n >= 0 && n <= 18446744073709551615 then Just n else Nothing++-- | Parse a string to a uint8 (0 to 255).+parseUint8 :: String -> Maybe Int16+parseUint8 s = do+ n <- readMaybe s :: Maybe Integer+ if n >= 0 && n <= 255 then Just (fromIntegral n) else Nothing++-- | Convert a bigint (Integer) to string.+printBigint :: Integer -> String+printBigint = show++-- | Convert a boolean to string.+printBoolean :: Bool -> String+printBoolean b = case b of+ True -> "true"+ False -> "false"++-- | Convert a decimal (Scientific) to its representation-faithful string, per+-- docs/specification/json-format.md (Decimal formatting) and syntax.md (§2.6):+-- coefficient digits -- trailing zeros included -- are preserved exactly, and+-- zero prints per its scale ("0", "0.0", "0.00"). Scientific's own Show+-- instance normalizes away trailing zeros (e.g. 1.10 and 1.1 both show as+-- "1.1"), which violates this, so the digit string is built directly from+-- the coefficient and scale instead.+-- Layout follows ECMAScript Number::toString / RFC 8785: positional form+-- when the adjusted exponent a satisfies -6 <= a < 21, exponent form+-- otherwise (one digit before the point, lowercase e, always-signed+-- exponent, coefficient digits preserved).+printDecimal :: Scientific -> String+printDecimal x = sign ++ body+ where+ coeff = Sci.coefficient x+ scale = negate (Sci.base10Exponent x)+ sign = if coeff < 0 then "-" else ""+ digits = show (abs coeff)+ n = length digits+ -- Adjusted exponent: position of the leading significant digit.+ a = n - 1 - scale+ body+ | a >= (-6) && a < 21 = positional+ | otherwise = exponential+ -- Positional form: place the decimal point `scale` digits from the right,+ -- padding with zeros on either side as needed.+ positional+ | scale <= 0 = digits ++ replicate (negate scale) '0'+ | scale < n = let (intPart, fracPart) = splitAt (n - scale) digits in intPart ++ "." ++ fracPart+ | otherwise = "0." ++ replicate (scale - n) '0' ++ digits+ -- Exponent form: one digit before the point, remaining digits after,+ -- coefficient digits preserved (a trailing ".0" if there's only one digit).+ exponential = mantissa ++ "e" ++ (if a >= 0 then "+" else "") ++ show a+ where+ mantissa+ | n == 1 = digits ++ ".0"+ | otherwise = take 1 digits ++ "." ++ drop 1 digits++-- | Convert a float32 (Float) to string.+printFloat32 :: Float -> String+printFloat32 = show++-- | Convert a float64 (Double) to string.+printFloat64 :: Double -> String+printFloat64 = show++-- | Convert an int16 to string.+printInt16 :: Int16 -> String+printInt16 = show++-- | Convert an int32 to string.+printInt32 :: Int -> String+printInt32 = show++-- | Convert an int64 to string.+printInt64 :: Int64 -> String+printInt64 = show++-- | Convert an int8 to string.+printInt8 :: Int8 -> String+printInt8 = show++-- | Convert a string to a quoted string representation.+printString :: String -> String+printString = show++-- | Convert a uint16 to string.+printUint16 :: Int -> String+printUint16 = show++-- | Convert a uint32 to string.+printUint32 :: Int64 -> String+printUint32 = show++-- | Convert a uint64 to string.+printUint64 :: Integer -> String+printUint64 = show++-- | Convert a uint8 to string.+printUint8 :: Int16 -> String+printUint8 = show++-- | Convert string to binary by base64 decoding.+-- Returns an empty ByteString if decoding fails.+base64ToBinary :: String -> B.ByteString+base64ToBinary s = case B64.decode (TE.encodeUtf8 $ T.pack s) of+ Left _ -> B.empty+ Right bs -> bs++-- | Parse a string as a Scientific decimal. Errors on malformed input.+stringToDecimal :: String -> Scientific+stringToDecimal = read++-- | Convert a uint8 to a bigint (Integer).+uint8ToBigint :: Int16 -> Integer+uint8ToBigint = fromIntegral++-- | Convert a uint16 to a bigint (Integer).+uint16ToBigint :: Int -> Integer+uint16ToBigint = fromIntegral++-- | Convert a uint32 to a bigint (Integer).+uint32ToBigint :: Int64 -> Integer+uint32ToBigint = fromIntegral++-- | Convert a uint64 to a bigint (Integer).+uint64ToBigint :: Integer -> Integer+uint64ToBigint = id
@@ -0,0 +1,24 @@+-- | Haskell implementations of hydra.core.lib.logic (logic and control flow) primitives++module Hydra.Core.Overlay.Haskell.Lib.Logic where++import Hydra.Core.Model++import Data.Int+++-- | Compute the logical AND of two boolean values.+and :: Bool -> Bool -> Bool+and x y = x && y++-- | Compute a conditional expression.+ifElse :: Bool -> a -> a -> a+ifElse b x y = if b then x else y++-- | Compute the logical NOT of a boolean value.+not :: Bool -> Bool+not = Prelude.not++-- | Compute the logical OR of two boolean values.+or :: Bool -> Bool -> Bool+or x y = x || y
@@ -0,0 +1,98 @@+-- | Haskell implementations of hydra.core.lib.maps primitives++module Hydra.Core.Overlay.Haskell.Lib.Maps where++import qualified Data.Map as M+++-- | Alter a value at a key using a function.+alter :: Ord k => (Maybe v -> Maybe v) -> k -> M.Map k v -> M.Map k v+alter = M.alter++-- | Map a function over the keys and values of a map.+bimap :: (Ord k1, Ord k2) => (k1 -> k2) -> (v1 -> v2) -> M.Map k1 v1 -> M.Map k2 v2+bimap f g = M.fromList . fmap (\(k, v) -> (f k, g v)) . M.toList++-- | Remove a key from a map.+delete :: Ord k => k -> M.Map k v -> M.Map k v+delete = M.delete++-- | Compute the difference of two maps by key.+difference :: Ord k => M.Map k v -> M.Map k v -> M.Map k v+difference = M.difference++-- | Get the values of a map.+elems :: M.Map k v -> [v]+elems = M.elems++-- | Create an empty map.+empty :: M.Map k v+empty = M.empty++-- | Filter a map based on values.+filter :: Ord k => (v -> Bool) -> M.Map k v -> M.Map k v+filter = M.filter++-- | Filter a map based on key-value pairs.+filterWithKey :: Ord k => (k -> v -> Bool) -> M.Map k v -> M.Map k v+filterWithKey = M.filterWithKey++-- | Lookup a value with a default.+findWithDefault :: Ord k => v -> k -> M.Map k v -> v+findWithDefault = M.findWithDefault++-- | Create a map from a list of key-value pairs.+fromList :: Ord k => [(k, v)] -> M.Map k v+fromList = M.fromList++-- | Insert a key-value pair into a map.+insert :: Ord k => k -> v -> M.Map k v -> M.Map k v+insert = M.insert++-- | Compute the intersection of two maps by key (values from the first map).+intersection :: Ord k => M.Map k v -> M.Map k v -> M.Map k v+intersection = M.intersection++-- | Get the keys of a map.+keys :: M.Map k v -> [k]+keys = M.keys++-- | Lookup a value in a map.+lookup :: Ord k => k -> M.Map k v -> Maybe v+lookup = M.lookup++-- | Map a function over a map.+map :: (v1 -> v2) -> M.Map k v1 -> M.Map k v2+map = fmap++-- | Map a function over the keys of a map.+mapKeys :: (Ord k1, Ord k2) => (k1 -> k2) -> M.Map k1 v -> M.Map k2 v+mapKeys = M.mapKeys++-- | Check if a key is present in a map.+member :: Ord k => k -> M.Map k v -> Bool+member = M.member++-- | Check if a map is empty.+isEmpty :: M.Map k v -> Bool+isEmpty = M.null++-- | Create a map with a single key-value pair.+singleton :: k -> v -> M.Map k v+singleton = M.singleton++-- | Get the size of a map.+size :: M.Map k v -> Int+size = M.size++-- | Convert a map to a list of key-value pairs.+toList :: M.Map k v -> [(k, v)]+toList = M.toList++-- | Union two maps, with the first taking precedence.+union :: Ord k => M.Map k v -> M.Map k v -> M.Map k v+union = M.union++-- | Compute the left-biased union of a list of maps.+unions :: Ord k => [M.Map k v] -> M.Map k v+unions = M.unions
@@ -0,0 +1,507 @@+-- | Haskell implementations of hydra.core.lib.math primitives+{-# LANGUAGE RankNTypes #-}++module Hydra.Core.Overlay.Haskell.Lib.Math where++import Prelude (Num, Fractional, Ord, Integral, Enum, Bool, Double, Int, Integer, Float, Maybe(..), String, (.), ($), (+), (-), (*), (/), (==), (||))+import qualified Prelude+import qualified Data.Int as I+import qualified Hydra.Core.Model as Core+++-- | Return the absolute value.+abs :: Num a => a -> a+abs = Prelude.abs++-- | Return the arc cosine of x in radians.+acos :: Double -> Double+acos = Prelude.acos++-- | Return the inverse hyperbolic cosine of x.+acosh :: Double -> Double+acosh = Prelude.acosh++-- | Add two numbers.+add :: Num a => a -> a -> a+add x y = x + y++-- | Add two Float64 numbers.+addFloat64 :: Double -> Double -> Double+addFloat64 = add++-- | Return the arc sine of x in radians.+asin :: Double -> Double+asin = Prelude.asin++-- | Return the inverse hyperbolic sine of x.+asinh :: Double -> Double+asinh = Prelude.asinh++-- | Return the arc tangent of x in radians.+atan :: Double -> Double+atan = Prelude.atan++-- | Return the arc tangent of y/x in radians, using signs to determine quadrant.+atan2 :: Double -> Double -> Double+atan2 = Prelude.atan2++-- | Return the inverse hyperbolic tangent of x.+atanh :: Double -> Double+atanh = Prelude.atanh++-- | Return the ceiling of x as a float.+--+-- DIVERGENCE FROM HASKELL: Haskell's Prelude.ceiling returns an Integer, which+-- cannot represent NaN or Inf; GHC's behavior on those inputs is undefined and+-- produces nonsensical gigantic integers. Hydra returns a Float64 instead so+-- that NaN and ±Inf propagate naturally per IEEE 754, matching the conventions+-- of C (ceil), Java (Math.ceil), Go (math.Ceil), Rust (f64::ceil), and JavaScript+-- (Math.ceil). Users who need an Integer value must convert explicitly.+ceiling :: Double -> Double+ceiling x+ | Prelude.isNaN x Prelude.|| Prelude.isInfinite x = x+ | Prelude.otherwise = Prelude.fromIntegral (Prelude.ceiling x :: Integer)++-- | Return the cosine of x radians.+cos :: Double -> Double+cos = Prelude.cos++-- | Return the hyperbolic cosine of x.+cosh :: Double -> Double+cosh = Prelude.cosh++-- | Divide two numbers (native call contract; monomorphized at Float or Double by the+-- caller). IEEE 754 total division: GHC's Fractional (/) already produces the IEEE+-- sentinels (±Infinity, NaN) for both Float and Double, so no special-casing is needed+-- here (cf. add/sub/mul, which are also directly the Prelude class method).+divide :: Fractional a => a -> a -> a+divide x y = x / y++-- | Euler's number (e ≈ 2.71828).+e :: Double+e = Prelude.exp 1.0++-- | Check if an integer is even.+even :: Integral a => a -> Bool+even = Prelude.even++-- | Return e raised to the power x.+exp :: Double -> Double+exp = Prelude.exp++-- | Return the floor of x as a float.+--+-- DIVERGENCE FROM HASKELL: see the note on ceiling. Returns Float64 rather than+-- Integer so that NaN and ±Inf propagate naturally per IEEE 754.+floor :: Double -> Double+floor x+ | Prelude.isNaN x Prelude.|| Prelude.isInfinite x = x+ | Prelude.otherwise = Prelude.fromIntegral (Prelude.floor x :: Integer)++-- | Return the natural logarithm of x.+log :: Double -> Double+log = Prelude.log++-- | Return the logarithm of x to the given base.+logBase :: Double -> Double -> Double+logBase = Prelude.logBase++-- | Divide two integers using integer division, returning Nothing on division by zero.+div :: Int -> Int -> Maybe Int+div _ 0 = Nothing+div x y = Just (Prelude.div x y)++-- | Mathematical modulo, returning Nothing on division by zero.+mod :: Int -> Int -> Maybe Int+mod _ 0 = Nothing+mod x y = Just (Prelude.mod x y)++-- | Multiply two numbers.+mul :: Num a => a -> a -> a+mul x y = x * y++-- | Multiply two Float64 numbers.+mulFloat64 :: Double -> Double -> Double+mulFloat64 = mul++-- | Negate a number.+negate :: Num a => a -> a+negate = Prelude.negate++-- | Negate a Float64 number.+negateFloat64 :: Double -> Double+negateFloat64 = Prelude.negate++-- | Check if an integer is odd.+odd :: Integral a => a -> Bool+odd = Prelude.odd++-- | Pi (π ≈ 3.14159).+pi :: Double+pi = Prelude.pi++-- | Return x raised to the power y.+pow :: Double -> Double -> Double+pow = (Prelude.**)++-- | Generate a half-open range of values from start (inclusive) to end (exclusive).+range :: (Enum a, Ord a) => a -> a -> [a]+range start end = if start Prelude.>= end then [] else [start .. Prelude.pred end]++-- | Integer remainder, returning Nothing on division by zero.+rem :: Int -> Int -> Maybe Int+rem _ 0 = Nothing+rem x y = Just (Prelude.rem x y)++-- | Return x rounded to the nearest integer, as a float.+--+-- DIVERGENCE FROM HASKELL: see the note on ceiling. Returns Float64 rather than+-- Integer so that NaN and ±Inf propagate naturally per IEEE 754.+round :: Double -> Double+round x+ | Prelude.isNaN x Prelude.|| Prelude.isInfinite x = x+ | Prelude.otherwise = Prelude.fromIntegral (Prelude.round x :: Integer)++-- | Round a float32 to n significant digits.+-- Returns NaN/Inf inputs unchanged (no rounding is possible).+roundFloat32 :: Int -> Float -> Float+roundFloat32 n x+ | Prelude.isNaN x Prelude.|| Prelude.isInfinite x = x+ | x Prelude.== 0 = 0+ | Prelude.otherwise =+ let factor = 10 Prelude.^^ (n - 1 - Prelude.floor (Prelude.logBase 10 (Prelude.abs x)))+ in Prelude.fromIntegral (Prelude.round (x * factor) :: Integer) Prelude./ factor++-- | Round a float64 to n significant digits.+-- Returns NaN/Inf inputs unchanged (no rounding is possible).+roundFloat64 :: Int -> Double -> Double+roundFloat64 n x+ | Prelude.isNaN x Prelude.|| Prelude.isInfinite x = x+ | x Prelude.== 0 = 0+ | Prelude.otherwise =+ let factor = 10 Prelude.^^ (n - 1 - Prelude.floor (Prelude.logBase 10 (Prelude.abs x)))+ in Prelude.fromIntegral (Prelude.round (x * factor) :: Integer) Prelude./ factor++-- | Return the sign of a number (-1, 0, or 1).+signum :: Num a => a -> a+signum = Prelude.signum++-- | Return the sine of x radians.+sin :: Double -> Double+sin = Prelude.sin++-- | Return the hyperbolic sine of x.+sinh :: Double -> Double+sinh = Prelude.sinh++-- | Return the square root of x.+sqrt :: Double -> Double+sqrt = Prelude.sqrt++-- | Subtract two numbers.+sub :: Num a => a -> a -> a+sub x y = x - y++-- | Subtract two Float64 numbers.+subFloat64 :: Double -> Double -> Double+subFloat64 = sub+++-- | Return the tangent of x radians.+tan :: Double -> Double+tan = Prelude.tan++-- | Return the hyperbolic tangent of x.+tanh :: Double -> Double+tanh = Prelude.tanh++-- | Return x truncated (towards zero), as a float.+--+-- DIVERGENCE FROM HASKELL: see the note on ceiling. Returns Float64 rather than+-- Integer so that NaN and ±Inf propagate naturally per IEEE 754.+truncate :: Double -> Double+truncate x+ | Prelude.isNaN x Prelude.|| Prelude.isInfinite x = x+ | Prelude.otherwise = Prelude.fromIntegral (Prelude.truncate x :: Integer)++-- Constraint-polymorphic ('numeric') arithmetic over raw terms.+--+-- These implementations back the polymorphic add/sub/mul/negate primitives, which are+-- registered with identity (Term) coders (see Hydra.Core.Overlay.Haskell.Libraries) so that the+-- runtime numeric type is discovered by dispatching on the argument's literal variant. Each+-- variant delegates to Haskell's Num instance for the underlying representation type, then+-- (for int32/uint8/uint16/uint32/uint64, whose IntegerValue payload is an oversized container+-- rather than a matching fixed-width type — see Hydra.Core's IntegerValueInt32 :: Int,+-- IntegerValueUint32 :: I.Int64, etc.) explicitly re-narrows the result to the nominal bit+-- width. int8/int16/int64 use exactly-sized containers (I.Int8/I.Int16/I.Int64) and get+-- two's-complement wraparound for free from GHC's Num instance; bigint is unbounded by design.+-- Without the explicit narrowing, e.g. abs(minBound::int32) or (maxBound + maxBound :: uint8)+-- silently escape their nominal range instead of wrapping.+--+-- Type inference guarantees both operands of a binary op share one 'numeric' type, so the+-- dispatch keys on the first operand and requires the second to match; a mismatch or a+-- non-numeric literal is an internal invariant violation and fails loudly.++-- | Narrow a container-typed intermediate result back to the nominal signed bit width+-- (two's-complement wraparound: mask to 2^bits, then re-center into the signed range).+wrapSigned :: Prelude.Integer -> Prelude.Integer -> Prelude.Integer+wrapSigned bits raw =+ let m = (2 :: Prelude.Integer) Prelude.^ bits+ halfM = m `Prelude.div` 2+ masked = raw `Prelude.mod` m+ in if masked Prelude.>= halfM then masked Prelude.- m else masked++-- | Narrow a container-typed intermediate result back to the nominal unsigned bit width.+wrapUnsigned :: Prelude.Integer -> Prelude.Integer -> Prelude.Integer+wrapUnsigned bits raw = raw `Prelude.mod` ((2 :: Prelude.Integer) Prelude.^ bits)++wrapInt32 :: Int -> Int+wrapInt32 raw = Prelude.fromIntegral (wrapSigned 32 (Prelude.toInteger raw))++wrapUint8 :: I.Int16 -> I.Int16+wrapUint8 raw = Prelude.fromIntegral (wrapUnsigned 8 (Prelude.toInteger raw))++wrapUint16 :: Int -> Int+wrapUint16 raw = Prelude.fromIntegral (wrapUnsigned 16 (Prelude.toInteger raw))++wrapUint32 :: I.Int64 -> I.Int64+wrapUint32 raw = Prelude.fromIntegral (wrapUnsigned 32 (Prelude.toInteger raw))++wrapUint64 :: Prelude.Integer -> Prelude.Integer+wrapUint64 = wrapUnsigned 64++-- | Apply a Num-polymorphic binary operation to two numeric terms, dispatching on the runtime+-- integer/float variant.+numericBinary :: String -> (forall a. Num a => a -> a -> a) -> Core.Term -> Core.Term -> Core.Term+numericBinary opName op x y = case (numericLiteral opName x, numericLiteral opName y) of+ (Core.LiteralInteger ix, Core.LiteralInteger iy) ->+ Core.TermLiteral $ Core.LiteralInteger $ integerBinary opName op ix iy+ (Core.LiteralFloat fx, Core.LiteralFloat fy) ->+ Core.TermLiteral $ Core.LiteralFloat $ floatBinary opName op fx fy+ _ -> Prelude.error $ "hydra.core.lib.math." Prelude.++ opName Prelude.++ ": operands are not the same numeric kind"++-- | Apply a Num-polymorphic unary operation to a numeric term.+numericUnary :: String -> (forall a. Num a => a -> a) -> Core.Term -> Core.Term+numericUnary opName op x = case numericLiteral opName x of+ Core.LiteralInteger ix -> Core.TermLiteral $ Core.LiteralInteger $ integerUnary op ix+ Core.LiteralFloat fx -> Core.TermLiteral $ Core.LiteralFloat $ floatUnary op fx+ _ -> Prelude.error $ "hydra.core.lib.math." Prelude.++ opName Prelude.++ ": operand is not numeric"++-- | Extract the literal from a term, failing loudly on any non-literal term.+numericLiteral :: String -> Core.Term -> Core.Literal+numericLiteral opName term = case term of+ Core.TermLiteral lit -> lit+ _ -> Prelude.error $ "hydra.core.lib.math." Prelude.++ opName Prelude.++ ": expected a literal term"++integerBinary :: String -> (forall a. Num a => a -> a -> a) -> Core.IntegerValue -> Core.IntegerValue -> Core.IntegerValue+integerBinary opName op ix iy = case (ix, iy) of+ (Core.IntegerValueBigint a, Core.IntegerValueBigint b) -> Core.IntegerValueBigint (op a b)+ (Core.IntegerValueInt8 a, Core.IntegerValueInt8 b) -> Core.IntegerValueInt8 (op a b)+ (Core.IntegerValueInt16 a, Core.IntegerValueInt16 b) -> Core.IntegerValueInt16 (op a b)+ (Core.IntegerValueInt32 a, Core.IntegerValueInt32 b) -> Core.IntegerValueInt32 (wrapInt32 (op a b))+ (Core.IntegerValueInt64 a, Core.IntegerValueInt64 b) -> Core.IntegerValueInt64 (op a b)+ (Core.IntegerValueUint8 a, Core.IntegerValueUint8 b) -> Core.IntegerValueUint8 (wrapUint8 (op a b))+ (Core.IntegerValueUint16 a, Core.IntegerValueUint16 b) -> Core.IntegerValueUint16 (wrapUint16 (op a b))+ (Core.IntegerValueUint32 a, Core.IntegerValueUint32 b) -> Core.IntegerValueUint32 (wrapUint32 (op a b))+ (Core.IntegerValueUint64 a, Core.IntegerValueUint64 b) -> Core.IntegerValueUint64 (wrapUint64 (op a b))+ _ -> Prelude.error $ "hydra.core.lib.math." Prelude.++ opName Prelude.++ ": integer operands differ in precision"++integerUnary :: (forall a. Num a => a -> a) -> Core.IntegerValue -> Core.IntegerValue+integerUnary op iv = case iv of+ Core.IntegerValueBigint a -> Core.IntegerValueBigint (op a)+ Core.IntegerValueInt8 a -> Core.IntegerValueInt8 (op a)+ Core.IntegerValueInt16 a -> Core.IntegerValueInt16 (op a)+ Core.IntegerValueInt32 a -> Core.IntegerValueInt32 (wrapInt32 (op a))+ Core.IntegerValueInt64 a -> Core.IntegerValueInt64 (op a)+ Core.IntegerValueUint8 a -> Core.IntegerValueUint8 (wrapUint8 (op a))+ Core.IntegerValueUint16 a -> Core.IntegerValueUint16 (wrapUint16 (op a))+ Core.IntegerValueUint32 a -> Core.IntegerValueUint32 (wrapUint32 (op a))+ Core.IntegerValueUint64 a -> Core.IntegerValueUint64 (wrapUint64 (op a))++floatBinary :: String -> (forall a. Num a => a -> a -> a) -> Core.FloatValue -> Core.FloatValue -> Core.FloatValue+floatBinary opName op fx fy = case (fx, fy) of+ (Core.FloatValueFloat32 a, Core.FloatValueFloat32 b) -> Core.FloatValueFloat32 (op a b)+ (Core.FloatValueFloat64 a, Core.FloatValueFloat64 b) -> Core.FloatValueFloat64 (op a b)+ _ -> Prelude.error $ "hydra.core.lib.math." Prelude.++ opName Prelude.++ ": float operands differ in precision"++floatUnary :: (forall a. Num a => a -> a) -> Core.FloatValue -> Core.FloatValue+floatUnary op fv = case fv of+ Core.FloatValueFloat32 a -> Core.FloatValueFloat32 (op a)+ Core.FloatValueFloat64 a -> Core.FloatValueFloat64 (op a)++-- | Polymorphic addition over numeric terms.+addTerm :: Core.Term -> Core.Term -> Core.Term+addTerm = numericBinary "add" (+)++-- | Polymorphic subtraction over numeric terms.+subTerm :: Core.Term -> Core.Term -> Core.Term+subTerm = numericBinary "sub" (-)++-- | Polymorphic multiplication over numeric terms.+mulTerm :: Core.Term -> Core.Term -> Core.Term+mulTerm = numericBinary "mul" (*)++-- | Polymorphic negation over numeric terms.+negateTerm :: Core.Term -> Core.Term+negateTerm = numericUnary "negate" Prelude.negate++-- | Polymorphic absolute value over numeric terms.+absTerm :: Core.Term -> Core.Term+absTerm = numericUnary "abs" Prelude.abs++-- | Polymorphic sign function over numeric terms.+signumTerm :: Core.Term -> Core.Term+signumTerm = numericUnary "signum" Prelude.signum++-- Constraint-polymorphic ('fractional') division over raw terms.+--+-- This implementation backs the polymorphic divide primitive, which is registered with an+-- identity (Term) coder (see Hydra.Core.Overlay.Haskell.Libraries) so that the runtime float type+-- is discovered by dispatching on the argument's literal variant. Both arms delegate to+-- GHC's Fractional (/) for the underlying representation type (Float or Double), which+-- already produces the IEEE 754 sentinels (±Infinity, NaN) for free.+--+-- Type inference guarantees both operands share one 'fractional' type, so the dispatch keys+-- on the first operand and requires the second to match; a mismatch or a non-float literal+-- is an internal invariant violation and fails loudly (same discipline as numericBinary).++-- | Apply divide to two float terms, dispatching on the runtime float32/float64 variant.+divideTerm :: Core.Term -> Core.Term -> Core.Term+divideTerm x y = case (fractionalLiteral x, fractionalLiteral y) of+ (Core.LiteralFloat fx, Core.LiteralFloat fy) ->+ Core.TermLiteral $ Core.LiteralFloat $ floatDivide fx fy+ _ -> Prelude.error "hydra.core.lib.math.divide: operands are not the same fractional kind"++-- | Extract the literal from a term, failing loudly on any non-literal term.+fractionalLiteral :: Core.Term -> Core.Literal+fractionalLiteral term = case term of+ Core.TermLiteral lit -> lit+ _ -> Prelude.error "hydra.core.lib.math.divide: expected a literal term"++floatDivide :: Core.FloatValue -> Core.FloatValue -> Core.FloatValue+floatDivide fx fy = case (fx, fy) of+ (Core.FloatValueFloat32 a, Core.FloatValueFloat32 b) -> Core.FloatValueFloat32 (divide a b)+ (Core.FloatValueFloat64 a, Core.FloatValueFloat64 b) -> Core.FloatValueFloat64 (divide a b)+ _ -> Prelude.error "hydra.core.lib.math.divide: float operands differ in precision"++-- Constraint-polymorphic ('integral') division/modulus/remainder/parity over raw terms.+--+-- These implementations back the polymorphic div/mod/rem/even primitives, registered with+-- identity (Term) coders (see Hydra.Core.Overlay.Haskell.Libraries) so the runtime integer type+-- is discovered by dispatching on the argument's literal variant. div/mod are floor-based+-- (sign follows the divisor); rem is truncated (sign follows the dividend) — this matches+-- GHC's own div/mod vs quot/rem split. Both dispatch families guard the zero-divisor case+-- (returning Nothing) BEFORE calling the underlying Integral operation.+--+-- The (minBound, -1) boundary needs an explicit guard on div only: GHC's div/quot for+-- Int8/Int16/Int32/Int64 throw "arithmetic overflow" there (the quotient +maxBound+1 is not+-- representable), while mod/rem do NOT trap (Haskell special-cases them to 0 at that point,+-- since no overflow occurs in the remainder). Guarding div wraps the quotient to minBound,+-- matching the two's-complement contract (design round4 finding E1). Bigint/uint has no such+-- boundary (unbounded / no negative domain).++-- | Apply floor division to two integer terms, dispatching on the runtime integer variant.+divTerm :: Core.Term -> Core.Term -> Maybe Core.Term+divTerm x y = case (integralLiteral "div" x, integralLiteral "div" y) of+ (Core.IntegerValueBigint a, Core.IntegerValueBigint b) ->+ integralResult $ Core.IntegerValueBigint Prelude.<$> maybeDivBounded Prelude.Nothing a b+ (Core.IntegerValueInt8 a, Core.IntegerValueInt8 b) ->+ integralResult $ Core.IntegerValueInt8 Prelude.<$> maybeDivBounded (Prelude.Just (Prelude.minBound, -1)) a b+ (Core.IntegerValueInt16 a, Core.IntegerValueInt16 b) ->+ integralResult $ Core.IntegerValueInt16 Prelude.<$> maybeDivBounded (Prelude.Just (Prelude.minBound, -1)) a b+ (Core.IntegerValueInt32 a, Core.IntegerValueInt32 b) ->+ integralResult $ Core.IntegerValueInt32 Prelude.<$> maybeDivBounded (Prelude.Just (-2147483648, -1)) a b+ (Core.IntegerValueInt64 a, Core.IntegerValueInt64 b) ->+ integralResult $ Core.IntegerValueInt64 Prelude.<$> maybeDivBounded (Prelude.Just (Prelude.minBound, -1)) a b+ (Core.IntegerValueUint8 a, Core.IntegerValueUint8 b) ->+ integralResult $ Core.IntegerValueUint8 Prelude.<$> maybeDivBounded Prelude.Nothing a b+ (Core.IntegerValueUint16 a, Core.IntegerValueUint16 b) ->+ integralResult $ Core.IntegerValueUint16 Prelude.<$> maybeDivBounded Prelude.Nothing a b+ (Core.IntegerValueUint32 a, Core.IntegerValueUint32 b) ->+ integralResult $ Core.IntegerValueUint32 Prelude.<$> maybeDivBounded Prelude.Nothing a b+ (Core.IntegerValueUint64 a, Core.IntegerValueUint64 b) ->+ integralResult $ Core.IntegerValueUint64 Prelude.<$> maybeDivBounded Prelude.Nothing a b+ _ -> Prelude.error "hydra.core.lib.math.div: integer operands differ in precision"++-- | div, guarded against the zero-divisor case and (when a boundary pair is given) the+-- minBound/-1 overflow case, which is wrapped rather than left to trap.+maybeDivBounded :: (Integral a) => Maybe (a, a) -> a -> a -> Maybe a+maybeDivBounded boundary x y+ | y Prelude.== 0 = Prelude.Nothing+ | Prelude.Just (mn, negOne) <- boundary, x Prelude.== mn, y Prelude.== negOne = Prelude.Just mn+ | Prelude.otherwise = Prelude.Just (Prelude.div x y)++-- | Apply floor modulus to two integer terms, dispatching on the runtime integer variant.+modTerm :: Core.Term -> Core.Term -> Maybe Core.Term+modTerm x y = case (integralLiteral "mod" x, integralLiteral "mod" y) of+ (Core.IntegerValueBigint a, Core.IntegerValueBigint b) -> integralResult $ Core.IntegerValueBigint Prelude.<$> maybeMod a b+ (Core.IntegerValueInt8 a, Core.IntegerValueInt8 b) -> integralResult $ Core.IntegerValueInt8 Prelude.<$> maybeMod a b+ (Core.IntegerValueInt16 a, Core.IntegerValueInt16 b) -> integralResult $ Core.IntegerValueInt16 Prelude.<$> maybeMod a b+ (Core.IntegerValueInt32 a, Core.IntegerValueInt32 b) -> integralResult $ Core.IntegerValueInt32 Prelude.<$> maybeMod a b+ (Core.IntegerValueInt64 a, Core.IntegerValueInt64 b) -> integralResult $ Core.IntegerValueInt64 Prelude.<$> maybeMod a b+ (Core.IntegerValueUint8 a, Core.IntegerValueUint8 b) -> integralResult $ Core.IntegerValueUint8 Prelude.<$> maybeMod a b+ (Core.IntegerValueUint16 a, Core.IntegerValueUint16 b) -> integralResult $ Core.IntegerValueUint16 Prelude.<$> maybeMod a b+ (Core.IntegerValueUint32 a, Core.IntegerValueUint32 b) -> integralResult $ Core.IntegerValueUint32 Prelude.<$> maybeMod a b+ (Core.IntegerValueUint64 a, Core.IntegerValueUint64 b) -> integralResult $ Core.IntegerValueUint64 Prelude.<$> maybeMod a b+ _ -> Prelude.error "hydra.core.lib.math.mod: integer operands differ in precision"++maybeMod :: (Integral a) => a -> a -> Maybe a+maybeMod x y+ | y Prelude.== 0 = Prelude.Nothing+ | Prelude.otherwise = Prelude.Just (Prelude.mod x y)++-- | Apply truncated remainder to two integer terms, dispatching on the runtime integer variant.+remTerm :: Core.Term -> Core.Term -> Maybe Core.Term+remTerm x y = case (integralLiteral "rem" x, integralLiteral "rem" y) of+ (Core.IntegerValueBigint a, Core.IntegerValueBigint b) -> integralResult $ Core.IntegerValueBigint Prelude.<$> maybeRem a b+ (Core.IntegerValueInt8 a, Core.IntegerValueInt8 b) -> integralResult $ Core.IntegerValueInt8 Prelude.<$> maybeRem a b+ (Core.IntegerValueInt16 a, Core.IntegerValueInt16 b) -> integralResult $ Core.IntegerValueInt16 Prelude.<$> maybeRem a b+ (Core.IntegerValueInt32 a, Core.IntegerValueInt32 b) -> integralResult $ Core.IntegerValueInt32 Prelude.<$> maybeRem a b+ (Core.IntegerValueInt64 a, Core.IntegerValueInt64 b) -> integralResult $ Core.IntegerValueInt64 Prelude.<$> maybeRem a b+ (Core.IntegerValueUint8 a, Core.IntegerValueUint8 b) -> integralResult $ Core.IntegerValueUint8 Prelude.<$> maybeRem a b+ (Core.IntegerValueUint16 a, Core.IntegerValueUint16 b) -> integralResult $ Core.IntegerValueUint16 Prelude.<$> maybeRem a b+ (Core.IntegerValueUint32 a, Core.IntegerValueUint32 b) -> integralResult $ Core.IntegerValueUint32 Prelude.<$> maybeRem a b+ (Core.IntegerValueUint64 a, Core.IntegerValueUint64 b) -> integralResult $ Core.IntegerValueUint64 Prelude.<$> maybeRem a b+ _ -> Prelude.error "hydra.core.lib.math.rem: integer operands differ in precision"++maybeRem :: (Integral a) => a -> a -> Maybe a+maybeRem x y+ | y Prelude.== 0 = Prelude.Nothing+ | Prelude.otherwise = Prelude.Just (Prelude.rem x y)++-- | Apply a parity test to an integer term, dispatching on the runtime integer variant.+evenTerm :: Core.Term -> Bool+evenTerm x = case integralLiteral "even" x of+ Core.IntegerValueBigint a -> Prelude.even a+ Core.IntegerValueInt8 a -> Prelude.even a+ Core.IntegerValueInt16 a -> Prelude.even a+ Core.IntegerValueInt32 a -> Prelude.even a+ Core.IntegerValueInt64 a -> Prelude.even a+ Core.IntegerValueUint8 a -> Prelude.even a+ Core.IntegerValueUint16 a -> Prelude.even a+ Core.IntegerValueUint32 a -> Prelude.even a+ Core.IntegerValueUint64 a -> Prelude.even a++-- | Apply a parity test (odd) to an integer term, dispatching on the runtime integer variant.+oddTerm :: Core.Term -> Bool+oddTerm x = case integralLiteral "odd" x of+ Core.IntegerValueBigint a -> Prelude.odd a+ Core.IntegerValueInt8 a -> Prelude.odd a+ Core.IntegerValueInt16 a -> Prelude.odd a+ Core.IntegerValueInt32 a -> Prelude.odd a+ Core.IntegerValueInt64 a -> Prelude.odd a+ Core.IntegerValueUint8 a -> Prelude.odd a+ Core.IntegerValueUint16 a -> Prelude.odd a+ Core.IntegerValueUint32 a -> Prelude.odd a+ Core.IntegerValueUint64 a -> Prelude.odd a++-- | Extract the integer value from a term, failing loudly on any non-integer literal term.+integralLiteral :: String -> Core.Term -> Core.IntegerValue+integralLiteral opName term = case term of+ Core.TermLiteral (Core.LiteralInteger iv) -> iv+ _ -> Prelude.error $ "hydra.core.lib.math." Prelude.++ opName Prelude.++ ": expected an integer literal term"++-- | Wrap a Maybe integer result as a Term-encoded optional integer literal.+integralResult :: Maybe Core.IntegerValue -> Maybe Core.Term+integralResult Prelude.Nothing = Prelude.Nothing+integralResult (Prelude.Just iv) = Prelude.Just (Core.TermLiteral (Core.LiteralInteger iv))
@@ -0,0 +1,69 @@+-- | Haskell implementations of hydra.core.lib.optionals primitives++module Hydra.Core.Overlay.Haskell.Lib.Optionals where++import Prelude hiding (map)+import qualified Control.Monad as CM+import qualified Data.Maybe as Y+import qualified Data.Set as S+++-- | Apply a function to an argument (applicative).+apply :: Y.Maybe (a -> b) -> Y.Maybe a -> Y.Maybe b+apply = (<*>)++-- | Chain operations on optional values, handling absent cases automatically.+bind :: Y.Maybe a -> (a -> Y.Maybe b) -> Y.Maybe b+bind = (>>=)++-- | Compose two optional-returning functions (Kleisli composition).+compose :: (a -> Y.Maybe b) -> (b -> Y.Maybe c) -> (a -> Y.Maybe c)+compose f g = \x -> f x >>= g++-- | Left-fold over a list with an optional-returning function, short-circuiting on none.+foldList :: (a -> b -> Y.Maybe a) -> a -> [b] -> Y.Maybe a+foldList = CM.foldM++-- | Lift a value into the optional type.+given :: a -> Y.Maybe a+given = Just++-- | Filter out absent values from a list.+givens :: [Y.Maybe a] -> [a]+givens = Y.catMaybes++-- | Check if a value is present.+isGiven :: Y.Maybe a -> Bool+isGiven = Y.isJust++-- | Check if a value is absent.+isNone :: Y.Maybe a -> Bool+isNone = Y.isNothing++-- | Map a function over an optional value.+map :: (a -> b) -> Y.Maybe a -> Y.Maybe b+map = fmap++-- | Traverse a list in the optional monad.+mapList :: (a -> Y.Maybe b) -> [a] -> Y.Maybe [b]+mapList = CM.mapM++-- | Map a function over a list and collect present results.+mapOptional :: (a -> Y.Maybe b) -> [a] -> [b]+mapOptional = Y.mapMaybe++-- | Traverse a set in the optional monad.+mapSet :: Ord b => (a -> Y.Maybe b) -> S.Set a -> Y.Maybe (S.Set b)+mapSet f s = fmap S.fromList (CM.mapM f (S.toList s))++-- | Handle an optional value with the absent-case value as the first argument.+match :: Y.Maybe a -> b -> (a -> b) -> b+match m n j = Y.maybe n j m++-- | Convert an optional value to a list: a present value becomes [x], an absent value becomes [].+toList :: Y.Maybe a -> [a]+toList = Y.maybeToList++-- | Get a value from an optional value, or return a default value.+withDefault :: a -> Y.Maybe a -> a+withDefault = Y.fromMaybe
@@ -0,0 +1,37 @@+-- | Haskell implementations of hydra.core.lib.ordering primitives.++module Hydra.Core.Overlay.Haskell.Lib.Ordering where++import Hydra.Core.Util+++-- | Compare two values and return a Comparison.+compare :: Ord a => a -> a -> Comparison+compare x y+ | x < y = ComparisonLessThan+ | x > y = ComparisonGreaterThan+ | otherwise = ComparisonEqualTo++-- | Check if first value is greater than second.+gt :: Ord a => a -> a -> Bool+gt = (>)++-- | Check if first value is greater than or equal to second.+gte :: Ord a => a -> a -> Bool+gte = (>=)++-- | Check if first value is less than second.+lt :: Ord a => a -> a -> Bool+lt = (<)++-- | Check if first value is less than or equal to second.+lte :: Ord a => a -> a -> Bool+lte = (<=)++-- | Return the maximum of two values.+max :: Ord a => a -> a -> a+max = Prelude.max++-- | Return the minimum of two values.+min :: Ord a => a -> a -> a+min = Prelude.min
@@ -0,0 +1,22 @@+-- | Haskell implementations of hydra.core.lib.pairs primitives++module Hydra.Core.Overlay.Haskell.Lib.Pairs where++import qualified Data.Bifunctor as BF+++-- | Map over both elements of a pair.+bimap :: (a -> c) -> (b -> d) -> (a, b) -> (c, d)+bimap = BF.bimap++-- | Get the first element of a pair.+first :: (a, b) -> a+first (x, _) = x++-- | Construct a pair from two values.+pair :: a -> b -> (a, b)+pair x y = (x, y)++-- | Get the second element of a pair.+second :: (a, b) -> b+second (_, y) = y
@@ -0,0 +1,75 @@+-- | Haskell implementations of hydra.core.lib.regex primitives.+--+-- Patterns are Hydra-defined and translingual (docs/specification/regex.md): each primitive first+-- runs the pattern through hydra.core.parse.regex, then renders the resulting AST to POSIX ERE syntax via+-- hydra.core.print.posix.regex (Haskell's Text.Regex.TDFA is POSIX ERE), and only then hands the rendered+-- pattern to the native engine. An ill-formed pattern (one that hydra.core.parse.regex rejects) is treated+-- as "no match" — the same portable-failure convention as an empty match, so no primitive here raises+-- an error for a malformed pattern; see issue #603.++module Hydra.Core.Overlay.Haskell.Lib.Regex where++import qualified Text.Regex.TDFA as R++import qualified Hydra.Core.Parse.Regex as ParseRegex+import qualified Hydra.Core.Print.Posix.Regex as PrintPosixRegex+++-- | Translate a Hydra regex pattern to POSIX ERE syntax via parse.regex |> print.posix.regex. Nothing+-- if the pattern does not parse (ill-formed).+toNative :: String -> Maybe String+toNative pattern = PrintPosixRegex.printRegex <$> ParseRegex.parseRegex pattern++-- | Find the first substring matching a regex pattern.+find :: String -> String -> Maybe String+find pattern input = case toNative pattern of+ Nothing -> Nothing+ Just native -> case (input R.=~ native :: (String, String, String)) of+ (_, match, _)+ | null match -> Nothing+ | otherwise -> Just match++-- | Find all non-overlapping substrings matching a regex pattern.+findAll :: String -> String -> [String]+findAll pattern input = case toNative pattern of+ Nothing -> []+ Just native -> R.getAllTextMatches (input R.=~ native :: R.AllTextMatches [] String)++-- | Check whether an entire string matches a regex pattern.+matches :: String -> String -> Bool+matches pattern input = case toNative pattern of+ Nothing -> False+ Just native -> input R.=~ ("^(" ++ native ++ ")$" :: String) :: Bool++-- | Replace the first occurrence of a regex pattern with a replacement string.+replace :: String -> String -> String -> String+replace pattern replacement input = case toNative pattern of+ Nothing -> input+ Just native -> case (input R.=~ native :: (String, String, String)) of+ (before, match, after)+ | null match -> input+ | otherwise -> before ++ replacement ++ after++-- | Replace all non-overlapping occurrences of a regex pattern with a replacement string.+replaceAll :: String -> String -> String -> String+replaceAll pattern replacement input = case toNative pattern of+ Nothing -> input+ Just native -> go input+ where+ go "" = ""+ go s = case (s R.=~ native :: (String, String, String)) of+ (before, match, after)+ | null match -> s+ | otherwise -> before ++ replacement ++ go after++-- | Split a string by a regex pattern.+split :: String -> String -> [String]+split pattern input = case toNative pattern of+ Nothing -> [input]+ Just native -> go input+ where+ go "" = [""]+ go s = case (s R.=~ native :: (String, String, String)) of+ (before, match, after)+ | null match -> [s]+ | otherwise -> before : go after
@@ -0,0 +1,69 @@+-- | Haskell implementations of hydra.core.lib.sets primitives++module Hydra.Core.Overlay.Haskell.Lib.Sets where++import Prelude hiding (filter)+import qualified Data.Set as S+++-- | Delete an element from a set.+delete :: Ord x => x -> S.Set x -> S.Set x+delete = S.delete++-- | Compute the difference of two sets.+difference :: Ord x => S.Set x -> S.Set x -> S.Set x+difference = S.difference++-- | Create an empty set.+empty :: S.Set x+empty = S.empty++-- | Filter a set by a predicate.+filter :: Ord x => (x -> Bool) -> S.Set x -> S.Set x+filter = S.filter++-- | Create a set from a list.+fromList :: Ord x => [x] -> S.Set x+fromList = S.fromList++-- | Insert an element into a set.+insert :: Ord x => x -> S.Set x -> S.Set x+insert = S.insert++-- | Compute the intersection of two sets.+intersection :: Ord x => S.Set x -> S.Set x -> S.Set x+intersection = S.intersection++-- | Map a function over a set.+-- Note: the presence of a 'map' function does not imply that sets are a functor in Hydra+map :: Ord y => (x -> y) -> S.Set x -> S.Set y+map f = S.fromList . fmap f . S.toList++-- | Check if an element is in a set.+member :: Ord x => x -> S.Set x -> Bool+member = S.member++-- | Check if a set is empty.+isEmpty :: S.Set x -> Bool+isEmpty = S.null++-- | Create a singleton set.+-- Consider renaming this to Sets.pure, or creating an alias+singleton :: x -> S.Set x+singleton = S.singleton++-- | Get the size of a set.+size :: S.Set x -> Int+size = S.size++-- | Convert a set to a list.+toList :: Ord x => S.Set x -> [x]+toList = S.toList++-- | Compute the union of two sets.+union :: Ord x => S.Set x -> S.Set x -> S.Set x+union = S.union++-- | Compute the union of multiple sets.+unions :: Ord x => [S.Set x] -> S.Set x+unions = S.unions
@@ -0,0 +1,55 @@+-- | Haskell implementations of hydra.core.lib.strings primitives++module Hydra.Core.Overlay.Haskell.Lib.Strings where++import Prelude hiding (concat, length)+import qualified Data.Char as C+import qualified Data.List as L+import qualified Data.List.Split as LS+++-- | Get the Unicode code point of the character at a specific index, returning Nothing if out of bounds.+charAt :: Int -> String -> Maybe Int+charAt i s+ | i < 0 || i >= L.length s = Nothing+ | otherwise = Just (C.ord (s !! i))++-- | Concatenate a list of strings into a single string.+concat :: [String] -> String+concat = L.concat++-- | Concatenate two strings.+concat2 :: String -> String -> String+concat2 s1 s2 = s1 ++ s2++-- | Convert a list of Unicode code points to a string.+fromList :: [Int] -> String+fromList = fmap C.chr++-- | Join a list of strings with a separator between each element.+join :: String -> [String] -> String+join = L.intercalate++-- | Return the length of a string.+length :: String -> Int+length = L.length++-- | Check whether a string is empty.+isEmpty :: String -> Bool+isEmpty = L.null++-- | Split a string on a delimiter string.+splitOn :: String -> String -> [String]+splitOn = LS.splitOn++-- | Convert a string to a list of Unicode code points.+toList :: String -> [Int]+toList = fmap C.ord++-- | Convert a string to lowercase.+toLower :: String -> String+toLower = fmap C.toLower++-- | Convert a string to uppercase.+toUpper :: String -> String+toUpper = fmap C.toUpper
@@ -0,0 +1,116 @@+-- | Haskell implementations of hydra.core.lib.system primitives++module Hydra.Core.Overlay.Haskell.Lib.System where++import qualified Control.Exception as E+import qualified Data.ByteString as BS+import qualified Data.Map as M+import qualified Data.Maybe as Y+import qualified Hydra.Core.Error.System as SystemError+import qualified Hydra.Core.File as File+import qualified Hydra.Core.System as System+import qualified Hydra.Core.Time as Time+import Data.Time.Clock.POSIX (getPOSIXTime)+import System.Exit (ExitCode(..), exitWith)+import qualified System.Directory as Dir+import qualified System.Environment as Env+import qualified System.IO as SIO+import qualified System.IO.Error as IOE+import qualified System.Process as P+++-- | Run a program to completion and capture its result.+execute :: System.Command -> IO (Either SystemError.SystemError System.ProcessResult)+execute command =+ let program = File.unFilePath (System.commandProgram command)+ args = System.commandArguments command+ cwd = fmap File.unFilePath (System.commandWorkingDirectory command)+ env = fmap toEnvList (System.commandEnvironment command)+ proc0 = (P.proc program args) {+ P.cwd = cwd,+ P.env = env,+ P.std_out = P.CreatePipe,+ P.std_err = P.CreatePipe}+ in E.catch (runProcess proc0) (pure . Left . classify (System.commandProgram command))++-- | Terminate the current process with a status code.+exit :: System.StatusCode -> IO ()+exit code =+ let n = System.unStatusCode code+ in exitWith (if n == 0 then ExitSuccess else ExitFailure (fromIntegral n))++-- | Get the full set of environment variables.+getEnvironment :: IO (M.Map System.EnvironmentVariable String)+getEnvironment = do+ pairs <- Env.getEnvironment+ pure $ M.fromList [(System.EnvironmentVariable k, v) | (k, v) <- pairs]++-- | Look up a single environment variable by name.+getEnvironmentVariable :: System.EnvironmentVariable -> IO (Maybe String)+getEnvironmentVariable name =+ Env.lookupEnv (System.unEnvironmentVariable name)++-- | Get the current wall-clock time.+getTime :: IO Time.Timespec+getTime = do+ t <- getPOSIXTime+ let picos = floor (toRational t * 1000000000000) :: Integer+ (secs, subPicos) = picos `divMod` 1000000000000+ nanos = subPicos `div` 1000+ pure Time.Timespec {+ Time.timespecSeconds = fromInteger secs,+ Time.timespecNanoseconds = fromInteger nanos}++-- | Get the current working directory.+getWorkingDirectory :: IO (Either SystemError.SystemError File.FilePath)+getWorkingDirectory =+ E.catch (Right . File.FilePath <$> Dir.getCurrentDirectory)+ (\e -> pure $ Left $ SystemError.SystemErrorOther (IOE.ioeGetErrorString (e :: IOError)))++-- | Read the complete contents of standard input as raw bytes.+readStdin :: IO (Either SystemError.SystemError BS.ByteString)+readStdin = withStdioError BS.hGetContents SIO.stdin++-- | Write raw bytes to standard error.+writeStderr :: BS.ByteString -> IO (Either SystemError.SystemError ())+writeStderr = withStdioError' BS.hPut SIO.stderr++-- | Write raw bytes to standard output.+writeStdout :: BS.ByteString -> IO (Either SystemError.SystemError ())+writeStdout = withStdioError' BS.hPut SIO.stdout++-- Helpers (not primitives)++withStdioError :: (SIO.Handle -> IO a) -> SIO.Handle -> IO (Either SystemError.SystemError a)+withStdioError action handle =+ E.catch (Right <$> action handle)+ (\e -> pure $ Left $ SystemError.SystemErrorOther (IOE.ioeGetErrorString (e :: IOError)))++withStdioError' :: (SIO.Handle -> a -> IO ()) -> SIO.Handle -> a -> IO (Either SystemError.SystemError ())+withStdioError' action handle x = withStdioError (`action` x) handle++-- | Convert the environment map to the association list System.Process expects.+toEnvList :: M.Map System.EnvironmentVariable String -> [(String, String)]+toEnvList m = [(System.unEnvironmentVariable k, v) | (k, v) <- M.toList m]++-- | Run a prepared process, capturing stdout/stderr as bytes and the exit code.+runProcess :: P.CreateProcess -> IO (Either SystemError.SystemError System.ProcessResult)+runProcess cp = do+ (_, mout, merr, ph) <- P.createProcess cp+ out <- Y.maybe (pure BS.empty) BS.hGetContents mout+ err <- Y.maybe (pure BS.empty) BS.hGetContents merr+ ec <- P.waitForProcess ph+ let code = case ec of+ ExitSuccess -> 0+ ExitFailure n -> fromIntegral n+ pure $ Right System.ProcessResult {+ System.processResultExitCode = System.StatusCode code,+ System.processResultStdout = out,+ System.processResultStderr = err}++-- | Classify a launch IOError into a SystemError.+classify :: File.FilePath -> IOError -> SystemError.SystemError+classify program e+ | IOE.isDoesNotExistError e = SystemError.SystemErrorCommandNotFound program+ | IOE.isPermissionError e = SystemError.SystemErrorPermissionDenied program+ | otherwise = SystemError.SystemErrorOther (IOE.ioeGetErrorString e)
@@ -0,0 +1,20 @@+-- | Haskell implementations of hydra.core.lib.text primitives++module Hydra.Core.Overlay.Haskell.Lib.Text where++import qualified Data.ByteString as BS+import qualified Data.Text as T+import qualified Data.Text.Encoding as TE+import qualified Data.Text.Encoding.Error as TEE+++-- | Decode a sequence of bytes as UTF-8 text, returning Left with a host-provided+-- message if the bytes are not valid UTF-8.+decodeUtf8 :: BS.ByteString -> Either String String+decodeUtf8 bytes = case TE.decodeUtf8' bytes of+ Left err -> Left (show (err :: TEE.UnicodeException))+ Right t -> Right (T.unpack t)++-- | Encode text as a sequence of UTF-8 bytes. Total: every string is valid Unicode.+encodeUtf8 :: String -> BS.ByteString+encodeUtf8 = TE.encodeUtf8 . T.pack
@@ -0,0 +1,703 @@++-- | Implementations of the Hydra standard libraries in Haskell+module Hydra.Core.Overlay.Haskell.Libraries (+ module Hydra.Core.Overlay.Haskell.Libraries,+) where++import Hydra.Kernel+import Hydra.Core.Overlay.Haskell.Dsl.Prims as Prims+import qualified Hydra.Core.Overlay.Haskell.Dsl.Terms as Terms+import qualified Hydra.Core.Overlay.Haskell.Dsl.Types as Types++import qualified Hydra.Core.Overlay.Haskell.Lib.Chars as Chars+import qualified Hydra.Core.Overlay.Haskell.Lib.Eithers as Eithers+import qualified Hydra.Core.Overlay.Haskell.Lib.Functions as Functions+import qualified Hydra.Core.Overlay.Haskell.Lib.Hashing as Hashing+import qualified Hydra.Core.Overlay.Haskell.Lib.Lists as Lists+import qualified Hydra.Core.Overlay.Haskell.Lib.Literals as Literals+import qualified Hydra.Core.Overlay.Haskell.Lib.Logic as Logic+import qualified Hydra.Core.Overlay.Haskell.Lib.Maps as Maps+import qualified Hydra.Core.Overlay.Haskell.Lib.Math as Math+import qualified Hydra.Core.Overlay.Haskell.Lib.Optionals as Optionals+import qualified Hydra.Core.Overlay.Haskell.Lib.Pairs as Pairs+import qualified Hydra.Core.Overlay.Haskell.Lib.Regex as Regex+import qualified Hydra.Core.Overlay.Haskell.Lib.Sets as Sets+import qualified Hydra.Core.Overlay.Haskell.Lib.Strings as Strings+import qualified Hydra.Core.Overlay.Haskell.Lib.Text as Text+import qualified Hydra.Core.Lib.Chars as DefChars+import qualified Hydra.Core.Lib.Effects as DefEffects+import qualified Hydra.Core.Lib.Eithers as DefEithers+import qualified Hydra.Core.Lib.Equality as DefEquality+import qualified Hydra.Core.Lib.Files as DefFiles+import qualified Hydra.Core.Lib.Functions as DefFunctions+import qualified Hydra.Core.Lib.Hashing as DefHashing+import qualified Hydra.Core.Lib.Lists as DefLists+import qualified Hydra.Core.Lib.Literals as DefLiterals+import qualified Hydra.Core.Lib.Logic as DefLogic+import qualified Hydra.Core.Lib.Maps as DefMaps+import qualified Hydra.Core.Lib.Math as DefMath+import qualified Hydra.Core.Lib.Optionals as DefOptionals+import qualified Hydra.Core.Lib.Ordering as DefOrdering+import qualified Hydra.Core.Lib.Pairs as DefPairs+import qualified Hydra.Core.Lib.Regex as DefRegex+import qualified Hydra.Core.Lib.Sets as DefSets+import qualified Hydra.Core.Lib.Strings as DefStrings+import qualified Hydra.Core.Lib.System as DefSystem+import qualified Hydra.Core.Lib.Text as DefText++import qualified Data.List as L+import qualified Data.Map as M+import qualified Data.Scientific as Sci+import qualified Data.Set as S+++-- Term coders for type variables (used in primitive implementations)+a_, b_, c_, d_, k_, k1_, k2_, s_, v_, v1_, v2_, w_, x_, y_, z_ :: TermCoder Term+a_ = variable "a"+b_ = variable "b"+c_ = variable "c"+d_ = variable "d"+k_ = variable "k"+k1_ = variable "k1"+k2_ = variable "k2"+s_ = variable "s"+v_ = variable "v"+v1_ = variable "v1"+v2_ = variable "v2"+w_ = variable "w"+x_ = variable "x"+y_ = variable "y"+z_ = variable "z"++-- | A TermCoder for function types which uses beta reduction to bridge term-level+-- functions to native functions. This allows higher-order primitives like map,+-- filter, foldl, etc. to use native implementations rather than eval-level ones.+-- Used by the DYNAMIC higher-order primitives (those that must inspect a reduced+-- per-element application result), pending their migration to term-level+-- defaultImplementations under issue #446.+fun :: TermCoder x -> TermCoder y -> TermCoder (x -> y)+fun = Prims.functionWithReduce (\cx g t -> reduceTerm cx g True t)++-- | A graph-free TermCoder for function types (issue #446): the bridged native function builds an+-- unreduced @apply funTerm argTerm@ term and lets the outer reducer fold it, rather than calling+-- the reducer here. Used by the STATIC higher-order primitives — those whose result shape is fixed+-- by the (already-reduced) data argument's spine, so they never inspect a reduced per-element+-- application. This is the form that requires no InferenceContext/Graph, enabling the carrier drop.+funT :: TermCoder x -> TermCoder y -> TermCoder (x -> y)+funT = Prims.functionDeferred++hydraLibChars :: Library+hydraLibChars = standardLibrary [+ prim1 DefChars.isAlpha Chars.isAlpha int32 boolean,+ prim1 DefChars.isAlphaNum Chars.isAlphaNum int32 boolean,+ prim1 DefChars.isDigit Chars.isDigit int32 boolean,+ prim1 DefChars.isLower Chars.isLower int32 boolean,+ prim1 DefChars.isSpace Chars.isSpace int32 boolean,+ prim1 DefChars.isUpper Chars.isUpper int32 boolean,+ prim1 DefChars.toLower Chars.toLower int32 int32,+ prim1 DefChars.toUpper Chars.toUpper int32 int32]++hydraLibEffects :: Library+hydraLibEffects = standardLibrary [+ unsupportedEffectPrimitive DefEffects.apply,+ unsupportedEffectPrimitive DefEffects.bind,+ unsupportedEffectPrimitive DefEffects.compose,+ unsupportedEffectPrimitive DefEffects.foldList,+ unsupportedEffectPrimitive DefEffects.map,+ unsupportedEffectPrimitive DefEffects.mapList,+ unsupportedEffectPrimitive DefEffects.mapOptional,+ unsupportedEffectPrimitive DefEffects.mapSet,+ unsupportedEffectPrimitive DefEffects.pure]++hydraLibFiles :: Library+hydraLibFiles = standardLibrary [+ unsupportedEffectPrimitive DefFiles.appendFile,+ unsupportedEffectPrimitive DefFiles.copy,+ unsupportedEffectPrimitive DefFiles.createDirectory,+ unsupportedEffectPrimitive DefFiles.createSymlink,+ unsupportedEffectPrimitive DefFiles.exists,+ unsupportedEffectPrimitive DefFiles.listDirectory,+ unsupportedEffectPrimitive DefFiles.readFile,+ unsupportedEffectPrimitive DefFiles.readSymlink,+ unsupportedEffectPrimitive DefFiles.removeDirectory,+ unsupportedEffectPrimitive DefFiles.removeFile,+ unsupportedEffectPrimitive DefFiles.rename,+ unsupportedEffectPrimitive DefFiles.status,+ unsupportedEffectPrimitive DefFiles.writeFile]++hydraLibEithers :: Library+hydraLibEithers = standardLibrary [+ prim2 DefEithers.apply Eithers.apply (Prims.either_ x_ (funT y_ z_)) (Prims.either_ x_ y_) (Prims.either_ x_ z_),+ prim3 DefEithers.bimap Eithers.bimap (funT x_ z_) (funT y_ w_) (Prims.either_ x_ y_) (Prims.either_ z_ w_),+ prim2 DefEithers.bind Eithers.bind (Prims.either_ x_ y_) (fun y_ (Prims.either_ x_ z_)) (Prims.either_ x_ z_),+ prim3 DefEithers.compose Eithers.compose (fun x_ (Prims.either_ w_ y_)) (fun y_ (Prims.either_ w_ z_)) x_ (Prims.either_ w_ z_),+ prim3 DefEithers.either Eithers.either (funT x_ z_) (funT y_ z_) (Prims.either_ x_ y_) z_,+ prim3 DefEithers.foldList Eithers.foldList (fun x_ (fun y_ (Prims.either_ z_ x_))) x_ (list y_) (Prims.either_ z_ x_),+ prim3 DefEithers.foldList Eithers.foldList (fun x_ (fun y_ (Prims.either_ z_ x_))) x_ (list y_) (Prims.either_ z_ x_),+ prim1 DefEithers.isLeft Eithers.isLeft (Prims.either_ x_ y_) boolean,+ prim1 DefEithers.isRight Eithers.isRight (Prims.either_ x_ y_) boolean,+ prim1 DefEithers.left Eithers.left x_ (Prims.either_ x_ y_),+ prim1 DefEithers.lefts Eithers.lefts (list $ Prims.either_ x_ y_) (list x_),+ prim2 DefEithers.map Eithers.map (funT x_ y_) (Prims.either_ z_ x_) (Prims.either_ z_ y_),+ prim2 DefEithers.mapList Eithers.mapList (fun x_ (Prims.either_ z_ y_)) (list x_) (Prims.either_ z_ (list y_)),+ prim2 DefEithers.mapOptional Eithers.mapOptional (fun x_ (Prims.either_ z_ y_)) (optional x_) (Prims.either_ z_ (optional y_)),+ prim2 DefEithers.mapSet Eithers.mapSet (fun x_ (Prims.either_ z_ y_)) (set x_) (Prims.either_ z_ (set y_)),+ prim1 DefEithers.partition Eithers.partition (list $ Prims.either_ x_ y_) (pair (list x_) (list y_)),+ prim1 DefEithers.partition Eithers.partition (list $ Prims.either_ x_ y_) (pair (list x_) (list y_)),+ prim1 DefEithers.right Eithers.right y_ (Prims.either_ x_ y_),+ prim1 DefEithers.rights Eithers.rights (list $ Prims.either_ x_ y_) (list y_)]++-- hydra.core.lib.equality.equal / hydra.core.lib.ordering.compare (+gt/gte/lt/lte/max/min) are+-- registered below at Term (x_ is the identity TermCoder), so termEqual/termCompare+-- special-case Literal.Decimal for scale-aware comparison per docs/specification/+-- ordering-and-equality.md, instead of using the generic Equality.equal/Ordering.compare+-- (which stay polymorphic Eq/Ord-constrained -- they're also called directly, at+-- non-Term types, by Haskell-generated-Haskell code elsewhere in the kernel, so they+-- must not be narrowed to Term).+--+-- Kernel-type DSL constructors (Hydra.Core.Dsl.Model / Hydra.Core.Overlay.Haskell.Dsl.Meta.Terms)+-- build hydra.core.model.Term/Literal values via the generic, reflective TermInject/Injection+-- encoding rather than the native Term/Literal ADT constructors directly -- e.g. a+-- decimal literal built via the DSL is+-- TermInject(Injection{"hydra.core.model.Term", Field{"literal",+-- TermInject(Injection{"hydra.core.model.Literal", Field{"decimal", <native TermLiteral+-- (LiteralDecimal sci)>}})}}).+-- No reduction/normalization step collapses this to the native shape before a primitive+-- runs (confirmed: Reduction.hs only beta-reduces/deannotates), so decimalPayload below+-- unwraps nested injections to find it.+decimalPayload :: Term -> Maybe Sci.Scientific+decimalPayload (TermLiteral (LiteralDecimal a)) = Just a+decimalPayload (TermInject (Injection _ (Field _ t))) = decimalPayload t+decimalPayload _ = Nothing++-- | Scale-aware comparison of two decimal payloads.+compareDecimals :: Sci.Scientific -> Sci.Scientific -> Ordering+compareDecimals a b+ | a < b = LT+ | a > b = GT+ -- Equal value; scale is -base10Exponent, so smaller scale is the larger+ -- (less negative) exponent.+ | ea > eb = LT+ | ea < eb = GT+ | otherwise = EQ+ where+ ea = Sci.base10Exponent a+ eb = Sci.base10Exponent b++-- | Extract a float payload as a Double, unwrapping the same DSL-injection shape+-- decimalPayload handles. Both Float32 and Float64 widen to Double for comparison,+-- matching the other hosts' float overlay comparators.+floatPayload :: Term -> Maybe Double+floatPayload (TermLiteral (LiteralFloat (FloatValueFloat32 f))) = Just (realToFrac f)+floatPayload (TermLiteral (LiteralFloat (FloatValueFloat64 d))) = Just d+floatPayload (TermInject (Injection _ (Field _ t))) = floatPayload t+floatPayload _ = Nothing++-- | IEEE 754 extended totalOrder comparison (docs/specification/ordering-and-equality.md):+-- NaN is greatest and equal to itself; -0.0 < +0.0. Native Haskell compare/== on+-- Double/Float disagree on both (NaN is unordered; -0.0 == 0.0).+compareFloats :: Double -> Double -> Ordering+compareFloats a b+ | aNaN || bNaN = if aNaN && bNaN then EQ else if aNaN then GT else LT+ | a < b = LT+ | a > b = GT+ | a == 0 && b == 0 = compare (isNegativeZero b) (isNegativeZero a)+ | otherwise = EQ+ where+ aNaN = isNaN a+ bNaN = isNaN b++-- | Structural comparison of two terms, per docs/specification/ordering-and-equality.md:+-- records compare field-by-field in declaration order, unions by declared-variant order+-- then payload (the derived Ord on Term/Literal/etc. already implements this via+-- constructor declaration order -- see Hydra.Core.Model), decimals by numeric value then scale.+--+-- This is a full recursive walk (NOT a check of the top level only): decimalPayload above+-- only recognizes a decimal at the term's own top level (or one Injection layer above it,+-- for DSL-constructed literals) -- a decimal nested inside a Map/List/Set/Record/etc. is+-- invisible to it, so termCompareOrdering must recurse through every container-shaped Term+-- constructor and apply the decimal special-case at each leaf, falling back to the derived+-- Ord only for genuinely decimal-free subtrees (an optimization: once neither side contains+-- a decimal, derived Ord already agrees with structural comparison, since Scientific's Eq/Ord+-- is the only actual divergence point from the spec).+termCompareOrdering :: Term -> Term -> Ordering+termCompareOrdering x y+ | Just a <- decimalPayload x, Just b <- decimalPayload y = compareDecimals a b+ | Just a <- floatPayload x, Just b <- floatPayload y = compareFloats a b+ | otherwise = case (x, y) of+ (TermAnnotated (AnnotatedTerm bx ax), TermAnnotated (AnnotatedTerm by ay)) ->+ termCompareOrdering bx by <> termCompareOrdering ax ay+ (TermApplication (Application fx ax), TermApplication (Application fy ay)) ->+ termCompareOrdering fx fy <> termCompareOrdering ax ay+ (TermCases (CaseStatement tnx dx csx), TermCases (CaseStatement tny dy csy)) ->+ compare tnx tny <> compareMaybeTerm dx dy <> compareCaseAlternatives csx csy+ (TermEither ex, TermEither ey) -> case (ex, ey) of+ (Left lx, Left ly) -> termCompareOrdering lx ly+ (Right rx, Right ry) -> termCompareOrdering rx ry+ (Left _, Right _) -> LT+ (Right _, Left _) -> GT+ (TermInject (Injection tnx (Field fnx fvx)), TermInject (Injection tny (Field fny fvy))) ->+ compare tnx tny <> compare fnx fny <> termCompareOrdering fvx fvy+ (TermLambda (Lambda px dx bx), TermLambda (Lambda py dy by)) ->+ compare px py <> compare dx dy <> termCompareOrdering bx by+ (TermLet (Let bsx bx), TermLet (Let bsy by)) ->+ compareBindings bsx bsy <> termCompareOrdering bx by+ (TermList xs, TermList ys) -> compareTermLists xs ys+ (TermLiteral lx, TermLiteral ly) -> compare lx ly+ (TermMap mx, TermMap my) -> compareTermPairLists (M.toAscList mx) (M.toAscList my)+ (TermOptional mx, TermOptional my) -> case (mx, my) of+ (Nothing, Nothing) -> EQ+ (Nothing, Just _) -> LT+ (Just _, Nothing) -> GT+ (Just tx, Just ty) -> termCompareOrdering tx ty+ (TermPair (x1, x2), TermPair (y1, y2)) -> termCompareOrdering x1 y1 <> termCompareOrdering x2 y2+ (TermProject px, TermProject py) -> compare px py+ (TermRecord (Record tnx fsx), TermRecord (Record tny fsy)) ->+ compare tnx tny <> compareFields fsx fsy+ (TermSet sx, TermSet sy) -> compareTermLists (S.toAscList sx) (S.toAscList sy)+ (TermTypeApplication (TypeApplicationTerm bx tx), TermTypeApplication (TypeApplicationTerm by ty)) ->+ termCompareOrdering bx by <> compare tx ty+ (TermTypeLambda (TypeLambda px bx), TermTypeLambda (TypeLambda py by)) ->+ compare px py <> termCompareOrdering bx by+ (TermUnwrap nx, TermUnwrap ny) -> compare nx ny+ (TermVariable nx, TermVariable ny) -> compare nx ny+ -- Different variants, or a variant with no decimal-bearing substructure (TermUnit, or+ -- a mismatched-variant pair): the derived Ord already agrees with the spec's+ -- declared-variant-order-then-payload rule (constructor declaration order in+ -- Hydra.Core.Model mirrors the DSL, and the payload itself was checked above for the+ -- same-variant cases that can carry a Term).+ _ -> compare x y+ where+ compareMaybeTerm Nothing Nothing = EQ+ compareMaybeTerm Nothing (Just _) = LT+ compareMaybeTerm (Just _) Nothing = GT+ compareMaybeTerm (Just a) (Just b) = termCompareOrdering a b+ compareTermLists [] [] = EQ+ compareTermLists [] (_:_) = LT+ compareTermLists (_:_) [] = GT+ compareTermLists (a:as) (b:bs) = termCompareOrdering a b <> compareTermLists as bs+ compareTermPairLists [] [] = EQ+ compareTermPairLists [] (_:_) = LT+ compareTermPairLists (_:_) [] = GT+ compareTermPairLists ((ka,va):as) ((kb,vb):bs) =+ termCompareOrdering ka kb <> termCompareOrdering va vb <> compareTermPairLists as bs+ compareFields [] [] = EQ+ compareFields [] (_:_) = LT+ compareFields (_:_) [] = GT+ compareFields (Field nax tax : as) (Field nbx tbx : bs) =+ compare nax nbx <> termCompareOrdering tax tbx <> compareFields as bs+ compareCaseAlternatives [] [] = EQ+ compareCaseAlternatives [] (_:_) = LT+ compareCaseAlternatives (_:_) [] = GT+ compareCaseAlternatives (CaseAlternative nax hax : as) (CaseAlternative nbx hbx : bs) =+ compare nax nbx <> termCompareOrdering hax hbx <> compareCaseAlternatives as bs+ compareBindings [] [] = EQ+ compareBindings [] (_:_) = LT+ compareBindings (_:_) [] = GT+ compareBindings (Binding nax tax tsax : as) (Binding nbx tbx tsbx : bs) =+ compare nax nbx <> termCompareOrdering tax tbx <> compare tsax tsbx <> compareBindings as bs++termEqual :: Term -> Term -> Bool+termEqual x y = termCompareOrdering x y == EQ++termNotEqual :: Term -> Term -> Bool+termNotEqual x y = not (termEqual x y)++termCompare :: Term -> Term -> Comparison+termCompare x y = case termCompareOrdering x y of+ LT -> ComparisonLessThan+ GT -> ComparisonGreaterThan+ EQ -> ComparisonEqualTo++termGt :: Term -> Term -> Bool+termGt x y = case termCompare x y of+ ComparisonGreaterThan -> True+ _ -> False++termGte :: Term -> Term -> Bool+termGte x y = case termCompare x y of+ ComparisonLessThan -> False+ _ -> True++termLt :: Term -> Term -> Bool+termLt x y = case termCompare x y of+ ComparisonLessThan -> True+ _ -> False++termLte :: Term -> Term -> Bool+termLte x y = case termCompare x y of+ ComparisonGreaterThan -> False+ _ -> True++termMax :: Term -> Term -> Term+termMax x y = if termGte x y then x else y++termMin :: Term -> Term -> Term+termMin x y = if termLte x y then x else y++hydraLibEquality :: Library+hydraLibEquality = standardLibrary [+ prim2 DefEquality.equal termEqual x_ x_ boolean,+ prim2 DefEquality.notEqual termNotEqual x_ x_ boolean]++hydraLibOrdering :: Library+hydraLibOrdering = standardLibrary [+ prim2 DefOrdering.compare termCompare x_ x_ comparison,+ prim2 DefOrdering.gt termGt x_ x_ boolean,+ prim2 DefOrdering.gte termGte x_ x_ boolean,+ prim2 DefOrdering.lt termLt x_ x_ boolean,+ prim2 DefOrdering.lte termLte x_ x_ boolean,+ prim2 DefOrdering.max termMax x_ x_ x_,+ prim2 DefOrdering.min termMin x_ x_ x_]++hydraLibFunctions :: Library+hydraLibFunctions = standardLibrary [+ prim1 DefFunctions.absurd Functions.absurd x_ y_,+ prim3 DefFunctions.compose Functions.compose (funT y_ z_) (funT x_ y_) x_ z_,+ prim2 DefFunctions.const Functions.const x_ y_ x_,+ prim3 DefFunctions.flip Functions.flip (funT x_ (funT y_ z_)) y_ x_ z_,+ prim1 DefFunctions.identity Functions.identity x_ x_]++hydraLibLists :: Library+hydraLibLists = standardLibrary [+ prim2 DefLists.apply Lists.apply (list $ funT x_ y_) (list x_) (list y_),+ prim2 DefLists.at Lists.at int32 (list x_) (optional x_),+ prim2 DefLists.bind Lists.bind (list x_) (fun x_ (list y_)) (list y_),+ prim3 DefLists.compose Lists.compose (fun x_ (list y_)) (fun y_ (list z_)) x_ (list z_),+ prim1 DefLists.concat Lists.concat (list (list x_)) (list x_),+ prim2 DefLists.concat2 Lists.concat2 (list x_) (list x_) (list x_),+ prim2 DefLists.cons Lists.cons x_ (list x_) (list x_),+ prim1 DefLists.distinct Lists.distinct (list x_) (list x_),+ prim2 DefLists.drop Lists.drop int32 (list x_) (list x_),+ prim2 DefLists.dropWhile Lists.dropWhile (fun x_ boolean) (list x_) (list x_),+ prim2 DefLists.member Lists.member x_ (list x_) boolean,+ prim2 DefLists.filter Lists.filter (fun x_ boolean) (list x_) (list x_),+ prim2 DefLists.find Lists.find (fun x_ boolean) (list x_) (optional x_),+ prim3 DefLists.foldList Lists.foldList (fun x_ (fun y_ (list x_))) x_ (list y_) (list x_),+ prim3 DefLists.foldl Lists.foldl (funT y_ (funT x_ y_)) y_ (list x_) y_,+ prim3 DefLists.foldr Lists.foldr (funT x_ (funT y_ y_)) y_ (list x_) y_,+ prim1 DefLists.group Lists.group (list x_) (list (list x_)),+ prim1 DefLists.head Lists.head (list x_) (optional x_),+ prim1 DefLists.init Lists.init (list x_) (optional (list x_)),+ prim2 DefLists.join Lists.join (list x_) (list (list x_)) (list x_),+ prim2 DefLists.join Lists.join (list x_) (list (list x_)) (list x_),+ prim2 DefLists.intersperse Lists.intersperse x_ (list x_) (list x_),+ prim1 DefLists.last Lists.last (list x_) (optional x_),+ prim1 DefLists.length Lists.length (list x_) int32,+ prim2 DefLists.map Lists.map (funT x_ y_) (list x_) (list y_),+ prim2 DefLists.mapList Lists.mapList (fun x_ (list y_)) (list x_) (list (list y_)),+ prim2 DefLists.mapOptional Lists.mapOptional (fun x_ (list y_)) (optional x_) (list (optional y_)),+ prim2 DefLists.mapSet Lists.mapSet (fun x_ (list y_)) (set x_) (list (set y_)),+ prim2 DefLists.member Lists.member x_ (list x_) boolean,+ prim2 DefLists.at Lists.at int32 (list x_) (optional x_),+ prim1 DefLists.head Lists.head (list x_) (optional x_),+ prim1 DefLists.init Lists.init (list x_) (optional (list x_)),+ prim1 DefLists.last Lists.last (list x_) (optional x_),+ prim1 DefLists.tail Lists.tail (list x_) (optional (list x_)),+ prim1 DefLists.distinct Lists.distinct (list x_) (list x_),+ prim1 DefLists.isEmpty Lists.isEmpty (list x_) boolean,+ prim2 DefLists.partition Lists.partition (fun x_ boolean) (list x_) (pair (list x_) (list x_)),+ prim2 DefLists.replicate Lists.replicate int32 x_ (list x_),+ prim1 DefLists.reverse Lists.reverse (list x_) (list x_),+ prim1 DefLists.singleton Lists.singleton x_ (list x_),+ prim1 DefLists.sort Lists.sort (list x_) (list x_),+ prim2 DefLists.sortBy Lists.sortBy (fun x_ y_) (list x_) (list x_),+ prim2 DefLists.sortBy Lists.sortBy (fun x_ y_) (list x_) (list x_),+ prim2 DefLists.span Lists.span (fun x_ boolean) (list x_) (pair (list x_) (list x_)),+ prim1 DefLists.tail Lists.tail (list x_) (optional (list x_)),+ prim2 DefLists.take Lists.take int32 (list x_) (list x_),+ prim2 DefLists.takeWhile Lists.takeWhile (fun x_ boolean) (list x_) (list x_),+ prim1 DefLists.transpose Lists.transpose (list (list x_)) (list (list x_)),+ prim1 DefLists.uncons Lists.uncons (list x_) (optional (pair x_ (list x_))),+ prim2 DefLists.zip Lists.zip (list x_) (list y_) (list (pair x_ y_)),+ prim3 DefLists.zipWith Lists.zipWith (funT x_ $ funT y_ z_) (list x_) (list y_) (list z_)]++hydraLibLiterals :: Library+hydraLibLiterals = standardLibrary [+ prim1 DefLiterals.bigintToDecimal Literals.bigintToDecimal bigint decimal,+ prim1 DefLiterals.bigintToInt8 Literals.bigintToInt8 bigint int8,+ prim1 DefLiterals.bigintToInt16 Literals.bigintToInt16 bigint int16,+ prim1 DefLiterals.bigintToInt32 Literals.bigintToInt32 bigint int32,+ prim1 DefLiterals.bigintToInt64 Literals.bigintToInt64 bigint int64,+ prim1 DefLiterals.bigintToUint8 Literals.bigintToUint8 bigint uint8,+ prim1 DefLiterals.bigintToUint16 Literals.bigintToUint16 bigint uint16,+ prim1 DefLiterals.bigintToUint32 Literals.bigintToUint32 bigint uint32,+ prim1 DefLiterals.bigintToUint64 Literals.bigintToUint64 bigint uint64,+ prim1 DefLiterals.binaryToBytes Literals.binaryToBytes binary (list int32),+ prim1 DefLiterals.binaryToBase64 Literals.binaryToBase64 binary string,+ prim1 DefLiterals.decimalToBigint Literals.decimalToBigint decimal bigint,+ prim1 DefLiterals.decimalToFloat32 Literals.decimalToFloat32 decimal float32,+ prim1 DefLiterals.decimalToFloat64 Literals.decimalToFloat64 decimal float64,+ prim1 DefLiterals.float32ToDecimal Literals.float32ToDecimal float32 decimal,+ prim1 DefLiterals.float32ToFloat64 Literals.float32ToFloat64 float32 float64,+ prim1 DefLiterals.float64ToDecimal Literals.float64ToDecimal float64 decimal,+ prim1 DefLiterals.float64ToFloat32 Literals.float64ToFloat32 float64 float32,+ prim1 DefLiterals.int8ToBigint Literals.int8ToBigint int8 bigint,+ prim1 DefLiterals.int16ToBigint Literals.int16ToBigint int16 bigint,+ prim1 DefLiterals.int32ToBigint Literals.int32ToBigint int32 bigint,+ prim1 DefLiterals.int64ToBigint Literals.int64ToBigint int64 bigint,+ prim1 DefLiterals.parseBigint Literals.parseBigint string (optional bigint),+ prim1 DefLiterals.parseBoolean Literals.parseBoolean string (optional boolean),+ prim1 DefLiterals.parseDecimal Literals.parseDecimal string (optional decimal),+ prim1 DefLiterals.parseFloat32 Literals.parseFloat32 string (optional float32),+ prim1 DefLiterals.parseFloat64 Literals.parseFloat64 string (optional float64),+ prim1 DefLiterals.parseInt8 Literals.parseInt8 string (optional int8),+ prim1 DefLiterals.parseInt16 Literals.parseInt16 string (optional int16),+ prim1 DefLiterals.parseInt32 Literals.parseInt32 string (optional int32),+ prim1 DefLiterals.parseInt64 Literals.parseInt64 string (optional int64),+ prim1 DefLiterals.parseString Literals.parseString string (optional string),+ prim1 DefLiterals.parseUint8 Literals.parseUint8 string (optional uint8),+ prim1 DefLiterals.parseUint16 Literals.parseUint16 string (optional uint16),+ prim1 DefLiterals.parseUint32 Literals.parseUint32 string (optional uint32),+ prim1 DefLiterals.parseUint64 Literals.parseUint64 string (optional uint64),+ prim1 DefLiterals.printBigint Literals.printBigint bigint string,+ prim1 DefLiterals.printBoolean Literals.printBoolean boolean string,+ prim1 DefLiterals.printDecimal Literals.printDecimal decimal string,+ prim1 DefLiterals.printFloat32 Literals.printFloat32 float32 string,+ prim1 DefLiterals.printFloat64 Literals.printFloat64 float64 string,+ prim1 DefLiterals.printInt8 Literals.printInt8 int8 string,+ prim1 DefLiterals.printInt16 Literals.printInt16 int16 string,+ prim1 DefLiterals.printInt32 Literals.printInt32 int32 string,+ prim1 DefLiterals.printInt64 Literals.printInt64 int64 string,+ prim1 DefLiterals.printString Literals.printString string string,+ prim1 DefLiterals.printUint8 Literals.printUint8 uint8 string,+ prim1 DefLiterals.printUint16 Literals.printUint16 uint16 string,+ prim1 DefLiterals.printUint32 Literals.printUint32 uint32 string,+ prim1 DefLiterals.printUint64 Literals.printUint64 uint64 string,+ prim1 DefLiterals.base64ToBinary Literals.base64ToBinary string binary,+ prim1 DefLiterals.uint8ToBigint Literals.uint8ToBigint uint8 bigint,+ prim1 DefLiterals.uint16ToBigint Literals.uint16ToBigint uint16 bigint,+ prim1 DefLiterals.uint32ToBigint Literals.uint32ToBigint uint32 bigint,+ prim1 DefLiterals.uint64ToBigint Literals.uint64ToBigint uint64 bigint]++hydraLibLogic :: Library+hydraLibLogic = standardLibrary [+ prim2 DefLogic.and Logic.and boolean boolean boolean,+ prim3 DefLogic.ifElse Logic.ifElse boolean x_ x_ x_,+ prim1 DefLogic.not Logic.not boolean boolean,+ prim2 DefLogic.or Logic.or boolean boolean boolean]++hydraLibMaps :: Library+hydraLibMaps = standardLibrary [+ prim3 DefMaps.alter Maps.alter (fun (optional v_) (optional v_)) k_ mapKv mapKv,+ prim3 DefMaps.bimap Maps.bimap (fun k1_ k2_) (fun v1_ v2_) (Prims.map k1_ v1_) (Prims.map k2_ v2_),+ prim2 DefMaps.delete Maps.delete k_ mapKv mapKv,+ prim2 DefMaps.difference Maps.difference mapKv mapKv mapKv,+ prim1 DefMaps.elems Maps.elems mapKv (list v_),+ prim0 DefMaps.empty Maps.empty mapKv,+ prim2 DefMaps.filter Maps.filter (fun v_ boolean) mapKv mapKv,+ prim2 DefMaps.filterWithKey Maps.filterWithKey (fun k_ (fun v_ boolean)) mapKv mapKv,+ prim3 DefMaps.findWithDefault Maps.findWithDefault v_ k_ mapKv v_,+ prim1 DefMaps.fromList Maps.fromList (list $ pair k_ v_) mapKv,+ prim3 DefMaps.insert Maps.insert k_ v_ mapKv mapKv,+ prim2 DefMaps.intersection Maps.intersection mapKv mapKv mapKv,+ prim1 DefMaps.keys Maps.keys mapKv (list k_),+ prim2 DefMaps.lookup Maps.lookup k_ mapKv (optional v_),+ prim2 DefMaps.map Maps.map (funT v1_ v2_) (Prims.map k_ v1_) (Prims.map k_ v2_),+ prim2 DefMaps.mapKeys Maps.mapKeys (fun k1_ k2_) (Prims.map k1_ v_) (Prims.map k2_ v_),+ prim2 DefMaps.member Maps.member k_ mapKv boolean,+ prim1 DefMaps.isEmpty Maps.isEmpty mapKv boolean,+ prim2 DefMaps.singleton Maps.singleton k_ v_ mapKv,+ prim1 DefMaps.size Maps.size mapKv int32,+ prim1 DefMaps.toList Maps.toList mapKv (list $ pair k_ v_),+ prim2 DefMaps.union Maps.union mapKv mapKv mapKv,+ prim1 DefMaps.unions Maps.unions (list mapKv) mapKv]+ where+ mapKv = Prims.map k_ v_++hydraLibMathFloat64 :: Library+hydraLibMathFloat64 = standardLibrary [+ prim1 DefMath.acos Math.acos float64 float64,+ prim1 DefMath.acosh Math.acosh float64 float64,+ prim2 DefMath.addFloat64 Math.addFloat64 float64 float64 float64,+ prim1 DefMath.asin Math.asin float64 float64,+ prim1 DefMath.asinh Math.asinh float64 float64,+ prim1 DefMath.atan Math.atan float64 float64,+ prim2 DefMath.atan2 Math.atan2 float64 float64 float64,+ prim1 DefMath.atanh Math.atanh float64 float64,+ prim1 DefMath.ceiling Math.ceiling float64 float64,+ prim1 DefMath.cos Math.cos float64 float64,+ prim1 DefMath.cosh Math.cosh float64 float64,+ -- Constraint-polymorphic ('fractional') division: registered once with identity (Term)+ -- coders so the implementation dispatches on the argument's runtime float type (float32+ -- or float64; see Math.divideTerm). Mirrors #566's numeric-class registration pattern.+ prim2 DefMath.divide Math.divideTerm x_ x_ x_,+ prim0 DefMath.e Math.e float64,+ prim1 DefMath.exp Math.exp float64 float64,+ prim1 DefMath.floor Math.floor float64 float64,+ prim1 DefMath.log Math.log float64 float64,+ prim2 DefMath.logBase Math.logBase float64 float64 float64,+ prim2 DefMath.mulFloat64 Math.mulFloat64 float64 float64 float64,+ prim1 DefMath.negateFloat64 Math.negateFloat64 float64 float64,+ prim0 DefMath.pi Math.pi float64,+ prim2 DefMath.pow Math.pow float64 float64 float64,+ prim1 DefMath.round Math.round float64 float64,+ prim2 DefMath.roundFloat32 Math.roundFloat32 int32 float32 float32,+ prim2 DefMath.roundFloat64 Math.roundFloat64 int32 float64 float64,+ prim1 DefMath.sin Math.sin float64 float64,+ prim1 DefMath.sinh Math.sinh float64 float64,+ prim1 DefMath.sqrt Math.sqrt float64 float64,+ prim2 DefMath.subFloat64 Math.subFloat64 float64 float64 float64,+ prim1 DefMath.tan Math.tan float64 float64,+ prim1 DefMath.tanh Math.tanh float64 float64,+ prim1 DefMath.truncate Math.truncate float64 float64]++hydraLibMathInt32 :: Library+hydraLibMathInt32 = standardLibrary [+ -- Constraint-polymorphic ('numeric'/'integral') primitives: registered once with identity+ -- (Term) coders so the implementation dispatches on the argument's runtime type (see+ -- Math.*Term). Mirrors #566's numeric-class registration pattern.+ prim1 DefMath.abs Math.absTerm x_ x_,+ prim2 DefMath.add Math.addTerm x_ x_ x_,+ prim1 DefMath.even Math.evenTerm x_ boolean,+ prim2 DefMath.div Math.divTerm x_ x_ (optional x_),+ prim2 DefMath.mod Math.modTerm x_ x_ (optional x_),+ prim2 DefMath.mul Math.mulTerm x_ x_ x_,+ prim1 DefMath.negate Math.negateTerm x_ x_,+ prim1 DefMath.odd Math.oddTerm x_ boolean,+ prim2 DefMath.range Math.range int32 int32 (list int32),+ prim2 DefMath.rem Math.remTerm x_ x_ (optional x_),+ prim1 DefMath.signum Math.signumTerm x_ x_,+ prim2 DefMath.sub Math.subTerm x_ x_ x_]++hydraLibOptionals :: Library+hydraLibOptionals = standardLibrary [+ prim2 DefOptionals.apply Optionals.apply (optional $ funT x_ y_) (optional x_) (optional y_),+ prim2 DefOptionals.bind Optionals.bind (optional x_) (fun x_ (optional y_)) (optional y_),+ prim3 DefOptionals.match Optionals.match (optional x_) y_ (funT x_ y_) y_,+ prim1 DefOptionals.givens Optionals.givens (list $ optional x_) (list x_),+ prim3 DefOptionals.compose Optionals.compose (fun x_ $ optional y_) (fun y_ $ optional z_) x_ (optional z_),+ prim3 DefOptionals.foldList Optionals.foldList (fun x_ (fun y_ (optional x_))) x_ (list y_) (optional x_),+ prim2 DefOptionals.withDefault Optionals.withDefault x_ (optional x_) x_,+ prim1 DefOptionals.givens Optionals.givens (list $ optional x_) (list x_),+ prim1 DefOptionals.isGiven Optionals.isGiven (optional x_) boolean,+ prim1 DefOptionals.isNone Optionals.isNone (optional x_) boolean,+ prim2 DefOptionals.map Optionals.map (funT x_ y_) (optional x_) (optional y_),+ prim2 DefOptionals.mapList Optionals.mapList (fun x_ (optional y_)) (list x_) (optional (list y_)),+ prim2 DefOptionals.mapOptional Optionals.mapOptional (fun x_ $ optional y_) (list x_) (list y_),+ prim2 DefOptionals.mapSet Optionals.mapSet (fun x_ (optional y_)) (set x_) (optional (set y_)),+ prim1 DefOptionals.given Optionals.given x_ (optional x_),+ prim1 DefOptionals.toList Optionals.toList (optional x_) (list x_),+ prim2 DefOptionals.withDefault Optionals.withDefault x_ (optional x_) x_]++hydraLibPairs :: Library+hydraLibPairs = standardLibrary [+ prim3 DefPairs.bimap Pairs.bimap (funT a_ c_) (funT b_ d_) (pair a_ b_) (pair c_ d_),+ prim1 DefPairs.first Pairs.first (pair a_ b_) a_,+ prim2 DefPairs.pair Pairs.pair a_ b_ (pair a_ b_),+ prim1 DefPairs.second Pairs.second (pair a_ b_) b_]++hydraLibRegex :: Library+hydraLibRegex = standardLibrary [+ prim2 DefRegex.find Regex.find string string (optional string),+ prim2 DefRegex.findAll Regex.findAll string string (list string),+ prim2 DefRegex.matches Regex.matches string string boolean,+ prim3 DefRegex.replace Regex.replace string string string string,+ prim3 DefRegex.replaceAll Regex.replaceAll string string string string,+ prim2 DefRegex.split Regex.split string string (list string)]++hydraLibSets :: Library+hydraLibSets = standardLibrary [+ prim2 DefSets.delete Sets.delete x_ (set x_) (set x_),+ prim2 DefSets.difference Sets.difference (set x_) (set x_) (set x_),+ prim0 DefSets.empty Sets.empty (set x_),+ prim2 DefSets.filter Sets.filter (fun x_ boolean) (set x_) (set x_),+ prim1 DefSets.fromList Sets.fromList (list x_) (set x_),+ prim2 DefSets.insert Sets.insert x_ (set x_) (set x_),+ prim2 DefSets.intersection Sets.intersection (set x_) (set x_) (set x_),+ prim2 DefSets.map Sets.map (fun x_ y_) (set x_) (set y_),+ prim2 DefSets.member Sets.member x_ (set x_) boolean,+ prim1 DefSets.isEmpty Sets.isEmpty (set x_) boolean,+ prim1 DefSets.singleton Sets.singleton x_ (set x_),+ prim1 DefSets.size Sets.size (set x_) int32,+ prim1 DefSets.toList Sets.toList (set x_) (list x_),+ prim2 DefSets.union Sets.union (set x_) (set x_) (set x_),+ prim1 DefSets.unions Sets.unions (list $ set x_) (set x_)]++hydraLibStrings :: Library+hydraLibStrings = standardLibrary [+ prim1 DefStrings.concat Strings.concat (list string) string,+ prim2 DefStrings.concat2 Strings.concat2 string string string,+ prim2 DefStrings.charAt Strings.charAt int32 string (optional int32),+ prim1 DefStrings.concat Strings.concat (list string) string,+ prim2 DefStrings.concat2 Strings.concat2 string string string,+ prim1 DefStrings.fromList Strings.fromList (list int32) string,+ prim2 DefStrings.join Strings.join string (list string) string,+ prim2 DefStrings.join Strings.join string (list string) string,+ prim1 DefStrings.length Strings.length string int32,+ prim2 DefStrings.charAt Strings.charAt int32 string (optional int32),+ prim1 DefStrings.isEmpty Strings.isEmpty string boolean,+ prim2 DefStrings.splitOn Strings.splitOn string string (list string),+ prim1 DefStrings.toList Strings.toList string (list int32),+ prim1 DefStrings.toLower Strings.toLower string string,+ prim1 DefStrings.toUpper Strings.toUpper string string]++hydraLibSystem :: Library+hydraLibSystem = standardLibrary [+ unsupportedEffectPrimitive DefSystem.execute,+ unsupportedEffectPrimitive DefSystem.exit,+ unsupportedEffectPrimitive DefSystem.getEnvironment,+ unsupportedEffectPrimitive DefSystem.getEnvironmentVariable,+ unsupportedEffectPrimitive DefSystem.getTime,+ unsupportedEffectPrimitive DefSystem.getWorkingDirectory,+ unsupportedEffectPrimitive DefSystem.readStdin,+ unsupportedEffectPrimitive DefSystem.writeStderr,+ unsupportedEffectPrimitive DefSystem.writeStdout]++hydraLibHashing :: Library+hydraLibHashing = standardLibrary [+ prim1 DefHashing.sha256 Hashing.sha256 binary binary,+ prim1 DefHashing.sha256Hex Hashing.sha256Hex binary string]++hydraLibText :: Library+hydraLibText = standardLibrary [+ prim1 DefText.decodeUtf8 Text.decodeUtf8 binary (Prims.either_ string string),+ prim1 DefText.encodeUtf8 Text.encodeUtf8 string binary]++standardLibraries :: [Library]+standardLibraries = [+ hydraLibChars,+ hydraLibEffects,+ hydraLibEithers,+ hydraLibEquality,+ hydraLibFiles,+ hydraLibFunctions,+ hydraLibHashing,+ hydraLibLists,+ hydraLibLiterals,+ hydraLibLogic,+ hydraLibMaps,+ hydraLibMathFloat64,+ hydraLibMathInt32,+ hydraLibOptionals,+ hydraLibOrdering,+ hydraLibPairs,+ hydraLibRegex,+ hydraLibSets,+ hydraLibStrings,+ hydraLibSystem,+ hydraLibText]++-- | Assemble a library from its primitives. The library's module name (e.g. "hydra.core.lib.chars")+-- is *derived* from the primitives' shared namespace rather than passed as a literal string (#473):+-- every primitive in a library shares the namespace, so it is read off the first one's+-- PrimitiveDefinition name. Fails loudly on an empty list.+standardLibrary :: [Primitive] -> Library+standardLibrary [] = error "standardLibrary: empty primitive list (cannot derive module name)"+standardLibrary prims = Library {+ libraryName = ns,+ libraryPrefix = L.drop (L.length ("hydra.core.lib." :: String)) $ unModuleName ns,+ libraryPrimitives = prims}+ where+ -- namespace = the primitive name with its final ".<local>" segment dropped+ firstName = unName $ primitiveDefinitionName $ primitiveDefinition $ head prims+ ns = ModuleName $ reverse $ L.drop 1 $ L.dropWhile (/= '.') $ reverse firstName++-- | Register effect primitives for name resolution and inference, while keeping+-- Hydra's pure reducer from interpreting host effects as ordinary terms.+unsupportedEffectPrimitive :: PrimitiveDefinition -> Primitive+unsupportedEffectPrimitive def = Primitive def implementation+ where+ implementation _ _ = Left $ ErrorOther $ OtherError $+ "effect primitive cannot be reduced by Hydra's pure Haskell reducer: "+ ++ unName (primitiveDefinitionName def)
@@ -0,0 +1,384 @@+-- Note: this is an automatically generated file. Do not edit.++-- | A model for Hydra module names, modules, and packages++module Hydra.Core.Packaging where++import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Typing as Typing+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | A definition, which may be either a term, type, or primitive definition+data Definition =+ -- | A primitive definition+ DefinitionPrimitive PrimitiveDefinition |+ -- | A term definition+ DefinitionTerm TermDefinition |+ -- | A type definition+ DefinitionType TypeDefinition+ deriving (Eq, Ord, Read, Show)++_Definition = Model.Name "hydra.core.packaging.Definition"++_Definition_primitive = Model.Name "primitive"++_Definition_term = Model.Name "term"++_Definition_type = Model.Name "type"++-- | A typed reference to a definition: a type, a term, or a primitive, identified by name+data DefinitionReference =+ -- | A reference to a primitive definition, by name+ DefinitionReferencePrimitive Model.Name |+ -- | A reference to a term definition, by name+ DefinitionReferenceTerm Model.Name |+ -- | A reference to a type definition, by name+ DefinitionReferenceType Model.Name+ deriving (Eq, Ord, Read, Show)++_DefinitionReference = Model.Name "hydra.core.packaging.DefinitionReference"++_DefinitionReference_primitive = Model.Name "primitive"++_DefinitionReference_term = Model.Name "term"++_DefinitionReference_type = Model.Name "type"++-- | The scope in which a package dependency is required. Relevant mainly to dependencies on third-party (non-Hydra) artifacts, where build systems distinguish compile-time, runtime, test-only, and build-tool-only dependencies. Hydra inter-package dependencies normally leave the scope unspecified.+data DependencyScope =+ -- | A dependency exported transitively to consumers of this package (e.g. Gradle `api`, Cabal `build-depends`): present at both compile time and runtime, and visible downstream+ DependencyScopeApi |+ -- | A dependency required at runtime but not at compile time+ DependencyScopeRuntime |+ -- | A dependency required only to compile and run the package's tests+ DependencyScopeTest |+ -- | A build-tool-only dependency, used to generate or process sources at build time but not present in the compiled artifact (e.g. an ANTLR tool jar or an annotation processor)+ DependencyScopeTool+ deriving (Eq, Ord, Read, Show)++_DependencyScope = Model.Name "hydra.core.packaging.DependencyScope"++_DependencyScope_api = Model.Name "api"++_DependencyScope_runtime = Model.Name "runtime"++_DependencyScope_test = Model.Name "test"++_DependencyScope_tool = Model.Name "tool"++-- | Documentation, lifecycle, and normative metadata attachable to a packaging entity (package, module, or definition). Bundling these fields in one type lets future metadata be added without changing the field shape of the entities that carry it.+data EntityMetadata =+ EntityMetadata {+ -- | An optional, concise one-line human-readable summary of the entity.+ entityMetadataDescription :: (Maybe String),+ -- | Zero or more long-form prose paragraphs: cross-cutting semantic conventions, caveats, and references that would otherwise be repeated across the entity's constituents.+ entityMetadataComments :: [String],+ -- | Typed cross-references to related entities, for navigation and documentation.+ entityMetadataSeeAlso :: [EntityReference],+ -- | Optional version-lifecycle milestones for the entity.+ entityMetadataLifecycle :: (Maybe LifecycleInfo),+ -- | Named normative provisions (requirements and recommendations) concerning this entity. Empty when the entity states none.+ entityMetadataProvisions :: [Provision]}+ deriving (Eq, Ord, Read, Show)++_EntityMetadata = Model.Name "hydra.core.packaging.EntityMetadata"++_EntityMetadata_description = Model.Name "description"++_EntityMetadata_comments = Model.Name "comments"++_EntityMetadata_seeAlso = Model.Name "seeAlso"++_EntityMetadata_lifecycle = Model.Name "lifecycle"++_EntityMetadata_provisions = Model.Name "provisions"++-- | A typed reference to a Hydra entity: a package, a module, a definition (by name), or an inline type or term expression in Hydra textual syntax.+data EntityReference =+ -- | A reference to a definition (type, term, or primitive), by name+ EntityReferenceDefinition DefinitionReference |+ -- | A reference to a module, by name+ EntityReferenceModule ModuleName |+ -- | A reference to a package, by name+ EntityReferencePackage PackageName |+ -- | An inline term expression in Hydra textual syntax+ EntityReferenceTermExpr String |+ -- | An inline type expression in Hydra textual syntax+ EntityReferenceTypeExpr String+ deriving (Eq, Ord, Read, Show)++_EntityReference = Model.Name "hydra.core.packaging.EntityReference"++_EntityReference_definition = Model.Name "definition"++_EntityReference_module = Model.Name "module"++_EntityReference_package = Model.Name "package"++_EntityReference_termExpr = Model.Name "termExpr"++_EntityReference_typeExpr = Model.Name "typeExpr"++-- | Version-lifecycle milestones for a packaging entity. Each milestone is independently optional; further milestones (e.g. stableSince, removedSince) may be added without changing dependent types.+data LifecycleInfo =+ LifecycleInfo {+ -- | The version in which the entity was introduced, if known.+ lifecycleInfoAvailableSince :: (Maybe Version),+ -- | The version in which the entity was deprecated, if applicable.+ lifecycleInfoDeprecatedSince :: (Maybe Version)}+ deriving (Eq, Ord, Read, Show)++_LifecycleInfo = Model.Name "hydra.core.packaging.LifecycleInfo"++_LifecycleInfo_availableSince = Model.Name "availableSince"++_LifecycleInfo_deprecatedSince = Model.Name "deprecatedSince"++-- | A logical collection of elements sharing a common module name, having dependencies on zero or more other modules+data Module =+ Module {+ -- | The name of the module, which is also the common prefix for all element names in the module+ moduleName :: ModuleName,+ -- | Optional documentation and lifecycle metadata for the module+ moduleMetadata :: (Maybe EntityMetadata),+ -- | Any modules which this module directly depends on+ moduleDependencies :: [ModuleDependency],+ -- | The definitions in this module+ moduleDefinitions :: [Definition]}+ deriving (Eq, Ord, Read, Show)++_Module = Model.Name "hydra.core.packaging.Module"++_Module_name = Model.Name "name"++_Module_metadata = Model.Name "metadata"++_Module_dependencies = Model.Name "dependencies"++_Module_definitions = Model.Name "definitions"++-- | A dependency on another module, identified by its name and (optionally) the package which provides it. When the package is omitted, the resolver searches all packages in scope; a duplicate module name across packages is a resolution error which can be disambiguated by naming the intended package explicitly.+data ModuleDependency =+ ModuleDependency {+ -- | The name of the depended-on module+ moduleDependencyModule :: ModuleName,+ -- | The package providing the depended-on module, if disambiguation is required+ moduleDependencyPackage :: (Maybe PackageName)}+ deriving (Eq, Ord, Read, Show)++_ModuleDependency = Model.Name "hydra.core.packaging.ModuleDependency"++_ModuleDependency_module = Model.Name "module"++_ModuleDependency_package = Model.Name "package"++-- | The unique name of a module; a prefix for the names of elements defined in the module.+newtype ModuleName =+ ModuleName {+ unModuleName :: String}+ deriving (Eq, Ord, Read, Show)++_ModuleName = Model.Name "hydra.core.packaging.ModuleName"++-- | A package, which is a named collection of modules with metadata and dependencies+data Package =+ Package {+ -- | The name of the package+ packageName :: PackageName,+ -- | Optional documentation and lifecycle metadata for the package+ packageMetadata :: (Maybe EntityMetadata),+ -- | The packages which this package depends on+ packageDependencies :: [PackageDependency],+ -- | The modules in this package+ packageModules :: [Module]}+ deriving (Eq, Ord, Read, Show)++_Package = Model.Name "hydra.core.packaging.Package"++_Package_name = Model.Name "name"++_Package_metadata = Model.Name "metadata"++_Package_dependencies = Model.Name "dependencies"++_Package_modules = Model.Name "modules"++-- | A dependency on another package, identified by name and constrained by an optional version specifier+data PackageDependency =+ PackageDependency {+ -- | The name of the depended-on package+ packageDependencyName :: PackageName,+ -- | The version-range constraint on the depended-on package+ packageDependencyVersion :: VersionSpecifier,+ -- | The scope in which the dependency is required, if specified. Normally absent for Hydra inter-package dependencies; specified for third-party dependencies whose build scope (compile/runtime/test/tool) is significant.+ packageDependencyScope :: (Maybe DependencyScope)}+ deriving (Eq, Ord, Read, Show)++_PackageDependency = Model.Name "hydra.core.packaging.PackageDependency"++_PackageDependency_name = Model.Name "name"++_PackageDependency_version = Model.Name "version"++_PackageDependency_scope = Model.Name "scope"++-- | The unique name of a package, e.g. "hydra-kernel" or "hydra-python". For dependencies on third-party artifacts in ecosystems with a group/namespace component (notably Maven), the group and artifact are carried in a single name separated by a colon, e.g. "org.eclipse.rdf4j:rdf4j-rio-ntriples"; the consuming host splits on the colon to recover the group when emitting build configuration. Hydra package names contain no colon.+newtype PackageName =+ PackageName {+ unPackageName :: String}+ deriving (Eq, Ord, Read, Show)++_PackageName = Model.Name "hydra.core.packaging.PackageName"++-- | A primitive definition: the universal, host-independent declarative metadata for a primitive, including name, signature, documentation and lifecycle metadata, totality and purity flags, and an optional default implementation expressed as a Hydra term.+data PrimitiveDefinition =+ PrimitiveDefinition {+ -- | The name of the primitive+ primitiveDefinitionName :: Model.Name,+ -- | Optional documentation and lifecycle metadata for the primitive.+ primitiveDefinitionMetadata :: (Maybe EntityMetadata),+ -- | The signature of the primitive. Always explicit, never inferred.+ primitiveDefinitionSignature :: Typing.TermSignature,+ -- | Whether the primitive is pure (referentially transparent, no observable side effects). Normally true.+ primitiveDefinitionIsPure :: Bool,+ -- | Whether the primitive is total (terminates on every input of its declared type). Normally true.+ primitiveDefinitionIsTotal :: Bool,+ -- | An optional cross-compilable reference implementation of the primitive, expressed as a Hydra term. Used by interpreters lacking a native implementation and as a proof-friendly reference. Distinct from the per-host Primitive.implementation.+ primitiveDefinitionDefaultImplementation :: (Maybe Model.Term)}+ deriving (Eq, Ord, Read, Show)++_PrimitiveDefinition = Model.Name "hydra.core.packaging.PrimitiveDefinition"++_PrimitiveDefinition_name = Model.Name "name"++_PrimitiveDefinition_metadata = Model.Name "metadata"++_PrimitiveDefinition_signature = Model.Name "signature"++_PrimitiveDefinition_isPure = Model.Name "isPure"++_PrimitiveDefinition_isTotal = Model.Name "isTotal"++_PrimitiveDefinition_defaultImplementation = Model.Name "defaultImplementation"++-- | A named normative statement concerning an entity: a single falsifiable condition a conforming implementation is measured against. Tests reference provisions by name.+data Provision =+ Provision {+ -- | The fully-qualified name of the provision: the enclosing entity's name extended by one segment (e.g. hydra.core.lib.lists.concat.emptyLists). Composed at definition time by a helper that prefixes the entity's name, exactly as a definition's name is composed from its module's name -- so the author writes only the final segment, but the stored value is the full name.+ provisionName :: Model.Name,+ -- | Whether this provision is a requirement or a recommendation.+ provisionKind :: ProvisionKind,+ -- | The normative statement itself, as markdown prose: the falsifiable claim.+ provisionStatement :: String}+ deriving (Eq, Ord, Read, Show)++_Provision = Model.Name "hydra.core.packaging.Provision"++_Provision_name = Model.Name "name"++_Provision_kind = Model.Name "kind"++_Provision_statement = Model.Name "statement"++-- | Whether a provision is a requirement (a MUST: no deviation permitted for conformance) or a recommendation (a SHOULD: observed by the Hydra kernel, but a downstream project may opt out).+data ProvisionKind =+ -- | A requirement: no deviation is permitted if conformance is to be claimed (MUST).+ ProvisionKindRequirement |+ -- | A recommendation: observed strictly by the Hydra kernel and codebase, but a downstream project may opt out (SHOULD).+ ProvisionKindRecommendation+ deriving (Eq, Ord, Read, Show)++_ProvisionKind = Model.Name "hydra.core.packaging.ProvisionKind"++_ProvisionKind_requirement = Model.Name "requirement"++_ProvisionKind_recommendation = Model.Name "recommendation"++-- | A term-level definition, including a name, an optional signature, and a term+data TermDefinition =+ TermDefinition {+ -- | The name of the term+ termDefinitionName :: Model.Name,+ -- | Optional documentation and lifecycle metadata for the term definition+ termDefinitionMetadata :: (Maybe EntityMetadata),+ -- | The optional signature of the term. When absent, the signature has yet to be inferred.+ termDefinitionSignature :: (Maybe Typing.TermSignature),+ -- | The term being defined+ termDefinitionBody :: Model.Term}+ deriving (Eq, Ord, Read, Show)++_TermDefinition = Model.Name "hydra.core.packaging.TermDefinition"++_TermDefinition_name = Model.Name "name"++_TermDefinition_metadata = Model.Name "metadata"++_TermDefinition_signature = Model.Name "signature"++_TermDefinition_body = Model.Name "body"++-- | A type-level definition, including a name and the type scheme+data TypeDefinition =+ TypeDefinition {+ -- | The name of the type+ typeDefinitionName :: Model.Name,+ -- | Optional documentation and lifecycle metadata for the type definition+ typeDefinitionMetadata :: (Maybe EntityMetadata),+ -- | The type scheme being defined+ typeDefinitionBody :: Model.TypeScheme}+ deriving (Eq, Ord, Read, Show)++_TypeDefinition = Model.Name "hydra.core.packaging.TypeDefinition"++_TypeDefinition_name = Model.Name "name"++_TypeDefinition_metadata = Model.Name "metadata"++_TypeDefinition_body = Model.Name "body"++-- | A version string, e.g. "0.15" or "1.0.0".+newtype Version =+ Version {+ unVersion :: String}+ deriving (Eq, Ord, Read, Show)++_Version = Model.Name "hydra.core.packaging.Version"++-- | A version range with an optional inclusive lower bound and an optional exclusive upper bound.+data VersionRange =+ VersionRange {+ -- | The inclusive lower bound, if any (the minimum acceptable version).+ versionRangeLowerInclusive :: (Maybe Version),+ -- | The exclusive upper bound, if any (versions strictly below this are acceptable).+ versionRangeUpperExclusive :: (Maybe Version)}+ deriving (Eq, Ord, Read, Show)++_VersionRange = Model.Name "hydra.core.packaging.VersionRange"++_VersionRange_lowerInclusive = Model.Name "lowerInclusive"++_VersionRange_upperExclusive = Model.Name "upperExclusive"++-- | A specifier constraining acceptable versions of a dependency. Build systems render each variant into their own syntax (e.g. a range becomes ">=3.7,<4.0" for PyPI or "[3.7,4.0)" for Maven). Further variants such as `caret` may be added without breaking consumers of the existing forms.+data VersionSpecifier =+ -- | Any version satisfies the dependency+ VersionSpecifierAny |+ -- | Exactly the given version satisfies the dependency; used to pin a specific release+ VersionSpecifierExact Version |+ -- | Any version greater than or equal to the given version (e.g. PyPI ">=7.0")+ VersionSpecifierAtLeast Version |+ -- | A version range with an optional inclusive lower bound and optional exclusive upper bound (e.g. ">=3.7,<4.0")+ VersionSpecifierRange VersionRange+ deriving (Eq, Ord, Read, Show)++_VersionSpecifier = Model.Name "hydra.core.packaging.VersionSpecifier"++_VersionSpecifier_any = Model.Name "any"++_VersionSpecifier_exact = Model.Name "exact"++_VersionSpecifier_atLeast = Model.Name "atLeast"++_VersionSpecifier_range = Model.Name "range"
@@ -0,0 +1,73 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Parser for Hydra documentation strings, producing DocSegment lists. A bespoke helper parser, not a parse<T> convention function (see docs/specification/index.md, Conventions).++module Hydra.Core.Parse.Docs where++import qualified Hydra.Core.Ast as Ast+import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Diff as Diff+import qualified Hydra.Core.Docs as Docs+import qualified Hydra.Core.Error.Checking as Checking+import qualified Hydra.Core.Error.File as ErrorFile+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Error.Packaging as ErrorPackaging+import qualified Hydra.Core.Error.System as ErrorSystem+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Json.Model as JsonModel+import qualified Hydra.Core.Overlay.Haskell.Lib.Equality as Equality+import qualified Hydra.Core.Overlay.Haskell.Lib.Lists as Lists+import qualified Hydra.Core.Overlay.Haskell.Lib.Logic as Logic+import qualified Hydra.Core.Overlay.Haskell.Lib.Optionals as Optionals+import qualified Hydra.Core.Overlay.Haskell.Lib.Strings as Strings+import qualified Hydra.Core.Markdown as Markdown+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Parsing as Parsing+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Query as Query+import qualified Hydra.Core.Regex as Regex+import qualified Hydra.Core.Relational as Relational+import qualified Hydra.Core.System as System+import qualified Hydra.Core.Tabular as Tabular+import qualified Hydra.Core.Testing as Testing+import qualified Hydra.Core.Time as Time+import qualified Hydra.Core.Topology as Topology+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Validation as Validation+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | Parse the content between the doc-escape delimiters into an EntityReference. The input is the inner content (tag and optional rhs), e.g. "type hydra.core.model.Lambda". Returns nothing for unrecognized tags.+parseDocAnnotation :: String -> Maybe Packaging.EntityReference+parseDocAnnotation inner =++ let parts = Strings.splitOn " " inner+ tag = Optionals.withDefault "" (Lists.head parts)+ rhs = Strings.join " " (Lists.drop 1 parts)+ in (Logic.ifElse (Equality.equal tag "primitive") (Just (Packaging.EntityReferenceDefinition (Packaging.DefinitionReferencePrimitive (Model.Name rhs)))) (Logic.ifElse (Equality.equal tag "term") (Just (Packaging.EntityReferenceDefinition (Packaging.DefinitionReferenceTerm (Model.Name rhs)))) (Logic.ifElse (Equality.equal tag "type") (Just (Packaging.EntityReferenceDefinition (Packaging.DefinitionReferenceType (Model.Name rhs)))) (Logic.ifElse (Equality.equal tag "module") (Just (Packaging.EntityReferenceModule (Packaging.ModuleName rhs))) (Logic.ifElse (Equality.equal tag "package") (Just (Packaging.EntityReferencePackage (Packaging.PackageName rhs))) (Logic.ifElse (Equality.equal tag "term-expr") (Just (Packaging.EntityReferenceTermExpr rhs)) (Logic.ifElse (Equality.equal tag "type-expr") (Just (Packaging.EntityReferenceTypeExpr rhs)) Nothing)))))))++-- | Parse a documentation string into a list of 'DocSegment's. Recognized doc-escape tags become DocSegment.ref segments (wrapping a 'EntityReference'); all other text (including unrecognized doc-escape blocks) becomes DocSegment.text segments. Adjacent text fragments are not merged.+parseDocString :: String -> [Docs.DocSegment]+parseDocString s =++ let parts = Strings.splitOn "{@" s+ head_ = Optionals.withDefault "" (Lists.head parts)+ tail_ = Lists.drop 1 parts+ toSeg =+ \part ->+ let subparts = Strings.splitOn "}" part+ inner = Optionals.withDefault "" (Lists.head subparts)+ after = Strings.join "}" (Lists.drop 1 subparts)+ mref = parseDocAnnotation inner+ in (Optionals.match mref [+ Docs.DocSegmentText (Strings.concat2 "{@" part)] (\ref -> Optionals.givens [+ Just (Docs.DocSegmentRef ref),+ (Logic.ifElse (Equality.equal after "") Nothing (Just (Docs.DocSegmentText after)))]))+ in (Lists.cons (Docs.DocSegmentText head_) (Lists.concat (Lists.map toSeg tail_)))
@@ -0,0 +1,149 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Parser for Hydra's translingual regular-expression syntax (docs/specification/regex.md): text -> hydra.core.regex AST. Built on the hydra.core.parsers combinators. Rejects ill-formed patterns (empty alternation branches, empty classes, out-of-range code points) via the ParseResult failure channel, so 'well-formed' is portable across hosts. See issue #567. A structured textual-syntax parser (precedent for the general parser in #497), not a scalar parse<T> convention function (see docs/specification/index.md, Conventions).++module Hydra.Core.Parse.Regex where++import qualified Hydra.Core.Ast as Ast+import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Diff as Diff+import qualified Hydra.Core.Docs as Docs+import qualified Hydra.Core.Error.Checking as Checking+import qualified Hydra.Core.Error.File as ErrorFile+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Error.Packaging as ErrorPackaging+import qualified Hydra.Core.Error.System as ErrorSystem+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Json.Model as JsonModel+import qualified Hydra.Core.Overlay.Haskell.Lib.Equality as Equality+import qualified Hydra.Core.Overlay.Haskell.Lib.Lists as Lists+import qualified Hydra.Core.Overlay.Haskell.Lib.Logic as Logic+import qualified Hydra.Core.Overlay.Haskell.Lib.Math as Math+import qualified Hydra.Core.Overlay.Haskell.Lib.Optionals as Optionals+import qualified Hydra.Core.Overlay.Haskell.Lib.Ordering as Ordering+import qualified Hydra.Core.Markdown as Markdown+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Parsers as Parsers+import qualified Hydra.Core.Parsing as Parsing+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Query as Query+import qualified Hydra.Core.Regex as Regex+import qualified Hydra.Core.Relational as Relational+import qualified Hydra.Core.System as System+import qualified Hydra.Core.Tabular as Tabular+import qualified Hydra.Core.Testing as Testing+import qualified Hydra.Core.Time as Time+import qualified Hydra.Core.Topology as Topology+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Validation as Validation+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | Parse an alternation of sequences separated by |. When there is more than one branch, each branch must be non-empty; empty branches (a|, |b, a||b, and the nested (a|)) are rejected at every level. A single empty branch is the legal empty case (empty whole pattern / empty group).+alternation :: Parsing.Parser [[Regex.Quantified]]+alternation =+ Parsers.bind (Parsers.sepBy1 (Parsers.lazy (\_ -> regexSequence)) (Parsers.char 124)) (\branches ->+ let hasEmpty = Lists.foldl (\acc -> \b -> Logic.or acc (Lists.isEmpty b)) False branches+ multi = Ordering.gt (Lists.length branches) 1+ in (Logic.ifElse (Logic.and hasEmpty multi) (Parsers.fail "empty alternation branch") (Parsers.pure branches)))++-- | Parse a single atom: a group ( ... ), a class [ ... ], ., an anchor ^ or $, or a literal.+atom :: Parsing.Parser Regex.Atom+atom =+ Parsers.choice [+ Parsers.map (\g -> Regex.AtomGroup g) (Parsers.between (Parsers.char 40) (Parsers.char 41) (Parsers.lazy (\_ -> alternation))),+ characterClass,+ (Parsers.bind (Parsers.char 46) (\_ -> Parsers.pure Regex.AtomAny)),+ (Parsers.bind (Parsers.char 94) (\_ -> Parsers.pure Regex.AtomAnchorStart)),+ (Parsers.bind (Parsers.char 36) (\_ -> Parsers.pure Regex.AtomAnchorEnd)),+ literalAtom]++-- | Parse a character class [ ... ] or [^ ... ]; the class must be non-empty.+characterClass :: Parsing.Parser Regex.Atom+characterClass =+ Parsers.bind (Parsers.char 91) (\_ -> Parsers.bind (Parsers.optional (Parsers.char 94)) (\neg -> Parsers.bind (Parsers.some classItem) (\items -> Parsers.bind (Parsers.char 93) (\_2 -> Parsers.pure (Regex.AtomClass (Regex.CharacterClass {+ Regex.characterClassNegated = (Optionals.match neg False (\_3 -> True)),+ Regex.characterClassItems = items}))))))++-- | Parse one member of a character class: a range like a-z, or a single character (escapes allowed).+classItem :: Parsing.Parser Regex.ClassItem+classItem =+ Parsers.bind classChar (\from -> Parsers.alt (Parsers.bind (Parsers.char 45) (\_ -> Parsers.map (\to -> Regex.ClassItemRange (Regex.CharacterRange {+ Regex.characterRangeFrom = from,+ Regex.characterRangeTo = to})) classChar)) (Parsers.pure (Regex.ClassItemCharacter from)))+ where+ classChar =+ Parsers.alt escapedChar (Parsers.satisfy (\c -> Logic.and (Logic.not (Equality.equal c 93)) (Logic.not (Equality.equal c 92))))++-- | Parse a backslash followed by any character; yields that character's codepoint (the escape is consumed).+escapedChar :: Parsing.Parser Int+escapedChar = Parsers.bind (Parsers.char 92) (\_ -> Parsers.anyChar)++-- | True if the codepoint is a top-level regex metacharacter that must be escaped to match literally.+isMetachar :: Int -> Bool+isMetachar c =+ Lists.foldl (\acc -> \m -> Logic.or acc (Equality.equal c m)) False [+ 46,+ 94,+ 36,+ 42,+ 43,+ 63,+ 40,+ 41,+ 91,+ 93,+ 123,+ 125,+ 124,+ 92]++-- | Parse a literal character (an escaped metacharacter, or any ordinary non-metacharacter) into an Atom.+literalAtom :: Parsing.Parser Regex.Atom+literalAtom =+ Parsers.map (\c -> Regex.AtomLiteral c) (Parsers.alt escapedChar (Parsers.satisfy (\c -> Logic.not (isMetachar c))))++-- | Parse a full regex pattern string into a hydra.core.regex AST. Returns nothing if the pattern is ill-formed or does not consume all input; a well-formed pattern is exactly one that parses here, so 'well-formed' is portable across all hosts.+parseRegex :: String -> Maybe [[Regex.Quantified]]+parseRegex input =+ (\x -> case x of+ Parsing.ParseResultSuccess v0 -> Logic.ifElse (Lists.isEmpty (Parsing.parseSuccessRemainder v0)) (Just (Parsing.parseSuccessValue v0)) Nothing+ Parsing.ParseResultFailure _ -> Nothing) (Parsers.runParser regex input)++-- | Parse an atom followed by an optional quantifier.+quantified :: Parsing.Parser Regex.Quantified+quantified =+ Parsers.bind atom (\a -> Parsers.map (\q -> Regex.Quantified {+ Regex.quantifiedAtom = a,+ Regex.quantifiedQuantifier = q}) quantifier)++-- | Parse an optional quantifier following an atom; yields 'one' when no quantifier is present.+quantifier :: Parsing.Parser Regex.Quantifier+quantifier =+ Parsers.alt (Parsers.choice [+ Parsers.bind (Parsers.char 42) (\_ -> Parsers.pure Regex.QuantifierZeroOrMore),+ (Parsers.bind (Parsers.char 43) (\_ -> Parsers.pure Regex.QuantifierOneOrMore)),+ (Parsers.bind (Parsers.char 63) (\_ -> Parsers.pure Regex.QuantifierZeroOrOne)),+ (Parsers.bind (Parsers.char 123) (\_ -> Parsers.bind unsignedInt (\n -> Parsers.bind (Parsers.optional (Parsers.char 44)) (\comma -> Optionals.match comma (Parsers.bind (Parsers.char 125) (\_2 -> Parsers.pure (Regex.QuantifierExactly n))) (\_2 -> Parsers.bind (Parsers.optional unsignedInt) (\mm -> Parsers.bind (Parsers.char 125) (\_3 -> Optionals.match mm (Parsers.pure (Regex.QuantifierAtLeast n)) (\m -> Parsers.pure (Regex.QuantifierRange_ (Regex.QuantifierRange {+ Regex.quantifierRangeMin = n,+ Regex.quantifierRangeMax = m}))))))))))]) (Parsers.pure Regex.QuantifierOne)++-- | Parse a complete regex (an alternation). The empty pattern parses to a single empty sequence.+regex :: Parsing.Parser [[Regex.Quantified]]+regex = alternation++-- | Parse a sequence of quantified atoms (a single alternation branch). May be empty only as the whole pattern; as an alternation branch it is constrained to be non-empty by the alternation parser's use of sepBy1 plus a non-empty check.+regexSequence :: Parsing.Parser [Regex.Quantified]+regexSequence = Parsers.many quantified++-- | Parse a non-negative decimal integer (one or more digits).+unsignedInt :: Parsing.Parser Int+unsignedInt =+ Parsers.map (\digits -> Lists.foldl (\acc -> \d -> Math.add (Math.mul acc 10) (Math.sub d 48)) 0 digits) (Parsers.some (Parsers.satisfy (\c -> Logic.and (Ordering.gte c 48) (Ordering.lte c 57))))
@@ -0,0 +1,202 @@+-- Note: this is an automatically generated file. Do not edit.++-- | General-purpose parser combinators, operating on a Parser type. A helper library, not a set of parse<T> convention functions (see docs/specification/index.md, Conventions).++module Hydra.Core.Parsers where++import qualified Hydra.Core.Ast as Ast+import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Diff as Diff+import qualified Hydra.Core.Docs as Docs+import qualified Hydra.Core.Error.Checking as Checking+import qualified Hydra.Core.Error.File as ErrorFile+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Error.Packaging as ErrorPackaging+import qualified Hydra.Core.Error.System as ErrorSystem+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Json.Model as JsonModel+import qualified Hydra.Core.Overlay.Haskell.Lib.Equality as Equality+import qualified Hydra.Core.Overlay.Haskell.Lib.Lists as Lists+import qualified Hydra.Core.Overlay.Haskell.Lib.Logic as Logic+import qualified Hydra.Core.Overlay.Haskell.Lib.Optionals as Optionals+import qualified Hydra.Core.Overlay.Haskell.Lib.Pairs as Pairs+import qualified Hydra.Core.Overlay.Haskell.Lib.Strings as Strings+import qualified Hydra.Core.Markdown as Markdown+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Parsing as Parsing+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Query as Query+import qualified Hydra.Core.Regex as Regex+import qualified Hydra.Core.Relational as Relational+import qualified Hydra.Core.System as System+import qualified Hydra.Core.Tabular as Tabular+import qualified Hydra.Core.Testing as Testing+import qualified Hydra.Core.Time as Time+import qualified Hydra.Core.Topology as Topology+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Validation as Validation+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | Try the first parser; if it fails without consuming input, try the second+alt :: Parsing.Parser t0 -> Parsing.Parser t0 -> Parsing.Parser t0+alt p1 p2 =++ let parse =+ \input -> (\x -> case x of+ Parsing.ParseResultSuccess v0 -> Parsing.ParseResultSuccess v0+ Parsing.ParseResultFailure v0 -> Logic.ifElse (Equality.equal (Parsing.parseErrorRemainder v0) input) (Parsing.unParser p2 input) (Parsing.ParseResultFailure v0)) (Parsing.unParser p1 input)+ in (Parsing.Parser parse)++-- | Parse any single character (codepoint)+anyChar :: Parsing.Parser Int+anyChar = satisfy (\_ -> True)++-- | Apply a parser containing a function to a parser containing a value+apply :: Parsing.Parser (t0 -> t1) -> Parsing.Parser t0 -> Parsing.Parser t1+apply pf pa =++ let parse =+ \input -> (\x -> case x of+ Parsing.ParseResultSuccess v0 -> (\x -> case x of+ Parsing.ParseResultSuccess v1 -> Parsing.ParseResultSuccess (Parsing.ParseSuccess {+ Parsing.parseSuccessValue = (Parsing.parseSuccessValue v0 (Parsing.parseSuccessValue v1)),+ Parsing.parseSuccessRemainder = (Parsing.parseSuccessRemainder v1)})+ Parsing.ParseResultFailure v1 -> Parsing.ParseResultFailure v1) (Parsing.unParser pa (Parsing.parseSuccessRemainder v0))+ Parsing.ParseResultFailure v0 -> Parsing.ParseResultFailure v0) (Parsing.unParser pf input)+ in (Parsing.Parser parse)++-- | Parse something between an opening and closing parser+between :: Parsing.Parser t0 -> Parsing.Parser t1 -> Parsing.Parser t2 -> Parsing.Parser t2+between open close p = bind open (\_ -> bind p (\x -> bind close (\_2 -> pure x)))++-- | Sequence two parsers, passing the result of the first to a function that produces the second+bind :: Parsing.Parser t0 -> (t0 -> Parsing.Parser t1) -> Parsing.Parser t1+bind pa f =++ let parse =+ \input -> (\x -> case x of+ Parsing.ParseResultSuccess v0 -> Parsing.unParser (f (Parsing.parseSuccessValue v0)) (Parsing.parseSuccessRemainder v0)+ Parsing.ParseResultFailure v0 -> Parsing.ParseResultFailure v0) (Parsing.unParser pa input)+ in (Parsing.Parser parse)++-- | Parse a specific character (codepoint)+char :: Int -> Parsing.Parser Int+char c = satisfy (\x -> Equality.equal x c)++-- | Try each parser in the list until one succeeds+choice :: [Parsing.Parser t0] -> Parsing.Parser t0+choice ps = Lists.foldl alt (fail "no choice matched") ps++-- | A parser that succeeds only at the end of input+eof :: Parsing.Parser ()+eof =+ Parsing.Parser (\input -> Logic.ifElse (Lists.isEmpty input) (Parsing.ParseResultSuccess (Parsing.ParseSuccess {+ Parsing.parseSuccessValue = (),+ Parsing.parseSuccessRemainder = input})) (Parsing.ParseResultFailure (Parsing.ParseError {+ Parsing.parseErrorMessage = "expected end of input",+ Parsing.parseErrorRemainder = input})))++-- | A parser that always fails with the given error message+fail :: String -> Parsing.Parser t0+fail msg =+ Parsing.Parser (\input -> Parsing.ParseResultFailure (Parsing.ParseError {+ Parsing.parseErrorMessage = msg,+ Parsing.parseErrorRemainder = input}))++-- | Create a parser that defers construction of another parser until parsing time. This is essential for breaking recursive parser definitions.+lazy :: (() -> Parsing.Parser t0) -> Parsing.Parser t0+lazy f = Parsing.Parser (\input -> Parsing.unParser (f ()) input)++-- | Parse zero or more occurrences of the given parser+many :: Parsing.Parser t0 -> Parsing.Parser [t0]+many p =++ let parse = \input -> manyLoop p input []+ in (Parsing.Parser parse)++-- | Repeatedly apply a parser, accumulating results, until it fails+manyLoop :: Parsing.Parser t0 -> [Int] -> [t0] -> Parsing.ParseResult [t0]+manyLoop p input acc =+ (\x -> case x of+ Parsing.ParseResultSuccess v0 -> manyLoop p (Parsing.parseSuccessRemainder v0) (Lists.cons (Parsing.parseSuccessValue v0) acc)+ Parsing.ParseResultFailure _ -> Parsing.ParseResultSuccess (Parsing.ParseSuccess {+ Parsing.parseSuccessValue = (Lists.reverse acc),+ Parsing.parseSuccessRemainder = input})) (Parsing.unParser p input)++-- | Apply a function to the result of a parser+map :: (t0 -> t1) -> Parsing.Parser t0 -> Parsing.Parser t1+map f pa =++ let parse =+ \input -> (\x -> case x of+ Parsing.ParseResultSuccess v0 -> Parsing.ParseResultSuccess (Parsing.ParseSuccess {+ Parsing.parseSuccessValue = (f (Parsing.parseSuccessValue v0)),+ Parsing.parseSuccessRemainder = (Parsing.parseSuccessRemainder v0)})+ Parsing.ParseResultFailure v0 -> Parsing.ParseResultFailure v0) (Parsing.unParser pa input)+ in (Parsing.Parser parse)++-- | Optionally parse something, returning Nothing if it fails+optional :: Parsing.Parser t0 -> Parsing.Parser (Maybe t0)+optional p = alt (map Optionals.given p) (pure Nothing)++-- | A parser that always succeeds with the given value without consuming input+pure :: t0 -> Parsing.Parser t0+pure a =+ Parsing.Parser (\input -> Parsing.ParseResultSuccess (Parsing.ParseSuccess {+ Parsing.parseSuccessValue = a,+ Parsing.parseSuccessRemainder = input}))++-- | Run a parser on the given input string. The string is converted to a codepoint list once, up front, so that the parser itself can consume characters in constant time.+runParser :: Parsing.Parser t0 -> String -> Parsing.ParseResult t0+runParser p input = Parsing.unParser p (Strings.toList input)++-- | Parse a character (codepoint) that satisfies the given predicate+satisfy :: (Int -> Bool) -> Parsing.Parser Int+satisfy pred =++ let parse =+ \input -> Optionals.match (Lists.uncons input) (Parsing.ParseResultFailure (Parsing.ParseError {+ Parsing.parseErrorMessage = "unexpected end of input",+ Parsing.parseErrorRemainder = input})) (\uc ->+ let c = Pairs.first uc+ rest = Pairs.second uc+ in (Logic.ifElse (pred c) (Parsing.ParseResultSuccess (Parsing.ParseSuccess {+ Parsing.parseSuccessValue = c,+ Parsing.parseSuccessRemainder = rest})) (Parsing.ParseResultFailure (Parsing.ParseError {+ Parsing.parseErrorMessage = "character did not satisfy predicate",+ Parsing.parseErrorRemainder = input}))))+ in (Parsing.Parser parse)++-- | Parse zero or more occurrences separated by a separator+sepBy :: Parsing.Parser t0 -> Parsing.Parser t1 -> Parsing.Parser [t0]+sepBy p sep = alt (sepBy1 p sep) (pure [])++-- | Parse one or more occurrences separated by a separator+sepBy1 :: Parsing.Parser t0 -> Parsing.Parser t1 -> Parsing.Parser [t0]+sepBy1 p sep = bind p (\x -> bind (many (bind sep (\_ -> p))) (\xs -> pure (Lists.cons x xs)))++-- | Parse one or more occurrences of the given parser+some :: Parsing.Parser t0 -> Parsing.Parser [t0]+some p = bind p (\x -> bind (many p) (\xs -> pure (Lists.cons x xs)))++-- | Parse a specific string+string :: String -> Parsing.Parser String+string str =++ let strCodes = Strings.toList str+ strLen = Lists.length strCodes+ in (Parsing.Parser (\input ->+ let inputPrefix = Lists.take strLen input+ in (Logic.ifElse (Equality.equal strCodes inputPrefix) (Parsing.ParseResultSuccess (Parsing.ParseSuccess {+ Parsing.parseSuccessValue = str,+ Parsing.parseSuccessRemainder = (Lists.drop strLen input)})) (Parsing.ParseResultFailure (Parsing.ParseError {+ Parsing.parseErrorMessage = (Strings.concat2 "expected: " str),+ Parsing.parseErrorRemainder = input})))))
@@ -0,0 +1,61 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Parser combinator types for text parsing++module Hydra.Core.Parsing where++import qualified Hydra.Core.Model as Model+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | An error which occurred while parsing+data ParseError =+ ParseError {+ -- | An error message+ parseErrorMessage :: String,+ -- | The remaining input (as codepoints) at the point of failure+ parseErrorRemainder :: [Int]}+ deriving (Eq, Ord, Read, Show)++_ParseError = Model.Name "hydra.core.parsing.ParseError"++_ParseError_message = Model.Name "message"++_ParseError_remainder = Model.Name "remainder"++-- | The result of a parse operation+data ParseResult a =+ -- | A successful parse, with a value and the remaining unparsed input+ ParseResultSuccess (ParseSuccess a) |+ -- | A failed parse, with an error message and the remaining input+ ParseResultFailure ParseError+ deriving (Eq, Ord, Read, Show)++_ParseResult = Model.Name "hydra.core.parsing.ParseResult"++_ParseResult_success = Model.Name "success"++_ParseResult_failure = Model.Name "failure"++-- | A successful parse result+data ParseSuccess a =+ ParseSuccess {+ -- | The parsed value+ parseSuccessValue :: a,+ -- | The remaining unparsed input, as codepoints. Represented as a list rather than a string+ parseSuccessRemainder :: [Int]}+ deriving (Eq, Ord, Read, Show)++_ParseSuccess = Model.Name "hydra.core.parsing.ParseSuccess"++_ParseSuccess_value = Model.Name "value"++_ParseSuccess_remainder = Model.Name "remainder"++-- | A parser which consumes characters from a codepoint list and produces a value. The input is a list, rather than a string, so that consuming one character is a constant-time operation rather than a linear-time string copy.+newtype Parser a =+ Parser {+ unParser :: ([Int] -> ParseResult a)}++_Parser = Model.Name "hydra.core.parsing.Parser"
@@ -0,0 +1,572 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Subterm and subtype access, and the term/type graph view of a graph++module Hydra.Core.Paths where++import qualified Hydra.Core.Model as Model+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void+import qualified Data.Map as M++-- | A reference to a lambda-bound variable: the node introducing it is the binding lambda+data LambdaVariableReference =+ LambdaVariableReference {+ -- | The name of the lambda-bound variable+ lambdaVariableReferenceVariable :: Model.Name,+ -- | The id of the node at the binding lambda+ lambdaVariableReferenceBoundByNode :: TermNodeId,+ -- | The type of the variable+ lambdaVariableReferenceType :: Model.Type}+ deriving (Eq, Ord, Read, Show)++_LambdaVariableReference = Model.Name "hydra.core.paths.LambdaVariableReference"++_LambdaVariableReference_variable = Model.Name "variable"++_LambdaVariableReference_boundByNode = Model.Name "boundByNode"++_LambdaVariableReference_type = Model.Name "type"++-- | A reference to a let-bound variable: the node introducing it is the bound term+data LetVariableReference =+ LetVariableReference {+ -- | The name of the let-bound variable+ letVariableReferenceVariable :: Model.Name,+ -- | The id of the node at the bound term+ letVariableReferenceBindingNode :: TermNodeId,+ -- | The type of the variable+ letVariableReferenceType :: Model.Type}+ deriving (Eq, Ord, Read, Show)++_LetVariableReference = Model.Name "hydra.core.paths.LetVariableReference"++_LetVariableReference_variable = Model.Name "variable"++_LetVariableReference_bindingNode = Model.Name "bindingNode"++_LetVariableReference_type = Model.Name "type"++-- | A reference to a named type of the schema (analogous to a let-bound variable)+data NominalTypeReference =+ NominalTypeReference {+ -- | The name of the referenced schema type+ nominalTypeReferenceName :: Model.Name}+ deriving (Eq, Ord, Read, Show)++_NominalTypeReference = Model.Name "hydra.core.paths.NominalTypeReference"++_NominalTypeReference_name = Model.Name "name"++-- | A reference to a primitive function+data PrimitiveReference =+ PrimitiveReference {+ -- | The name of the primitive+ primitiveReferenceName :: Model.Name,+ -- | The type of the primitive+ primitiveReferenceType :: Model.Type}+ deriving (Eq, Ord, Read, Show)++_PrimitiveReference = Model.Name "hydra.core.paths.PrimitiveReference"++_PrimitiveReference_name = Model.Name "name"++_PrimitiveReference_type = Model.Name "type"++-- | An outgoing link to an immediate subterm, carried inline as a child node+data SubtermLink =+ SubtermLink {+ -- | The step by which the child subterm is reached+ subtermLinkStep :: SubtermStep,+ -- | The child node (inline; the structure is a tree)+ subtermLinkChild :: TermNode}+ deriving (Eq, Ord, Read, Show)++_SubtermLink = Model.Name "hydra.core.paths.SubtermLink"++_SubtermLink_step = Model.Name "step"++_SubtermLink_child = Model.Name "child"++-- | A sequence of subterm steps forming a path through a term, root first+newtype SubtermPath =+ SubtermPath {+ unSubtermPath :: [SubtermStep]}+ deriving (Eq, Ord, Read, Show)++_SubtermPath = Model.Name "hydra.core.paths.SubtermPath"++-- | A function which maps from a term to a particular immediate subterm+data SubtermStep =+ -- | Access the annotation of an annotated term+ SubtermStepAnnotatedAnnotation |+ -- | Access the body of an annotated term+ SubtermStepAnnotatedBody |+ -- | Access the argument of an application term+ SubtermStepApplicationArgument |+ -- | Access the function of an application term+ SubtermStepApplicationFunction |+ -- | Access the handler of a specific case of a case statement by field name+ SubtermStepCasesCase Model.Name |+ -- | Access the default case of a case statement+ SubtermStepCasesDefault |+ -- | Access the left term of an either value+ SubtermStepEitherLeft |+ -- | Access the right term of an either value+ SubtermStepEitherRight |+ -- | Access the injected term of a union injection by field name+ SubtermStepInjectField Model.Name |+ -- | Access the body of a lambda term+ SubtermStepLambdaBody |+ -- | Access a specific binding in a let term by variable name+ SubtermStepLetBinding Model.Name |+ -- | Access the body of a let term+ SubtermStepLetBody |+ -- | Access an element of a list by index+ SubtermStepListElement Int |+ -- | Access the map entry at the given index as a pair (k, v). Accessing this step constructs the pair; the entry is not itself a subterm occurrence, though its key and value components are, reached via pairFirst/pairSecond. Entry indexes follow the total order on serializable terms.+ SubtermStepMapEntry Int |+ -- | Access the term inside a given (present) optional value+ SubtermStepOptionalGiven |+ -- | Access the first term of a pair+ SubtermStepPairFirst |+ -- | Access the second term of a pair+ SubtermStepPairSecond |+ -- | Access a field of a record by field name+ SubtermStepRecordField Model.Name |+ -- | Access an element of a set by index+ SubtermStepSetElement Int |+ -- | Access the body of a type application term+ SubtermStepTypeApplicationBody |+ -- | Access the body of a type lambda term+ SubtermStepTypeLambdaBody |+ -- | Access the body of a wrapped term+ SubtermStepWrapBody+ deriving (Eq, Ord, Read, Show)++_SubtermStep = Model.Name "hydra.core.paths.SubtermStep"++_SubtermStep_annotatedAnnotation = Model.Name "annotatedAnnotation"++_SubtermStep_annotatedBody = Model.Name "annotatedBody"++_SubtermStep_applicationArgument = Model.Name "applicationArgument"++_SubtermStep_applicationFunction = Model.Name "applicationFunction"++_SubtermStep_casesCase = Model.Name "casesCase"++_SubtermStep_casesDefault = Model.Name "casesDefault"++_SubtermStep_eitherLeft = Model.Name "eitherLeft"++_SubtermStep_eitherRight = Model.Name "eitherRight"++_SubtermStep_injectField = Model.Name "injectField"++_SubtermStep_lambdaBody = Model.Name "lambdaBody"++_SubtermStep_letBinding = Model.Name "letBinding"++_SubtermStep_letBody = Model.Name "letBody"++_SubtermStep_listElement = Model.Name "listElement"++_SubtermStep_mapEntry = Model.Name "mapEntry"++_SubtermStep_optionalGiven = Model.Name "optionalGiven"++_SubtermStep_pairFirst = Model.Name "pairFirst"++_SubtermStep_pairSecond = Model.Name "pairSecond"++_SubtermStep_recordField = Model.Name "recordField"++_SubtermStep_setElement = Model.Name "setElement"++_SubtermStep_typeApplicationBody = Model.Name "typeApplicationBody"++_SubtermStep_typeLambdaBody = Model.Name "typeLambdaBody"++_SubtermStep_wrapBody = Model.Name "wrapBody"++-- | An outgoing link to an immediate subtype, carried inline as a child node+data SubtypeLink =+ SubtypeLink {+ -- | The step by which the child subtype is reached+ subtypeLinkStep :: SubtypeStep,+ -- | The child node (inline; the structure is a tree)+ subtypeLinkChild :: TypeNode}+ deriving (Eq, Ord, Read, Show)++_SubtypeLink = Model.Name "hydra.core.paths.SubtypeLink"++_SubtypeLink_step = Model.Name "step"++_SubtypeLink_child = Model.Name "child"++-- | A sequence of subtype steps forming a path through a type, root first+newtype SubtypePath =+ SubtypePath {+ unSubtypePath :: [SubtypeStep]}+ deriving (Eq, Ord, Read, Show)++_SubtypePath = Model.Name "hydra.core.paths.SubtypePath"++-- | A function which maps from a type to a particular immediate subtype+data SubtypeStep =+ -- | Access the body of an annotated type (the annotation is a term; there is no step for it)+ SubtypeStepAnnotatedBody |+ -- | Access the argument of an application type+ SubtypeStepApplicationArgument |+ -- | Access the function of an application type+ SubtypeStepApplicationFunction |+ -- | Access the value type of an effect type+ SubtypeStepEffectValue |+ -- | Access the left type of an either type+ SubtypeStepEitherLeft |+ -- | Access the right type of an either type+ SubtypeStepEitherRight |+ -- | Access the body of a universally quantified type+ SubtypeStepForallBody |+ -- | Access the codomain type of a function type+ SubtypeStepFunctionCodomain |+ -- | Access the domain type of a function type+ SubtypeStepFunctionDomain |+ -- | Access the element type of a list type+ SubtypeStepListElement |+ -- | Access the key type of a map type+ SubtypeStepMapKeys |+ -- | Access the value type of a map type+ SubtypeStepMapValues |+ -- | Access the element type of an optional type+ SubtypeStepOptionalElement |+ -- | Access the first type of a pair type+ SubtypeStepPairFirst |+ -- | Access the second type of a pair type+ SubtypeStepPairSecond |+ -- | Access a field type of a record type by field name+ SubtypeStepRecordField Model.Name |+ -- | Access the element type of a set type+ SubtypeStepSetElement |+ -- | Access a field type of a union type by field name+ SubtypeStepUnionField Model.Name |+ -- | Access the body type of a wrapped type+ SubtypeStepWrapBody+ deriving (Eq, Ord, Read, Show)++_SubtypeStep = Model.Name "hydra.core.paths.SubtypeStep"++_SubtypeStep_annotatedBody = Model.Name "annotatedBody"++_SubtypeStep_applicationArgument = Model.Name "applicationArgument"++_SubtypeStep_applicationFunction = Model.Name "applicationFunction"++_SubtypeStep_effectValue = Model.Name "effectValue"++_SubtypeStep_eitherLeft = Model.Name "eitherLeft"++_SubtypeStep_eitherRight = Model.Name "eitherRight"++_SubtypeStep_forallBody = Model.Name "forallBody"++_SubtypeStep_functionCodomain = Model.Name "functionCodomain"++_SubtypeStep_functionDomain = Model.Name "functionDomain"++_SubtypeStep_listElement = Model.Name "listElement"++_SubtypeStep_mapKeys = Model.Name "mapKeys"++_SubtypeStep_mapValues = Model.Name "mapValues"++_SubtypeStep_optionalElement = Model.Name "optionalElement"++_SubtypeStep_pairFirst = Model.Name "pairFirst"++_SubtypeStep_pairSecond = Model.Name "pairSecond"++_SubtypeStep_recordField = Model.Name "recordField"++_SubtypeStep_setElement = Model.Name "setElement"++_SubtypeStep_unionField = Model.Name "unionField"++_SubtypeStep_wrapBody = Model.Name "wrapBody"++-- | A non-term constituent of this node's term, with its value+data TermAttributeLink =+ -- | The name of the union type eliminated by a case statement+ TermAttributeLinkCasesTypeName Model.Name |+ -- | The name of the union type of an injection+ TermAttributeLinkInjectTypeName Model.Name |+ -- | The (given) domain type of a lambda+ TermAttributeLinkLambdaDomainGiven Model.Type |+ -- | The parameter name of a lambda+ TermAttributeLinkLambdaParameter Model.Name |+ -- | The name of a let binding together with its (given) type scheme+ TermAttributeLinkLetBindingTypeSchemeGiven (Model.Name, Model.TypeScheme) |+ -- | The literal value of a literal term (a leaf)+ TermAttributeLinkLiteral Model.Literal |+ -- | The name of the field projected by a projection+ TermAttributeLinkProjectFieldName Model.Name |+ -- | The name of the record type of a projection+ TermAttributeLinkProjectTypeName Model.Name |+ -- | The name of the record type of a record term+ TermAttributeLinkRecordTypeName Model.Name |+ -- | The type argument of a type application term+ TermAttributeLinkTypeApplicationType Model.Type |+ -- | The type-variable parameter of a type lambda term+ TermAttributeLinkTypeLambdaParameter Model.Name |+ -- | The name of the wrapper type eliminated by an unwrap+ TermAttributeLinkUnwrapTypeName Model.Name |+ -- | The name of the wrapper type of a wrapped term+ TermAttributeLinkWrapTypeName Model.Name+ deriving (Eq, Ord, Read, Show)++_TermAttributeLink = Model.Name "hydra.core.paths.TermAttributeLink"++_TermAttributeLink_casesTypeName = Model.Name "casesTypeName"++_TermAttributeLink_injectTypeName = Model.Name "injectTypeName"++_TermAttributeLink_lambdaDomainGiven = Model.Name "lambdaDomainGiven"++_TermAttributeLink_lambdaParameter = Model.Name "lambdaParameter"++_TermAttributeLink_letBindingTypeSchemeGiven = Model.Name "letBindingTypeSchemeGiven"++_TermAttributeLink_literal = Model.Name "literal"++_TermAttributeLink_projectFieldName = Model.Name "projectFieldName"++_TermAttributeLink_projectTypeName = Model.Name "projectTypeName"++_TermAttributeLink_recordTypeName = Model.Name "recordTypeName"++_TermAttributeLink_typeApplicationType = Model.Name "typeApplicationType"++_TermAttributeLink_typeLambdaParameter = Model.Name "typeLambdaParameter"++_TermAttributeLink_unwrapTypeName = Model.Name "unwrapTypeName"++_TermAttributeLink_wrapTypeName = Model.Name "wrapTypeName"++-- | A typed graph as a term graph: one root node per binding of the graph+data TermGraph =+ TermGraph {+ -- | The root nodes, keyed by binding name+ termGraphRoots :: (M.Map Model.Name TermNode)}+ deriving (Eq, Ord, Read, Show)++_TermGraph = Model.Name "hydra.core.paths.TermGraph"++_TermGraph_roots = Model.Name "roots"++-- | An outgoing link of a term node: an inline subterm, a variable occurrence, or a non-term attribute+data TermLink =+ -- | A non-term constituent of this node's term+ TermLinkAttribute TermAttributeLink |+ -- | A variable or primitive occurrence+ TermLinkReference TermReferenceLink |+ -- | An immediate subterm, carried inline+ TermLinkSubterm SubtermLink+ deriving (Eq, Ord, Read, Show)++_TermLink = Model.Name "hydra.core.paths.TermLink"++_TermLink_attribute = Model.Name "attribute"++_TermLink_reference = Model.Name "reference"++_TermLink_subterm = Model.Name "subterm"++-- | A node in a term graph: a subterm as written, its type, and its outgoing links+data TermNode =+ TermNode {+ -- | The subterm as written+ termNodeTerm :: Model.Term,+ -- | The subterm's type (a binding's forall type at roots), via hydra.core.checking+ termNodeType :: Model.Type,+ -- | The outgoing links of the node+ termNodeLinks :: [TermLink]}+ deriving (Eq, Ord, Read, Show)++_TermNode = Model.Name "hydra.core.paths.TermNode"++_TermNode_term = Model.Name "term"++_TermNode_type = Model.Name "type"++_TermNode_links = Model.Name "links"++-- | The id of a term-graph node: a root binding name plus a subterm path from that root. A root node's id has an empty path. A letBinding step appears only for an actual nested let inside a binding's term, never as a leading pseudo-step.+data TermNodeId =+ TermNodeId {+ -- | The name of the root binding+ termNodeIdRoot :: Model.Name,+ -- | The subterm path from the root+ termNodeIdPath :: SubtermPath}+ deriving (Eq, Ord, Read, Show)++_TermNodeId = Model.Name "hydra.core.paths.TermNodeId"++_TermNodeId_root = Model.Name "root"++_TermNodeId_path = Model.Name "path"++-- | The target of a variable or primitive occurrence+data TermReference =+ -- | A reference to a lambda-bound variable+ TermReferenceLambda LambdaVariableReference |+ -- | A reference to a let-bound variable+ TermReferenceLet LetVariableReference |+ -- | A reference to a primitive function+ TermReferencePrimitive PrimitiveReference+ deriving (Eq, Ord, Read, Show)++_TermReference = Model.Name "hydra.core.paths.TermReference"++_TermReference_lambda = Model.Name "lambda"++_TermReference_let = Model.Name "let"++_TermReference_primitive = Model.Name "primitive"++-- | An outgoing link to a variable or primitive occurrence+data TermReferenceLink =+ TermReferenceLink {+ -- | The step by which the occurrence is reached+ termReferenceLinkStep :: SubtermStep,+ -- | The referenced binding, lambda parameter, or primitive+ termReferenceLinkTarget :: TermReference}+ deriving (Eq, Ord, Read, Show)++_TermReferenceLink = Model.Name "hydra.core.paths.TermReferenceLink"++_TermReferenceLink_step = Model.Name "step"++_TermReferenceLink_target = Model.Name "target"++-- | A non-type constituent of this node's type, with its value+data TypeAttributeLink =+ -- | The annotation of an annotated type (a term; not descended into)+ TypeAttributeLinkAnnotatedAnnotation Model.Term |+ -- | The type-variable parameter of a universally quantified type+ TypeAttributeLinkForallParameter Model.Name |+ -- | The literal type of a literal type (a leaf)+ TypeAttributeLinkLiteral Model.LiteralType+ deriving (Eq, Ord, Read, Show)++_TypeAttributeLink = Model.Name "hydra.core.paths.TypeAttributeLink"++_TypeAttributeLink_annotatedAnnotation = Model.Name "annotatedAnnotation"++_TypeAttributeLink_forallParameter = Model.Name "forallParameter"++_TypeAttributeLink_literal = Model.Name "literal"++-- | A schema as a type graph: one root node per named type+data TypeGraph =+ TypeGraph {+ -- | The root nodes, keyed by type name+ typeGraphRoots :: (M.Map Model.Name TypeNode)}+ deriving (Eq, Ord, Read, Show)++_TypeGraph = Model.Name "hydra.core.paths.TypeGraph"++_TypeGraph_roots = Model.Name "roots"++-- | An outgoing link of a type node: an inline subtype, a type reference, or a non-type attribute+data TypeLink =+ -- | A non-type constituent of this node's type+ TypeLinkAttribute TypeAttributeLink |+ -- | A named-type or type-variable occurrence+ TypeLinkReference TypeReferenceLink |+ -- | An immediate subtype, carried inline+ TypeLinkSubtype SubtypeLink+ deriving (Eq, Ord, Read, Show)++_TypeLink = Model.Name "hydra.core.paths.TypeLink"++_TypeLink_attribute = Model.Name "attribute"++_TypeLink_reference = Model.Name "reference"++_TypeLink_subtype = Model.Name "subtype"++-- | A node in a type graph: a subtype as written and its outgoing links+data TypeNode =+ TypeNode {+ -- | The subtype as written (needed for linkless leaves: literal types, unit, void)+ typeNodeType :: Model.Type,+ -- | The outgoing links of the node+ typeNodeLinks :: [TypeLink]}+ deriving (Eq, Ord, Read, Show)++_TypeNode = Model.Name "hydra.core.paths.TypeNode"++_TypeNode_type = Model.Name "type"++_TypeNode_links = Model.Name "links"++-- | The id of a type-graph node: a root type name plus a subtype path from that root. A root node's id has an empty path. There is no enclosing-let analog for schemas.+data TypeNodeId =+ TypeNodeId {+ -- | The name of the root type+ typeNodeIdRoot :: Model.Name,+ -- | The subtype path from the root+ typeNodeIdPath :: SubtypePath}+ deriving (Eq, Ord, Read, Show)++_TypeNodeId = Model.Name "hydra.core.paths.TypeNodeId"++_TypeNodeId_root = Model.Name "root"++_TypeNodeId_path = Model.Name "path"++-- | The target of a named-type or type-variable occurrence+data TypeReference =+ -- | A reference to a named type of the schema+ TypeReferenceNominal NominalTypeReference |+ -- | A reference to a forall-bound type variable+ TypeReferenceVariable TypeVariableReference+ deriving (Eq, Ord, Read, Show)++_TypeReference = Model.Name "hydra.core.paths.TypeReference"++_TypeReference_nominal = Model.Name "nominal"++_TypeReference_variable = Model.Name "variable"++-- | An outgoing link to a named-type or type-variable occurrence+data TypeReferenceLink =+ TypeReferenceLink {+ -- | The step by which the occurrence is reached+ typeReferenceLinkStep :: SubtypeStep,+ -- | The referenced named type or type variable+ typeReferenceLinkTarget :: TypeReference}+ deriving (Eq, Ord, Read, Show)++_TypeReferenceLink = Model.Name "hydra.core.paths.TypeReferenceLink"++_TypeReferenceLink_step = Model.Name "step"++_TypeReferenceLink_target = Model.Name "target"++-- | A reference to a forall-bound type variable: the node introducing it is the binder+data TypeVariableReference =+ TypeVariableReference {+ -- | The name of the forall-bound type variable+ typeVariableReferenceVariable :: Model.Name,+ -- | The id of the node at the binding forall+ typeVariableReferenceBoundByNode :: TypeNodeId}+ deriving (Eq, Ord, Read, Show)++_TypeVariableReference = Model.Name "hydra.core.paths.TypeVariableReference"++_TypeVariableReference_variable = Model.Name "variable"++_TypeVariableReference_boundByNode = Model.Name "boundByNode"
@@ -0,0 +1,223 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Type and term classification predicates++module Hydra.Core.Predicates where++import qualified Hydra.Core.Arity as Arity+import qualified Hydra.Core.Ast as Ast+import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Decode.Model as DecodeModel+import qualified Hydra.Core.Dependencies as Dependencies+import qualified Hydra.Core.Diff as Diff+import qualified Hydra.Core.Docs as Docs+import qualified Hydra.Core.Error.Checking as Checking+import qualified Hydra.Core.Error.File as ErrorFile+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Error.Packaging as ErrorPackaging+import qualified Hydra.Core.Error.System as ErrorSystem+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Json.Model as JsonModel+import qualified Hydra.Core.Lexical as Lexical+import qualified Hydra.Core.Overlay.Haskell.Lib.Eithers as Eithers+import qualified Hydra.Core.Overlay.Haskell.Lib.Equality as Equality+import qualified Hydra.Core.Overlay.Haskell.Lib.Functions as Functions+import qualified Hydra.Core.Overlay.Haskell.Lib.Lists as Lists+import qualified Hydra.Core.Overlay.Haskell.Lib.Logic as Logic+import qualified Hydra.Core.Overlay.Haskell.Lib.Maps as Maps+import qualified Hydra.Core.Overlay.Haskell.Lib.Optionals as Optionals+import qualified Hydra.Core.Overlay.Haskell.Lib.Ordering as Ordering+import qualified Hydra.Core.Overlay.Haskell.Lib.Pairs as Pairs+import qualified Hydra.Core.Overlay.Haskell.Lib.Sets as Sets+import qualified Hydra.Core.Overlay.Haskell.Lib.Strings as Strings+import qualified Hydra.Core.Markdown as Markdown+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Parsing as Parsing+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Query as Query+import qualified Hydra.Core.Reflect as Reflect+import qualified Hydra.Core.Regex as Regex+import qualified Hydra.Core.Relational as Relational+import qualified Hydra.Core.Rewriting as Rewriting+import qualified Hydra.Core.Scoping as Scoping+import qualified Hydra.Core.Strip as Strip+import qualified Hydra.Core.System as System+import qualified Hydra.Core.Tabular as Tabular+import qualified Hydra.Core.Testing as Testing+import qualified Hydra.Core.Time as Time+import qualified Hydra.Core.Topology as Topology+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Validation as Validation+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void+import qualified Data.Map as M++-- | Check if a binding needs to be treated as a function+isComplexBinding :: Graph.Graph -> Model.Binding -> Bool+isComplexBinding tc b =++ let term = Model.bindingTerm b+ mts = Model.bindingTypeScheme b+ in (Optionals.match mts (isComplexTerm tc term) (\ts ->+ let isPolymorphic = Logic.not (Lists.isEmpty (Model.typeSchemeVariables ts))+ isNonNullary = Ordering.gt (Arity.typeArity (Model.typeSchemeBody ts)) 0+ isComplex = isComplexTerm tc term+ in (Logic.or (Logic.or isPolymorphic isNonNullary) isComplex)))++-- | Check if a term needs to be treated as a function rather than a simple value+isComplexTerm :: Graph.Graph -> Model.Term -> Bool+isComplexTerm tc t =+ case t of+ Model.TermLet _ -> True+ Model.TermTypeApplication _ -> True+ Model.TermTypeLambda _ -> True+ Model.TermVariable v0 -> isComplexVariable tc v0+ _ -> Lists.foldl (\b -> \sub -> Logic.or b (isComplexTerm tc sub)) False (Rewriting.subterms t)++-- | Check if a variable is bound to a complex term+isComplexVariable :: Graph.Graph -> Model.Name -> Bool+isComplexVariable tc name =++ let metaLookup = Maps.lookup name (Graph.graphMetadata tc)+ in (Logic.ifElse (Optionals.isGiven metaLookup) True (Logic.ifElse (Sets.member name (Graph.graphLambdaVariables tc)) True (+ let typeLookup = Maps.lookup name (Graph.graphBoundTypes tc)+ in (Optionals.match typeLookup (+ let primLookup = Maps.lookup name (Graph.graphPrimitives tc)+ in (Optionals.match primLookup True (\prim -> Ordering.gt (Arity.typeSchemeArity (Scoping.termSignatureToTypeScheme (Packaging.primitiveDefinitionSignature (Graph.primitiveDefinition prim)))) 0))) (\ts -> Ordering.gt (Arity.typeSchemeArity ts) 0)))))++-- | Determines whether a given term is an encoded term (meta-level term)+isEncodedTerm :: Model.Term -> Bool+isEncodedTerm t =+ case (Strip.deannotateTerm t) of+ Model.TermApplication v0 -> isEncodedTerm (Model.applicationFunction v0)+ Model.TermInject v0 -> Equality.equal "hydra.core.model.Term" (Model.unName (Model.injectionTypeName v0))+ _ -> False++-- | Determines whether a given term is an encoded type+isEncodedType :: Model.Term -> Bool+isEncodedType t =+ case (Strip.deannotateTerm t) of+ Model.TermApplication v0 -> isEncodedType (Model.applicationFunction v0)+ Model.TermInject v0 -> Equality.equal "hydra.core.model.Type" (Model.unName (Model.injectionTypeName v0))+ _ -> False++-- | Check if a row type represents an enum (all fields are unit-typed)+isEnumRowType :: [Model.FieldType] -> Bool+isEnumRowType rt =+ Lists.foldl Logic.and True (Lists.map (\f -> isUnitType (Strip.deannotateType (Model.fieldTypeType f))) rt)++-- | Check if a type is an enum type+isEnumType :: Model.Type -> Bool+isEnumType typ =+ case (Strip.deannotateType typ) of+ Model.TypeUnion v0 -> isEnumRowType v0+ _ -> False++-- | Check whether a type is a nominal type definition (record, union, wrap, or forall wrapping one). Type aliases (applications, functions, literal types, etc.) return false.+isNominalType :: Model.Type -> Bool+isNominalType typ =+ case (Strip.deannotateType typ) of+ Model.TypeRecord _ -> True+ Model.TypeUnion _ -> True+ Model.TypeWrap _ -> True+ Model.TypeForall v0 -> isNominalType (Model.forallTypeBody v0)+ _ -> False++-- | Check if an element is serializable (no function, effect, or void types in dependencies) (Either version)+isSerializable :: t0 -> Graph.Graph -> Model.Binding -> Either Errors.Error Bool+isSerializable cx graph el =++ let variants =+ \typ -> Lists.map Reflect.typeVariant (Rewriting.foldOverType Coders.TraversalOrderPre (\m -> \t -> Lists.cons t m) [] typ)+ in (Eithers.map (\deps ->+ let allVariants = Sets.fromList (Lists.concat (Lists.map variants (Maps.elems deps)))+ in (Logic.not (Logic.or (Sets.member Variants.TypeVariantEffect allVariants) (Logic.or (Sets.member Variants.TypeVariantFunction allVariants) (Sets.member Variants.TypeVariantVoid allVariants))))) (typeDependencies cx graph False Functions.identity (Model.bindingName el)))++-- | Check if a type (by name) is serializable, resolving all type dependencies (no function, effect, or void types) (Either version)+isSerializableByName :: t0 -> Graph.Graph -> Model.Name -> Either Errors.Error Bool+isSerializableByName cx graph name =++ let variants =+ \typ -> Lists.map Reflect.typeVariant (Rewriting.foldOverType Coders.TraversalOrderPre (\m -> \t -> Lists.cons t m) [] typ)+ in (Eithers.map (\deps ->+ let allVariants = Sets.fromList (Lists.concat (Lists.map variants (Maps.elems deps)))+ in (Logic.not (Logic.or (Sets.member Variants.TypeVariantEffect allVariants) (Logic.or (Sets.member Variants.TypeVariantFunction allVariants) (Sets.member Variants.TypeVariantVoid allVariants))))) (typeDependencies cx graph False Functions.identity name))++-- | Check if a type is serializable (no function, effect, or void types in the type itself)+isSerializableType :: Model.Type -> Bool+isSerializableType typ =++ let allVariants =+ Sets.fromList (Lists.map Reflect.typeVariant (Rewriting.foldOverType Coders.TraversalOrderPre (\m -> \t -> Lists.cons t m) [] typ))+ in (Logic.not (Logic.or (Sets.member Variants.TypeVariantEffect allVariants) (Logic.or (Sets.member Variants.TypeVariantFunction allVariants) (Sets.member Variants.TypeVariantVoid allVariants))))++-- | Check if a term is trivially cheap (no thunking needed)+isTrivialTerm :: Model.Term -> Bool+isTrivialTerm t =+ case (Strip.deannotateTerm t) of+ Model.TermLiteral _ -> True+ Model.TermVariable v0 -> Equality.equal (Lists.length (Strings.splitOn "." (Model.unName v0))) 1+ Model.TermUnit -> True+ Model.TermApplication v0 ->+ let fun = Model.applicationFunction v0+ arg = Model.applicationArgument v0+ in case fun of+ Model.TermProject _ -> isTrivialTerm arg+ Model.TermUnwrap _ -> isTrivialTerm arg+ _ -> False+ Model.TermOptional v0 -> Optionals.match v0 True (\inner -> isTrivialTerm inner)+ Model.TermRecord v0 -> Lists.foldl (\acc -> \fld -> Logic.and acc (isTrivialTerm (Model.fieldTerm fld))) True (Model.recordFields v0)+ Model.TermWrap v0 -> isTrivialTerm (Model.wrappedTermBody v0)+ Model.TermTypeApplication v0 -> isTrivialTerm (Model.typeApplicationTermBody v0)+ Model.TermTypeLambda v0 -> isTrivialTerm (Model.typeLambdaBody v0)+ _ -> False++-- | Check whether a type is a type (always true for non-encoded types)+isType :: Model.Type -> Bool+isType t =+ case (Strip.deannotateType t) of+ Model.TypeApplication v0 -> isType (Model.applicationTypeFunction v0)+ Model.TypeForall v0 -> isType (Model.forallTypeBody v0)+ Model.TypeUnion _ -> False+ Model.TypeVariable v0 -> Equality.equal v0 (Model.Name "hydra.core.model.Type")+ _ -> False++-- | Check whether a term is the unit term+isUnitTerm :: Model.Term -> Bool+isUnitTerm x =+ case x of+ Model.TermUnit -> True+ _ -> False++-- | Check whether a type is the unit type+isUnitType :: Model.Type -> Bool+isUnitType x =+ case x of+ Model.TypeUnit -> True+ _ -> False++-- | Get all type dependencies for a given type name (Either version)+typeDependencies :: t0 -> Graph.Graph -> Bool -> (Model.Type -> Model.Type) -> Model.Name -> Either Errors.Error (M.Map Model.Name Model.Type)+typeDependencies cx graph withSchema transform name =++ let requireType =+ \name2 ->+ let cx1 = cx+ in (Eithers.bind (Lexical.requireBinding graph name2) (\el -> Eithers.bimap (\_e -> Errors.ErrorDecoding _e) (\_a -> _a) (DecodeModel.type_ graph (Model.bindingTerm el))))+ toPair = \name2 -> Eithers.map (\typ -> (name2, (transform typ))) (requireType name2)+ deps =+ \seeds -> \names -> Logic.ifElse (Sets.isEmpty seeds) (Right names) (Eithers.bind (Eithers.mapList toPair (Sets.toList seeds)) (\pairs ->+ let newNames = Maps.union names (Maps.fromList pairs)+ refs =+ Lists.foldl Sets.union Sets.empty (Lists.map (\pair -> Dependencies.typeDependencyNames withSchema (Pairs.second pair)) pairs)+ visited = Sets.fromList (Maps.keys names)+ newSeeds = Sets.difference refs visited+ in (deps newSeeds newNames)))+ in (deps (Sets.singleton name) Maps.empty)
@@ -0,0 +1,91 @@+-- Note: this is an automatically generated file. Do not edit.++-- | String representations of hydra.core.docs types++module Hydra.Core.Print.Docs where++import qualified Hydra.Core.Ast as Ast+import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Diff as Diff+import qualified Hydra.Core.Docs as Docs+import qualified Hydra.Core.Error.Checking as Checking+import qualified Hydra.Core.Error.File as ErrorFile+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Error.Packaging as ErrorPackaging+import qualified Hydra.Core.Error.System as ErrorSystem+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Json.Model as JsonModel+import qualified Hydra.Core.Overlay.Haskell.Lib.Lists as Lists+import qualified Hydra.Core.Overlay.Haskell.Lib.Strings as Strings+import qualified Hydra.Core.Markdown as Markdown+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Parse.Docs as ParseDocs+import qualified Hydra.Core.Parsing as Parsing+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Query as Query+import qualified Hydra.Core.Regex as Regex+import qualified Hydra.Core.Relational as Relational+import qualified Hydra.Core.System as System+import qualified Hydra.Core.Tabular as Tabular+import qualified Hydra.Core.Testing as Testing+import qualified Hydra.Core.Time as Time+import qualified Hydra.Core.Topology as Topology+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Validation as Validation+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | Render a DefinitionReference as its fully-qualified name+definitionReference :: Packaging.DefinitionReference -> String+definitionReference x =+ case x of+ Packaging.DefinitionReferencePrimitive v0 -> Model.unName v0+ Packaging.DefinitionReferenceTerm v0 -> Model.unName v0+ Packaging.DefinitionReferenceType v0 -> Model.unName v0++-- | Render a single DocSegment back to its source string form+docSegment :: Docs.DocSegment -> String+docSegment seg = docSegmentWith entityReference seg++-- | Render a single DocSegment using a custom 'EntityReference' renderer+docSegmentWith :: (Packaging.EntityReference -> String) -> Docs.DocSegment -> String+docSegmentWith render x =+ case x of+ Docs.DocSegmentRef v0 -> render v0+ Docs.DocSegmentText v0 -> v0++-- | Render a list of DocSegments back to a plain documentation string+docSegments :: [Docs.DocSegment] -> String+docSegments segs = Strings.concat (Lists.map docSegment segs)++-- | Render a list of DocSegments using a custom 'EntityReference' renderer+docSegmentsWith :: (Packaging.EntityReference -> String) -> [Docs.DocSegment] -> String+docSegmentsWith render segs = Strings.concat (Lists.map (docSegmentWith render) segs)++-- | Render a 'EntityReference' as its doc-escape tag string (without the surrounding braces)+entityReference :: Packaging.EntityReference -> String+entityReference x =+ case x of+ Packaging.EntityReferenceDefinition v0 -> Strings.concat2 (case v0 of+ Packaging.DefinitionReferencePrimitive _ -> "primitive"+ Packaging.DefinitionReferenceTerm _ -> "term"+ Packaging.DefinitionReferenceType _ -> "type") (Strings.concat2 " " (definitionReference v0))+ Packaging.EntityReferenceModule v0 -> Strings.concat2 "module " (Packaging.unModuleName v0)+ Packaging.EntityReferencePackage v0 -> Strings.concat2 "package " (Packaging.unPackageName v0)+ Packaging.EntityReferenceTermExpr v0 -> Strings.concat2 "term-expr " v0+ Packaging.EntityReferenceTypeExpr v0 -> Strings.concat2 "type-expr " v0++-- | Parse a documentation string and re-render it, converting doc-escape tags through their canonical form+renderDocString :: String -> String+renderDocString s = renderDocStringWith entityReference s++-- | Parse a documentation string and render it using a custom 'EntityReference' renderer. Text segments are passed through; ref segments are rendered by the provided function. Unrecognized doc-escape blocks are passed through as text.+renderDocStringWith :: (Packaging.EntityReference -> String) -> String -> String+renderDocStringWith render s = docSegmentsWith render (ParseDocs.parseDocString s)
@@ -0,0 +1,173 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Per-dialect printer rendering the hydra.core.regex AST into GNU Emacs regexp syntax. Emacs inverts several escaping conventions relative to POSIX ERE (probe-verified, Emacs 28.2): alternation is \| (bare | is literal), grouping is \( \) (bare ( ) are literal), and bounded quantifiers are \{n,m\} (bare braces are literal). The quantifiers * + ? are bare as usual. Hydra's . (any incl. newline) renders as [^z-a] — an empty negated range that matches every character including newline (Emacs . excludes newline). Three further divergences, each probe-verified (issue #603): (1) anchors ^ and $ (whole-STRING boundaries in Hydra) render as the GNU whole-buffer anchors \` and \', because Emacs's native ^ and $ are line-oriented; (2) character-class metacharacters ] ^ - are disambiguated POSITIONALLY (] first, - last, ^ never first) rather than by backslash-escaping, because Emacs bracket expressions are POSIX-like and have no escape mechanism inside [...] (a backslash there is an ordinary character); (3) alternation branches are ordered by descending rendered length, because Emacs's alternation is leftmost-FIRST, unlike Hydra's leftmost-LONGEST semantics. See docs/specification/regex.md and issue #567/#603.++module Hydra.Core.Print.Emacs.Regex where++import qualified Hydra.Core.Ast as Ast+import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Diff as Diff+import qualified Hydra.Core.Docs as Docs+import qualified Hydra.Core.Error.Checking as Checking+import qualified Hydra.Core.Error.File as ErrorFile+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Error.Packaging as ErrorPackaging+import qualified Hydra.Core.Error.System as ErrorSystem+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Json.Model as JsonModel+import qualified Hydra.Core.Overlay.Haskell.Lib.Equality as Equality+import qualified Hydra.Core.Overlay.Haskell.Lib.Lists as Lists+import qualified Hydra.Core.Overlay.Haskell.Lib.Literals as Literals+import qualified Hydra.Core.Overlay.Haskell.Lib.Logic as Logic+import qualified Hydra.Core.Overlay.Haskell.Lib.Pairs as Pairs+import qualified Hydra.Core.Overlay.Haskell.Lib.Strings as Strings+import qualified Hydra.Core.Markdown as Markdown+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Parsing as Parsing+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Query as Query+import qualified Hydra.Core.Regex as Regex+import qualified Hydra.Core.Relational as Relational+import qualified Hydra.Core.System as System+import qualified Hydra.Core.Tabular as Tabular+import qualified Hydra.Core.Testing as Testing+import qualified Hydra.Core.Time as Time+import qualified Hydra.Core.Topology as Topology+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Validation as Validation+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | Render an alternation, joining its branches with Emacs's \| operator. Branches are ordered by descending rendered length so that Emacs's leftmost-first matching agrees with Hydra's leftmost-longest semantics for fixed-length alternatives.+alternation :: [[Regex.Quantified]] -> String+alternation alt =++ let rendered = Lists.map regexSequence alt+ byLength = Lists.sortBy Strings.length rendered+ in (Strings.join "\\|" (Lists.reverse byLength))++-- | The Emacs rendering of Hydra's . (any character incl. newline): the empty-negated-range [^z-a].+anyClass :: String+anyClass = "[^z-a]"++-- | Render a single atom; . -> [^z-a], and groups use Emacs's \( \) escaping.+atom :: Regex.Atom -> String+atom a =+ case a of+ Regex.AtomLiteral v0 -> escapeLiteral v0+ Regex.AtomAny -> anyClass+ Regex.AtomAnchorStart -> "\\`"+ Regex.AtomAnchorEnd -> "\\'"+ Regex.AtomGroup v0 -> Strings.concat [+ "\\(",+ (alternation v0),+ "\\)"]+ Regex.AtomClass v0 -> characterClass v0++-- | Render a character class, including the leading ^ for a negated class. Reorders items positionally for Emacs (which has no bracket-expression escaping): a literal ] is moved to the front (immediately after the optional negating ^), a literal - is moved to the back, and (only when there is no literal ] item to occupy the first slot) a literal ^ is moved after the first non-^ item -- Emacs treats a leading ^ as the negation marker regardless of Hydra's negated flag. The one residual gap: a class whose only member is a literal ^ has no safe position on Emacs; this is an extreme corner case (single-item classes are otherwise unremarkable) and is left unhandled here.+characterClass :: Regex.CharacterClass -> String+characterClass cc =++ let items = Regex.characterClassItems cc+ bracketAndRest = Lists.partition (classItemIsLiteral 93) items+ bracketItems = Pairs.first bracketAndRest+ afterBracket = Pairs.second bracketAndRest+ dashAndRest = Lists.partition (classItemIsLiteral 45) afterBracket+ dashItems = Pairs.first dashAndRest+ rest = Pairs.second dashAndRest+ caretAndNonCaret = Lists.partition (classItemIsLiteral 94) rest+ caretItems = Pairs.first caretAndNonCaret+ nonCaretItems = Pairs.second caretAndNonCaret+ safeRest =+ Logic.ifElse (Logic.or (Logic.not (Lists.isEmpty bracketItems)) (Lists.isEmpty nonCaretItems)) rest (Lists.concat2 nonCaretItems caretItems)+ ordered =+ Lists.concat [+ bracketItems,+ safeRest,+ dashItems]+ in (Strings.concat [+ "[",+ (Logic.ifElse (Regex.characterClassNegated cc) "^" ""),+ (Strings.concat (Lists.map classItem ordered)),+ "]"])++-- | Render one character-class member (a single character or an inclusive range). Emacs bracket expressions do NOT support backslash escaping (probe-verified: \- and \] inside [...] are two literal characters, not an escape); the metacharacters ] ^ - are instead disambiguated positionally by characterClass (] first, - last, ^ never first), so a plain character or range here never needs an escape.+classItem :: Regex.ClassItem -> String+classItem item =+ case item of+ Regex.ClassItemCharacter v0 -> printCodePoint v0+ Regex.ClassItemRange v0 -> Strings.concat [+ printCodePoint (Regex.characterRangeFrom v0),+ "-",+ (printCodePoint (Regex.characterRangeTo v0))]++-- | True if a ClassItem is the single literal character code point c (not a range).+classItemIsLiteral :: Int -> Regex.ClassItem -> Bool+classItemIsLiteral c item =+ case item of+ Regex.ClassItemCharacter v0 -> Equality.equal v0 c+ _ -> False++-- | Render a literal code point in top-level context under Emacs regexp, escaping only the characters that are special bare in Emacs: . * + ? [ ] ^ $ \. Note | ( ) { } are literal in Emacs and are NOT escaped here.+escapeLiteral :: Int -> String+escapeLiteral c =++ let isMeta =+ Lists.foldl (\acc -> \m -> Logic.or acc (Equality.equal c m)) False [+ 46,+ 42,+ 43,+ 63,+ 91,+ 93,+ 94,+ 36,+ 92]+ in (Logic.ifElse isMeta (Strings.concat2 "\\" (printCodePoint c)) (printCodePoint c))++-- | Render a single Unicode code point as a one-character string.+printCodePoint :: Int -> String+printCodePoint c = Strings.fromList [+ c]++-- | Render a hydra.core.regex AST into GNU Emacs regexp syntax (escaped \| \( \) \{..\}, . as [^z-a]).+printRegex :: [[Regex.Quantified]] -> String+printRegex r = alternation r++-- | Render an atom followed by its quantifier suffix.+quantified :: Regex.Quantified -> String+quantified qa = Strings.concat2 (atom (Regex.quantifiedAtom qa)) (quantifier (Regex.quantifiedQuantifier qa))++-- | Render a quantifier suffix; bounded {..} forms use Emacs's escaped braces \{..\}.+quantifier :: Regex.Quantifier -> String+quantifier q =+ case q of+ Regex.QuantifierOne -> ""+ Regex.QuantifierZeroOrOne -> "?"+ Regex.QuantifierZeroOrMore -> "*"+ Regex.QuantifierOneOrMore -> "+"+ Regex.QuantifierExactly v0 -> Strings.concat [+ "\\{",+ (Literals.printInt32 v0),+ "\\}"]+ Regex.QuantifierAtLeast v0 -> Strings.concat [+ "\\{",+ (Literals.printInt32 v0),+ ",\\}"]+ Regex.QuantifierRange_ v0 -> Strings.concat [+ "\\{",+ (Literals.printInt32 (Regex.quantifierRangeMin v0)),+ ",",+ (Literals.printInt32 (Regex.quantifierRangeMax v0)),+ "\\}"]++-- | Render a sequence of quantified atoms by concatenation.+regexSequence :: [Regex.Quantified] -> String+regexSequence s = Strings.concat (Lists.map quantified s)
@@ -0,0 +1,453 @@+-- Note: this is an automatically generated file. Do not edit.++-- | String representations of hydra.core.error.model types++module Hydra.Core.Print.Error.Model where++import qualified Hydra.Core.Ast as Ast+import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Diff as Diff+import qualified Hydra.Core.Docs as Docs+import qualified Hydra.Core.Error.Checking as Checking+import qualified Hydra.Core.Error.File as ErrorFile+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Error.Packaging as ErrorPackaging+import qualified Hydra.Core.Error.System as ErrorSystem+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Json.Model as JsonModel+import qualified Hydra.Core.Overlay.Haskell.Lib.Lists as Lists+import qualified Hydra.Core.Overlay.Haskell.Lib.Literals as Literals+import qualified Hydra.Core.Overlay.Haskell.Lib.Strings as Strings+import qualified Hydra.Core.Markdown as Markdown+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Parsing as Parsing+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Print.Model as PrintModel+import qualified Hydra.Core.Print.Variants as PrintVariants+import qualified Hydra.Core.Query as Query+import qualified Hydra.Core.Regex as Regex+import qualified Hydra.Core.Relational as Relational+import qualified Hydra.Core.System as System+import qualified Hydra.Core.Tabular as Tabular+import qualified Hydra.Core.Testing as Testing+import qualified Hydra.Core.Time as Time+import qualified Hydra.Core.Topology as Topology+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Validation as Validation+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | Show a constant condition error as a string+constantConditionError :: ErrorModel.ConstantConditionError -> String+constantConditionError e =+ Strings.concat [+ "constant condition: ifElse with literal ",+ (Literals.printBoolean (ErrorModel.constantConditionErrorValue e))]++-- | Show a duplicate binding error as a string+duplicateBindingError :: ErrorModel.DuplicateBindingError -> String+duplicateBindingError e =+ Strings.concat [+ "duplicate binding: ",+ (Model.unName (ErrorModel.duplicateBindingErrorName e))]++-- | Show a duplicate field error as a string+duplicateFieldError :: ErrorModel.DuplicateFieldError -> String+duplicateFieldError e =+ Strings.concat [+ "duplicate field: ",+ (Model.unName (ErrorModel.duplicateFieldErrorName e))]++-- | Show a duplicate record type field names error as a string+duplicateRecordTypeFieldNamesError :: ErrorModel.DuplicateRecordTypeFieldNamesError -> String+duplicateRecordTypeFieldNamesError e =+ Strings.concat [+ "duplicate field in record type: ",+ (Model.unName (ErrorModel.duplicateRecordTypeFieldNamesErrorName e))]++-- | Show a duplicate union type field names error as a string+duplicateUnionTypeFieldNamesError :: ErrorModel.DuplicateUnionTypeFieldNamesError -> String+duplicateUnionTypeFieldNamesError e =+ Strings.concat [+ "duplicate field in union type: ",+ (Model.unName (ErrorModel.duplicateUnionTypeFieldNamesErrorName e))]++-- | Show an empty case statement error as a string+emptyCaseStatementError :: ErrorModel.EmptyCaseStatementError -> String+emptyCaseStatementError e =+ Strings.concat [+ "empty case statement for type: ",+ (Model.unName (ErrorModel.emptyCaseStatementErrorTypeName e))]++-- | Show an empty let bindings error as a string+emptyLetBindingsError :: t0 -> String+emptyLetBindingsError e = "let expression with no bindings"++-- | Show an empty record type error as a string+emptyRecordTypeError :: t0 -> String+emptyRecordTypeError e = "record type with no fields (use TypeUnit instead)"++-- | Show an empty term annotation error as a string+emptyTermAnnotationError :: t0 -> String+emptyTermAnnotationError e = "term annotation with empty annotation map"++-- | Show an empty type annotation error as a string+emptyTypeAnnotationError :: t0 -> String+emptyTypeAnnotationError e = "type annotation with empty annotation map"++-- | Show an empty type name in term error as a string+emptyTypeNameInTermError :: t0 -> String+emptyTypeNameInTermError e = "term with empty type name"++-- | Show an empty union type error as a string+emptyUnionTypeError :: t0 -> String+emptyUnionTypeError e = "union type with no alternatives (use TypeVoid instead)"++-- | Show an extra record fields error as a string+extraRecordFieldsError :: ErrorModel.ExtraRecordFieldsError -> String+extraRecordFieldsError e =++ let tname = ErrorModel.extraRecordFieldsErrorTypeName e+ fieldNames = ErrorModel.extraRecordFieldsErrorFieldNames e+ in (Strings.concat [+ "record term for type ",+ (Model.unName tname),+ " supplies undeclared field(s): ",+ (Strings.join ", " (Lists.map Model.unName fieldNames))])++-- | Show an invalid forall parameter name error as a string+invalidForallParameterNameError :: ErrorModel.InvalidForallParameterNameError -> String+invalidForallParameterNameError e =+ Strings.concat [+ "invalid forall parameter name: ",+ (Model.unName (ErrorModel.invalidForallParameterNameErrorName e))]++-- | Show an invalid lambda parameter name error as a string+invalidLambdaParameterNameError :: ErrorModel.InvalidLambdaParameterNameError -> String+invalidLambdaParameterNameError e =+ Strings.concat [+ "invalid lambda parameter name: ",+ (Model.unName (ErrorModel.invalidLambdaParameterNameErrorName e))]++-- | Show an invalid let binding name error as a string+invalidLetBindingNameError :: ErrorModel.InvalidLetBindingNameError -> String+invalidLetBindingNameError e =+ Strings.concat [+ "invalid let binding name: ",+ (Model.unName (ErrorModel.invalidLetBindingNameErrorName e))]++-- | Show an invalid term error as a string+invalidTermError :: ErrorModel.InvalidTermError -> String+invalidTermError e =+ Strings.concat2 "invalid term: " (case e of+ ErrorModel.InvalidTermErrorConstantCondition v0 -> constantConditionError v0+ ErrorModel.InvalidTermErrorDuplicateBinding v0 -> duplicateBindingError v0+ ErrorModel.InvalidTermErrorDuplicateField v0 -> duplicateFieldError v0+ ErrorModel.InvalidTermErrorEmptyCaseStatement v0 -> emptyCaseStatementError v0+ ErrorModel.InvalidTermErrorEmptyLetBindings v0 -> emptyLetBindingsError v0+ ErrorModel.InvalidTermErrorEmptyTermAnnotation v0 -> emptyTermAnnotationError v0+ ErrorModel.InvalidTermErrorEmptyTypeNameInTerm v0 -> emptyTypeNameInTermError v0+ ErrorModel.InvalidTermErrorExtraRecordFields v0 -> extraRecordFieldsError v0+ ErrorModel.InvalidTermErrorInvalidLambdaParameterName v0 -> invalidLambdaParameterNameError v0+ ErrorModel.InvalidTermErrorInvalidLetBindingName v0 -> invalidLetBindingNameError v0+ ErrorModel.InvalidTermErrorInvalidTypeLambdaParameterName v0 -> invalidTypeLambdaParameterNameError v0+ ErrorModel.InvalidTermErrorMissingCaseBranches v0 -> missingCaseBranchesError v0+ ErrorModel.InvalidTermErrorMissingRecordFields v0 -> missingRecordFieldsError v0+ ErrorModel.InvalidTermErrorNestedTermAnnotation v0 -> nestedTermAnnotationError v0+ ErrorModel.InvalidTermErrorNominalTypeKindMismatch v0 -> nominalTypeKindMismatchError v0+ ErrorModel.InvalidTermErrorRedundantWrapUnwrap v0 -> redundantWrapUnwrapError v0+ ErrorModel.InvalidTermErrorSelfApplication v0 -> selfApplicationError v0+ ErrorModel.InvalidTermErrorTermVariableShadowing v0 -> termVariableShadowingError v0+ ErrorModel.InvalidTermErrorTypeVariableShadowingInTypeLambda v0 -> typeVariableShadowingInTypeLambdaError v0+ ErrorModel.InvalidTermErrorUndeclaredVariant v0 -> undeclaredVariantError v0+ ErrorModel.InvalidTermErrorUndefinedTermVariable v0 -> undefinedTermVariableError v0+ ErrorModel.InvalidTermErrorUndefinedTypeVariableInBindingType v0 -> undefinedTypeVariableInBindingTypeError v0+ ErrorModel.InvalidTermErrorUndefinedTypeVariableInLambdaDomain v0 -> undefinedTypeVariableInLambdaDomainError v0+ ErrorModel.InvalidTermErrorUndefinedTypeVariableInTypeApplication v0 -> undefinedTypeVariableInTypeApplicationError v0+ ErrorModel.InvalidTermErrorUnknownCaseAlternative v0 -> unknownCaseAlternativeError v0+ ErrorModel.InvalidTermErrorUnknownPrimitiveName v0 -> unknownPrimitiveNameError v0+ ErrorModel.InvalidTermErrorUnknownProjectedField v0 -> unknownProjectedFieldError v0+ ErrorModel.InvalidTermErrorUnnecessaryIdentityApplication v0 -> unnecessaryIdentityApplicationError v0+ ErrorModel.InvalidTermErrorUnresolvedNominalType v0 -> unresolvedNominalTypeError v0+ ErrorModel.InvalidTermErrorUntypedTermVariable v0 -> untypedTermVariableError v0)++-- | Show an invalid type error as a string+invalidTypeError :: ErrorModel.InvalidTypeError -> String+invalidTypeError e =+ Strings.concat2 "invalid type: " (case e of+ ErrorModel.InvalidTypeErrorDuplicateRecordTypeFieldNames v0 -> duplicateRecordTypeFieldNamesError v0+ ErrorModel.InvalidTypeErrorDuplicateUnionTypeFieldNames v0 -> duplicateUnionTypeFieldNamesError v0+ ErrorModel.InvalidTypeErrorEmptyRecordType v0 -> emptyRecordTypeError v0+ ErrorModel.InvalidTypeErrorEmptyTypeAnnotation v0 -> emptyTypeAnnotationError v0+ ErrorModel.InvalidTypeErrorEmptyUnionType v0 -> emptyUnionTypeError v0+ ErrorModel.InvalidTypeErrorInvalidForallParameterName v0 -> invalidForallParameterNameError v0+ ErrorModel.InvalidTypeErrorInvalidTypeSchemeVariableName v0 -> invalidTypeSchemeVariableNameError v0+ ErrorModel.InvalidTypeErrorNestedTypeAnnotation v0 -> nestedTypeAnnotationError v0+ ErrorModel.InvalidTypeErrorNonComparableMapKeyType v0 -> nonComparableMapKeyTypeError v0+ ErrorModel.InvalidTypeErrorNonComparableSetElementType v0 -> nonComparableSetElementTypeError v0+ ErrorModel.InvalidTypeErrorSingleVariantUnion v0 -> singleVariantUnionError v0+ ErrorModel.InvalidTypeErrorTypeVariableShadowingInForall v0 -> typeVariableShadowingInForallError v0+ ErrorModel.InvalidTypeErrorUndefinedTypeVariable v0 -> undefinedTypeVariableError v0+ ErrorModel.InvalidTypeErrorVoidInNonBottomPosition v0 -> voidInNonBottomPositionError v0)++-- | Show an invalid type lambda parameter name error as a string+invalidTypeLambdaParameterNameError :: ErrorModel.InvalidTypeLambdaParameterNameError -> String+invalidTypeLambdaParameterNameError e =+ Strings.concat [+ "invalid type lambda parameter name: ",+ (Model.unName (ErrorModel.invalidTypeLambdaParameterNameErrorName e))]++-- | Show an invalid type scheme variable name error as a string+invalidTypeSchemeVariableNameError :: ErrorModel.InvalidTypeSchemeVariableNameError -> String+invalidTypeSchemeVariableNameError e =+ Strings.concat [+ "invalid type scheme variable name: ",+ (Model.unName (ErrorModel.invalidTypeSchemeVariableNameErrorName e))]++-- | Show a missing case branches error as a string+missingCaseBranchesError :: ErrorModel.MissingCaseBranchesError -> String+missingCaseBranchesError e =++ let tname = ErrorModel.missingCaseBranchesErrorTypeName e+ variantNames = ErrorModel.missingCaseBranchesErrorVariantNames e+ in (Strings.concat [+ "case statement for type ",+ (Model.unName tname),+ " does not cover variant(s): ",+ (Strings.join ", " (Lists.map Model.unName variantNames))])++-- | Show a missing record fields error as a string+missingRecordFieldsError :: ErrorModel.MissingRecordFieldsError -> String+missingRecordFieldsError e =++ let tname = ErrorModel.missingRecordFieldsErrorTypeName e+ fieldNames = ErrorModel.missingRecordFieldsErrorFieldNames e+ in (Strings.concat [+ "record term for type ",+ (Model.unName tname),+ " is missing declared field(s): ",+ (Strings.join ", " (Lists.map Model.unName fieldNames))])++-- | Show a nested term annotation error as a string+nestedTermAnnotationError :: t0 -> String+nestedTermAnnotationError e = "nested term annotations should be merged"++-- | Show a nested type annotation error as a string+nestedTypeAnnotationError :: t0 -> String+nestedTypeAnnotationError e = "nested type annotations should be merged"++-- | Show a nominal type kind mismatch error as a string+nominalTypeKindMismatchError :: ErrorModel.NominalTypeKindMismatchError -> String+nominalTypeKindMismatchError e =++ let tname = ErrorModel.nominalTypeKindMismatchErrorTypeName e+ expected = ErrorModel.nominalTypeKindMismatchErrorExpectedVariant e+ actual = ErrorModel.nominalTypeKindMismatchErrorActualVariant e+ in (Strings.concat [+ "type name ",+ (Model.unName tname),+ " is expected to be a ",+ (PrintVariants.typeVariant expected),+ " type, but resolves to a ",+ (PrintVariants.typeVariant actual),+ " type"])++-- | Show a non-comparable map key type error as a string+nonComparableMapKeyTypeError :: ErrorModel.NonComparableMapKeyTypeError -> String+nonComparableMapKeyTypeError e =+ Strings.concat [+ "map key type contains a function type: ",+ (PrintModel.type_ (ErrorModel.nonComparableMapKeyTypeErrorKeyType e))]++-- | Show a non-comparable set element type error as a string+nonComparableSetElementTypeError :: ErrorModel.NonComparableSetElementTypeError -> String+nonComparableSetElementTypeError e =+ Strings.concat [+ "set element type contains a function type: ",+ (PrintModel.type_ (ErrorModel.nonComparableSetElementTypeErrorElementType e))]++-- | Show a redundant wrap/unwrap error as a string+redundantWrapUnwrapError :: ErrorModel.RedundantWrapUnwrapError -> String+redundantWrapUnwrapError e =+ Strings.concat [+ "redundant wrap/unwrap for type: ",+ (Model.unName (ErrorModel.redundantWrapUnwrapErrorTypeName e))]++-- | Show a self-application error as a string+selfApplicationError :: ErrorModel.SelfApplicationError -> String+selfApplicationError e =+ Strings.concat [+ "self-application of variable: ",+ (Model.unName (ErrorModel.selfApplicationErrorName e))]++-- | Show a single variant union error as a string+singleVariantUnionError :: ErrorModel.SingleVariantUnionError -> String+singleVariantUnionError e =+ Strings.concat [+ "union type with single variant: ",+ (Model.unName (ErrorModel.singleVariantUnionErrorFieldName e))]++-- | Show a term variable shadowing error as a string+termVariableShadowingError :: ErrorModel.TermVariableShadowingError -> String+termVariableShadowingError e =+ Strings.concat [+ "variable shadowing: ",+ (Model.unName (ErrorModel.termVariableShadowingErrorName e))]++-- | Show a type variable shadowing in forall error as a string+typeVariableShadowingInForallError :: ErrorModel.TypeVariableShadowingInForallError -> String+typeVariableShadowingInForallError e =+ Strings.concat [+ "type variable shadowing in forall: ",+ (Model.unName (ErrorModel.typeVariableShadowingInForallErrorName e))]++-- | Show a type variable shadowing in type lambda error as a string+typeVariableShadowingInTypeLambdaError :: ErrorModel.TypeVariableShadowingInTypeLambdaError -> String+typeVariableShadowingInTypeLambdaError e =+ Strings.concat [+ "type variable shadowing in type lambda: ",+ (Model.unName (ErrorModel.typeVariableShadowingInTypeLambdaErrorName e))]++-- | Show an undeclared variant error as a string+undeclaredVariantError :: ErrorModel.UndeclaredVariantError -> String+undeclaredVariantError e =++ let tname = ErrorModel.undeclaredVariantErrorTypeName e+ vname = ErrorModel.undeclaredVariantErrorVariantName e+ in (Strings.concat [+ "injected variant ",+ (Model.unName vname),+ " is not declared by union type ",+ (Model.unName tname)])++-- | Show an undefined field error as a string+undefinedFieldError :: ErrorModel.UndefinedFieldError -> String+undefinedFieldError e =++ let fname = ErrorModel.undefinedFieldErrorFieldName e+ tname = ErrorModel.undefinedFieldErrorTypeName e+ in (Strings.concat [+ "no such field \"",+ (Model.unName fname),+ "\" in type \"",+ (Model.unName tname),+ "\""])++-- | Show an undefined term variable error as a string+undefinedTermVariableError :: ErrorModel.UndefinedTermVariableError -> String+undefinedTermVariableError e =+ Strings.concat [+ "undefined term variable: ",+ (Model.unName (ErrorModel.undefinedTermVariableErrorName e))]++-- | Show an undefined type variable error as a string+undefinedTypeVariableError :: ErrorModel.UndefinedTypeVariableError -> String+undefinedTypeVariableError e =+ Strings.concat [+ "undefined type variable: ",+ (Model.unName (ErrorModel.undefinedTypeVariableErrorName e))]++-- | Show an undefined type variable in binding type error as a string+undefinedTypeVariableInBindingTypeError :: ErrorModel.UndefinedTypeVariableInBindingTypeError -> String+undefinedTypeVariableInBindingTypeError e =+ Strings.concat [+ "undefined type variable in binding type: ",+ (Model.unName (ErrorModel.undefinedTypeVariableInBindingTypeErrorName e))]++-- | Show an undefined type variable in lambda domain error as a string+undefinedTypeVariableInLambdaDomainError :: ErrorModel.UndefinedTypeVariableInLambdaDomainError -> String+undefinedTypeVariableInLambdaDomainError e =+ Strings.concat [+ "undefined type variable in lambda domain: ",+ (Model.unName (ErrorModel.undefinedTypeVariableInLambdaDomainErrorName e))]++-- | Show an undefined type variable in type application error as a string+undefinedTypeVariableInTypeApplicationError :: ErrorModel.UndefinedTypeVariableInTypeApplicationError -> String+undefinedTypeVariableInTypeApplicationError e =+ Strings.concat [+ "undefined type variable in type application: ",+ (Model.unName (ErrorModel.undefinedTypeVariableInTypeApplicationErrorName e))]++-- | Show an unexpected term variant error as a string+unexpectedTermVariantError :: ErrorModel.UnexpectedTermVariantError -> String+unexpectedTermVariantError e =++ let expected = ErrorModel.unexpectedTermVariantErrorExpectedVariant e+ actual = ErrorModel.unexpectedTermVariantErrorActualTerm e+ in (Strings.concat [+ "expected ",+ (PrintVariants.termVariant expected),+ " term but found ",+ (PrintModel.term actual)])++-- | Show an unexpected type variant error as a string+unexpectedTypeVariantError :: ErrorModel.UnexpectedTypeVariantError -> String+unexpectedTypeVariantError e =++ let expected = ErrorModel.unexpectedTypeVariantErrorExpectedVariant e+ actual = ErrorModel.unexpectedTypeVariantErrorActualType e+ in (Strings.concat [+ "expected ",+ (PrintVariants.typeVariant expected),+ " type but found ",+ (PrintModel.type_ actual)])++-- | Show an unknown case alternative error as a string+unknownCaseAlternativeError :: ErrorModel.UnknownCaseAlternativeError -> String+unknownCaseAlternativeError e =++ let tname = ErrorModel.unknownCaseAlternativeErrorTypeName e+ name = ErrorModel.unknownCaseAlternativeErrorName e+ in (Strings.concat [+ "case alternative ",+ (Model.unName name),+ " is not a variant of type ",+ (Model.unName tname)])++-- | Show an unknown primitive name error as a string+unknownPrimitiveNameError :: ErrorModel.UnknownPrimitiveNameError -> String+unknownPrimitiveNameError e =+ Strings.concat [+ "unknown primitive: ",+ (Model.unName (ErrorModel.unknownPrimitiveNameErrorName e))]++-- | Show an unknown projected field error as a string+unknownProjectedFieldError :: ErrorModel.UnknownProjectedFieldError -> String+unknownProjectedFieldError e =++ let tname = ErrorModel.unknownProjectedFieldErrorTypeName e+ fname = ErrorModel.unknownProjectedFieldErrorFieldName e+ in (Strings.concat [+ "projected field ",+ (Model.unName fname),+ " is not declared by record type ",+ (Model.unName tname)])++-- | Show an unnecessary identity application error as a string+unnecessaryIdentityApplicationError :: t0 -> String+unnecessaryIdentityApplicationError e = "unnecessary application of identity lambda"++-- | Show an unresolved nominal type error as a string+unresolvedNominalTypeError :: ErrorModel.UnresolvedNominalTypeError -> String+unresolvedNominalTypeError e =+ Strings.concat [+ "type name does not resolve to any declared type: ",+ (Model.unName (ErrorModel.unresolvedNominalTypeErrorTypeName e))]++-- | Show an untyped term variable error as a string+untypedTermVariableError :: ErrorModel.UntypedTermVariableError -> String+untypedTermVariableError e =+ Strings.concat [+ "untyped term variable: ",+ (Model.unName (ErrorModel.untypedTermVariableErrorName e))]++-- | Show a void in non-bottom position error as a string+voidInNonBottomPositionError :: t0 -> String+voidInNonBottomPositionError e = "TypeVoid in a position where no value can be constructed"
@@ -0,0 +1,194 @@+-- Note: this is an automatically generated file. Do not edit.++-- | String representations of hydra.core.error.packaging types++module Hydra.Core.Print.Error.Packaging where++import qualified Hydra.Core.Ast as Ast+import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Diff as Diff+import qualified Hydra.Core.Docs as Docs+import qualified Hydra.Core.Error.Checking as Checking+import qualified Hydra.Core.Error.File as ErrorFile+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Error.Packaging as ErrorPackaging+import qualified Hydra.Core.Error.System as ErrorSystem+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Json.Model as JsonModel+import qualified Hydra.Core.Overlay.Haskell.Lib.Strings as Strings+import qualified Hydra.Core.Markdown as Markdown+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Parsing as Parsing+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Print.Util as PrintUtil+import qualified Hydra.Core.Query as Query+import qualified Hydra.Core.Regex as Regex+import qualified Hydra.Core.Relational as Relational+import qualified Hydra.Core.System as System+import qualified Hydra.Core.Tabular as Tabular+import qualified Hydra.Core.Testing as Testing+import qualified Hydra.Core.Time as Time+import qualified Hydra.Core.Topology as Topology+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Validation as Validation+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | Show a conflicting module namespace error as a string+conflictingModuleNameError :: ErrorPackaging.ConflictingModuleNameError -> String+conflictingModuleNameError e =+ Strings.concat [+ "module namespaces conflict when mapped to target language path: ",+ (Packaging.unModuleName (ErrorPackaging.conflictingModuleNameErrorFirst e)),+ " vs ",+ (Packaging.unModuleName (ErrorPackaging.conflictingModuleNameErrorSecond e))]++-- | Show a conflicting variant name error as a string+conflictingVariantNameError :: ErrorPackaging.ConflictingVariantNameError -> String+conflictingVariantNameError e =+ Strings.concat [+ "in module ",+ (Packaging.unModuleName (ErrorPackaging.conflictingVariantNameErrorModuleName e)),+ ": variant ",+ (Model.unName (ErrorPackaging.conflictingVariantNameErrorVariantName e)),+ " of type ",+ (Model.unName (ErrorPackaging.conflictingVariantNameErrorTypeName e)),+ " produces constructor name ",+ (Model.unName (ErrorPackaging.conflictingVariantNameErrorConflictingName e)),+ " which conflicts with another type definition"]++-- | Show a definition-not-in-module-namespace error as a string+definitionNotInModuleNameError :: ErrorPackaging.DefinitionNotInModuleNameError -> String+definitionNotInModuleNameError e =+ Strings.concat [+ "definition ",+ (Model.unName (ErrorPackaging.definitionNotInModuleNameErrorName e)),+ " is not in module namespace ",+ (Packaging.unModuleName (ErrorPackaging.definitionNotInModuleNameErrorModuleName e))]++-- | Show a definitions-out-of-order error as a string+definitionsOutOfOrderError :: ErrorPackaging.DefinitionsOutOfOrderError -> String+definitionsOutOfOrderError e =+ Strings.concat [+ "in module ",+ (Packaging.unModuleName (ErrorPackaging.definitionsOutOfOrderErrorModuleName e)),+ ": definitions out of order: ",+ (Model.unName (ErrorPackaging.definitionsOutOfOrderErrorPrecedingName e)),+ " precedes ",+ (Model.unName (ErrorPackaging.definitionsOutOfOrderErrorFollowingName e))]++-- | Show a duplicate definition name error as a string+duplicateDefinitionNameError :: ErrorPackaging.DuplicateDefinitionNameError -> String+duplicateDefinitionNameError e =+ Strings.concat [+ "in module ",+ (Packaging.unModuleName (ErrorPackaging.duplicateDefinitionNameErrorModuleName e)),+ ": duplicate definition name ",+ (Model.unName (ErrorPackaging.duplicateDefinitionNameErrorName e))]++-- | Show a duplicate module namespace error as a string+duplicateModuleNameError :: ErrorPackaging.DuplicateModuleNameError -> String+duplicateModuleNameError e =+ Strings.concat [+ "duplicate module namespace ",+ (Packaging.unModuleName (ErrorPackaging.duplicateModuleNameErrorModuleName e))]++-- | Show an invalid definition name error as a string+invalidDefinitionNameError :: ErrorPackaging.InvalidDefinitionNameError -> String+invalidDefinitionNameError e =+ Strings.concat [+ "in module ",+ (Packaging.unModuleName (ErrorPackaging.invalidDefinitionNameErrorModuleName e)),+ ": definition ",+ (Model.unName (ErrorPackaging.invalidDefinitionNameErrorName e)),+ " does not match expected ",+ (PrintUtil.caseConvention (ErrorPackaging.invalidDefinitionNameErrorExpectedConvention e))]++-- | Show an invalid module error as a string+invalidModuleError :: ErrorPackaging.InvalidModuleError -> String+invalidModuleError e =+ Strings.concat2 "invalid module: " (case e of+ ErrorPackaging.InvalidModuleErrorConflictingVariantName v0 -> conflictingVariantNameError v0+ ErrorPackaging.InvalidModuleErrorDefinitionNotInModuleName v0 -> definitionNotInModuleNameError v0+ ErrorPackaging.InvalidModuleErrorDefinitionsOutOfOrder v0 -> definitionsOutOfOrderError v0+ ErrorPackaging.InvalidModuleErrorDuplicateDefinitionName v0 -> duplicateDefinitionNameError v0+ ErrorPackaging.InvalidModuleErrorInvalidDefinitionName v0 -> invalidDefinitionNameError v0+ ErrorPackaging.InvalidModuleErrorInvalidModuleNameConvention v0 -> invalidModuleNameConventionError v0+ ErrorPackaging.InvalidModuleErrorMissingDocumentation v0 -> missingDocumentationError v0)++-- | Show an invalid namespace convention error as a string+invalidModuleNameConventionError :: ErrorPackaging.InvalidModuleNameConventionError -> String+invalidModuleNameConventionError e =+ Strings.concat [+ "namespace ",+ (Packaging.unModuleName (ErrorPackaging.invalidModuleNameConventionErrorModuleName e)),+ " does not match the dotted-camelCase naming convention"]++-- | Show an invalid package error as a string+invalidPackageError :: ErrorPackaging.InvalidPackageError -> String+invalidPackageError e =+ Strings.concat2 "invalid package: " (case e of+ ErrorPackaging.InvalidPackageErrorConflictingModuleName v0 -> conflictingModuleNameError v0+ ErrorPackaging.InvalidPackageErrorDuplicateModuleName v0 -> duplicateModuleNameError v0+ ErrorPackaging.InvalidPackageErrorInvalidModule v0 -> invalidModuleError v0+ ErrorPackaging.InvalidPackageErrorInvalidPackageName v0 -> invalidPackageNameError v0+ ErrorPackaging.InvalidPackageErrorModuleInMultiplePackages v0 -> moduleInMultiplePackagesError v0+ ErrorPackaging.InvalidPackageErrorNestedModuleName v0 -> nestedModuleNameError v0+ ErrorPackaging.InvalidPackageErrorUndeclaredDependency v0 -> undeclaredDependencyError v0)++-- | Show an invalid package name error as a string+invalidPackageNameError :: ErrorPackaging.InvalidPackageNameError -> String+invalidPackageNameError e =+ Strings.concat [+ "package name ",+ (Packaging.unPackageName (ErrorPackaging.invalidPackageNameErrorPackageName e)),+ " does not match the hyphen-separated lowercase naming convention"]++-- | Show a missing documentation error as a string+missingDocumentationError :: ErrorPackaging.MissingDocumentationError -> String+missingDocumentationError e =+ Strings.concat [+ "in module ",+ (Packaging.unModuleName (ErrorPackaging.missingDocumentationErrorModuleName e)),+ ": definition ",+ (Model.unName (ErrorPackaging.missingDocumentationErrorName e)),+ " lacks a description annotation"]++-- | Show a module-in-multiple-packages error as a string+moduleInMultiplePackagesError :: ErrorPackaging.ModuleInMultiplePackagesError -> String+moduleInMultiplePackagesError e =+ Strings.concat [+ "module namespace ",+ (Packaging.unModuleName (ErrorPackaging.moduleInMultiplePackagesErrorModuleName e)),+ " is declared by more than one package: ",+ (Packaging.unPackageName (ErrorPackaging.moduleInMultiplePackagesErrorFirstPackage e)),+ " vs ",+ (Packaging.unPackageName (ErrorPackaging.moduleInMultiplePackagesErrorSecondPackage e))]++-- | Show a nested module name error as a string+nestedModuleNameError :: ErrorPackaging.NestedModuleNameError -> String+nestedModuleNameError e =+ Strings.concat [+ "module namespace ",+ (Packaging.unModuleName (ErrorPackaging.nestedModuleNameErrorOuter e)),+ " is a strict dotted-prefix of module namespace ",+ (Packaging.unModuleName (ErrorPackaging.nestedModuleNameErrorInner e))]++-- | Show an undeclared dependency error as a string+undeclaredDependencyError :: ErrorPackaging.UndeclaredDependencyError -> String+undeclaredDependencyError e =+ Strings.concat [+ "module ",+ (Packaging.unModuleName (ErrorPackaging.undeclaredDependencyErrorModuleName e)),+ " references ",+ (Model.unName (ErrorPackaging.undeclaredDependencyErrorReferencedName e)),+ ", whose owning module ",+ (Packaging.unModuleName (ErrorPackaging.undeclaredDependencyErrorOwningModuleName e)),+ " is not among its declared dependencies; add it to moduleDependencies"]
@@ -0,0 +1,218 @@+-- Note: this is an automatically generated file. Do not edit.++-- | String representations of hydra.core.error types++module Hydra.Core.Print.Errors where++import qualified Hydra.Core.Ast as Ast+import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Diff as Diff+import qualified Hydra.Core.Docs as Docs+import qualified Hydra.Core.Error.Checking as Checking+import qualified Hydra.Core.Error.File as ErrorFile+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Error.Packaging as ErrorPackaging+import qualified Hydra.Core.Error.System as ErrorSystem+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Formatting as Formatting+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Json.Model as JsonModel+import qualified Hydra.Core.Overlay.Haskell.Lib.Lists as Lists+import qualified Hydra.Core.Overlay.Haskell.Lib.Literals as Literals+import qualified Hydra.Core.Overlay.Haskell.Lib.Sets as Sets+import qualified Hydra.Core.Overlay.Haskell.Lib.Strings as Strings+import qualified Hydra.Core.Markdown as Markdown+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Parsing as Parsing+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Print.Error.Model as PrintErrorModel+import qualified Hydra.Core.Print.Model as PrintModel+import qualified Hydra.Core.Print.Typing as PrintTyping+import qualified Hydra.Core.Print.Variants as PrintVariants+import qualified Hydra.Core.Query as Query+import qualified Hydra.Core.Regex as Regex+import qualified Hydra.Core.Relational as Relational+import qualified Hydra.Core.System as System+import qualified Hydra.Core.Tabular as Tabular+import qualified Hydra.Core.Testing as Testing+import qualified Hydra.Core.Time as Time+import qualified Hydra.Core.Topology as Topology+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Validation as Validation+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | Show a checking error as a string+checkingError :: Checking.CheckingError -> String+checkingError ce =+ case ce of+ Checking.CheckingErrorIncorrectUnification v0 -> incorrectUnificationError v0+ Checking.CheckingErrorNotAForallType v0 -> notAForallTypeError v0+ Checking.CheckingErrorNotAFunctionType v0 -> notAFunctionTypeError v0+ Checking.CheckingErrorTypeArityMismatch v0 -> typeArityMismatchError v0+ Checking.CheckingErrorTypeMismatch v0 -> typeMismatchError v0+ Checking.CheckingErrorUnboundTypeVariables v0 -> unboundTypeVariablesError v0+ Checking.CheckingErrorUnequalTypes v0 -> unequalTypesError v0+ Checking.CheckingErrorUnsupportedTermVariant v0 -> unsupportedTermVariantError v0+ Checking.CheckingErrorUntypedLambda v0 -> untypedLambdaError v0+ Checking.CheckingErrorUntypedLetBinding v0 -> untypedLetBindingError v0++-- | Show a decoding error as a string+decodingError :: Errors.DecodingError -> String+decodingError de = Strings.concat2 "decoding error: " (Errors.unDecodingError de)++-- | Show an error as a string+error :: Errors.Error -> String+error e =+ case e of+ Errors.ErrorChecking v0 -> checkingError v0+ Errors.ErrorDecoding v0 -> decodingError v0+ Errors.ErrorDuplicateBinding v0 -> PrintErrorModel.duplicateBindingError v0+ Errors.ErrorDuplicateField v0 -> PrintErrorModel.duplicateFieldError v0+ Errors.ErrorExtraction _ -> "extraction error"+ Errors.ErrorInference _ -> "inference error"+ Errors.ErrorOther v0 -> otherError v0+ Errors.ErrorResolution v0 -> resolutionError v0+ Errors.ErrorUndefinedField v0 -> PrintErrorModel.undefinedFieldError v0+ Errors.ErrorUndefinedTermVariable v0 -> PrintErrorModel.undefinedTermVariableError v0+ Errors.ErrorUntypedTermVariable v0 -> PrintErrorModel.untypedTermVariableError v0+ Errors.ErrorUnexpectedTermVariant v0 -> PrintErrorModel.unexpectedTermVariantError v0+ Errors.ErrorUnexpectedTypeVariant v0 -> PrintErrorModel.unexpectedTypeVariantError v0+ Errors.ErrorUnification v0 -> unificationError v0++-- | Show an incorrect unification error as a string+incorrectUnificationError :: Checking.IncorrectUnificationError -> String+incorrectUnificationError e =++ let subst = Checking.incorrectUnificationErrorSubstitution e+ in (Strings.concat2 "incorrect unification: " (PrintTyping.typeSubst subst))++-- | Show a not-a-forall-type error as a string+notAForallTypeError :: Checking.NotAForallTypeError -> String+notAForallTypeError e =++ let typ = Checking.notAForallTypeErrorType e+ args = Checking.notAForallTypeErrorTypeArguments e+ in (Strings.concat [+ "not a forall type: ",+ (PrintModel.type_ typ),+ ". Trying to apply ",+ (Literals.printInt32 (Lists.length args)),+ " type argument(s): ",+ (Formatting.showList PrintModel.type_ args)])++-- | Show a not-a-function-type error as a string+notAFunctionTypeError :: Checking.NotAFunctionTypeError -> String+notAFunctionTypeError e =++ let typ = Checking.notAFunctionTypeErrorType e+ in (Strings.concat2 "not a function type: " (PrintModel.type_ typ))++-- | Show an other error as a string+otherError :: Errors.OtherError -> String+otherError oe = Errors.unOtherError oe++-- | Show a resolution error as a string, including the offending name or shape+resolutionError :: Errors.ResolutionError -> String+resolutionError re =+ case re of+ Errors.ResolutionErrorNoSuchBinding v0 -> Strings.concat2 "no such binding: " (Model.unName (Errors.noSuchBindingErrorName v0))+ Errors.ResolutionErrorNoSuchPrimitive v0 -> Strings.concat2 "no such primitive: " (Model.unName (Errors.noSuchPrimitiveErrorName v0))+ Errors.ResolutionErrorNoMatchingField v0 -> Strings.concat2 "no matching field: " (Model.unName (Errors.noMatchingFieldErrorFieldName v0))+ Errors.ResolutionErrorOther v0 -> Strings.concat2 "resolution error: " (Errors.unOtherResolutionError v0)+ Errors.ResolutionErrorUnexpectedShape v0 -> Strings.concat [+ "unexpected shape: expected ",+ (Errors.unexpectedShapeErrorExpected v0),+ " but got ",+ (Errors.unexpectedShapeErrorActual v0)]++-- | Show a type arity mismatch error as a string+typeArityMismatchError :: Checking.TypeArityMismatchError -> String+typeArityMismatchError e =++ let typ = Checking.typeArityMismatchErrorType e+ expected = Checking.typeArityMismatchErrorExpectedArity e+ actual = Checking.typeArityMismatchErrorActualArity e+ args = Checking.typeArityMismatchErrorTypeArguments e+ in (Strings.concat [+ "type ",+ (PrintModel.type_ typ),+ " applied to the wrong number of type arguments (expected ",+ (Literals.printInt32 expected),+ ", got ",+ (Literals.printInt32 actual),+ "): ",+ (Formatting.showList PrintModel.type_ args)])++-- | Show a type mismatch error as a string+typeMismatchError :: Checking.TypeMismatchError -> String+typeMismatchError e =++ let expected = Checking.typeMismatchErrorExpectedType e+ actual = Checking.typeMismatchErrorActualType e+ in (Strings.concat [+ "type mismatch: expected ",+ (PrintModel.type_ expected),+ " but found ",+ (PrintModel.type_ actual)])++-- | Show an unbound type variables error as a string+unboundTypeVariablesError :: Checking.UnboundTypeVariablesError -> String+unboundTypeVariablesError e =++ let vars = Checking.unboundTypeVariablesErrorVariables e+ typ = Checking.unboundTypeVariablesErrorType e+ in (Strings.concat [+ "unbound type variables: {",+ (Strings.join ", " (Lists.map Model.unName (Sets.toList vars))),+ "} in type ",+ (PrintModel.type_ typ)])++-- | Show an unequal types error as a string+unequalTypesError :: Checking.UnequalTypesError -> String+unequalTypesError e =++ let types = Checking.unequalTypesErrorTypes e+ desc = Checking.unequalTypesErrorDescription e+ in (Strings.concat [+ "unequal types ",+ (Formatting.showList PrintModel.type_ types),+ " in ",+ desc])++-- | Show a unification error as a string+unificationError :: Errors.UnificationError -> String+unificationError e =++ let lt = Errors.unificationErrorLeftType e+ rt = Errors.unificationErrorRightType e+ msg = Errors.unificationErrorMessage e+ in (Strings.concat [+ "unification error: cannot unify ",+ (PrintModel.type_ lt),+ " with ",+ (PrintModel.type_ rt),+ ": ",+ msg])++-- | Show an unsupported term variant error as a string+unsupportedTermVariantError :: Checking.UnsupportedTermVariantError -> String+unsupportedTermVariantError e =+ Strings.concat2 "unsupported term variant: " (PrintVariants.termVariant (Checking.unsupportedTermVariantErrorTermVariant e))++-- | Show an untyped lambda error as a string+untypedLambdaError :: t0 -> String+untypedLambdaError _ = "untyped lambda"++-- | Show an untyped let binding error as a string+untypedLetBindingError :: Checking.UntypedLetBindingError -> String+untypedLetBindingError e =++ let b = Checking.untypedLetBindingErrorBinding e+ in (Strings.concat2 "untyped let binding: " (PrintModel.binding b))
@@ -0,0 +1,53 @@+-- Note: this is an automatically generated file. Do not edit.++-- | String representations of hydra.core.graph types++module Hydra.Core.Print.Graph where++import qualified Hydra.Core.Ast as Ast+import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Diff as Diff+import qualified Hydra.Core.Docs as Docs+import qualified Hydra.Core.Error.Checking as Checking+import qualified Hydra.Core.Error.File as ErrorFile+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Error.Packaging as ErrorPackaging+import qualified Hydra.Core.Error.System as ErrorSystem+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Json.Model as JsonModel+import qualified Hydra.Core.Overlay.Haskell.Lib.Lists as Lists+import qualified Hydra.Core.Overlay.Haskell.Lib.Strings as Strings+import qualified Hydra.Core.Markdown as Markdown+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Parsing as Parsing+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Print.Model as PrintModel+import qualified Hydra.Core.Query as Query+import qualified Hydra.Core.Regex as Regex+import qualified Hydra.Core.Relational as Relational+import qualified Hydra.Core.System as System+import qualified Hydra.Core.Tabular as Tabular+import qualified Hydra.Core.Testing as Testing+import qualified Hydra.Core.Time as Time+import qualified Hydra.Core.Topology as Topology+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Validation as Validation+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | Show a list of bindings as a string+graph :: [Model.Binding] -> String+graph elements =++ let elementStrs = Lists.map PrintModel.binding elements+ in (Strings.concat [+ "{",+ (Strings.join ", " elementStrs),+ "}"])
@@ -0,0 +1,155 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Serialization of hydra.core.markdown documents to Markdown text++module Hydra.Core.Print.Markdown where++import qualified Hydra.Core.Ast as Ast+import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Diff as Diff+import qualified Hydra.Core.Docs as Docs+import qualified Hydra.Core.Error.Checking as Checking+import qualified Hydra.Core.Error.File as ErrorFile+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Error.Packaging as ErrorPackaging+import qualified Hydra.Core.Error.System as ErrorSystem+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Formatting as Formatting+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Json.Model as JsonModel+import qualified Hydra.Core.Overlay.Haskell.Lib.Lists as Lists+import qualified Hydra.Core.Overlay.Haskell.Lib.Literals as Literals+import qualified Hydra.Core.Overlay.Haskell.Lib.Logic as Logic+import qualified Hydra.Core.Overlay.Haskell.Lib.Math as Math+import qualified Hydra.Core.Overlay.Haskell.Lib.Optionals as Optionals+import qualified Hydra.Core.Overlay.Haskell.Lib.Pairs as Pairs+import qualified Hydra.Core.Overlay.Haskell.Lib.Strings as Strings+import qualified Hydra.Core.Markdown as Markdown+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Parsing as Parsing+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Query as Query+import qualified Hydra.Core.Regex as Regex+import qualified Hydra.Core.Relational as Relational+import qualified Hydra.Core.System as System+import qualified Hydra.Core.Tabular as Tabular+import qualified Hydra.Core.Testing as Testing+import qualified Hydra.Core.Time as Time+import qualified Hydra.Core.Topology as Topology+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Validation as Validation+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | Render a single Block to its Markdown text form+block :: Markdown.Block -> String+block b =+ case b of+ Markdown.BlockCodeBlock v0 -> codeBlock v0+ Markdown.BlockList v0 -> list v0+ Markdown.BlockParagraph v0 -> inlines (Markdown.paragraphContent v0)+ Markdown.BlockRaw v0 -> v0+ Markdown.BlockSection v0 ->+ let h = Markdown.sectionHeading v0+ content = Markdown.sectionContent v0+ in (Strings.join "\n\n" (Lists.cons (heading h) (Lists.map block content)))+ Markdown.BlockTable v0 -> table v0++-- | Render a list of Blocks, joined by a blank line+blocks :: [Markdown.Block] -> String+blocks bs = Strings.join "\n\n" (Lists.map block bs)++-- | Render a CodeBlock as a fenced code block, with the language tag on the opening fence if present+codeBlock :: Markdown.CodeBlock -> String+codeBlock cb =++ let lang = Markdown.codeBlockLanguage cb+ content = Markdown.codeBlockContent cb+ fence = Strings.concat2 "```" (Optionals.withDefault "" lang)+ in (Strings.join "\n" [+ fence,+ content,+ "```"])++-- | Render a Document as its complete Markdown text, an H1 title followed by its blocks+document :: Markdown.Document -> String+document d =++ let title = Markdown.documentTitle d+ content = Markdown.documentContent d+ in (Strings.join "\n\n" (Lists.cons (Strings.concat2 "# " title) (Lists.map block content)))++-- | Render a Heading, prefixing its inline content with the appropriate number of `#` characters+heading :: Markdown.Heading -> String+heading h =++ let level = Markdown.headingLevel h+ content = Markdown.headingContent h+ hashes = Strings.concat (Lists.replicate level "#")+ in (Strings.concat2 (Strings.concat2 hashes " ") (inlines content))++-- | Render a single Inline to its Markdown text form+inline :: Markdown.Inline -> String+inline i =+ case i of+ Markdown.InlineCode v0 -> Strings.concat2 (Strings.concat2 "`" v0) "`"+ Markdown.InlineEmphasis v0 -> Strings.concat2 (Strings.concat2 "*" (inlines v0)) "*"+ Markdown.InlineLink v0 -> link v0+ Markdown.InlineStrong v0 -> Strings.concat2 (Strings.concat2 "**" (inlines v0)) "**"+ Markdown.InlineText v0 -> v0++-- | Render a list of Inlines, concatenated with no separator+inlines :: [Markdown.Inline] -> String+inlines is = Strings.concat (Lists.map inline is)++-- | Render a Link in the standard `[text](target)` form+link :: Markdown.Link -> String+link lk =++ let text = Markdown.linkText lk+ target = Markdown.linkTarget lk+ in (Strings.concat2 (Strings.concat2 (Strings.concat2 (Strings.concat2 "[" (inlines text)) "](") target) ")")++-- | Render a List as bulleted (`-`) or numbered (`1.`, `2.`, ...) lines, one per item; item content is joined with a blank line for items spanning multiple blocks+list :: Markdown.List -> String+list l =++ let ordered = Markdown.listOrdered l+ items = Markdown.listItems l+ itemContent = \it -> blocks (Markdown.unListItem it)+ indices = Math.range 0 (Lists.length items)+ indexedItems = Lists.zip indices items+ renderIndexed =+ \ip ->+ let idx = Pairs.first ip+ it = Pairs.second ip+ marker = Logic.ifElse ordered (Strings.concat2 (Literals.printInt32 (Math.add idx 1)) ".") "-"+ in (Strings.concat2 (Strings.concat2 marker " ") (itemContent it))+ in (Strings.join "\n" (Lists.map renderIndexed indexedItems))++-- | Render a Table in GitHub-flavored Markdown pipe-table form, with a `---` separator row after the header+table :: Markdown.Table -> String+table t =++ let header = Markdown.tableHeader t+ rows = Markdown.tableRows t+ headerCells = Markdown.unTableRow header+ sepRow = Strings.concat2 "|" (Strings.concat (Lists.map (\_ -> " --- |") headerCells))+ in (Strings.join "\n" (Lists.cons (tableRow header) (Lists.cons sepRow (Lists.map tableRow rows))))++-- | Render a TableCell's inline content+tableCell :: Markdown.TableCell -> String+tableCell c = inlines (Markdown.unTableCell c)++-- | Render a TableRow as a pipe-delimited line+tableRow :: Markdown.TableRow -> String+tableRow r =++ let cells = Markdown.unTableRow r+ in (Strings.concat2 (Strings.concat2 "| " (Strings.join " | " (Lists.map tableCell cells))) " |")
@@ -0,0 +1,539 @@+-- Note: this is an automatically generated file. Do not edit.++-- | String representations of hydra.core.model types++module Hydra.Core.Print.Model where++import qualified Hydra.Core.Ast as Ast+import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Diff as Diff+import qualified Hydra.Core.Docs as Docs+import qualified Hydra.Core.Error.Checking as Checking+import qualified Hydra.Core.Error.File as ErrorFile+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Error.Packaging as ErrorPackaging+import qualified Hydra.Core.Error.System as ErrorSystem+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Json.Model as JsonModel+import qualified Hydra.Core.Overlay.Haskell.Lib.Eithers as Eithers+import qualified Hydra.Core.Overlay.Haskell.Lib.Lists as Lists+import qualified Hydra.Core.Overlay.Haskell.Lib.Literals as Literals+import qualified Hydra.Core.Overlay.Haskell.Lib.Logic as Logic+import qualified Hydra.Core.Overlay.Haskell.Lib.Maps as Maps+import qualified Hydra.Core.Overlay.Haskell.Lib.Optionals as Optionals+import qualified Hydra.Core.Overlay.Haskell.Lib.Pairs as Pairs+import qualified Hydra.Core.Overlay.Haskell.Lib.Sets as Sets+import qualified Hydra.Core.Overlay.Haskell.Lib.Strings as Strings+import qualified Hydra.Core.Markdown as Markdown+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Parsing as Parsing+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Query as Query+import qualified Hydra.Core.Regex as Regex+import qualified Hydra.Core.Relational as Relational+import qualified Hydra.Core.System as System+import qualified Hydra.Core.Tabular as Tabular+import qualified Hydra.Core.Testing as Testing+import qualified Hydra.Core.Time as Time+import qualified Hydra.Core.Topology as Topology+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Validation as Validation+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void+import qualified Data.Map as M+import qualified Data.Set as S++-- | Show a binding as a string+binding :: Model.Binding -> String+binding el =++ let name = Model.unName (Model.bindingName el)+ t = Model.bindingTerm el+ typeStr =+ Optionals.match (Model.bindingTypeScheme el) "" (\ts -> Strings.concat [+ ":(",+ (typeScheme ts),+ ")"])+ in (Strings.concat [+ name,+ typeStr,+ " = ",+ (term t)])++-- | Show a case statement as a string+caseStatement :: Model.CaseStatement -> String+caseStatement cs =++ let tname = Model.unName (Model.caseStatementTypeName cs)+ mdef = Model.caseStatementDefault cs+ csCases = Model.caseStatementCases cs+ caseFields =+ Lists.map (\alt -> Model.Field {+ Model.fieldName = (Model.caseAlternativeName alt),+ Model.fieldTerm = (Model.caseAlternativeHandler alt)}) csCases+ defaultField =+ Optionals.match mdef [] (\d -> [+ Model.Field {+ Model.fieldName = (Model.Name "[default]"),+ Model.fieldTerm = d}])+ allFields =+ Lists.concat [+ caseFields,+ defaultField]+ in (Strings.concat [+ "case(",+ tname,+ ")",+ (fields allFields)])++-- | Show an Either value using given functions for left and right+either :: (t0 -> String) -> (t1 -> String) -> Either t0 t1 -> String+either showA showB e =+ Eithers.either (\a -> Strings.concat2 "left(" (Strings.concat2 (showA a) ")")) (\b -> Strings.concat2 "right(" (Strings.concat2 (showB b) ")")) e++-- | Show a field as a string+field :: Model.Field -> String+field field =++ let fname = Model.unName (Model.fieldName field)+ fterm = Model.fieldTerm field+ in (Strings.concat [+ fname,+ "=",+ (term fterm)])++-- | Show a field type as a string+fieldType :: Model.FieldType -> String+fieldType ft =++ let fname = Model.unName (Model.fieldTypeName ft)+ ftyp = Model.fieldTypeType ft+ in (Strings.concat [+ fname,+ ":",+ (type_ ftyp)])++-- | Show a list of fields as a string+fields :: [Model.Field] -> String+fields flds =++ let fieldStrs = Lists.map field flds+ in (Strings.concat [+ "{",+ (Strings.join ", " fieldStrs),+ "}"])++-- | Show a float value as a string+float :: Model.FloatValue -> String+float fv =+ case fv of+ Model.FloatValueFloat32 v0 -> Strings.concat2 (Literals.printFloat32 v0) ":float32"+ Model.FloatValueFloat64 v0 -> Strings.concat2 (Literals.printFloat64 v0) ":float64"++-- | Show a float type as a string+floatType :: Model.FloatType -> String+floatType ft =+ case ft of+ Model.FloatTypeFloat32 -> "float32"+ Model.FloatTypeFloat64 -> "float64"++-- | Show an injection as a string+injection :: Model.Injection -> String+injection inj =++ let tname = Model.injectionTypeName inj+ f = Model.injectionField inj+ in (Strings.concat [+ "inject(",+ (Model.unName tname),+ ")",+ (fields [+ f])])++-- | Show an integer value as a string+integer :: Model.IntegerValue -> String+integer iv =+ case iv of+ Model.IntegerValueBigint v0 -> Strings.concat2 (Literals.printBigint v0) ":bigint"+ Model.IntegerValueInt8 v0 -> Strings.concat2 (Literals.printInt8 v0) ":int8"+ Model.IntegerValueInt16 v0 -> Strings.concat2 (Literals.printInt16 v0) ":int16"+ Model.IntegerValueInt32 v0 -> Strings.concat2 (Literals.printInt32 v0) ":int32"+ Model.IntegerValueInt64 v0 -> Strings.concat2 (Literals.printInt64 v0) ":int64"+ Model.IntegerValueUint8 v0 -> Strings.concat2 (Literals.printUint8 v0) ":uint8"+ Model.IntegerValueUint16 v0 -> Strings.concat2 (Literals.printUint16 v0) ":uint16"+ Model.IntegerValueUint32 v0 -> Strings.concat2 (Literals.printUint32 v0) ":uint32"+ Model.IntegerValueUint64 v0 -> Strings.concat2 (Literals.printUint64 v0) ":uint64"++-- | Show an integer type as a string+integerType :: Model.IntegerType -> String+integerType it =+ case it of+ Model.IntegerTypeBigint -> "bigint"+ Model.IntegerTypeInt8 -> "int8"+ Model.IntegerTypeInt16 -> "int16"+ Model.IntegerTypeInt32 -> "int32"+ Model.IntegerTypeInt64 -> "int64"+ Model.IntegerTypeUint8 -> "uint8"+ Model.IntegerTypeUint16 -> "uint16"+ Model.IntegerTypeUint32 -> "uint32"+ Model.IntegerTypeUint64 -> "uint64"++-- | Show a lambda as a string+lambda :: Model.Lambda -> String+lambda l =++ let v = Model.unName (Model.lambdaParameter l)+ mt = Model.lambdaDomain l+ body = Model.lambdaBody l+ typeStr = Optionals.match mt "" (\t -> Strings.concat2 ":" (type_ t))+ in (Strings.concat [+ "\955",+ v,+ typeStr,+ ".",+ (term body)])++-- | Show a let expression as a string+let_ :: Model.Let -> String+let_ l =++ let bindings = Model.letBindings l+ env = Model.letBody l+ bindingStrs = Lists.map binding bindings+ in (Strings.concat [+ "let ",+ (Strings.join ", " bindingStrs),+ " in ",+ (term env)])++-- | Show a list using a given function to show each element+list :: (t0 -> String) -> [t0] -> String+list f xs =++ let elementStrs = Lists.map f xs+ in (Strings.concat [+ "[",+ (Strings.join ", " elementStrs),+ "]"])++-- | Show a literal as a string+literal :: Model.Literal -> String+literal l =+ case l of+ Model.LiteralBinary _ -> "[binary]"+ Model.LiteralBoolean v0 -> Logic.ifElse v0 "true" "false"+ Model.LiteralDecimal v0 -> Literals.printDecimal v0+ Model.LiteralFloat v0 -> float v0+ Model.LiteralInteger v0 -> integer v0+ Model.LiteralString v0 -> Literals.printString v0++-- | Show a literal type as a string+literalType :: Model.LiteralType -> String+literalType lt =+ case lt of+ Model.LiteralTypeBinary -> "binary"+ Model.LiteralTypeBoolean -> "boolean"+ Model.LiteralTypeDecimal -> "decimal"+ Model.LiteralTypeFloat v0 -> floatType v0+ Model.LiteralTypeInteger v0 -> integerType v0+ Model.LiteralTypeString -> "string"++-- | Show a map using given functions to show keys and values+map :: Ord t0 => ((t0 -> String) -> (t1 -> String) -> M.Map t0 t1 -> String)+map showK showV m =++ let pairStrs =+ Lists.map (\p -> Strings.concat [+ showK (Pairs.first p),+ ": ",+ (showV (Pairs.second p))]) (Maps.toList m)+ in (Strings.concat [+ "{",+ (Strings.join ", " pairStrs),+ "}"])++-- | Show an optional value using a given function to show the element+optional :: (t0 -> String) -> Maybe t0 -> String+optional f mx = Optionals.match mx "none" (\x -> Strings.concat2 "given(" (Strings.concat2 (f x) ")"))++-- | Show a pair using given functions to show each element+pair :: (t0 -> String) -> (t1 -> String) -> (t0, t1) -> String+pair showA showB p =+ Strings.concat [+ "(",+ (showA (Pairs.first p)),+ ", ",+ (showB (Pairs.second p)),+ ")"]++-- | Show a projection as a string+projection :: Model.Projection -> String+projection proj =++ let tname = Model.unName (Model.projectionTypeName proj)+ fname = Model.unName (Model.projectionFieldName proj)+ in (Strings.concat [+ "project(",+ tname,+ "){",+ fname,+ "}"])++-- | A placeholder for reading terms from their serialized form. Not implemented.+readTerm :: String -> Maybe Model.Term+readTerm s = Just (Model.TermLiteral (Model.LiteralString s))++-- | Show a set using a given function to show each element+set :: Ord t0 => ((t0 -> String) -> S.Set t0 -> String)+set f xs =++ let elementStrs = Lists.map f (Sets.toList xs)+ in (Strings.concat [+ "{",+ (Strings.join ", " elementStrs),+ "}"])++-- | Show a term as a string+term :: Model.Term -> String+term t =++ let gatherTerms =+ \prev -> \app ->+ let lhs = Model.applicationFunction app+ rhs = Model.applicationArgument app+ in case lhs of+ Model.TermApplication v0 -> gatherTerms (Lists.cons rhs prev) v0+ _ -> Lists.cons lhs (Lists.cons rhs prev)+ in case t of+ Model.TermAnnotated v0 -> term (Model.annotatedTermBody v0)+ Model.TermApplication v0 ->+ let terms = gatherTerms [] v0+ termStrs = Lists.map term terms+ in (Strings.concat [+ "(",+ (Strings.join " @ " termStrs),+ ")"])+ Model.TermCases v0 -> caseStatement v0+ Model.TermEither v0 -> Eithers.either (\l -> Strings.concat [+ "left(",+ (term l),+ ")"]) (\r -> Strings.concat [+ "right(",+ (term r),+ ")"]) v0+ Model.TermLambda v0 -> lambda v0+ Model.TermLet v0 -> let_ v0+ Model.TermList v0 ->+ let termStrs = Lists.map term v0+ in (Strings.concat [+ "[",+ (Strings.join ", " termStrs),+ "]"])+ Model.TermLiteral v0 -> literal v0+ Model.TermMap v0 ->+ let entry =+ \p -> Strings.concat [+ term (Pairs.first p),+ "=",+ (term (Pairs.second p))]+ in (Strings.concat [+ "{",+ (Strings.join ", " (Lists.map entry (Maps.toList v0))),+ "}"])+ Model.TermOptional v0 -> Optionals.match v0 "none" (\t2 -> Strings.concat [+ "given(",+ (term t2),+ ")"])+ Model.TermPair v0 -> Strings.concat [+ "(",+ (term (Pairs.first v0)),+ ", ",+ (term (Pairs.second v0)),+ ")"]+ Model.TermProject v0 -> projection v0+ Model.TermRecord v0 ->+ let tname = Model.unName (Model.recordTypeName v0)+ flds = Model.recordFields v0+ in (Strings.concat [+ "record(",+ tname,+ ")",+ (fields flds)])+ Model.TermSet v0 -> Strings.concat [+ "{",+ (Strings.join ", " (Lists.map term (Sets.toList v0))),+ "}"]+ Model.TermTypeLambda v0 ->+ let param = Model.unName (Model.typeLambdaParameter v0)+ body = Model.typeLambdaBody v0+ in (Strings.concat [+ "\923",+ param,+ ".",+ (term body)])+ Model.TermTypeApplication v0 ->+ let t2 = Model.typeApplicationTermBody v0+ typ = Model.typeApplicationTermType v0+ in (Strings.concat [+ term t2,+ "\10216",+ (type_ typ),+ "\10217"])+ Model.TermInject v0 -> injection v0+ Model.TermUnit -> "unit"+ Model.TermUnwrap v0 -> Strings.concat [+ "unwrap(",+ (Model.unName v0),+ ")"]+ Model.TermVariable v0 -> Model.unName v0+ Model.TermWrap v0 ->+ let tname = Model.unName (Model.wrappedTermTypeName v0)+ term1 = Model.wrappedTermBody v0+ in (Strings.concat [+ "wrap(",+ tname,+ "){",+ (term term1),+ "}"])++-- | Show a type as a string+type_ :: Model.Type -> String+type_ typ =++ let showRowType =+ \flds ->+ let fieldStrs = Lists.map fieldType flds+ in (Strings.concat [+ "{",+ (Strings.join ", " fieldStrs),+ "}"])+ gatherTypes =+ \prev -> \app ->+ let lhs = Model.applicationTypeFunction app+ rhs = Model.applicationTypeArgument app+ in case lhs of+ Model.TypeApplication v0 -> gatherTypes (Lists.cons rhs prev) v0+ _ -> Lists.cons lhs (Lists.cons rhs prev)+ gatherFunctionTypes =+ \prev -> \t -> case t of+ Model.TypeFunction v0 ->+ let dom = Model.functionTypeDomain v0+ cod = Model.functionTypeCodomain v0+ in (gatherFunctionTypes (Lists.cons dom prev) cod)+ _ -> Lists.reverse (Lists.cons t prev)+ in case typ of+ Model.TypeAnnotated v0 -> type_ (Model.annotatedTypeBody v0)+ Model.TypeApplication v0 ->+ let types = gatherTypes [] v0+ typeStrs = Lists.map type_ types+ in (Strings.concat [+ "(",+ (Strings.join " @ " typeStrs),+ ")"])+ Model.TypeEffect v0 -> Strings.concat [+ "effect<",+ (type_ v0),+ ">"]+ Model.TypeEither v0 ->+ let leftTyp = Model.eitherTypeLeft v0+ rightTyp = Model.eitherTypeRight v0+ in (Strings.concat [+ "either<",+ (type_ leftTyp),+ ", ",+ (type_ rightTyp),+ ">"])+ Model.TypeForall v0 ->+ let var = Model.unName (Model.forallTypeParameter v0)+ body = Model.forallTypeBody v0+ in (Strings.concat [+ "(\8704",+ var,+ ".",+ (type_ body),+ ")"])+ Model.TypeFunction _ ->+ let types = gatherFunctionTypes [] typ+ typeStrs = Lists.map type_ types+ in (Strings.concat [+ "(",+ (Strings.join " \8594 " typeStrs),+ ")"])+ Model.TypeList v0 -> Strings.concat [+ "list<",+ (type_ v0),+ ">"]+ Model.TypeLiteral v0 -> literalType v0+ Model.TypeMap v0 ->+ let keyTyp = Model.mapTypeKeys v0+ valTyp = Model.mapTypeValues v0+ in (Strings.concat [+ "map<",+ (type_ keyTyp),+ ", ",+ (type_ valTyp),+ ">"])+ Model.TypeOptional v0 -> Strings.concat [+ "optional<",+ (type_ v0),+ ">"]+ Model.TypePair v0 ->+ let firstTyp = Model.pairTypeFirst v0+ secondTyp = Model.pairTypeSecond v0+ in (Strings.concat [+ "(",+ (type_ firstTyp),+ ", ",+ (type_ secondTyp),+ ")"])+ Model.TypeRecord v0 -> Strings.concat2 "record" (showRowType v0)+ Model.TypeSet v0 -> Strings.concat [+ "set<",+ (type_ v0),+ ">"]+ Model.TypeUnion v0 -> Strings.concat2 "union" (showRowType v0)+ Model.TypeUnit -> "unit"+ Model.TypeVariable v0 -> Model.unName v0+ Model.TypeVoid -> "void"+ Model.TypeWrap v0 -> Strings.concat [+ "wrap(",+ (type_ v0),+ ")"]++-- | Show a type scheme as a string+typeScheme :: Model.TypeScheme -> String+typeScheme ts =++ let vars = Model.typeSchemeVariables ts+ body = Model.typeSchemeBody ts+ varNames = Lists.map Model.unName vars+ fa =+ Logic.ifElse (Lists.isEmpty vars) "" (Strings.concat [+ "forall ",+ (Strings.join "," varNames),+ ". "])+ toConstraintPair =+ \v -> \c -> Strings.concat [+ case c of+ Model.TypeClassConstraintSimple v0 -> Model.unName v0,+ " ",+ (Model.unName v)]+ toConstraintPairs =+ \p -> Lists.map (toConstraintPair (Pairs.first p)) (Sets.toList (Model.typeVariableConstraintsClasses (Pairs.second p)))+ tc = Lists.concat (Lists.map toConstraintPairs (Maps.toList (Model.typeSchemeConstraints ts)))+ in (Strings.concat [+ "(",+ fa,+ (Logic.ifElse (Lists.isEmpty tc) "" (Strings.concat [+ "(",+ (Strings.join ", " tc),+ ") => "])),+ (type_ body),+ ")"])
@@ -0,0 +1,139 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Serialization (printing and parsing) of subterm and subtype steps and paths.++module Hydra.Core.Print.Paths where++import qualified Hydra.Core.Ast as Ast+import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Diff as Diff+import qualified Hydra.Core.Docs as Docs+import qualified Hydra.Core.Error.Checking as Checking+import qualified Hydra.Core.Error.File as ErrorFile+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Error.Packaging as ErrorPackaging+import qualified Hydra.Core.Error.System as ErrorSystem+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Json.Model as JsonModel+import qualified Hydra.Core.Overlay.Haskell.Lib.Equality as Equality+import qualified Hydra.Core.Overlay.Haskell.Lib.Lists as Lists+import qualified Hydra.Core.Overlay.Haskell.Lib.Literals as Literals+import qualified Hydra.Core.Overlay.Haskell.Lib.Logic as Logic+import qualified Hydra.Core.Overlay.Haskell.Lib.Optionals as Optionals+import qualified Hydra.Core.Overlay.Haskell.Lib.Strings as Strings+import qualified Hydra.Core.Markdown as Markdown+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Names as Names+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Parsing as Parsing+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Query as Query+import qualified Hydra.Core.Regex as Regex+import qualified Hydra.Core.Relational as Relational+import qualified Hydra.Core.System as System+import qualified Hydra.Core.Tabular as Tabular+import qualified Hydra.Core.Testing as Testing+import qualified Hydra.Core.Time as Time+import qualified Hydra.Core.Topology as Topology+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Validation as Validation+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | Parse a printed subterm path (steps joined by '/') back into a SubtermPath+parseSubtermPath :: String -> Maybe Paths.SubtermPath+parseSubtermPath s =+ Optionals.map (\x -> Paths.SubtermPath x) (Lists.foldl (\macc -> \tok -> Optionals.bind macc (\acc -> Optionals.map (\st -> Lists.concat2 acc [+ st]) (parseSubtermStep tok))) (Just []) (Strings.splitOn "/" s))++-- | Parse a printed subterm step token back into a SubtermStep+parseSubtermStep :: String -> Maybe Paths.SubtermStep+parseSubtermStep tok =++ let segs = Strings.splitOn ":" tok+ tag = Optionals.withDefault tok (Lists.at 0 segs)+ mpayload = Lists.at 1 segs+ name = Optionals.map (\x -> Model.Name x) mpayload+ idx = Optionals.bind mpayload Literals.parseInt32+ in (Logic.ifElse (Equality.equal tag "annotatedAnnotation") (Just Paths.SubtermStepAnnotatedAnnotation) (Logic.ifElse (Equality.equal tag "annotatedBody") (Just Paths.SubtermStepAnnotatedBody) (Logic.ifElse (Equality.equal tag "applicationArgument") (Just Paths.SubtermStepApplicationArgument) (Logic.ifElse (Equality.equal tag "applicationFunction") (Just Paths.SubtermStepApplicationFunction) (Logic.ifElse (Equality.equal tag "casesCase") (Optionals.map (\x -> Paths.SubtermStepCasesCase x) name) (Logic.ifElse (Equality.equal tag "casesDefault") (Just Paths.SubtermStepCasesDefault) (Logic.ifElse (Equality.equal tag "eitherLeft") (Just Paths.SubtermStepEitherLeft) (Logic.ifElse (Equality.equal tag "eitherRight") (Just Paths.SubtermStepEitherRight) (Logic.ifElse (Equality.equal tag "injectField") (Optionals.map (\x -> Paths.SubtermStepInjectField x) name) (Logic.ifElse (Equality.equal tag "lambdaBody") (Just Paths.SubtermStepLambdaBody) (Logic.ifElse (Equality.equal tag "letBinding") (Optionals.map (\x -> Paths.SubtermStepLetBinding x) name) (Logic.ifElse (Equality.equal tag "letBody") (Just Paths.SubtermStepLetBody) (Logic.ifElse (Equality.equal tag "listElement") (Optionals.map (\x -> Paths.SubtermStepListElement x) idx) (Logic.ifElse (Equality.equal tag "mapEntry") (Optionals.map (\x -> Paths.SubtermStepMapEntry x) idx) (Logic.ifElse (Equality.equal tag "optionalGiven") (Just Paths.SubtermStepOptionalGiven) (Logic.ifElse (Equality.equal tag "pairFirst") (Just Paths.SubtermStepPairFirst) (Logic.ifElse (Equality.equal tag "pairSecond") (Just Paths.SubtermStepPairSecond) (Logic.ifElse (Equality.equal tag "recordField") (Optionals.map (\x -> Paths.SubtermStepRecordField x) name) (Logic.ifElse (Equality.equal tag "setElement") (Optionals.map (\x -> Paths.SubtermStepSetElement x) idx) (Logic.ifElse (Equality.equal tag "typeApplicationBody") (Just Paths.SubtermStepTypeApplicationBody) (Logic.ifElse (Equality.equal tag "typeLambdaBody") (Just Paths.SubtermStepTypeLambdaBody) (Logic.ifElse (Equality.equal tag "wrapBody") (Just Paths.SubtermStepWrapBody) Nothing))))))))))))))))))))))++-- | Parse a printed subtype path (steps joined by '/') back into a SubtypePath+parseSubtypePath :: String -> Maybe Paths.SubtypePath+parseSubtypePath s =+ Optionals.map (\x -> Paths.SubtypePath x) (Lists.foldl (\macc -> \tok -> Optionals.bind macc (\acc -> Optionals.map (\st -> Lists.concat2 acc [+ st]) (parseSubtypeStep tok))) (Just []) (Strings.splitOn "/" s))++-- | Parse a printed subtype step token back into a SubtypeStep+parseSubtypeStep :: String -> Maybe Paths.SubtypeStep+parseSubtypeStep tok =++ let segs = Strings.splitOn ":" tok+ tag = Optionals.withDefault tok (Lists.at 0 segs)+ mpayload = Lists.at 1 segs+ name = Optionals.map (\x -> Model.Name x) mpayload+ in (Logic.ifElse (Equality.equal tag "annotatedBody") (Just Paths.SubtypeStepAnnotatedBody) (Logic.ifElse (Equality.equal tag "applicationArgument") (Just Paths.SubtypeStepApplicationArgument) (Logic.ifElse (Equality.equal tag "applicationFunction") (Just Paths.SubtypeStepApplicationFunction) (Logic.ifElse (Equality.equal tag "effectValue") (Just Paths.SubtypeStepEffectValue) (Logic.ifElse (Equality.equal tag "eitherLeft") (Just Paths.SubtypeStepEitherLeft) (Logic.ifElse (Equality.equal tag "eitherRight") (Just Paths.SubtypeStepEitherRight) (Logic.ifElse (Equality.equal tag "forallBody") (Just Paths.SubtypeStepForallBody) (Logic.ifElse (Equality.equal tag "functionCodomain") (Just Paths.SubtypeStepFunctionCodomain) (Logic.ifElse (Equality.equal tag "functionDomain") (Just Paths.SubtypeStepFunctionDomain) (Logic.ifElse (Equality.equal tag "listElement") (Just Paths.SubtypeStepListElement) (Logic.ifElse (Equality.equal tag "mapKeys") (Just Paths.SubtypeStepMapKeys) (Logic.ifElse (Equality.equal tag "mapValues") (Just Paths.SubtypeStepMapValues) (Logic.ifElse (Equality.equal tag "optionalElement") (Just Paths.SubtypeStepOptionalElement) (Logic.ifElse (Equality.equal tag "pairFirst") (Just Paths.SubtypeStepPairFirst) (Logic.ifElse (Equality.equal tag "pairSecond") (Just Paths.SubtypeStepPairSecond) (Logic.ifElse (Equality.equal tag "recordField") (Optionals.map (\x -> Paths.SubtypeStepRecordField x) name) (Logic.ifElse (Equality.equal tag "setElement") (Just Paths.SubtypeStepSetElement) (Logic.ifElse (Equality.equal tag "unionField") (Optionals.map (\x -> Paths.SubtypeStepUnionField x) name) (Logic.ifElse (Equality.equal tag "wrapBody") (Just Paths.SubtypeStepWrapBody) Nothing)))))))))))))))))))++-- | Print a subterm path as its steps joined by '/'+subtermPath :: Paths.SubtermPath -> String+subtermPath path = Strings.join "/" (Lists.map subtermStep (Paths.unSubtermPath path))++-- | Print a subterm step in its round-trippable notation+subtermStep :: Paths.SubtermStep -> String+subtermStep step =+ case step of+ Paths.SubtermStepAnnotatedAnnotation -> "annotatedAnnotation"+ Paths.SubtermStepAnnotatedBody -> "annotatedBody"+ Paths.SubtermStepApplicationArgument -> "applicationArgument"+ Paths.SubtermStepApplicationFunction -> "applicationFunction"+ Paths.SubtermStepCasesCase v0 -> Strings.concat2 "casesCase:" (Model.unName v0)+ Paths.SubtermStepCasesDefault -> "casesDefault"+ Paths.SubtermStepEitherLeft -> "eitherLeft"+ Paths.SubtermStepEitherRight -> "eitherRight"+ Paths.SubtermStepInjectField v0 -> Strings.concat2 "injectField:" (Model.unName v0)+ Paths.SubtermStepLambdaBody -> "lambdaBody"+ Paths.SubtermStepLetBinding v0 -> Strings.concat2 "letBinding:" (Model.unName v0)+ Paths.SubtermStepLetBody -> "letBody"+ Paths.SubtermStepListElement v0 -> Strings.concat2 "listElement:" (Literals.printInt32 v0)+ Paths.SubtermStepMapEntry v0 -> Strings.concat2 "mapEntry:" (Literals.printInt32 v0)+ Paths.SubtermStepOptionalGiven -> "optionalGiven"+ Paths.SubtermStepPairFirst -> "pairFirst"+ Paths.SubtermStepPairSecond -> "pairSecond"+ Paths.SubtermStepRecordField v0 -> Strings.concat2 "recordField:" (Model.unName v0)+ Paths.SubtermStepSetElement v0 -> Strings.concat2 "setElement:" (Literals.printInt32 v0)+ Paths.SubtermStepTypeApplicationBody -> "typeApplicationBody"+ Paths.SubtermStepTypeLambdaBody -> "typeLambdaBody"+ Paths.SubtermStepWrapBody -> "wrapBody"++-- | Print a subtype path as its steps joined by '/'+subtypePath :: Paths.SubtypePath -> String+subtypePath path = Strings.join "/" (Lists.map subtypeStep (Paths.unSubtypePath path))++-- | Print a subtype step in its round-trippable notation+subtypeStep :: Paths.SubtypeStep -> String+subtypeStep step =+ case step of+ Paths.SubtypeStepAnnotatedBody -> "annotatedBody"+ Paths.SubtypeStepApplicationArgument -> "applicationArgument"+ Paths.SubtypeStepApplicationFunction -> "applicationFunction"+ Paths.SubtypeStepEffectValue -> "effectValue"+ Paths.SubtypeStepEitherLeft -> "eitherLeft"+ Paths.SubtypeStepEitherRight -> "eitherRight"+ Paths.SubtypeStepForallBody -> "forallBody"+ Paths.SubtypeStepFunctionCodomain -> "functionCodomain"+ Paths.SubtypeStepFunctionDomain -> "functionDomain"+ Paths.SubtypeStepListElement -> "listElement"+ Paths.SubtypeStepMapKeys -> "mapKeys"+ Paths.SubtypeStepMapValues -> "mapValues"+ Paths.SubtypeStepOptionalElement -> "optionalElement"+ Paths.SubtypeStepPairFirst -> "pairFirst"+ Paths.SubtypeStepPairSecond -> "pairSecond"+ Paths.SubtypeStepRecordField v0 -> Strings.concat2 "recordField:" (Model.unName v0)+ Paths.SubtypeStepSetElement -> "setElement"+ Paths.SubtypeStepUnionField v0 -> Strings.concat2 "unionField:" (Model.unName v0)+ Paths.SubtypeStepWrapBody -> "wrapBody"
@@ -0,0 +1,160 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Per-dialect printer rendering the hydra.core.regex AST into the PCRE / java.util.regex / ECMA family syntax (Java, Scala, Clojure, Python, Common Lisp, TypeScript). Differs from the canonical hydra.core.print.regex in exactly one place: Hydra's . (any character INCLUDING newline) renders as [\s\S] rather than a bare . (whose native meaning excludes newline in these engines). All other productions match the canonical form. See docs/specification/regex.md and issue #567.++module Hydra.Core.Print.Pcre.Regex where++import qualified Hydra.Core.Ast as Ast+import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Diff as Diff+import qualified Hydra.Core.Docs as Docs+import qualified Hydra.Core.Error.Checking as Checking+import qualified Hydra.Core.Error.File as ErrorFile+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Error.Packaging as ErrorPackaging+import qualified Hydra.Core.Error.System as ErrorSystem+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Json.Model as JsonModel+import qualified Hydra.Core.Overlay.Haskell.Lib.Equality as Equality+import qualified Hydra.Core.Overlay.Haskell.Lib.Lists as Lists+import qualified Hydra.Core.Overlay.Haskell.Lib.Literals as Literals+import qualified Hydra.Core.Overlay.Haskell.Lib.Logic as Logic+import qualified Hydra.Core.Overlay.Haskell.Lib.Strings as Strings+import qualified Hydra.Core.Markdown as Markdown+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Parsing as Parsing+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Query as Query+import qualified Hydra.Core.Regex as Regex+import qualified Hydra.Core.Relational as Relational+import qualified Hydra.Core.System as System+import qualified Hydra.Core.Tabular as Tabular+import qualified Hydra.Core.Testing as Testing+import qualified Hydra.Core.Time as Time+import qualified Hydra.Core.Topology as Topology+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Validation as Validation+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | Render an alternation, joining its branches with the | operator. Branches are ordered by descending rendered length so that PCRE/ECMA's leftmost-first matching agrees with Hydra's leftmost-longest semantics for fixed-length alternatives.+alternation :: [[Regex.Quantified]] -> String+alternation alt =++ let rendered = Lists.map regexSequence alt+ byLength = Lists.sortBy Strings.length rendered+ in (Strings.join "|" (Lists.reverse byLength))++-- | Render a single atom; the . metacharacter renders as [\s\S] to preserve newline-inclusive 'any'.+atom :: Regex.Atom -> String+atom a =+ case a of+ Regex.AtomLiteral v0 -> escapeLiteral v0+ Regex.AtomAny -> "[\\s\\S]"+ Regex.AtomAnchorStart -> "^"+ Regex.AtomAnchorEnd -> "$"+ Regex.AtomGroup v0 -> Strings.concat [+ "(",+ (alternation v0),+ ")"]+ Regex.AtomClass v0 -> characterClass v0++-- | Render a character class, including the leading ^ for a negated class.+characterClass :: Regex.CharacterClass -> String+characterClass cc =+ Strings.concat [+ "[",+ (Logic.ifElse (Regex.characterClassNegated cc) "^" ""),+ (Strings.concat (Lists.map classItem (Regex.characterClassItems cc))),+ "]"]++-- | Render one character-class member (a single character or an inclusive range).+classItem :: Regex.ClassItem -> String+classItem item =+ case item of+ Regex.ClassItemCharacter v0 -> escapeClassChar v0+ Regex.ClassItemRange v0 -> Strings.concat [+ escapeClassChar (Regex.characterRangeFrom v0),+ "-",+ (escapeClassChar (Regex.characterRangeTo v0))]++-- | Render a code point inside a character class, uniformly escaping the class metacharacters \ ] ^ -.+escapeClassChar :: Int -> String+escapeClassChar c =++ let isMeta =+ Lists.foldl (\acc -> \m -> Logic.or acc (Equality.equal c m)) False [+ 92,+ 93,+ 94,+ 45]+ in (Logic.ifElse isMeta (Strings.concat2 "\\" (printCodePoint c)) (printCodePoint c))++-- | Render a literal code point in top-level context, backslash-escaping PCRE/ECMA metacharacters.+escapeLiteral :: Int -> String+escapeLiteral c =++ let isMeta =+ Lists.foldl (\acc -> \m -> Logic.or acc (Equality.equal c m)) False [+ 46,+ 94,+ 36,+ 42,+ 43,+ 63,+ 40,+ 41,+ 91,+ 93,+ 123,+ 125,+ 124,+ 92]+ in (Logic.ifElse isMeta (Strings.concat2 "\\" (printCodePoint c)) (printCodePoint c))++-- | Render a single Unicode code point as a one-character string.+printCodePoint :: Int -> String+printCodePoint c = Strings.fromList [+ c]++-- | Render a hydra.core.regex AST into PCRE / java.util.regex / ECMA syntax. Identical to the canonical printer except that . (any incl. newline) becomes [\s\S].+printRegex :: [[Regex.Quantified]] -> String+printRegex r = alternation r++-- | Render an atom followed by its quantifier suffix.+quantified :: Regex.Quantified -> String+quantified qa = Strings.concat2 (atom (Regex.quantifiedAtom qa)) (quantifier (Regex.quantifiedQuantifier qa))++-- | Render a quantifier suffix; the 'one' quantifier renders as the empty string.+quantifier :: Regex.Quantifier -> String+quantifier q =+ case q of+ Regex.QuantifierOne -> ""+ Regex.QuantifierZeroOrOne -> "?"+ Regex.QuantifierZeroOrMore -> "*"+ Regex.QuantifierOneOrMore -> "+"+ Regex.QuantifierExactly v0 -> Strings.concat [+ "{",+ (Literals.printInt32 v0),+ "}"]+ Regex.QuantifierAtLeast v0 -> Strings.concat [+ "{",+ (Literals.printInt32 v0),+ ",}"]+ Regex.QuantifierRange_ v0 -> Strings.concat [+ "{",+ (Literals.printInt32 (Regex.quantifierRangeMin v0)),+ ",",+ (Literals.printInt32 (Regex.quantifierRangeMax v0)),+ "}"]++-- | Render a sequence of quantified atoms by concatenation.+regexSequence :: [Regex.Quantified] -> String+regexSequence s = Strings.concat (Lists.map quantified s)
@@ -0,0 +1,178 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Per-dialect printer rendering the hydra.core.regex AST into POSIX ERE syntax (Haskell Text.Regex.TDFA, Scheme Guile (ice-9 regex)). Differs from the canonical hydra.core.print.regex in three places, each probe-verified against BOTH TDFA and Guile (docs/specification/regex.md and issue #567/#603/#729-land): (1) Hydra's . (any character INCLUDING newline) renders as (.|<newline>), a grouped alternation, because POSIX ERE's native . excludes newline, does not support the \s / \S shorthands, and (on Guile specifically) rejects a literal NUL byte inside a bracket expression, ruling out an explicit [<U+0000>-<U+10FFFF>] range class; (2) anchors ^ and $ (whole-STRING boundaries in Hydra) render as the GNU/glibc whole-buffer anchors \` and \', because TDFA's native ^ and $ are line-oriented; (3) character-class metacharacters ] ^ - are disambiguated POSITIONALLY (] first, - last, ^ never first) rather than by backslash-escaping, because POSIX ERE bracket expressions have no escape mechanism at all (a backslash inside [...] is an ordinary character on TDFA). All other productions are native POSIX ERE.++module Hydra.Core.Print.Posix.Regex where++import qualified Hydra.Core.Ast as Ast+import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Diff as Diff+import qualified Hydra.Core.Docs as Docs+import qualified Hydra.Core.Error.Checking as Checking+import qualified Hydra.Core.Error.File as ErrorFile+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Error.Packaging as ErrorPackaging+import qualified Hydra.Core.Error.System as ErrorSystem+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Json.Model as JsonModel+import qualified Hydra.Core.Overlay.Haskell.Lib.Equality as Equality+import qualified Hydra.Core.Overlay.Haskell.Lib.Lists as Lists+import qualified Hydra.Core.Overlay.Haskell.Lib.Literals as Literals+import qualified Hydra.Core.Overlay.Haskell.Lib.Logic as Logic+import qualified Hydra.Core.Overlay.Haskell.Lib.Pairs as Pairs+import qualified Hydra.Core.Overlay.Haskell.Lib.Strings as Strings+import qualified Hydra.Core.Markdown as Markdown+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Parsing as Parsing+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Query as Query+import qualified Hydra.Core.Regex as Regex+import qualified Hydra.Core.Relational as Relational+import qualified Hydra.Core.System as System+import qualified Hydra.Core.Tabular as Tabular+import qualified Hydra.Core.Testing as Testing+import qualified Hydra.Core.Time as Time+import qualified Hydra.Core.Topology as Topology+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Validation as Validation+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | Render an alternation, joining its branches with the | operator.+alternation :: [[Regex.Quantified]] -> String+alternation alt = Strings.join "|" (Lists.map regexSequence alt)++-- | The POSIX ERE rendering of Hydra's . (any character incl. newline): '.' alternated with an explicit newline, grouped — portable across POSIX ERE engines including Guile, which rejects a literal NUL byte in a bracket expression.+anyClass :: String+anyClass =+ Strings.concat [+ "(.|",+ (printCodePoint 10),+ ")"]++-- | Render a single atom; . renders as (.|<newline>), portable across POSIX ERE engines.+atom :: Regex.Atom -> String+atom a =+ case a of+ Regex.AtomLiteral v0 -> escapeLiteral v0+ Regex.AtomAny -> anyClass+ Regex.AtomAnchorStart -> "\\`"+ Regex.AtomAnchorEnd -> "\\'"+ Regex.AtomGroup v0 -> Strings.concat [+ "(",+ (alternation v0),+ ")"]+ Regex.AtomClass v0 -> characterClass v0++-- | Render a character class, including the leading ^ for a negated class. Reorders items positionally for POSIX ERE (which has no bracket-expression escaping): a literal ] is moved to the front (immediately after the optional negating ^), a literal - is moved to the back, and (only when there is no literal ] item to occupy the first slot) a literal ^ is moved after the first non-^ item -- POSIX treats a leading ^ as the negation marker regardless of Hydra's negated flag. The one residual gap: a class whose only member is a literal ^ has no safe position on POSIX ERE; this is an extreme corner case (single-item classes are otherwise unremarkable) and is left unhandled here.+characterClass :: Regex.CharacterClass -> String+characterClass cc =++ let items = Regex.characterClassItems cc+ bracketAndRest = Lists.partition (classItemIsLiteral 93) items+ bracketItems = Pairs.first bracketAndRest+ afterBracket = Pairs.second bracketAndRest+ dashAndRest = Lists.partition (classItemIsLiteral 45) afterBracket+ dashItems = Pairs.first dashAndRest+ rest = Pairs.second dashAndRest+ caretAndNonCaret = Lists.partition (classItemIsLiteral 94) rest+ caretItems = Pairs.first caretAndNonCaret+ nonCaretItems = Pairs.second caretAndNonCaret+ safeRest =+ Logic.ifElse (Logic.or (Logic.not (Lists.isEmpty bracketItems)) (Lists.isEmpty nonCaretItems)) rest (Lists.concat2 nonCaretItems caretItems)+ ordered =+ Lists.concat [+ bracketItems,+ safeRest,+ dashItems]+ in (Strings.concat [+ "[",+ (Logic.ifElse (Regex.characterClassNegated cc) "^" ""),+ (Strings.concat (Lists.map classItem ordered)),+ "]"])++-- | Render one character-class member (a single character or an inclusive range). POSIX ERE bracket expressions do NOT support backslash escaping (confirmed by TDFA probe: \- and \] inside [...] are two literal characters, not an escape); the metacharacters ] ^ - are instead disambiguated positionally by characterClass (] first, - last, ^ never first), so a plain character or range here never needs an escape.+classItem :: Regex.ClassItem -> String+classItem item =+ case item of+ Regex.ClassItemCharacter v0 -> printCodePoint v0+ Regex.ClassItemRange v0 -> Strings.concat [+ printCodePoint (Regex.characterRangeFrom v0),+ "-",+ (printCodePoint (Regex.characterRangeTo v0))]++-- | True if a ClassItem is the single literal character code point c (not a range).+classItemIsLiteral :: Int -> Regex.ClassItem -> Bool+classItemIsLiteral c item =+ case item of+ Regex.ClassItemCharacter v0 -> Equality.equal v0 c+ _ -> False++-- | Render a literal code point in top-level context, backslash-escaping POSIX ERE metacharacters.+escapeLiteral :: Int -> String+escapeLiteral c =++ let isMeta =+ Lists.foldl (\acc -> \m -> Logic.or acc (Equality.equal c m)) False [+ 46,+ 94,+ 36,+ 42,+ 43,+ 63,+ 40,+ 41,+ 91,+ 93,+ 123,+ 125,+ 124,+ 92]+ in (Logic.ifElse isMeta (Strings.concat2 "\\" (printCodePoint c)) (printCodePoint c))++-- | Render a single Unicode code point as a one-character string.+printCodePoint :: Int -> String+printCodePoint c = Strings.fromList [+ c]++-- | Render a hydra.core.regex AST into POSIX ERE syntax. Identical to the canonical printer except that . (any incl. newline) becomes the grouped alternation (.|<newline>).+printRegex :: [[Regex.Quantified]] -> String+printRegex r = alternation r++-- | Render an atom followed by its quantifier suffix.+quantified :: Regex.Quantified -> String+quantified qa = Strings.concat2 (atom (Regex.quantifiedAtom qa)) (quantifier (Regex.quantifiedQuantifier qa))++-- | Render a quantifier suffix; the 'one' quantifier renders as the empty string.+quantifier :: Regex.Quantifier -> String+quantifier q =+ case q of+ Regex.QuantifierOne -> ""+ Regex.QuantifierZeroOrOne -> "?"+ Regex.QuantifierZeroOrMore -> "*"+ Regex.QuantifierOneOrMore -> "+"+ Regex.QuantifierExactly v0 -> Strings.concat [+ "{",+ (Literals.printInt32 v0),+ "}"]+ Regex.QuantifierAtLeast v0 -> Strings.concat [+ "{",+ (Literals.printInt32 v0),+ ",}"]+ Regex.QuantifierRange_ v0 -> Strings.concat [+ "{",+ (Literals.printInt32 (Regex.quantifierRangeMin v0)),+ ",",+ (Literals.printInt32 (Regex.quantifierRangeMax v0)),+ "}"]++-- | Render a sequence of quantified atoms by concatenation.+regexSequence :: [Regex.Quantified] -> String+regexSequence s = Strings.concat (Lists.map quantified s)
@@ -0,0 +1,156 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Canonical printer for Hydra's translingual regular-expression syntax (docs/specification/regex.md): hydra.core.regex AST -> canonical text. Escapes minimally (a character is escaped only where it is special in its context), so that print.regex . parse.regex is idempotent on well-formed input. Per-dialect renderers (hydra.core.print.<dialect>.regex) build on this. See issue #567.++module Hydra.Core.Print.Regex where++import qualified Hydra.Core.Ast as Ast+import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Diff as Diff+import qualified Hydra.Core.Docs as Docs+import qualified Hydra.Core.Error.Checking as Checking+import qualified Hydra.Core.Error.File as ErrorFile+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Error.Packaging as ErrorPackaging+import qualified Hydra.Core.Error.System as ErrorSystem+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Json.Model as JsonModel+import qualified Hydra.Core.Overlay.Haskell.Lib.Equality as Equality+import qualified Hydra.Core.Overlay.Haskell.Lib.Lists as Lists+import qualified Hydra.Core.Overlay.Haskell.Lib.Literals as Literals+import qualified Hydra.Core.Overlay.Haskell.Lib.Logic as Logic+import qualified Hydra.Core.Overlay.Haskell.Lib.Strings as Strings+import qualified Hydra.Core.Markdown as Markdown+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Parsing as Parsing+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Query as Query+import qualified Hydra.Core.Regex as Regex+import qualified Hydra.Core.Relational as Relational+import qualified Hydra.Core.System as System+import qualified Hydra.Core.Tabular as Tabular+import qualified Hydra.Core.Testing as Testing+import qualified Hydra.Core.Time as Time+import qualified Hydra.Core.Topology as Topology+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Validation as Validation+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | Render an alternation, joining its branches with the | operator.+alternation :: [[Regex.Quantified]] -> String+alternation alt = Strings.join "|" (Lists.map regexSequence alt)++-- | Render a single atom (literal, ., anchor, group, or class) to canonical text.+atom :: Regex.Atom -> String+atom a =+ case a of+ Regex.AtomLiteral v0 -> escapeLiteral v0+ Regex.AtomAny -> "."+ Regex.AtomAnchorStart -> "^"+ Regex.AtomAnchorEnd -> "$"+ Regex.AtomGroup v0 -> Strings.concat [+ "(",+ (alternation v0),+ ")"]+ Regex.AtomClass v0 -> characterClass v0++-- | Render a character class, including the leading ^ for a negated class.+characterClass :: Regex.CharacterClass -> String+characterClass cc =+ Strings.concat [+ "[",+ (Logic.ifElse (Regex.characterClassNegated cc) "^" ""),+ (Strings.concat (Lists.map classItem (Regex.characterClassItems cc))),+ "]"]++-- | Render one character-class member (a single character or an inclusive range) to canonical text.+classItem :: Regex.ClassItem -> String+classItem item =+ case item of+ Regex.ClassItemCharacter v0 -> escapeClassChar v0+ Regex.ClassItemRange v0 -> Strings.concat [+ escapeClassChar (Regex.characterRangeFrom v0),+ "-",+ (escapeClassChar (Regex.characterRangeTo v0))]++-- | Render a code point inside a character class, backslash-escaping it iff it is one of the class metacharacters \ ] ^ -. Escaping is uniform, with no positional exceptions (a literal '-' always prints as \-).+escapeClassChar :: Int -> String+escapeClassChar c =++ let isMeta =+ Lists.foldl (\acc -> \m -> Logic.or acc (Equality.equal c m)) False [+ 92,+ 93,+ 94,+ 45]+ in (Logic.ifElse isMeta (Strings.concat2 "\\" (printCodePoint c)) (printCodePoint c))++-- | Render a literal code point in top-level context, backslash-escaping it iff it is one of the top-level metacharacters . ^ $ * + ? ( ) [ ] { } | \. A '-' is not special at top level and prints bare.+escapeLiteral :: Int -> String+escapeLiteral c =++ let isMeta =+ Lists.foldl (\acc -> \m -> Logic.or acc (Equality.equal c m)) False [+ 46,+ 94,+ 36,+ 42,+ 43,+ 63,+ 40,+ 41,+ 91,+ 93,+ 123,+ 125,+ 124,+ 92]+ in (Logic.ifElse isMeta (Strings.concat2 "\\" (printCodePoint c)) (printCodePoint c))++-- | Render a single Unicode code point as a one-character string.+printCodePoint :: Int -> String+printCodePoint c = Strings.fromList [+ c]++-- | Render a hydra.core.regex AST to canonical Hydra regex text. Escapes minimally, so that printRegex . parseRegex is the identity on well-formed patterns.+printRegex :: [[Regex.Quantified]] -> String+printRegex r = alternation r++-- | Render an atom followed by its quantifier suffix.+quantified :: Regex.Quantified -> String+quantified qa = Strings.concat2 (atom (Regex.quantifiedAtom qa)) (quantifier (Regex.quantifiedQuantifier qa))++-- | Render a quantifier suffix; the 'one' quantifier renders as the empty string.+quantifier :: Regex.Quantifier -> String+quantifier q =+ case q of+ Regex.QuantifierOne -> ""+ Regex.QuantifierZeroOrOne -> "?"+ Regex.QuantifierZeroOrMore -> "*"+ Regex.QuantifierOneOrMore -> "+"+ Regex.QuantifierExactly v0 -> Strings.concat [+ "{",+ (Literals.printInt32 v0),+ "}"]+ Regex.QuantifierAtLeast v0 -> Strings.concat [+ "{",+ (Literals.printInt32 v0),+ ",}"]+ Regex.QuantifierRange_ v0 -> Strings.concat [+ "{",+ (Literals.printInt32 (Regex.quantifierRangeMin v0)),+ ",",+ (Literals.printInt32 (Regex.quantifierRangeMax v0)),+ "}"]++-- | Render a sequence of quantified atoms by concatenation.+regexSequence :: [Regex.Quantified] -> String+regexSequence s = Strings.concat (Lists.map quantified s)
@@ -0,0 +1,76 @@+-- Note: this is an automatically generated file. Do not edit.++-- | String representations of hydra.core.typing types++module Hydra.Core.Print.Typing where++import qualified Hydra.Core.Ast as Ast+import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Diff as Diff+import qualified Hydra.Core.Docs as Docs+import qualified Hydra.Core.Error.Checking as Checking+import qualified Hydra.Core.Error.File as ErrorFile+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Error.Packaging as ErrorPackaging+import qualified Hydra.Core.Error.System as ErrorSystem+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Json.Model as JsonModel+import qualified Hydra.Core.Overlay.Haskell.Lib.Lists as Lists+import qualified Hydra.Core.Overlay.Haskell.Lib.Maps as Maps+import qualified Hydra.Core.Overlay.Haskell.Lib.Pairs as Pairs+import qualified Hydra.Core.Overlay.Haskell.Lib.Strings as Strings+import qualified Hydra.Core.Markdown as Markdown+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Parsing as Parsing+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Print.Model as PrintModel+import qualified Hydra.Core.Query as Query+import qualified Hydra.Core.Regex as Regex+import qualified Hydra.Core.Relational as Relational+import qualified Hydra.Core.System as System+import qualified Hydra.Core.Tabular as Tabular+import qualified Hydra.Core.Testing as Testing+import qualified Hydra.Core.Time as Time+import qualified Hydra.Core.Topology as Topology+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Validation as Validation+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | Show a type constraint as a string+typeConstraint :: Typing.TypeConstraint -> String+typeConstraint tc =++ let ltyp = Typing.typeConstraintLeft tc+ rtyp = Typing.typeConstraintRight tc+ in (Strings.concat [+ PrintModel.type_ ltyp,+ "\8801",+ (PrintModel.type_ rtyp)])++-- | Show a type substitution as a string+typeSubst :: Typing.TypeSubst -> String+typeSubst ts =++ let subst = Typing.unTypeSubst ts+ pairs = Maps.toList subst+ showPair =+ \pair ->+ let name = Model.unName (Pairs.first pair)+ typ = Pairs.second pair+ in (Strings.concat [+ name,+ "\8614",+ (PrintModel.type_ typ)])+ pairStrs = Lists.map showPair pairs+ in (Strings.concat [+ "{",+ (Strings.join "," pairStrs),+ "}"])
@@ -0,0 +1,58 @@+-- Note: this is an automatically generated file. Do not edit.++-- | String representations of hydra.core.util types++module Hydra.Core.Print.Util where++import qualified Hydra.Core.Ast as Ast+import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Diff as Diff+import qualified Hydra.Core.Docs as Docs+import qualified Hydra.Core.Error.Checking as Checking+import qualified Hydra.Core.Error.File as ErrorFile+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Error.Packaging as ErrorPackaging+import qualified Hydra.Core.Error.System as ErrorSystem+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Json.Model as JsonModel+import qualified Hydra.Core.Markdown as Markdown+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Parsing as Parsing+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Query as Query+import qualified Hydra.Core.Regex as Regex+import qualified Hydra.Core.Relational as Relational+import qualified Hydra.Core.System as System+import qualified Hydra.Core.Tabular as Tabular+import qualified Hydra.Core.Testing as Testing+import qualified Hydra.Core.Time as Time+import qualified Hydra.Core.Topology as Topology+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Validation as Validation+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | Show a case convention as a string+caseConvention :: Util.CaseConvention -> String+caseConvention c =+ case c of+ Util.CaseConventionLowerSnake -> "lower_snake_case"+ Util.CaseConventionUpperSnake -> "UPPER_SNAKE_CASE"+ Util.CaseConventionCamel -> "camelCase"+ Util.CaseConventionPascal -> "PascalCase"+ Util.CaseConventionUpperDashed -> "UPPER-DASHED-CASE"++-- | Show a comparison result as a string+comparison :: Util.Comparison -> String+comparison c =+ case c of+ Util.ComparisonLessThan -> "lessThan"+ Util.ComparisonEqualTo -> "equalTo"+ Util.ComparisonGreaterThan -> "greaterThan"
@@ -0,0 +1,89 @@+-- Note: this is an automatically generated file. Do not edit.++-- | String representations of hydra.core.variants types++module Hydra.Core.Print.Variants where++import qualified Hydra.Core.Ast as Ast+import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Diff as Diff+import qualified Hydra.Core.Docs as Docs+import qualified Hydra.Core.Error.Checking as Checking+import qualified Hydra.Core.Error.File as ErrorFile+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Error.Packaging as ErrorPackaging+import qualified Hydra.Core.Error.System as ErrorSystem+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Json.Model as JsonModel+import qualified Hydra.Core.Markdown as Markdown+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Parsing as Parsing+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Query as Query+import qualified Hydra.Core.Regex as Regex+import qualified Hydra.Core.Relational as Relational+import qualified Hydra.Core.System as System+import qualified Hydra.Core.Tabular as Tabular+import qualified Hydra.Core.Testing as Testing+import qualified Hydra.Core.Time as Time+import qualified Hydra.Core.Topology as Topology+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Validation as Validation+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | Show a term variant as a string+termVariant :: Variants.TermVariant -> String+termVariant x =+ case x of+ Variants.TermVariantAnnotated -> "annotated"+ Variants.TermVariantApplication -> "application"+ Variants.TermVariantCases -> "cases"+ Variants.TermVariantEither -> "either"+ Variants.TermVariantLambda -> "lambda"+ Variants.TermVariantLet -> "let"+ Variants.TermVariantList -> "list"+ Variants.TermVariantLiteral -> "literal"+ Variants.TermVariantMap -> "map"+ Variants.TermVariantOptional -> "optional"+ Variants.TermVariantPair -> "pair"+ Variants.TermVariantProject -> "project"+ Variants.TermVariantRecord -> "record"+ Variants.TermVariantSet -> "set"+ Variants.TermVariantTypeLambda -> "typeLambda"+ Variants.TermVariantTypeApplication -> "typeApplication"+ Variants.TermVariantInject -> "inject"+ Variants.TermVariantUnit -> "unit"+ Variants.TermVariantUnwrap -> "unwrap"+ Variants.TermVariantVariable -> "variable"+ Variants.TermVariantWrap -> "wrap"++-- | Show a type variant as a string+typeVariant :: Variants.TypeVariant -> String+typeVariant x =+ case x of+ Variants.TypeVariantAnnotated -> "annotated"+ Variants.TypeVariantApplication -> "application"+ Variants.TypeVariantEffect -> "effect"+ Variants.TypeVariantEither -> "either"+ Variants.TypeVariantForall -> "forall"+ Variants.TypeVariantFunction -> "function"+ Variants.TypeVariantList -> "list"+ Variants.TypeVariantLiteral -> "literal"+ Variants.TypeVariantMap -> "map"+ Variants.TypeVariantOptional -> "optional"+ Variants.TypeVariantPair -> "pair"+ Variants.TypeVariantRecord -> "record"+ Variants.TypeVariantSet -> "set"+ Variants.TypeVariantUnion -> "union"+ Variants.TypeVariantUnit -> "unit"+ Variants.TypeVariantVariable -> "variable"+ Variants.TypeVariantVoid -> "void"+ Variants.TypeVariantWrap -> "wrap"
@@ -0,0 +1,284 @@+-- Note: this is an automatically generated file. Do not edit.++-- | A model for language-agnostic graph pattern queries++module Hydra.Core.Query where++import qualified Hydra.Core.Model as Model+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | One of several comparison operators+data ComparisonConstraint =+ ComparisonConstraintEqual |+ ComparisonConstraintNotEqual |+ ComparisonConstraintLessThan |+ ComparisonConstraintGreaterThan |+ ComparisonConstraintLessThanOrEqual |+ ComparisonConstraintGreaterThanOrEqual+ deriving (Eq, Ord, Read, Show)++_ComparisonConstraint = Model.Name "hydra.core.query.ComparisonConstraint"++_ComparisonConstraint_equal = Model.Name "equal"++_ComparisonConstraint_notEqual = Model.Name "notEqual"++_ComparisonConstraint_lessThan = Model.Name "lessThan"++_ComparisonConstraint_greaterThan = Model.Name "greaterThan"++_ComparisonConstraint_lessThanOrEqual = Model.Name "lessThanOrEqual"++_ComparisonConstraint_greaterThanOrEqual = Model.Name "greaterThanOrEqual"++-- | An abstract edge based on a record type+data Edge =+ Edge {+ -- | The name of a record type, for which the edge also specifies an out- and an in- projection+ edgeType :: Model.Name,+ -- | The field representing the out-projection of the edge. Defaults to 'out'.+ edgeOut :: (Maybe Model.Name),+ -- | The field representing the in-projection of the edge. Defaults to 'in'.+ edgeIn :: (Maybe Model.Name)}+ deriving (Eq, Ord, Read, Show)++_Edge = Model.Name "hydra.core.query.Edge"++_Edge_type = Model.Name "type"++_Edge_out = Model.Name "out"++_Edge_in = Model.Name "in"++-- | A query pattern which matches within a designated component subgraph+data GraphPattern =+ GraphPattern {+ -- | The name of the component graph+ graphPatternGraph :: Model.Name,+ -- | The patterns to match within the subgraph+ graphPatternPatterns :: [Pattern]}+ deriving (Eq, Ord, Read, Show)++_GraphPattern = Model.Name "hydra.core.query.GraphPattern"++_GraphPattern_graph = Model.Name "graph"++_GraphPattern_patterns = Model.Name "patterns"++-- | A node in a query expression; it may be a term, a variable, or a wildcard+data Node =+ -- | A graph term; an expression which is valid in the graph being matched+ NodeTerm Model.Term |+ -- | A query variable, not to be confused with a variable term+ NodeVariable Variable |+ -- | An anonymous variable which we do not care to join across patterns+ NodeWildcard+ deriving (Eq, Ord, Read, Show)++_Node = Model.Name "hydra.core.query.Node"++_Node_term = Model.Name "term"++_Node_variable = Model.Name "variable"++_Node_wildcard = Model.Name "wildcard"++-- | A query path+data Path =+ -- | A path given by a single step+ PathStep Step |+ -- | A path given by a regular expression quantifier applied to another path+ PathRegex RegexSequence |+ -- | A path given by the inverse of another path+ PathInverse Path+ deriving (Eq, Ord, Read, Show)++_Path = Model.Name "hydra.core.query.Path"++_Path_step = Model.Name "step"++_Path_regex = Model.Name "regex"++_Path_inverse = Model.Name "inverse"++-- | A declared equivalence between two abstract paths in a graph+data PathEquation =+ PathEquation {+ -- | The left-hand side of the equation+ pathEquationLeft :: Path,+ -- | The right-hand side of the equation+ pathEquationRight :: Path}+ deriving (Eq, Ord, Read, Show)++_PathEquation = Model.Name "hydra.core.query.PathEquation"++_PathEquation_left = Model.Name "left"++_PathEquation_right = Model.Name "right"++-- | A query pattern+data Pattern =+ -- | A subject/predicate/object pattern+ PatternTriple TriplePattern |+ -- | The negation of another pattern+ PatternNegation Pattern |+ -- | The conjunction ('and') of several other patterns+ PatternConjunction [Pattern] |+ -- | The disjunction (inclusive 'or') of several other patterns+ PatternDisjunction [Pattern] |+ -- | A pattern which matches within a named subgraph+ PatternGraph GraphPattern+ deriving (Eq, Ord, Read, Show)++_Pattern = Model.Name "hydra.core.query.Pattern"++_Pattern_triple = Model.Name "triple"++_Pattern_negation = Model.Name "negation"++_Pattern_conjunction = Model.Name "conjunction"++_Pattern_disjunction = Model.Name "disjunction"++_Pattern_graph = Model.Name "graph"++-- | A pattern which, if it matches in a given graph, implies that another pattern must also match. Query variables are shared between the two patterns.+data PatternImplication =+ PatternImplication {+ -- | The pattern which, if it matches, triggers the constraint+ patternImplicationAntecedent :: Pattern,+ -- | The pattern which must also match when the antecedent matches+ patternImplicationConsequent :: Pattern}+ deriving (Eq, Ord, Read, Show)++_PatternImplication = Model.Name "hydra.core.query.PatternImplication"++_PatternImplication_antecedent = Model.Name "antecedent"++_PatternImplication_consequent = Model.Name "consequent"++-- | A SELECT-style graph pattern matching query+data Query =+ Query {+ -- | The variables selected by the query+ queryVariables :: [Variable],+ -- | The patterns to be matched+ queryPatterns :: [Pattern]}+ deriving (Eq, Ord, Read, Show)++_Query = Model.Name "hydra.core.query.Query"++_Query_variables = Model.Name "variables"++_Query_patterns = Model.Name "patterns"++-- | A range from min to max, inclusive+data Range =+ Range {+ -- | The minimum value (inclusive)+ rangeMin :: Int,+ -- | The maximum value (inclusive)+ rangeMax :: Int}+ deriving (Eq, Ord, Read, Show)++_Range = Model.Name "hydra.core.query.Range"++_Range_min = Model.Name "min"++_Range_max = Model.Name "max"++-- | A regular expression quantifier+data RegexQuantifier =+ -- | No quantifier; matches a single occurrence+ RegexQuantifierOne |+ -- | The ? quanifier; matches zero or one occurrence+ RegexQuantifierZeroOrOne |+ -- | The * quantifier; matches any number of occurrences+ RegexQuantifierZeroOrMore |+ -- | The + quantifier; matches one or more occurrences+ RegexQuantifierOneOrMore |+ -- | The {n} quantifier; matches exactly n occurrences+ RegexQuantifierExactly Int |+ -- | The {n,} quantifier; matches at least n occurrences+ RegexQuantifierAtLeast Int |+ -- | The {n, m} quantifier; matches between n and m (inclusive) occurrences+ RegexQuantifierRange Range+ deriving (Eq, Ord, Read, Show)++_RegexQuantifier = Model.Name "hydra.core.query.RegexQuantifier"++_RegexQuantifier_one = Model.Name "one"++_RegexQuantifier_zeroOrOne = Model.Name "zeroOrOne"++_RegexQuantifier_zeroOrMore = Model.Name "zeroOrMore"++_RegexQuantifier_oneOrMore = Model.Name "oneOrMore"++_RegexQuantifier_exactly = Model.Name "exactly"++_RegexQuantifier_atLeast = Model.Name "atLeast"++_RegexQuantifier_range = Model.Name "range"++-- | A path with a regex quantifier+data RegexSequence =+ RegexSequence {+ -- | The path to which the quantifier applies+ regexSequencePath :: Path,+ -- | The quantifier+ regexSequenceQuantifier :: RegexQuantifier}+ deriving (Eq, Ord, Read, Show)++_RegexSequence = Model.Name "hydra.core.query.RegexSequence"++_RegexSequence_path = Model.Name "path"++_RegexSequence_quantifier = Model.Name "quantifier"++-- | An atomic function as part of a query. When applied to a graph, steps are typed by function types.+data Step =+ -- | An out-to-in traversal of an abstract edge+ StepEdge Edge |+ -- | A projection from a record through one of its fields+ StepProject Model.Projection |+ -- | A comparison of two terms+ StepCompare ComparisonConstraint+ deriving (Eq, Ord, Read, Show)++_Step = Model.Name "hydra.core.query.Step"++_Step_edge = Model.Name "edge"++_Step_project = Model.Name "project"++_Step_compare = Model.Name "compare"++-- | A subject/predicate/object pattern+data TriplePattern =+ TriplePattern {+ -- | The subject of the pattern+ triplePatternSubject :: Node,+ -- | The predicate (property) of the pattern+ triplePatternPredicate :: Path,+ -- | The object of the pattern+ triplePatternObject :: Node}+ deriving (Eq, Ord, Read, Show)++_TriplePattern = Model.Name "hydra.core.query.TriplePattern"++_TriplePattern_subject = Model.Name "subject"++_TriplePattern_predicate = Model.Name "predicate"++_TriplePattern_object = Model.Name "object"++-- | A query variable+newtype Variable =+ Variable {+ unVariable :: String}+ deriving (Eq, Ord, Read, Show)++_Variable = Model.Name "hydra.core.query.Variable"
@@ -0,0 +1,626 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Functions for reducing terms and types, i.e. performing computations.++module Hydra.Core.Reduction where++import qualified Hydra.Core.Annotations as Annotations+import qualified Hydra.Core.Arity as Arity+import qualified Hydra.Core.Ast as Ast+import qualified Hydra.Core.Checking as Checking+import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Diff as Diff+import qualified Hydra.Core.Docs as Docs+import qualified Hydra.Core.Encode.Model as EncodeModel+import qualified Hydra.Core.Error.Checking as ErrorChecking+import qualified Hydra.Core.Error.File as ErrorFile+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Error.Packaging as ErrorPackaging+import qualified Hydra.Core.Error.System as ErrorSystem+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.Extract.Model as ExtractModel+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Hoisting as Hoisting+import qualified Hydra.Core.Inference as Inference+import qualified Hydra.Core.Json.Model as JsonModel+import qualified Hydra.Core.Lexical as Lexical+import qualified Hydra.Core.Overlay.Haskell.Lib.Eithers as Eithers+import qualified Hydra.Core.Overlay.Haskell.Lib.Equality as Equality+import qualified Hydra.Core.Overlay.Haskell.Lib.Lists as Lists+import qualified Hydra.Core.Overlay.Haskell.Lib.Literals as Literals+import qualified Hydra.Core.Overlay.Haskell.Lib.Logic as Logic+import qualified Hydra.Core.Overlay.Haskell.Lib.Maps as Maps+import qualified Hydra.Core.Overlay.Haskell.Lib.Math as Math+import qualified Hydra.Core.Overlay.Haskell.Lib.Optionals as Optionals+import qualified Hydra.Core.Overlay.Haskell.Lib.Ordering as Ordering+import qualified Hydra.Core.Overlay.Haskell.Lib.Pairs as Pairs+import qualified Hydra.Core.Overlay.Haskell.Lib.Sets as Sets+import qualified Hydra.Core.Overlay.Haskell.Lib.Strings as Strings+import qualified Hydra.Core.Markdown as Markdown+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Parsing as Parsing+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Print.Errors as PrintErrors+import qualified Hydra.Core.Print.Model as PrintModel+import qualified Hydra.Core.Query as Query+import qualified Hydra.Core.Regex as Regex+import qualified Hydra.Core.Relational as Relational+import qualified Hydra.Core.Resolution as Resolution+import qualified Hydra.Core.Rewriting as Rewriting+import qualified Hydra.Core.Scoping as Scoping+import qualified Hydra.Core.Strip as Strip+import qualified Hydra.Core.System as System+import qualified Hydra.Core.Tabular as Tabular+import qualified Hydra.Core.Testing as Testing+import qualified Hydra.Core.Time as Time+import qualified Hydra.Core.Topology as Topology+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Validation as Validation+import qualified Hydra.Core.Variables as Variables+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | Alpha convert a variable in a term+alphaConvert :: Model.Name -> Model.Name -> Model.Term -> Model.Term+alphaConvert vold vnew term = Variables.replaceFreeTermVariable vold (Model.TermVariable vnew) term++-- | Eagerly beta-reduce a type by substituting type arguments into type lambdas+betaReduceType :: t0 -> Graph.Graph -> Model.Type -> Either Errors.Error Model.Type+betaReduceType cx graph typ =++ let reduceApp =+ \app ->+ let lhs = Model.applicationTypeFunction app+ rhs = Model.applicationTypeArgument app+ in case lhs of+ Model.TypeAnnotated v0 -> Eithers.bind (reduceApp (Model.ApplicationType {+ Model.applicationTypeFunction = (Model.annotatedTypeBody v0),+ Model.applicationTypeArgument = rhs})) (\a -> Right (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = a,+ Model.annotatedTypeAnnotation = (Model.annotatedTypeAnnotation v0)})))+ Model.TypeForall v0 -> betaReduceType cx graph (Variables.replaceFreeTypeVariable (Model.forallTypeParameter v0) rhs (Model.forallTypeBody v0))+ Model.TypeVariable v0 -> Eithers.bind (Resolution.requireType cx graph v0) (\t_ -> betaReduceType cx graph (Model.TypeApplication (Model.ApplicationType {+ Model.applicationTypeFunction = t_,+ Model.applicationTypeArgument = rhs})))+ mapExpr =+ \recurse -> \t ->+ let findApp =+ \r -> case r of+ Model.TypeApplication v0 -> reduceApp v0+ _ -> Right r+ in (Eithers.bind (recurse t) (\r -> findApp r))+ in (Rewriting.rewriteTypeM mapExpr typ)++-- | Apply the special rules:+-- | ((\x.e1) e2) == e1, where x does not appear free in e1+-- | and+-- | ((\x.e1) e2) = e1[x/e2]+-- | These are both limited forms of beta reduction which help to "clean up" a term without fully evaluating it.+contractTerm :: Model.Term -> Model.Term+contractTerm term =++ let rewrite =+ \recurse -> \t ->+ let rec = recurse t+ in case rec of+ Model.TermApplication v0 ->+ let lhs = Model.applicationFunction v0+ rhs = Model.applicationArgument v0+ in case (Strip.deannotateTerm lhs) of+ Model.TermLambda v1 ->+ let v = Model.lambdaParameter v1+ body = Model.lambdaBody v1+ in (Logic.ifElse (Variables.isFreeVariableInTerm v body) body (Variables.replaceFreeTermVariable v rhs body))+ _ -> rec+ _ -> rec+ in (Rewriting.rewriteTerm rewrite term)++-- | Compile-time flag controlling whether primitive invocations are counted during evaluation. For demo and instrumentation purposes.+countPrimitiveInvocations :: Bool+countPrimitiveInvocations = True++-- | Recursively transform terms to eliminate partial application, e.g. 'add 42' becomes '\x.add 42 x'. Uses the Graph to look up types for arity calculation. Bare primitives and variables are NOT expanded; eliminations and partial applications are. This version properly tracks the Graph through nested scopes.+etaExpandTerm :: Graph.Graph -> Model.Term -> Model.Term+etaExpandTerm tx0 term0 =++ let primTypes =+ Maps.fromList (Lists.map (\_gpt_p -> (+ Packaging.primitiveDefinitionName (Graph.primitiveDefinition _gpt_p),+ (Scoping.termSignatureToTypeScheme (Packaging.primitiveDefinitionSignature (Graph.primitiveDefinition _gpt_p))))) (Maps.elems (Graph.graphPrimitives tx0)))+ termArityWithContext =+ \tx -> \term -> case term of+ Model.TermAnnotated v0 -> termArityWithContext tx (Model.annotatedTermBody v0)+ Model.TermApplication v0 -> Math.sub (termArityWithContext tx (Model.applicationFunction v0)) 1+ Model.TermCases _ -> 1+ Model.TermLambda _ -> 0+ Model.TermProject _ -> 1+ Model.TermUnwrap _ -> 1+ Model.TermLet v0 -> termArityWithContext (Scoping.extendGraphForLet (\_ -> \_2 -> Nothing) tx v0) (Model.letBody v0)+ Model.TermTypeLambda v0 -> termArityWithContext (Scoping.extendGraphForTypeLambda tx v0) (Model.typeLambdaBody v0)+ Model.TermTypeApplication v0 -> termArityWithContext tx (Model.typeApplicationTermBody v0)+ Model.TermVariable v0 -> Optionals.match (Optionals.map Scoping.typeSchemeToFType (Maps.lookup v0 (Graph.graphBoundTypes tx))) (Optionals.match (Maps.lookup v0 primTypes) 0 Arity.typeSchemeArity) Arity.typeArity+ _ -> 0+ domainTypes =+ \n -> \mt -> Logic.ifElse (Ordering.lte n 0) [] (Optionals.match mt (Lists.map (\_ -> Nothing) (Math.range 0 n)) (\typ -> case typ of+ Model.TypeFunction v0 -> Lists.cons (Just (Model.functionTypeDomain v0)) (domainTypes (Math.sub n 1) (Just (Model.functionTypeCodomain v0)))+ Model.TypeAnnotated v0 -> domainTypes n (Just (Model.annotatedTypeBody v0))+ Model.TypeApplication v0 -> domainTypes n (Just (Model.applicationTypeFunction v0))+ Model.TypeForall _ -> Lists.map (\_2 -> Nothing) (Math.range 0 n)+ _ -> Lists.map (\_ -> Nothing) (Math.range 0 n)))+ peelFunctionDomains =+ \mtyp -> \n -> Logic.ifElse (Ordering.lte n 0) mtyp (Optionals.match mtyp Nothing (\typ -> case typ of+ Model.TypeFunction v0 -> peelFunctionDomains (Just (Model.functionTypeCodomain v0)) (Math.sub n 1)+ Model.TypeAnnotated v0 -> peelFunctionDomains (Just (Model.annotatedTypeBody v0)) n+ Model.TypeApplication v0 -> peelFunctionDomains (Just (Model.applicationTypeFunction v0)) n+ Model.TypeForall _ -> Nothing+ _ -> Nothing))+ expand =+ \alwaysPad -> \args -> \arity -> \headTyp -> \head ->+ let applied =+ Lists.foldl (\lhs -> \arg -> Model.TermApplication (Model.Application {+ Model.applicationFunction = lhs,+ Model.applicationArgument = arg})) head args+ numArgs = Lists.length args+ needed = Math.sub arity numArgs+ in (Logic.ifElse (Logic.and (Ordering.gt needed 0) (Logic.or alwaysPad (Ordering.gt numArgs 0))) (+ let indices = Math.range 1 (Math.add needed 1)+ remainingType = peelFunctionDomains headTyp numArgs+ domains = domainTypes needed remainingType+ codomainType = peelFunctionDomains remainingType needed+ fullyAppliedRaw =+ Lists.foldl (\body -> \i ->+ let vn = Model.Name (Strings.concat2 "v" (Literals.printInt32 i))+ in (Model.TermApplication (Model.Application {+ Model.applicationFunction = body,+ Model.applicationArgument = (Model.TermVariable vn)}))) applied indices+ fullyApplied =+ Optionals.match codomainType fullyAppliedRaw (\ct -> Model.TermAnnotated (Model.AnnotatedTerm {+ Model.annotatedTermBody = fullyAppliedRaw,+ Model.annotatedTermAnnotation = (Annotations.wrapAnnotationMap (Maps.singleton (Model.Name "type") (EncodeModel.type_ ct)))}))+ indexedDomains = Lists.zip indices domains+ in (Lists.foldl (\body -> \idPair ->+ let i = Pairs.first idPair+ dom = Pairs.second idPair+ vn = Model.Name (Strings.concat2 "v" (Literals.printInt32 i))+ in (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = vn,+ Model.lambdaDomain = dom,+ Model.lambdaBody = body}))) fullyApplied (Lists.reverse indexedDomains))) applied)+ rewriteWithArgs =+ \args -> \tx -> \term ->+ let recurse = \tx1 -> \term1 -> rewriteWithArgs [] tx1 term1+ termHeadType =+ \tx2 -> \trm2 -> case trm2 of+ Model.TermAnnotated v0 -> termHeadType tx2 (Model.annotatedTermBody v0)+ Model.TermLambda _ -> Nothing+ Model.TermCases _ -> Nothing+ Model.TermProject _ -> Nothing+ Model.TermUnwrap _ -> Nothing+ Model.TermLet v0 -> termHeadType (Scoping.extendGraphForLet (\_ -> \_2 -> Nothing) tx2 v0) (Model.letBody v0)+ Model.TermTypeLambda v0 -> termHeadType (Scoping.extendGraphForTypeLambda tx2 v0) (Model.typeLambdaBody v0)+ Model.TermTypeApplication v0 -> Optionals.bind (termHeadType tx2 (Model.typeApplicationTermBody v0)) (\htyp2 -> case htyp2 of+ Model.TypeForall v1 -> Just (Variables.replaceFreeTypeVariable (Model.forallTypeParameter v1) (Model.typeApplicationTermType v0) (Model.forallTypeBody v1))+ _ -> Just htyp2)+ Model.TermVariable v0 -> Optionals.map Scoping.typeSchemeToFType (Maps.lookup v0 (Graph.graphBoundTypes tx2))+ _ -> Nothing+ afterRecursion =+ \trm ->+ let arity = termArityWithContext tx trm+ hType = termHeadType tx trm+ in (expand False args arity hType trm)+ forField =+ \f -> Model.Field {+ Model.fieldName = (Model.fieldName f),+ Model.fieldTerm = (recurse tx (Model.fieldTerm f))}+ forCaseBranch =+ \f ->+ let branchBody = recurse tx (Model.caseAlternativeHandler f)+ arty = termArityWithContext tx branchBody+ branchHType = termHeadType tx branchBody+ in Model.CaseAlternative {+ Model.caseAlternativeName = (Model.caseAlternativeName f),+ Model.caseAlternativeHandler = (expand True [] arty branchHType branchBody)}+ forMap =+ \mp ->+ let forPair = \pr -> (recurse tx (Pairs.first pr), (recurse tx (Pairs.second pr)))+ in (Maps.fromList (Lists.map forPair (Maps.toList mp)))+ in case term of+ Model.TermAnnotated v0 -> afterRecursion (Model.TermAnnotated (Model.AnnotatedTerm {+ Model.annotatedTermBody = (recurse tx (Model.annotatedTermBody v0)),+ Model.annotatedTermAnnotation = (Model.annotatedTermAnnotation v0)}))+ Model.TermApplication v0 ->+ let rhs = rewriteWithArgs [] tx (Model.applicationArgument v0)+ in (rewriteWithArgs (Lists.cons rhs args) tx (Model.applicationFunction v0))+ Model.TermEither v0 -> afterRecursion (Model.TermEither (Eithers.either (\l -> Left (recurse tx l)) (\r -> Right (recurse tx r)) v0))+ Model.TermCases v0 ->+ let newCs =+ Model.CaseStatement {+ Model.caseStatementTypeName = (Model.caseStatementTypeName v0),+ Model.caseStatementDefault = (Optionals.map (\t1 -> recurse tx t1) (Model.caseStatementDefault v0)),+ Model.caseStatementCases = (Lists.map forCaseBranch (Model.caseStatementCases v0))}+ elimTerm = Model.TermCases newCs+ elimHeadType =+ Just (Model.TypeFunction (Model.FunctionType {+ Model.functionTypeDomain = (Model.TypeVariable (Model.caseStatementTypeName v0)),+ Model.functionTypeCodomain = Model.TypeUnit}))+ in (expand True args 1 elimHeadType elimTerm)+ Model.TermProject v0 -> expand False args 1 Nothing (Model.TermProject v0)+ Model.TermUnwrap v0 -> expand False args 1 Nothing (Model.TermUnwrap v0)+ Model.TermLambda v0 ->+ let tx1 = Scoping.extendGraphForLambda tx v0+ body = rewriteWithArgs [] tx1 (Model.lambdaBody v0)+ result =+ Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.lambdaParameter v0),+ Model.lambdaDomain = (Model.lambdaDomain v0),+ Model.lambdaBody = body})+ arty = termArityWithContext tx result+ in (expand False args arty Nothing result)+ Model.TermLet v0 ->+ let tx1 = Scoping.extendGraphForLet (\_ -> \_2 -> Nothing) tx v0+ mapBinding =+ \b -> Model.Binding {+ Model.bindingName = (Model.bindingName b),+ Model.bindingTerm = (rewriteWithArgs [] tx1 (Model.bindingTerm b)),+ Model.bindingTypeScheme = (Model.bindingTypeScheme b)}+ result =+ Model.TermLet (Model.Let {+ Model.letBindings = (Lists.map mapBinding (Model.letBindings v0)),+ Model.letBody = (rewriteWithArgs [] tx1 (Model.letBody v0))})+ in (afterRecursion result)+ Model.TermList v0 -> afterRecursion (Model.TermList (Lists.map (\el -> recurse tx el) v0))+ Model.TermLiteral v0 -> Model.TermLiteral v0+ Model.TermMap v0 -> afterRecursion (Model.TermMap (forMap v0))+ Model.TermOptional v0 -> afterRecursion (Model.TermOptional (Optionals.map (\v -> recurse tx v) v0))+ Model.TermPair v0 -> afterRecursion (Model.TermPair (recurse tx (Pairs.first v0), (recurse tx (Pairs.second v0))))+ Model.TermRecord v0 -> afterRecursion (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.recordTypeName v0),+ Model.recordFields = (Lists.map forField (Model.recordFields v0))}))+ Model.TermSet v0 -> afterRecursion (Model.TermSet (Sets.fromList (Lists.map (\el -> recurse tx el) (Sets.toList v0))))+ Model.TermTypeApplication v0 ->+ let gatherTypeApps =+ \acc -> \trm -> case (Strip.deannotateTerm trm) of+ Model.TermTypeApplication v1 -> gatherTypeApps (Lists.cons (Model.typeApplicationTermType v1) acc) (Model.typeApplicationTermBody v1)+ _ -> (trm, acc)+ gathered = gatherTypeApps [+ Model.typeApplicationTermType v0] (Model.typeApplicationTermBody v0)+ innermost = Pairs.first gathered+ tApps = Pairs.second gathered+ in case (Strip.deannotateTerm innermost) of+ Model.TermCases v1 ->+ let newCs =+ Model.CaseStatement {+ Model.caseStatementTypeName = (Model.caseStatementTypeName v1),+ Model.caseStatementDefault = (Optionals.map (\t1 -> recurse tx t1) (Model.caseStatementDefault v1)),+ Model.caseStatementCases = (Lists.map forCaseBranch (Model.caseStatementCases v1))}+ casesWithTypeApps =+ Lists.foldl (\trm -> \t -> Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = trm,+ Model.typeApplicationTermType = t})) (Model.TermCases newCs) tApps+ elimHeadTypeTyped =+ Just (Model.TypeFunction (Model.FunctionType {+ Model.functionTypeDomain = (Resolution.nominalApplication (Model.caseStatementTypeName v1) tApps),+ Model.functionTypeCodomain = Model.TypeUnit}))+ in (expand True args 1 elimHeadTypeTyped casesWithTypeApps)+ _ -> afterRecursion (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (recurse tx (Model.typeApplicationTermBody v0)),+ Model.typeApplicationTermType = (Model.typeApplicationTermType v0)}))+ Model.TermTypeLambda v0 ->+ let tx1 = Scoping.extendGraphForTypeLambda tx v0+ result =+ Model.TermTypeLambda (Model.TypeLambda {+ Model.typeLambdaParameter = (Model.typeLambdaParameter v0),+ Model.typeLambdaBody = (rewriteWithArgs [] tx1 (Model.typeLambdaBody v0))})+ in (afterRecursion result)+ Model.TermInject v0 -> afterRecursion (Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.injectionTypeName v0),+ Model.injectionField = (forField (Model.injectionField v0))}))+ Model.TermUnit -> Model.TermUnit+ Model.TermVariable v0 ->+ let arty = termArityWithContext tx term+ varType = Optionals.map Scoping.typeSchemeToFType (Maps.lookup v0 (Graph.graphBoundTypes tx))+ in (expand False args arty varType term)+ Model.TermWrap v0 -> afterRecursion (Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.wrappedTermTypeName v0),+ Model.wrappedTermBody = (recurse tx (Model.wrappedTermBody v0))}))+ in (contractTerm (rewriteWithArgs [] tx0 term0))++-- | Recursively transform arbitrary terms like 'add 42' into terms like '\x.add 42 x', eliminating partial application. Variable references are not expanded. This is useful for targets like Python with weaker support for currying than Hydra or Haskell. Note: this is a "trusty" function which assumes the graph is well-formed, i.e. no dangling references. It also assumes that type inference has already been performed. After eta expansion, type inference needs to be performed again, as new, untyped lambdas may have been added.+etaExpandTypedTerm :: Typing.InferenceContext -> Graph.Graph -> Model.Term -> Either Errors.Error Model.Term+etaExpandTypedTerm cx tx0 term0 =++ let rewrite =+ \topLevel -> \forced -> \typeArgs -> \recurse -> \tx -> \term ->+ let rewriteSpine =+ \term2 -> case term2 of+ Model.TermAnnotated v0 -> Eithers.bind (rewriteSpine (Model.annotatedTermBody v0)) (\body ->+ let ann = Model.annotatedTermAnnotation v0+ in (Right (Model.TermAnnotated (Model.AnnotatedTerm {+ Model.annotatedTermBody = body,+ Model.annotatedTermAnnotation = ann}))))+ Model.TermApplication v0 ->+ let l = Logic.ifElse False [+ Model.TypeLiteral Model.LiteralTypeString] []+ in (Eithers.bind (rewriteSpine (Model.applicationFunction v0)) (\lhs -> Eithers.bind (rewrite True False l recurse tx (Model.applicationArgument v0)) (\rhs -> Right (Model.TermApplication (Model.Application {+ Model.applicationFunction = lhs,+ Model.applicationArgument = rhs})))))+ Model.TermTypeApplication v0 -> Eithers.bind (rewriteSpine (Model.typeApplicationTermBody v0)) (\body ->+ let typ = Model.typeApplicationTermType v0+ in (Right (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = body,+ Model.typeApplicationTermType = typ}))))+ _ -> rewrite False False [] recurse tx term2+ arityOf =+ \tx2 -> \term2 ->+ let dflt = Eithers.map (\_tc -> Arity.typeArity (Pairs.first _tc)) (Checking.typeOf cx tx2 [] term2)+ in case term2 of+ Model.TermAnnotated v0 -> arityOf tx2 (Model.annotatedTermBody v0)+ Model.TermCases _ -> Right 1+ Model.TermProject _ -> Right 1+ Model.TermUnwrap _ -> Right 1+ Model.TermLambda v0 ->+ let txl = Scoping.extendGraphForLambda tx2 v0+ in (arityOf txl (Model.lambdaBody v0))+ Model.TermLet v0 ->+ let txl = Scoping.extendGraphForLet (\_ -> \_2 -> Nothing) tx2 v0+ in (arityOf txl (Model.letBody v0))+ Model.TermTypeApplication v0 -> arityOf tx2 (Model.typeApplicationTermBody v0)+ Model.TermTypeLambda v0 ->+ let txt = Scoping.extendGraphForTypeLambda tx2 v0+ in (arityOf txt (Model.typeLambdaBody v0))+ Model.TermVariable v0 -> Optionals.match (Optionals.map Scoping.typeSchemeToFType (Maps.lookup v0 (Graph.graphBoundTypes tx2))) (Eithers.map (\_tc -> Arity.typeArity (Pairs.first _tc)) (Checking.typeOf cx tx2 [] (Model.TermVariable v0))) (\t -> Right (Arity.typeArity t))+ _ -> dflt+ extraVariables =+ \n -> Lists.map (\i -> Model.Name (Strings.concat2 "v" (Literals.printInt32 i))) (Math.range 1 (Math.add n 1))+ pad =+ \vars -> \body -> Optionals.match (Lists.uncons vars) body (\uc ->+ let v0 = Pairs.first uc+ vrest = Pairs.second uc+ in (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = v0,+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (pad vrest (Model.TermApplication (Model.Application {+ Model.applicationFunction = body,+ Model.applicationArgument = (Model.TermVariable v0)})))})))+ padn = \n -> \body -> pad (extraVariables n) body+ unwind =+ \term2 -> Lists.foldl (\e -> \t -> Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = e,+ Model.typeApplicationTermType = t})) term2 typeArgs+ forceExpansion =+ \t -> Eithers.bind (Checking.typeOf cx tx [] t) (\typCx ->+ let arity = Arity.typeArity (Pairs.first typCx)+ in (Right (padn arity (unwind t))))+ recurseOrForce = \term2 -> Logic.ifElse forced (forceExpansion term2) (recurse tx (unwind term2))+ forCase =+ \f -> Eithers.bind (rewrite False True [] recurse tx (Model.caseAlternativeHandler f)) (\r -> Right (Model.CaseAlternative {+ Model.caseAlternativeName = (Model.caseAlternativeName f),+ Model.caseAlternativeHandler = r}))+ forCaseStatement =+ \cs ->+ let tname = Model.caseStatementTypeName cs+ dflt = Model.caseStatementDefault cs+ csCases = Model.caseStatementCases cs+ in (Eithers.bind (Eithers.mapOptional (rewrite False False [] recurse tx) dflt) (\rdflt -> Eithers.bind (Eithers.mapList forCase csCases) (\rcases -> Right (Model.TermCases (Model.CaseStatement {+ Model.caseStatementTypeName = tname,+ Model.caseStatementDefault = rdflt,+ Model.caseStatementCases = rcases})))))+ forCases =+ \cs -> Eithers.bind (Eithers.map unwind (forCaseStatement cs)) (\base -> Right (Logic.ifElse (Logic.or topLevel forced) (padn 1 base) base))+ forNullaryElim =+ \elimTerm ->+ let base = unwind elimTerm+ in (Logic.ifElse (Logic.or topLevel forced) (padn 1 base) base)+ in case term of+ Model.TermApplication v0 ->+ let lhs = Model.applicationFunction v0+ rhs = Model.applicationArgument v0+ in (Eithers.bind (rewrite True False [] recurse tx rhs) (\rhs2 -> Eithers.bind (arityOf tx lhs) (\lhsarity -> Eithers.bind (rewriteSpine lhs) (\lhs2 ->+ let a2 =+ Model.TermApplication (Model.Application {+ Model.applicationFunction = lhs2,+ Model.applicationArgument = rhs2})+ in (Right (Logic.ifElse (Ordering.gt lhsarity 1) (padn (Math.sub lhsarity 1) a2) a2))))))+ Model.TermCases v0 -> forCases v0+ Model.TermProject v0 -> Right (forNullaryElim (Model.TermProject v0))+ Model.TermUnwrap v0 -> Right (forNullaryElim (Model.TermUnwrap v0))+ Model.TermLambda v0 ->+ let txl = Scoping.extendGraphForLambda tx v0+ in (Eithers.map unwind (recurse txl term))+ Model.TermLet v0 ->+ let txlt = Scoping.extendGraphForLet (\_ -> \_2 -> Nothing) tx v0+ in (recurse txlt term)+ Model.TermTypeApplication v0 -> rewrite topLevel forced (Lists.cons (Model.typeApplicationTermType v0) typeArgs) recurse tx (Model.typeApplicationTermBody v0)+ Model.TermTypeLambda v0 ->+ let txt = Scoping.extendGraphForTypeLambda tx v0+ in (recurse txt term)+ _ -> recurseOrForce term+ in (Rewriting.rewriteTermWithContextM (rewrite True False []) tx0 term0)++-- | Calculate the arity for eta expansion Note: this is a "trusty" function which assumes the graph is well-formed, i.e. no dangling references.+etaExpansionArity :: Graph.Graph -> Model.Term -> Int+etaExpansionArity graph term =+ case term of+ Model.TermAnnotated v0 -> etaExpansionArity graph (Model.annotatedTermBody v0)+ Model.TermApplication v0 -> Math.sub (etaExpansionArity graph (Model.applicationFunction v0)) 1+ Model.TermCases _ -> 1+ Model.TermLambda _ -> 0+ Model.TermProject _ -> 1+ Model.TermUnwrap _ -> 1+ Model.TermTypeLambda v0 -> etaExpansionArity graph (Model.typeLambdaBody v0)+ Model.TermTypeApplication v0 -> etaExpansionArity graph (Model.typeApplicationTermBody v0)+ Model.TermVariable v0 -> Optionals.match (Optionals.bind (Lexical.lookupBinding graph v0) (\b -> Model.bindingTypeScheme b)) 0 (\ts -> Arity.typeArity (Model.typeSchemeBody ts))+ _ -> 0++-- | Eta-reduce a term by removing redundant lambda abstractions+etaReduceTerm :: Model.Term -> Model.Term+etaReduceTerm term =++ let noChange = term+ reduceLambda =+ \l ->+ let v = Model.lambdaParameter l+ d = Model.lambdaDomain l+ body = Model.lambdaBody l+ in case (etaReduceTerm body) of+ Model.TermAnnotated v0 -> reduceLambda (Model.Lambda {+ Model.lambdaParameter = v,+ Model.lambdaDomain = d,+ Model.lambdaBody = (Model.annotatedTermBody v0)})+ Model.TermApplication v0 ->+ let lhs = Model.applicationFunction v0+ rhs = Model.applicationArgument v0+ in case (etaReduceTerm rhs) of+ Model.TermAnnotated v1 -> reduceLambda (Model.Lambda {+ Model.lambdaParameter = v,+ Model.lambdaDomain = d,+ Model.lambdaBody = (Model.TermApplication (Model.Application {+ Model.applicationFunction = lhs,+ Model.applicationArgument = (Model.annotatedTermBody v1)}))})+ Model.TermVariable v1 -> Logic.ifElse (Logic.and (Equality.equal (Model.unName v) (Model.unName v1)) (Logic.not (Variables.isFreeVariableInTerm v lhs))) (etaReduceTerm lhs) noChange+ _ -> noChange+ _ -> noChange+ in case term of+ Model.TermAnnotated v0 -> Model.TermAnnotated (Model.AnnotatedTerm {+ Model.annotatedTermBody = (etaReduceTerm (Model.annotatedTermBody v0)),+ Model.annotatedTermAnnotation = (Model.annotatedTermAnnotation v0)})+ Model.TermLambda v0 -> reduceLambda v0+ _ -> noChange++-- | A term evaluation function which is alternatively lazy or eager+reduceTerm :: t0 -> Graph.Graph -> Bool -> Model.Term -> Either Errors.Error Model.Term+reduceTerm cx graph eager term =++ let reduce = \eager2 -> reduceTerm cx graph eager2+ doRecurse =+ \eager2 -> \term2 ->+ let isNonLambdaTerm =+ case term2 of+ Model.TermLambda _ -> False+ Model.TermLet _ -> False+ _ -> True+ in (Logic.and eager2 isNonLambdaTerm)+ reduceArg = \eager2 -> \arg -> Logic.ifElse eager2 (Right arg) (reduce False arg)+ applyToArguments =+ \fun -> \args -> Optionals.match (Lists.uncons args) fun (\uc -> applyToArguments (Model.TermApplication (Model.Application {+ Model.applicationFunction = fun,+ Model.applicationArgument = (Pairs.first uc)})) (Pairs.second uc))+ mapErrorToString = \e -> Errors.ErrorOther (Errors.OtherError (PrintErrors.error e))+ applyProjection =+ \proj -> \reducedArg -> Eithers.bind (ExtractModel.record (Model.projectionTypeName proj) graph (Strip.deannotateTerm reducedArg)) (\fields ->+ let matching = Lists.find (\f -> Equality.equal (Model.fieldName f) (Model.projectionFieldName proj)) fields+ in (Optionals.match matching (Left (Errors.ErrorResolution (Errors.ResolutionErrorNoMatchingField (Errors.NoMatchingFieldError {+ Errors.noMatchingFieldErrorFieldName = (Model.projectionFieldName proj)})))) (\mf -> Right (Model.fieldTerm mf))))+ applyCases =+ \cs -> \reducedArg -> Eithers.bind (ExtractModel.injection (Model.caseStatementTypeName cs) graph reducedArg) (\field ->+ let matching =+ Lists.find (\f -> Equality.equal (Model.caseAlternativeName f) (Model.fieldName field)) (Model.caseStatementCases cs)+ in (Optionals.match matching (Optionals.match (Model.caseStatementDefault cs) (Left (Errors.ErrorResolution (Errors.ResolutionErrorNoMatchingField (Errors.NoMatchingFieldError {+ Errors.noMatchingFieldErrorFieldName = (Model.fieldName field)})))) (\x -> Right x)) (\mf -> Right (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.caseAlternativeHandler mf),+ Model.applicationArgument = (Model.fieldTerm field)})))))+ applyIfNullary =+ \eager2 -> \original -> \args ->+ let stripped = Strip.deannotateTerm original+ forProjection =+ \proj -> \args2 -> Optionals.match (Lists.uncons args2) (Right original) (\uc ->+ let arg = Pairs.first uc+ remainingArgs = Pairs.second uc+ in (Eithers.bind (reduceArg eager2 (Strip.deannotateTerm arg)) (\reducedArg -> Eithers.bind (Eithers.bind (applyProjection proj reducedArg) (reduce eager2)) (\reducedResult -> applyIfNullary eager2 reducedResult remainingArgs))))+ forCases =+ \cs -> \args2 -> Optionals.match (Lists.uncons args2) (Right original) (\uc ->+ let arg = Pairs.first uc+ remainingArgs = Pairs.second uc+ in (Eithers.bind (reduceArg eager2 (Strip.deannotateTerm arg)) (\reducedArg -> Eithers.bind (Eithers.bind (applyCases cs reducedArg) (reduce eager2)) (\reducedResult -> applyIfNullary eager2 reducedResult remainingArgs))))+ forUnwrap =+ \name -> \args2 -> Optionals.match (Lists.uncons args2) (Right original) (\uc ->+ let arg = Pairs.first uc+ remainingArgs = Pairs.second uc+ in (Eithers.bind (reduceArg eager2 (Strip.deannotateTerm arg)) (\reducedArg -> Eithers.bind (Eithers.bind (ExtractModel.wrap name graph reducedArg) (reduce eager2)) (\reducedResult -> applyIfNullary eager2 reducedResult remainingArgs))))+ forLambda =+ \l -> \args2 ->+ let param = Model.lambdaParameter l+ body = Model.lambdaBody l+ in (Optionals.match (Lists.uncons args2) (Right original) (\uc ->+ let arg = Pairs.first uc+ remainingArgs = Pairs.second uc+ in (Eithers.bind (reduce eager2 (Strip.deannotateTerm arg)) (\reducedArg -> Eithers.bind (reduce eager2 (Variables.replaceFreeTermVariable param reducedArg body)) (\reducedResult -> applyIfNullary eager2 reducedResult remainingArgs)))))+ forPrimitive =+ \prim -> \arity -> \args2 ->+ let argList = Lists.take arity args2+ remainingArgs = Lists.drop arity args2+ in (Eithers.bind (Eithers.mapList (reduceArg eager2) argList) (\reducedArgs ->+ let strippedArgs = Lists.map Strip.deannotateTerm reducedArgs+ in (Eithers.bind (Eithers.bimap mapErrorToString (\x -> x) (Graph.primitiveImplementation prim graph strippedArgs)) (\primResult -> Eithers.bind (reduce eager2 primResult) (\reducedResult -> applyIfNullary eager2 reducedResult remainingArgs)))))+ in case stripped of+ Model.TermApplication v0 -> applyIfNullary eager2 (Model.applicationFunction v0) (Lists.cons (Model.applicationArgument v0) args)+ Model.TermCases v0 -> Logic.ifElse (Lists.isEmpty args) (Right original) (forCases v0 args)+ Model.TermProject v0 -> Logic.ifElse (Lists.isEmpty args) (Right original) (forProjection v0 args)+ Model.TermUnwrap v0 -> Logic.ifElse (Lists.isEmpty args) (Right original) (forUnwrap v0 args)+ Model.TermLambda v0 -> Logic.ifElse (Lists.isEmpty args) (Right original) (forLambda v0 args)+ Model.TermVariable v0 ->+ let mBinding = Lexical.lookupBinding graph v0+ in (Optionals.match mBinding (+ let mPrim = Lexical.lookupPrimitive graph v0+ in (Optionals.match mPrim (Right (applyToArguments original args)) (\prim ->+ let arity = Arity.primitiveArity prim+ in (Logic.ifElse (Ordering.gt arity (Lists.length args)) (Right (applyToArguments original args)) (forPrimitive prim arity args))))) (\binding -> applyIfNullary eager2 (Model.bindingTerm binding) args))+ Model.TermLet v0 ->+ let bindings = Model.letBindings v0+ body = Model.letBody v0+ letExpr =+ \b -> Model.TermLet (Model.Let {+ Model.letBindings = [+ b],+ Model.letBody = (Model.TermVariable (Model.bindingName b))})+ expandBinding =+ \b -> Model.Binding {+ Model.bindingName = (Model.bindingName b),+ Model.bindingTerm = (Variables.replaceFreeTermVariable (Model.bindingName b) (letExpr b) (Model.bindingTerm b)),+ Model.bindingTypeScheme = (Model.bindingTypeScheme b)}+ expandedBindings = Lists.map expandBinding bindings+ substituteBinding = \term2 -> \b -> Variables.replaceFreeTermVariable (Model.bindingName b) (Model.bindingTerm b) term2+ substituteAll = \bs -> \term2 -> Lists.foldl substituteBinding term2 bs+ expandedBody = substituteAll expandedBindings body+ in (Eithers.bind (reduce eager2 expandedBody) (\reducedBody -> applyIfNullary eager2 reducedBody args))+ _ -> Right (applyToArguments original args)+ mapping =+ \recurse -> \mid -> Eithers.bind (Logic.ifElse (doRecurse eager mid) (recurse mid) (Right mid)) (\inner -> applyIfNullary eager inner [])+ in (Rewriting.rewriteTermM mapping term)++-- | Whether a term is closed, i.e. represents a complete program+termIsClosed :: Model.Term -> Bool+termIsClosed term = Sets.isEmpty (Variables.freeVariablesInTerm term)++-- | Whether a term has been fully reduced to a value+termIsValue :: Model.Term -> Bool+termIsValue term =++ let forList = \els -> Lists.foldl (\b -> \t -> Logic.and b (termIsValue t)) True els+ checkField = \f -> termIsValue (Model.fieldTerm f)+ checkFields = \fields -> Lists.foldl (\b -> \f -> Logic.and b (checkField f)) True fields+ checkCaseAlternatives =+ \alts -> Lists.foldl (\b -> \a -> Logic.and b (termIsValue (Model.caseAlternativeHandler a))) True alts+ in case (Strip.deannotateTerm term) of+ Model.TermApplication _ -> False+ Model.TermCases v0 -> Logic.and (checkCaseAlternatives (Model.caseStatementCases v0)) (Optionals.match (Model.caseStatementDefault v0) True termIsValue)+ Model.TermEither v0 -> Eithers.either (\l -> termIsValue l) (\r -> termIsValue r) v0+ Model.TermLambda v0 -> termIsValue (Model.lambdaBody v0)+ Model.TermLiteral _ -> True+ Model.TermProject _ -> True+ Model.TermUnwrap _ -> True+ Model.TermList v0 -> forList v0+ Model.TermMap v0 -> Lists.foldl (\b -> \kv -> Logic.and b (Logic.and (termIsValue (Pairs.first kv)) (termIsValue (Pairs.second kv)))) True (Maps.toList v0)+ Model.TermOptional v0 -> Optionals.match v0 True termIsValue+ Model.TermRecord v0 -> checkFields (Model.recordFields v0)+ Model.TermSet v0 -> forList (Sets.toList v0)+ Model.TermInject v0 -> checkField (Model.injectionField v0)+ Model.TermUnit -> True+ Model.TermVariable _ -> False+ _ -> False
@@ -0,0 +1,266 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Reflection functions for working with term, type, and literal type variants, as well as numeric precision.++module Hydra.Core.Reflect where++import qualified Hydra.Core.Ast as Ast+import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Diff as Diff+import qualified Hydra.Core.Docs as Docs+import qualified Hydra.Core.Error.Checking as Checking+import qualified Hydra.Core.Error.File as ErrorFile+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Error.Packaging as ErrorPackaging+import qualified Hydra.Core.Error.System as ErrorSystem+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Json.Model as JsonModel+import qualified Hydra.Core.Overlay.Haskell.Lib.Lists as Lists+import qualified Hydra.Core.Markdown as Markdown+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Parsing as Parsing+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Query as Query+import qualified Hydra.Core.Regex as Regex+import qualified Hydra.Core.Relational as Relational+import qualified Hydra.Core.System as System+import qualified Hydra.Core.Tabular as Tabular+import qualified Hydra.Core.Testing as Testing+import qualified Hydra.Core.Time as Time+import qualified Hydra.Core.Topology as Topology+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Validation as Validation+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | Find the precision of a given floating-point type+floatTypePrecision :: Model.FloatType -> Util.Precision+floatTypePrecision x =+ case x of+ Model.FloatTypeFloat32 -> Util.PrecisionBits 32+ Model.FloatTypeFloat64 -> Util.PrecisionBits 64++-- | All floating-point types in a canonical order+floatTypes :: [Model.FloatType]+floatTypes =+ [+ Model.FloatTypeFloat32,+ Model.FloatTypeFloat64]++-- | Find the float type for a given floating-point value+floatValueType :: Model.FloatValue -> Model.FloatType+floatValueType x =+ case x of+ Model.FloatValueFloat32 _ -> Model.FloatTypeFloat32+ Model.FloatValueFloat64 _ -> Model.FloatTypeFloat64++-- | Find whether a given integer type is signed (true) or unsigned (false)+integerTypeIsSigned :: Model.IntegerType -> Bool+integerTypeIsSigned x =+ case x of+ Model.IntegerTypeBigint -> True+ Model.IntegerTypeInt8 -> True+ Model.IntegerTypeInt16 -> True+ Model.IntegerTypeInt32 -> True+ Model.IntegerTypeInt64 -> True+ Model.IntegerTypeUint8 -> False+ Model.IntegerTypeUint16 -> False+ Model.IntegerTypeUint32 -> False+ Model.IntegerTypeUint64 -> False++-- | Find the precision of a given integer type+integerTypePrecision :: Model.IntegerType -> Util.Precision+integerTypePrecision x =+ case x of+ Model.IntegerTypeBigint -> Util.PrecisionArbitrary+ Model.IntegerTypeInt8 -> Util.PrecisionBits 8+ Model.IntegerTypeInt16 -> Util.PrecisionBits 16+ Model.IntegerTypeInt32 -> Util.PrecisionBits 32+ Model.IntegerTypeInt64 -> Util.PrecisionBits 64+ Model.IntegerTypeUint8 -> Util.PrecisionBits 8+ Model.IntegerTypeUint16 -> Util.PrecisionBits 16+ Model.IntegerTypeUint32 -> Util.PrecisionBits 32+ Model.IntegerTypeUint64 -> Util.PrecisionBits 64++-- | All integer types, in a canonical order+integerTypes :: [Model.IntegerType]+integerTypes =+ [+ Model.IntegerTypeBigint,+ Model.IntegerTypeInt8,+ Model.IntegerTypeInt16,+ Model.IntegerTypeInt32,+ Model.IntegerTypeInt64,+ Model.IntegerTypeUint8,+ Model.IntegerTypeUint16,+ Model.IntegerTypeUint32,+ Model.IntegerTypeUint64]++-- | Find the integer type for a given integer value+integerValueType :: Model.IntegerValue -> Model.IntegerType+integerValueType x =+ case x of+ Model.IntegerValueBigint _ -> Model.IntegerTypeBigint+ Model.IntegerValueInt8 _ -> Model.IntegerTypeInt8+ Model.IntegerValueInt16 _ -> Model.IntegerTypeInt16+ Model.IntegerValueInt32 _ -> Model.IntegerTypeInt32+ Model.IntegerValueInt64 _ -> Model.IntegerTypeInt64+ Model.IntegerValueUint8 _ -> Model.IntegerTypeUint8+ Model.IntegerValueUint16 _ -> Model.IntegerTypeUint16+ Model.IntegerValueUint32 _ -> Model.IntegerTypeUint32+ Model.IntegerValueUint64 _ -> Model.IntegerTypeUint64++-- | Find the literal type for a given literal value+literalType :: Model.Literal -> Model.LiteralType+literalType x =+ case x of+ Model.LiteralBinary _ -> Model.LiteralTypeBinary+ Model.LiteralBoolean _ -> Model.LiteralTypeBoolean+ Model.LiteralDecimal _ -> Model.LiteralTypeDecimal+ Model.LiteralFloat v0 -> (\injected_ -> Model.LiteralTypeFloat injected_) (floatValueType v0)+ Model.LiteralInteger v0 -> (\injected_ -> Model.LiteralTypeInteger injected_) (integerValueType v0)+ Model.LiteralString _ -> Model.LiteralTypeString++-- | Find the literal type inject (constructor) for a given literal value+literalTypeVariant :: Model.LiteralType -> Variants.LiteralVariant+literalTypeVariant x =+ case x of+ Model.LiteralTypeBinary -> Variants.LiteralVariantBinary+ Model.LiteralTypeBoolean -> Variants.LiteralVariantBoolean+ Model.LiteralTypeDecimal -> Variants.LiteralVariantDecimal+ Model.LiteralTypeFloat _ -> Variants.LiteralVariantFloat+ Model.LiteralTypeInteger _ -> Variants.LiteralVariantInteger+ Model.LiteralTypeString -> Variants.LiteralVariantString++-- | All literal types, in a canonical order+literalTypes :: [Model.LiteralType]+literalTypes =+ Lists.concat [+ [+ Model.LiteralTypeBinary,+ Model.LiteralTypeBoolean,+ Model.LiteralTypeDecimal],+ (Lists.map (\x -> Model.LiteralTypeFloat x) floatTypes),+ (Lists.map (\x -> Model.LiteralTypeInteger x) integerTypes),+ [+ Model.LiteralTypeString]]++-- | Find the literal inject (constructor) for a given literal value+literalVariant :: Model.Literal -> Variants.LiteralVariant+literalVariant arg_ = literalTypeVariant (literalType arg_)++-- | All literal variants, in a canonical order+literalVariants :: [Variants.LiteralVariant]+literalVariants =+ [+ Variants.LiteralVariantBinary,+ Variants.LiteralVariantBoolean,+ Variants.LiteralVariantDecimal,+ Variants.LiteralVariantFloat,+ Variants.LiteralVariantInteger,+ Variants.LiteralVariantString]++-- | Find the term inject (constructor) for a given term+termVariant :: Model.Term -> Variants.TermVariant+termVariant x =+ case x of+ Model.TermAnnotated _ -> Variants.TermVariantAnnotated+ Model.TermApplication _ -> Variants.TermVariantApplication+ Model.TermCases _ -> Variants.TermVariantCases+ Model.TermEither _ -> Variants.TermVariantEither+ Model.TermLambda _ -> Variants.TermVariantLambda+ Model.TermLet _ -> Variants.TermVariantLet+ Model.TermList _ -> Variants.TermVariantList+ Model.TermLiteral _ -> Variants.TermVariantLiteral+ Model.TermMap _ -> Variants.TermVariantMap+ Model.TermOptional _ -> Variants.TermVariantOptional+ Model.TermPair _ -> Variants.TermVariantPair+ Model.TermProject _ -> Variants.TermVariantProject+ Model.TermRecord _ -> Variants.TermVariantRecord+ Model.TermSet _ -> Variants.TermVariantSet+ Model.TermTypeApplication _ -> Variants.TermVariantTypeApplication+ Model.TermTypeLambda _ -> Variants.TermVariantTypeLambda+ Model.TermInject _ -> Variants.TermVariantInject+ Model.TermUnit -> Variants.TermVariantUnit+ Model.TermUnwrap _ -> Variants.TermVariantUnwrap+ Model.TermVariable _ -> Variants.TermVariantVariable+ Model.TermWrap _ -> Variants.TermVariantWrap++-- | All term (expression) variants, in a canonical order+termVariants :: [Variants.TermVariant]+termVariants =+ [+ Variants.TermVariantAnnotated,+ Variants.TermVariantApplication,+ Variants.TermVariantCases,+ Variants.TermVariantEither,+ Variants.TermVariantLambda,+ Variants.TermVariantLet,+ Variants.TermVariantList,+ Variants.TermVariantLiteral,+ Variants.TermVariantMap,+ Variants.TermVariantOptional,+ Variants.TermVariantPair,+ Variants.TermVariantProject,+ Variants.TermVariantRecord,+ Variants.TermVariantSet,+ Variants.TermVariantTypeLambda,+ Variants.TermVariantTypeApplication,+ Variants.TermVariantInject,+ Variants.TermVariantUnit,+ Variants.TermVariantUnwrap,+ Variants.TermVariantVariable,+ Variants.TermVariantWrap]++-- | Find the type inject (constructor) for a given type+typeVariant :: Model.Type -> Variants.TypeVariant+typeVariant x =+ case x of+ Model.TypeAnnotated _ -> Variants.TypeVariantAnnotated+ Model.TypeApplication _ -> Variants.TypeVariantApplication+ Model.TypeEffect _ -> Variants.TypeVariantEffect+ Model.TypeEither _ -> Variants.TypeVariantEither+ Model.TypeForall _ -> Variants.TypeVariantForall+ Model.TypeFunction _ -> Variants.TypeVariantFunction+ Model.TypeList _ -> Variants.TypeVariantList+ Model.TypeLiteral _ -> Variants.TypeVariantLiteral+ Model.TypeMap _ -> Variants.TypeVariantMap+ Model.TypeOptional _ -> Variants.TypeVariantOptional+ Model.TypePair _ -> Variants.TypeVariantPair+ Model.TypeRecord _ -> Variants.TypeVariantRecord+ Model.TypeSet _ -> Variants.TypeVariantSet+ Model.TypeUnion _ -> Variants.TypeVariantUnion+ Model.TypeUnit -> Variants.TypeVariantUnit+ Model.TypeVariable _ -> Variants.TypeVariantVariable+ Model.TypeVoid -> Variants.TypeVariantVoid+ Model.TypeWrap _ -> Variants.TypeVariantWrap++-- | All type variants, in a canonical order+typeVariants :: [Variants.TypeVariant]+typeVariants =+ [+ Variants.TypeVariantAnnotated,+ Variants.TypeVariantApplication,+ Variants.TypeVariantEffect,+ Variants.TypeVariantEither,+ Variants.TypeVariantForall,+ Variants.TypeVariantFunction,+ Variants.TypeVariantList,+ Variants.TypeVariantLiteral,+ Variants.TypeVariantMap,+ Variants.TypeVariantOptional,+ Variants.TypeVariantPair,+ Variants.TypeVariantRecord,+ Variants.TypeVariantSet,+ Variants.TypeVariantUnion,+ Variants.TypeVariantUnit,+ Variants.TypeVariantVariable,+ Variants.TypeVariantVoid,+ Variants.TypeVariantWrap]
@@ -0,0 +1,83 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Typed references to derived encode/decode/show functions, and structural coder builders++module Hydra.Core.Refs where++import qualified Hydra.Core.Ast as Ast+import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Diff as Diff+import qualified Hydra.Core.Docs as Docs+import qualified Hydra.Core.Error.Checking as Checking+import qualified Hydra.Core.Error.File as ErrorFile+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Error.Packaging as ErrorPackaging+import qualified Hydra.Core.Error.System as ErrorSystem+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Json.Model as JsonModel+import qualified Hydra.Core.Overlay.Haskell.Lib.Lists as Lists+import qualified Hydra.Core.Overlay.Haskell.Lib.Maps as Maps+import qualified Hydra.Core.Overlay.Haskell.Lib.Optionals as Optionals+import qualified Hydra.Core.Overlay.Haskell.Lib.Pairs as Pairs+import qualified Hydra.Core.Overlay.Haskell.Lib.Sets as Sets+import qualified Hydra.Core.Markdown as Markdown+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Names as Names+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Parsing as Parsing+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Query as Query+import qualified Hydra.Core.Regex as Regex+import qualified Hydra.Core.Relational as Relational+import qualified Hydra.Core.System as System+import qualified Hydra.Core.Tabular as Tabular+import qualified Hydra.Core.Testing as Testing+import qualified Hydra.Core.Time as Time+import qualified Hydra.Core.Topology as Topology+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Validation as Validation+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void+import qualified Data.Map as M+import qualified Data.Set as S++-- | Look up the decoder function for a type given its TypedName token+decodeRef :: Typed.TypedName t0 -> Model.Term+decodeRef tn = Model.TermVariable (Names.derivedBindingName [+ "decode"] True (Typed.unTypedName tn))++-- | Build an encoder for a list, given an encoder for its element type+encodeList :: (t0 -> Model.Term) -> [t0] -> Model.Term+encodeList elemEncoder xs = Model.TermList (Lists.map elemEncoder xs)++-- | Build an encoder for a map, given encoders for its key and value types+encodeMap :: Ord t0 => ((t0 -> Model.Term) -> (t1 -> Model.Term) -> M.Map t0 t1 -> Model.Term)+encodeMap keyEncoder valEncoder m = Model.TermMap (Maps.bimap keyEncoder valEncoder m)++-- | Build an encoder for an optional value, given an encoder for its element type+encodeOptional :: (t0 -> Model.Term) -> Maybe t0 -> Model.Term+encodeOptional elemEncoder x = Model.TermOptional (Optionals.map elemEncoder x)++-- | Build an encoder for a pair, given encoders for its first and second components+encodePair :: (t0 -> Model.Term) -> (t1 -> Model.Term) -> (t0, t1) -> Model.Term+encodePair firstEncoder secondEncoder p = Model.TermPair (Pairs.bimap firstEncoder secondEncoder p)++-- | Look up the encoder function for a type given its TypedName token+encodeRef :: Typed.TypedName t0 -> Model.Term+encodeRef tn = Model.TermVariable (Names.derivedBindingName [+ "encode"] True (Typed.unTypedName tn))++-- | Build an encoder for a set, given an encoder for its element type+encodeSet :: Ord t0 => ((t0 -> Model.Term) -> S.Set t0 -> Model.Term)+encodeSet elemEncoder xs = Model.TermSet (Sets.map elemEncoder xs)++-- | Look up the string-shower function for a type given its TypedName token+showRef :: Typed.TypedName t0 -> Model.Term+showRef tn = Model.TermVariable (Names.derivedBindingName [+ "show"] True (Typed.unTypedName tn))
@@ -0,0 +1,163 @@+-- Note: this is an automatically generated file. Do not edit.++-- | A model for Hydra's translingual regular-expression syntax: the abstract syntax tree (AST) into which hydra.core.parse.regex parses a pattern and from which hydra.core.print.regex (and the per-dialect hydra.core.print.<dialect>.regex renderers) emit target syntax. Covers the minimal core defined in docs/specification/regex.md (literals, character classes, ., quantifiers, alternation, anchors, grouping). See issue #567.++module Hydra.Core.Regex where++import qualified Hydra.Core.Model as Model+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | A non-empty list of alternative sequences, joined by the | operator. Matches if any alternative matches.+type Alternation = [RegexSequence]++_Alternation = Model.Name "hydra.core.regex.Alternation"++-- | A single, unquantified regex element: the smallest unit to which a quantifier may apply.+data Atom =+ -- | A literal character, matched exactly. The character is a Unicode scalar value in the range [U+0000, U+10FFFF] (surrogates excluded), held as an int32 code point (the range fits in signed 32-bit, and int32 matches Hydra's string/parser code-point representation). In concrete syntax, a metacharacter is written escaped (e.g. \.); escaping is purely a concrete-syntax concern, so the AST holds the bare code point.+ AtomLiteral Int |+ -- | The . metacharacter; matches any single character, INCLUDING newline (unlike most host engines, whose native . excludes newline). To exclude newline, write [^\n] explicitly.+ AtomAny |+ -- | The ^ anchor; matches the empty string at the start of input.+ AtomAnchorStart |+ -- | The $ anchor; matches the empty string at the end of input.+ AtomAnchorEnd |+ -- | A parenthesized sub-expression, ( ... ); groups an alternation for quantification.+ AtomGroup Alternation |+ -- | A character class, [ ... ]; matches any single character in (or, if negated, not in) the set.+ AtomClass CharacterClass+ deriving (Eq, Ord, Read, Show)++_Atom = Model.Name "hydra.core.regex.Atom"++_Atom_literal = Model.Name "literal"++_Atom_any = Model.Name "any"++_Atom_anchorStart = Model.Name "anchorStart"++_Atom_anchorEnd = Model.Name "anchorEnd"++_Atom_group = Model.Name "group"++_Atom_class = Model.Name "class"++-- | A bracketed character class, [ ... ] or [^ ... ].+data CharacterClass =+ CharacterClass {+ -- | True for a negated class ([^ ... ]), which matches any character NOT listed.+ characterClassNegated :: Bool,+ -- | The class members: individual characters and/or character ranges. Must be non-empty; the empty class [] and negated-empty class [^] are excluded from the core (they are not in the POSIX/PCRE/ECMA intersection). hydra.core.parse.regex rejects an empty class.+ characterClassItems :: [ClassItem]}+ deriving (Eq, Ord, Read, Show)++_CharacterClass = Model.Name "hydra.core.regex.CharacterClass"++_CharacterClass_negated = Model.Name "negated"++_CharacterClass_items = Model.Name "items"++-- | An inclusive range of characters within a character class, e.g. a-z.+data CharacterRange =+ CharacterRange {+ -- | The first character of the range (inclusive), as an int32 Unicode scalar value.+ characterRangeFrom :: Int,+ -- | The last character of the range (inclusive), as an int32 Unicode scalar value.+ characterRangeTo :: Int}+ deriving (Eq, Ord, Read, Show)++_CharacterRange = Model.Name "hydra.core.regex.CharacterRange"++_CharacterRange_from = Model.Name "from"++_CharacterRange_to = Model.Name "to"++-- | A member of a character class: either a single character or an inclusive character range.+data ClassItem =+ -- | A single character (int32 Unicode scalar value) in the class.+ ClassItemCharacter Int |+ -- | An inclusive range of characters, e.g. a-z.+ ClassItemRange CharacterRange+ deriving (Eq, Ord, Read, Show)++_ClassItem = Model.Name "hydra.core.regex.ClassItem"++_ClassItem_character = Model.Name "character"++_ClassItem_range = Model.Name "range"++-- | An atom together with an optional quantifier applied to it.+data Quantified =+ Quantified {+ -- | The atom being quantified.+ quantifiedAtom :: Atom,+ -- | The quantifier; use 'one' for an unquantified atom.+ quantifiedQuantifier :: Quantifier}+ deriving (Eq, Ord, Read, Show)++_Quantified = Model.Name "hydra.core.regex.Quantified"++_Quantified_atom = Model.Name "atom"++_Quantified_quantifier = Model.Name "quantifier"++-- | A regular-expression quantifier. Mirrors hydra.core.query.RegexQuantifier, which models the same set of quantifiers for graph-path queries; a future refactor may hoist a shared type (see #567 findings).+data Quantifier =+ -- | No quantifier; matches exactly one occurrence.+ QuantifierOne |+ -- | The ? quantifier; matches zero or one occurrence.+ QuantifierZeroOrOne |+ -- | The * quantifier; matches zero or more occurrences.+ QuantifierZeroOrMore |+ -- | The + quantifier; matches one or more occurrences.+ QuantifierOneOrMore |+ -- | The {n} quantifier; matches exactly n occurrences.+ QuantifierExactly Int |+ -- | The {n,} quantifier; matches at least n occurrences.+ QuantifierAtLeast Int |+ -- | The {n,m} quantifier; matches between n and m (inclusive) occurrences.+ QuantifierRange_ QuantifierRange+ deriving (Eq, Ord, Read, Show)++_Quantifier = Model.Name "hydra.core.regex.Quantifier"++_Quantifier_one = Model.Name "one"++_Quantifier_zeroOrOne = Model.Name "zeroOrOne"++_Quantifier_zeroOrMore = Model.Name "zeroOrMore"++_Quantifier_oneOrMore = Model.Name "oneOrMore"++_Quantifier_exactly = Model.Name "exactly"++_Quantifier_atLeast = Model.Name "atLeast"++_Quantifier_range = Model.Name "range"++-- | The bounds of a {n,m} quantifier: between min and max (inclusive) occurrences.+data QuantifierRange =+ QuantifierRange {+ -- | The minimum number of occurrences (inclusive).+ quantifierRangeMin :: Int,+ -- | The maximum number of occurrences (inclusive).+ quantifierRangeMax :: Int}+ deriving (Eq, Ord, Read, Show)++_QuantifierRange = Model.Name "hydra.core.regex.QuantifierRange"++_QuantifierRange_min = Model.Name "min"++_QuantifierRange_max = Model.Name "max"++-- | A complete Hydra regular expression: the root of the AST. A regex is an alternation of sequences.+type Regex = Alternation++_Regex = Model.Name "hydra.core.regex.Regex"++-- | A (possibly empty) sequence of quantified atoms, matched in order. An empty sequence matches the empty string. (Named RegexSequence rather than Sequence to avoid the generated coder binding colliding with the host's built-in sequence.)+type RegexSequence = [Quantified]++_RegexSequence = Model.Name "hydra.core.regex.RegexSequence"
@@ -0,0 +1,113 @@+-- Note: this is an automatically generated file. Do not edit.++-- | An interpretation of Codd's Relational Model, as described in 'A Relational Model of Data for Large Shared Data Banks' (1970). Types ('domains') and values are parameterized so as to allow for application-specific implementations. No special support is provided for 'nonsimple' domains; i.e. relations are assumed to be normalized.++module Hydra.Core.Relational where++import qualified Hydra.Core.Model as Model+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void+import qualified Data.Map as M+import qualified Data.Set as S++-- | A name for a domain which serves to identify the role played by that domain in the given relation; a 'role name' in Codd+newtype ColumnName =+ ColumnName {+ unColumnName :: String}+ deriving (Eq, Ord, Read, Show)++_ColumnName = Model.Name "hydra.core.relational.ColumnName"++-- | An abstract specification of the domain represented by a column in a relation; a role+data ColumnSchema t =+ ColumnSchema {+ -- | A unique name for the column+ columnSchemaName :: ColumnName,+ -- | The domain (type) of the column+ columnSchemaDomain :: t}+ deriving (Eq, Ord, Read, Show)++_ColumnSchema = Model.Name "hydra.core.relational.ColumnSchema"++_ColumnSchema_name = Model.Name "name"++_ColumnSchema_domain = Model.Name "domain"++-- | A mapping from certain columns of a source relation to primary key columns of a target relation+data ForeignKey =+ ForeignKey {+ -- | The name of the target relation+ foreignKeyForeignRelation :: RelationName,+ -- | The mapping of source column names to target column names. The target column names must together make up the primary key of the target relation.+ foreignKeyKeys :: (M.Map ColumnName ColumnName)}+ deriving (Eq, Ord, Read, Show)++_ForeignKey = Model.Name "hydra.core.relational.ForeignKey"++_ForeignKey_foreignRelation = Model.Name "foreignRelation"++_ForeignKey_keys = Model.Name "keys"++-- | A primary key of a relation, specified either as a single column, or as a list of columns+newtype PrimaryKey =+ PrimaryKey {+ unPrimaryKey :: [ColumnName]}+ deriving (Eq, Ord, Read, Show)++_PrimaryKey = Model.Name "hydra.core.relational.PrimaryKey"++-- | A set of distinct n-tuples; a table+newtype Relation v =+ Relation {+ unRelation :: [Row v]}+ deriving (Eq, Ord, Read, Show)++_Relation = Model.Name "hydra.core.relational.Relation"++-- | A unique relation (table) name+newtype RelationName =+ RelationName {+ unRelationName :: String}+ deriving (Eq, Ord, Read, Show)++_RelationName = Model.Name "hydra.core.relational.RelationName"++-- | An abstract relation; the name and columns of a relation without its actual data+data RelationSchema t =+ RelationSchema {+ -- | A unique name for the relation+ relationSchemaName :: RelationName,+ -- | A list of column specifications+ relationSchemaColumns :: [ColumnSchema t],+ -- | Any number of primary keys for the relation, each of which must be valid for this relation+ relationSchemaPrimaryKeys :: [PrimaryKey],+ -- | Any number of foreign keys, each of which must be valid for both this relation and the target relation+ relationSchemaForeignKeys :: [ForeignKey]}+ deriving (Eq, Ord, Read, Show)++_RelationSchema = Model.Name "hydra.core.relational.RelationSchema"++_RelationSchema_name = Model.Name "name"++_RelationSchema_columns = Model.Name "columns"++_RelationSchema_primaryKeys = Model.Name "primaryKeys"++_RelationSchema_foreignKeys = Model.Name "foreignKeys"++-- | A domain-unordered (string-indexed, rather than position-indexed) relation+newtype Relationship v =+ Relationship {+ unRelationship :: (S.Set (M.Map ColumnName v))}+ deriving (Eq, Ord, Read, Show)++_Relationship = Model.Name "hydra.core.relational.Relationship"++-- | An n-tuple which is an element of a given relation+newtype Row v =+ Row {+ unRow :: [v]}+ deriving (Eq, Ord, Read, Show)++_Row = Model.Name "hydra.core.relational.Row"
@@ -0,0 +1,269 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Type dereference, lookup, requirements, and instantiation++module Hydra.Core.Resolution where++import qualified Hydra.Core.Ast as Ast+import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Decode.Model as DecodeModel+import qualified Hydra.Core.Diff as Diff+import qualified Hydra.Core.Docs as Docs+import qualified Hydra.Core.Error.Checking as Checking+import qualified Hydra.Core.Error.File as ErrorFile+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Error.Packaging as ErrorPackaging+import qualified Hydra.Core.Error.System as ErrorSystem+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Json.Model as JsonModel+import qualified Hydra.Core.Lexical as Lexical+import qualified Hydra.Core.Overlay.Haskell.Lib.Eithers as Eithers+import qualified Hydra.Core.Overlay.Haskell.Lib.Equality as Equality+import qualified Hydra.Core.Overlay.Haskell.Lib.Lists as Lists+import qualified Hydra.Core.Overlay.Haskell.Lib.Literals as Literals+import qualified Hydra.Core.Overlay.Haskell.Lib.Logic as Logic+import qualified Hydra.Core.Overlay.Haskell.Lib.Maps as Maps+import qualified Hydra.Core.Overlay.Haskell.Lib.Math as Math+import qualified Hydra.Core.Overlay.Haskell.Lib.Optionals as Optionals+import qualified Hydra.Core.Overlay.Haskell.Lib.Pairs as Pairs+import qualified Hydra.Core.Overlay.Haskell.Lib.Strings as Strings+import qualified Hydra.Core.Markdown as Markdown+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Names as Names+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Parsing as Parsing+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Print.Model as PrintModel+import qualified Hydra.Core.Query as Query+import qualified Hydra.Core.Regex as Regex+import qualified Hydra.Core.Relational as Relational+import qualified Hydra.Core.Scoping as Scoping+import qualified Hydra.Core.Strip as Strip+import qualified Hydra.Core.Substitution as Substitution+import qualified Hydra.Core.System as System+import qualified Hydra.Core.Tabular as Tabular+import qualified Hydra.Core.Testing as Testing+import qualified Hydra.Core.Time as Time+import qualified Hydra.Core.Topology as Topology+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Validation as Validation+import qualified Hydra.Core.Variables as Variables+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void+import qualified Data.Map as M++-- | Dereference a type name to get the actual type (Either version)+dereferenceType :: t0 -> Graph.Graph -> Model.Name -> Either Errors.Error (Maybe Model.Type)+dereferenceType cx graph name =++ let mel = Lexical.lookupBinding graph name+ in (Optionals.match mel (Right Nothing) (\el -> Eithers.map Optionals.given (Eithers.bimap (\_e -> Errors.ErrorResolution (Errors.ResolutionErrorUnexpectedShape (Errors.UnexpectedShapeError {+ Errors.unexpectedShapeErrorExpected = "type",+ Errors.unexpectedShapeErrorActual = (Errors.unDecodingError _e)}))) (\_a -> _a) (DecodeModel.type_ graph (Model.bindingTerm el)))))++-- | Test whether a given System F type is polymorphic (i.e., a forall type)+fTypeIsPolymorphic :: Model.Type -> Bool+fTypeIsPolymorphic typ =+ case typ of+ Model.TypeAnnotated v0 -> fTypeIsPolymorphic (Model.annotatedTypeBody v0)+ Model.TypeForall _ -> True+ _ -> False++-- | Build a map from field name to field term, given a list of fields+fieldMap :: [Model.Field] -> M.Map Model.Name Model.Term+fieldMap fields =++ let toPair = \f -> (Model.fieldName f, (Model.fieldTerm f))+ in (Maps.fromList (Lists.map toPair fields))++-- | Build a map from field name to field type, given a list of field types+fieldTypeMap :: [Model.FieldType] -> M.Map Model.Name Model.Type+fieldTypeMap fields =++ let toPair = \f -> (Model.fieldTypeName f, (Model.fieldTypeType f))+ in (Maps.fromList (Lists.map toPair fields))++-- | Get field types from a record or union type (Either version)+fieldTypes :: t0 -> Graph.Graph -> Model.Type -> Either Errors.Error (M.Map Model.Name Model.Type)+fieldTypes cx graph t =++ let toMap = \fields -> Maps.fromList (Lists.map (\ft -> (Model.fieldTypeName ft, (Model.fieldTypeType ft))) fields)+ in case (Strip.deannotateType t) of+ Model.TypeForall v0 -> fieldTypes cx graph (Model.forallTypeBody v0)+ Model.TypeRecord v0 -> Right (toMap v0)+ Model.TypeUnion v0 -> Right (toMap v0)+ Model.TypeVariable v0 -> Optionals.match (Maps.lookup v0 (Graph.graphSchemaTypes graph)) (Eithers.bind (Lexical.requireBinding graph v0) (\el -> Eithers.bind (Eithers.bimap (\_e -> Errors.ErrorResolution (Errors.ResolutionErrorUnexpectedShape (Errors.UnexpectedShapeError {+ Errors.unexpectedShapeErrorExpected = "type",+ Errors.unexpectedShapeErrorActual = (Errors.unDecodingError _e)}))) (\_a -> _a) (DecodeModel.type_ graph (Model.bindingTerm el))) (\decodedType -> fieldTypes cx graph decodedType))) (\ts -> fieldTypes cx graph (Model.typeSchemeBody ts))+ _ -> Left (Errors.ErrorResolution (Errors.ResolutionErrorUnexpectedShape (Errors.UnexpectedShapeError {+ Errors.unexpectedShapeErrorExpected = "record or union type",+ Errors.unexpectedShapeErrorActual = (PrintModel.type_ t)})))++-- | Find a field type by name in a list of field types+findFieldType :: t0 -> Model.Name -> [Model.FieldType] -> Either Errors.Error Model.Type+findFieldType cx fname fields =++ let matchingFields = Lists.filter (\ft -> Equality.equal (Model.unName (Model.fieldTypeName ft)) (Model.unName fname)) fields+ noMatch =+ Left (Errors.ErrorResolution (Errors.ResolutionErrorNoMatchingField (Errors.NoMatchingFieldError {+ Errors.noMatchingFieldErrorFieldName = fname})))+ in (Logic.ifElse (Lists.isEmpty matchingFields) noMatch (Logic.ifElse (Equality.equal (Lists.length matchingFields) 1) (Optionals.match (Lists.head matchingFields) noMatch (\ft -> Right (Model.fieldTypeType ft))) (Left (Errors.ErrorExtraction (Errors.ExtractionErrorMultipleFields (Errors.MultipleFieldsError {+ Errors.multipleFieldsErrorFieldName = fname}))))))++-- | Fully strip a type of forall quantifiers, normalizing bound variable names for alpha-equivalence comparison+fullyStripAndNormalizeType :: Model.Type -> Model.Type+fullyStripAndNormalizeType typ =++ let go =+ \depth -> \subst -> \t -> case (Strip.deannotateType t) of+ Model.TypeForall v0 ->+ let oldVar = Model.forallTypeParameter v0+ newVar = Model.Name (Strings.concat2 "_" (Literals.printInt32 depth))+ in (go (Math.add depth 1) (Maps.insert oldVar newVar subst) (Model.forallTypeBody v0))+ _ -> (subst, t)+ result = go 0 Maps.empty typ+ subst = Pairs.first result+ body = Pairs.second result+ in (Variables.substituteTypeVariables subst body)++-- | Fully strip a type of forall quantifiers+fullyStripType :: Model.Type -> Model.Type+fullyStripType typ =+ case (Strip.deannotateType typ) of+ Model.TypeForall v0 -> fullyStripType (Model.forallTypeBody v0)+ _ -> typ++-- | Instantiate a type by replacing all forall-bound type variables with fresh variables, threading InferenceContext+instantiateType :: Typing.InferenceContext -> Model.Type -> (Model.Type, Typing.InferenceContext)+instantiateType cx typ =++ let result = instantiateTypeScheme cx (typeToTypeScheme typ)+ in (Scoping.typeSchemeToFType (Pairs.first result), (Pairs.second result))++-- | Instantiate a type scheme with fresh variables, threading InferenceContext+instantiateTypeScheme :: Typing.InferenceContext -> Model.TypeScheme -> (Model.TypeScheme, Typing.InferenceContext)+instantiateTypeScheme cx scheme =++ let oldVars = Model.typeSchemeVariables scheme+ result = Names.freshNames (Lists.length oldVars) cx+ newVars = Pairs.first result+ cx2 = Pairs.second result+ subst = Typing.TypeSubst (Maps.fromList (Lists.zip oldVars (Lists.map (\x -> Model.TypeVariable x) newVars)))+ nameSubst = Maps.fromList (Lists.zip oldVars newVars)+ renamedConstraints =+ Maps.fromList (Lists.map (\kv -> (Optionals.withDefault (Pairs.first kv) (Maps.lookup (Pairs.first kv) nameSubst), (Pairs.second kv))) (Maps.toList (Model.typeSchemeConstraints scheme)))+ in (+ Model.TypeScheme {+ Model.typeSchemeVariables = newVars,+ Model.typeSchemeBody = (Substitution.substInType subst (Model.typeSchemeBody scheme)),+ Model.typeSchemeConstraints = renamedConstraints},+ cx2)++-- | Test whether a map's key type resolves to string, following aliases and wrappers. Used to decide whether a map may use the compact JSON object encoding.+mapKeyResolvesToString :: M.Map Model.Name Model.Type -> Model.Type -> Bool+mapKeyResolvesToString types keyType =+ case (resolveBaseType types keyType) of+ Model.TypeLiteral v0 -> case v0 of+ Model.LiteralTypeString -> True+ _ -> False+ _ -> False++-- | Apply type arguments to a nominal type+nominalApplication :: Model.Name -> [Model.Type] -> Model.Type+nominalApplication tname args =+ Lists.foldl (\t -> \a -> Model.TypeApplication (Model.ApplicationType {+ Model.applicationTypeFunction = t,+ Model.applicationTypeArgument = a})) (Model.TypeVariable tname) args++-- | Require a name to resolve to a record type+requireRecordType :: t0 -> Graph.Graph -> Model.Name -> Either Errors.Error [Model.FieldType]+requireRecordType cx graph name =++ let toRecord =+ \t -> case t of+ Model.TypeRecord v0 -> Just v0+ _ -> Nothing+ in (requireRowType cx "record type" toRecord graph name)++-- | Require a name to resolve to a row type+requireRowType :: t0 -> String -> (Model.Type -> Maybe t1) -> Graph.Graph -> Model.Name -> Either Errors.Error t1+requireRowType cx label getter graph name =++ let rawType =+ \t -> case t of+ Model.TypeAnnotated v0 -> rawType (Model.annotatedTypeBody v0)+ Model.TypeForall v0 -> rawType (Model.forallTypeBody v0)+ _ -> t+ in (Eithers.bind (requireType cx graph name) (\t -> Optionals.match (getter (rawType t)) (Left (Errors.ErrorResolution (Errors.ResolutionErrorUnexpectedShape (Errors.UnexpectedShapeError {+ Errors.unexpectedShapeErrorExpected = (Strings.concat2 label " type"),+ Errors.unexpectedShapeErrorActual = (Strings.concat2 (Model.unName name) (Strings.concat2 ": " (PrintModel.type_ t)))})))) (\x -> Right x)))++-- | Look up a schema type and instantiate it, threading InferenceContext+requireSchemaType :: Typing.InferenceContext -> M.Map Model.Name Model.TypeScheme -> Model.Name -> Either Errors.Error (Model.TypeScheme, Typing.InferenceContext)+requireSchemaType cx types tname =+ Optionals.match (Maps.lookup tname types) (Left (Errors.ErrorResolution (Errors.ResolutionErrorNoSuchBinding (Errors.NoSuchBindingError {+ Errors.noSuchBindingErrorName = tname})))) (\ts -> Right (instantiateTypeScheme cx (Strip.deannotateTypeSchemeRecursive ts)))++-- | Require a type by name+requireType :: t0 -> Graph.Graph -> Model.Name -> Either Errors.Error Model.Type+requireType cx graph name =+ Optionals.match (Maps.lookup name (Graph.graphSchemaTypes graph)) (Optionals.match (Maps.lookup name (Graph.graphBoundTypes graph)) (Left (Errors.ErrorResolution (Errors.ResolutionErrorNoSuchBinding (Errors.NoSuchBindingError {+ Errors.noSuchBindingErrorName = name})))) (\ts -> Right (Scoping.typeSchemeToFType ts))) (\ts -> Right (Scoping.typeSchemeToFType ts))++-- | Require a field type from a union type+requireUnionField :: t0 -> Graph.Graph -> Model.Name -> Model.Name -> Either Errors.Error Model.Type+requireUnionField cx graph tname fname =++ let withRowType =+ \rt ->+ let noMatchErr =+ Left (Errors.ErrorResolution (Errors.ResolutionErrorNoMatchingField (Errors.NoMatchingFieldError {+ Errors.noMatchingFieldErrorFieldName = fname})))+ in (Optionals.match (Lists.find (\ft -> Equality.equal (Model.fieldTypeName ft) fname) rt) noMatchErr (\ft -> Right (Model.fieldTypeType ft)))+ in (Eithers.bind (requireUnionType cx graph tname) withRowType)++-- | Require a name to resolve to a union type+requireUnionType :: t0 -> Graph.Graph -> Model.Name -> Either Errors.Error [Model.FieldType]+requireUnionType cx graph name =++ let toUnion =+ \t -> case t of+ Model.TypeUnion v0 -> Just v0+ _ -> Nothing+ in (requireRowType cx "union" toUnion graph name)++-- | Resolve a type to its base, following annotations, type aliases (Type.variable dereferenced against the given type map), and Type.wrap bodies, transitively. An unresolvable variable name (not found in the map) is returned as-is, since the caller is in the best position to decide whether that is an error. As with hydra.sources.kernel.terms.lexical.dereferenceSchemaType, this assumes type aliases form an acyclic reference graph, as guaranteed by schema construction; a genuinely self-referential alias is not a supported input and would not terminate.+resolveBaseType :: M.Map Model.Name Model.Type -> Model.Type -> Model.Type+resolveBaseType types typ =++ let stripped = Strip.deannotateType typ+ in case stripped of+ Model.TypeVariable v0 -> Optionals.match (Maps.lookup v0 types) stripped (\resolved -> resolveBaseType types resolved)+ Model.TypeWrap v0 -> resolveBaseType types v0+ _ -> stripped++-- | Resolve a type, dereferencing type variables+resolveType :: Graph.Graph -> Model.Type -> Maybe Model.Type+resolveType graph typ =+ case (Strip.deannotateType typ) of+ Model.TypeVariable v0 -> Optionals.match (Maps.lookup v0 (Graph.graphSchemaTypes graph)) (Optionals.map (\ts -> Scoping.typeSchemeToFType ts) (Maps.lookup v0 (Graph.graphBoundTypes graph))) (\ts -> Just (Scoping.typeSchemeToFType ts))+ _ -> Just typ++-- | Convert a (System F -style) type to a type scheme+typeToTypeScheme :: Model.Type -> Model.TypeScheme+typeToTypeScheme t0 =++ let helper =+ \vars -> \t -> case (Strip.deannotateType t) of+ Model.TypeForall v0 -> helper (Lists.cons (Model.forallTypeParameter v0) vars) (Model.forallTypeBody v0)+ _ -> Model.TypeScheme {+ Model.typeSchemeVariables = (Lists.reverse vars),+ Model.typeSchemeBody = t,+ Model.typeSchemeConstraints = Maps.empty}+ in (helper [] t0)
@@ -0,0 +1,1075 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Core rewrite and fold combinators for terms and types++module Hydra.Core.Rewriting where++import qualified Hydra.Core.Ast as Ast+import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Constants as Constants+import qualified Hydra.Core.Diff as Diff+import qualified Hydra.Core.Docs as Docs+import qualified Hydra.Core.Error.Checking as Checking+import qualified Hydra.Core.Error.File as ErrorFile+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Error.Packaging as ErrorPackaging+import qualified Hydra.Core.Error.System as ErrorSystem+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Json.Model as JsonModel+import qualified Hydra.Core.Overlay.Haskell.Lib.Eithers as Eithers+import qualified Hydra.Core.Overlay.Haskell.Lib.Lists as Lists+import qualified Hydra.Core.Overlay.Haskell.Lib.Maps as Maps+import qualified Hydra.Core.Overlay.Haskell.Lib.Math as Math+import qualified Hydra.Core.Overlay.Haskell.Lib.Optionals as Optionals+import qualified Hydra.Core.Overlay.Haskell.Lib.Pairs as Pairs+import qualified Hydra.Core.Overlay.Haskell.Lib.Sets as Sets+import qualified Hydra.Core.Markdown as Markdown+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Parsing as Parsing+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Query as Query+import qualified Hydra.Core.Regex as Regex+import qualified Hydra.Core.Relational as Relational+import qualified Hydra.Core.Scoping as Scoping+import qualified Hydra.Core.System as System+import qualified Hydra.Core.Tabular as Tabular+import qualified Hydra.Core.Testing as Testing+import qualified Hydra.Core.Time as Time+import qualified Hydra.Core.Topology as Topology+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Validation as Validation+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | Apply a term-level function inside any leading type lambdas+applyInsideTypeLambdasAndAnnotations :: (Model.Term -> Model.Term) -> Model.Term -> Model.Term+applyInsideTypeLambdasAndAnnotations f term0 =+ case term0 of+ Model.TermAnnotated v0 -> Model.TermAnnotated (Model.AnnotatedTerm {+ Model.annotatedTermBody = (applyInsideTypeLambdasAndAnnotations f (Model.annotatedTermBody v0)),+ Model.annotatedTermAnnotation = (Model.annotatedTermAnnotation v0)})+ Model.TermTypeLambda v0 -> Model.TermTypeLambda (Model.TypeLambda {+ Model.typeLambdaParameter = (Model.typeLambdaParameter v0),+ Model.typeLambdaBody = (applyInsideTypeLambdasAndAnnotations f (Model.typeLambdaBody v0))})+ _ -> f term0++-- | Fold over a term, traversing its subterms in the specified order+foldOverTerm :: Coders.TraversalOrder -> (t0 -> Model.Term -> t0) -> t0 -> Model.Term -> t0+foldOverTerm order fld b0 term =+ case order of+ Coders.TraversalOrderPre -> Lists.foldl (foldOverTerm order fld) (fld b0 term) (subterms term)+ Coders.TraversalOrderPost -> fld (Lists.foldl (foldOverTerm order fld) b0 (subterms term)) term++-- | Fold over a type, traversing its subtypes in the specified order+foldOverType :: Coders.TraversalOrder -> (t0 -> Model.Type -> t0) -> t0 -> Model.Type -> t0+foldOverType order fld b0 typ =+ case order of+ Coders.TraversalOrderPre -> Lists.foldl (foldOverType order fld) (fld b0 typ) (subtypes typ)+ Coders.TraversalOrderPost -> fld (Lists.foldl (foldOverType order fld) b0 (subtypes typ)) typ++-- | Fold over a term to produce a value, with both Graph and accessor path tracked. Like rewriteAndFoldTermWithGraphAndPath, but only folds without rewriting. The Graph is automatically updated when descending into lambdas, lets, and type lambdas.+foldTermWithGraphAndPath :: ((t0 -> Model.Term -> t0) -> [Paths.SubtermStep] -> Graph.Graph -> t0 -> Model.Term -> t0) -> Graph.Graph -> t0 -> Model.Term -> t0+foldTermWithGraphAndPath f cx0 val0 term0 =++ let wrapper =+ \recurse -> \path -> \cx -> \val -> \term ->+ let recurseForUser =+ \valIn -> \subterm ->+ let r = recurse valIn subterm+ in (Pairs.first r)+ in (f recurseForUser path cx val term, term)+ result = rewriteAndFoldTermWithGraphAndPath wrapper cx0 val0 term0+ in (Pairs.first result)++-- | Apply a transformation to the first type beneath a chain of annotations+mapBeneathTypeAnnotations :: (Model.Type -> Model.Type) -> Model.Type -> Model.Type+mapBeneathTypeAnnotations f t =+ case t of+ Model.TypeAnnotated v0 -> Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (mapBeneathTypeAnnotations f (Model.annotatedTypeBody v0)),+ Model.annotatedTypeAnnotation = (Model.annotatedTypeAnnotation v0)})+ _ -> f t++-- | Rewrite a term, and at the same time, fold a function over it, accumulating a value+rewriteAndFoldTerm :: ((t0 -> Model.Term -> (t0, Model.Term)) -> t0 -> Model.Term -> (t0, Model.Term)) -> t0 -> Model.Term -> (t0, Model.Term)+rewriteAndFoldTerm f term0 =++ let fsub =+ \recurse -> \val0 -> \term02 ->+ let forSingle =+ \rec -> \cons -> \val -> \term ->+ let r = rec val term+ in (Pairs.first r, (cons (Pairs.second r)))+ forMany =+ \rec -> \cons -> \val -> \els ->+ let rr =+ Lists.foldl (\r -> \el ->+ let r2 = rec (Pairs.first r) el+ in (Pairs.first r2, (Lists.cons (Pairs.second r2) (Pairs.second r)))) (val, []) els+ in (Pairs.first rr, (cons (Lists.reverse (Pairs.second rr))))+ forField =+ \val -> \field ->+ let r = recurse val (Model.fieldTerm field)+ in (+ Pairs.first r,+ Model.Field {+ Model.fieldName = (Model.fieldName field),+ Model.fieldTerm = (Pairs.second r)})+ forFields = forMany forField (\x -> x)+ forCaseAlternative =+ \val -> \alt ->+ let r = recurse val (Model.caseAlternativeHandler alt)+ in (+ Pairs.first r,+ Model.CaseAlternative {+ Model.caseAlternativeName = (Model.caseAlternativeName alt),+ Model.caseAlternativeHandler = (Pairs.second r)})+ forCaseAlternatives = forMany forCaseAlternative (\x -> x)+ forPair =+ \val -> \kv ->+ let rk = recurse val (Pairs.first kv)+ rv = recurse (Pairs.first rk) (Pairs.second kv)+ in (Pairs.first rv, (Pairs.second rk, (Pairs.second rv)))+ forBinding =+ \val -> \binding ->+ let r = recurse val (Model.bindingTerm binding)+ in (+ Pairs.first r,+ Model.Binding {+ Model.bindingName = (Model.bindingName binding),+ Model.bindingTerm = (Pairs.second r),+ Model.bindingTypeScheme = (Model.bindingTypeScheme binding)})+ dflt = (val0, term02)+ in case term02 of+ Model.TermAnnotated v0 -> forSingle recurse (\t -> Model.TermAnnotated (Model.AnnotatedTerm {+ Model.annotatedTermBody = t,+ Model.annotatedTermAnnotation = (Model.annotatedTermAnnotation v0)})) val0 (Model.annotatedTermBody v0)+ Model.TermApplication v0 ->+ let rlhs = recurse val0 (Model.applicationFunction v0)+ rrhs = recurse (Pairs.first rlhs) (Model.applicationArgument v0)+ in (+ Pairs.first rrhs,+ (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Pairs.second rlhs),+ Model.applicationArgument = (Pairs.second rrhs)})))+ Model.TermCases v0 ->+ let rmd = Optionals.map (recurse val0) (Model.caseStatementDefault v0)+ val1 = Optionals.match rmd val0 Pairs.first+ rcases = forCaseAlternatives val1 (Model.caseStatementCases v0)+ in (+ Pairs.first rcases,+ (Model.TermCases (Model.CaseStatement {+ Model.caseStatementTypeName = (Model.caseStatementTypeName v0),+ Model.caseStatementDefault = (Optionals.map Pairs.second rmd),+ Model.caseStatementCases = (Pairs.second rcases)})))+ Model.TermEither v0 -> Eithers.either (\l ->+ let rl = recurse val0 l+ in (Pairs.first rl, (Model.TermEither (Left (Pairs.second rl))))) (\r ->+ let rr = recurse val0 r+ in (Pairs.first rr, (Model.TermEither (Right (Pairs.second rr))))) v0+ Model.TermLambda v0 ->+ let rl = recurse val0 (Model.lambdaBody v0)+ in (+ Pairs.first rl,+ (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.lambdaParameter v0),+ Model.lambdaDomain = (Model.lambdaDomain v0),+ Model.lambdaBody = (Pairs.second rl)})))+ Model.TermLet v0 ->+ let renv = recurse val0 (Model.letBody v0)+ in (forMany forBinding (\bins -> Model.TermLet (Model.Let {+ Model.letBindings = bins,+ Model.letBody = (Pairs.second renv)})) (Pairs.first renv) (Model.letBindings v0))+ Model.TermList v0 -> forMany recurse (\x -> Model.TermList x) val0 v0+ Model.TermMap v0 -> forMany forPair (\pairs -> Model.TermMap (Maps.fromList pairs)) val0 (Maps.toList v0)+ Model.TermOptional v0 -> Optionals.match v0 dflt (\t -> forSingle recurse (\t1 -> Model.TermOptional (Just t1)) val0 t)+ Model.TermPair v0 ->+ let rf = recurse val0 (Pairs.first v0)+ rs = recurse (Pairs.first rf) (Pairs.second v0)+ in (Pairs.first rs, (Model.TermPair (Pairs.second rf, (Pairs.second rs))))+ Model.TermProject v0 -> (val0, (Model.TermProject v0))+ Model.TermRecord v0 -> forMany forField (\fields -> Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.recordTypeName v0),+ Model.recordFields = fields})) val0 (Model.recordFields v0)+ Model.TermSet v0 -> forMany recurse (\e -> Model.TermSet (Sets.fromList e)) val0 (Sets.toList v0)+ Model.TermTypeApplication v0 -> forSingle recurse (\t -> Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = t,+ Model.typeApplicationTermType = (Model.typeApplicationTermType v0)})) val0 (Model.typeApplicationTermBody v0)+ Model.TermTypeLambda v0 -> forSingle recurse (\t -> Model.TermTypeLambda (Model.TypeLambda {+ Model.typeLambdaParameter = (Model.typeLambdaParameter v0),+ Model.typeLambdaBody = t})) val0 (Model.typeLambdaBody v0)+ Model.TermInject v0 -> forSingle recurse (\t -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.injectionTypeName v0),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.fieldName (Model.injectionField v0)),+ Model.fieldTerm = t}})) val0 (Model.fieldTerm (Model.injectionField v0))+ Model.TermUnwrap v0 -> (val0, (Model.TermUnwrap v0))+ Model.TermWrap v0 -> forSingle recurse (\t -> Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.wrappedTermTypeName v0),+ Model.wrappedTermBody = t})) val0 (Model.wrappedTermBody v0)+ _ -> dflt+ recurse = f (fsub recurse)+ in (recurse term0)++-- | Rewrite a term while folding to produce a value, with Graph updated as we descend into subterms. Combines the features of rewriteAndFoldTerm and rewriteTermWithGraph. The user function f receives a recurse function that handles subterm traversal and Graph management.+rewriteAndFoldTermWithGraph :: ((t0 -> Model.Term -> (t0, Model.Term)) -> Graph.Graph -> t0 -> Model.Term -> (t0, Model.Term)) -> Graph.Graph -> t0 -> Model.Term -> (t0, Model.Term)+rewriteAndFoldTermWithGraph f cx0 val0 term0 =++ let wrapper =+ \lowLevelRecurse -> \valAndCx -> \term ->+ let val = Pairs.first valAndCx+ cx = Pairs.second valAndCx+ cx1 =+ case term of+ Model.TermLambda v0 -> Scoping.extendGraphForLambda cx v0+ Model.TermLet v0 -> Scoping.extendGraphForLet (\_ -> \_2 -> Nothing) cx v0+ Model.TermTypeLambda v0 -> Scoping.extendGraphForTypeLambda cx v0+ _ -> cx+ recurseForUser =+ \newVal -> \subterm ->+ let result = lowLevelRecurse (newVal, cx1) subterm+ in (Pairs.first (Pairs.first result), (Pairs.second result))+ fResult = f recurseForUser cx1 val term+ in ((Pairs.first fResult, cx), (Pairs.second fResult))+ result = rewriteAndFoldTerm wrapper (val0, cx0) term0+ in (Pairs.first (Pairs.first result), (Pairs.second result))++-- | Rewrite a term while folding to produce a value, with both Graph and accessor path tracked. The path is a list of SubtermSteps representing the position from the root to the current term. Combines the features of rewriteAndFoldTermWithPath and Graph tracking. The Graph is automatically updated when descending into lambdas, lets, and type lambdas.+rewriteAndFoldTermWithGraphAndPath :: ((t0 -> Model.Term -> (t0, Model.Term)) -> [Paths.SubtermStep] -> Graph.Graph -> t0 -> Model.Term -> (t0, Model.Term)) -> Graph.Graph -> t0 -> Model.Term -> (t0, Model.Term)+rewriteAndFoldTermWithGraphAndPath f cx0 val0 term0 =++ let wrapper =+ \recurse -> \path -> \cxAndVal -> \term ->+ let cx = Pairs.first cxAndVal+ val = Pairs.second cxAndVal+ cx1 =+ case term of+ Model.TermLambda v0 -> Scoping.extendGraphForLambda cx v0+ Model.TermLet v0 -> Scoping.extendGraphForLet (\_ -> \_2 -> Nothing) cx v0+ Model.TermTypeLambda v0 -> Scoping.extendGraphForTypeLambda cx v0+ _ -> cx+ recurseForUser =+ \valIn -> \termIn ->+ let result = recurse path (cx1, valIn) termIn+ in (Pairs.second (Pairs.first result), (Pairs.second result))+ fResult = f recurseForUser path cx1 val term+ in ((cx, (Pairs.first fResult)), (Pairs.second fResult))+ result = rewriteAndFoldTermWithPath wrapper (cx0, val0) term0+ in (Pairs.second (Pairs.first result), (Pairs.second result))++-- | Rewrite a term with path tracking, and fold a function over it, accumulating a value. The path is a list of SubtermSteps from root to current position.+rewriteAndFoldTermWithPath :: (([Paths.SubtermStep] -> t0 -> Model.Term -> (t0, Model.Term)) -> [Paths.SubtermStep] -> t0 -> Model.Term -> (t0, Model.Term)) -> t0 -> Model.Term -> (t0, Model.Term)+rewriteAndFoldTermWithPath f term0 =++ let fsub =+ \recurse -> \path -> \val0 -> \term02 ->+ let forSingleWithAccessor =+ \rec -> \cons -> \accessor -> \val -> \term ->+ let r = rec (Lists.concat2 path [+ accessor]) val term+ in (Pairs.first r, (cons (Pairs.second r)))+ forManyWithAccessors =+ \rec -> \cons -> \val -> \accessorTermPairs ->+ let rr =+ Lists.foldl (\r -> \atp ->+ let r2 = rec (Lists.concat2 path [+ Pairs.first atp]) (Pairs.first r) (Pairs.second atp)+ in (Pairs.first r2, (Lists.cons (Pairs.second r2) (Pairs.second r)))) (val, []) accessorTermPairs+ in (Pairs.first rr, (cons (Lists.reverse (Pairs.second rr))))+ forFieldWithAccessor =+ \mkAccessor -> \val -> \field ->+ let r = recurse (Lists.concat2 path [+ mkAccessor (Model.fieldName field)]) val (Model.fieldTerm field)+ in (+ Pairs.first r,+ Model.Field {+ Model.fieldName = (Model.fieldName field),+ Model.fieldTerm = (Pairs.second r)})+ forFieldsWithAccessor =+ \mkAccessor -> forManyWithAccessors (\path1 -> \val1 -> \field1 -> forFieldWithAccessor mkAccessor val1 field1) (\x -> x)+ forPairWithAccessors =+ \keyAccessor -> \valAccessor -> \val -> \kv ->+ let rk = recurse (Lists.concat2 path [+ keyAccessor]) val (Pairs.first kv)+ rv = recurse (Lists.concat2 path [+ valAccessor]) (Pairs.first rk) (Pairs.second kv)+ in (Pairs.first rv, (Pairs.second rk, (Pairs.second rv)))+ forBindingWithAccessor =+ \val -> \binding ->+ let r = recurse (Lists.concat2 path [+ Paths.SubtermStepLetBinding (Model.bindingName binding)]) val (Model.bindingTerm binding)+ in (+ Pairs.first r,+ Model.Binding {+ Model.bindingName = (Model.bindingName binding),+ Model.bindingTerm = (Pairs.second r),+ Model.bindingTypeScheme = (Model.bindingTypeScheme binding)})+ dflt = (val0, term02)+ in case term02 of+ Model.TermAnnotated v0 -> forSingleWithAccessor recurse (\t -> Model.TermAnnotated (Model.AnnotatedTerm {+ Model.annotatedTermBody = t,+ Model.annotatedTermAnnotation = (Model.annotatedTermAnnotation v0)})) Paths.SubtermStepAnnotatedBody val0 (Model.annotatedTermBody v0)+ Model.TermApplication v0 ->+ let rlhs = recurse (Lists.concat2 path [+ Paths.SubtermStepApplicationFunction]) val0 (Model.applicationFunction v0)+ rrhs =+ recurse (Lists.concat2 path [+ Paths.SubtermStepApplicationArgument]) (Pairs.first rlhs) (Model.applicationArgument v0)+ in (+ Pairs.first rrhs,+ (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Pairs.second rlhs),+ Model.applicationArgument = (Pairs.second rrhs)})))+ Model.TermCases v0 ->+ let rmd =+ Optionals.map (\def -> recurse (Lists.concat2 path [+ Paths.SubtermStepCasesDefault]) val0 def) (Model.caseStatementDefault v0)+ val1 = Optionals.match rmd val0 Pairs.first+ rcases =+ forManyWithAccessors recurse (\x -> x) val1 (Lists.map (\f2 -> (Paths.SubtermStepCasesCase (Model.caseAlternativeName f2), (Model.caseAlternativeHandler f2))) (Model.caseStatementCases v0))+ in (+ Pairs.first rcases,+ (Model.TermCases (Model.CaseStatement {+ Model.caseStatementTypeName = (Model.caseStatementTypeName v0),+ Model.caseStatementDefault = (Optionals.map Pairs.second rmd),+ Model.caseStatementCases = (Lists.map (\ft -> Model.CaseAlternative {+ Model.caseAlternativeName = (Pairs.first ft),+ Model.caseAlternativeHandler = (Pairs.second ft)}) (Lists.zip (Lists.map Model.caseAlternativeName (Model.caseStatementCases v0)) (Pairs.second rcases)))})))+ Model.TermEither v0 -> Eithers.either (\l ->+ let rl = recurse (Lists.concat2 path [+ Paths.SubtermStepEitherLeft]) val0 l+ in (Pairs.first rl, (Model.TermEither (Left (Pairs.second rl))))) (\r ->+ let rr = recurse (Lists.concat2 path [+ Paths.SubtermStepEitherRight]) val0 r+ in (Pairs.first rr, (Model.TermEither (Right (Pairs.second rr))))) v0+ Model.TermLambda v0 ->+ let rl = recurse (Lists.concat2 path [+ Paths.SubtermStepLambdaBody]) val0 (Model.lambdaBody v0)+ in (+ Pairs.first rl,+ (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.lambdaParameter v0),+ Model.lambdaDomain = (Model.lambdaDomain v0),+ Model.lambdaBody = (Pairs.second rl)})))+ Model.TermLet v0 ->+ let renv = recurse (Lists.concat2 path [+ Paths.SubtermStepLetBody]) val0 (Model.letBody v0)+ rbindings =+ Lists.foldl (\r -> \binding ->+ let rb = forBindingWithAccessor (Pairs.first r) binding+ in (Pairs.first rb, (Lists.cons (Pairs.second rb) (Pairs.second r)))) (Pairs.first renv, []) (Model.letBindings v0)+ in (+ Pairs.first rbindings,+ (Model.TermLet (Model.Let {+ Model.letBindings = (Lists.reverse (Pairs.second rbindings)),+ Model.letBody = (Pairs.second renv)})))+ Model.TermList v0 ->+ let idx = 0+ rr =+ Lists.foldl (\r -> \el ->+ let r2 = recurse (Lists.concat2 path [+ Paths.SubtermStepListElement (Pairs.first r)]) (Pairs.first (Pairs.second r)) el+ in (Math.add (Pairs.first r) 1, (Pairs.first r2, (Lists.cons (Pairs.second r2) (Pairs.second (Pairs.second r)))))) (idx, (val0, [])) v0+ in (Pairs.first (Pairs.second rr), (Model.TermList (Lists.reverse (Pairs.second (Pairs.second rr)))))+ Model.TermMap v0 ->+ let idx = 0+ rr =+ Lists.foldl (\r -> \kv ->+ let rk =+ recurse (Lists.concat2 path [+ Paths.SubtermStepMapEntry (Pairs.first r),+ Paths.SubtermStepPairFirst]) (Pairs.first (Pairs.second r)) (Pairs.first kv)+ rv =+ recurse (Lists.concat2 path [+ Paths.SubtermStepMapEntry (Pairs.first r),+ Paths.SubtermStepPairSecond]) (Pairs.first rk) (Pairs.second kv)+ in (Math.add (Pairs.first r) 1, (Pairs.first rv, (Lists.cons (Pairs.second rk, (Pairs.second rv)) (Pairs.second (Pairs.second r)))))) (idx, (val0, [])) (Maps.toList v0)+ in (Pairs.first (Pairs.second rr), (Model.TermMap (Maps.fromList (Lists.reverse (Pairs.second (Pairs.second rr))))))+ Model.TermOptional v0 -> Optionals.match v0 dflt (\t -> forSingleWithAccessor recurse (\t1 -> Model.TermOptional (Just t1)) Paths.SubtermStepOptionalGiven val0 t)+ Model.TermPair v0 ->+ let rf = recurse (Lists.concat2 path [+ Paths.SubtermStepPairFirst]) val0 (Pairs.first v0)+ rs = recurse (Lists.concat2 path [+ Paths.SubtermStepPairSecond]) (Pairs.first rf) (Pairs.second v0)+ in (Pairs.first rs, (Model.TermPair (Pairs.second rf, (Pairs.second rs))))+ Model.TermProject v0 -> (val0, (Model.TermProject v0))+ Model.TermRecord v0 ->+ let rfields =+ forManyWithAccessors recurse (\x -> x) val0 (Lists.map (\f2 -> (Paths.SubtermStepRecordField (Model.fieldName f2), (Model.fieldTerm f2))) (Model.recordFields v0))+ in (+ Pairs.first rfields,+ (Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.recordTypeName v0),+ Model.recordFields = (Lists.map (\ft -> Model.Field {+ Model.fieldName = (Pairs.first ft),+ Model.fieldTerm = (Pairs.second ft)}) (Lists.zip (Lists.map Model.fieldName (Model.recordFields v0)) (Pairs.second rfields)))})))+ Model.TermSet v0 ->+ let idx = 0+ rr =+ Lists.foldl (\r -> \el ->+ let r2 = recurse (Lists.concat2 path [+ Paths.SubtermStepSetElement (Pairs.first r)]) (Pairs.first (Pairs.second r)) el+ in (Math.add (Pairs.first r) 1, (Pairs.first r2, (Lists.cons (Pairs.second r2) (Pairs.second (Pairs.second r)))))) (idx, (val0, [])) (Sets.toList v0)+ in (Pairs.first (Pairs.second rr), (Model.TermSet (Sets.fromList (Lists.reverse (Pairs.second (Pairs.second rr))))))+ Model.TermTypeApplication v0 -> forSingleWithAccessor recurse (\t -> Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = t,+ Model.typeApplicationTermType = (Model.typeApplicationTermType v0)})) Paths.SubtermStepTypeApplicationBody val0 (Model.typeApplicationTermBody v0)+ Model.TermTypeLambda v0 -> forSingleWithAccessor recurse (\t -> Model.TermTypeLambda (Model.TypeLambda {+ Model.typeLambdaParameter = (Model.typeLambdaParameter v0),+ Model.typeLambdaBody = t})) Paths.SubtermStepTypeLambdaBody val0 (Model.typeLambdaBody v0)+ Model.TermInject v0 -> forSingleWithAccessor recurse (\t -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.injectionTypeName v0),+ Model.injectionField = Model.Field {+ Model.fieldName = (Model.fieldName (Model.injectionField v0)),+ Model.fieldTerm = t}})) (Paths.SubtermStepInjectField (Model.fieldName (Model.injectionField v0))) val0 (Model.fieldTerm (Model.injectionField v0))+ Model.TermUnwrap v0 -> (val0, (Model.TermUnwrap v0))+ Model.TermWrap v0 -> forSingleWithAccessor recurse (\t -> Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.wrappedTermTypeName v0),+ Model.wrappedTermBody = t})) Paths.SubtermStepWrapBody val0 (Model.wrappedTermBody v0)+ _ -> dflt+ recurse = f (fsub recurse)+ in (recurse [] term0)++-- | Rewrite a term with a custom transformation function. The function receives a recursive walker and the current term and decides whether to recurse, replace, or both.+rewriteTerm :: ((Model.Term -> Model.Term) -> Model.Term -> Model.Term) -> Model.Term -> Model.Term+rewriteTerm f term0 =++ let fsub =+ \recurse -> \term ->+ let forField =+ \f2 -> Model.Field {+ Model.fieldName = (Model.fieldName f2),+ Model.fieldTerm = (recurse (Model.fieldTerm f2))}+ forCaseAlternative =+ \a -> Model.CaseAlternative {+ Model.caseAlternativeName = (Model.caseAlternativeName a),+ Model.caseAlternativeHandler = (recurse (Model.caseAlternativeHandler a))}+ forLet =+ \lt ->+ let mapBinding =+ \b -> Model.Binding {+ Model.bindingName = (Model.bindingName b),+ Model.bindingTerm = (recurse (Model.bindingTerm b)),+ Model.bindingTypeScheme = (Model.bindingTypeScheme b)}+ in Model.Let {+ Model.letBindings = (Lists.map mapBinding (Model.letBindings lt)),+ Model.letBody = (recurse (Model.letBody lt))}+ forMap =+ \m ->+ let forPair = \p -> (recurse (Pairs.first p), (recurse (Pairs.second p)))+ in (Maps.fromList (Lists.map forPair (Maps.toList m)))+ in case term of+ Model.TermAnnotated v0 -> Model.TermAnnotated (Model.AnnotatedTerm {+ Model.annotatedTermBody = (recurse (Model.annotatedTermBody v0)),+ Model.annotatedTermAnnotation = (Model.annotatedTermAnnotation v0)})+ Model.TermApplication v0 -> Model.TermApplication (Model.Application {+ Model.applicationFunction = (recurse (Model.applicationFunction v0)),+ Model.applicationArgument = (recurse (Model.applicationArgument v0))})+ Model.TermCases v0 -> Model.TermCases (Model.CaseStatement {+ Model.caseStatementTypeName = (Model.caseStatementTypeName v0),+ Model.caseStatementDefault = (Optionals.map recurse (Model.caseStatementDefault v0)),+ Model.caseStatementCases = (Lists.map forCaseAlternative (Model.caseStatementCases v0))})+ Model.TermEither v0 -> Model.TermEither (Eithers.either (\l -> Left (recurse l)) (\r -> Right (recurse r)) v0)+ Model.TermLambda v0 -> Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.lambdaParameter v0),+ Model.lambdaDomain = (Model.lambdaDomain v0),+ Model.lambdaBody = (recurse (Model.lambdaBody v0))})+ Model.TermLet v0 -> Model.TermLet (forLet v0)+ Model.TermList v0 -> Model.TermList (Lists.map recurse v0)+ Model.TermLiteral v0 -> Model.TermLiteral v0+ Model.TermMap v0 -> Model.TermMap (forMap v0)+ Model.TermOptional v0 -> Model.TermOptional (Optionals.map recurse v0)+ Model.TermPair v0 -> Model.TermPair (recurse (Pairs.first v0), (recurse (Pairs.second v0)))+ Model.TermProject v0 -> Model.TermProject v0+ Model.TermRecord v0 -> Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.recordTypeName v0),+ Model.recordFields = (Lists.map forField (Model.recordFields v0))})+ Model.TermSet v0 -> Model.TermSet (Sets.fromList (Lists.map recurse (Sets.toList v0)))+ Model.TermTypeApplication v0 -> Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (recurse (Model.typeApplicationTermBody v0)),+ Model.typeApplicationTermType = (Model.typeApplicationTermType v0)})+ Model.TermTypeLambda v0 -> Model.TermTypeLambda (Model.TypeLambda {+ Model.typeLambdaParameter = (Model.typeLambdaParameter v0),+ Model.typeLambdaBody = (recurse (Model.typeLambdaBody v0))})+ Model.TermInject v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.injectionTypeName v0),+ Model.injectionField = (forField (Model.injectionField v0))})+ Model.TermUnit -> Model.TermUnit+ Model.TermUnwrap v0 -> Model.TermUnwrap v0+ Model.TermVariable v0 -> Model.TermVariable v0+ Model.TermWrap v0 -> Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.wrappedTermTypeName v0),+ Model.wrappedTermBody = (recurse (Model.wrappedTermBody v0))})+ recurse = f (fsub recurse)+ in (recurse term0)++-- | Either-based term rewriting with custom transformation function+rewriteTermM :: ((Model.Term -> Either t0 Model.Term) -> Model.Term -> Either t0 Model.Term) -> Model.Term -> Either t0 Model.Term+rewriteTermM f term0 =++ let fsub =+ \recurse -> \term ->+ let forField =+ \field -> Eithers.bind (recurse (Model.fieldTerm field)) (\t -> Right (Model.Field {+ Model.fieldName = (Model.fieldName field),+ Model.fieldTerm = t}))+ forCaseAlternative =+ \alt -> Eithers.bind (recurse (Model.caseAlternativeHandler alt)) (\t -> Right (Model.CaseAlternative {+ Model.caseAlternativeName = (Model.caseAlternativeName alt),+ Model.caseAlternativeHandler = t}))+ forPair =+ \kv -> Eithers.bind (recurse (Pairs.first kv)) (\k -> Eithers.bind (recurse (Pairs.second kv)) (\v -> Right (k, v)))+ mapBinding =+ \b -> Eithers.bind (recurse (Model.bindingTerm b)) (\v -> Right (Model.Binding {+ Model.bindingName = (Model.bindingName b),+ Model.bindingTerm = v,+ Model.bindingTypeScheme = (Model.bindingTypeScheme b)}))+ in case term of+ Model.TermAnnotated v0 -> Eithers.bind (recurse (Model.annotatedTermBody v0)) (\ex -> Right (Model.TermAnnotated (Model.AnnotatedTerm {+ Model.annotatedTermBody = ex,+ Model.annotatedTermAnnotation = (Model.annotatedTermAnnotation v0)})))+ Model.TermApplication v0 -> Eithers.bind (recurse (Model.applicationFunction v0)) (\lhs -> Eithers.bind (recurse (Model.applicationArgument v0)) (\rhs -> Right (Model.TermApplication (Model.Application {+ Model.applicationFunction = lhs,+ Model.applicationArgument = rhs}))))+ Model.TermCases v0 ->+ let n = Model.caseStatementTypeName v0+ def = Model.caseStatementDefault v0+ csCases = Model.caseStatementCases v0+ in (Eithers.bind (Optionals.match def (Right Nothing) (\t -> Eithers.map Optionals.given (recurse t))) (\rdef -> Eithers.map (\rcases -> Model.TermCases (Model.CaseStatement {+ Model.caseStatementTypeName = n,+ Model.caseStatementDefault = rdef,+ Model.caseStatementCases = rcases})) (Eithers.mapList forCaseAlternative csCases)))+ Model.TermEither v0 -> Eithers.bind (Eithers.either (\l -> Eithers.map (\x -> Left x) (recurse l)) (\r -> Eithers.map (\x -> Right x) (recurse r)) v0) (\re -> Right (Model.TermEither re))+ Model.TermLambda v0 ->+ let v = Model.lambdaParameter v0+ d = Model.lambdaDomain v0+ body = Model.lambdaBody v0+ in (Eithers.bind (recurse body) (\rbody -> Right (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = v,+ Model.lambdaDomain = d,+ Model.lambdaBody = rbody}))))+ Model.TermLet v0 ->+ let bindings = Model.letBindings v0+ env = Model.letBody v0+ in (Eithers.bind (Eithers.mapList mapBinding bindings) (\rbindings -> Eithers.bind (recurse env) (\renv -> Right (Model.TermLet (Model.Let {+ Model.letBindings = rbindings,+ Model.letBody = renv})))))+ Model.TermList v0 -> Eithers.bind (Eithers.mapList recurse v0) (\rels -> Right (Model.TermList rels))+ Model.TermLiteral v0 -> Right (Model.TermLiteral v0)+ Model.TermMap v0 -> Eithers.bind (Eithers.mapList forPair (Maps.toList v0)) (\pairs -> Right (Model.TermMap (Maps.fromList pairs)))+ Model.TermOptional v0 -> Eithers.bind (Eithers.mapOptional recurse v0) (\rm -> Right (Model.TermOptional rm))+ Model.TermPair v0 -> Eithers.bind (recurse (Pairs.first v0)) (\rf -> Eithers.bind (recurse (Pairs.second v0)) (\rs -> Right (Model.TermPair (rf, rs))))+ Model.TermProject v0 -> Right (Model.TermProject v0)+ Model.TermRecord v0 ->+ let n = Model.recordTypeName v0+ fields = Model.recordFields v0+ in (Eithers.map (\rfields -> Model.TermRecord (Model.Record {+ Model.recordTypeName = n,+ Model.recordFields = rfields})) (Eithers.mapList forField fields))+ Model.TermSet v0 -> Eithers.bind (Eithers.mapList recurse (Sets.toList v0)) (\rlist -> Right (Model.TermSet (Sets.fromList rlist)))+ Model.TermTypeApplication v0 -> Eithers.bind (recurse (Model.typeApplicationTermBody v0)) (\t -> Right (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = t,+ Model.typeApplicationTermType = (Model.typeApplicationTermType v0)})))+ Model.TermTypeLambda v0 ->+ let v = Model.typeLambdaParameter v0+ body = Model.typeLambdaBody v0+ in (Eithers.bind (recurse body) (\rbody -> Right (Model.TermTypeLambda (Model.TypeLambda {+ Model.typeLambdaParameter = v,+ Model.typeLambdaBody = rbody}))))+ Model.TermInject v0 ->+ let n = Model.injectionTypeName v0+ field = Model.injectionField v0+ in (Eithers.map (\rfield -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = n,+ Model.injectionField = rfield})) (forField field))+ Model.TermUnit -> Right Model.TermUnit+ Model.TermUnwrap v0 -> Right (Model.TermUnwrap v0)+ Model.TermVariable v0 -> Right (Model.TermVariable v0)+ Model.TermWrap v0 ->+ let name = Model.wrappedTermTypeName v0+ t = Model.wrappedTermBody v0+ in (Eithers.bind (recurse t) (\rt -> Right (Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = name,+ Model.wrappedTermBody = rt}))))+ recurse = f (fsub recurse)+ in (recurse term0)++-- | A variant of rewriteTerm which allows a context (e.g. a TypeContext) to be passed down to all subterms during rewriting+rewriteTermWithContext :: ((t0 -> Model.Term -> Model.Term) -> t0 -> Model.Term -> Model.Term) -> t0 -> Model.Term -> Model.Term+rewriteTermWithContext f cx0 term0 =++ let forSubterms =+ \recurse0 -> \cx -> \term ->+ let recurse = recurse0 cx+ forField =+ \field -> Model.Field {+ Model.fieldName = (Model.fieldName field),+ Model.fieldTerm = (recurse (Model.fieldTerm field))}+ forCaseAlternative =+ \alt -> Model.CaseAlternative {+ Model.caseAlternativeName = (Model.caseAlternativeName alt),+ Model.caseAlternativeHandler = (recurse (Model.caseAlternativeHandler alt))}+ forLet =+ \lt ->+ let mapBinding =+ \b -> Model.Binding {+ Model.bindingName = (Model.bindingName b),+ Model.bindingTerm = (recurse (Model.bindingTerm b)),+ Model.bindingTypeScheme = (Model.bindingTypeScheme b)}+ in Model.Let {+ Model.letBindings = (Lists.map mapBinding (Model.letBindings lt)),+ Model.letBody = (recurse (Model.letBody lt))}+ forMap =+ \m ->+ let forPair = \p -> (recurse (Pairs.first p), (recurse (Pairs.second p)))+ in (Maps.fromList (Lists.map forPair (Maps.toList m)))+ in case term of+ Model.TermAnnotated v0 -> Model.TermAnnotated (Model.AnnotatedTerm {+ Model.annotatedTermBody = (recurse (Model.annotatedTermBody v0)),+ Model.annotatedTermAnnotation = (Model.annotatedTermAnnotation v0)})+ Model.TermApplication v0 -> Model.TermApplication (Model.Application {+ Model.applicationFunction = (recurse (Model.applicationFunction v0)),+ Model.applicationArgument = (recurse (Model.applicationArgument v0))})+ Model.TermCases v0 -> Model.TermCases (Model.CaseStatement {+ Model.caseStatementTypeName = (Model.caseStatementTypeName v0),+ Model.caseStatementDefault = (Optionals.map recurse (Model.caseStatementDefault v0)),+ Model.caseStatementCases = (Lists.map forCaseAlternative (Model.caseStatementCases v0))})+ Model.TermEither v0 -> Model.TermEither (Eithers.either (\l -> Left (recurse l)) (\r -> Right (recurse r)) v0)+ Model.TermLambda v0 -> Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.lambdaParameter v0),+ Model.lambdaDomain = (Model.lambdaDomain v0),+ Model.lambdaBody = (recurse (Model.lambdaBody v0))})+ Model.TermLet v0 -> Model.TermLet (forLet v0)+ Model.TermList v0 -> Model.TermList (Lists.map recurse v0)+ Model.TermLiteral v0 -> Model.TermLiteral v0+ Model.TermMap v0 -> Model.TermMap (forMap v0)+ Model.TermOptional v0 -> Model.TermOptional (Optionals.map recurse v0)+ Model.TermPair v0 -> Model.TermPair (recurse (Pairs.first v0), (recurse (Pairs.second v0)))+ Model.TermProject v0 -> Model.TermProject v0+ Model.TermRecord v0 -> Model.TermRecord (Model.Record {+ Model.recordTypeName = (Model.recordTypeName v0),+ Model.recordFields = (Lists.map forField (Model.recordFields v0))})+ Model.TermSet v0 -> Model.TermSet (Sets.fromList (Lists.map recurse (Sets.toList v0)))+ Model.TermTypeApplication v0 -> Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (recurse (Model.typeApplicationTermBody v0)),+ Model.typeApplicationTermType = (Model.typeApplicationTermType v0)})+ Model.TermTypeLambda v0 -> Model.TermTypeLambda (Model.TypeLambda {+ Model.typeLambdaParameter = (Model.typeLambdaParameter v0),+ Model.typeLambdaBody = (recurse (Model.typeLambdaBody v0))})+ Model.TermInject v0 -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.injectionTypeName v0),+ Model.injectionField = (forField (Model.injectionField v0))})+ Model.TermUnit -> Model.TermUnit+ Model.TermUnwrap v0 -> Model.TermUnwrap v0+ Model.TermVariable v0 -> Model.TermVariable v0+ Model.TermWrap v0 -> Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = (Model.wrappedTermTypeName v0),+ Model.wrappedTermBody = (recurse (Model.wrappedTermBody v0))})+ rewrite = \cx -> \term -> f (forSubterms rewrite) cx term+ in (rewrite cx0 term0)++-- | Either-based variant of rewriteTermWithContextM which allows a context (e.g. a TypeContext) to be passed down to all subterms during rewriting+rewriteTermWithContextM :: ((t0 -> Model.Term -> Either t1 Model.Term) -> t0 -> Model.Term -> Either t1 Model.Term) -> t0 -> Model.Term -> Either t1 Model.Term+rewriteTermWithContextM f cx0 term0 =++ let forSubterms =+ \recurse0 -> \cx -> \term ->+ let recurse = recurse0 cx+ forField =+ \field -> Eithers.bind (recurse (Model.fieldTerm field)) (\t -> Right (Model.Field {+ Model.fieldName = (Model.fieldName field),+ Model.fieldTerm = t}))+ forCaseAlternative =+ \alt -> Eithers.bind (recurse (Model.caseAlternativeHandler alt)) (\t -> Right (Model.CaseAlternative {+ Model.caseAlternativeName = (Model.caseAlternativeName alt),+ Model.caseAlternativeHandler = t}))+ forPair =+ \kv -> Eithers.bind (recurse (Pairs.first kv)) (\k -> Eithers.bind (recurse (Pairs.second kv)) (\v -> Right (k, v)))+ mapBinding =+ \b -> Eithers.bind (recurse (Model.bindingTerm b)) (\v -> Right (Model.Binding {+ Model.bindingName = (Model.bindingName b),+ Model.bindingTerm = v,+ Model.bindingTypeScheme = (Model.bindingTypeScheme b)}))+ in case term of+ Model.TermAnnotated v0 -> Eithers.bind (recurse (Model.annotatedTermBody v0)) (\ex -> Right (Model.TermAnnotated (Model.AnnotatedTerm {+ Model.annotatedTermBody = ex,+ Model.annotatedTermAnnotation = (Model.annotatedTermAnnotation v0)})))+ Model.TermApplication v0 -> Eithers.bind (recurse (Model.applicationFunction v0)) (\lhs -> Eithers.bind (recurse (Model.applicationArgument v0)) (\rhs -> Right (Model.TermApplication (Model.Application {+ Model.applicationFunction = lhs,+ Model.applicationArgument = rhs}))))+ Model.TermCases v0 ->+ let n = Model.caseStatementTypeName v0+ def = Model.caseStatementDefault v0+ csCases = Model.caseStatementCases v0+ in (Eithers.bind (Optionals.match def (Right Nothing) (\t -> Eithers.map Optionals.given (recurse t))) (\rdef -> Eithers.map (\rcases -> Model.TermCases (Model.CaseStatement {+ Model.caseStatementTypeName = n,+ Model.caseStatementDefault = rdef,+ Model.caseStatementCases = rcases})) (Eithers.mapList forCaseAlternative csCases)))+ Model.TermEither v0 -> Eithers.bind (Eithers.either (\l -> Eithers.map (\x -> Left x) (recurse l)) (\r -> Eithers.map (\x -> Right x) (recurse r)) v0) (\re -> Right (Model.TermEither re))+ Model.TermLambda v0 ->+ let v = Model.lambdaParameter v0+ d = Model.lambdaDomain v0+ body = Model.lambdaBody v0+ in (Eithers.bind (recurse body) (\rbody -> Right (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = v,+ Model.lambdaDomain = d,+ Model.lambdaBody = rbody}))))+ Model.TermLet v0 ->+ let bindings = Model.letBindings v0+ body = Model.letBody v0+ in (Eithers.bind (Eithers.mapList mapBinding bindings) (\rbindings -> Eithers.bind (recurse body) (\rbody -> Right (Model.TermLet (Model.Let {+ Model.letBindings = rbindings,+ Model.letBody = rbody})))))+ Model.TermList v0 -> Eithers.bind (Eithers.mapList recurse v0) (\rels -> Right (Model.TermList rels))+ Model.TermLiteral v0 -> Right (Model.TermLiteral v0)+ Model.TermMap v0 -> Eithers.bind (Eithers.mapList forPair (Maps.toList v0)) (\pairs -> Right (Model.TermMap (Maps.fromList pairs)))+ Model.TermOptional v0 -> Eithers.bind (Eithers.mapOptional recurse v0) (\rm -> Right (Model.TermOptional rm))+ Model.TermPair v0 -> Eithers.bind (recurse (Pairs.first v0)) (\rfirst -> Eithers.bind (recurse (Pairs.second v0)) (\rsecond -> Right (Model.TermPair (rfirst, rsecond))))+ Model.TermProject v0 -> Right (Model.TermProject v0)+ Model.TermRecord v0 ->+ let n = Model.recordTypeName v0+ fields = Model.recordFields v0+ in (Eithers.map (\rfields -> Model.TermRecord (Model.Record {+ Model.recordTypeName = n,+ Model.recordFields = rfields})) (Eithers.mapList forField fields))+ Model.TermSet v0 -> Eithers.bind (Eithers.mapList recurse (Sets.toList v0)) (\rlist -> Right (Model.TermSet (Sets.fromList rlist)))+ Model.TermTypeApplication v0 -> Eithers.bind (recurse (Model.typeApplicationTermBody v0)) (\t -> Right (Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = t,+ Model.typeApplicationTermType = (Model.typeApplicationTermType v0)})))+ Model.TermTypeLambda v0 ->+ let v = Model.typeLambdaParameter v0+ body = Model.typeLambdaBody v0+ in (Eithers.bind (recurse body) (\rbody -> Right (Model.TermTypeLambda (Model.TypeLambda {+ Model.typeLambdaParameter = v,+ Model.typeLambdaBody = rbody}))))+ Model.TermInject v0 ->+ let n = Model.injectionTypeName v0+ field = Model.injectionField v0+ in (Eithers.map (\rfield -> Model.TermInject (Model.Injection {+ Model.injectionTypeName = n,+ Model.injectionField = rfield})) (forField field))+ Model.TermUnit -> Right Model.TermUnit+ Model.TermUnwrap v0 -> Right (Model.TermUnwrap v0)+ Model.TermVariable v0 -> Right (Model.TermVariable v0)+ Model.TermWrap v0 ->+ let name = Model.wrappedTermTypeName v0+ t = Model.wrappedTermBody v0+ in (Eithers.bind (recurse t) (\rt -> Right (Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = name,+ Model.wrappedTermBody = rt}))))+ rewrite = \cx -> \term -> f (forSubterms rewrite) cx term+ in (rewrite cx0 term0)++-- | Rewrite a term with the help of a Graph which is updated as we descend into subterms+rewriteTermWithGraph :: ((Model.Term -> t0) -> Graph.Graph -> Model.Term -> t0) -> Graph.Graph -> Model.Term -> t0+rewriteTermWithGraph f cx0 term0 =++ let f2 =+ \recurse -> \cx -> \term ->+ let recurse1 = \term2 -> recurse cx term2+ in case term of+ Model.TermLambda v0 ->+ let cx1 = Scoping.extendGraphForLambda cx v0+ recurse2 = \term2 -> recurse cx1 term2+ in (f recurse2 cx1 term)+ Model.TermLet v0 ->+ let cx1 = Scoping.extendGraphForLet (\_ -> \_2 -> Nothing) cx v0+ recurse2 = \term2 -> recurse cx1 term2+ in (f recurse2 cx1 term)+ Model.TermTypeLambda v0 ->+ let cx1 = Scoping.extendGraphForTypeLambda cx v0+ recurse2 = \term2 -> recurse cx1 term2+ in (f recurse2 cx1 term)+ _ -> f recurse1 cx term+ rewrite = \cx -> \term -> f2 rewrite cx term+ in (rewrite cx0 term0)++-- | Rewrite a type with a custom transformation function. The function receives a recursive walker and the current type and decides whether to recurse, replace, or both.+rewriteType :: ((Model.Type -> Model.Type) -> Model.Type -> Model.Type) -> Model.Type -> Model.Type+rewriteType f typ0 =++ let fsub =+ \recurse -> \typ ->+ let forField =+ \field -> Model.FieldType {+ Model.fieldTypeName = (Model.fieldTypeName field),+ Model.fieldTypeType = (recurse (Model.fieldTypeType field))}+ in case typ of+ Model.TypeAnnotated v0 -> Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = (recurse (Model.annotatedTypeBody v0)),+ Model.annotatedTypeAnnotation = (Model.annotatedTypeAnnotation v0)})+ Model.TypeApplication v0 -> Model.TypeApplication (Model.ApplicationType {+ Model.applicationTypeFunction = (recurse (Model.applicationTypeFunction v0)),+ Model.applicationTypeArgument = (recurse (Model.applicationTypeArgument v0))})+ Model.TypeEffect v0 -> Model.TypeEffect (recurse v0)+ Model.TypeEither v0 -> Model.TypeEither (Model.EitherType {+ Model.eitherTypeLeft = (recurse (Model.eitherTypeLeft v0)),+ Model.eitherTypeRight = (recurse (Model.eitherTypeRight v0))})+ Model.TypePair v0 -> Model.TypePair (Model.PairType {+ Model.pairTypeFirst = (recurse (Model.pairTypeFirst v0)),+ Model.pairTypeSecond = (recurse (Model.pairTypeSecond v0))})+ Model.TypeFunction v0 -> Model.TypeFunction (Model.FunctionType {+ Model.functionTypeDomain = (recurse (Model.functionTypeDomain v0)),+ Model.functionTypeCodomain = (recurse (Model.functionTypeCodomain v0))})+ Model.TypeForall v0 -> Model.TypeForall (Model.ForallType {+ Model.forallTypeParameter = (Model.forallTypeParameter v0),+ Model.forallTypeBody = (recurse (Model.forallTypeBody v0))})+ Model.TypeList v0 -> Model.TypeList (recurse v0)+ Model.TypeLiteral v0 -> Model.TypeLiteral v0+ Model.TypeMap v0 -> Model.TypeMap (Model.MapType {+ Model.mapTypeKeys = (recurse (Model.mapTypeKeys v0)),+ Model.mapTypeValues = (recurse (Model.mapTypeValues v0))})+ Model.TypeOptional v0 -> Model.TypeOptional (recurse v0)+ Model.TypeRecord v0 -> Model.TypeRecord (Lists.map forField v0)+ Model.TypeSet v0 -> Model.TypeSet (recurse v0)+ Model.TypeUnion v0 -> Model.TypeUnion (Lists.map forField v0)+ Model.TypeUnit -> Model.TypeUnit+ Model.TypeVariable v0 -> Model.TypeVariable v0+ Model.TypeVoid -> Model.TypeVoid+ Model.TypeWrap v0 -> Model.TypeWrap (recurse v0)+ recurse = f (fsub recurse)+ in (recurse typ0)++-- | Either-based type rewriting+rewriteTypeM :: ((Model.Type -> Either t0 Model.Type) -> Model.Type -> Either t0 Model.Type) -> Model.Type -> Either t0 Model.Type+rewriteTypeM f typ0 =++ let fsub =+ \recurse -> \typ -> case typ of+ Model.TypeAnnotated v0 -> Eithers.bind (recurse (Model.annotatedTypeBody v0)) (\t -> Right (Model.TypeAnnotated (Model.AnnotatedType {+ Model.annotatedTypeBody = t,+ Model.annotatedTypeAnnotation = (Model.annotatedTypeAnnotation v0)})))+ Model.TypeApplication v0 -> Eithers.bind (recurse (Model.applicationTypeFunction v0)) (\lhs -> Eithers.bind (recurse (Model.applicationTypeArgument v0)) (\rhs -> Right (Model.TypeApplication (Model.ApplicationType {+ Model.applicationTypeFunction = lhs,+ Model.applicationTypeArgument = rhs}))))+ Model.TypeEffect v0 -> Eithers.bind (recurse v0) (\rt -> Right (Model.TypeEffect rt))+ Model.TypeEither v0 -> Eithers.bind (recurse (Model.eitherTypeLeft v0)) (\left -> Eithers.bind (recurse (Model.eitherTypeRight v0)) (\right -> Right (Model.TypeEither (Model.EitherType {+ Model.eitherTypeLeft = left,+ Model.eitherTypeRight = right}))))+ Model.TypePair v0 -> Eithers.bind (recurse (Model.pairTypeFirst v0)) (\pairFirst -> Eithers.bind (recurse (Model.pairTypeSecond v0)) (\pairSecond -> Right (Model.TypePair (Model.PairType {+ Model.pairTypeFirst = pairFirst,+ Model.pairTypeSecond = pairSecond}))))+ Model.TypeFunction v0 -> Eithers.bind (recurse (Model.functionTypeDomain v0)) (\dom -> Eithers.bind (recurse (Model.functionTypeCodomain v0)) (\cod -> Right (Model.TypeFunction (Model.FunctionType {+ Model.functionTypeDomain = dom,+ Model.functionTypeCodomain = cod}))))+ Model.TypeForall v0 -> Eithers.bind (recurse (Model.forallTypeBody v0)) (\b -> Right (Model.TypeForall (Model.ForallType {+ Model.forallTypeParameter = (Model.forallTypeParameter v0),+ Model.forallTypeBody = b})))+ Model.TypeList v0 -> Eithers.bind (recurse v0) (\rt -> Right (Model.TypeList rt))+ Model.TypeLiteral v0 -> Right (Model.TypeLiteral v0)+ Model.TypeMap v0 -> Eithers.bind (recurse (Model.mapTypeKeys v0)) (\kt -> Eithers.bind (recurse (Model.mapTypeValues v0)) (\vt -> Right (Model.TypeMap (Model.MapType {+ Model.mapTypeKeys = kt,+ Model.mapTypeValues = vt}))))+ Model.TypeOptional v0 -> Eithers.bind (recurse v0) (\rt -> Right (Model.TypeOptional rt))+ Model.TypeRecord v0 ->+ let forField =+ \f2 -> Eithers.bind (recurse (Model.fieldTypeType f2)) (\t -> Right (Model.FieldType {+ Model.fieldTypeName = (Model.fieldTypeName f2),+ Model.fieldTypeType = t}))+ in (Eithers.bind (Eithers.mapList forField v0) (\rfields -> Right (Model.TypeRecord rfields)))+ Model.TypeSet v0 -> Eithers.bind (recurse v0) (\rt -> Right (Model.TypeSet rt))+ Model.TypeUnion v0 ->+ let forField =+ \f2 -> Eithers.bind (recurse (Model.fieldTypeType f2)) (\t -> Right (Model.FieldType {+ Model.fieldTypeName = (Model.fieldTypeName f2),+ Model.fieldTypeType = t}))+ in (Eithers.bind (Eithers.mapList forField v0) (\rfields -> Right (Model.TypeUnion rfields)))+ Model.TypeUnit -> Right Model.TypeUnit+ Model.TypeVariable v0 -> Right (Model.TypeVariable v0)+ Model.TypeVoid -> Right Model.TypeVoid+ Model.TypeWrap v0 -> Eithers.bind (recurse v0) (\t -> Right (Model.TypeWrap t))+ recurse = f (fsub recurse)+ in (recurse typ0)++-- | Find the children of a given term+subterms :: Model.Term -> [Model.Term]+subterms x =+ case x of+ Model.TermAnnotated v0 -> [+ Model.annotatedTermBody v0]+ Model.TermApplication v0 -> [+ Model.applicationFunction v0,+ (Model.applicationArgument v0)]+ Model.TermCases v0 -> Lists.concat2 (Optionals.match (Model.caseStatementDefault v0) [] (\t -> [+ t])) (Lists.map Model.caseAlternativeHandler (Model.caseStatementCases v0))+ Model.TermEither v0 -> Eithers.either (\l -> [+ l]) (\r -> [+ r]) v0+ Model.TermLambda v0 -> [+ Model.lambdaBody v0]+ Model.TermLet v0 -> Lists.cons (Model.letBody v0) (Lists.map Model.bindingTerm (Model.letBindings v0))+ Model.TermList v0 -> v0+ Model.TermLiteral _ -> []+ Model.TermMap v0 -> Lists.concat (Lists.map (\p -> [+ Pairs.first p,+ (Pairs.second p)]) (Maps.toList v0))+ Model.TermOptional v0 -> Optionals.match v0 [] (\t -> [+ t])+ Model.TermPair v0 -> [+ Pairs.first v0,+ (Pairs.second v0)]+ Model.TermProject _ -> []+ Model.TermRecord v0 -> Lists.map Model.fieldTerm (Model.recordFields v0)+ Model.TermSet v0 -> Sets.toList v0+ Model.TermTypeApplication v0 -> [+ Model.typeApplicationTermBody v0]+ Model.TermTypeLambda v0 -> [+ Model.typeLambdaBody v0]+ Model.TermInject v0 -> [+ Model.fieldTerm (Model.injectionField v0)]+ Model.TermUnit -> []+ Model.TermUnwrap _ -> []+ Model.TermVariable _ -> []+ Model.TermWrap v0 -> [+ Model.wrappedTermBody v0]++-- | Find the children of a given term+subtermsWithSteps :: Model.Term -> [(Paths.SubtermStep, Model.Term)]+subtermsWithSteps x =+ case x of+ Model.TermAnnotated v0 -> [+ (Paths.SubtermStepAnnotatedBody, (Model.annotatedTermBody v0))]+ Model.TermApplication v0 -> [+ (Paths.SubtermStepApplicationFunction, (Model.applicationFunction v0)),+ (Paths.SubtermStepApplicationArgument, (Model.applicationArgument v0))]+ Model.TermCases v0 -> Lists.concat2 (Optionals.match (Model.caseStatementDefault v0) [] (\t -> [+ (Paths.SubtermStepCasesDefault, t)])) (Lists.map (\f -> (Paths.SubtermStepCasesCase (Model.caseAlternativeName f), (Model.caseAlternativeHandler f))) (Model.caseStatementCases v0))+ Model.TermEither v0 -> Eithers.either (\l -> [+ (Paths.SubtermStepEitherLeft, l)]) (\r -> [+ (Paths.SubtermStepEitherRight, r)]) v0+ Model.TermLambda v0 -> [+ (Paths.SubtermStepLambdaBody, (Model.lambdaBody v0))]+ Model.TermLet v0 -> Lists.cons (Paths.SubtermStepLetBody, (Model.letBody v0)) (Lists.map (\b -> (Paths.SubtermStepLetBinding (Model.bindingName b), (Model.bindingTerm b))) (Model.letBindings v0))+ Model.TermList v0 -> Lists.map (\ip -> (Paths.SubtermStepListElement (Pairs.first ip), (Pairs.second ip))) (Lists.reverse (Pairs.second (Lists.foldl (\r -> \el ->+ let idx = Pairs.first r+ in (Math.add idx 1, (Lists.cons (idx, el) (Pairs.second r)))) (0, []) v0)))+ Model.TermLiteral _ -> []+ Model.TermMap v0 -> Lists.map (\ip -> (Paths.SubtermStepMapEntry (Pairs.first ip), (Model.TermPair (Pairs.first (Pairs.second ip), (Pairs.second (Pairs.second ip)))))) (Lists.reverse (Pairs.second (Lists.foldl (\r -> \el ->+ let idx = Pairs.first r+ in (Math.add idx 1, (Lists.cons (idx, el) (Pairs.second r)))) (0, []) (Maps.toList v0))))+ Model.TermOptional v0 -> Optionals.match v0 [] (\t -> [+ (Paths.SubtermStepOptionalGiven, t)])+ Model.TermPair v0 -> [+ (Paths.SubtermStepPairFirst, (Pairs.first v0)),+ (Paths.SubtermStepPairSecond, (Pairs.second v0))]+ Model.TermProject _ -> []+ Model.TermRecord v0 -> Lists.map (\f -> (Paths.SubtermStepRecordField (Model.fieldName f), (Model.fieldTerm f))) (Model.recordFields v0)+ Model.TermSet v0 -> Lists.map (\ip -> (Paths.SubtermStepSetElement (Pairs.first ip), (Pairs.second ip))) (Lists.reverse (Pairs.second (Lists.foldl (\r -> \el ->+ let idx = Pairs.first r+ in (Math.add idx 1, (Lists.cons (idx, el) (Pairs.second r)))) (0, []) (Sets.toList v0))))+ Model.TermTypeApplication v0 -> [+ (Paths.SubtermStepTypeApplicationBody, (Model.typeApplicationTermBody v0))]+ Model.TermTypeLambda v0 -> [+ (Paths.SubtermStepTypeLambdaBody, (Model.typeLambdaBody v0))]+ Model.TermInject v0 -> [+ (Paths.SubtermStepInjectField (Model.fieldName (Model.injectionField v0)), (Model.fieldTerm (Model.injectionField v0)))]+ Model.TermUnit -> []+ Model.TermUnwrap _ -> []+ Model.TermVariable _ -> []+ Model.TermWrap v0 -> [+ (Paths.SubtermStepWrapBody, (Model.wrappedTermBody v0))]++-- | Find the children of a given type expression+subtypes :: Model.Type -> [Model.Type]+subtypes x =+ case x of+ Model.TypeAnnotated v0 -> [+ Model.annotatedTypeBody v0]+ Model.TypeApplication v0 -> [+ Model.applicationTypeFunction v0,+ (Model.applicationTypeArgument v0)]+ Model.TypeEffect v0 -> [+ v0]+ Model.TypeEither v0 -> [+ Model.eitherTypeLeft v0,+ (Model.eitherTypeRight v0)]+ Model.TypePair v0 -> [+ Model.pairTypeFirst v0,+ (Model.pairTypeSecond v0)]+ Model.TypeFunction v0 -> [+ Model.functionTypeDomain v0,+ (Model.functionTypeCodomain v0)]+ Model.TypeForall v0 -> [+ Model.forallTypeBody v0]+ Model.TypeList v0 -> [+ v0]+ Model.TypeLiteral _ -> []+ Model.TypeMap v0 -> [+ Model.mapTypeKeys v0,+ (Model.mapTypeValues v0)]+ Model.TypeOptional v0 -> [+ v0]+ Model.TypeRecord v0 -> Lists.map Model.fieldTypeType v0+ Model.TypeSet v0 -> [+ v0]+ Model.TypeUnion v0 -> Lists.map Model.fieldTypeType v0+ Model.TypeUnit -> []+ Model.TypeVariable _ -> []+ Model.TypeVoid -> []+ Model.TypeWrap v0 -> [+ v0]++-- | Find the children of a given type expression, each paired with the step by which it is reached+subtypesWithSteps :: Model.Type -> [(Paths.SubtypeStep, Model.Type)]+subtypesWithSteps x =+ case x of+ Model.TypeAnnotated v0 -> [+ (Paths.SubtypeStepAnnotatedBody, (Model.annotatedTypeBody v0))]+ Model.TypeApplication v0 -> [+ (Paths.SubtypeStepApplicationFunction, (Model.applicationTypeFunction v0)),+ (Paths.SubtypeStepApplicationArgument, (Model.applicationTypeArgument v0))]+ Model.TypeEffect v0 -> [+ (Paths.SubtypeStepEffectValue, v0)]+ Model.TypeEither v0 -> [+ (Paths.SubtypeStepEitherLeft, (Model.eitherTypeLeft v0)),+ (Paths.SubtypeStepEitherRight, (Model.eitherTypeRight v0))]+ Model.TypeForall v0 -> [+ (Paths.SubtypeStepForallBody, (Model.forallTypeBody v0))]+ Model.TypeFunction v0 -> [+ (Paths.SubtypeStepFunctionDomain, (Model.functionTypeDomain v0)),+ (Paths.SubtypeStepFunctionCodomain, (Model.functionTypeCodomain v0))]+ Model.TypeList v0 -> [+ (Paths.SubtypeStepListElement, v0)]+ Model.TypeLiteral _ -> []+ Model.TypeMap v0 -> [+ (Paths.SubtypeStepMapKeys, (Model.mapTypeKeys v0)),+ (Paths.SubtypeStepMapValues, (Model.mapTypeValues v0))]+ Model.TypeOptional v0 -> [+ (Paths.SubtypeStepOptionalElement, v0)]+ Model.TypePair v0 -> [+ (Paths.SubtypeStepPairFirst, (Model.pairTypeFirst v0)),+ (Paths.SubtypeStepPairSecond, (Model.pairTypeSecond v0))]+ Model.TypeRecord v0 -> Lists.map (\f -> (Paths.SubtypeStepRecordField (Model.fieldTypeName f), (Model.fieldTypeType f))) v0+ Model.TypeSet v0 -> [+ (Paths.SubtypeStepSetElement, v0)]+ Model.TypeUnion v0 -> Lists.map (\f -> (Paths.SubtypeStepUnionField (Model.fieldTypeName f), (Model.fieldTypeType f))) v0+ Model.TypeUnit -> []+ Model.TypeVariable _ -> []+ Model.TypeVoid -> []+ Model.TypeWrap v0 -> [+ (Paths.SubtypeStepWrapBody, v0)]++-- | Convert a wrapped (newtype) term to an equivalent single-field record term, for target languages without a newtype concept+wrapTermToRecord :: Model.Name -> Model.Term -> Model.Term+wrapTermToRecord tname body =+ Model.TermRecord (Model.Record {+ Model.recordTypeName = tname,+ Model.recordFields = [+ Model.Field {+ Model.fieldName = (Model.Name Constants.fieldNameValue),+ Model.fieldTerm = body}]})++-- | Convert a wrapped (newtype) type to an equivalent single-field record type, for target languages without a newtype concept+wrapTypeToRecord :: Model.Type -> Model.Type+wrapTypeToRecord t =+ Model.TypeRecord [+ Model.FieldType {+ Model.fieldTypeName = (Model.Name Constants.fieldNameValue),+ Model.fieldTypeType = t}]
@@ -0,0 +1,212 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Graph context extension and type scheme conversion++module Hydra.Core.Scoping where++import qualified Hydra.Core.Ast as Ast+import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Diff as Diff+import qualified Hydra.Core.Docs as Docs+import qualified Hydra.Core.Error.Checking as Checking+import qualified Hydra.Core.Error.File as ErrorFile+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Error.Packaging as ErrorPackaging+import qualified Hydra.Core.Error.System as ErrorSystem+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Json.Model as JsonModel+import qualified Hydra.Core.Overlay.Haskell.Lib.Lists as Lists+import qualified Hydra.Core.Overlay.Haskell.Lib.Literals as Literals+import qualified Hydra.Core.Overlay.Haskell.Lib.Maps as Maps+import qualified Hydra.Core.Overlay.Haskell.Lib.Math as Math+import qualified Hydra.Core.Overlay.Haskell.Lib.Optionals as Optionals+import qualified Hydra.Core.Overlay.Haskell.Lib.Pairs as Pairs+import qualified Hydra.Core.Overlay.Haskell.Lib.Sets as Sets+import qualified Hydra.Core.Overlay.Haskell.Lib.Strings as Strings+import qualified Hydra.Core.Markdown as Markdown+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Parsing as Parsing+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Query as Query+import qualified Hydra.Core.Regex as Regex+import qualified Hydra.Core.Relational as Relational+import qualified Hydra.Core.System as System+import qualified Hydra.Core.Tabular as Tabular+import qualified Hydra.Core.Testing as Testing+import qualified Hydra.Core.Time as Time+import qualified Hydra.Core.Topology as Topology+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Validation as Validation+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | Extend a graph by descending into a lambda body+extendGraphForLambda :: Graph.Graph -> Model.Lambda -> Graph.Graph+extendGraphForLambda g lam =++ let var = Model.lambdaParameter lam+ in Graph.Graph {+ Graph.graphBoundTerms = (Graph.graphBoundTerms g),+ Graph.graphBoundTypes = (Optionals.match (Model.lambdaDomain lam) (Graph.graphBoundTypes g) (\dom -> Maps.insert var (fTypeToTypeScheme dom) (Graph.graphBoundTypes g))),+ Graph.graphClassConstraints = (Graph.graphClassConstraints g),+ Graph.graphLambdaVariables = (Sets.insert var (Graph.graphLambdaVariables g)),+ Graph.graphMetadata = (Maps.delete var (Graph.graphMetadata g)),+ Graph.graphPrimitives = (Graph.graphPrimitives g),+ Graph.graphSchemaTypes = (Graph.graphSchemaTypes g),+ Graph.graphTypeVariables = (Graph.graphTypeVariables g)}++-- | Extend a graph by descending into a let body+extendGraphForLet :: (Graph.Graph -> Model.Binding -> Maybe Model.Term) -> Graph.Graph -> Model.Let -> Graph.Graph+extendGraphForLet forBinding g letrec =++ let bindings = Model.letBindings letrec+ g2 = extendGraphWithBindings bindings g+ in Graph.Graph {+ Graph.graphBoundTerms = (Maps.union (Maps.fromList (Lists.map (\b -> (Model.bindingName b, (Model.bindingTerm b))) bindings)) (Graph.graphBoundTerms g)),+ Graph.graphBoundTypes = (Maps.union (Maps.fromList (Optionals.givens (Lists.map (\b -> Optionals.map (\ts -> (Model.bindingName b, ts)) (Model.bindingTypeScheme b)) bindings))) (Graph.graphBoundTypes g)),+ Graph.graphClassConstraints = (Graph.graphClassConstraints g),+ Graph.graphLambdaVariables = (Lists.foldl (\s -> \b -> Sets.delete (Model.bindingName b) s) (Graph.graphLambdaVariables g) bindings),+ Graph.graphMetadata = (Graph.graphMetadata (Lists.foldl (\gAcc -> \b ->+ let m = Graph.graphMetadata gAcc+ newMeta =+ Optionals.match (forBinding gAcc b) (Maps.delete (Model.bindingName b) m) (\t -> Maps.insert (Model.bindingName b) t m)+ in Graph.Graph {+ Graph.graphBoundTerms = (Graph.graphBoundTerms gAcc),+ Graph.graphBoundTypes = (Graph.graphBoundTypes gAcc),+ Graph.graphClassConstraints = (Graph.graphClassConstraints gAcc),+ Graph.graphLambdaVariables = (Graph.graphLambdaVariables gAcc),+ Graph.graphMetadata = newMeta,+ Graph.graphPrimitives = (Graph.graphPrimitives gAcc),+ Graph.graphSchemaTypes = (Graph.graphSchemaTypes gAcc),+ Graph.graphTypeVariables = (Graph.graphTypeVariables gAcc)}) g2 bindings)),+ Graph.graphPrimitives = (Graph.graphPrimitives g),+ Graph.graphSchemaTypes = (Graph.graphSchemaTypes g),+ Graph.graphTypeVariables = (Graph.graphTypeVariables g)}++-- | Extend a graph by descending into a type lambda body+extendGraphForTypeLambda :: Graph.Graph -> Model.TypeLambda -> Graph.Graph+extendGraphForTypeLambda g tlam =++ let name = Model.typeLambdaParameter tlam+ in Graph.Graph {+ Graph.graphBoundTerms = (Graph.graphBoundTerms g),+ Graph.graphBoundTypes = (Graph.graphBoundTypes g),+ Graph.graphClassConstraints = (Graph.graphClassConstraints g),+ Graph.graphLambdaVariables = (Graph.graphLambdaVariables g),+ Graph.graphMetadata = (Graph.graphMetadata g),+ Graph.graphPrimitives = (Graph.graphPrimitives g),+ Graph.graphSchemaTypes = (Graph.graphSchemaTypes g),+ Graph.graphTypeVariables = (Sets.insert name (Graph.graphTypeVariables g))}++-- | Add bindings to an existing graph+extendGraphWithBindings :: [Model.Binding] -> Graph.Graph -> Graph.Graph+extendGraphWithBindings bindings g =++ let newTerms = Maps.fromList (Lists.map (\b -> (Model.bindingName b, (Model.bindingTerm b))) bindings)+ newTypes =+ Maps.fromList (Optionals.givens (Lists.map (\b -> Optionals.map (\ts -> (Model.bindingName b, ts)) (Model.bindingTypeScheme b)) bindings))+ in Graph.Graph {+ Graph.graphBoundTerms = (Maps.union newTerms (Graph.graphBoundTerms g)),+ Graph.graphBoundTypes = (Maps.union newTypes (Graph.graphBoundTypes g)),+ Graph.graphClassConstraints = (Graph.graphClassConstraints g),+ Graph.graphLambdaVariables = (Graph.graphLambdaVariables g),+ Graph.graphMetadata = (Graph.graphMetadata g),+ Graph.graphPrimitives = (Graph.graphPrimitives g),+ Graph.graphSchemaTypes = (Graph.graphSchemaTypes g),+ Graph.graphTypeVariables = (Graph.graphTypeVariables g)}++-- | Convert a forall type to a type scheme+fTypeToTypeScheme :: Model.Type -> Model.TypeScheme+fTypeToTypeScheme typ =++ let stripAnnotations =+ \t -> case t of+ Model.TypeAnnotated v0 -> stripAnnotations (Model.annotatedTypeBody v0)+ _ -> t+ gatherForall =+ \vars -> \typ2 -> case (stripAnnotations typ2) of+ Model.TypeForall v0 -> gatherForall (Lists.cons (Model.forallTypeParameter v0) vars) (Model.forallTypeBody v0)+ _ -> Model.TypeScheme {+ Model.typeSchemeVariables = (Lists.reverse vars),+ Model.typeSchemeBody = typ2,+ Model.typeSchemeConstraints = Maps.empty}+ in (gatherForall [] typ)++-- | Convert a TermSignature to a TypeScheme, erasing parameter names, descriptions, and laziness flags.+termSignatureToTypeScheme :: Typing.TermSignature -> Model.TypeScheme+termSignatureToTypeScheme sig =++ let typeParams = Typing.termSignatureTypeParameters sig+ params = Typing.termSignatureParameters sig+ result = Typing.termSignatureResult sig+ variables = Lists.map (\tp -> Typing.typeParameterName tp) typeParams+ body =+ Lists.foldl (\acc -> \p -> Model.TypeFunction (Model.FunctionType {+ Model.functionTypeDomain = (Typing.parameterType p),+ Model.functionTypeCodomain = acc})) (Typing.resultType result) (Lists.reverse params)+ constraints =+ Maps.fromList (Lists.map (\tp -> (+ Typing.typeParameterName tp,+ Model.TypeVariableConstraints {+ Model.typeVariableConstraintsClasses = (Sets.fromList (Typing.typeParameterConstraints tp))})) typeParams)+ in Model.TypeScheme {+ Model.typeSchemeVariables = variables,+ Model.typeSchemeBody = body,+ Model.typeSchemeConstraints = constraints}++-- | Convert a type scheme to a forall type+typeSchemeToFType :: Model.TypeScheme -> Model.Type+typeSchemeToFType ts =++ let vars = Model.typeSchemeVariables ts+ body = Model.typeSchemeBody ts+ in (Lists.foldl (\t -> \v -> Model.TypeForall (Model.ForallType {+ Model.forallTypeParameter = v,+ Model.forallTypeBody = t})) body (Lists.reverse vars))++-- | Convert a TypeScheme to a TermSignature. Type variables and class constraints are preserved exactly. Value-parameter names are synthesized as arg0, arg1, .... Per-parameter descriptions are nothing and isLazy defaults to false.+typeSchemeToTermSignature :: Model.TypeScheme -> Typing.TermSignature+typeSchemeToTermSignature ts =++ let variables = Model.typeSchemeVariables ts+ body = Model.typeSchemeBody ts+ constraintsMap = Model.typeSchemeConstraints ts+ typeParams =+ Lists.map (\v -> Typing.TypeParameter {+ Typing.typeParameterName = v,+ Typing.typeParameterConstraints = (Optionals.match (Maps.lookup v constraintsMap) [] (\tvm -> Sets.toList (Model.typeVariableConstraintsClasses tvm)))}) variables+ peel =+ \acc -> \t -> case t of+ Model.TypeFunction v0 -> peel (Lists.cons (Model.functionTypeDomain v0) acc) (Model.functionTypeCodomain v0)+ _ -> (Lists.reverse acc, t)+ peeled = peel [] body+ paramTypes = Pairs.first peeled+ resultType = Pairs.second peeled+ params =+ Lists.reverse (Pairs.first (Lists.foldl (\acc -> \ty ->+ let pairAcc = Pairs.first acc+ i = Pairs.second acc+ in (+ Lists.cons (Typing.Parameter {+ Typing.parameterName = (Model.Name (Strings.concat [+ "arg",+ (Literals.printInt32 i)])),+ Typing.parameterDescription = Nothing,+ Typing.parameterType = ty,+ Typing.parameterIsLazy = False}) pairAcc,+ (Math.add i 1))) ([], 0) paramTypes))+ result =+ Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = resultType}+ in Typing.TermSignature {+ Typing.termSignatureTypeParameters = typeParams,+ Typing.termSignatureParameters = params,+ Typing.termSignatureResult = result}
@@ -0,0 +1,669 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Utilities for constructing generic program code ASTs, used for the serialization phase of source code generation.++module Hydra.Core.Serialization where++import qualified Hydra.Core.Ast as Ast+import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Diff as Diff+import qualified Hydra.Core.Docs as Docs+import qualified Hydra.Core.Error.Checking as Checking+import qualified Hydra.Core.Error.File as ErrorFile+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Error.Packaging as ErrorPackaging+import qualified Hydra.Core.Error.System as ErrorSystem+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Formatting as Formatting+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Json.Model as JsonModel+import qualified Hydra.Core.Overlay.Haskell.Lib.Equality as Equality+import qualified Hydra.Core.Overlay.Haskell.Lib.Lists as Lists+import qualified Hydra.Core.Overlay.Haskell.Lib.Literals as Literals+import qualified Hydra.Core.Overlay.Haskell.Lib.Logic as Logic+import qualified Hydra.Core.Overlay.Haskell.Lib.Math as Math+import qualified Hydra.Core.Overlay.Haskell.Lib.Optionals as Optionals+import qualified Hydra.Core.Overlay.Haskell.Lib.Ordering as Ordering+import qualified Hydra.Core.Overlay.Haskell.Lib.Pairs as Pairs+import qualified Hydra.Core.Overlay.Haskell.Lib.Strings as Strings+import qualified Hydra.Core.Markdown as Markdown+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Parsing as Parsing+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Query as Query+import qualified Hydra.Core.Regex as Regex+import qualified Hydra.Core.Relational as Relational+import qualified Hydra.Core.System as System+import qualified Hydra.Core.Tabular as Tabular+import qualified Hydra.Core.Testing as Testing+import qualified Hydra.Core.Time as Time+import qualified Hydra.Core.Topology as Topology+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Validation as Validation+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | Angle bracket pair `<` `>` for use with `brackets`+angleBraces :: Ast.Brackets+angleBraces =+ Ast.Brackets {+ Ast.bracketsOpen = (Ast.Symbol "<"),+ Ast.bracketsClose = (Ast.Symbol ">")}++-- | Comma-separate the elements inside angle brackets in the given block style; renders as `<>` when empty+angleBracesList :: Ast.BlockStyle -> [Ast.Expr] -> Ast.Expr+angleBracesList style els = Logic.ifElse (Lists.isEmpty els) (cst "<>") (brackets angleBraces style (commaSep style els))++-- | Produce a bracketed list which separates elements by spaces or newlines depending on the estimated width of the expression.+bracesListAdaptive :: [Ast.Expr] -> Ast.Expr+bracesListAdaptive els =+ chooseLayout maxLineWidth (curlyBracesList Nothing inlineStyle els) (curlyBracesList Nothing halfBlockStyle els)++-- | Comma-separate the elements inside square brackets in the given block style; renders as `[]` when empty+bracketList :: Ast.BlockStyle -> [Ast.Expr] -> Ast.Expr+bracketList style els = Logic.ifElse (Lists.isEmpty els) (cst "[]") (brackets squareBrackets style (commaSep style els))++-- | Produce a bracketed list which separates elements by spaces or newlines depending on the estimated width of the expression.+bracketListAdaptive :: [Ast.Expr] -> Ast.Expr+bracketListAdaptive els = chooseLayout maxLineWidth (bracketList inlineStyle els) (bracketList halfBlockStyle els)++-- | Wrap an expression in the given bracket pair using the given block style+brackets :: Ast.Brackets -> Ast.BlockStyle -> Ast.Expr -> Ast.Expr+brackets br style e =+ Ast.ExprBrackets (Ast.BracketExpr {+ Ast.bracketExprBrackets = br,+ Ast.bracketExprEnclosed = e,+ Ast.bracketExprStyle = style})++-- | Pick between an inline and a multi-line layout for the same logical expression. Returns the inline form if its estimated width does not exceed the threshold, otherwise the block form. Note: the threshold is measured against the inline expression in isolation; surrounding indentation may push content beyond the threshold at print time. Callers that know they are nested can pass a smaller threshold to compensate.+chooseLayout :: Int -> Ast.Expr -> Ast.Expr -> Ast.Expr+chooseLayout threshold inlineExpr blockExpr =+ Logic.ifElse (Ordering.gt (expressionLength inlineExpr) threshold) blockExpr inlineExpr++-- | Separate elements with a comma, using the given block style+commaSep :: Ast.BlockStyle -> [Ast.Expr] -> Ast.Expr+commaSep = symbolSep ","++-- | Comma-separate elements inline if the joined width fits, otherwise break onto separate lines.+commaSepAdaptive :: [Ast.Expr] -> Ast.Expr+commaSepAdaptive els = chooseLayout maxLineWidth (commaSep inlineStyle els) (commaSep halfBlockStyle els)++-- | Construct a constant expression from a literal string+cst :: String -> Ast.Expr+cst s = Ast.ExprConst (sym s)++-- | Wrap a single expression in curly braces using the given block style+curlyBlock :: Ast.BlockStyle -> Ast.Expr -> Ast.Expr+curlyBlock style e = curlyBracesList Nothing style [+ e]++-- | Curly brace pair `{` `}` for use with `brackets`+curlyBraces :: Ast.Brackets+curlyBraces =+ Ast.Brackets {+ Ast.bracketsOpen = (Ast.Symbol "{"),+ Ast.bracketsClose = (Ast.Symbol "}")}++-- | Separate the elements inside curly braces using the given symbol (default `,`) in the given block style; renders as `{}` when empty+curlyBracesList :: Maybe String -> Ast.BlockStyle -> [Ast.Expr] -> Ast.Expr+curlyBracesList msymb style els =+ Logic.ifElse (Lists.isEmpty els) (cst "{}") (brackets curlyBraces style (symbolSep (Optionals.withDefault "," msymb) style els))++-- | Indent every non-empty line of `s` by `idt`. Empty lines stay empty (no trailing whitespace) so downstream byte-identity checks don't care about indent depth.+customIndent :: String -> String -> String+customIndent idt s =+ Strings.concat (Lists.intersperse "\n" (Lists.map (\line -> Logic.ifElse (Equality.equal line "") line (Strings.concat2 idt line)) (Formatting.lines s)))++-- | Render a list of expressions as a block whose first element starts where the surrounding context placed it and subsequent elements break onto fresh lines indented by the given prefix+customIndentBlock :: String -> [Ast.Expr] -> Ast.Expr+customIndentBlock idt els =++ let idtOp =+ Ast.Op {+ Ast.opSymbol = (sym ""),+ Ast.opPadding = Ast.Padding {+ Ast.paddingLeft = Ast.WsSpace,+ Ast.paddingRight = (Ast.WsBreakAndIndent idt)},+ Ast.opPrecedence = (Ast.Precedence 0),+ Ast.opAssociativity = Ast.AssociativityNone}+ in (Optionals.match (Lists.head els) (cst "") (\head -> Logic.ifElse (Equality.equal (Lists.length els) 1) head (ifx idtOp head (newlineSep (Lists.drop 1 els)))))++-- | Separate elements with a dot and no surrounding whitespace+dotSep :: [Ast.Expr] -> Ast.Expr+dotSep =+ sep (Ast.Op {+ Ast.opSymbol = (sym "."),+ Ast.opPadding = Ast.Padding {+ Ast.paddingLeft = Ast.WsNone,+ Ast.paddingRight = Ast.WsNone},+ Ast.opPrecedence = (Ast.Precedence 0),+ Ast.opAssociativity = Ast.AssociativityNone})++-- | Separate elements with a blank line between them+doubleNewlineSep :: [Ast.Expr] -> Ast.Expr+doubleNewlineSep =+ sep (Ast.Op {+ Ast.opSymbol = (sym ""),+ Ast.opPadding = Ast.Padding {+ Ast.paddingLeft = Ast.WsBreak,+ Ast.paddingRight = Ast.WsBreak},+ Ast.opPrecedence = (Ast.Precedence 0),+ Ast.opAssociativity = Ast.AssociativityNone})++-- | The two-space string used as the canonical indent unit+doubleSpace :: String+doubleSpace = " "++-- | Find the approximate length (number of characters, including spaces and newlines) of an expression without actually printing it.+expressionLength :: Ast.Expr -> Int+expressionLength e =++ let symbolLength = \s -> Strings.length (Ast.unSymbol s)+ wsLength =+ \ws -> case ws of+ Ast.WsNone -> 0+ Ast.WsSpace -> 1+ Ast.WsBreak -> 10000+ Ast.WsBreakAndIndent _ -> 10000+ Ast.WsDoubleBreak -> 10000+ blockStyleLength =+ \style ->+ let mindentLen = Optionals.match (Ast.blockStyleIndent style) 0 Strings.length+ nlBeforeLen = Logic.ifElse (Ast.blockStyleNewlineBeforeContent style) 1 0+ nlAfterLen = Logic.ifElse (Ast.blockStyleNewlineAfterContent style) 1 0+ in (Math.add mindentLen (Math.add nlBeforeLen nlAfterLen))+ bracketsLength =+ \brackets -> Math.add (symbolLength (Ast.bracketsOpen brackets)) (symbolLength (Ast.bracketsClose brackets))+ bracketExprLength =+ \be -> Math.add (bracketsLength (Ast.bracketExprBrackets be)) (Math.add (expressionLength (Ast.bracketExprEnclosed be)) (blockStyleLength (Ast.bracketExprStyle be)))+ indentedExpressionLength =+ \ie ->+ let baseLen = expressionLength (Ast.indentedExpressionExpr ie)+ indentLen =+ case (Ast.indentedExpressionStyle ie) of+ Ast.IndentStyleAllLines v0 -> Strings.length v0+ Ast.IndentStyleSubsequentLines v0 -> Strings.length v0+ in (Math.add baseLen indentLen)+ opLength =+ \op ->+ let symLen = symbolLength (Ast.opSymbol op)+ padding = Ast.opPadding op+ leftLen = wsLength (Ast.paddingLeft padding)+ rightLen = wsLength (Ast.paddingRight padding)+ in (Math.add symLen (Math.add leftLen rightLen))+ opExprLength =+ \oe ->+ let opLen = opLength (Ast.opExprOp oe)+ leftLen = expressionLength (Ast.opExprLhs oe)+ rightLen = expressionLength (Ast.opExprRhs oe)+ in (Math.add opLen (Math.add leftLen rightLen))+ seqExprLength =+ \se ->+ let sopLen = opLength (Ast.seqExprOp se)+ elementLens = Lists.map expressionLength (Ast.seqExprElements se)+ totalElLen = Lists.foldl Math.add 0 elementLens+ numSeps = Math.sub (Lists.length (Ast.seqExprElements se)) 1+ in (Math.add totalElLen (Math.mul sopLen (Logic.ifElse (Ordering.gt numSeps 0) numSeps 0)))+ in case e of+ Ast.ExprConst v0 -> symbolLength v0+ Ast.ExprIndent v0 -> indentedExpressionLength v0+ Ast.ExprOp v0 -> opExprLength v0+ Ast.ExprBrackets v0 -> bracketExprLength v0+ Ast.ExprSeq v0 -> seqExprLength v0++-- | Block style with double-space indent and newlines both before and after the bracketed content+fullBlockStyle :: Ast.BlockStyle+fullBlockStyle =+ Ast.BlockStyle {+ Ast.blockStyleIndent = (Just doubleSpace),+ Ast.blockStyleNewlineBeforeContent = True,+ Ast.blockStyleNewlineAfterContent = True}++-- | Block style with double-space indent, a newline before the content but not after+halfBlockStyle :: Ast.BlockStyle+halfBlockStyle =+ Ast.BlockStyle {+ Ast.blockStyleIndent = (Just doubleSpace),+ Ast.blockStyleNewlineBeforeContent = True,+ Ast.blockStyleNewlineAfterContent = False}++-- | Build an infix expression with the given operator and two operands+ifx :: Ast.Op -> Ast.Expr -> Ast.Expr -> Ast.Expr+ifx op lhs rhs =+ Ast.ExprOp (Ast.OpExpr {+ Ast.opExprOp = op,+ Ast.opExprLhs = lhs,+ Ast.opExprRhs = rhs})++-- | Indent every non-empty line of a string by `doubleSpace`+indent :: String -> String+indent = customIndent doubleSpace++-- | Like `customIndentBlock`, but using `doubleSpace` as the indent prefix+indentBlock :: [Ast.Expr] -> Ast.Expr+indentBlock = customIndentBlock doubleSpace++-- | Indent every line of an expression except the first by the given prefix+indentSubsequentLines :: String -> Ast.Expr -> Ast.Expr+indentSubsequentLines idt e =+ Ast.ExprIndent (Ast.IndentedExpression {+ Ast.indentedExpressionStyle = (Ast.IndentStyleSubsequentLines idt),+ Ast.indentedExpressionExpr = e})++-- | Space-separate three elements: left operand, operator string, right operand+infixWs :: String -> Ast.Expr -> Ast.Expr -> Ast.Expr+infixWs op l r =+ spaceSep [+ l,+ (cst op),+ r]++-- | Space-separate operands interleaved with the given operator string+infixWsList :: String -> [Ast.Expr] -> Ast.Expr+infixWsList op opers =++ let opExpr = cst op+ foldFun = \e -> \r -> Logic.ifElse (Lists.isEmpty e) [+ r] (Lists.cons r (Lists.cons opExpr e))+ in (spaceSep (Lists.foldl foldFun [] (Lists.reverse opers)))++-- | Block style with no indent and no surrounding newlines: contents stay on a single line+inlineStyle :: Ast.BlockStyle+inlineStyle =+ Ast.BlockStyle {+ Ast.blockStyleIndent = Nothing,+ Ast.blockStyleNewlineBeforeContent = False,+ Ast.blockStyleNewlineAfterContent = False}++-- | The canonical maximum line width used by Hydra writers. Adaptive helpers compare estimated expression widths against this threshold to decide whether to render inline or break across lines. Set to 120 to match the project-wide line-length convention.+maxLineWidth :: Int+maxLineWidth = 120++-- | Separate elements by a newline (no leading whitespace)+newlineSep :: [Ast.Expr] -> Ast.Expr+newlineSep =+ sep (Ast.Op {+ Ast.opSymbol = (sym ""),+ Ast.opPadding = Ast.Padding {+ Ast.paddingLeft = Ast.WsNone,+ Ast.paddingRight = Ast.WsBreak},+ Ast.opPrecedence = (Ast.Precedence 0),+ Ast.opAssociativity = Ast.AssociativityNone})++-- | Operator padding with no whitespace on either side+noPadding :: Ast.Padding+noPadding =+ Ast.Padding {+ Ast.paddingLeft = Ast.WsNone,+ Ast.paddingRight = Ast.WsNone}++-- | Concatenate elements with no separator and no whitespace+noSep :: [Ast.Expr] -> Ast.Expr+noSep =+ sep (Ast.Op {+ Ast.opSymbol = (sym ""),+ Ast.opPadding = Ast.Padding {+ Ast.paddingLeft = Ast.WsNone,+ Ast.paddingRight = Ast.WsNone},+ Ast.opPrecedence = (Ast.Precedence 0),+ Ast.opAssociativity = Ast.AssociativityNone})++-- | Construct a constant expression from an int32+num :: Int -> Ast.Expr+num i = cst (Literals.printInt32 i)++-- | Build an op with single-space padding from a symbol, precedence, and associativity+op :: String -> Int -> Ast.Associativity -> Ast.Op+op s p assoc =+ Ast.Op {+ Ast.opSymbol = (sym s),+ Ast.opPadding = Ast.Padding {+ Ast.paddingLeft = Ast.WsSpace,+ Ast.paddingRight = Ast.WsSpace},+ Ast.opPrecedence = (Ast.Precedence p),+ Ast.opAssociativity = assoc}++-- | Build the `|` alternative-separator operator. The flag selects whether the right side breaks onto a new line.+orOp :: Bool -> Ast.Op+orOp newlines =+ Ast.Op {+ Ast.opSymbol = (sym "|"),+ Ast.opPadding = Ast.Padding {+ Ast.paddingLeft = Ast.WsSpace,+ Ast.paddingRight = (Logic.ifElse newlines Ast.WsBreak Ast.WsSpace)},+ Ast.opPrecedence = (Ast.Precedence 0),+ Ast.opAssociativity = Ast.AssociativityNone}++-- | Separate alternatives with `|`, breaking onto separate lines when the block style requests a newline before content+orSep :: Ast.BlockStyle -> [Ast.Expr] -> Ast.Expr+orSep style l =++ let newlines = Ast.blockStyleNewlineBeforeContent style+ in (Optionals.match (Lists.head l) (cst "") (\h -> Lists.foldl (\acc -> \el -> ifx (orOp newlines) acc el) h (Lists.drop 1 l)))++-- | Comma-separate the elements inside parentheses; switches to a half-block style when newlines are requested and there is more than one element. Renders as `()` when empty.+parenList :: Bool -> [Ast.Expr] -> Ast.Expr+parenList newlines els =++ let style = Logic.ifElse (Logic.and newlines (Ordering.gt (Lists.length els) 1)) halfBlockStyle inlineStyle+ in (Logic.ifElse (Lists.isEmpty els) (cst "()") (brackets parentheses style (commaSep style els)))++-- | Produce a parenthesized list which separates elements by spaces or newlines depending on the estimated width of the expression.+parenListAdaptive :: [Ast.Expr] -> Ast.Expr+parenListAdaptive els = chooseLayout maxLineWidth (parenList False els) (parenList True els)++-- | Wrap an expression in inline parentheses+parens :: Ast.Expr -> Ast.Expr+parens = brackets parentheses inlineStyle++-- | Round parenthesis pair `(` `)` for use with `brackets`+parentheses :: Ast.Brackets+parentheses =+ Ast.Brackets {+ Ast.bracketsOpen = (Ast.Symbol "("),+ Ast.bracketsClose = (Ast.Symbol ")")}++-- | Recursively insert parentheses around subexpressions where required by operator precedence and associativity. The traversal descends into bracket, indent, sequence, and operator expressions and parenthesizes left or right operands whose binding is weaker than the surrounding operator.+parenthesize :: Ast.Expr -> Ast.Expr+parenthesize exp =++ let assocLeft =+ \a -> case a of+ Ast.AssociativityRight -> False+ _ -> True+ assocRight =+ \a -> case a of+ Ast.AssociativityLeft -> False+ _ -> True+ in case exp of+ Ast.ExprBrackets v0 -> Ast.ExprBrackets (Ast.BracketExpr {+ Ast.bracketExprBrackets = (Ast.bracketExprBrackets v0),+ Ast.bracketExprEnclosed = (parenthesize (Ast.bracketExprEnclosed v0)),+ Ast.bracketExprStyle = (Ast.bracketExprStyle v0)})+ Ast.ExprConst _ -> exp+ Ast.ExprIndent v0 -> Ast.ExprIndent (Ast.IndentedExpression {+ Ast.indentedExpressionStyle = (Ast.indentedExpressionStyle v0),+ Ast.indentedExpressionExpr = (parenthesize (Ast.indentedExpressionExpr v0))})+ Ast.ExprSeq v0 -> Ast.ExprSeq (Ast.SeqExpr {+ Ast.seqExprOp = (Ast.seqExprOp v0),+ Ast.seqExprElements = (Lists.map parenthesize (Ast.seqExprElements v0))})+ Ast.ExprOp v0 ->+ let op = Ast.opExprOp v0+ prec = Ast.unPrecedence (Ast.opPrecedence op)+ assoc = Ast.opAssociativity op+ lhs = Ast.opExprLhs v0+ rhs = Ast.opExprRhs v0+ lhs_ = parenthesize lhs+ rhs_ = parenthesize rhs+ lhs2 =+ case lhs_ of+ Ast.ExprOp v1 ->+ let lop = Ast.opExprOp v1+ lprec = Ast.unPrecedence (Ast.opPrecedence lop)+ lassoc = Ast.opAssociativity lop+ comparison = Ordering.compare prec lprec+ in case comparison of+ Util.ComparisonLessThan -> lhs_+ Util.ComparisonGreaterThan -> parens lhs_+ Util.ComparisonEqualTo -> Logic.ifElse (Logic.and (assocLeft assoc) (assocLeft lassoc)) lhs_ (parens lhs_)+ _ -> lhs_+ rhs2 =+ case rhs_ of+ Ast.ExprOp v1 ->+ let rop = Ast.opExprOp v1+ rprec = Ast.unPrecedence (Ast.opPrecedence rop)+ rassoc = Ast.opAssociativity rop+ comparison = Ordering.compare prec rprec+ in case comparison of+ Util.ComparisonLessThan -> rhs_+ Util.ComparisonGreaterThan -> parens rhs_+ Util.ComparisonEqualTo -> Logic.ifElse (Logic.and (assocRight assoc) (assocRight rassoc)) rhs_ (parens rhs_)+ _ -> rhs_+ in (Ast.ExprOp (Ast.OpExpr {+ Ast.opExprOp = op,+ Ast.opExprLhs = lhs2,+ Ast.opExprRhs = rhs2}))++-- | Prepend a prefix string to an expression with no surrounding whitespace+prefix :: String -> Ast.Expr -> Ast.Expr+prefix p expr =++ let preOp =+ Ast.Op {+ Ast.opSymbol = (sym p),+ Ast.opPadding = Ast.Padding {+ Ast.paddingLeft = Ast.WsNone,+ Ast.paddingRight = Ast.WsNone},+ Ast.opPrecedence = (Ast.Precedence 0),+ Ast.opAssociativity = Ast.AssociativityNone}+ in (ifx preOp (cst "") expr)++-- | Render an expression to a string, expanding bracket pairs, block styles, indents, and operator chains+printExpr :: Ast.Expr -> String+printExpr e =++ let pad =+ \ws -> case ws of+ Ast.WsNone -> ""+ Ast.WsSpace -> " "+ Ast.WsBreak -> "\n"+ Ast.WsBreakAndIndent _ -> "\n"+ Ast.WsDoubleBreak -> "\n\n"+ idt =+ \ws -> \s -> case ws of+ Ast.WsBreakAndIndent v0 -> customIndent v0 s+ _ -> s+ in case e of+ Ast.ExprConst v0 -> Ast.unSymbol v0+ Ast.ExprIndent v0 ->+ let style = Ast.indentedExpressionStyle v0+ expr = Ast.indentedExpressionExpr v0+ lns = Formatting.lines (printExpr expr)+ indentLine = \pre -> \line -> Logic.ifElse (Equality.equal line "") line (Strings.concat2 pre line)+ ilns =+ case style of+ Ast.IndentStyleAllLines v1 -> Lists.map (indentLine v1) lns+ Ast.IndentStyleSubsequentLines v1 -> Logic.ifElse (Equality.equal (Lists.length lns) 1) lns (Optionals.withDefault lns (Optionals.map (\uc -> Lists.cons (Pairs.first uc) (Lists.map (indentLine v1) (Pairs.second uc))) (Lists.uncons lns)))+ in (Strings.join "\n" ilns)+ Ast.ExprSeq v0 ->+ let sop = Ast.seqExprOp v0+ ssym = Ast.unSymbol (Ast.opSymbol sop)+ spadding = Ast.opPadding sop+ spadl = Ast.paddingLeft spadding+ spadr = Ast.paddingRight spadding+ selements = Ast.seqExprElements v0+ printedElements = Lists.map (\el -> idt spadr (printExpr el)) selements+ isNewlineWs =+ \ws -> case ws of+ Ast.WsBreak -> True+ Ast.WsBreakAndIndent _ -> True+ Ast.WsDoubleBreak -> True+ _ -> False+ spadlIsNewline = isNewlineWs spadl+ spadrIsNewline = isNewlineWs spadr+ joinElements =+ \acc -> \el ->+ let elStartsWithNewline = Optionals.match (Strings.charAt 0 el) False (\c -> Equality.equal c 10)+ elIsEmpty = Equality.equal el ""+ padlEff =+ Logic.ifElse (Logic.or (Logic.and elStartsWithNewline (Logic.not spadlIsNewline)) (Logic.and elIsEmpty (Equality.equal ssym ""))) "" (pad spadl)+ padrEff =+ Logic.ifElse (Logic.or (Logic.and elStartsWithNewline (Logic.not spadrIsNewline)) (Logic.and elIsEmpty (Equality.equal ssym ""))) "" (pad spadr)+ in (Strings.concat [+ acc,+ padlEff,+ ssym,+ padrEff,+ el])+ in (Optionals.match (Lists.head printedElements) "" (\h -> Lists.foldl joinElements h (Lists.drop 1 printedElements)))+ Ast.ExprOp v0 ->+ let op = Ast.opExprOp v0+ sym = Ast.unSymbol (Ast.opSymbol op)+ padding = Ast.opPadding op+ padl = Ast.paddingLeft padding+ padr = Ast.paddingRight padding+ l = Ast.opExprLhs v0+ r = Ast.opExprRhs v0+ lhs = idt padl (printExpr l)+ rhs = idt padr (printExpr r)+ padrIsNewline =+ case padr of+ Ast.WsBreak -> True+ Ast.WsBreakAndIndent _ -> True+ Ast.WsDoubleBreak -> True+ _ -> False+ padlIsNewline =+ case padl of+ Ast.WsBreak -> True+ Ast.WsDoubleBreak -> True+ _ -> False+ padlEffective =+ Logic.ifElse (Logic.and (Logic.not padlIsNewline) (Logic.and (Equality.equal sym "") (Logic.or padrIsNewline (Equality.equal rhs "")))) "" (pad padl)+ padrPad = pad padr+ rhsStartsWithNewline = Optionals.match (Strings.charAt 0 rhs) False (\c -> Equality.equal c 10)+ padrEffective = Logic.ifElse (Logic.and rhsStartsWithNewline (Logic.not padrIsNewline)) "" padrPad+ in (Strings.concat2 (Strings.concat2 (Strings.concat2 (Strings.concat2 lhs padlEffective) sym) padrEffective) rhs)+ Ast.ExprBrackets v0 ->+ let brs = Ast.bracketExprBrackets v0+ l = Ast.unSymbol (Ast.bracketsOpen brs)+ r = Ast.unSymbol (Ast.bracketsClose brs)+ e = Ast.bracketExprEnclosed v0+ style = Ast.bracketExprStyle v0+ body = printExpr e+ doIndent = Ast.blockStyleIndent style+ nlBefore = Ast.blockStyleNewlineBeforeContent style+ nlAfter = Ast.blockStyleNewlineAfterContent style+ ibody = Optionals.match doIndent body (\pre -> customIndent pre body)+ pre = Logic.ifElse nlBefore "\n" ""+ suf = Logic.ifElse nlAfter "\n" ""+ in (Strings.concat2 (Strings.concat2 (Strings.concat2 (Strings.concat2 l pre) ibody) suf) r)++-- | Separate elements with `;` inline+semicolonSep :: [Ast.Expr] -> Ast.Expr+semicolonSep = symbolSep ";" inlineStyle++-- | Combine a list of expressions into a single OpExpr chain using the given operator. Returns the empty constant for an empty list.+sep :: Ast.Op -> [Ast.Expr] -> Ast.Expr+sep op els = Optionals.match (Lists.head els) (cst "") (\h -> Lists.foldl (\acc -> \el -> ifx op acc el) h (Lists.drop 1 els))++-- | Space-separate elements (no break between them)+spaceSep :: [Ast.Expr] -> Ast.Expr+spaceSep =+ sep (Ast.Op {+ Ast.opSymbol = (sym ""),+ Ast.opPadding = Ast.Padding {+ Ast.paddingLeft = Ast.WsSpace,+ Ast.paddingRight = Ast.WsNone},+ Ast.opPrecedence = (Ast.Precedence 0),+ Ast.opAssociativity = Ast.AssociativityNone})++-- | Space-separate elements inline if the joined width fits, otherwise newline-separate them. Useful for long signatures, type chains, and other space-joined sequences.+spaceSepAdaptive :: [Ast.Expr] -> Ast.Expr+spaceSepAdaptive els = chooseLayout maxLineWidth (spaceSep els) (newlineSep els)++-- | Square bracket pair `[` `]` for use with `brackets`+squareBrackets :: Ast.Brackets+squareBrackets =+ Ast.Brackets {+ Ast.bracketsOpen = (Ast.Symbol "["),+ Ast.bracketsClose = (Ast.Symbol "]")}++-- | Like sep, but produces a SeqExpr instead of an OpExpr chain. SeqExpr is treated as structural layout and is not subject to parenthesization.+structuralSep :: Ast.Op -> [Ast.Expr] -> Ast.Expr+structuralSep op els =+ Logic.ifElse (Lists.isEmpty els) (cst "") (Logic.ifElse (Equality.equal (Lists.length els) 1) (Optionals.withDefault (cst "") (Lists.head els)) (Ast.ExprSeq (Ast.SeqExpr {+ Ast.seqExprOp = op,+ Ast.seqExprElements = els})))++-- | Like spaceSep, but produces a SeqExpr. Use for structural layout that should not trigger parenthesization of children.+structuralSpaceSep :: [Ast.Expr] -> Ast.Expr+structuralSpaceSep =+ structuralSep (Ast.Op {+ Ast.opSymbol = (sym ""),+ Ast.opPadding = Ast.Padding {+ Ast.paddingLeft = Ast.WsSpace,+ Ast.paddingRight = Ast.WsNone},+ Ast.opPrecedence = (Ast.Precedence 0),+ Ast.opAssociativity = Ast.AssociativityNone})++-- | Append a suffix string to an expression+suffix :: String -> Ast.Expr -> Ast.Expr+suffix s expr =++ let sufOp =+ Ast.Op {+ Ast.opSymbol = (sym s),+ Ast.opPadding = Ast.Padding {+ Ast.paddingLeft = Ast.WsNone,+ Ast.paddingRight = Ast.WsNone},+ Ast.opPrecedence = (Ast.Precedence 0),+ Ast.opAssociativity = Ast.AssociativityNone}+ in (ifx sufOp expr (cst ""))++-- | Construct a Symbol from a string+sym :: String -> Ast.Symbol+sym s = Ast.Symbol s++-- | Separate elements with the given symbol; trailing whitespace per element is determined by the block style's newline-before/after flags (space, single break, or double break)+symbolSep :: String -> Ast.BlockStyle -> [Ast.Expr] -> Ast.Expr+symbolSep symb style l =++ let breakCount =+ Lists.length (Lists.filter (\x_ -> x_) [+ Ast.blockStyleNewlineBeforeContent style,+ (Ast.blockStyleNewlineAfterContent style)])+ break =+ Logic.ifElse (Equality.equal breakCount 0) Ast.WsSpace (Logic.ifElse (Equality.equal breakCount 1) Ast.WsBreak Ast.WsDoubleBreak)+ commaOp =+ Ast.Op {+ Ast.opSymbol = (sym symb),+ Ast.opPadding = Ast.Padding {+ Ast.paddingLeft = Ast.WsNone,+ Ast.paddingRight = break},+ Ast.opPrecedence = (Ast.Precedence 0),+ Ast.opAssociativity = Ast.AssociativityNone}+ in (Optionals.match (Lists.head l) (cst "") (\h -> Lists.foldl (\acc -> \el -> ifx commaOp acc el) h (Lists.drop 1 l)))++-- | Indent every line of an expression by four spaces+tabIndent :: Ast.Expr -> Ast.Expr+tabIndent e =+ Ast.ExprIndent (Ast.IndentedExpression {+ Ast.indentedExpressionStyle = (Ast.IndentStyleAllLines " "),+ Ast.indentedExpressionExpr = e})++-- | Tab-indent a list of expressions, separated by blank lines+tabIndentDoubleSpace :: [Ast.Expr] -> Ast.Expr+tabIndentDoubleSpace exprs = tabIndent (doubleNewlineSep exprs)++-- | Tab-indent a list of expressions, separated by single newlines+tabIndentSingleSpace :: [Ast.Expr] -> Ast.Expr+tabIndentSingleSpace exprs = tabIndent (newlineSep exprs)++-- | Render a placeholder for a type the writer does not yet handle, e.g. `[bigint]`+unsupportedType :: String -> Ast.Expr+unsupportedType label = cst (Strings.concat2 (Strings.concat2 "[" label) "]")++-- | Render a placeholder for an unsupported variant, including a string representation of the offending value+unsupportedVariant :: String -> String -> Ast.Expr+unsupportedVariant label obj =+ cst (Strings.concat2 (Strings.concat2 (Strings.concat2 (Strings.concat2 "[unsupported " label) ": ") (Literals.printString obj)) "]")++-- | Append a trailing comma to an expression+withComma :: Ast.Expr -> Ast.Expr+withComma e =+ noSep [+ e,+ (cst ",")]++-- | Append a trailing semicolon to an expression+withSemi :: Ast.Expr -> Ast.Expr+withSemi e =+ noSep [+ e,+ (cst ";")]
@@ -0,0 +1,255 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Utilities for sorting. This module includes an implementation of Tarjan's algorithm, originally based on GraphSCC by Iavor S. Diatchki: https://hackage.haskell.org/package/GraphSCC. Tarjan was chosen because it computes strongly connected components in O(V+E), in a single pass, and yields the components in reverse topological order — exactly the shape every consumer in the kernel (HM let-generalization, schema graph construction, target-language emission) needs.++module Hydra.Core.Sorting where++import qualified Hydra.Core.Ast as Ast+import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Constants as Constants+import qualified Hydra.Core.Diff as Diff+import qualified Hydra.Core.Docs as Docs+import qualified Hydra.Core.Error.Checking as Checking+import qualified Hydra.Core.Error.File as ErrorFile+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Error.Packaging as ErrorPackaging+import qualified Hydra.Core.Error.System as ErrorSystem+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Json.Model as JsonModel+import qualified Hydra.Core.Overlay.Haskell.Lib.Equality as Equality+import qualified Hydra.Core.Overlay.Haskell.Lib.Functions as Functions+import qualified Hydra.Core.Overlay.Haskell.Lib.Lists as Lists+import qualified Hydra.Core.Overlay.Haskell.Lib.Logic as Logic+import qualified Hydra.Core.Overlay.Haskell.Lib.Maps as Maps+import qualified Hydra.Core.Overlay.Haskell.Lib.Math as Math+import qualified Hydra.Core.Overlay.Haskell.Lib.Optionals as Optionals+import qualified Hydra.Core.Overlay.Haskell.Lib.Ordering as Ordering+import qualified Hydra.Core.Overlay.Haskell.Lib.Pairs as Pairs+import qualified Hydra.Core.Overlay.Haskell.Lib.Sets as Sets+import qualified Hydra.Core.Markdown as Markdown+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Parsing as Parsing+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Query as Query+import qualified Hydra.Core.Regex as Regex+import qualified Hydra.Core.Relational as Relational+import qualified Hydra.Core.System as System+import qualified Hydra.Core.Tabular as Tabular+import qualified Hydra.Core.Testing as Testing+import qualified Hydra.Core.Time as Time+import qualified Hydra.Core.Topology as Topology+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Validation as Validation+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void+import qualified Data.Map as M+import qualified Data.Set as S++-- | Convert an adjacency list to a map, concatenating values for duplicate keys+adjacencyListToMap :: Ord t0 => ([(t0, [t1])] -> M.Map t0 [t1])+adjacencyListToMap pairs =+ Lists.foldl (\mp -> \p ->+ let k = Pairs.first p+ vs = Pairs.second p+ existing = Optionals.match (Maps.lookup k mp) [] Functions.identity+ in (Maps.insert k (Lists.concat2 existing vs) mp)) Maps.empty pairs++-- | Given a list of adjacency lists represented as (key, [key]) pairs, construct a graph along with a function mapping each vertex (an Int) back to its original key (Nothing for unknown vertices).+adjacencyListsToGraph :: Ord t0 => ([(t0, [t0])] -> (M.Map Int [Int], (Int -> Maybe t0)))+adjacencyListsToGraph edges0 =++ let sortedEdges = Lists.sortBy Pairs.first edges0+ indexedEdges = Lists.zip (Math.range 0 (Lists.length sortedEdges)) sortedEdges+ keyToVertex =+ Maps.fromList (Lists.map (\vkNeighbors ->+ let v = Pairs.first vkNeighbors+ kNeighbors = Pairs.second vkNeighbors+ k = Pairs.first kNeighbors+ in (k, v)) indexedEdges)+ vertexMap =+ Maps.fromList (Lists.map (\vkNeighbors ->+ let v = Pairs.first vkNeighbors+ kNeighbors = Pairs.second vkNeighbors+ k = Pairs.first kNeighbors+ in (v, k)) indexedEdges)+ graph =+ Maps.fromList (Lists.map (\vkNeighbors ->+ let v = Pairs.first vkNeighbors+ kNeighbors = Pairs.second vkNeighbors+ neighbors = Pairs.second kNeighbors+ in (v, (Optionals.mapOptional (\k -> Maps.lookup k keyToVertex) neighbors))) indexedEdges)+ vertexToKey = \v -> Maps.lookup v vertexMap+ in (graph, vertexToKey)++-- | Construct an OrderingIsomorphism between two orderings of the same elements. The two list arguments must be permutations of each other; the result is a pair of mappings that transport an element list from one ordering to the other.+createOrderingIsomorphism :: Ord t0 => ([t0] -> [t0] -> Topology.OrderingIsomorphism t1)+createOrderingIsomorphism sourceOrd targetOrd =++ let sourceToTargetMapping =+ \els ->+ let mp = Maps.fromList (Lists.zip sourceOrd els)+ in (Optionals.givens (Lists.map (\n -> Maps.lookup n mp) targetOrd))+ targetToSourceMapping =+ \els ->+ let mp = Maps.fromList (Lists.zip targetOrd els)+ in (Optionals.givens (Lists.map (\n -> Maps.lookup n mp) sourceOrd))+ in Topology.OrderingIsomorphism {+ Topology.orderingIsomorphismEncode = sourceToTargetMapping,+ Topology.orderingIsomorphismDecode = targetToSourceMapping}++-- | Given an adjacency function and a distinguished root node, find all reachable nodes (including the root node)+findReachableNodes :: Ord t0 => ((t0 -> S.Set t0) -> t0 -> S.Set t0)+findReachableNodes adj root =++ let visit =+ \visited -> \node ->+ let toVisit = Sets.difference (adj node) visited+ in (Logic.ifElse (Sets.isEmpty toVisit) visited (Lists.foldl (\v -> \n -> visit (Sets.insert n v) n) visited (Sets.toList toVisit)))+ in (visit (Sets.singleton root) root)++-- | Initial state for Tarjan's algorithm+initialState :: Topology.TarjanState+initialState =+ Topology.TarjanState {+ Topology.tarjanStateCounter = 0,+ Topology.tarjanStateIndices = Maps.empty,+ Topology.tarjanStateLowLinks = Maps.empty,+ Topology.tarjanStateStack = [],+ Topology.tarjanStateOnStack = Sets.empty,+ Topology.tarjanStateSccs = []}++-- | Pop vertices off the stack until the given vertex is reached, collecting the current strongly connected component+popStackUntil :: Int -> Topology.TarjanState -> ([Int], Topology.TarjanState)+popStackUntil v st0 =++ let go =+ \acc -> \st -> Optionals.match (Lists.uncons (Topology.tarjanStateStack st)) (Lists.reverse acc, st) (\uc ->+ let x = Pairs.first uc+ xs = Pairs.second uc+ newSt =+ Topology.TarjanState {+ Topology.tarjanStateCounter = (Topology.tarjanStateCounter st),+ Topology.tarjanStateIndices = (Topology.tarjanStateIndices st),+ Topology.tarjanStateLowLinks = (Topology.tarjanStateLowLinks st),+ Topology.tarjanStateStack = xs,+ Topology.tarjanStateOnStack = (Topology.tarjanStateOnStack st),+ Topology.tarjanStateSccs = (Topology.tarjanStateSccs st)}+ newSt2 =+ Topology.TarjanState {+ Topology.tarjanStateCounter = (Topology.tarjanStateCounter newSt),+ Topology.tarjanStateIndices = (Topology.tarjanStateIndices newSt),+ Topology.tarjanStateLowLinks = (Topology.tarjanStateLowLinks newSt),+ Topology.tarjanStateStack = (Topology.tarjanStateStack newSt),+ Topology.tarjanStateOnStack = (Sets.delete x (Topology.tarjanStateOnStack st)),+ Topology.tarjanStateSccs = (Topology.tarjanStateSccs newSt)}+ acc_ = Lists.cons x acc+ in (Logic.ifElse (Equality.equal x v) (Lists.reverse acc_, newSt2) (go acc_ newSt2)))+ in (go [] st0)++-- | Given a graph as an adjacency list of edges and a list of explicit tags per node, compute the full set of tags for each node by propagating tags through edges. If there is an edge from n1 to n2 and n2 has tag t, then n1 also has tag t. Note: pairs in the output are not ordered.+propagateTags :: (Ord t0, Ord t1) => ([(t0, [t0])] -> [(t0, [t1])] -> [(t0, (S.Set t1))])+propagateTags edges nodeTags =++ let adjMap = adjacencyListToMap edges+ tagMap = Maps.map Sets.fromList (adjacencyListToMap nodeTags)+ allNodes = Sets.toList (Sets.fromList (Lists.concat2 (Lists.map Pairs.first edges) (Lists.map Pairs.first nodeTags)))+ getTagsForNode =+ \node ->+ let reachable = findReachableNodes (\n -> Sets.fromList (Optionals.match (Maps.lookup n adjMap) [] Functions.identity)) node+ in (Sets.unions (Lists.map (\n -> Optionals.match (Maps.lookup n tagMap) Sets.empty Functions.identity) (Sets.toList reachable)))+ in (Lists.map (\n -> (n, (getTagsForNode n))) allNodes)++-- | Visit a vertex and recursively explore its successors+strongConnect :: M.Map Int [Int] -> Int -> Topology.TarjanState -> Topology.TarjanState+strongConnect graph v st =++ let i = Topology.tarjanStateCounter st+ newSt =+ Topology.TarjanState {+ Topology.tarjanStateCounter = (Math.add i 1),+ Topology.tarjanStateIndices = (Maps.insert v i (Topology.tarjanStateIndices st)),+ Topology.tarjanStateLowLinks = (Maps.insert v i (Topology.tarjanStateLowLinks st)),+ Topology.tarjanStateStack = (Lists.cons v (Topology.tarjanStateStack st)),+ Topology.tarjanStateOnStack = (Sets.insert v (Topology.tarjanStateOnStack st)),+ Topology.tarjanStateSccs = (Topology.tarjanStateSccs st)}+ neighbors = Maps.findWithDefault [] v graph+ processNeighbor =+ \st_ -> \w ->+ let lowLink =+ \s ->+ let lowV1 = Maps.findWithDefault Constants.maxInt32 v (Topology.tarjanStateLowLinks s)+ idx_w = Maps.findWithDefault Constants.maxInt32 w (Topology.tarjanStateIndices s)+ in Topology.TarjanState {+ Topology.tarjanStateCounter = (Topology.tarjanStateCounter s),+ Topology.tarjanStateIndices = (Topology.tarjanStateIndices s),+ Topology.tarjanStateLowLinks = (Maps.insert v (Ordering.min lowV1 idx_w) (Topology.tarjanStateLowLinks s)),+ Topology.tarjanStateStack = (Topology.tarjanStateStack s),+ Topology.tarjanStateOnStack = (Topology.tarjanStateOnStack s),+ Topology.tarjanStateSccs = (Topology.tarjanStateSccs s)}+ in (Logic.ifElse (Logic.not (Maps.member w (Topology.tarjanStateIndices st_))) (+ let stAfter = strongConnect graph w st_+ lowV2 = Maps.findWithDefault Constants.maxInt32 v (Topology.tarjanStateLowLinks stAfter)+ low_w = Maps.findWithDefault Constants.maxInt32 w (Topology.tarjanStateLowLinks stAfter)+ in Topology.TarjanState {+ Topology.tarjanStateCounter = (Topology.tarjanStateCounter stAfter),+ Topology.tarjanStateIndices = (Topology.tarjanStateIndices stAfter),+ Topology.tarjanStateLowLinks = (Maps.insert v (Ordering.min lowV2 low_w) (Topology.tarjanStateLowLinks stAfter)),+ Topology.tarjanStateStack = (Topology.tarjanStateStack stAfter),+ Topology.tarjanStateOnStack = (Topology.tarjanStateOnStack stAfter),+ Topology.tarjanStateSccs = (Topology.tarjanStateSccs stAfter)}) (Logic.ifElse (Sets.member w (Topology.tarjanStateOnStack st_)) (lowLink st_) st_))+ stAfterNeighbors = Lists.foldl processNeighbor newSt neighbors+ low_v = Maps.findWithDefault Constants.maxInt32 v (Topology.tarjanStateLowLinks stAfterNeighbors)+ idx_v = Maps.findWithDefault Constants.maxInt32 v (Topology.tarjanStateIndices stAfterNeighbors)+ in (Logic.ifElse (Equality.equal low_v idx_v) (+ let compResult = popStackUntil v stAfterNeighbors+ comp = Pairs.first compResult+ stPopped = Pairs.second compResult+ in Topology.TarjanState {+ Topology.tarjanStateCounter = (Topology.tarjanStateCounter stPopped),+ Topology.tarjanStateIndices = (Topology.tarjanStateIndices stPopped),+ Topology.tarjanStateLowLinks = (Topology.tarjanStateLowLinks stPopped),+ Topology.tarjanStateStack = (Topology.tarjanStateStack stPopped),+ Topology.tarjanStateOnStack = (Topology.tarjanStateOnStack stPopped),+ Topology.tarjanStateSccs = (Lists.cons comp (Topology.tarjanStateSccs stPopped))}) stAfterNeighbors)++-- | Compute the strongly connected components of the given graph. The components are returned in reverse topological order+stronglyConnectedComponents :: M.Map Int [Int] -> [[Int]]+stronglyConnectedComponents graph =++ let verts = Maps.keys graph+ finalState =+ Lists.foldl (\st -> \v -> Logic.ifElse (Maps.member v (Topology.tarjanStateIndices st)) st (strongConnect graph v st)) initialState verts+ in (Lists.reverse (Lists.map Lists.sort (Topology.tarjanStateSccs finalState)))++-- | Sort a directed acyclic graph (DAG) based on an adjacency list. Yields a list of nontrivial strongly connected components if the graph has cycles, otherwise a simple list.+topologicalSort :: Ord t0 => ([(t0, [t0])] -> Either [[t0]] [t0])+topologicalSort pairs =++ let sccs = topologicalSortComponents pairs+ isCycle = \scc -> Ordering.gt (Lists.length scc) 1+ withCycles = Lists.filter isCycle sccs+ in (Logic.ifElse (Lists.isEmpty withCycles) (Right (Lists.concat sccs)) (Left withCycles))++-- | Find the strongly connected components (including cycles and isolated vertices) of a graph, in (reverse) topological order, i.e. dependencies before dependents+topologicalSortComponents :: Ord t0 => ([(t0, [t0])] -> [[t0]])+topologicalSortComponents pairs =++ let graphResult = adjacencyListsToGraph pairs+ g = Pairs.first graphResult+ in (Lists.map (\comp -> Optionals.mapOptional (Pairs.second graphResult) comp) (stronglyConnectedComponents g))++-- | Sort a directed acyclic graph (DAG) of nodes using two helper functions: one for node keys, and one for the adjacency list of connected node keys. The result is a list of strongly-connected components (cycles), in which singleton lists represent acyclic nodes.+topologicalSortNodes :: Ord t1 => ((t0 -> t1) -> (t0 -> [t1]) -> [t0] -> [[t0]])+topologicalSortNodes getKey getAdj nodes =++ let nodesByKey = Maps.fromList (Lists.map (\n -> (getKey n, n)) nodes)+ pairs = Lists.map (\n -> (getKey n, (getAdj n))) nodes+ comps = topologicalSortComponents pairs+ in (Lists.map (\c -> Optionals.givens (Lists.map (\k -> Maps.lookup k nodesByKey) c)) comps)
@@ -0,0 +1,193 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Annotation and type stripping and normalization++module Hydra.Core.Strip where++import qualified Hydra.Core.Ast as Ast+import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Diff as Diff+import qualified Hydra.Core.Docs as Docs+import qualified Hydra.Core.Error.Checking as Checking+import qualified Hydra.Core.Error.File as ErrorFile+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Error.Packaging as ErrorPackaging+import qualified Hydra.Core.Error.System as ErrorSystem+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Json.Model as JsonModel+import qualified Hydra.Core.Overlay.Haskell.Lib.Lists as Lists+import qualified Hydra.Core.Markdown as Markdown+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Parsing as Parsing+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Query as Query+import qualified Hydra.Core.Regex as Regex+import qualified Hydra.Core.Relational as Relational+import qualified Hydra.Core.Rewriting as Rewriting+import qualified Hydra.Core.System as System+import qualified Hydra.Core.Tabular as Tabular+import qualified Hydra.Core.Testing as Testing+import qualified Hydra.Core.Time as Time+import qualified Hydra.Core.Topology as Topology+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Validation as Validation+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | Strip type annotations from the top levels of a term+deannotateAndDetypeTerm :: Model.Term -> Model.Term+deannotateAndDetypeTerm t =+ case t of+ Model.TermAnnotated v0 -> deannotateAndDetypeTerm (Model.annotatedTermBody v0)+ Model.TermTypeApplication v0 -> deannotateAndDetypeTerm (Model.typeApplicationTermBody v0)+ Model.TermTypeLambda v0 -> deannotateAndDetypeTerm (Model.typeLambdaBody v0)+ _ -> t++-- | Strip all annotations (including System F type annotations) from the top levels of a term+deannotateTerm :: Model.Term -> Model.Term+deannotateTerm t =+ case t of+ Model.TermAnnotated v0 -> deannotateTerm (Model.annotatedTermBody v0)+ _ -> t++-- | Strip all annotations from a term+deannotateType :: Model.Type -> Model.Type+deannotateType t =+ case t of+ Model.TypeAnnotated v0 -> deannotateType (Model.annotatedTypeBody v0)+ _ -> t++-- | Strip any top-level type lambdas from a type, extracting the (possibly nested) type body+deannotateTypeParameters :: Model.Type -> Model.Type+deannotateTypeParameters t =+ case (deannotateType t) of+ Model.TypeForall v0 -> deannotateTypeParameters (Model.forallTypeBody v0)+ _ -> t++-- | Recursively strip all annotations from a type+deannotateTypeRecursive :: Model.Type -> Model.Type+deannotateTypeRecursive typ =++ let strip =+ \recurse -> \typ2 ->+ let rewritten = recurse typ2+ in case rewritten of+ Model.TypeAnnotated v0 -> Model.annotatedTypeBody v0+ _ -> rewritten+ in (Rewriting.rewriteType strip typ)++-- | Recursively strip all annotations from a type scheme+deannotateTypeSchemeRecursive :: Model.TypeScheme -> Model.TypeScheme+deannotateTypeSchemeRecursive ts =++ let vars = Model.typeSchemeVariables ts+ typ = Model.typeSchemeBody ts+ constraints = Model.typeSchemeConstraints ts+ in Model.TypeScheme {+ Model.typeSchemeVariables = vars,+ Model.typeSchemeBody = (deannotateTypeRecursive typ),+ Model.typeSchemeConstraints = constraints}++-- | Strip System F type annotations from the top levels of a term, but leave application-specific annotations intact+detypeTerm :: Model.Term -> Model.Term+detypeTerm t =+ case t of+ Model.TermAnnotated v0 ->+ let subj = Model.annotatedTermBody v0+ ann = Model.annotatedTermAnnotation v0+ in (Model.TermAnnotated (Model.AnnotatedTerm {+ Model.annotatedTermBody = (detypeTerm subj),+ Model.annotatedTermAnnotation = ann}))+ Model.TermTypeApplication v0 -> deannotateAndDetypeTerm (Model.typeApplicationTermBody v0)+ Model.TermTypeLambda v0 -> deannotateAndDetypeTerm (Model.typeLambdaBody v0)+ _ -> t++-- | Recursively remove term annotations, including within subterms+removeTermAnnotations :: Model.Term -> Model.Term+removeTermAnnotations term =++ let remove =+ \recurse -> \term2 ->+ let rewritten = recurse term2+ in case term2 of+ Model.TermAnnotated v0 -> Model.annotatedTermBody v0+ _ -> rewritten+ in (Rewriting.rewriteTerm remove term)++-- | Recursively remove type annotations, including within subtypes+removeTypeAnnotations :: Model.Type -> Model.Type+removeTypeAnnotations typ =++ let remove =+ \recurse -> \typ2 ->+ let rewritten = recurse typ2+ in case rewritten of+ Model.TypeAnnotated v0 -> Model.annotatedTypeBody v0+ _ -> rewritten+ in (Rewriting.rewriteType remove typ)++-- | Strip type annotations (TypeLambda, TypeApplication, binding type schemes) from terms while preserving lambda domain types and other annotations+removeTypeAnnotationsFromTerm :: Model.Term -> Model.Term+removeTypeAnnotationsFromTerm term =++ let strip =+ \recurse -> \term2 ->+ let rewritten = recurse term2+ stripBinding =+ \b -> Model.Binding {+ Model.bindingName = (Model.bindingName b),+ Model.bindingTerm = (Model.bindingTerm b),+ Model.bindingTypeScheme = Nothing}+ in case rewritten of+ Model.TermLet v0 -> Model.TermLet (Model.Let {+ Model.letBindings = (Lists.map stripBinding (Model.letBindings v0)),+ Model.letBody = (Model.letBody v0)})+ Model.TermTypeApplication v0 -> Model.typeApplicationTermBody v0+ Model.TermTypeLambda v0 -> Model.typeLambdaBody v0+ _ -> rewritten+ in (Rewriting.rewriteTerm strip term)++-- | Strip type annotations from terms while preserving other annotations+removeTypesFromTerm :: Model.Term -> Model.Term+removeTypesFromTerm term =++ let strip =+ \recurse -> \term2 ->+ let rewritten = recurse term2+ stripBinding =+ \b -> Model.Binding {+ Model.bindingName = (Model.bindingName b),+ Model.bindingTerm = (Model.bindingTerm b),+ Model.bindingTypeScheme = Nothing}+ in case rewritten of+ Model.TermLambda v0 -> Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.lambdaParameter v0),+ Model.lambdaDomain = Nothing,+ Model.lambdaBody = (Model.lambdaBody v0)})+ Model.TermLet v0 -> Model.TermLet (Model.Let {+ Model.letBindings = (Lists.map stripBinding (Model.letBindings v0)),+ Model.letBody = (Model.letBody v0)})+ Model.TermTypeApplication v0 -> Model.typeApplicationTermBody v0+ Model.TermTypeLambda v0 -> Model.typeLambdaBody v0+ _ -> rewritten+ in (Rewriting.rewriteTerm strip term)++-- | Strip outer type lambda wrappers from a term, preserving type application wrappers and annotations+stripTypeLambdas :: Model.Term -> Model.Term+stripTypeLambdas t =+ case t of+ Model.TermAnnotated v0 ->+ let subj = Model.annotatedTermBody v0+ ann = Model.annotatedTermAnnotation v0+ in (Model.TermAnnotated (Model.AnnotatedTerm {+ Model.annotatedTermBody = (stripTypeLambdas subj),+ Model.annotatedTermAnnotation = ann}))+ Model.TermTypeLambda v0 -> stripTypeLambdas (Model.typeLambdaBody v0)+ _ -> t
@@ -0,0 +1,253 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Variable substitution in type and term expressions.++module Hydra.Core.Substitution where++import qualified Hydra.Core.Ast as Ast+import qualified Hydra.Core.Classes as Classes+import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Diff as Diff+import qualified Hydra.Core.Docs as Docs+import qualified Hydra.Core.Error.Checking as Checking+import qualified Hydra.Core.Error.File as ErrorFile+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Error.Packaging as ErrorPackaging+import qualified Hydra.Core.Error.System as ErrorSystem+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Json.Model as JsonModel+import qualified Hydra.Core.Overlay.Haskell.Lib.Lists as Lists+import qualified Hydra.Core.Overlay.Haskell.Lib.Logic as Logic+import qualified Hydra.Core.Overlay.Haskell.Lib.Maps as Maps+import qualified Hydra.Core.Overlay.Haskell.Lib.Optionals as Optionals+import qualified Hydra.Core.Overlay.Haskell.Lib.Ordering as Ordering+import qualified Hydra.Core.Overlay.Haskell.Lib.Pairs as Pairs+import qualified Hydra.Core.Overlay.Haskell.Lib.Sets as Sets+import qualified Hydra.Core.Overlay.Haskell.Lib.Strings as Strings+import qualified Hydra.Core.Markdown as Markdown+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Parsing as Parsing+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Query as Query+import qualified Hydra.Core.Regex as Regex+import qualified Hydra.Core.Relational as Relational+import qualified Hydra.Core.Rewriting as Rewriting+import qualified Hydra.Core.System as System+import qualified Hydra.Core.Tabular as Tabular+import qualified Hydra.Core.Testing as Testing+import qualified Hydra.Core.Time as Time+import qualified Hydra.Core.Topology as Topology+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Validation as Validation+import qualified Hydra.Core.Variables as Variables+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void+import qualified Data.Map as M++-- | Compose two type substitutions+composeTypeSubst :: Typing.TypeSubst -> Typing.TypeSubst -> Typing.TypeSubst+composeTypeSubst s1 s2 =+ Logic.ifElse (Maps.isEmpty (Typing.unTypeSubst s1)) s2 (Logic.ifElse (Maps.isEmpty (Typing.unTypeSubst s2)) s1 (composeTypeSubstNonEmpty s1 s2))++-- | Compose a list of type substitutions+composeTypeSubstList :: [Typing.TypeSubst] -> Typing.TypeSubst+composeTypeSubstList = Lists.foldl composeTypeSubst idTypeSubst++-- | Compose two non-empty type substitutions (internal helper)+composeTypeSubstNonEmpty :: Typing.TypeSubst -> Typing.TypeSubst -> Typing.TypeSubst+composeTypeSubstNonEmpty s1 s2 =++ let isExtra = \k -> \v -> Optionals.isNone (Maps.lookup k (Typing.unTypeSubst s1))+ withExtra = Maps.filterWithKey isExtra (Typing.unTypeSubst s2)+ in (Typing.TypeSubst (Maps.union withExtra (Maps.map (substInType s2) (Typing.unTypeSubst s1))))++-- | The identity type substitution+idTypeSubst :: Typing.TypeSubst+idTypeSubst = Typing.TypeSubst Maps.empty++-- | Create a type substitution with a single variable mapping+singletonTypeSubst :: Model.Name -> Model.Type -> Typing.TypeSubst+singletonTypeSubst v t = Typing.TypeSubst (Maps.singleton v t)++-- | Apply a type substitution to class constraints, propagating to free variables or discharging/retaining on concrete resolution+substInClassConstraints :: Typing.TypeSubst -> M.Map Model.Name Model.TypeVariableConstraints -> M.Map Model.Name Model.TypeVariableConstraints+substInClassConstraints subst constraints =++ let substMap = Typing.unTypeSubst subst+ in (Logic.ifElse (Logic.or (Maps.isEmpty substMap) (Maps.isEmpty constraints)) constraints (+ let isGenuineVarName = \name -> Ordering.lte (Lists.length (Strings.splitOn "." (Model.unName name))) 1+ insertOrMerge =+ \varName -> \metadata -> \acc -> Optionals.match (Maps.lookup varName acc) (Maps.insert varName metadata acc) (\existing ->+ let merged =+ Model.TypeVariableConstraints {+ Model.typeVariableConstraintsClasses = (Sets.union (Model.typeVariableConstraintsClasses existing) (Model.typeVariableConstraintsClasses metadata))}+ in (Maps.insert varName merged acc))+ in (Lists.foldl (\acc -> \pair ->+ let varName = Pairs.first pair+ metadata = Pairs.second pair+ in (Optionals.match (Maps.lookup varName substMap) (insertOrMerge varName metadata acc) (\targetType ->+ let genuineVars = Lists.filter isGenuineVarName (Sets.toList (Variables.freeVariablesInType targetType))+ in (Logic.ifElse (Logic.not (Lists.isEmpty genuineVars)) (Lists.foldl (\acc2 -> \freeVar -> insertOrMerge freeVar metadata acc2) acc genuineVars) (+ let unsatisfied =+ Sets.filter (\c -> Logic.not (Classes.classIsSatisfiedByType (case c of+ Model.TypeClassConstraintSimple v0 -> v0) targetType)) (Model.typeVariableConstraintsClasses metadata)+ in (Logic.ifElse (Sets.isEmpty unsatisfied) acc (insertOrMerge varName (Model.TypeVariableConstraints {+ Model.typeVariableConstraintsClasses = unsatisfied}) acc))))))) Maps.empty (Maps.toList constraints))))++-- | Apply a type substitution to a graph's bound types and class constraints+substInContext :: Typing.TypeSubst -> Graph.Graph -> Graph.Graph+substInContext subst cx =++ let newBoundTypes = Maps.map (substInTypeScheme subst) (Graph.graphBoundTypes cx)+ newClassConstraints = substInClassConstraints subst (Graph.graphClassConstraints cx)+ cx2 =+ Graph.Graph {+ Graph.graphBoundTerms = (Graph.graphBoundTerms cx),+ Graph.graphBoundTypes = newBoundTypes,+ Graph.graphClassConstraints = (Graph.graphClassConstraints cx),+ Graph.graphLambdaVariables = (Graph.graphLambdaVariables cx),+ Graph.graphMetadata = (Graph.graphMetadata cx),+ Graph.graphPrimitives = (Graph.graphPrimitives cx),+ Graph.graphSchemaTypes = (Graph.graphSchemaTypes cx),+ Graph.graphTypeVariables = (Graph.graphTypeVariables cx)}+ in Graph.Graph {+ Graph.graphBoundTerms = (Graph.graphBoundTerms cx2),+ Graph.graphBoundTypes = (Graph.graphBoundTypes cx2),+ Graph.graphClassConstraints = newClassConstraints,+ Graph.graphLambdaVariables = (Graph.graphLambdaVariables cx2),+ Graph.graphMetadata = (Graph.graphMetadata cx2),+ Graph.graphPrimitives = (Graph.graphPrimitives cx2),+ Graph.graphSchemaTypes = (Graph.graphSchemaTypes cx2),+ Graph.graphTypeVariables = (Graph.graphTypeVariables cx2)}++-- | Apply a type substitution to a type+substInType :: Typing.TypeSubst -> Model.Type -> Model.Type+substInType subst typ0 = Logic.ifElse (Maps.isEmpty (Typing.unTypeSubst subst)) typ0 (substInTypeNonEmpty subst typ0)++-- | Apply a non-empty type substitution to a type (internal helper)+substInTypeNonEmpty :: Typing.TypeSubst -> Model.Type -> Model.Type+substInTypeNonEmpty subst typ0 =++ let rewrite =+ \recurse -> \typ -> case typ of+ Model.TypeForall v0 -> Optionals.match (Maps.lookup (Model.forallTypeParameter v0) (Typing.unTypeSubst subst)) (recurse typ) (\styp -> Model.TypeForall (Model.ForallType {+ Model.forallTypeParameter = (Model.forallTypeParameter v0),+ Model.forallTypeBody = (substInType (removeVar (Model.forallTypeParameter v0)) (Model.forallTypeBody v0))}))+ Model.TypeVariable v0 -> Optionals.match (Maps.lookup v0 (Typing.unTypeSubst subst)) typ (\styp -> styp)+ _ -> recurse typ+ removeVar = \v -> Typing.TypeSubst (Maps.delete v (Typing.unTypeSubst subst))+ in (Rewriting.rewriteType rewrite typ0)++-- | Apply a type substitution to a type scheme. The scheme's quantifier variables shadow the substitution: any name in typeSchemeVariables is removed from subst before substituting into the body and constraints. Without this, a substitution like {t0 -> Foo} applied to `forall [t0]. t0 -> t0` would incorrectly replace the bound t0.+substInTypeScheme :: Typing.TypeSubst -> Model.TypeScheme -> Model.TypeScheme+substInTypeScheme subst ts =++ let scopedSubst =+ Typing.TypeSubst (Lists.foldl (\m -> \v -> Maps.delete v m) (Typing.unTypeSubst subst) (Model.typeSchemeVariables ts))+ in Model.TypeScheme {+ Model.typeSchemeVariables = (Model.typeSchemeVariables ts),+ Model.typeSchemeBody = (substInType scopedSubst (Model.typeSchemeBody ts)),+ Model.typeSchemeConstraints = (substInClassConstraints scopedSubst (Model.typeSchemeConstraints ts))}++-- | Apply a type substitution to the type annotations within a term+substTypesInTerm :: Typing.TypeSubst -> Model.Term -> Model.Term+substTypesInTerm subst term0 =++ let rewrite =+ \recurse -> \term ->+ let dflt = recurse term+ forLambda =+ \l -> Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.lambdaParameter l),+ Model.lambdaDomain = (Optionals.map (substInType subst) (Model.lambdaDomain l)),+ Model.lambdaBody = (substTypesInTerm subst (Model.lambdaBody l))})+ forLet =+ \l ->+ let rewriteBinding =+ \b -> Model.Binding {+ Model.bindingName = (Model.bindingName b),+ Model.bindingTerm = (substTypesInTerm subst (Model.bindingTerm b)),+ Model.bindingTypeScheme = (Optionals.map (substInTypeScheme subst) (Model.bindingTypeScheme b))}+ in (Model.TermLet (Model.Let {+ Model.letBindings = (Lists.map rewriteBinding (Model.letBindings l)),+ Model.letBody = (substTypesInTerm subst (Model.letBody l))}))+ forTypeApplication =+ \tt -> Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (substTypesInTerm subst (Model.typeApplicationTermBody tt)),+ Model.typeApplicationTermType = (substInType subst (Model.typeApplicationTermType tt))})+ forTypeLambda =+ \ta ->+ let param = Model.typeLambdaParameter ta+ subst2 = Typing.TypeSubst (Maps.delete param (Typing.unTypeSubst subst))+ in (Model.TermTypeLambda (Model.TypeLambda {+ Model.typeLambdaParameter = param,+ Model.typeLambdaBody = (substTypesInTerm subst2 (Model.typeLambdaBody ta))}))+ in case term of+ Model.TermLambda v0 -> forLambda v0+ Model.TermLet v0 -> forLet v0+ Model.TermTypeApplication v0 -> forTypeApplication v0+ Model.TermTypeLambda v0 -> forTypeLambda v0+ _ -> dflt+ in (Rewriting.rewriteTerm rewrite term0)++-- | Apply a term substitution to a binding+substituteInBinding :: Typing.TermSubst -> Model.Binding -> Model.Binding+substituteInBinding subst b =+ Model.Binding {+ Model.bindingName = (Model.bindingName b),+ Model.bindingTerm = (substituteInTerm subst (Model.bindingTerm b)),+ Model.bindingTypeScheme = (Model.bindingTypeScheme b)}++-- | Apply a type substitution to a type constraint+substituteInConstraint :: Typing.TypeSubst -> Typing.TypeConstraint -> Typing.TypeConstraint+substituteInConstraint subst c =+ Typing.TypeConstraint {+ Typing.typeConstraintLeft = (substInType subst (Typing.typeConstraintLeft c)),+ Typing.typeConstraintRight = (substInType subst (Typing.typeConstraintRight c)),+ Typing.typeConstraintComment = (Typing.typeConstraintComment c)}++-- | Apply a type substitution to a list of type constraints+substituteInConstraints :: Typing.TypeSubst -> [Typing.TypeConstraint] -> [Typing.TypeConstraint]+substituteInConstraints subst cs = Lists.map (substituteInConstraint subst) cs++-- | Apply a term substitution to a term+substituteInTerm :: Typing.TermSubst -> Model.Term -> Model.Term+substituteInTerm subst term0 =++ let s = Typing.unTermSubst subst+ rewrite =+ \recurse -> \term ->+ let withLambda =+ \l ->+ let v = Model.lambdaParameter l+ subst2 = Typing.TermSubst (Maps.delete v s)+ in (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = v,+ Model.lambdaDomain = (Model.lambdaDomain l),+ Model.lambdaBody = (substituteInTerm subst2 (Model.lambdaBody l))}))+ withLet =+ \lt ->+ let bindings = Model.letBindings lt+ names = Sets.fromList (Lists.map Model.bindingName bindings)+ subst2 = Typing.TermSubst (Maps.filterWithKey (\k -> \v -> Logic.not (Sets.member k names)) s)+ rewriteBinding =+ \b -> Model.Binding {+ Model.bindingName = (Model.bindingName b),+ Model.bindingTerm = (substituteInTerm subst2 (Model.bindingTerm b)),+ Model.bindingTypeScheme = (Model.bindingTypeScheme b)}+ in (Model.TermLet (Model.Let {+ Model.letBindings = (Lists.map rewriteBinding bindings),+ Model.letBody = (substituteInTerm subst2 (Model.letBody lt))}))+ in case term of+ Model.TermLambda v0 -> withLambda v0+ Model.TermLet v0 -> withLet v0+ Model.TermVariable v0 -> Optionals.match (Maps.lookup v0 s) (recurse term) (\sterm -> sterm)+ _ -> recurse term+ in (Rewriting.rewriteTerm rewrite term0)
@@ -0,0 +1,357 @@+-- Note: this is an automatically generated file. Do not edit.++-- | The term-graph view of a typed graph: nodes are subterms, sharing is explicit, children are inline (a tree with symbolic cross-links). graphToTermGraph builds it; schemaToTypeGraph is the type-side twin. Term graphs are Ariola-Klop's nested systems of recursion equations.++module Hydra.Core.Subterms where++import qualified Hydra.Core.Ast as Ast+import qualified Hydra.Core.Checking as Checking+import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Diff as Diff+import qualified Hydra.Core.Docs as Docs+import qualified Hydra.Core.Error.Checking as ErrorChecking+import qualified Hydra.Core.Error.File as ErrorFile+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Error.Packaging as ErrorPackaging+import qualified Hydra.Core.Error.System as ErrorSystem+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.Extract.Model as ExtractModel+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Json.Model as JsonModel+import qualified Hydra.Core.Lexical as Lexical+import qualified Hydra.Core.Overlay.Haskell.Lib.Eithers as Eithers+import qualified Hydra.Core.Overlay.Haskell.Lib.Equality as Equality+import qualified Hydra.Core.Overlay.Haskell.Lib.Lists as Lists+import qualified Hydra.Core.Overlay.Haskell.Lib.Logic as Logic+import qualified Hydra.Core.Overlay.Haskell.Lib.Maps as Maps+import qualified Hydra.Core.Overlay.Haskell.Lib.Optionals as Optionals+import qualified Hydra.Core.Overlay.Haskell.Lib.Pairs as Pairs+import qualified Hydra.Core.Overlay.Haskell.Lib.Sets as Sets+import qualified Hydra.Core.Overlay.Haskell.Lib.Strings as Strings+import qualified Hydra.Core.Markdown as Markdown+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Parsing as Parsing+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Query as Query+import qualified Hydra.Core.Reflect as Reflect+import qualified Hydra.Core.Regex as Regex+import qualified Hydra.Core.Relational as Relational+import qualified Hydra.Core.Rewriting as Rewriting+import qualified Hydra.Core.Substitution as Substitution+import qualified Hydra.Core.System as System+import qualified Hydra.Core.Tabular as Tabular+import qualified Hydra.Core.Testing as Testing+import qualified Hydra.Core.Time as Time+import qualified Hydra.Core.Topology as Topology+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Validation as Validation+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void+import qualified Data.Map as M+import qualified Data.Set as S++-- | The expected type to thread into an immediate child, given this node's (synthesized) type, its term, and the step reaching the child. This is the term->type position map underlying the TermGraph:TypeGraph erasure: element positions get the container element type, mapEntry gets pair<K,V>, lambdaBody the codomain, and so on. `none` where the child's type is not fixed top-down (e.g. a function-position subterm), which is fine for non-empty children.+expectedForStep :: M.Map Model.Name Model.Type -> Model.Type -> Model.Term -> Paths.SubtermStep -> Maybe Model.Type+expectedForStep schema typ term step =++ let elementOfList =+ \t -> case t of+ Model.TypeList v0 -> Just v0+ _ -> Nothing+ elementOfSet =+ \t -> case t of+ Model.TypeSet v0 -> Just v0+ _ -> Nothing+ elementOfOptional =+ \t -> case t of+ Model.TypeOptional v0 -> Just v0+ _ -> Nothing+ codomainOf =+ \t -> case t of+ Model.TypeFunction v0 -> Just (Model.functionTypeCodomain v0)+ _ -> Nothing+ mapPairType =+ \t -> case t of+ Model.TypeMap v0 -> Just (Model.TypePair (Model.PairType {+ Model.pairTypeFirst = (Model.mapTypeKeys v0),+ Model.pairTypeSecond = (Model.mapTypeValues v0)}))+ _ -> Nothing+ in case step of+ Paths.SubtermStepListElement _ -> elementOfList typ+ Paths.SubtermStepSetElement _ -> elementOfSet typ+ Paths.SubtermStepOptionalGiven -> elementOfOptional typ+ Paths.SubtermStepLambdaBody -> codomainOf typ+ Paths.SubtermStepMapEntry _ -> mapPairType typ+ Paths.SubtermStepPairFirst -> case typ of+ Model.TypePair v1 -> Just (Model.pairTypeFirst v1)+ _ -> Nothing+ Paths.SubtermStepPairSecond -> case typ of+ Model.TypePair v1 -> Just (Model.pairTypeSecond v1)+ _ -> Nothing+ Paths.SubtermStepRecordField v0 -> fieldTypeFromSchema schema term v0+ Paths.SubtermStepInjectField v0 -> fieldTypeFromSchema schema term v0+ _ -> Nothing++-- | The expected type of a record field / injected union field, from the named type in the schema+fieldTypeFromSchema :: M.Map Model.Name Model.Type -> Model.Term -> Model.Name -> Maybe Model.Type+fieldTypeFromSchema schema term fname =+ case term of+ Model.TermRecord v0 -> Optionals.bind (Maps.lookup (Model.recordTypeName v0) schema) (\sty -> Eithers.either (\_ -> Nothing) (\fields -> findFieldTypeIn fname fields) (ExtractModel.recordType (Model.recordTypeName v0) sty))+ Model.TermInject v0 -> Optionals.bind (Maps.lookup (Model.injectionTypeName v0) schema) (\sty -> Eithers.either (\_ -> Nothing) (\fields -> findFieldTypeIn fname fields) (ExtractModel.unionType (Model.injectionTypeName v0) sty))+ _ -> Nothing++-- | The type of the named field within a list of field types, if present+findFieldTypeIn :: Model.Name -> [Model.FieldType] -> Maybe Model.Type+findFieldTypeIn fname fields =+ Optionals.map Model.fieldTypeType (Lists.head (Lists.filter (\f -> Equality.equal (Model.fieldTypeName f) fname) fields))++-- | The term-graph view of a typed graph: one root node per binding. Sharing is explicit; children are inline (a tree); variable occurrences become symbolic references carrying their binding node's id. Input must be a POST-INFERENCE (elaborated) graph: binding schemes present, lambda domains present, typeLambda/typeApplication explicit. Node types are synthesized in one O(n) bidirectional pass; a missing annotation (or an untyped empty leaf) is a precondition failure.+graphToTermGraph :: Graph.Graph -> Either Errors.Error Paths.TermGraph+graphToTermGraph graph =++ let boundTerms = Graph.graphBoundTerms graph+ schema = Maps.map (\ts -> Model.typeSchemeBody ts) (Graph.graphBoundTypes graph)+ in (Eithers.map (\roots -> Paths.TermGraph {+ Paths.termGraphRoots = (Maps.fromList roots)}) (Eithers.mapList (\nt ->+ let name = Pairs.first nt+ term = Pairs.second nt+ expected = rootExpectedType schema name+ in (Eithers.map (\node -> (name, node)) (termGraphNode graph schema name Maps.empty Sets.empty expected (Paths.SubtermPath []) term))) (Maps.toList boundTerms)))++-- | The expected type for a root binding node: its declared type in the schema, if present+rootExpectedType :: Ord t0 => (M.Map t0 t1 -> t0 -> Maybe t1)+rootExpectedType schema name = Maps.lookup name schema++-- | The type-graph view of a schema: one root node per named type. A Type.variable referencing a schema-bound name is a nominal reference; a forall-bound variable in scope is a variable reference to its binding node; leaf types and non-type constituents are carried as links.+schemaToTypeGraph :: M.Map Model.Name Model.Type -> Either Errors.Error Paths.TypeGraph+schemaToTypeGraph schema =++ let schemaNames = Maps.keys schema+ in (Eithers.map (\roots -> Paths.TypeGraph {+ Paths.typeGraphRoots = (Maps.fromList roots)}) (Eithers.mapList (\nt ->+ let name = Pairs.first nt+ typ = Pairs.second nt+ in (Eithers.map (\node -> (name, node)) (typeGraphNode (Sets.fromList schemaNames) name Maps.empty (Paths.SubtypePath []) typ))) (Maps.toList schema)))++-- | Synthesize the type of an elaborated subterm, syntax-directed and without unification, threading `expected` top-down. Reads annotations (lambda domain, typeApplication type) and combines child types bottom-up; synthesis-incomplete leaves (empty list/set/map, optional none, either's absent branch) CONSUME `expected`. `expected = none` at such a leaf is a precondition failure with path.+synthesizeType :: t0 -> M.Map Model.Name Model.Type -> M.Map Model.Name Model.Type -> Model.Name -> Maybe Model.Type -> t1 -> Model.Term -> Either Errors.Error Model.Type+synthesizeType graph schema env root expected path term =++ let recurseInto = \mexp -> \child -> synthesizeType graph schema env root mexp path child+ fail =+ \msg -> Left (Errors.ErrorOther (Errors.OtherError (Strings.concat2 (Strings.concat2 "synthesizeType precondition: " msg) (Strings.concat2 " at " (Model.unName root)))))+ consumeExpected = \what -> Optionals.match expected (fail (Strings.concat2 "untyped " what)) (\t -> Right t)+ elementOfExpected =+ Optionals.bind expected (\t -> case t of+ Model.TypeList v0 -> Just v0+ Model.TypeSet v0 -> Just v0+ Model.TypeOptional v0 -> Just v0+ _ -> Nothing)+ codomainOfExpected =+ Optionals.bind expected (\t -> case t of+ Model.TypeFunction v0 -> Just (Model.functionTypeCodomain v0)+ _ -> Nothing)+ in case term of+ Model.TermApplication v0 -> Eithers.bind (recurseInto Nothing (Model.applicationFunction v0)) (\ftype -> case ftype of+ Model.TypeFunction v1 -> Right (Model.functionTypeCodomain v1)+ _ -> fail "application of a non-function")+ Model.TermLambda v0 -> Optionals.match (Model.lambdaDomain v0) (fail "lambda without a domain annotation") (\dom -> Eithers.map (\bt -> Model.TypeFunction (Model.FunctionType {+ Model.functionTypeDomain = dom,+ Model.functionTypeCodomain = bt})) (recurseInto codomainOfExpected (Model.lambdaBody v0)))+ Model.TermTypeLambda v0 -> Eithers.map (\bt -> Model.TypeForall (Model.ForallType {+ Model.forallTypeParameter = (Model.typeLambdaParameter v0),+ Model.forallTypeBody = bt})) (recurseInto Nothing (Model.typeLambdaBody v0))+ Model.TermTypeApplication v0 -> Eithers.bind (recurseInto Nothing (Model.typeApplicationTermBody v0)) (\bt -> case bt of+ Model.TypeForall v1 -> Right (Substitution.substInType (Substitution.singletonTypeSubst (Model.forallTypeParameter v1) (Model.typeApplicationTermType v0)) (Model.forallTypeBody v1))+ _ -> fail "type application of a non-forall")+ Model.TermVariable v0 -> Optionals.match (Maps.lookup v0 env) (Optionals.match (Maps.lookup v0 schema) (fail (Strings.concat2 "unbound variable " (Model.unName v0))) (\t -> Right t)) (\t -> Right t)+ Model.TermUnit -> Right Model.TypeUnit+ Model.TermLiteral v0 -> Right (Model.TypeLiteral (Reflect.literalType v0))+ Model.TermOptional v0 -> Optionals.match v0 (consumeExpected "optional none") (\t -> Eithers.map (\x -> Model.TypeOptional x) (recurseInto elementOfExpected t))+ Model.TermList v0 -> Optionals.match (Lists.head v0) (consumeExpected "empty list") (\t0 -> Eithers.map (\x -> Model.TypeList x) (recurseInto elementOfExpected t0))+ Model.TermSet v0 -> Optionals.match (Lists.head (Sets.toList v0)) (consumeExpected "empty set") (\t0 -> Eithers.map (\x -> Model.TypeSet x) (recurseInto elementOfExpected t0))+ Model.TermMap v0 -> Optionals.match (Lists.head (Maps.toList v0)) (consumeExpected "empty map") (\kv -> Eithers.bind (recurseInto Nothing (Pairs.first kv)) (\kt -> Eithers.map (\vt -> Model.TypeMap (Model.MapType {+ Model.mapTypeKeys = kt,+ Model.mapTypeValues = vt})) (recurseInto Nothing (Pairs.second kv))))+ Model.TermPair v0 -> Eithers.bind (recurseInto Nothing (Pairs.first v0)) (\ft -> Eithers.map (\st -> Model.TypePair (Model.PairType {+ Model.pairTypeFirst = ft,+ Model.pairTypeSecond = st})) (recurseInto Nothing (Pairs.second v0)))+ Model.TermEither _ -> consumeExpected "either value"+ Model.TermRecord v0 -> Optionals.match (Maps.lookup (Model.recordTypeName v0) schema) (fail (Strings.concat2 "record type not in schema: " (Model.unName (Model.recordTypeName v0)))) (\t -> Right t)+ Model.TermInject v0 -> Optionals.match (Maps.lookup (Model.injectionTypeName v0) schema) (fail (Strings.concat2 "union type not in schema: " (Model.unName (Model.injectionTypeName v0)))) (\t -> Right t)+ Model.TermWrap v0 -> Optionals.match (Maps.lookup (Model.wrappedTermTypeName v0) schema) (fail (Strings.concat2 "wrapper type not in schema: " (Model.unName (Model.wrappedTermTypeName v0)))) (\t -> Right t)+ Model.TermAnnotated v0 -> recurseInto expected (Model.annotatedTermBody v0)+ Model.TermLet v0 -> recurseInto expected (Model.letBody v0)+ Model.TermProject v0 ->+ let tname = Model.projectionTypeName v0+ fname = Model.projectionFieldName v0+ in (Optionals.match (Maps.lookup tname schema) (fail (Strings.concat2 "projection type not in schema: " (Model.unName tname))) (\sty -> Eithers.bind (ExtractModel.recordType tname sty) (\fields -> Optionals.match (findFieldTypeIn fname fields) (fail (Strings.concat2 "projected field not in record type: " (Model.unName fname))) (\ftyp -> Right (Model.TypeFunction (Model.FunctionType {+ Model.functionTypeDomain = (Model.TypeVariable tname),+ Model.functionTypeCodomain = ftyp}))))))+ Model.TermUnwrap v0 -> Optionals.match (Maps.lookup v0 schema) (fail (Strings.concat2 "unwrap type not in schema: " (Model.unName v0))) (\sty -> Eithers.map (\inner -> Model.TypeFunction (Model.FunctionType {+ Model.functionTypeDomain = (Model.TypeVariable v0),+ Model.functionTypeCodomain = inner})) (ExtractModel.wrappedType v0 sty))+ Model.TermCases v0 ->+ let tname = Model.caseStatementTypeName v0+ rep =+ Optionals.match (Model.caseStatementDefault v0) (Optionals.map Model.caseAlternativeHandler (Lists.head (Model.caseStatementCases v0))) (\d -> Just d)+ in (Optionals.match rep (fail "case statement with no branches") (\handler -> Eithers.bind (recurseInto Nothing handler) (\htype -> Eithers.map (\ft -> Model.TypeFunction (Model.FunctionType {+ Model.functionTypeDomain = (Model.TypeVariable tname),+ Model.functionTypeCodomain = (Model.functionTypeCodomain ft)})) (ExtractModel.functionType htype))))+ _ -> fail "unsupported term constructor"++-- | The content attribute links contributed by a term constructor (a non-term constituent, with its value)+termAttributesOf :: Model.Term -> [Paths.TermAttributeLink]+termAttributesOf term =+ case term of+ Model.TermCases v0 -> [+ Paths.TermAttributeLinkCasesTypeName (Model.caseStatementTypeName v0)]+ Model.TermInject v0 -> [+ Paths.TermAttributeLinkInjectTypeName (Model.injectionTypeName v0)]+ Model.TermLambda v0 -> Lists.concat2 [+ Paths.TermAttributeLinkLambdaParameter (Model.lambdaParameter v0)] (Optionals.match (Model.lambdaDomain v0) [] (\d -> [+ Paths.TermAttributeLinkLambdaDomainGiven d]))+ Model.TermLiteral v0 -> [+ Paths.TermAttributeLinkLiteral v0]+ Model.TermProject v0 -> [+ Paths.TermAttributeLinkProjectTypeName (Model.projectionTypeName v0),+ (Paths.TermAttributeLinkProjectFieldName (Model.projectionFieldName v0))]+ Model.TermRecord v0 -> [+ Paths.TermAttributeLinkRecordTypeName (Model.recordTypeName v0)]+ Model.TermTypeApplication v0 -> [+ Paths.TermAttributeLinkTypeApplicationType (Model.typeApplicationTermType v0)]+ Model.TermTypeLambda v0 -> [+ Paths.TermAttributeLinkTypeLambdaParameter (Model.typeLambdaParameter v0)]+ Model.TermUnwrap v0 -> [+ Paths.TermAttributeLinkUnwrapTypeName v0]+ Model.TermWrap v0 -> [+ Paths.TermAttributeLinkWrapTypeName (Model.wrappedTermTypeName v0)]+ _ -> []++-- | Build a term-graph node (inline) for the subterm at the given path within a root binding. `env` maps each in-scope local variable to its (binder node id, type); `lambdaScope` marks the lambda-bound subset. `expected` is the type flowing top-down, consumed by synthesis-incomplete leaves. A variable child is not a node: the parent emits a reference link for it.+termGraphNode :: Graph.Graph -> M.Map Model.Name Model.Type -> Model.Name -> M.Map Model.Name (Paths.TermNodeId, Model.Type) -> S.Set Model.Name -> Maybe Model.Type -> Paths.SubtermPath -> Model.Term -> Either Errors.Error Paths.TermNode+termGraphNode graph schema root env lambdaScope expected path term =++ let steps = Paths.unSubtermPath path+ thisId =+ Paths.TermNodeId {+ Paths.termNodeIdRoot = root,+ Paths.termNodeIdPath = path}+ envTypes = Maps.map (\p -> Pairs.second p) env+ childEnv =+ case term of+ Model.TermLambda v0 -> Maps.insert (Model.lambdaParameter v0) (thisId, (Optionals.withDefault (Model.TypeVariable (Model.Name "?")) (Model.lambdaDomain v0))) env+ Model.TermLet v0 -> Lists.foldl (\acc -> \b ->+ let bname = Model.bindingName b+ bid =+ Paths.TermNodeId {+ Paths.termNodeIdRoot = root,+ Paths.termNodeIdPath = (Paths.SubtermPath (Lists.concat2 steps [+ Paths.SubtermStepLetBinding bname]))}+ btype =+ Optionals.withDefault (Model.TypeVariable (Model.Name "?")) (Optionals.map Model.typeSchemeBody (Model.bindingTypeScheme b))+ in (Maps.insert bname (bid, btype) acc)) env (Model.letBindings v0)+ _ -> env+ childLambdaScope =+ case term of+ Model.TermLambda v0 -> Sets.insert (Model.lambdaParameter v0) lambdaScope+ _ -> lambdaScope+ in (Eithers.bind (synthesizeType graph schema envTypes root expected path term) (\typ ->+ let attrLinks = Lists.map (\x -> Paths.TermLinkAttribute x) (termAttributesOf term)+ in (Eithers.bind (Eithers.mapList (\st ->+ let step = Pairs.first st+ child = Pairs.second st+ childPath = Paths.SubtermPath (Lists.concat2 steps [+ step])+ childExpected = expectedForStep schema typ term step+ in case child of+ Model.TermVariable v0 -> Eithers.map (\ref -> Paths.TermLinkReference (Paths.TermReferenceLink {+ Paths.termReferenceLinkStep = step,+ Paths.termReferenceLinkTarget = ref})) (termReferenceFor graph childEnv childLambdaScope v0)+ _ -> Eithers.map (\cnode -> Paths.TermLinkSubterm (Paths.SubtermLink {+ Paths.subtermLinkStep = step,+ Paths.subtermLinkChild = cnode})) (termGraphNode graph schema root childEnv childLambdaScope childExpected childPath child)) (Rewriting.subtermsWithSteps term)) (\childLinks -> Right (Paths.TermNode {+ Paths.termNodeTerm = term,+ Paths.termNodeType = typ,+ Paths.termNodeLinks = (Lists.concat2 attrLinks childLinks)})))))++-- | Classify a variable occurrence, carrying its binder's node id: lambda-bound (node = the binding lambda), let-bound — locally or as a graph binding — (node = the bound term), or a primitive; a free variable is a precondition failure. `lambdaScope` marks which local names are lambda-bound.+termReferenceFor :: Graph.Graph -> M.Map Model.Name (Paths.TermNodeId, Model.Type) -> S.Set Model.Name -> Model.Name -> Either Errors.Error Paths.TermReference+termReferenceFor graph env lambdaScope name =+ Optionals.match (Maps.lookup name env) (Logic.ifElse (Maps.member name (Graph.graphBoundTerms graph)) (Right (Paths.TermReferenceLet (Paths.LetVariableReference {+ Paths.letVariableReferenceVariable = name,+ Paths.letVariableReferenceBindingNode = Paths.TermNodeId {+ Paths.termNodeIdRoot = name,+ Paths.termNodeIdPath = (Paths.SubtermPath [])},+ Paths.letVariableReferenceType = (Optionals.withDefault (Model.TypeVariable (Model.Name "?")) (Optionals.map Model.typeSchemeBody (Maps.lookup name (Graph.graphBoundTypes graph))))}))) (Logic.ifElse (Maps.member name (Graph.graphPrimitives graph)) (Right (Paths.TermReferencePrimitive (Paths.PrimitiveReference {+ Paths.primitiveReferenceName = name,+ Paths.primitiveReferenceType = (Model.TypeVariable (Model.Name "?"))}))) (Left (Errors.ErrorOther (Errors.OtherError (Strings.concat2 "free variable in term graph: " (Model.unName name))))))) (\idType ->+ let binderId = Pairs.first idType+ occType = Pairs.second idType+ in (Logic.ifElse (Sets.member name lambdaScope) (Right (Paths.TermReferenceLambda (Paths.LambdaVariableReference {+ Paths.lambdaVariableReferenceVariable = name,+ Paths.lambdaVariableReferenceBoundByNode = binderId,+ Paths.lambdaVariableReferenceType = occType}))) (Right (Paths.TermReferenceLet (Paths.LetVariableReference {+ Paths.letVariableReferenceVariable = name,+ Paths.letVariableReferenceBindingNode = binderId,+ Paths.letVariableReferenceType = occType})))))++-- | The content attribute links contributed by a type constructor: annotation, forall parameter, or literal type+typeAttributesOf :: Model.Type -> [Paths.TypeAttributeLink]+typeAttributesOf typ =+ case typ of+ Model.TypeAnnotated v0 -> [+ Paths.TypeAttributeLinkAnnotatedAnnotation (Model.annotatedTypeAnnotation v0)]+ Model.TypeForall v0 -> [+ Paths.TypeAttributeLinkForallParameter (Model.forallTypeParameter v0)]+ Model.TypeLiteral v0 -> [+ Paths.TypeAttributeLinkLiteral v0]+ _ -> []++-- | Build a type-graph node (inline) for the subtype at the given path within a named root type+typeGraphNode :: S.Set Model.Name -> Model.Name -> M.Map Model.Name Paths.TypeNodeId -> Paths.SubtypePath -> Model.Type -> Either Errors.Error Paths.TypeNode+typeGraphNode schemaNames root forallScope path typ =+ Eithers.map (\links -> Paths.TypeNode {+ Paths.typeNodeType = typ,+ Paths.typeNodeLinks = links}) (typeLinks schemaNames root forallScope path typ)++-- | The outgoing links of a type node: its content attributes, and one link per immediate subtype — a variable occurrence becomes a reference link on the parent (occurrences are not nodes), any other subtype an inline subtype link. `forallScope` maps each in-scope forall variable to its binding node id.+typeLinks :: S.Set Model.Name -> Model.Name -> M.Map Model.Name Paths.TypeNodeId -> Paths.SubtypePath -> Model.Type -> Either Errors.Error [Paths.TypeLink]+typeLinks schemaNames root forallScope path typ =++ let steps = Paths.unSubtypePath path+ thisId =+ Paths.TypeNodeId {+ Paths.typeNodeIdRoot = root,+ Paths.typeNodeIdPath = path}+ attrLinks = Lists.map (\x -> Paths.TypeLinkAttribute x) (typeAttributesOf typ)+ childScope =+ case typ of+ Model.TypeForall v0 -> Maps.insert (Model.forallTypeParameter v0) thisId forallScope+ _ -> forallScope+ in (Eithers.bind (Eithers.mapList (\st ->+ let step = Pairs.first st+ child = Pairs.second st+ childPath = Paths.SubtypePath (Lists.concat2 steps [+ step])+ in case child of+ Model.TypeVariable v0 -> Eithers.map (\ref -> Paths.TypeLinkReference (Paths.TypeReferenceLink {+ Paths.typeReferenceLinkStep = step,+ Paths.typeReferenceLinkTarget = ref})) (typeReferenceFor schemaNames childScope v0)+ _ -> Eithers.map (\cnode -> Paths.TypeLinkSubtype (Paths.SubtypeLink {+ Paths.subtypeLinkStep = step,+ Paths.subtypeLinkChild = cnode})) (typeGraphNode schemaNames root childScope childPath child)) (Rewriting.subtypesWithSteps typ)) (\childLinks -> Right (Lists.concat2 attrLinks childLinks)))++-- | Classify a type variable occurrence: a schema-bound name is a nominal reference; a forall-bound variable in scope is a variable reference carrying its binding forall's node id; anything else is a free-variable precondition failure.+typeReferenceFor :: S.Set Model.Name -> M.Map Model.Name Paths.TypeNodeId -> Model.Name -> Either Errors.Error Paths.TypeReference+typeReferenceFor schemaNames forallScope name =+ Logic.ifElse (Sets.member name schemaNames) (Right (Paths.TypeReferenceNominal (Paths.NominalTypeReference {+ Paths.nominalTypeReferenceName = name}))) (Optionals.match (Maps.lookup name forallScope) (Left (Errors.ErrorOther (Errors.OtherError (Strings.concat2 "free type variable in type graph: " (Model.unName name))))) (\binderId -> Right (Paths.TypeReferenceVariable (Paths.TypeVariableReference {+ Paths.typeVariableReferenceVariable = name,+ Paths.typeVariableReferenceBoundByNode = binderId}))))
@@ -0,0 +1,71 @@+-- Note: this is an automatically generated file. Do not edit.++-- | A model for a program's interface to the host operating system: running other programs, the environment, the working directory, and process exit status. Names and semantics follow the POSIX System Interfaces (XSH) volume; see https://pubs.opengroup.org/onlinepubs/9799919799. Only the portable, cross-platform subset is modeled.++module Hydra.Core.System where++import qualified Hydra.Core.File as File+import qualified Hydra.Core.Model as Model+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void+import qualified Data.ByteString as B+import qualified Data.Map as M++-- | A description of a program to run, supplying the inputs the POSIX posix_spawn / execve family takes: the executable, its argument vector, and optionally a working directory and a replacement environment. Only the portable subset is modeled; POSIX file actions, spawn attributes, and signal masks are omitted. See https://pubs.opengroup.org/onlinepubs/9799919799/functions/posix_spawn.html and https://pubs.opengroup.org/onlinepubs/9799919799/functions/execve.html+data Command =+ Command {+ -- | The executable to run; a POSIX pathname, resolved against PATH by the host when it contains no slash (as for the execvp/execlp family). POSIX argv[0] (the program name) is supplied by the host from this field+ commandProgram :: File.FilePath,+ -- | The arguments following the program name, becoming argv[1..] for the child. The program name (argv[0]) is not included here+ commandArguments :: [String],+ -- | The directory in which to run the child, as if chdir() (XSH, https://pubs.opengroup.org/onlinepubs/9799919799/functions/chdir.html) were called before exec. None inherits the parent's working directory+ commandWorkingDirectory :: (Maybe File.FilePath),+ -- | The complete environment for the child (POSIX environ). None inherits the parent's environment; given(m) replaces it entirely, as execve's envp argument does. There is no partial-merge form; merge in pure code before calling+ commandEnvironment :: (Maybe (M.Map EnvironmentVariable String))}+ deriving (Eq, Ord, Read, Show)++_Command = Model.Name "hydra.core.system.Command"++_Command_program = Model.Name "program"++_Command_arguments = Model.Name "arguments"++_Command_workingDirectory = Model.Name "workingDirectory"++_Command_environment = Model.Name "environment"++-- | The name of an environment variable: its identity within the POSIX environment list environ (XBD section 8, Environment Variables, https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/V1_chap08.html). POSIX models each entry as a "name=value" string; this type wraps the name, which is the constrained, identifying part: XBD section 8 requires names to consist of characters from the portable character set and to contain no '=' (the name/value separator). A variable's value is an arbitrary string and is left unwrapped+newtype EnvironmentVariable =+ EnvironmentVariable {+ unEnvironmentVariable :: String}+ deriving (Eq, Ord, Read, Show)++_EnvironmentVariable = Model.Name "hydra.core.system.EnvironmentVariable"++-- | The outcome of a child process that ran to completion, as obtained by wait() / waitpid() (XSH, https://pubs.opengroup.org/onlinepubs/9799919799/functions/wait.html) together with its captured output. Only normal termination is modeled directly; abnormal termination (POSIX WIFSIGNALED) is surfaced through exitCode using the host's convention rather than as a separate field+data ProcessResult =+ ProcessResult {+ -- | The child's exit status (POSIX WEXITSTATUS); 0 denotes success by convention+ processResultExitCode :: StatusCode,+ -- | The bytes the child wrote to file descriptor 1, standard output (XBD STDOUT_FILENO)+ processResultStdout :: B.ByteString,+ -- | The bytes the child wrote to file descriptor 2, standard error (XBD STDERR_FILENO)+ processResultStderr :: B.ByteString}+ deriving (Eq, Ord, Read, Show)++_ProcessResult = Model.Name "hydra.core.system.ProcessResult"++_ProcessResult_exitCode = Model.Name "exitCode"++_ProcessResult_stdout = Model.Name "stdout"++_ProcessResult_stderr = Model.Name "stderr"++-- | A process exit status: the value passed to the POSIX exit() function and reported by wait() / waitpid() for a normally-terminated child (XSH; see https://pubs.opengroup.org/onlinepubs/9799919799/functions/exit.html and https://pubs.opengroup.org/onlinepubs/9799919799/functions/wait.html). By the convention of XCU section 2.8.2, Exit Status for Commands (https://pubs.opengroup.org/onlinepubs/9799919799/utilities/V3_chap02.html#tag_19_08_02), 0 denotes success and non-zero denotes failure. POSIX passes only the low 8 bits of the status through wait(); Hydra widens this to a signed int32 so that host runtimes which expose a fuller code (e.g. Windows process exit codes, or the negative "killed by signal N" convention) can be represented without loss+newtype StatusCode =+ StatusCode {+ unStatusCode :: Int}+ deriving (Eq, Ord, Read, Show)++_StatusCode = Model.Name "hydra.core.system.StatusCode"
@@ -0,0 +1,68 @@+-- Note: this is an automatically generated file. Do not edit.++-- | A simple, untyped tabular data model, suitable for CSVs and TSVs++module Hydra.Core.Tabular where++import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Relational as Relational+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | A column type, consisting of a name and a value type+data ColumnType =+ ColumnType {+ columnTypeName :: Relational.ColumnName,+ columnTypeType :: Model.Type}+ deriving (Eq, Ord, Read, Show)++_ColumnType = Model.Name "hydra.core.tabular.ColumnType"++_ColumnType_name = Model.Name "name"++_ColumnType_type = Model.Name "type"++-- | A data row, containing optional-valued cells; one per column+newtype DataRow v =+ DataRow {+ unDataRow :: [Maybe v]}+ deriving (Eq, Ord, Read, Show)++_DataRow = Model.Name "hydra.core.tabular.DataRow"++-- | A header row, containing column names (but no types or data)+newtype HeaderRow =+ HeaderRow {+ unHeaderRow :: [String]}+ deriving (Eq, Ord, Read, Show)++_HeaderRow = Model.Name "hydra.core.tabular.HeaderRow"++-- | A simple table as in a CSV file, having an optional header row and any number of data rows+data Table v =+ Table {+ -- | The optional header row of the table. If present, the header must have the same number of cells as each data row.+ tableHeader :: (Maybe HeaderRow),+ -- | The data rows of the table. Each row must have the same number of cells.+ tableData :: [DataRow v]}+ deriving (Eq, Ord, Read, Show)++_Table = Model.Name "hydra.core.tabular.Table"++_Table_header = Model.Name "header"++_Table_data = Model.Name "data"++-- | A type definition for a table, including column names and types+data TableType =+ TableType {+ tableTypeName :: Relational.RelationName,+ tableTypeColumns :: [ColumnType]}+ deriving (Eq, Ord, Read, Show)++_TableType = Model.Name "hydra.core.tabular.TableType"++_TableType_name = Model.Name "name"++_TableType_columns = Model.Name "columns"
@@ -0,0 +1,123 @@+-- Note: this is an automatically generated file. Do not edit.++-- | A utility which instantiates a nonrecursive type with default values++module Hydra.Core.Templates where++import qualified Hydra.Core.Ast as Ast+import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Constants as Constants+import qualified Hydra.Core.Decode.Model as DecodeModel+import qualified Hydra.Core.Diff as Diff+import qualified Hydra.Core.Docs as Docs+import qualified Hydra.Core.Error.Checking as Checking+import qualified Hydra.Core.Error.File as ErrorFile+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Error.Packaging as ErrorPackaging+import qualified Hydra.Core.Error.System as ErrorSystem+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Json.Model as JsonModel+import qualified Hydra.Core.Overlay.Haskell.Lib.Eithers as Eithers+import qualified Hydra.Core.Overlay.Haskell.Lib.Logic as Logic+import qualified Hydra.Core.Overlay.Haskell.Lib.Maps as Maps+import qualified Hydra.Core.Overlay.Haskell.Lib.Optionals as Optionals+import qualified Hydra.Core.Overlay.Haskell.Lib.Sets as Sets+import qualified Hydra.Core.Overlay.Haskell.Lib.Strings as Strings+import qualified Hydra.Core.Markdown as Markdown+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Parsing as Parsing+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Print.Model as PrintModel+import qualified Hydra.Core.Query as Query+import qualified Hydra.Core.Regex as Regex+import qualified Hydra.Core.Relational as Relational+import qualified Hydra.Core.System as System+import qualified Hydra.Core.Tabular as Tabular+import qualified Hydra.Core.Testing as Testing+import qualified Hydra.Core.Time as Time+import qualified Hydra.Core.Topology as Topology+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Validation as Validation+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void+import qualified Data.Map as M+import qualified Hydra.Core.Overlay.Haskell.Lib.Literals as Literals++-- | Decode a list of type-encoding bindings into a map of named types+graphToSchema :: t0 -> Graph.Graph -> [Model.Binding] -> Either Errors.DecodingError (M.Map Model.Name Model.Type)+graphToSchema cx graph els =++ let toPair =+ \el ->+ let name = Model.bindingName el+ in (Eithers.bind (DecodeModel.type_ graph (Model.bindingTerm el)) (\t -> Right (name, t)))+ in (Eithers.bind (Eithers.mapList toPair els) (\pairs -> Right (Maps.fromList pairs)))++-- | Given a graph schema and a nonrecursive type, instantiate it with default values. If the minimal flag is set, the smallest possible term is produced; otherwise, exactly one subterm is produced for constructors which do not otherwise require one, e.g. in lists and optionals. The name parameter provides the element name for nominal type construction.+instantiateTemplate :: t0 -> Bool -> M.Map Model.Name Model.Type -> Model.Name -> Model.Type -> Either Errors.Error Model.Term+instantiateTemplate cx minimal schema tname t =++ let inst = \tn -> instantiateTemplate cx minimal schema tn+ noPoly =+ Left (Errors.ErrorExtraction (Errors.ExtractionErrorUnexpectedShape (Errors.UnexpectedShapeError {+ Errors.unexpectedShapeErrorExpected = "non-polymorphic type",+ Errors.unexpectedShapeErrorActual = "polymorphic or function type"})))+ forFloat =+ \ft -> case ft of+ Model.FloatTypeFloat32 -> Model.FloatValueFloat32 0.0+ Model.FloatTypeFloat64 -> Model.FloatValueFloat64 0.0+ forInteger =+ \it -> case it of+ Model.IntegerTypeBigint -> Model.IntegerValueBigint 0+ Model.IntegerTypeInt8 -> Model.IntegerValueInt8 0+ Model.IntegerTypeInt16 -> Model.IntegerValueInt16 0+ Model.IntegerTypeInt32 -> Model.IntegerValueInt32 0+ Model.IntegerTypeInt64 -> Model.IntegerValueInt64 0+ Model.IntegerTypeUint8 -> Model.IntegerValueUint8 0+ Model.IntegerTypeUint16 -> Model.IntegerValueUint16 0+ Model.IntegerTypeUint32 -> Model.IntegerValueUint32 0+ Model.IntegerTypeUint64 -> Model.IntegerValueUint64 0+ forLiteral =+ \lt -> case lt of+ Model.LiteralTypeBinary -> Model.LiteralString ""+ Model.LiteralTypeBoolean -> Model.LiteralBoolean False+ Model.LiteralTypeDecimal -> Model.LiteralDecimal (Literals.stringToDecimal "0")+ Model.LiteralTypeInteger v0 -> Model.LiteralInteger (forInteger v0)+ Model.LiteralTypeFloat v0 -> Model.LiteralFloat (forFloat v0)+ Model.LiteralTypeString -> Model.LiteralString ""+ in case t of+ Model.TypeAnnotated v0 -> inst tname (Model.annotatedTypeBody v0)+ Model.TypeApplication _ -> noPoly+ Model.TypeFunction _ -> noPoly+ Model.TypeForall _ -> noPoly+ Model.TypeList v0 -> Logic.ifElse minimal (Right (Model.TermList [])) (Eithers.bind (inst tname v0) (\e -> Right (Model.TermList [+ e])))+ Model.TypeLiteral v0 -> Right (Model.TermLiteral (forLiteral v0))+ Model.TypeMap v0 ->+ let kt = Model.mapTypeKeys v0+ vt = Model.mapTypeValues v0+ in (Logic.ifElse minimal (Right (Model.TermMap Maps.empty)) (Eithers.bind (inst tname kt) (\ke -> Eithers.bind (inst tname vt) (\ve -> Right (Model.TermMap (Maps.singleton ke ve))))))+ Model.TypeOptional v0 -> Logic.ifElse minimal (Right (Model.TermOptional Nothing)) (Eithers.bind (inst tname v0) (\e -> Right (Model.TermOptional (Just e))))+ Model.TypeRecord v0 ->+ let toField =+ \ft -> Eithers.bind (inst tname (Model.fieldTypeType ft)) (\e -> Right (Model.Field {+ Model.fieldName = (Model.fieldTypeName ft),+ Model.fieldTerm = e}))+ in (Eithers.bind (Eithers.mapList toField v0) (\dfields -> Right (Model.TermRecord (Model.Record {+ Model.recordTypeName = tname,+ Model.recordFields = dfields}))))+ Model.TypeSet v0 -> Logic.ifElse minimal (Right (Model.TermSet Sets.empty)) (Eithers.bind (inst tname v0) (\e -> Right (Model.TermSet (Sets.fromList [+ e]))))+ Model.TypeVariable v0 -> Optionals.match (Maps.lookup v0 schema) (Left (Errors.ErrorResolution (Errors.ResolutionErrorUnexpectedShape (Errors.UnexpectedShapeError {+ Errors.unexpectedShapeErrorExpected = "bound type variable",+ Errors.unexpectedShapeErrorActual = (Strings.concat2 "unbound variable " (Model.unName v0))})))) (inst v0)+ Model.TypeWrap v0 -> Eithers.bind (inst tname v0) (\e -> Right (Model.TermWrap (Model.WrappedTerm {+ Model.wrappedTermTypeName = tname,+ Model.wrappedTermBody = e})))
@@ -0,0 +1,147 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Transform test cases for code generation, filtering to tests that can be compiled to target languages++module Hydra.Core.Test.Transform where++import qualified Hydra.Core.Ast as Ast+import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Diff as Diff+import qualified Hydra.Core.Docs as Docs+import qualified Hydra.Core.Error.Checking as Checking+import qualified Hydra.Core.Error.File as ErrorFile+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Error.Packaging as ErrorPackaging+import qualified Hydra.Core.Error.System as ErrorSystem+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Formatting as Formatting+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Json.Model as JsonModel+import qualified Hydra.Core.Overlay.Haskell.Lib.Eithers as Eithers+import qualified Hydra.Core.Overlay.Haskell.Lib.Lists as Lists+import qualified Hydra.Core.Overlay.Haskell.Lib.Logic as Logic+import qualified Hydra.Core.Overlay.Haskell.Lib.Optionals as Optionals+import qualified Hydra.Core.Overlay.Haskell.Lib.Pairs as Pairs+import qualified Hydra.Core.Overlay.Haskell.Lib.Strings as Strings+import qualified Hydra.Core.Markdown as Markdown+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Parsing as Parsing+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Query as Query+import qualified Hydra.Core.Regex as Regex+import qualified Hydra.Core.Relational as Relational+import qualified Hydra.Core.Sorting as Sorting+import qualified Hydra.Core.System as System+import qualified Hydra.Core.Tabular as Tabular+import qualified Hydra.Core.Testing as Testing+import qualified Hydra.Core.Time as Time+import qualified Hydra.Core.Topology as Topology+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Validation as Validation+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | Add generation namespace prefix+addGenerationPrefix :: Packaging.ModuleName -> Packaging.ModuleName+addGenerationPrefix ns_ = Packaging.ModuleName (Strings.concat2 "generation." (Packaging.unModuleName ns_))++-- | Build a Term representing a convertCase function call+buildConvertCaseCall :: Util.CaseConvention -> Util.CaseConvention -> String -> Model.Term+buildConvertCaseCall fromConv toConv input_ =+ Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.formatting.convertCase")),+ Model.applicationArgument = (encodeCaseConvention fromConv)})),+ Model.applicationArgument = (encodeCaseConvention toConv)})),+ Model.applicationArgument = (Model.TermLiteral (Model.LiteralString input_))})++-- | Build a Term representing a topologicalSort function call+buildTopologicalSortCall :: [(Int, [Int])] -> Model.Term+buildTopologicalSortCall adjList =+ Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.sorting.topologicalSort")),+ Model.applicationArgument = (encodeAdjacencyList adjList)})++-- | Build a Term representing a topologicalSortComponents function call+buildTopologicalSortSCCCall :: [(Int, [Int])] -> Model.Term+buildTopologicalSortSCCCall adjList =+ Model.TermApplication (Model.Application {+ Model.applicationFunction = (Model.TermVariable (Model.Name "hydra.core.sorting.topologicalSortComponents")),+ Model.applicationArgument = (encodeAdjacencyList adjList)})++-- | Collect all test cases from a test group (flattening hierarchy)+collectTestCases :: Testing.TestGroup -> [Testing.TestCaseWithMetadata]+collectTestCases tg =+ Lists.concat2 (Testing.testGroupCases tg) (Lists.concat (Lists.map (\sg -> collectTestCases sg) (Testing.testGroupSubgroups tg)))++-- | Encode an adjacency list as a Term+encodeAdjacencyList :: [(Int, [Int])] -> Model.Term+encodeAdjacencyList pairs =+ Model.TermList (Lists.map (\p -> Model.TermPair (encodeInt (Pairs.first p), (Model.TermList (Lists.map (\d -> encodeInt d) (Pairs.second p))))) pairs)++-- | Encode CaseConvention as a Term (unit variant)+encodeCaseConvention :: Util.CaseConvention -> Model.Term+encodeCaseConvention conv =+ Model.TermInject (Model.Injection {+ Model.injectionTypeName = (Model.Name "hydra.core.util.CaseConvention"),+ Model.injectionField = Model.Field {+ Model.fieldName = case conv of+ Util.CaseConventionLowerSnake -> Model.Name "lowerSnake"+ Util.CaseConventionUpperSnake -> Model.Name "upperSnake"+ Util.CaseConventionCamel -> Model.Name "camel"+ Util.CaseConventionPascal -> Model.Name "pascal"+ Util.CaseConventionUpperDashed -> Model.Name "upperDashed",+ Model.fieldTerm = Model.TermUnit}})++-- | Encode Either [[Int]] [Int] as a Term+encodeEitherListList :: Either [[Int]] [Int] -> Model.Term+encodeEitherListList e =+ Model.TermEither (Eithers.bimap (\cycles -> encodeListList cycles) (\sorted -> encodeIntList sorted) e)++-- | Encode an Int as a Term+encodeInt :: Int -> Model.Term+encodeInt n = Model.TermLiteral (Model.LiteralInteger (Model.IntegerValueInt32 n))++-- | Encode [Int] as a Term+encodeIntList :: [Int] -> Model.Term+encodeIntList ints = Model.TermList (Lists.map (\n -> encodeInt n) ints)++-- | Encode [[Int]] as a Term+encodeListList :: [[Int]] -> Model.Term+encodeListList lists = Model.TermList (Lists.map (\l -> encodeIntList l) lists)++-- | Transform module with generation namespace+transformModule :: Packaging.Module -> Packaging.Module+transformModule m =+ Packaging.Module {+ Packaging.moduleName = (addGenerationPrefix (Packaging.moduleName m)),+ Packaging.moduleMetadata = (Packaging.moduleMetadata m),+ Packaging.moduleDependencies = (Packaging.moduleDependencies m),+ Packaging.moduleDefinitions = (Packaging.moduleDefinitions m)}++-- | Pass through test cases unchanged+transformTestCase :: t0 -> Maybe t0+transformTestCase tcm = Just tcm++-- | Transform test group hierarchy to only include delegated evaluation tests+transformToCompiledTests :: Testing.TestGroup -> Maybe Testing.TestGroup+transformToCompiledTests tg =++ let name_ = Testing.testGroupName tg+ desc = Testing.testGroupDescription tg+ subgroups = Testing.testGroupSubgroups tg+ cases_ = Testing.testGroupCases tg+ transformedCases = Optionals.givens (Lists.map (\tc -> transformTestCase tc) cases_)+ transformedSubgroups = Optionals.givens (Lists.map (\sg -> transformToCompiledTests sg) subgroups)+ in (Logic.ifElse (Logic.and (Lists.isEmpty transformedCases) (Lists.isEmpty transformedSubgroups)) Nothing (Just (Testing.TestGroup {+ Testing.testGroupName = name_,+ Testing.testGroupDescription = desc,+ Testing.testGroupSubgroups = transformedSubgroups,+ Testing.testGroupCases = transformedCases})))
@@ -0,0 +1,79 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Shared utility functions for test code generation codecs++module Hydra.Core.Test.Utils where++import qualified Hydra.Core.Ast as Ast+import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Diff as Diff+import qualified Hydra.Core.Docs as Docs+import qualified Hydra.Core.Error.Checking as Checking+import qualified Hydra.Core.Error.File as ErrorFile+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Error.Packaging as ErrorPackaging+import qualified Hydra.Core.Error.System as ErrorSystem+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Inference as Inference+import qualified Hydra.Core.Json.Model as JsonModel+import qualified Hydra.Core.Lexical as Lexical+import qualified Hydra.Core.Overlay.Haskell.Lib.Eithers as Eithers+import qualified Hydra.Core.Markdown as Markdown+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Parsing as Parsing+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Print.Errors as PrintErrors+import qualified Hydra.Core.Query as Query+import qualified Hydra.Core.Regex as Regex+import qualified Hydra.Core.Relational as Relational+import qualified Hydra.Core.System as System+import qualified Hydra.Core.Tabular as Tabular+import qualified Hydra.Core.Testing as Testing+import qualified Hydra.Core.Time as Time+import qualified Hydra.Core.Topology as Topology+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Validation as Validation+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | Run type inference on a single term+inferTerm :: Graph.Graph -> Model.Term -> Either String Model.Term+inferTerm g term =+ Eithers.bimap (\e -> PrintErrors.error e) (\x -> Typing.inferenceResultTerm x) (Inference.inferInGraphContext Lexical.emptyInferenceContext g term)++-- | Run type inference on the terms in a test case+inferTestCase :: t0 -> Testing.TestCaseWithMetadata -> Either t1 Testing.TestCaseWithMetadata+inferTestCase g tcm =++ let name_ = Testing.testCaseWithMetadataName tcm+ tcase = Testing.testCaseWithMetadataCase tcm+ desc = Testing.testCaseWithMetadataDescription tcm+ tags_ = Testing.testCaseWithMetadataTags tcm+ provisions_ = Testing.testCaseWithMetadataProvisions tcm+ in (Eithers.map (\inferredCase -> Testing.TestCaseWithMetadata {+ Testing.testCaseWithMetadataName = name_,+ Testing.testCaseWithMetadataCase = inferredCase,+ Testing.testCaseWithMetadataDescription = desc,+ Testing.testCaseWithMetadataTags = tags_,+ Testing.testCaseWithMetadataProvisions = provisions_}) (Right tcase))++-- | Run type inference on all terms in a TestGroup to ensure lambdas have domain types+inferTestGroupTerms :: t0 -> Testing.TestGroup -> Either t1 Testing.TestGroup+inferTestGroupTerms g tg =++ let name_ = Testing.testGroupName tg+ desc = Testing.testGroupDescription tg+ subgroups = Testing.testGroupSubgroups tg+ cases_ = Testing.testGroupCases tg+ in (Eithers.bind (Eithers.mapList (\sg -> inferTestGroupTerms g sg) subgroups) (\inferredSubgroups -> Eithers.map (\inferredCases -> Testing.TestGroup {+ Testing.testGroupName = name_,+ Testing.testGroupDescription = desc,+ Testing.testGroupSubgroups = inferredSubgroups,+ Testing.testGroupCases = inferredCases}) (Eithers.mapList (\tc -> inferTestCase g tc) cases_)))
@@ -0,0 +1,107 @@+-- Note: this is an automatically generated file. Do not edit.++-- | A model for unit testing++module Hydra.Core.Testing where++import qualified Hydra.Core.Model as Model+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | An effectful test case: the actual value is a thunk producing an effect, which the test runner interprets (performing host interactions, e.g. file I/O within a per-case empty temporary directory) to obtain a result string; the expected value is a thunk producing a string.+data EffectfulTestCase =+ EffectfulTestCase {+ -- | A thunk producing the effect to be interpreted by the test runner. The thunk defers construction of the effect until the runner forces it.+ effectfulTestCaseActual :: (() -> IO String),+ -- | A thunk producing the expected result string.+ effectfulTestCaseExpected :: (() -> String)}++_EffectfulTestCase = Model.Name "hydra.core.testing.EffectfulTestCase"++_EffectfulTestCase_actual = Model.Name "actual"++_EffectfulTestCase_expected = Model.Name "expected"++-- | A tag for test cases+newtype Tag =+ Tag {+ unTag :: String}+ deriving (Eq, Ord, Read, Show)++_Tag = Model.Name "hydra.core.testing.Tag"++-- | A test case with an actual and expected string for comparison+data TestCase =+ -- | An effectful test case (interpret an effect, then string comparison)+ TestCaseEffectful EffectfulTestCase |+ -- | A universal test case (string comparison)+ TestCaseUniversal UniversalTestCase++_TestCase = Model.Name "hydra.core.testing.TestCase"++_TestCase_effectful = Model.Name "effectful"++_TestCase_universal = Model.Name "universal"++-- | A test case together with metadata+data TestCaseWithMetadata =+ TestCaseWithMetadata {+ -- | A short name for the test case+ testCaseWithMetadataName :: String,+ -- | The test case itself+ testCaseWithMetadataCase :: TestCase,+ -- | An optional longer description of the test case+ testCaseWithMetadataDescription :: (Maybe String),+ -- | Zero or more tags for the test case+ testCaseWithMetadataTags :: [Tag],+ -- | The fully-qualified names of zero or more provisions (hydra.core.packaging.Provision) which this test case confirms. A provision is authoritative with zero, one, or many confirming tests.+ testCaseWithMetadataProvisions :: [Model.Name]}++_TestCaseWithMetadata = Model.Name "hydra.core.testing.TestCaseWithMetadata"++_TestCaseWithMetadata_name = Model.Name "name"++_TestCaseWithMetadata_case = Model.Name "case"++_TestCaseWithMetadata_description = Model.Name "description"++_TestCaseWithMetadata_tags = Model.Name "tags"++_TestCaseWithMetadata_provisions = Model.Name "provisions"++-- | A collection of test cases with a name and optional description+data TestGroup =+ TestGroup {+ -- | A short name for the test group+ testGroupName :: String,+ -- | An optional longer description of the test group+ testGroupDescription :: (Maybe String),+ -- | Zero or more subgroups+ testGroupSubgroups :: [TestGroup],+ -- | Zero or more test cases+ testGroupCases :: [TestCaseWithMetadata]}++_TestGroup = Model.Name "hydra.core.testing.TestGroup"++_TestGroup_name = Model.Name "name"++_TestGroup_description = Model.Name "description"++_TestGroup_subgroups = Model.Name "subgroups"++_TestGroup_cases = Model.Name "cases"++-- | A universal test case: the actual and expected values are thunks producing strings.+data UniversalTestCase =+ UniversalTestCase {+ -- | A thunk producing the actual result string. Wrapping in a thunk defers expression evaluation until the test runner forces it, so eagerly-evaluated hosts measure expression cost inside their timing bracket rather than at test-data load time.+ universalTestCaseActual :: (() -> String),+ -- | A thunk producing the expected result string.+ universalTestCaseExpected :: (() -> String)}++_UniversalTestCase = Model.Name "hydra.core.testing.UniversalTestCase"++_UniversalTestCase_actual = Model.Name "actual"++_UniversalTestCase_expected = Model.Name "expected"
@@ -0,0 +1,26 @@+-- Note: this is an automatically generated file. Do not edit.++-- | A model for points in time++module Hydra.Core.Time where++import qualified Hydra.Core.Model as Model+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void+import qualified Data.Int as I++-- | The POSIX struct timespec, with the same semantics: an instant in time as a number of seconds and nanoseconds since the Unix Epoch (1970-01-01T00:00:00Z). The actual resolution is implementation- and filesystem-defined. See <time.h> (https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/time.h.html) and XBD section 4.19, "Seconds Since the Epoch" (https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/V1_chap04.html#tag_04_19).+data Timespec =+ Timespec {+ -- | Whole seconds since the Unix Epoch; signed, so instants in the far past or distant future are representable+ timespecSeconds :: I.Int64,+ -- | Nanoseconds within the second, in the range [0, 999999999]; unsigned, as the value is never negative+ timespecNanoseconds :: I.Int64}+ deriving (Eq, Ord, Read, Show)++_Timespec = Model.Name "hydra.core.time.Timespec"++_Timespec_seconds = Model.Name "seconds"++_Timespec_nanoseconds = Model.Name "nanoseconds"
@@ -0,0 +1,67 @@+-- Note: this is an automatically generated file. Do not edit.++-- | A model for simple graphs as adjacency lists++module Hydra.Core.Topology where++import qualified Hydra.Core.Model as Model+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void+import qualified Data.Map as M+import qualified Data.Set as S++-- | A directed graph represented as an adjacency list mapping vertices to their outgoing neighbors+type Graph = (M.Map Vertex [Vertex])++_Graph = Model.Name "hydra.core.topology.Graph"++-- | A pair of inverse permutations on lists, used to relate two orderings of the same elements+data OrderingIsomorphism a =+ OrderingIsomorphism {+ -- | Mapping from source ordering to target ordering+ orderingIsomorphismEncode :: ([a] -> [a]),+ -- | Mapping from target ordering to source ordering+ orderingIsomorphismDecode :: ([a] -> [a])}++_OrderingIsomorphism = Model.Name "hydra.core.topology.OrderingIsomorphism"++_OrderingIsomorphism_encode = Model.Name "encode"++_OrderingIsomorphism_decode = Model.Name "decode"++-- | State carried by Tarjan's strongly connected components algorithm during a depth-first traversal+data TarjanState =+ TarjanState {+ -- | Next available index for vertices in the DFS traversal+ tarjanStateCounter :: Int,+ -- | Mapping from vertices to their indices in the DFS traversal+ tarjanStateIndices :: (M.Map Vertex Int),+ -- | Mapping from vertices to their lowest reachable index in the DFS traversal+ tarjanStateLowLinks :: (M.Map Vertex Int),+ -- | Current DFS stack, with vertices in reverse order+ tarjanStateStack :: [Vertex],+ -- | Set of vertices currently on the stack, for quick lookup+ tarjanStateOnStack :: (S.Set Vertex),+ -- | Accumulated strongly connected components, each a list of vertices+ tarjanStateSccs :: [[Vertex]]}+ deriving (Eq, Ord, Read, Show)++_TarjanState = Model.Name "hydra.core.topology.TarjanState"++_TarjanState_counter = Model.Name "counter"++_TarjanState_indices = Model.Name "indices"++_TarjanState_lowLinks = Model.Name "lowLinks"++_TarjanState_stack = Model.Name "stack"++_TarjanState_onStack = Model.Name "onStack"++_TarjanState_sccs = Model.Name "sccs"++-- | A graph vertex, represented as a 32-bit integer identifier+type Vertex = Int++_Vertex = Model.Name "hydra.core.topology.Vertex"
@@ -0,0 +1,56 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Typed (phantom) wrappers for use with Hydra DSLs++module Hydra.Core.Typed where++import qualified Hydra.Core.Model as Model+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | An association of a named term (element) with a phantom type+data TypedBinding a =+ TypedBinding {+ -- | The name of the term+ typedBindingName :: Model.Name,+ -- | The term with its phantom type+ typedBindingTerm :: (TypedTerm a)}+ deriving (Eq, Ord, Read, Show)++_TypedBinding = Model.Name "hydra.core.typed.TypedBinding"++_TypedBinding_name = Model.Name "name"++_TypedBinding_term = Model.Name "term"++-- | An association of a name with a phantom type+newtype TypedName a =+ TypedName {+ unTypedName :: Model.Name}+ deriving (Eq, Ord, Read, Show)++_TypedName = Model.Name "hydra.core.typed.TypedName"++-- | An association of a term with a phantom type+newtype TypedTerm a =+ TypedTerm {+ unTypedTerm :: Model.Term}+ deriving (Eq, Ord, Read, Show)++_TypedTerm = Model.Name "hydra.core.typed.TypedTerm"++-- | An association of a term definition with a phantom type+data TypedTermDefinition a =+ TypedTermDefinition {+ -- | The name of the term+ typedTermDefinitionName :: Model.Name,+ -- | The term with its phantom type+ typedTermDefinitionTerm :: (TypedTerm a)}+ deriving (Eq, Ord, Read, Show)++_TypedTermDefinition = Model.Name "hydra.core.typed.TypedTermDefinition"++_TypedTermDefinition_name = Model.Name "name"++_TypedTermDefinition_term = Model.Name "term"
@@ -0,0 +1,207 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Types supporting type inference and type reconstruction.++module Hydra.Core.Typing where++import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Paths as Paths+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void+import qualified Data.Map as M++-- | A structured representation of a function term's components, replacing ad-hoc tuples. This captures all the information extracted from peeling lambdas, type lambdas, lets, and type applications from a term.+data FunctionStructure env =+ FunctionStructure {+ -- | Type parameters (from type lambdas)+ functionStructureTypeParams :: [Model.Name],+ -- | Value parameters (from lambdas)+ functionStructureParams :: [Model.Name],+ -- | Let bindings accumulated from the term+ functionStructureBindings :: [Model.Binding],+ -- | The body term after removing all lambdas, lets, etc.+ functionStructureBody :: Model.Term,+ -- | Domain types of the value parameters+ functionStructureDomains :: [Model.Type],+ -- | The return type of the function (if type inference succeeded)+ functionStructureCodomain :: (Maybe Model.Type),+ -- | Updated environment after processing all bindings+ functionStructureEnvironment :: env}+ deriving (Eq, Ord, Read, Show)++_FunctionStructure = Model.Name "hydra.core.typing.FunctionStructure"++_FunctionStructure_typeParams = Model.Name "typeParams"++_FunctionStructure_params = Model.Name "params"++_FunctionStructure_bindings = Model.Name "bindings"++_FunctionStructure_body = Model.Name "body"++_FunctionStructure_domains = Model.Name "domains"++_FunctionStructure_codomain = Model.Name "codomain"++_FunctionStructure_environment = Model.Name "environment"++-- | State threaded through type inference: the fresh type variable counter and the current subterm-path trace.+data InferenceContext =+ InferenceContext {+ -- | Counter used to generate distinct fresh type variables during inference+ inferenceContextFreshTypeVariableCount :: Int,+ -- | The current subterm-path trace, accumulated backwards (head = most-recently-pushed step, corresponding to the deepest point in the descent). At the moment an inference error is constructed, the list is reversed and wrapped into a SubtermPath (root-to-leaf order) and stamped onto the error.+ inferenceContextTrace :: [Paths.SubtermStep]}+ deriving (Eq, Ord, Read, Show)++_InferenceContext = Model.Name "hydra.core.typing.InferenceContext"++_InferenceContext_freshTypeVariableCount = Model.Name "freshTypeVariableCount"++_InferenceContext_trace = Model.Name "trace"++-- | The result of applying inference rules to a term.+data InferenceResult =+ InferenceResult {+ -- | The term which was inferred+ inferenceResultTerm :: Model.Term,+ -- | The inferred type of the term+ inferenceResultType :: Model.Type,+ -- | The type substitution resulting from unification+ inferenceResultSubst :: TypeSubst,+ -- | Class constraints discovered during inference (e.g., Ord constraints from Map.lookup)+ inferenceResultClassConstraints :: (M.Map Model.Name Model.TypeVariableConstraints),+ -- | The updated InferenceContext after inference (carries fresh-variable counter and trace)+ inferenceResultContext :: InferenceContext}+ deriving (Eq, Ord, Read, Show)++_InferenceResult = Model.Name "hydra.core.typing.InferenceResult"++_InferenceResult_term = Model.Name "term"++_InferenceResult_type = Model.Name "type"++_InferenceResult_subst = Model.Name "subst"++_InferenceResult_classConstraints = Model.Name "classConstraints"++_InferenceResult_context = Model.Name "context"++-- | A named, typed parameter of a term, with optional human-readable description and a flag indicating whether the parameter requires lazy evaluation by hosts which support it.+data Parameter =+ Parameter {+ -- | The name of the parameter+ parameterName :: Model.Name,+ -- | An optional human-readable description of the parameter+ parameterDescription :: (Maybe String),+ -- | The type of the parameter+ parameterType :: Model.Type,+ -- | Whether the parameter must be passed lazily (thunked) at call sites in hosts that distinguish strict from lazy evaluation+ parameterIsLazy :: Bool}+ deriving (Eq, Ord, Read, Show)++_Parameter = Model.Name "hydra.core.typing.Parameter"++_Parameter_name = Model.Name "name"++_Parameter_description = Model.Name "description"++_Parameter_type = Model.Name "type"++_Parameter_isLazy = Model.Name "isLazy"++-- | The result of a term, consisting of a type and an optional human-readable description.+data Result =+ Result {+ -- | An optional human-readable description of the result+ resultDescription :: (Maybe String),+ -- | The type of the result+ resultType :: Model.Type}+ deriving (Eq, Ord, Read, Show)++_Result = Model.Name "hydra.core.typing.Result"++_Result_description = Model.Name "description"++_Result_type = Model.Name "type"++-- | A structured signature for a term: an ordered list of type parameters (with optional class constraints), an ordered list of value parameters, and a result. TermSignature is a richer view of TypeScheme: every TermSignature can be converted to a TypeScheme by erasing parameter names, descriptions, and laziness flags.+data TermSignature =+ TermSignature {+ -- | The type parameters of the term, in order+ termSignatureTypeParameters :: [TypeParameter],+ -- | The value parameters of the term, in order+ termSignatureParameters :: [Parameter],+ -- | The result of the term+ termSignatureResult :: Result}+ deriving (Eq, Ord, Read, Show)++_TermSignature = Model.Name "hydra.core.typing.TermSignature"++_TermSignature_typeParameters = Model.Name "typeParameters"++_TermSignature_parameters = Model.Name "parameters"++_TermSignature_result = Model.Name "result"++-- | A substitution of term variables for terms+newtype TermSubst =+ TermSubst {+ unTermSubst :: (M.Map Model.Name Model.Term)}+ deriving (Eq, Ord, Read, Show)++_TermSubst = Model.Name "hydra.core.typing.TermSubst"++-- | A type class identifier together with a human-readable description. Type classes are referenced as bare names (e.g. the local name "equality") in TypeVariableConstraints.classes; the canonical definitions live as term bindings under hydra.core.classes.+data TypeClass =+ TypeClass {+ -- | A human-readable description of the type class+ typeClassDescription :: String}+ deriving (Eq, Ord, Read, Show)++_TypeClass = Model.Name "hydra.core.typing.TypeClass"++_TypeClass_description = Model.Name "description"++-- | An assertion that two types can be unified into a single type+data TypeConstraint =+ TypeConstraint {+ -- | The left-hand side of the constraint+ typeConstraintLeft :: Model.Type,+ -- | The right-hand side of the constraint+ typeConstraintRight :: Model.Type,+ -- | A description of the type constraint which may be used for tracing or debugging+ typeConstraintComment :: String}+ deriving (Eq, Ord, Read, Show)++_TypeConstraint = Model.Name "hydra.core.typing.TypeConstraint"++_TypeConstraint_left = Model.Name "left"++_TypeConstraint_right = Model.Name "right"++_TypeConstraint_comment = Model.Name "comment"++-- | A type parameter of a term, with an optional list of type class constraints+data TypeParameter =+ TypeParameter {+ -- | The name of the type parameter+ typeParameterName :: Model.Name,+ -- | Any type class constraints on the type parameter+ typeParameterConstraints :: [Model.TypeClassConstraint]}+ deriving (Eq, Ord, Read, Show)++_TypeParameter = Model.Name "hydra.core.typing.TypeParameter"++_TypeParameter_name = Model.Name "name"++_TypeParameter_constraints = Model.Name "constraints"++-- | A substitution of type variables for types+newtype TypeSubst =+ TypeSubst {+ unTypeSubst :: (M.Map Model.Name Model.Type)}+ deriving (Eq, Ord, Read, Show)++_TypeSubst = Model.Name "hydra.core.typing.TypeSubst"
@@ -0,0 +1,218 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Utilities for type unification.++module Hydra.Core.Unification where++import qualified Hydra.Core.Ast as Ast+import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Diff as Diff+import qualified Hydra.Core.Docs as Docs+import qualified Hydra.Core.Error.Checking as Checking+import qualified Hydra.Core.Error.File as ErrorFile+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Error.Packaging as ErrorPackaging+import qualified Hydra.Core.Error.System as ErrorSystem+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Json.Model as JsonModel+import qualified Hydra.Core.Overlay.Haskell.Lib.Eithers as Eithers+import qualified Hydra.Core.Overlay.Haskell.Lib.Equality as Equality+import qualified Hydra.Core.Overlay.Haskell.Lib.Lists as Lists+import qualified Hydra.Core.Overlay.Haskell.Lib.Logic as Logic+import qualified Hydra.Core.Overlay.Haskell.Lib.Maps as Maps+import qualified Hydra.Core.Overlay.Haskell.Lib.Optionals as Optionals+import qualified Hydra.Core.Overlay.Haskell.Lib.Pairs as Pairs+import qualified Hydra.Core.Overlay.Haskell.Lib.Strings as Strings+import qualified Hydra.Core.Markdown as Markdown+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Parsing as Parsing+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Print.Model as PrintModel+import qualified Hydra.Core.Query as Query+import qualified Hydra.Core.Regex as Regex+import qualified Hydra.Core.Relational as Relational+import qualified Hydra.Core.Rewriting as Rewriting+import qualified Hydra.Core.Strip as Strip+import qualified Hydra.Core.Substitution as Substitution+import qualified Hydra.Core.System as System+import qualified Hydra.Core.Tabular as Tabular+import qualified Hydra.Core.Testing as Testing+import qualified Hydra.Core.Time as Time+import qualified Hydra.Core.Topology as Topology+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Validation as Validation+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void+import qualified Data.Map as M++-- | Join two types, producing a list of type constraints.The comment is used to provide context for the constraints.+joinTypes :: t0 -> Model.Type -> Model.Type -> String -> Either Errors.UnificationError [Typing.TypeConstraint]+joinTypes cx left right comment =++ let sleft = Strip.deannotateType left+ sright = Strip.deannotateType right+ joinOne =+ \l -> \r -> Typing.TypeConstraint {+ Typing.typeConstraintLeft = l,+ Typing.typeConstraintRight = r,+ Typing.typeConstraintComment = (Strings.concat2 "join types; " comment)}+ cannotUnify =+ Left (Errors.UnificationError {+ Errors.unificationErrorLeftType = sleft,+ Errors.unificationErrorRightType = sright,+ Errors.unificationErrorMessage = (Strings.concat2 (Strings.concat2 (Strings.concat2 "cannot unify " (PrintModel.type_ sleft)) " with ") (PrintModel.type_ sright))})+ assertEqual = Logic.ifElse (Equality.equal sleft sright) (Right []) cannotUnify+ joinList =+ \lefts -> \rights -> Logic.ifElse (Equality.equal (Lists.length lefts) (Lists.length rights)) (Right (Lists.zipWith joinOne lefts rights)) cannotUnify+ joinRowTypes =+ \left2 -> \right2 -> Logic.ifElse (Logic.and (Equality.equal (Lists.length (Lists.map Model.fieldTypeName left2)) (Lists.length (Lists.map Model.fieldTypeName right2))) (Lists.foldl (\acc -> \x -> Logic.and acc x) True (Lists.zipWith (\left3 -> \right3 -> Equality.equal (Model.unName left3) (Model.unName right3)) (Lists.map Model.fieldTypeName left2) (Lists.map Model.fieldTypeName right2)))) (joinList (Lists.map Model.fieldTypeType left2) (Lists.map Model.fieldTypeType right2)) cannotUnify+ in case sleft of+ Model.TypeApplication v0 -> case sright of+ Model.TypeApplication v1 -> Right [+ joinOne (Model.applicationTypeFunction v0) (Model.applicationTypeFunction v1),+ (joinOne (Model.applicationTypeArgument v0) (Model.applicationTypeArgument v1))]+ _ -> cannotUnify+ Model.TypeEither v0 -> case sright of+ Model.TypeEither v1 -> Right [+ joinOne (Model.eitherTypeLeft v0) (Model.eitherTypeLeft v1),+ (joinOne (Model.eitherTypeRight v0) (Model.eitherTypeRight v1))]+ _ -> cannotUnify+ Model.TypeEffect v0 -> case sright of+ Model.TypeEffect v1 -> Right [+ joinOne v0 v1]+ _ -> cannotUnify+ Model.TypeFunction v0 -> case sright of+ Model.TypeFunction v1 -> Right [+ joinOne (Model.functionTypeDomain v0) (Model.functionTypeDomain v1),+ (joinOne (Model.functionTypeCodomain v0) (Model.functionTypeCodomain v1))]+ _ -> cannotUnify+ Model.TypeList v0 -> case sright of+ Model.TypeList v1 -> Right [+ joinOne v0 v1]+ _ -> cannotUnify+ Model.TypeLiteral _ -> assertEqual+ Model.TypeMap v0 -> case sright of+ Model.TypeMap v1 -> Right [+ joinOne (Model.mapTypeKeys v0) (Model.mapTypeKeys v1),+ (joinOne (Model.mapTypeValues v0) (Model.mapTypeValues v1))]+ _ -> cannotUnify+ Model.TypeOptional v0 -> case sright of+ Model.TypeOptional v1 -> Right [+ joinOne v0 v1]+ _ -> cannotUnify+ Model.TypePair v0 -> case sright of+ Model.TypePair v1 -> Right [+ joinOne (Model.pairTypeFirst v0) (Model.pairTypeFirst v1),+ (joinOne (Model.pairTypeSecond v0) (Model.pairTypeSecond v1))]+ _ -> cannotUnify+ Model.TypeRecord v0 -> case sright of+ Model.TypeRecord v1 -> joinRowTypes v0 v1+ _ -> cannotUnify+ Model.TypeSet v0 -> case sright of+ Model.TypeSet v1 -> Right [+ joinOne v0 v1]+ _ -> cannotUnify+ Model.TypeUnion v0 -> case sright of+ Model.TypeUnion v1 -> joinRowTypes v0 v1+ _ -> cannotUnify+ Model.TypeUnit -> case sright of+ Model.TypeUnit -> Right []+ _ -> cannotUnify+ Model.TypeVoid -> case sright of+ Model.TypeVoid -> Right []+ _ -> cannotUnify+ Model.TypeWrap v0 -> case sright of+ Model.TypeWrap v1 -> Right [+ joinOne v0 v1]+ _ -> cannotUnify+ _ -> cannotUnify++-- | Robinson's algorithm, following https://www.cs.cornell.edu/courses/cs6110/2017sp/lectures/lec23.pdf+-- | Specifically this is an implementation of the following rules:+-- | * Unify({(x, t)} ∪ E) = {t/x} Unify(E{t/x}) if x ∉ FV(t)+-- | * Unify(∅) = I (the identity substitution x ↦ x)+-- | * Unify({(x, x)} ∪ E) = Unify(E)+-- | * Unify({(f(s1, ..., sn), f(t1, ..., tn))} ∪ E) = Unify({(s1, t1), ..., (sn, tn)} ∪ E))+unifyTypeConstraints :: t0 -> M.Map Model.Name Model.TypeScheme -> [Typing.TypeConstraint] -> Either Errors.UnificationError Typing.TypeSubst+unifyTypeConstraints cx schemaTypes constraints =++ let withConstraint =+ \c -> \rest ->+ let sleft = Strip.deannotateType (Typing.typeConstraintLeft c)+ sright = Strip.deannotateType (Typing.typeConstraintRight c)+ comment = Typing.typeConstraintComment c+ bind =+ \v -> \t ->+ let subst = Substitution.singletonTypeSubst v t+ withResult = \s -> Substitution.composeTypeSubst subst s+ in (Eithers.map withResult (unifyTypeConstraints cx schemaTypes (Substitution.substituteInConstraints subst rest)))+ tryBinding =+ \v -> \t -> Logic.ifElse (variableOccursInType v t) (Left (Errors.UnificationError {+ Errors.unificationErrorLeftType = sleft,+ Errors.unificationErrorRightType = sright,+ Errors.unificationErrorMessage = (Strings.concat2 (Strings.concat2 (Strings.concat2 (Strings.concat2 (Strings.concat2 (Strings.concat2 "Variable " (Model.unName v)) " appears free in type ") (PrintModel.type_ t)) " (") comment) ")")})) (bind v t)+ isNominalSchemaType =+ \ts -> case (Strip.deannotateType (Model.typeSchemeBody ts)) of+ Model.TypeRecord _ -> True+ Model.TypeUnion _ -> True+ Model.TypeWrap _ -> True+ _ -> False+ tryBindOrSchema =+ \v -> \t -> Optionals.match (Maps.lookup v schemaTypes) (tryBinding v t) (\ts -> Logic.ifElse (isNominalSchemaType ts) (Left (Errors.UnificationError {+ Errors.unificationErrorLeftType = sleft,+ Errors.unificationErrorRightType = sright,+ Errors.unificationErrorMessage = (Strings.concat2 (Strings.concat2 (Strings.concat2 (Strings.concat2 (Strings.concat2 (Strings.concat2 "Cannot unify schema name " (Model.unName v)) " with type ") (PrintModel.type_ t)) " (") comment) ")")})) (tryBinding v t))+ noVars =++ let withConstraints = \constraints2 -> unifyTypeConstraints cx schemaTypes (Lists.concat2 constraints2 rest)+ in (Eithers.bind (joinTypes cx sleft sright comment) withConstraints)+ dflt =+ case sright of+ Model.TypeVariable v0 -> tryBindOrSchema v0 sleft+ _ -> noVars+ in case sleft of+ Model.TypeVariable v0 -> case sright of+ Model.TypeVariable v1 -> Logic.ifElse (Equality.equal (Model.unName v0) (Model.unName v1)) (unifyTypeConstraints cx schemaTypes rest) (Logic.ifElse (Optionals.isGiven (Maps.lookup v0 schemaTypes)) (Logic.ifElse (Optionals.isGiven (Maps.lookup v1 schemaTypes)) (Left (Errors.UnificationError {+ Errors.unificationErrorLeftType = sleft,+ Errors.unificationErrorRightType = sright,+ Errors.unificationErrorMessage = (Strings.concat2 (Strings.concat2 (Strings.concat2 (Strings.concat2 (Strings.concat2 (Strings.concat2 "Attempted to unify schema names " (Model.unName v0)) " and ") (Model.unName v1)) " (") comment) ")")})) (bind v1 sleft)) (bind v0 sright))+ _ -> tryBindOrSchema v0 sright+ _ -> dflt+ in (Optionals.match (Lists.uncons constraints) (Right Substitution.idTypeSubst) (\uc -> withConstraint (Pairs.first uc) (Pairs.second uc)))++-- | Unify two lists of types pairwise, producing a single substitution that satisfies every pair. The lists must have the same length; the comment is attached to each generated constraint for diagnostics.+unifyTypeLists :: t0 -> M.Map Model.Name Model.TypeScheme -> [Model.Type] -> [Model.Type] -> String -> Either Errors.UnificationError Typing.TypeSubst+unifyTypeLists cx schemaTypes l r comment =++ let toConstraint =+ \l2 -> \r2 -> Typing.TypeConstraint {+ Typing.typeConstraintLeft = l2,+ Typing.typeConstraintRight = r2,+ Typing.typeConstraintComment = comment}+ in (unifyTypeConstraints cx schemaTypes (Lists.zipWith toConstraint l r))++-- | Unify two types, producing a substitution that makes them equal (or an error). The comment is attached to the generated constraint for diagnostics.+unifyTypes :: t0 -> M.Map Model.Name Model.TypeScheme -> Model.Type -> Model.Type -> String -> Either Errors.UnificationError Typing.TypeSubst+unifyTypes cx schemaTypes l r comment =+ unifyTypeConstraints cx schemaTypes [+ Typing.TypeConstraint {+ Typing.typeConstraintLeft = l,+ Typing.typeConstraintRight = r,+ Typing.typeConstraintComment = comment}]++-- | Determine whether a type variable appears within a type expression.No distinction is made between free and bound type variables.+variableOccursInType :: Model.Name -> Model.Type -> Bool+variableOccursInType var typ0 =++ let tryType =+ \b -> \typ -> case typ of+ Model.TypeVariable v0 -> Logic.or b (Equality.equal (Model.unName v0) (Model.unName var))+ _ -> b+ in (Rewriting.foldOverType Coders.TraversalOrderPre tryType False typ0)
@@ -0,0 +1,92 @@+-- Note: this is an automatically generated file. Do not edit.++-- | General-purpose utility types used across Hydra.++module Hydra.Core.Util where++import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Packaging as Packaging+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void+import qualified Data.Map as M++-- | A naming convention for symbols, such as camelCase or snake_case+data CaseConvention =+ CaseConventionCamel |+ CaseConventionPascal |+ CaseConventionLowerSnake |+ CaseConventionUpperSnake |+ CaseConventionUpperDashed+ deriving (Eq, Ord, Read, Show)++_CaseConvention = Model.Name "hydra.core.util.CaseConvention"++_CaseConvention_camel = Model.Name "camel"++_CaseConvention_pascal = Model.Name "pascal"++_CaseConvention_lowerSnake = Model.Name "lowerSnake"++_CaseConvention_upperSnake = Model.Name "upperSnake"++_CaseConvention_upperDashed = Model.Name "upperDashed"++-- | An equality judgement: less than, equal to, or greater than+data Comparison =+ ComparisonLessThan |+ ComparisonEqualTo |+ ComparisonGreaterThan+ deriving (Eq, Ord, Read, Show)++_Comparison = Model.Name "hydra.core.util.Comparison"++_Comparison_lessThan = Model.Name "lessThan"++_Comparison_equalTo = Model.Name "equalTo"++_Comparison_greaterThan = Model.Name "greaterThan"++-- | A mapping from module names to values of type n, with a focus on one module name+data ModuleNames n =+ ModuleNames {+ -- | The module name in focus, together with its associated value+ moduleNamesFocus :: (Packaging.ModuleName, n),+ -- | A mapping of module names to values+ moduleNamesMapping :: (M.Map Packaging.ModuleName n)}+ deriving (Eq, Ord, Read, Show)++_ModuleNames = Model.Name "hydra.core.util.ModuleNames"++_ModuleNames_focus = Model.Name "focus"++_ModuleNames_mapping = Model.Name "mapping"++-- | Numeric precision: arbitrary precision, or precision to a specified number of bits+data Precision =+ -- | Arbitrary precision+ PrecisionArbitrary |+ -- | Precision to a specified number of bits+ PrecisionBits Int+ deriving (Eq, Ord, Read, Show)++_Precision = Model.Name "hydra.core.util.Precision"++_Precision_arbitrary = Model.Name "arbitrary"++_Precision_bits = Model.Name "bits"++-- | A qualified name consisting of an optional module name together with a mandatory local name+data QualifiedName =+ QualifiedName {+ -- | The optional module name+ qualifiedNameModuleName :: (Maybe Packaging.ModuleName),+ -- | The local name+ qualifiedNameLocal :: String}+ deriving (Eq, Ord, Read, Show)++_QualifiedName = Model.Name "hydra.core.util.QualifiedName"++_QualifiedName_moduleName = Model.Name "moduleName"++_QualifiedName_local = Model.Name "local"
@@ -0,0 +1,648 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Validation functions for core terms and types++module Hydra.Core.Validate.Model where++import qualified Hydra.Core.Annotations as Annotations+import qualified Hydra.Core.Ast as Ast+import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Diff as Diff+import qualified Hydra.Core.Docs as Docs+import qualified Hydra.Core.Error.Checking as Checking+import qualified Hydra.Core.Error.File as ErrorFile+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Error.Packaging as ErrorPackaging+import qualified Hydra.Core.Error.System as ErrorSystem+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Json.Model as JsonModel+import qualified Hydra.Core.Overlay.Haskell.Lib.Equality as Equality+import qualified Hydra.Core.Overlay.Haskell.Lib.Lists as Lists+import qualified Hydra.Core.Overlay.Haskell.Lib.Logic as Logic+import qualified Hydra.Core.Overlay.Haskell.Lib.Maps as Maps+import qualified Hydra.Core.Overlay.Haskell.Lib.Optionals as Optionals+import qualified Hydra.Core.Overlay.Haskell.Lib.Ordering as Ordering+import qualified Hydra.Core.Overlay.Haskell.Lib.Pairs as Pairs+import qualified Hydra.Core.Overlay.Haskell.Lib.Sets as Sets+import qualified Hydra.Core.Markdown as Markdown+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Names as Names+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Parsing as Parsing+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Query as Query+import qualified Hydra.Core.Reflect as Reflect+import qualified Hydra.Core.Regex as Regex+import qualified Hydra.Core.Relational as Relational+import qualified Hydra.Core.Rewriting as Rewriting+import qualified Hydra.Core.Scoping as Scoping+import qualified Hydra.Core.Strip as Strip+import qualified Hydra.Core.System as System+import qualified Hydra.Core.Tabular as Tabular+import qualified Hydra.Core.Testing as Testing+import qualified Hydra.Core.Time as Time+import qualified Hydra.Core.Topology as Topology+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Validation as Validation+import qualified Hydra.Core.Variables as Variables+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void+import qualified Data.Set as S++-- | Append a rule-tagged InvalidTermError finding to a ValidationResult, classifying as error or warning per the profile and respecting maxErrors/maxWarnings bounds.+appendFinding :: Validation.ValidationProfile -> Validation.ValidationResult t0 -> Maybe (Model.Name, t0) -> Validation.ValidationResult t0+appendFinding p acc finding =+ Optionals.match finding acc (\rp ->+ let ruleName = Pairs.first rp+ payload = Pairs.second rp+ errs = Validation.validationResultErrors acc+ wrns = Validation.validationResultWarnings acc+ in (Logic.ifElse (Sets.member ruleName (Validation.validationProfileErrorRules p)) (Logic.ifElse (Ordering.lt (Lists.length errs) (Validation.validationProfileMaxErrors p)) (Validation.ValidationResult {+ Validation.validationResultErrors = (Lists.concat2 errs (Lists.singleton payload)),+ Validation.validationResultWarnings = wrns}) acc) (Logic.ifElse (Sets.member ruleName (Validation.validationProfileWarningRules p)) (Logic.ifElse (Ordering.lt (Lists.length wrns) (Validation.validationProfileMaxWarnings p)) (Validation.ValidationResult {+ Validation.validationResultErrors = errs,+ Validation.validationResultWarnings = (Lists.concat2 wrns (Lists.singleton payload))}) acc) acc)))++-- | Append a rule-tagged InvalidTypeError finding to a ValidationResult, classifying as error or warning per the profile and respecting maxErrors/maxWarnings bounds.+appendFindingType :: Validation.ValidationProfile -> Validation.ValidationResult t0 -> Maybe (Model.Name, t0) -> Validation.ValidationResult t0+appendFindingType p acc finding =+ Optionals.match finding acc (\rp ->+ let ruleName = Pairs.first rp+ payload = Pairs.second rp+ errs = Validation.validationResultErrors acc+ wrns = Validation.validationResultWarnings acc+ in (Logic.ifElse (Sets.member ruleName (Validation.validationProfileErrorRules p)) (Logic.ifElse (Ordering.lt (Lists.length errs) (Validation.validationProfileMaxErrors p)) (Validation.ValidationResult {+ Validation.validationResultErrors = (Lists.concat2 errs (Lists.singleton payload)),+ Validation.validationResultWarnings = wrns}) acc) (Logic.ifElse (Sets.member ruleName (Validation.validationProfileWarningRules p)) (Logic.ifElse (Ordering.lt (Lists.length wrns) (Validation.validationProfileMaxWarnings p)) (Validation.ValidationResult {+ Validation.validationResultErrors = errs,+ Validation.validationResultWarnings = (Lists.concat2 wrns (Lists.singleton payload))}) acc) acc)))++-- | Check for duplicate binding names in a list of bindings+checkDuplicateBindings :: Paths.SubtermPath -> [Model.Binding] -> Maybe ErrorModel.InvalidTermError+checkDuplicateBindings path bindings =++ let names = Lists.map Model.bindingName bindings+ dup = findDuplicate names+ in (Optionals.map (\name -> ErrorModel.InvalidTermErrorDuplicateBinding (ErrorModel.DuplicateBindingError {+ ErrorModel.duplicateBindingErrorLocation = path,+ ErrorModel.duplicateBindingErrorName = name})) dup)++-- | Check for duplicate field names in a list of field types+checkDuplicateFieldTypes :: [Model.FieldType] -> (Model.Name -> Maybe t0) -> Maybe t0+checkDuplicateFieldTypes fields mkError =++ let names = Lists.map Model.fieldTypeName fields+ dup = findDuplicateFieldType names+ in (Optionals.match dup Nothing (\name -> mkError name))++-- | Check for duplicate field names in a list of fields+checkDuplicateFields :: Paths.SubtermPath -> [Model.Name] -> Maybe ErrorModel.InvalidTermError+checkDuplicateFields path names =++ let dup = findDuplicate names+ in (Optionals.map (\name -> ErrorModel.InvalidTermErrorDuplicateField (ErrorModel.DuplicateFieldError {+ ErrorModel.duplicateFieldErrorLocation = path,+ ErrorModel.duplicateFieldErrorName = name})) dup)++-- | Check that a literal value's type matches an expected literal type+checkLiteral :: Model.LiteralType -> Model.Literal -> Maybe ErrorModel.InvalidLiteralError+checkLiteral expected value =++ let actual = Reflect.literalType value+ in (Logic.ifElse (Equality.equal expected actual) Nothing (Just (ErrorModel.InvalidLiteralErrorTypeMismatch (ErrorModel.LiteralTypeMismatchError {+ ErrorModel.literalTypeMismatchErrorExpectedType = expected,+ ErrorModel.literalTypeMismatchErrorActualType = actual}))))++-- | Check if any name in a list shadows a variable already in scope+checkShadowing :: Paths.SubtermPath -> Graph.Graph -> [Model.Name] -> Maybe ErrorModel.InvalidTermError+checkShadowing path cx names =++ let result =+ Lists.foldl (\acc -> \name -> Optionals.match acc (Logic.ifElse (Logic.or (Optionals.isGiven (Maps.lookup name (Graph.graphBoundTerms cx))) (Sets.member name (Graph.graphLambdaVariables cx))) (Just (ErrorModel.InvalidTermErrorTermVariableShadowing (ErrorModel.TermVariableShadowingError {+ ErrorModel.termVariableShadowingErrorLocation = path,+ ErrorModel.termVariableShadowingErrorName = name}))) Nothing) (\_ -> acc)) Nothing names+ in result++-- | Check a single term node for validation errors. Rules disabled by the profile are not evaluated.+checkTerm :: Validation.ValidationProfile -> Bool -> Paths.SubtermPath -> Graph.Graph -> Model.Term -> Maybe (Model.Name, ErrorModel.InvalidTermError)+checkTerm p typed path cx term =+ case term of+ Model.TermAnnotated v0 ->+ let body = Model.annotatedTermBody v0+ annMap = Annotations.getAnnotationMap (Model.annotatedTermAnnotation v0)+ in (firstFinding [+ Logic.ifElse (enabled p (Model.Name "hydra.core.error.model.InvalidTermError.emptyTermAnnotation")) (Optionals.map (\f -> (Model.Name "hydra.core.error.model.InvalidTermError.emptyTermAnnotation", f)) (Logic.ifElse (Maps.isEmpty annMap) (Just (ErrorModel.InvalidTermErrorEmptyTermAnnotation (ErrorModel.EmptyTermAnnotationError {+ ErrorModel.emptyTermAnnotationErrorLocation = path}))) Nothing)) Nothing,+ (Logic.ifElse (enabled p (Model.Name "hydra.core.error.model.InvalidTermError.nestedTermAnnotation")) (Optionals.map (\f -> (Model.Name "hydra.core.error.model.InvalidTermError.nestedTermAnnotation", f)) (case body of+ Model.TermAnnotated _ -> Just (ErrorModel.InvalidTermErrorNestedTermAnnotation (ErrorModel.NestedTermAnnotationError {+ ErrorModel.nestedTermAnnotationErrorLocation = path}))+ _ -> Nothing)) Nothing)])+ Model.TermApplication v0 ->+ let fun = Model.applicationFunction v0+ arg = Model.applicationArgument v0+ in (firstFinding [+ Logic.ifElse (enabled p (Model.Name "hydra.core.error.model.InvalidTermError.constantCondition")) (Optionals.map (\f -> (Model.Name "hydra.core.error.model.InvalidTermError.constantCondition", f)) (case fun of+ Model.TermVariable v1 -> Logic.ifElse (Equality.equal (Model.unName v1) "hydra.core.lib.logic.ifElse") (case arg of+ Model.TermLiteral v2 -> case v2 of+ Model.LiteralBoolean v3 -> Just (ErrorModel.InvalidTermErrorConstantCondition (ErrorModel.ConstantConditionError {+ ErrorModel.constantConditionErrorLocation = path,+ ErrorModel.constantConditionErrorValue = v3}))+ _ -> Nothing+ _ -> Nothing) Nothing+ _ -> Nothing)) Nothing,+ (Logic.ifElse (enabled p (Model.Name "hydra.core.error.model.InvalidTermError.selfApplication")) (Optionals.map (\f -> (Model.Name "hydra.core.error.model.InvalidTermError.selfApplication", f)) (case fun of+ Model.TermVariable v1 -> case arg of+ Model.TermVariable v2 -> Logic.ifElse (Equality.equal v1 v2) (Just (ErrorModel.InvalidTermErrorSelfApplication (ErrorModel.SelfApplicationError {+ ErrorModel.selfApplicationErrorLocation = path,+ ErrorModel.selfApplicationErrorName = v1}))) Nothing+ _ -> Nothing+ _ -> Nothing)) Nothing),+ (Logic.ifElse (enabled p (Model.Name "hydra.core.error.model.InvalidTermError.unnecessaryIdentityApplication")) (Optionals.map (\f -> (Model.Name "hydra.core.error.model.InvalidTermError.unnecessaryIdentityApplication", f)) (case fun of+ Model.TermLambda v1 ->+ let param = Model.lambdaParameter v1+ body = Model.lambdaBody v1+ in case body of+ Model.TermVariable v2 -> Logic.ifElse (Equality.equal param v2) (Just (ErrorModel.InvalidTermErrorUnnecessaryIdentityApplication (ErrorModel.UnnecessaryIdentityApplicationError {+ ErrorModel.unnecessaryIdentityApplicationErrorLocation = path}))) Nothing+ _ -> Nothing+ _ -> Nothing)) Nothing),+ (Logic.ifElse (enabled p (Model.Name "hydra.core.error.model.InvalidTermError.redundantWrapUnwrap")) (Optionals.map (\f -> (Model.Name "hydra.core.error.model.InvalidTermError.redundantWrapUnwrap", f)) (case fun of+ Model.TermUnwrap v1 -> case arg of+ Model.TermWrap v2 ->+ let wrapName = Model.wrappedTermTypeName v2+ in (Logic.ifElse (Equality.equal v1 wrapName) (Just (ErrorModel.InvalidTermErrorRedundantWrapUnwrap (ErrorModel.RedundantWrapUnwrapError {+ ErrorModel.redundantWrapUnwrapErrorLocation = path,+ ErrorModel.redundantWrapUnwrapErrorTypeName = v1}))) Nothing)+ _ -> Nothing+ _ -> Nothing)) Nothing)])+ Model.TermRecord v0 ->+ let tname = Model.recordTypeName v0+ flds = Model.recordFields v0+ suppliedNames = Sets.fromList (Lists.map Model.fieldName flds)+ resolved = resolveNominalType cx tname+ in (firstFinding [+ Logic.ifElse (enabled p (Model.Name "hydra.core.error.model.InvalidTermError.emptyTypeNameInTerm")) (Optionals.map (\f -> (Model.Name "hydra.core.error.model.InvalidTermError.emptyTypeNameInTerm", f)) (Logic.ifElse (Equality.equal (Model.unName tname) "") (Just (ErrorModel.InvalidTermErrorEmptyTypeNameInTerm (ErrorModel.EmptyTypeNameInTermError {+ ErrorModel.emptyTypeNameInTermErrorLocation = path}))) Nothing)) Nothing,+ (Logic.ifElse (enabled p (Model.Name "hydra.core.error.model.InvalidTermError.duplicateField")) (Optionals.map (\f -> (Model.Name "hydra.core.error.model.InvalidTermError.duplicateField", f)) (checkDuplicateFields path (Lists.map Model.fieldName flds))) Nothing),+ (Logic.ifElse (enabled p (Model.Name "hydra.core.error.model.InvalidTermError.unresolvedNominalType")) (Optionals.map (\f -> (Model.Name "hydra.core.error.model.InvalidTermError.unresolvedNominalType", f)) (Optionals.match resolved (Just (ErrorModel.InvalidTermErrorUnresolvedNominalType (ErrorModel.UnresolvedNominalTypeError {+ ErrorModel.unresolvedNominalTypeErrorLocation = path,+ ErrorModel.unresolvedNominalTypeErrorTypeName = tname}))) (\_ -> Nothing))) Nothing),+ (Logic.ifElse (enabled p (Model.Name "hydra.core.error.model.InvalidTermError.nominalTypeKindMismatch")) (Optionals.map (\f -> (Model.Name "hydra.core.error.model.InvalidTermError.nominalTypeKindMismatch", f)) (Optionals.match resolved Nothing (\typ -> case typ of+ Model.TypeRecord _ -> Nothing+ _ -> Just (ErrorModel.InvalidTermErrorNominalTypeKindMismatch (ErrorModel.NominalTypeKindMismatchError {+ ErrorModel.nominalTypeKindMismatchErrorLocation = path,+ ErrorModel.nominalTypeKindMismatchErrorTypeName = tname,+ ErrorModel.nominalTypeKindMismatchErrorExpectedVariant = Variants.TypeVariantRecord,+ ErrorModel.nominalTypeKindMismatchErrorActualVariant = (Reflect.typeVariant typ)}))))) Nothing),+ (Logic.ifElse (enabled p (Model.Name "hydra.core.error.model.InvalidTermError.missingRecordFields")) (Optionals.map (\f -> (Model.Name "hydra.core.error.model.InvalidTermError.missingRecordFields", f)) (Optionals.match (resolveRecordFields cx tname) Nothing (\declFields ->+ let declNames = Sets.fromList (Lists.map Model.fieldTypeName declFields)+ missing = Sets.difference declNames suppliedNames+ in (Logic.ifElse (Sets.isEmpty missing) Nothing (Just (ErrorModel.InvalidTermErrorMissingRecordFields (ErrorModel.MissingRecordFieldsError {+ ErrorModel.missingRecordFieldsErrorLocation = path,+ ErrorModel.missingRecordFieldsErrorTypeName = tname,+ ErrorModel.missingRecordFieldsErrorFieldNames = (Sets.toList missing)}))))))) Nothing),+ (Logic.ifElse (enabled p (Model.Name "hydra.core.error.model.InvalidTermError.extraRecordFields")) (Optionals.map (\f -> (Model.Name "hydra.core.error.model.InvalidTermError.extraRecordFields", f)) (Optionals.match (resolveRecordFields cx tname) Nothing (\declFields ->+ let declNames = Sets.fromList (Lists.map Model.fieldTypeName declFields)+ extra = Sets.difference suppliedNames declNames+ in (Logic.ifElse (Sets.isEmpty extra) Nothing (Just (ErrorModel.InvalidTermErrorExtraRecordFields (ErrorModel.ExtraRecordFieldsError {+ ErrorModel.extraRecordFieldsErrorLocation = path,+ ErrorModel.extraRecordFieldsErrorTypeName = tname,+ ErrorModel.extraRecordFieldsErrorFieldNames = (Sets.toList extra)}))))))) Nothing)])+ Model.TermLet v0 ->+ let bindings = Model.letBindings v0+ names = Lists.map Model.bindingName bindings+ in (firstFinding [+ Logic.ifElse (enabled p (Model.Name "hydra.core.error.model.InvalidTermError.emptyLetBindings")) (Optionals.map (\f -> (Model.Name "hydra.core.error.model.InvalidTermError.emptyLetBindings", f)) (Logic.ifElse (Lists.isEmpty bindings) (Just (ErrorModel.InvalidTermErrorEmptyLetBindings (ErrorModel.EmptyLetBindingsError {+ ErrorModel.emptyLetBindingsErrorLocation = path}))) Nothing)) Nothing,+ (Logic.ifElse (enabled p (Model.Name "hydra.core.error.model.InvalidTermError.duplicateBinding")) (Optionals.map (\f -> (Model.Name "hydra.core.error.model.InvalidTermError.duplicateBinding", f)) (checkDuplicateBindings path bindings)) Nothing),+ Nothing,+ (Logic.ifElse (enabled p (Model.Name "hydra.core.error.model.InvalidTermError.invalidLetBindingName")) (Optionals.map (\f -> (Model.Name "hydra.core.error.model.InvalidTermError.invalidLetBindingName", f)) (firstError (Lists.map (\bname -> Logic.ifElse (isValidName bname) Nothing (Just (ErrorModel.InvalidTermErrorInvalidLetBindingName (ErrorModel.InvalidLetBindingNameError {+ ErrorModel.invalidLetBindingNameErrorLocation = path,+ ErrorModel.invalidLetBindingNameErrorName = bname})))) names))) Nothing),+ (Logic.ifElse (enabled p (Model.Name "hydra.core.error.model.InvalidTermError.undefinedTypeVariableInBindingType")) (Optionals.map (\f -> (Model.Name "hydra.core.error.model.InvalidTermError.undefinedTypeVariableInBindingType", f)) (Logic.ifElse typed (firstError (Lists.map (\b -> Optionals.match (Model.bindingTypeScheme b) Nothing (\ts -> checkUndefinedTypeVariablesInTypeScheme path cx ts (\uvName -> Just (ErrorModel.InvalidTermErrorUndefinedTypeVariableInBindingType (ErrorModel.UndefinedTypeVariableInBindingTypeError {+ ErrorModel.undefinedTypeVariableInBindingTypeErrorLocation = path,+ ErrorModel.undefinedTypeVariableInBindingTypeErrorName = uvName}))))) bindings)) Nothing)) Nothing)])+ Model.TermInject v0 ->+ let tname = Model.injectionTypeName v0+ variantName = Model.fieldName (Model.injectionField v0)+ resolved = resolveNominalType cx tname+ in (firstFinding [+ Logic.ifElse (enabled p (Model.Name "hydra.core.error.model.InvalidTermError.emptyTypeNameInTerm")) (Optionals.map (\f -> (Model.Name "hydra.core.error.model.InvalidTermError.emptyTypeNameInTerm", f)) (Logic.ifElse (Equality.equal (Model.unName tname) "") (Just (ErrorModel.InvalidTermErrorEmptyTypeNameInTerm (ErrorModel.EmptyTypeNameInTermError {+ ErrorModel.emptyTypeNameInTermErrorLocation = path}))) Nothing)) Nothing,+ (Logic.ifElse (enabled p (Model.Name "hydra.core.error.model.InvalidTermError.unresolvedNominalType")) (Optionals.map (\f -> (Model.Name "hydra.core.error.model.InvalidTermError.unresolvedNominalType", f)) (Optionals.match resolved (Just (ErrorModel.InvalidTermErrorUnresolvedNominalType (ErrorModel.UnresolvedNominalTypeError {+ ErrorModel.unresolvedNominalTypeErrorLocation = path,+ ErrorModel.unresolvedNominalTypeErrorTypeName = tname}))) (\_ -> Nothing))) Nothing),+ (Logic.ifElse (enabled p (Model.Name "hydra.core.error.model.InvalidTermError.nominalTypeKindMismatch")) (Optionals.map (\f -> (Model.Name "hydra.core.error.model.InvalidTermError.nominalTypeKindMismatch", f)) (Optionals.match resolved Nothing (\typ -> case typ of+ Model.TypeUnion _ -> Nothing+ _ -> Just (ErrorModel.InvalidTermErrorNominalTypeKindMismatch (ErrorModel.NominalTypeKindMismatchError {+ ErrorModel.nominalTypeKindMismatchErrorLocation = path,+ ErrorModel.nominalTypeKindMismatchErrorTypeName = tname,+ ErrorModel.nominalTypeKindMismatchErrorExpectedVariant = Variants.TypeVariantUnion,+ ErrorModel.nominalTypeKindMismatchErrorActualVariant = (Reflect.typeVariant typ)}))))) Nothing),+ (Logic.ifElse (enabled p (Model.Name "hydra.core.error.model.InvalidTermError.undeclaredVariant")) (Optionals.map (\f -> (Model.Name "hydra.core.error.model.InvalidTermError.undeclaredVariant", f)) (Optionals.match (resolveUnionFields cx tname) Nothing (\declFields ->+ let declNames = Sets.fromList (Lists.map Model.fieldTypeName declFields)+ in (Logic.ifElse (Sets.member variantName declNames) Nothing (Just (ErrorModel.InvalidTermErrorUndeclaredVariant (ErrorModel.UndeclaredVariantError {+ ErrorModel.undeclaredVariantErrorLocation = path,+ ErrorModel.undeclaredVariantErrorTypeName = tname,+ ErrorModel.undeclaredVariantErrorVariantName = variantName}))))))) Nothing)])+ Model.TermLambda v0 ->+ let paramName = Model.lambdaParameter v0+ in (firstFinding [+ Logic.ifElse (enabled p (Model.Name "hydra.core.error.model.InvalidTermError.termVariableShadowing")) (Optionals.map (\f -> (Model.Name "hydra.core.error.model.InvalidTermError.termVariableShadowing", f)) (Logic.ifElse (Optionals.isGiven (Maps.lookup paramName (Graph.graphBoundTerms cx))) (Just (ErrorModel.InvalidTermErrorTermVariableShadowing (ErrorModel.TermVariableShadowingError {+ ErrorModel.termVariableShadowingErrorLocation = path,+ ErrorModel.termVariableShadowingErrorName = paramName}))) Nothing)) Nothing,+ (Logic.ifElse (enabled p (Model.Name "hydra.core.error.model.InvalidTermError.invalidLambdaParameterName")) (Optionals.map (\f -> (Model.Name "hydra.core.error.model.InvalidTermError.invalidLambdaParameterName", f)) (Logic.ifElse (isValidName paramName) Nothing (Just (ErrorModel.InvalidTermErrorInvalidLambdaParameterName (ErrorModel.InvalidLambdaParameterNameError {+ ErrorModel.invalidLambdaParameterNameErrorLocation = path,+ ErrorModel.invalidLambdaParameterNameErrorName = paramName}))))) Nothing),+ (Logic.ifElse (enabled p (Model.Name "hydra.core.error.model.InvalidTermError.undefinedTypeVariableInLambdaDomain")) (Optionals.map (\f -> (Model.Name "hydra.core.error.model.InvalidTermError.undefinedTypeVariableInLambdaDomain", f)) (Logic.ifElse typed (Optionals.match (Model.lambdaDomain v0) Nothing (\dom -> checkUndefinedTypeVariablesInType path cx dom (\uvName -> Just (ErrorModel.InvalidTermErrorUndefinedTypeVariableInLambdaDomain (ErrorModel.UndefinedTypeVariableInLambdaDomainError {+ ErrorModel.undefinedTypeVariableInLambdaDomainErrorLocation = path,+ ErrorModel.undefinedTypeVariableInLambdaDomainErrorName = uvName}))))) Nothing)) Nothing)])+ Model.TermProject v0 ->+ let tname = Model.projectionTypeName v0+ fname = Model.projectionFieldName v0+ resolved = resolveNominalType cx tname+ in (firstFinding [+ Logic.ifElse (enabled p (Model.Name "hydra.core.error.model.InvalidTermError.emptyTypeNameInTerm")) (Optionals.map (\f -> (Model.Name "hydra.core.error.model.InvalidTermError.emptyTypeNameInTerm", f)) (Logic.ifElse (Equality.equal (Model.unName tname) "") (Just (ErrorModel.InvalidTermErrorEmptyTypeNameInTerm (ErrorModel.EmptyTypeNameInTermError {+ ErrorModel.emptyTypeNameInTermErrorLocation = path}))) Nothing)) Nothing,+ (Logic.ifElse (enabled p (Model.Name "hydra.core.error.model.InvalidTermError.unresolvedNominalType")) (Optionals.map (\f -> (Model.Name "hydra.core.error.model.InvalidTermError.unresolvedNominalType", f)) (Optionals.match resolved (Just (ErrorModel.InvalidTermErrorUnresolvedNominalType (ErrorModel.UnresolvedNominalTypeError {+ ErrorModel.unresolvedNominalTypeErrorLocation = path,+ ErrorModel.unresolvedNominalTypeErrorTypeName = tname}))) (\_ -> Nothing))) Nothing),+ (Logic.ifElse (enabled p (Model.Name "hydra.core.error.model.InvalidTermError.nominalTypeKindMismatch")) (Optionals.map (\f -> (Model.Name "hydra.core.error.model.InvalidTermError.nominalTypeKindMismatch", f)) (Optionals.match resolved Nothing (\typ -> case typ of+ Model.TypeRecord _ -> Nothing+ _ -> Just (ErrorModel.InvalidTermErrorNominalTypeKindMismatch (ErrorModel.NominalTypeKindMismatchError {+ ErrorModel.nominalTypeKindMismatchErrorLocation = path,+ ErrorModel.nominalTypeKindMismatchErrorTypeName = tname,+ ErrorModel.nominalTypeKindMismatchErrorExpectedVariant = Variants.TypeVariantRecord,+ ErrorModel.nominalTypeKindMismatchErrorActualVariant = (Reflect.typeVariant typ)}))))) Nothing),+ (Logic.ifElse (enabled p (Model.Name "hydra.core.error.model.InvalidTermError.unknownProjectedField")) (Optionals.map (\f -> (Model.Name "hydra.core.error.model.InvalidTermError.unknownProjectedField", f)) (Optionals.match (resolveRecordFields cx tname) Nothing (\declFields ->+ let declNames = Sets.fromList (Lists.map Model.fieldTypeName declFields)+ in (Logic.ifElse (Sets.member fname declNames) Nothing (Just (ErrorModel.InvalidTermErrorUnknownProjectedField (ErrorModel.UnknownProjectedFieldError {+ ErrorModel.unknownProjectedFieldErrorLocation = path,+ ErrorModel.unknownProjectedFieldErrorTypeName = tname,+ ErrorModel.unknownProjectedFieldErrorFieldName = fname}))))))) Nothing)])+ Model.TermCases v0 ->+ let tname = Model.caseStatementTypeName v0+ csDefault = Model.caseStatementDefault v0+ csCases = Model.caseStatementCases v0+ altNames = Sets.fromList (Lists.map Model.caseAlternativeName csCases)+ unionFields = resolveUnionFields cx tname+ resolved = resolveNominalType cx tname+ in (firstFinding [+ Logic.ifElse (enabled p (Model.Name "hydra.core.error.model.InvalidTermError.emptyTypeNameInTerm")) (Optionals.map (\f -> (Model.Name "hydra.core.error.model.InvalidTermError.emptyTypeNameInTerm", f)) (Logic.ifElse (Equality.equal (Model.unName tname) "") (Just (ErrorModel.InvalidTermErrorEmptyTypeNameInTerm (ErrorModel.EmptyTypeNameInTermError {+ ErrorModel.emptyTypeNameInTermErrorLocation = path}))) Nothing)) Nothing,+ (Logic.ifElse (enabled p (Model.Name "hydra.core.error.model.InvalidTermError.unresolvedNominalType")) (Optionals.map (\f -> (Model.Name "hydra.core.error.model.InvalidTermError.unresolvedNominalType", f)) (Optionals.match resolved (Just (ErrorModel.InvalidTermErrorUnresolvedNominalType (ErrorModel.UnresolvedNominalTypeError {+ ErrorModel.unresolvedNominalTypeErrorLocation = path,+ ErrorModel.unresolvedNominalTypeErrorTypeName = tname}))) (\_ -> Nothing))) Nothing),+ (Logic.ifElse (enabled p (Model.Name "hydra.core.error.model.InvalidTermError.nominalTypeKindMismatch")) (Optionals.map (\f -> (Model.Name "hydra.core.error.model.InvalidTermError.nominalTypeKindMismatch", f)) (Optionals.match resolved Nothing (\typ -> case typ of+ Model.TypeUnion _ -> Nothing+ _ -> Just (ErrorModel.InvalidTermErrorNominalTypeKindMismatch (ErrorModel.NominalTypeKindMismatchError {+ ErrorModel.nominalTypeKindMismatchErrorLocation = path,+ ErrorModel.nominalTypeKindMismatchErrorTypeName = tname,+ ErrorModel.nominalTypeKindMismatchErrorExpectedVariant = Variants.TypeVariantUnion,+ ErrorModel.nominalTypeKindMismatchErrorActualVariant = (Reflect.typeVariant typ)}))))) Nothing),+ (Logic.ifElse (enabled p (Model.Name "hydra.core.error.model.InvalidTermError.emptyCaseStatement")) (Optionals.map (\f -> (Model.Name "hydra.core.error.model.InvalidTermError.emptyCaseStatement", f)) (Logic.ifElse (Logic.and (Lists.isEmpty csCases) (Optionals.isNone csDefault)) (Just (ErrorModel.InvalidTermErrorEmptyCaseStatement (ErrorModel.EmptyCaseStatementError {+ ErrorModel.emptyCaseStatementErrorLocation = path,+ ErrorModel.emptyCaseStatementErrorTypeName = tname}))) Nothing)) Nothing),+ (Logic.ifElse (enabled p (Model.Name "hydra.core.error.model.InvalidTermError.duplicateField")) (Optionals.map (\f -> (Model.Name "hydra.core.error.model.InvalidTermError.duplicateField", f)) (checkDuplicateFields path (Lists.map Model.caseAlternativeName csCases))) Nothing),+ (Logic.ifElse (enabled p (Model.Name "hydra.core.error.model.InvalidTermError.missingCaseBranches")) (Optionals.map (\f -> (Model.Name "hydra.core.error.model.InvalidTermError.missingCaseBranches", f)) (Logic.ifElse (Optionals.isNone csDefault) (Optionals.match unionFields Nothing (\fields ->+ let variantNames = Sets.fromList (Lists.map Model.fieldTypeName fields)+ uncovered = Sets.difference variantNames altNames+ in (Logic.ifElse (Sets.isEmpty uncovered) Nothing (Just (ErrorModel.InvalidTermErrorMissingCaseBranches (ErrorModel.MissingCaseBranchesError {+ ErrorModel.missingCaseBranchesErrorLocation = path,+ ErrorModel.missingCaseBranchesErrorTypeName = tname,+ ErrorModel.missingCaseBranchesErrorVariantNames = (Sets.toList uncovered)})))))) Nothing)) Nothing),+ (Logic.ifElse (enabled p (Model.Name "hydra.core.error.model.InvalidTermError.unknownCaseAlternative")) (Optionals.map (\f -> (Model.Name "hydra.core.error.model.InvalidTermError.unknownCaseAlternative", f)) (Optionals.match unionFields Nothing (\fields ->+ let variantNames = Sets.fromList (Lists.map Model.fieldTypeName fields)+ unknown = Sets.difference altNames variantNames+ in (Optionals.match (Lists.head (Sets.toList unknown)) Nothing (\firstUnknown -> Just (ErrorModel.InvalidTermErrorUnknownCaseAlternative (ErrorModel.UnknownCaseAlternativeError {+ ErrorModel.unknownCaseAlternativeErrorLocation = path,+ ErrorModel.unknownCaseAlternativeErrorTypeName = tname,+ ErrorModel.unknownCaseAlternativeErrorName = firstUnknown}))))))) Nothing)])+ Model.TermTypeApplication v0 -> Logic.ifElse (enabled p (Model.Name "hydra.core.error.model.InvalidTermError.undefinedTypeVariableInTypeApplication")) (Optionals.map (\f -> (Model.Name "hydra.core.error.model.InvalidTermError.undefinedTypeVariableInTypeApplication", f)) (Logic.ifElse typed (checkUndefinedTypeVariablesInType path cx (Model.typeApplicationTermType v0) (\uvName -> Just (ErrorModel.InvalidTermErrorUndefinedTypeVariableInTypeApplication (ErrorModel.UndefinedTypeVariableInTypeApplicationError {+ ErrorModel.undefinedTypeVariableInTypeApplicationErrorLocation = path,+ ErrorModel.undefinedTypeVariableInTypeApplicationErrorName = uvName})))) Nothing)) Nothing+ Model.TermTypeLambda v0 ->+ let tvName = Model.typeLambdaParameter v0+ in (firstFinding [+ Logic.ifElse (enabled p (Model.Name "hydra.core.error.model.InvalidTermError.typeVariableShadowingInTypeLambda")) (Optionals.map (\f -> (Model.Name "hydra.core.error.model.InvalidTermError.typeVariableShadowingInTypeLambda", f)) (Logic.ifElse (Sets.member tvName (Sets.delete tvName (Graph.graphTypeVariables cx))) (Just (ErrorModel.InvalidTermErrorTypeVariableShadowingInTypeLambda (ErrorModel.TypeVariableShadowingInTypeLambdaError {+ ErrorModel.typeVariableShadowingInTypeLambdaErrorLocation = path,+ ErrorModel.typeVariableShadowingInTypeLambdaErrorName = tvName}))) Nothing)) Nothing,+ (Logic.ifElse (enabled p (Model.Name "hydra.core.error.model.InvalidTermError.invalidTypeLambdaParameterName")) (Optionals.map (\f -> (Model.Name "hydra.core.error.model.InvalidTermError.invalidTypeLambdaParameterName", f)) (Logic.ifElse (isValidName tvName) Nothing (Just (ErrorModel.InvalidTermErrorInvalidTypeLambdaParameterName (ErrorModel.InvalidTypeLambdaParameterNameError {+ ErrorModel.invalidTypeLambdaParameterNameErrorLocation = path,+ ErrorModel.invalidTypeLambdaParameterNameErrorName = tvName}))))) Nothing)])+ Model.TermVariable v0 ->+ let looksQualified = Optionals.isGiven (Names.moduleNameOf v0)+ isBoundTerm = Optionals.isGiven (Maps.lookup v0 (Graph.graphBoundTerms cx))+ isPrimitive = Optionals.isGiven (Maps.lookup v0 (Graph.graphPrimitives cx))+ in (firstFinding [+ Logic.ifElse (enabled p (Model.Name "hydra.core.error.model.InvalidTermError.undefinedTermVariable")) (Optionals.map (\f -> (Model.Name "hydra.core.error.model.InvalidTermError.undefinedTermVariable", f)) (Logic.ifElse (Logic.or looksQualified (Logic.or isBoundTerm (Logic.or (Sets.member v0 (Graph.graphLambdaVariables cx)) isPrimitive))) Nothing (Just (ErrorModel.InvalidTermErrorUndefinedTermVariable (ErrorModel.UndefinedTermVariableError {+ ErrorModel.undefinedTermVariableErrorLocation = path,+ ErrorModel.undefinedTermVariableErrorName = v0}))))) Nothing,+ (Logic.ifElse (enabled p (Model.Name "hydra.core.error.model.InvalidTermError.unknownPrimitiveName")) (Optionals.map (\f -> (Model.Name "hydra.core.error.model.InvalidTermError.unknownPrimitiveName", f)) (Logic.ifElse (Logic.and looksQualified (Logic.and (Logic.not isPrimitive) (Logic.not isBoundTerm))) (Just (ErrorModel.InvalidTermErrorUnknownPrimitiveName (ErrorModel.UnknownPrimitiveNameError {+ ErrorModel.unknownPrimitiveNameErrorLocation = path,+ ErrorModel.unknownPrimitiveNameErrorName = v0}))) Nothing)) Nothing),+ (Logic.ifElse (enabled p (Model.Name "hydra.core.error.model.InvalidTermError.untypedTermVariable")) (Optionals.map (\f -> (Model.Name "hydra.core.error.model.InvalidTermError.untypedTermVariable", f)) (Logic.ifElse (Logic.and typed (Logic.and (Sets.member v0 (Graph.graphLambdaVariables cx)) (Logic.not (Optionals.isGiven (Maps.lookup v0 (Graph.graphBoundTypes cx)))))) (Just (ErrorModel.InvalidTermErrorUntypedTermVariable (ErrorModel.UntypedTermVariableError {+ ErrorModel.untypedTermVariableErrorLocation = path,+ ErrorModel.untypedTermVariableErrorName = v0}))) Nothing)) Nothing)])+ Model.TermWrap v0 ->+ let tname = Model.wrappedTermTypeName v0+ resolved = resolveNominalType cx tname+ in (firstFinding [+ Logic.ifElse (enabled p (Model.Name "hydra.core.error.model.InvalidTermError.emptyTypeNameInTerm")) (Optionals.map (\f -> (Model.Name "hydra.core.error.model.InvalidTermError.emptyTypeNameInTerm", f)) (Logic.ifElse (Equality.equal (Model.unName tname) "") (Just (ErrorModel.InvalidTermErrorEmptyTypeNameInTerm (ErrorModel.EmptyTypeNameInTermError {+ ErrorModel.emptyTypeNameInTermErrorLocation = path}))) Nothing)) Nothing,+ (Logic.ifElse (enabled p (Model.Name "hydra.core.error.model.InvalidTermError.unresolvedNominalType")) (Optionals.map (\f -> (Model.Name "hydra.core.error.model.InvalidTermError.unresolvedNominalType", f)) (Optionals.match resolved (Just (ErrorModel.InvalidTermErrorUnresolvedNominalType (ErrorModel.UnresolvedNominalTypeError {+ ErrorModel.unresolvedNominalTypeErrorLocation = path,+ ErrorModel.unresolvedNominalTypeErrorTypeName = tname}))) (\_ -> Nothing))) Nothing),+ (Logic.ifElse (enabled p (Model.Name "hydra.core.error.model.InvalidTermError.nominalTypeKindMismatch")) (Optionals.map (\f -> (Model.Name "hydra.core.error.model.InvalidTermError.nominalTypeKindMismatch", f)) (Optionals.match resolved Nothing (\typ -> case typ of+ Model.TypeWrap _ -> Nothing+ _ -> Just (ErrorModel.InvalidTermErrorNominalTypeKindMismatch (ErrorModel.NominalTypeKindMismatchError {+ ErrorModel.nominalTypeKindMismatchErrorLocation = path,+ ErrorModel.nominalTypeKindMismatchErrorTypeName = tname,+ ErrorModel.nominalTypeKindMismatchErrorExpectedVariant = Variants.TypeVariantWrap,+ ErrorModel.nominalTypeKindMismatchErrorActualVariant = (Reflect.typeVariant typ)}))))) Nothing)])+ Model.TermUnwrap v0 ->+ let resolved = resolveNominalType cx v0+ in (firstFinding [+ Logic.ifElse (enabled p (Model.Name "hydra.core.error.model.InvalidTermError.unresolvedNominalType")) (Optionals.map (\f -> (Model.Name "hydra.core.error.model.InvalidTermError.unresolvedNominalType", f)) (Optionals.match resolved (Just (ErrorModel.InvalidTermErrorUnresolvedNominalType (ErrorModel.UnresolvedNominalTypeError {+ ErrorModel.unresolvedNominalTypeErrorLocation = path,+ ErrorModel.unresolvedNominalTypeErrorTypeName = v0}))) (\_ -> Nothing))) Nothing,+ (Logic.ifElse (enabled p (Model.Name "hydra.core.error.model.InvalidTermError.nominalTypeKindMismatch")) (Optionals.map (\f -> (Model.Name "hydra.core.error.model.InvalidTermError.nominalTypeKindMismatch", f)) (Optionals.match resolved Nothing (\typ -> case typ of+ Model.TypeWrap _ -> Nothing+ _ -> Just (ErrorModel.InvalidTermErrorNominalTypeKindMismatch (ErrorModel.NominalTypeKindMismatchError {+ ErrorModel.nominalTypeKindMismatchErrorLocation = path,+ ErrorModel.nominalTypeKindMismatchErrorTypeName = v0,+ ErrorModel.nominalTypeKindMismatchErrorExpectedVariant = Variants.TypeVariantWrap,+ ErrorModel.nominalTypeKindMismatchErrorActualVariant = (Reflect.typeVariant typ)}))))) Nothing)])+ _ -> Nothing++-- | Check a type for type variables not bound in the current scope+checkUndefinedTypeVariablesInType :: t0 -> Graph.Graph -> Model.Type -> (Model.Name -> Maybe t1) -> Maybe t1+checkUndefinedTypeVariablesInType path cx typ mkError =++ let freeVars = Variables.freeVariablesInType typ+ resolvedNames = Sets.union (Graph.graphTypeVariables cx) (Sets.fromList (Maps.keys (Graph.graphSchemaTypes cx)))+ undefined = Sets.difference freeVars resolvedNames+ in (Optionals.match (Lists.head (Sets.toList undefined)) Nothing (\firstUndefined -> mkError firstUndefined))++-- | Check a type scheme for type variables not bound by the scheme or the current scope+checkUndefinedTypeVariablesInTypeScheme :: t0 -> Graph.Graph -> Model.TypeScheme -> (Model.Name -> Maybe t1) -> Maybe t1+checkUndefinedTypeVariablesInTypeScheme path cx ts mkError =++ let freeVars = Variables.freeVariablesInTypeScheme ts+ resolvedNames = Sets.union (Graph.graphTypeVariables cx) (Sets.fromList (Maps.keys (Graph.graphSchemaTypes cx)))+ undefined = Sets.difference freeVars resolvedNames+ in (Optionals.match (Lists.head (Sets.toList undefined)) Nothing (\firstUndefined -> mkError firstUndefined))++-- | Return an error if the given type is TypeVoid+checkVoid :: Model.Type -> Maybe ErrorModel.InvalidTypeError+checkVoid typ =+ case typ of+ Model.TypeVoid -> Just (ErrorModel.InvalidTypeErrorVoidInNonBottomPosition (ErrorModel.VoidInNonBottomPositionError {+ ErrorModel.voidInNonBottomPositionErrorLocation = (Paths.SubtermPath [])}))+ _ -> Nothing++-- | True iff the given rule name appears in the profile's errorRules or warningRules.+enabled :: Validation.ValidationProfile -> Model.Name -> Bool+enabled p ruleName =+ Logic.or (Sets.member ruleName (Validation.validationProfileErrorRules p)) (Sets.member ruleName (Validation.validationProfileWarningRules p))++-- | Find the first duplicate name in a list+findDuplicate :: Ord t0 => ([t0] -> Maybe t0)+findDuplicate names =++ let result =+ Lists.foldl (\acc -> \name ->+ let seen = Pairs.first acc+ dup = Pairs.second acc+ in (Optionals.match dup (Logic.ifElse (Sets.member name seen) (seen, (Just name)) (Sets.insert name seen, Nothing)) (\_ -> acc))) (Sets.empty, Nothing) names+ in (Pairs.second result)++-- | Find the first duplicate name in a list (for field type validation)+findDuplicateFieldType :: Ord t0 => ([t0] -> Maybe t0)+findDuplicateFieldType names =++ let result =+ Lists.foldl (\acc -> \name ->+ let seen = Pairs.first acc+ dup = Pairs.second acc+ in (Optionals.match dup (Logic.ifElse (Sets.member name seen) (seen, (Just name)) (Sets.insert name seen, Nothing)) (\_ -> acc))) (Sets.empty, Nothing) names+ in (Pairs.second result)++-- | Return the first error from a list of optional errors, or nothing if all are valid+firstError :: [Maybe t0] -> Maybe t0+firstError checks = Lists.foldl (\acc -> \check -> Optionals.match acc check (\_ -> acc)) Nothing checks++-- | Return the first rule-tagged finding from a list, or nothing if all are valid+firstFinding :: [Maybe t0] -> Maybe t0+firstFinding checks = Lists.foldl (\acc -> \check -> Optionals.match acc check (\_ -> acc)) Nothing checks++-- | Return the first rule-tagged type finding from a list, or nothing if all are valid+firstFindingType :: [Maybe t0] -> Maybe t0+firstFindingType checks = Lists.foldl (\acc -> \check -> Optionals.match acc check (\_ -> acc)) Nothing checks++-- | Return the first type error from a list of optional errors, or nothing if all are valid+firstTypeError :: [Maybe t0] -> Maybe t0+firstTypeError checks = Lists.foldl (\acc -> \check -> Optionals.match acc check (\_ -> acc)) Nothing checks++-- | Check whether a name is valid at an introduction site. Currently rejects empty strings.+isValidName :: Model.Name -> Bool+isValidName name = Logic.not (Equality.equal (Model.unName name) "")++-- | The default validation profile for term and type validation, with every check classified as an error except InvalidTypeError.singleVariantUnion and InvalidTypeError.emptyRecordType (warnings); maxErrors=1, maxWarnings=20.+kernelDefaultCoreProfile :: Validation.ValidationProfile+kernelDefaultCoreProfile =+ Validation.ValidationProfile {+ Validation.validationProfileErrorRules = (Sets.fromList [+ Model.Name "hydra.core.error.model.InvalidTermError.constantCondition",+ (Model.Name "hydra.core.error.model.InvalidTermError.duplicateBinding"),+ (Model.Name "hydra.core.error.model.InvalidTermError.duplicateField"),+ (Model.Name "hydra.core.error.model.InvalidTermError.emptyCaseStatement"),+ (Model.Name "hydra.core.error.model.InvalidTermError.emptyLetBindings"),+ (Model.Name "hydra.core.error.model.InvalidTermError.emptyTermAnnotation"),+ (Model.Name "hydra.core.error.model.InvalidTermError.emptyTypeNameInTerm"),+ (Model.Name "hydra.core.error.model.InvalidTermError.extraRecordFields"),+ (Model.Name "hydra.core.error.model.InvalidTermError.invalidLambdaParameterName"),+ (Model.Name "hydra.core.error.model.InvalidTermError.invalidLetBindingName"),+ (Model.Name "hydra.core.error.model.InvalidTermError.invalidTypeLambdaParameterName"),+ (Model.Name "hydra.core.error.model.InvalidTermError.missingCaseBranches"),+ (Model.Name "hydra.core.error.model.InvalidTermError.missingRecordFields"),+ (Model.Name "hydra.core.error.model.InvalidTermError.nestedTermAnnotation"),+ (Model.Name "hydra.core.error.model.InvalidTermError.nominalTypeKindMismatch"),+ (Model.Name "hydra.core.error.model.InvalidTermError.redundantWrapUnwrap"),+ (Model.Name "hydra.core.error.model.InvalidTermError.selfApplication"),+ (Model.Name "hydra.core.error.model.InvalidTermError.termVariableShadowing"),+ (Model.Name "hydra.core.error.model.InvalidTermError.typeVariableShadowingInTypeLambda"),+ (Model.Name "hydra.core.error.model.InvalidTermError.undeclaredVariant"),+ (Model.Name "hydra.core.error.model.InvalidTermError.undefinedTermVariable"),+ (Model.Name "hydra.core.error.model.InvalidTermError.undefinedTypeVariableInBindingType"),+ (Model.Name "hydra.core.error.model.InvalidTermError.undefinedTypeVariableInLambdaDomain"),+ (Model.Name "hydra.core.error.model.InvalidTermError.undefinedTypeVariableInTypeApplication"),+ (Model.Name "hydra.core.error.model.InvalidTermError.unknownCaseAlternative"),+ (Model.Name "hydra.core.error.model.InvalidTermError.unknownPrimitiveName"),+ (Model.Name "hydra.core.error.model.InvalidTermError.unknownProjectedField"),+ (Model.Name "hydra.core.error.model.InvalidTermError.unnecessaryIdentityApplication"),+ (Model.Name "hydra.core.error.model.InvalidTermError.unresolvedNominalType"),+ (Model.Name "hydra.core.error.model.InvalidTermError.untypedTermVariable"),+ (Model.Name "hydra.core.error.model.InvalidTypeError.duplicateRecordTypeFieldNames"),+ (Model.Name "hydra.core.error.model.InvalidTypeError.duplicateUnionTypeFieldNames"),+ (Model.Name "hydra.core.error.model.InvalidTypeError.emptyTypeAnnotation"),+ (Model.Name "hydra.core.error.model.InvalidTypeError.emptyUnionType"),+ (Model.Name "hydra.core.error.model.InvalidTypeError.invalidForallParameterName"),+ (Model.Name "hydra.core.error.model.InvalidTypeError.invalidTypeSchemeVariableName"),+ (Model.Name "hydra.core.error.model.InvalidTypeError.nestedTypeAnnotation"),+ (Model.Name "hydra.core.error.model.InvalidTypeError.nonComparableMapKeyType"),+ (Model.Name "hydra.core.error.model.InvalidTypeError.nonComparableSetElementType"),+ (Model.Name "hydra.core.error.model.InvalidTypeError.typeVariableShadowingInForall"),+ (Model.Name "hydra.core.error.model.InvalidTypeError.undefinedTypeVariable"),+ (Model.Name "hydra.core.error.model.InvalidTypeError.voidInNonBottomPosition")]),+ Validation.validationProfileWarningRules = (Sets.fromList [+ Model.Name "hydra.core.error.model.InvalidTypeError.emptyRecordType",+ (Model.Name "hydra.core.error.model.InvalidTypeError.singleVariantUnion")]),+ Validation.validationProfileMaxErrors = 1,+ Validation.validationProfileMaxWarnings = 20}++-- | Resolve a type name to the annotation-stripped type it names in the current graph scope, or Nothing if it does not resolve.+resolveNominalType :: Graph.Graph -> Model.Name -> Maybe Model.Type+resolveNominalType cx tname =++ let toType = \ts -> Just (Strip.deannotateType (Model.typeSchemeBody ts))+ in (Optionals.match (Maps.lookup tname (Graph.graphSchemaTypes cx)) (Optionals.match (Maps.lookup tname (Graph.graphBoundTypes cx)) Nothing toType) toType)++-- | Resolve a type name to the field list of the record type it names, or Nothing if it does not resolve to a record type.+resolveRecordFields :: Graph.Graph -> Model.Name -> Maybe [Model.FieldType]+resolveRecordFields cx tname =+ Optionals.match (resolveNominalType cx tname) Nothing (\typ -> case typ of+ Model.TypeRecord v0 -> Just v0+ _ -> Nothing)++-- | Resolve a type name to the field list of the union type it names, or Nothing if it does not resolve to a union type.+resolveUnionFields :: Graph.Graph -> Model.Name -> Maybe [Model.FieldType]+resolveUnionFields cx tname =++ let toFields =+ \ts ->+ let stripped = Strip.deannotateType (Model.typeSchemeBody ts)+ in case stripped of+ Model.TypeUnion v0 -> Just v0+ _ -> Nothing+ in (Optionals.match (Maps.lookup tname (Graph.graphSchemaTypes cx)) (Optionals.match (Maps.lookup tname (Graph.graphBoundTypes cx)) Nothing toFields) toFields)++-- | Validate a term against the given ValidationProfile, returning a ValidationResult. Errors hard-stop traversal once maxErrors is reached; warnings are bounded by maxWarnings without causing termination.+term :: Validation.ValidationProfile -> Bool -> Graph.Graph -> Model.Term -> Validation.ValidationResult ErrorModel.InvalidTermError+term p typed g t =+ Rewriting.foldTermWithGraphAndPath (\recurse -> \path -> \cx -> \acc -> \trm -> Logic.ifElse (Ordering.gte (Lists.length (Validation.validationResultErrors acc)) (Validation.validationProfileMaxErrors p)) acc (+ let acc1 = appendFinding p acc (checkTerm p typed (Paths.SubtermPath path) cx trm)+ in (Logic.ifElse (Ordering.gte (Lists.length (Validation.validationResultErrors acc1)) (Validation.validationProfileMaxErrors p)) acc1 (recurse acc1 trm)))) g (Validation.ValidationResult {+ Validation.validationResultErrors = [],+ Validation.validationResultWarnings = []}) t++-- | Validate a type against the given ValidationProfile, threading a ValidationResult accumulator through subtypes. Errors hard-stop traversal once maxErrors is reached.+type_ :: Validation.ValidationProfile -> Validation.ValidationResult ErrorModel.InvalidTypeError -> S.Set Model.Name -> Model.Type -> Validation.ValidationResult ErrorModel.InvalidTypeError+type_ p acc boundVars typ =+ Logic.ifElse (Ordering.gte (Lists.length (Validation.validationResultErrors acc)) (Validation.validationProfileMaxErrors p)) acc (+ let acc1 = appendFindingType p acc (validateTypeNode p boundVars typ)+ in (Logic.ifElse (Ordering.gte (Lists.length (Validation.validationResultErrors acc1)) (Validation.validationProfileMaxErrors p)) acc1 (case typ of+ Model.TypeForall v0 ->+ let newBound = Sets.insert (Model.forallTypeParameter v0) boundVars+ in (type_ p acc1 newBound (Model.forallTypeBody v0))+ Model.TypeAnnotated v0 -> type_ p acc1 boundVars (Model.annotatedTypeBody v0)+ Model.TypeApplication v0 ->+ let acc2 = type_ p acc1 boundVars (Model.applicationTypeFunction v0)+ in (type_ p acc2 boundVars (Model.applicationTypeArgument v0))+ Model.TypeEffect v0 -> type_ p acc1 boundVars v0+ Model.TypeEither v0 ->+ let acc2 = type_ p acc1 boundVars (Model.eitherTypeLeft v0)+ in (type_ p acc2 boundVars (Model.eitherTypeRight v0))+ Model.TypeFunction v0 ->+ let acc2 = type_ p acc1 boundVars (Model.functionTypeDomain v0)+ in (type_ p acc2 boundVars (Model.functionTypeCodomain v0))+ Model.TypeList v0 -> type_ p acc1 boundVars v0+ Model.TypeMap v0 ->+ let acc2 = type_ p acc1 boundVars (Model.mapTypeKeys v0)+ in (type_ p acc2 boundVars (Model.mapTypeValues v0))+ Model.TypeOptional v0 -> type_ p acc1 boundVars v0+ Model.TypePair v0 ->+ let acc2 = type_ p acc1 boundVars (Model.pairTypeFirst v0)+ in (type_ p acc2 boundVars (Model.pairTypeSecond v0))+ Model.TypeRecord v0 -> Lists.foldl (\a -> \f -> type_ p a boundVars (Model.fieldTypeType f)) acc1 v0+ Model.TypeSet v0 -> type_ p acc1 boundVars v0+ Model.TypeUnion v0 -> Lists.foldl (\a -> \f -> type_ p a boundVars (Model.fieldTypeType f)) acc1 v0+ Model.TypeWrap v0 -> type_ p acc1 boundVars v0+ _ -> acc1)))++-- | Check a single type node for validation errors. Rules disabled by the profile are not evaluated.+validateTypeNode :: Validation.ValidationProfile -> S.Set Model.Name -> Model.Type -> Maybe (Model.Name, ErrorModel.InvalidTypeError)+validateTypeNode p boundVars typ =+ case typ of+ Model.TypeAnnotated v0 ->+ let body = Model.annotatedTypeBody v0+ annMap = Annotations.getAnnotationMap (Model.annotatedTypeAnnotation v0)+ in (firstFindingType [+ Logic.ifElse (enabled p (Model.Name "hydra.core.error.model.InvalidTypeError.emptyTypeAnnotation")) (Optionals.map (\f -> (Model.Name "hydra.core.error.model.InvalidTypeError.emptyTypeAnnotation", f)) (Logic.ifElse (Maps.isEmpty annMap) (Just (ErrorModel.InvalidTypeErrorEmptyTypeAnnotation (ErrorModel.EmptyTypeAnnotationError {+ ErrorModel.emptyTypeAnnotationErrorLocation = (Paths.SubtermPath [])}))) Nothing)) Nothing,+ (Logic.ifElse (enabled p (Model.Name "hydra.core.error.model.InvalidTypeError.nestedTypeAnnotation")) (Optionals.map (\f -> (Model.Name "hydra.core.error.model.InvalidTypeError.nestedTypeAnnotation", f)) (case body of+ Model.TypeAnnotated _ -> Just (ErrorModel.InvalidTypeErrorNestedTypeAnnotation (ErrorModel.NestedTypeAnnotationError {+ ErrorModel.nestedTypeAnnotationErrorLocation = (Paths.SubtermPath [])}))+ _ -> Nothing)) Nothing)])+ Model.TypeEither v0 -> firstFindingType [+ Logic.ifElse (enabled p (Model.Name "hydra.core.error.model.InvalidTypeError.voidInNonBottomPosition")) (Optionals.map (\f -> (Model.Name "hydra.core.error.model.InvalidTypeError.voidInNonBottomPosition", f)) (checkVoid (Model.eitherTypeLeft v0))) Nothing,+ (Logic.ifElse (enabled p (Model.Name "hydra.core.error.model.InvalidTypeError.voidInNonBottomPosition")) (Optionals.map (\f -> (Model.Name "hydra.core.error.model.InvalidTypeError.voidInNonBottomPosition", f)) (checkVoid (Model.eitherTypeRight v0))) Nothing)]+ Model.TypeEffect v0 -> Logic.ifElse (enabled p (Model.Name "hydra.core.error.model.InvalidTypeError.voidInNonBottomPosition")) (Optionals.map (\f -> (Model.Name "hydra.core.error.model.InvalidTypeError.voidInNonBottomPosition", f)) (checkVoid v0)) Nothing+ Model.TypeForall v0 ->+ let paramName = Model.forallTypeParameter v0+ in (firstFindingType [+ Logic.ifElse (enabled p (Model.Name "hydra.core.error.model.InvalidTypeError.typeVariableShadowingInForall")) (Optionals.map (\f -> (Model.Name "hydra.core.error.model.InvalidTypeError.typeVariableShadowingInForall", f)) (Logic.ifElse (Sets.member paramName boundVars) (Just (ErrorModel.InvalidTypeErrorTypeVariableShadowingInForall (ErrorModel.TypeVariableShadowingInForallError {+ ErrorModel.typeVariableShadowingInForallErrorLocation = (Paths.SubtermPath []),+ ErrorModel.typeVariableShadowingInForallErrorName = paramName}))) Nothing)) Nothing,+ (Logic.ifElse (enabled p (Model.Name "hydra.core.error.model.InvalidTypeError.invalidForallParameterName")) (Optionals.map (\f -> (Model.Name "hydra.core.error.model.InvalidTypeError.invalidForallParameterName", f)) (Logic.ifElse (isValidName paramName) Nothing (Just (ErrorModel.InvalidTypeErrorInvalidForallParameterName (ErrorModel.InvalidForallParameterNameError {+ ErrorModel.invalidForallParameterNameErrorLocation = (Paths.SubtermPath []),+ ErrorModel.invalidForallParameterNameErrorName = paramName}))))) Nothing)])+ Model.TypeFunction v0 -> Logic.ifElse (enabled p (Model.Name "hydra.core.error.model.InvalidTypeError.voidInNonBottomPosition")) (Optionals.map (\f -> (Model.Name "hydra.core.error.model.InvalidTypeError.voidInNonBottomPosition", f)) (checkVoid (Model.functionTypeCodomain v0))) Nothing+ Model.TypeList v0 -> Logic.ifElse (enabled p (Model.Name "hydra.core.error.model.InvalidTypeError.voidInNonBottomPosition")) (Optionals.map (\f -> (Model.Name "hydra.core.error.model.InvalidTypeError.voidInNonBottomPosition", f)) (checkVoid v0)) Nothing+ Model.TypeMap v0 ->+ let keyType = Model.mapTypeKeys v0+ in (firstFindingType [+ Logic.ifElse (enabled p (Model.Name "hydra.core.error.model.InvalidTypeError.nonComparableMapKeyType")) (Optionals.map (\f -> (Model.Name "hydra.core.error.model.InvalidTypeError.nonComparableMapKeyType", f)) (case keyType of+ Model.TypeFunction _ -> Just (ErrorModel.InvalidTypeErrorNonComparableMapKeyType (ErrorModel.NonComparableMapKeyTypeError {+ ErrorModel.nonComparableMapKeyTypeErrorLocation = (Paths.SubtermPath []),+ ErrorModel.nonComparableMapKeyTypeErrorKeyType = keyType}))+ _ -> Nothing)) Nothing,+ (Logic.ifElse (enabled p (Model.Name "hydra.core.error.model.InvalidTypeError.voidInNonBottomPosition")) (Optionals.map (\f -> (Model.Name "hydra.core.error.model.InvalidTypeError.voidInNonBottomPosition", f)) (checkVoid keyType)) Nothing),+ (Logic.ifElse (enabled p (Model.Name "hydra.core.error.model.InvalidTypeError.voidInNonBottomPosition")) (Optionals.map (\f -> (Model.Name "hydra.core.error.model.InvalidTypeError.voidInNonBottomPosition", f)) (checkVoid (Model.mapTypeValues v0))) Nothing)])+ Model.TypePair v0 -> firstFindingType [+ Logic.ifElse (enabled p (Model.Name "hydra.core.error.model.InvalidTypeError.voidInNonBottomPosition")) (Optionals.map (\f -> (Model.Name "hydra.core.error.model.InvalidTypeError.voidInNonBottomPosition", f)) (checkVoid (Model.pairTypeFirst v0))) Nothing,+ (Logic.ifElse (enabled p (Model.Name "hydra.core.error.model.InvalidTypeError.voidInNonBottomPosition")) (Optionals.map (\f -> (Model.Name "hydra.core.error.model.InvalidTypeError.voidInNonBottomPosition", f)) (checkVoid (Model.pairTypeSecond v0))) Nothing)]+ Model.TypeRecord v0 -> firstFindingType [+ Logic.ifElse (enabled p (Model.Name "hydra.core.error.model.InvalidTypeError.emptyRecordType")) (Optionals.map (\f -> (Model.Name "hydra.core.error.model.InvalidTypeError.emptyRecordType", f)) (Logic.ifElse (Lists.isEmpty v0) (Just (ErrorModel.InvalidTypeErrorEmptyRecordType (ErrorModel.EmptyRecordTypeError {+ ErrorModel.emptyRecordTypeErrorLocation = (Paths.SubtermPath [])}))) Nothing)) Nothing,+ (Logic.ifElse (enabled p (Model.Name "hydra.core.error.model.InvalidTypeError.duplicateRecordTypeFieldNames")) (Optionals.map (\f -> (Model.Name "hydra.core.error.model.InvalidTypeError.duplicateRecordTypeFieldNames", f)) (checkDuplicateFieldTypes v0 (\dupName -> Just (ErrorModel.InvalidTypeErrorDuplicateRecordTypeFieldNames (ErrorModel.DuplicateRecordTypeFieldNamesError {+ ErrorModel.duplicateRecordTypeFieldNamesErrorLocation = (Paths.SubtermPath []),+ ErrorModel.duplicateRecordTypeFieldNamesErrorName = dupName}))))) Nothing),+ (Logic.ifElse (enabled p (Model.Name "hydra.core.error.model.InvalidTypeError.voidInNonBottomPosition")) (Optionals.map (\f -> (Model.Name "hydra.core.error.model.InvalidTypeError.voidInNonBottomPosition", f)) (firstTypeError (Lists.map (\f -> checkVoid (Model.fieldTypeType f)) v0))) Nothing)]+ Model.TypeSet v0 -> firstFindingType [+ Logic.ifElse (enabled p (Model.Name "hydra.core.error.model.InvalidTypeError.nonComparableSetElementType")) (Optionals.map (\f -> (Model.Name "hydra.core.error.model.InvalidTypeError.nonComparableSetElementType", f)) (case v0 of+ Model.TypeFunction _ -> Just (ErrorModel.InvalidTypeErrorNonComparableSetElementType (ErrorModel.NonComparableSetElementTypeError {+ ErrorModel.nonComparableSetElementTypeErrorLocation = (Paths.SubtermPath []),+ ErrorModel.nonComparableSetElementTypeErrorElementType = v0}))+ _ -> Nothing)) Nothing,+ (Logic.ifElse (enabled p (Model.Name "hydra.core.error.model.InvalidTypeError.voidInNonBottomPosition")) (Optionals.map (\f -> (Model.Name "hydra.core.error.model.InvalidTypeError.voidInNonBottomPosition", f)) (checkVoid v0)) Nothing)]+ Model.TypeUnion v0 -> firstFindingType [+ Logic.ifElse (enabled p (Model.Name "hydra.core.error.model.InvalidTypeError.emptyUnionType")) (Optionals.map (\f -> (Model.Name "hydra.core.error.model.InvalidTypeError.emptyUnionType", f)) (Logic.ifElse (Lists.isEmpty v0) (Just (ErrorModel.InvalidTypeErrorEmptyUnionType (ErrorModel.EmptyUnionTypeError {+ ErrorModel.emptyUnionTypeErrorLocation = (Paths.SubtermPath [])}))) Nothing)) Nothing,+ (Logic.ifElse (enabled p (Model.Name "hydra.core.error.model.InvalidTypeError.singleVariantUnion")) (Optionals.map (\f -> (Model.Name "hydra.core.error.model.InvalidTypeError.singleVariantUnion", f)) (Logic.ifElse (Equality.equal (Lists.length v0) 1) (Optionals.match (Lists.head v0) Nothing (\singleField -> Just (ErrorModel.InvalidTypeErrorSingleVariantUnion (ErrorModel.SingleVariantUnionError {+ ErrorModel.singleVariantUnionErrorLocation = (Paths.SubtermPath []),+ ErrorModel.singleVariantUnionErrorFieldName = (Model.fieldTypeName singleField)})))) Nothing)) Nothing),+ (Logic.ifElse (enabled p (Model.Name "hydra.core.error.model.InvalidTypeError.duplicateUnionTypeFieldNames")) (Optionals.map (\f -> (Model.Name "hydra.core.error.model.InvalidTypeError.duplicateUnionTypeFieldNames", f)) (checkDuplicateFieldTypes v0 (\dupName -> Just (ErrorModel.InvalidTypeErrorDuplicateUnionTypeFieldNames (ErrorModel.DuplicateUnionTypeFieldNamesError {+ ErrorModel.duplicateUnionTypeFieldNamesErrorLocation = (Paths.SubtermPath []),+ ErrorModel.duplicateUnionTypeFieldNamesErrorName = dupName}))))) Nothing),+ (Logic.ifElse (enabled p (Model.Name "hydra.core.error.model.InvalidTypeError.voidInNonBottomPosition")) (Optionals.map (\f -> (Model.Name "hydra.core.error.model.InvalidTypeError.voidInNonBottomPosition", f)) (firstTypeError (Lists.map (\f -> checkVoid (Model.fieldTypeType f)) v0))) Nothing)]+ Model.TypeVariable v0 -> Logic.ifElse (enabled p (Model.Name "hydra.core.error.model.InvalidTypeError.undefinedTypeVariable")) (Optionals.map (\f -> (Model.Name "hydra.core.error.model.InvalidTypeError.undefinedTypeVariable", f)) (Logic.ifElse (Sets.member v0 boundVars) Nothing (Just (ErrorModel.InvalidTypeErrorUndefinedTypeVariable (ErrorModel.UndefinedTypeVariableError {+ ErrorModel.undefinedTypeVariableErrorLocation = (Paths.SubtermPath []),+ ErrorModel.undefinedTypeVariableErrorName = v0}))))) Nothing+ _ -> Nothing
@@ -0,0 +1,448 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Validation functions for modules and packages++module Hydra.Core.Validate.Packaging where++import qualified Hydra.Core.Annotations as Annotations+import qualified Hydra.Core.Ast as Ast+import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Constants as Constants+import qualified Hydra.Core.Dependencies as Dependencies+import qualified Hydra.Core.Diff as Diff+import qualified Hydra.Core.Docs as Docs+import qualified Hydra.Core.Error.Checking as Checking+import qualified Hydra.Core.Error.File as ErrorFile+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Error.Packaging as ErrorPackaging+import qualified Hydra.Core.Error.System as ErrorSystem+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Formatting as Formatting+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Json.Model as JsonModel+import qualified Hydra.Core.Overlay.Haskell.Lib.Equality as Equality+import qualified Hydra.Core.Overlay.Haskell.Lib.Lists as Lists+import qualified Hydra.Core.Overlay.Haskell.Lib.Logic as Logic+import qualified Hydra.Core.Overlay.Haskell.Lib.Maps as Maps+import qualified Hydra.Core.Overlay.Haskell.Lib.Optionals as Optionals+import qualified Hydra.Core.Overlay.Haskell.Lib.Ordering as Ordering+import qualified Hydra.Core.Overlay.Haskell.Lib.Pairs as Pairs+import qualified Hydra.Core.Overlay.Haskell.Lib.Regex as LibRegex+import qualified Hydra.Core.Overlay.Haskell.Lib.Sets as Sets+import qualified Hydra.Core.Overlay.Haskell.Lib.Strings as Strings+import qualified Hydra.Core.Markdown as Markdown+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Names as Names+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Parsing as Parsing+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Query as Query+import qualified Hydra.Core.Regex as Regex+import qualified Hydra.Core.Relational as Relational+import qualified Hydra.Core.System as System+import qualified Hydra.Core.Tabular as Tabular+import qualified Hydra.Core.Testing as Testing+import qualified Hydra.Core.Time as Time+import qualified Hydra.Core.Topology as Topology+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Validation as Validation+import qualified Hydra.Core.Variables as Variables+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void+import qualified Data.Map as M+import qualified Data.Set as S++-- | Append a rule-tagged InvalidModuleError finding to a ValidationResult, classifying as error or warning per the profile and respecting maxErrors/maxWarnings bounds.+appendFindingModule :: Validation.ValidationProfile -> Validation.ValidationResult t0 -> Maybe (Model.Name, t0) -> Validation.ValidationResult t0+appendFindingModule p acc finding =+ Optionals.match finding acc (\rp ->+ let ruleName = Pairs.first rp+ payload = Pairs.second rp+ errs = Validation.validationResultErrors acc+ wrns = Validation.validationResultWarnings acc+ in (Logic.ifElse (Sets.member ruleName (Validation.validationProfileErrorRules p)) (Logic.ifElse (Ordering.lt (Lists.length errs) (Validation.validationProfileMaxErrors p)) (Validation.ValidationResult {+ Validation.validationResultErrors = (Lists.concat2 errs (Lists.singleton payload)),+ Validation.validationResultWarnings = wrns}) acc) (Logic.ifElse (Sets.member ruleName (Validation.validationProfileWarningRules p)) (Logic.ifElse (Ordering.lt (Lists.length wrns) (Validation.validationProfileMaxWarnings p)) (Validation.ValidationResult {+ Validation.validationResultErrors = errs,+ Validation.validationResultWarnings = (Lists.concat2 wrns (Lists.singleton payload))}) acc) acc)))++-- | Append a rule-tagged InvalidPackageError finding to a ValidationResult, classifying as error or warning per the profile and respecting maxErrors/maxWarnings bounds.+appendFindingPackage :: Validation.ValidationProfile -> Validation.ValidationResult t0 -> Maybe (Model.Name, t0) -> Validation.ValidationResult t0+appendFindingPackage p acc finding =+ Optionals.match finding acc (\rp ->+ let ruleName = Pairs.first rp+ payload = Pairs.second rp+ errs = Validation.validationResultErrors acc+ wrns = Validation.validationResultWarnings acc+ in (Logic.ifElse (Sets.member ruleName (Validation.validationProfileErrorRules p)) (Logic.ifElse (Ordering.lt (Lists.length errs) (Validation.validationProfileMaxErrors p)) (Validation.ValidationResult {+ Validation.validationResultErrors = (Lists.concat2 errs (Lists.singleton payload)),+ Validation.validationResultWarnings = wrns}) acc) (Logic.ifElse (Sets.member ruleName (Validation.validationProfileWarningRules p)) (Logic.ifElse (Ordering.lt (Lists.length wrns) (Validation.validationProfileMaxWarnings p)) (Validation.ValidationResult {+ Validation.validationResultErrors = errs,+ Validation.validationResultWarnings = (Lists.concat2 wrns (Lists.singleton payload))}) acc) acc)))++-- | Check for module namespaces that conflict when mapped to target language paths+checkConflictingModuleNames :: Packaging.Package -> Maybe ErrorPackaging.InvalidPackageError+checkConflictingModuleNames pkg =++ let result =+ Lists.foldl (\acc -> \mod ->+ let seen = Pairs.first acc+ err = Pairs.second acc+ in (Optionals.match err (+ let ns = Packaging.moduleName mod+ key = Strings.toLower (Packaging.unModuleName ns)+ existing = Maps.lookup key seen+ in (Optionals.match existing (Maps.insert key ns seen, Nothing) (\first -> (+ seen,+ (Just (ErrorPackaging.InvalidPackageErrorConflictingModuleName (ErrorPackaging.ConflictingModuleNameError {+ ErrorPackaging.conflictingModuleNameErrorFirst = first,+ ErrorPackaging.conflictingModuleNameErrorSecond = ns}))))))) (\_ -> acc))) (Maps.empty, Nothing) (Packaging.packageModules pkg)+ in (Pairs.second result)++-- | Check for union variant names that, when mapped to constructor names, conflict with other type definitions+checkConflictingVariantNames :: Packaging.Module -> Maybe ErrorPackaging.InvalidModuleError+checkConflictingVariantNames mod =++ let ns = Packaging.moduleName mod+ defs = Packaging.moduleDefinitions mod+ defNames = Lists.foldl (\acc -> \def -> Sets.insert (Names.localNameOf (definitionName def)) acc) Sets.empty defs+ in (Lists.foldl (\acc -> \def -> Optionals.match acc (case def of+ Packaging.DefinitionType v0 ->+ let typeName = Packaging.typeDefinitionName v0+ localTypeName = Names.localNameOf typeName+ typ = Model.typeSchemeBody (Packaging.typeDefinitionBody v0)+ in case typ of+ Model.TypeUnion v1 -> Lists.foldl (\innerAcc -> \field -> Optionals.match innerAcc (+ let fieldName = Model.fieldTypeName field+ localFieldName = Names.localNameOf fieldName+ constructorName = Strings.concat2 (Formatting.capitalize localTypeName) (Formatting.capitalize localFieldName)+ in (Logic.ifElse (Sets.member constructorName defNames) (Just (ErrorPackaging.InvalidModuleErrorConflictingVariantName (ErrorPackaging.ConflictingVariantNameError {+ ErrorPackaging.conflictingVariantNameErrorModuleName = ns,+ ErrorPackaging.conflictingVariantNameErrorTypeName = typeName,+ ErrorPackaging.conflictingVariantNameErrorVariantName = fieldName,+ ErrorPackaging.conflictingVariantNameErrorConflictingName = (Model.Name constructorName)}))) Nothing)) (\_ -> innerAcc)) Nothing v1+ _ -> Nothing+ _ -> Nothing) (\_ -> acc)) Nothing defs)++-- | Check that every top-level definition is wrapped in a description annotation+checkDefinitionDocumentation :: Packaging.Module -> Maybe ErrorPackaging.InvalidModuleError+checkDefinitionDocumentation mod =++ let ns = Packaging.moduleName mod+ in (Lists.foldl (\acc -> \def -> Optionals.match acc (+ let name = definitionName def+ documented =+ case def of+ Packaging.DefinitionTerm v0 ->+ let term = Packaging.termDefinitionBody v0+ in case term of+ Model.TermAnnotated v1 -> Annotations.hasDescription (Annotations.getAnnotationMap (Model.annotatedTermAnnotation v1))+ _ -> False+ Packaging.DefinitionType v0 ->+ let typ = Model.typeSchemeBody (Packaging.typeDefinitionBody v0)+ in case typ of+ Model.TypeAnnotated v1 -> Annotations.hasDescription (Annotations.getAnnotationMap (Model.annotatedTypeAnnotation v1))+ _ -> False+ Packaging.DefinitionPrimitive v0 -> Optionals.match (Packaging.primitiveDefinitionMetadata v0) False (\em -> Logic.not (Equality.equal (Optionals.withDefault "" (Packaging.entityMetadataDescription em)) ""))+ _ -> False+ in (Logic.ifElse documented Nothing (Just (ErrorPackaging.InvalidModuleErrorMissingDocumentation (ErrorPackaging.MissingDocumentationError {+ ErrorPackaging.missingDocumentationErrorModuleName = ns,+ ErrorPackaging.missingDocumentationErrorName = name}))))) (\_ -> acc)) Nothing (Packaging.moduleDefinitions mod))++-- | Check that all definition names in a module have the module's name as a prefix+checkDefinitionModuleNames :: Packaging.Module -> Maybe ErrorPackaging.InvalidModuleError+checkDefinitionModuleNames mod =++ let ns = Packaging.moduleName mod+ prefix = Strings.concat2 (Packaging.unModuleName ns) "."+ prefixLen = Strings.length prefix+ in (Lists.foldl (\acc -> \def -> Optionals.match acc (+ let name = definitionName def+ nameStr = Model.unName name+ namePrefix = Lists.take prefixLen (Strings.toList nameStr)+ in (Logic.ifElse (Equality.equal (Strings.fromList namePrefix) prefix) Nothing (Just (ErrorPackaging.InvalidModuleErrorDefinitionNotInModuleName (ErrorPackaging.DefinitionNotInModuleNameError {+ ErrorPackaging.definitionNotInModuleNameErrorModuleName = ns,+ ErrorPackaging.definitionNotInModuleNameErrorName = name}))))) (\_ -> acc)) Nothing (Packaging.moduleDefinitions mod))++-- | Check that term definitions have camelCase local names and type definitions have PascalCase local names+checkDefinitionNameConvention :: Packaging.Module -> Maybe ErrorPackaging.InvalidModuleError+checkDefinitionNameConvention mod =++ let ns = Packaging.moduleName mod+ in (Lists.foldl (\acc -> \def -> Optionals.match acc (+ let name = definitionName def+ local = Names.localNameOf name+ expected =+ case def of+ Packaging.DefinitionTerm _ -> Util.CaseConventionCamel+ Packaging.DefinitionType _ -> Util.CaseConventionPascal+ Packaging.DefinitionPrimitive _ -> Util.CaseConventionCamel+ _ -> Util.CaseConventionCamel+ pattern =+ case def of+ Packaging.DefinitionTerm _ -> Constants.regexCamelCase+ Packaging.DefinitionType _ -> Constants.regexPascalCase+ Packaging.DefinitionPrimitive _ -> Constants.regexCamelCase+ _ -> Constants.regexCamelCase+ in (Logic.ifElse (LibRegex.matches pattern local) Nothing (Just (ErrorPackaging.InvalidModuleErrorInvalidDefinitionName (ErrorPackaging.InvalidDefinitionNameError {+ ErrorPackaging.invalidDefinitionNameErrorModuleName = ns,+ ErrorPackaging.invalidDefinitionNameErrorName = name,+ ErrorPackaging.invalidDefinitionNameErrorExpectedConvention = expected}))))) (\_ -> acc)) Nothing (Packaging.moduleDefinitions mod))++-- | Check that a module's definitions list is sorted in ascending lexicographic order by local name+checkDefinitionOrdering :: Packaging.Module -> Maybe ErrorPackaging.InvalidModuleError+checkDefinitionOrdering mod =++ let ns = Packaging.moduleName mod+ result =+ Lists.foldl (\acc -> \def ->+ let prev = Pairs.first acc+ err = Pairs.second acc+ in (Optionals.match err (+ let currName = definitionName def+ currLocal = Names.localNameOf currName+ in (Optionals.match prev (Just currName, Nothing) (\prevName ->+ let prevLocal = Names.localNameOf prevName+ in (Logic.ifElse (Ordering.lt prevLocal currLocal) (Just currName, Nothing) (+ Just currName,+ (Just (ErrorPackaging.InvalidModuleErrorDefinitionsOutOfOrder (ErrorPackaging.DefinitionsOutOfOrderError {+ ErrorPackaging.definitionsOutOfOrderErrorModuleName = ns,+ ErrorPackaging.definitionsOutOfOrderErrorPrecedingName = prevName,+ ErrorPackaging.definitionsOutOfOrderErrorFollowingName = currName})))))))) (\_ -> acc))) (Nothing, Nothing) (Packaging.moduleDefinitions mod)+ in (Pairs.second result)++-- | Check for duplicate definition names in a module+checkDuplicateDefinitionNames :: Packaging.Module -> Maybe ErrorPackaging.InvalidModuleError+checkDuplicateDefinitionNames mod =++ let ns = Packaging.moduleName mod+ result =+ Lists.foldl (\acc -> \def ->+ let seen = Pairs.first acc+ err = Pairs.second acc+ in (Optionals.match err (+ let name = definitionName def+ in (Logic.ifElse (Sets.member name seen) (+ seen,+ (Just (ErrorPackaging.InvalidModuleErrorDuplicateDefinitionName (ErrorPackaging.DuplicateDefinitionNameError {+ ErrorPackaging.duplicateDefinitionNameErrorModuleName = ns,+ ErrorPackaging.duplicateDefinitionNameErrorName = name})))) (Sets.insert name seen, Nothing))) (\_ -> acc))) (Sets.empty, Nothing) (Packaging.moduleDefinitions mod)+ in (Pairs.second result)++-- | Check for duplicate module namespaces in a package+checkDuplicateModuleNames :: Packaging.Package -> Maybe ErrorPackaging.InvalidPackageError+checkDuplicateModuleNames pkg =++ let result =+ Lists.foldl (\acc -> \mod ->+ let seen = Pairs.first acc+ err = Pairs.second acc+ in (Optionals.match err (+ let ns = Packaging.moduleName mod+ in (Logic.ifElse (Sets.member ns seen) (+ seen,+ (Just (ErrorPackaging.InvalidPackageErrorDuplicateModuleName (ErrorPackaging.DuplicateModuleNameError {+ ErrorPackaging.duplicateModuleNameErrorModuleName = ns})))) (Sets.insert ns seen, Nothing))) (\_ -> acc))) (Sets.empty, Nothing) (Packaging.packageModules pkg)+ in (Pairs.second result)++-- | Check that the module's namespace matches the dotted-lowercase naming convention+checkModuleNameConvention :: Packaging.Module -> Maybe ErrorPackaging.InvalidModuleError+checkModuleNameConvention mod =++ let ns = Packaging.moduleName mod+ in (Logic.ifElse (LibRegex.matches Constants.regexNamespace (Packaging.unModuleName ns)) Nothing (Just (ErrorPackaging.InvalidModuleErrorInvalidModuleNameConvention (ErrorPackaging.InvalidModuleNameConventionError {+ ErrorPackaging.invalidModuleNameConventionErrorModuleName = ns}))))++-- | Check that no module namespace is declared by more than one package, across the whole universe of packages.+checkModulePartition :: [(String, [Packaging.ModuleName])] -> [ErrorPackaging.InvalidPackageError]+checkModulePartition pkgs =++ let declaredPairs = Lists.concat (Lists.map (\p -> Lists.map (\m -> (m, (Pairs.first p))) (Pairs.second p)) pkgs)+ result =+ Lists.foldl (\acc -> \pair_ ->+ let seen = Pairs.first acc+ findings = Pairs.second acc+ ns = Pairs.first pair_+ pkg = Pairs.second pair_+ existing = Maps.lookup ns seen+ in (Optionals.match existing (Maps.insert ns pkg seen, findings) (\firstPkg -> Logic.ifElse (Equality.equal firstPkg pkg) acc (+ seen,+ (Lists.concat2 findings (Lists.singleton (ErrorPackaging.InvalidPackageErrorModuleInMultiplePackages (ErrorPackaging.ModuleInMultiplePackagesError {+ ErrorPackaging.moduleInMultiplePackagesErrorModuleName = ns,+ ErrorPackaging.moduleInMultiplePackagesErrorFirstPackage = (Packaging.PackageName firstPkg),+ ErrorPackaging.moduleInMultiplePackagesErrorSecondPackage = (Packaging.PackageName pkg)})))))))) (Maps.empty, []) declaredPairs+ in (Pairs.second result)++-- | Check for module namespaces that are a strict dotted-prefix of another module namespace in the same package+checkNestedModuleNames :: Packaging.Package -> Maybe ErrorPackaging.InvalidPackageError+checkNestedModuleNames pkg =++ let isDottedPrefixOf =+ \a -> \b ->+ let prefix = Strings.concat2 a "."+ prefixLen = Strings.length prefix+ in (Logic.and (Ordering.lte prefixLen (Strings.length b)) (Equality.equal (Strings.fromList (Lists.take prefixLen (Strings.toList b))) prefix))+ findNesting =+ \candidate -> \seen -> Lists.foldl (\acc -> \other -> Optionals.match acc (Logic.ifElse (isDottedPrefixOf other candidate) (Just (other, candidate)) (Logic.ifElse (isDottedPrefixOf candidate other) (Just (candidate, other)) Nothing)) (\_ -> acc)) Nothing seen+ result =+ Lists.foldl (\acc -> \mod ->+ let seen = Pairs.first acc+ err = Pairs.second acc+ in (Optionals.match err (+ let nsStr = Packaging.unModuleName (Packaging.moduleName mod)+ nesting = findNesting nsStr seen+ in (Optionals.match nesting (Lists.concat2 seen (Lists.singleton nsStr), Nothing) (\op -> (+ seen,+ (Just (ErrorPackaging.InvalidPackageErrorNestedModuleName (ErrorPackaging.NestedModuleNameError {+ ErrorPackaging.nestedModuleNameErrorOuter = (Packaging.ModuleName (Pairs.first op)),+ ErrorPackaging.nestedModuleNameErrorInner = (Packaging.ModuleName (Pairs.second op))}))))))) (\_ -> acc))) ([], Nothing) (Packaging.packageModules pkg)+ in (Pairs.second result)++-- | Check that the package's name matches the hyphen-separated lowercase naming convention+checkPackageNameConvention :: Packaging.Package -> Maybe ErrorPackaging.InvalidPackageError+checkPackageNameConvention pkg =++ let pname = Packaging.packageName pkg+ in (Logic.ifElse (LibRegex.matches Constants.regexPackageName (Packaging.unPackageName pname)) Nothing (Just (ErrorPackaging.InvalidPackageErrorInvalidPackageName (ErrorPackaging.InvalidPackageNameError {+ ErrorPackaging.invalidPackageNameErrorPackageName = pname}))))++-- | Check a module's definitions for free names whose owning module is not among its declared dependencies+checkUndeclaredDependencies :: M.Map Model.Name Packaging.ModuleName -> S.Set Model.Name -> Packaging.Module -> [ErrorPackaging.InvalidPackageError]+checkUndeclaredDependencies owners primNames mod =++ let ns = Packaging.moduleName mod+ visible =+ Sets.insert ns (Sets.fromList (Lists.map (\dep -> Packaging.moduleDependencyModule dep) (Packaging.moduleDependencies mod)))+ referencedNames =+ \def -> case def of+ Packaging.DefinitionTerm v0 -> Sets.union (Variables.freeVariablesInTerm (Packaging.termDefinitionBody v0)) (Dependencies.termDependencyNames False False True (Packaging.termDefinitionBody v0))+ Packaging.DefinitionType v0 -> Dependencies.typeDependencyNames False (Model.typeSchemeBody (Packaging.typeDefinitionBody v0))+ _ -> Sets.empty+ findingForRef =+ \refName -> Logic.ifElse (Sets.member refName primNames) Nothing (Optionals.bind (Maps.lookup refName owners) (\owner -> Logic.ifElse (Sets.member owner visible) Nothing (Just (ErrorPackaging.InvalidPackageErrorUndeclaredDependency (ErrorPackaging.UndeclaredDependencyError {+ ErrorPackaging.undeclaredDependencyErrorModuleName = ns,+ ErrorPackaging.undeclaredDependencyErrorReferencedName = refName,+ ErrorPackaging.undeclaredDependencyErrorOwningModuleName = owner})))))+ findingsForDef = \def -> Optionals.mapOptional findingForRef (Sets.toList (referencedNames def))+ in (Lists.concat (Lists.map findingsForDef (Packaging.moduleDefinitions mod)))++-- | Extract the name from a definition+definitionName :: Packaging.Definition -> Model.Name+definitionName def =+ case def of+ Packaging.DefinitionTerm v0 -> Packaging.termDefinitionName v0+ Packaging.DefinitionType v0 -> Packaging.typeDefinitionName v0+ Packaging.DefinitionPrimitive v0 -> Packaging.primitiveDefinitionName v0++-- | True iff the given rule name appears in the profile's errorRules or warningRules.+enabledPackaging :: Validation.ValidationProfile -> Model.Name -> Bool+enabledPackaging p ruleName =+ Logic.or (Sets.member ruleName (Validation.validationProfileErrorRules p)) (Sets.member ruleName (Validation.validationProfileWarningRules p))++-- | The default validation profile for module/package validation. Every kernel-shipped check classified as an error; no warnings; maxErrors=1, maxWarnings=20.+kernelDefaultPackagingProfile :: Validation.ValidationProfile+kernelDefaultPackagingProfile =+ Validation.ValidationProfile {+ Validation.validationProfileErrorRules = (Sets.fromList [+ Model.Name "hydra.core.error.packaging.InvalidModuleError.conflictingVariantName",+ (Model.Name "hydra.core.error.packaging.InvalidModuleError.definitionNotInModuleName"),+ (Model.Name "hydra.core.error.packaging.InvalidModuleError.definitionsOutOfOrder"),+ (Model.Name "hydra.core.error.packaging.InvalidModuleError.duplicateDefinitionName"),+ (Model.Name "hydra.core.error.packaging.InvalidModuleError.invalidDefinitionName"),+ (Model.Name "hydra.core.error.packaging.InvalidModuleError.invalidModuleNameConvention"),+ (Model.Name "hydra.core.error.packaging.InvalidModuleError.missingDocumentation"),+ (Model.Name "hydra.core.error.packaging.InvalidPackageError.conflictingModuleName"),+ (Model.Name "hydra.core.error.packaging.InvalidPackageError.duplicateModuleName"),+ (Model.Name "hydra.core.error.packaging.InvalidPackageError.invalidPackageName"),+ (Model.Name "hydra.core.error.packaging.InvalidPackageError.nestedModuleName")]),+ Validation.validationProfileWarningRules = Sets.empty,+ Validation.validationProfileMaxErrors = 1,+ Validation.validationProfileMaxWarnings = 20}++-- | Validate a kernel module against all kernel-default packaging rules; returns the first error found or nothing if valid. Convenience wrapper around 'module'' with 'kernelDefaultPackagingProfile'.+kernelModule :: Packaging.Module -> Maybe ErrorPackaging.InvalidModuleError+kernelModule mod =+ Lists.head (Validation.validationResultErrors (module_ kernelDefaultPackagingProfile (Validation.ValidationResult {+ Validation.validationResultErrors = [],+ Validation.validationResultWarnings = []}) mod))++-- | Validate a kernel package against all kernel-default packaging rules; returns the first error found or nothing if valid. Convenience wrapper around 'package' with 'kernelDefaultPackagingProfile'.+kernelPackage :: Packaging.Package -> Maybe ErrorPackaging.InvalidPackageError+kernelPackage pkg =+ Lists.head (Validation.validationResultErrors (package kernelDefaultPackagingProfile (Validation.ValidationResult {+ Validation.validationResultErrors = [],+ Validation.validationResultWarnings = []}) pkg))++-- | Non-kernel packaging profile (#575): identical to kernelDefaultPackagingProfile except the rules in kernelPackagingWarningRuleNamesForNonKernel (documentation, ordering, naming convention) are warnings, not errors, so each package's pre-existing backlog does not block sync until that package is promoted to the fully-fatal profile.+kernelPackagingProfileWithDocWarnings :: Validation.ValidationProfile+kernelPackagingProfileWithDocWarnings =+ Validation.ValidationProfile {+ Validation.validationProfileErrorRules = (Sets.fromList [+ Model.Name "hydra.core.error.packaging.InvalidModuleError.conflictingVariantName",+ (Model.Name "hydra.core.error.packaging.InvalidModuleError.definitionNotInModuleName"),+ (Model.Name "hydra.core.error.packaging.InvalidModuleError.duplicateDefinitionName"),+ (Model.Name "hydra.core.error.packaging.InvalidModuleError.invalidModuleNameConvention"),+ (Model.Name "hydra.core.error.packaging.InvalidPackageError.conflictingModuleName"),+ (Model.Name "hydra.core.error.packaging.InvalidPackageError.duplicateModuleName"),+ (Model.Name "hydra.core.error.packaging.InvalidPackageError.invalidPackageName"),+ (Model.Name "hydra.core.error.packaging.InvalidPackageError.nestedModuleName")]),+ Validation.validationProfileWarningRules = (Sets.fromList [+ Model.Name "hydra.core.error.packaging.InvalidModuleError.missingDocumentation",+ (Model.Name "hydra.core.error.packaging.InvalidModuleError.definitionsOutOfOrder"),+ (Model.Name "hydra.core.error.packaging.InvalidModuleError.invalidDefinitionName")]),+ Validation.validationProfileMaxErrors = 1,+ Validation.validationProfileMaxWarnings = 10000}++-- | Check every module in the given universe for undeclared cross-module dependencies, returning every finding.+kernelUniverseUndeclaredDependencies :: [Packaging.Module] -> S.Set Model.Name -> [ErrorPackaging.InvalidPackageError]+kernelUniverseUndeclaredDependencies universe primNames =++ let owners = undeclaredDependencyOwners universe+ in (Lists.concat (Lists.map (\mod -> checkUndeclaredDependencies owners primNames mod) universe))++-- | Validate a module against the given ValidationProfile, accumulating findings into a ValidationResult. Errors hard-stop the rule sequence once maxErrors is reached.+module_ :: Validation.ValidationProfile -> Validation.ValidationResult ErrorPackaging.InvalidModuleError -> Packaging.Module -> Validation.ValidationResult ErrorPackaging.InvalidModuleError+module_ p acc0 mod =+ Lists.foldl (\acc -> \guarded -> Logic.ifElse (Ordering.gte (Lists.length (Validation.validationResultErrors acc)) (Validation.validationProfileMaxErrors p)) acc (appendFindingModule p acc guarded)) acc0 [+ Logic.ifElse (enabledPackaging p (Model.Name "hydra.core.error.packaging.InvalidModuleError.conflictingVariantName")) (Optionals.map (\f -> (Model.Name "hydra.core.error.packaging.InvalidModuleError.conflictingVariantName", f)) (checkConflictingVariantNames mod)) Nothing,+ (Logic.ifElse (enabledPackaging p (Model.Name "hydra.core.error.packaging.InvalidModuleError.missingDocumentation")) (Optionals.map (\f -> (Model.Name "hydra.core.error.packaging.InvalidModuleError.missingDocumentation", f)) (checkDefinitionDocumentation mod)) Nothing),+ (Logic.ifElse (enabledPackaging p (Model.Name "hydra.core.error.packaging.InvalidModuleError.invalidDefinitionName")) (Optionals.map (\f -> (Model.Name "hydra.core.error.packaging.InvalidModuleError.invalidDefinitionName", f)) (checkDefinitionNameConvention mod)) Nothing),+ (Logic.ifElse (enabledPackaging p (Model.Name "hydra.core.error.packaging.InvalidModuleError.definitionNotInModuleName")) (Optionals.map (\f -> (Model.Name "hydra.core.error.packaging.InvalidModuleError.definitionNotInModuleName", f)) (checkDefinitionModuleNames mod)) Nothing),+ (Logic.ifElse (enabledPackaging p (Model.Name "hydra.core.error.packaging.InvalidModuleError.definitionsOutOfOrder")) (Optionals.map (\f -> (Model.Name "hydra.core.error.packaging.InvalidModuleError.definitionsOutOfOrder", f)) (checkDefinitionOrdering mod)) Nothing),+ (Logic.ifElse (enabledPackaging p (Model.Name "hydra.core.error.packaging.InvalidModuleError.duplicateDefinitionName")) (Optionals.map (\f -> (Model.Name "hydra.core.error.packaging.InvalidModuleError.duplicateDefinitionName", f)) (checkDuplicateDefinitionNames mod)) Nothing),+ (Logic.ifElse (enabledPackaging p (Model.Name "hydra.core.error.packaging.InvalidModuleError.invalidModuleNameConvention")) (Optionals.map (\f -> (Model.Name "hydra.core.error.packaging.InvalidModuleError.invalidModuleNameConvention", f)) (checkModuleNameConvention mod)) Nothing)]++-- | Validate a package against the given ValidationProfile, accumulating findings into a ValidationResult. Errors hard-stop traversal once maxErrors is reached.+package :: Validation.ValidationProfile -> Validation.ValidationResult ErrorPackaging.InvalidPackageError -> Packaging.Package -> Validation.ValidationResult ErrorPackaging.InvalidPackageError+package p acc0 pkg =++ let accPkg =+ Lists.foldl (\acc -> \guarded -> Logic.ifElse (Ordering.gte (Lists.length (Validation.validationResultErrors acc)) (Validation.validationProfileMaxErrors p)) acc (appendFindingPackage p acc guarded)) acc0 [+ Logic.ifElse (enabledPackaging p (Model.Name "hydra.core.error.packaging.InvalidPackageError.conflictingModuleName")) (Optionals.map (\f -> (Model.Name "hydra.core.error.packaging.InvalidPackageError.conflictingModuleName", f)) (checkConflictingModuleNames pkg)) Nothing,+ (Logic.ifElse (enabledPackaging p (Model.Name "hydra.core.error.packaging.InvalidPackageError.duplicateModuleName")) (Optionals.map (\f -> (Model.Name "hydra.core.error.packaging.InvalidPackageError.duplicateModuleName", f)) (checkDuplicateModuleNames pkg)) Nothing),+ (Logic.ifElse (enabledPackaging p (Model.Name "hydra.core.error.packaging.InvalidPackageError.invalidPackageName")) (Optionals.map (\f -> (Model.Name "hydra.core.error.packaging.InvalidPackageError.invalidPackageName", f)) (checkPackageNameConvention pkg)) Nothing),+ (Logic.ifElse (enabledPackaging p (Model.Name "hydra.core.error.packaging.InvalidPackageError.nestedModuleName")) (Optionals.map (\f -> (Model.Name "hydra.core.error.packaging.InvalidPackageError.nestedModuleName", f)) (checkNestedModuleNames pkg)) Nothing)]+ in (Lists.foldl (\acc -> \mod -> Logic.ifElse (Ordering.gte (Lists.length (Validation.validationResultErrors acc)) (Validation.validationProfileMaxErrors p)) acc (+ let mr =+ module_ p (Validation.ValidationResult {+ Validation.validationResultErrors = [],+ Validation.validationResultWarnings = []}) mod+ liftedErrs = Lists.map (\e -> ErrorPackaging.InvalidPackageErrorInvalidModule e) (Validation.validationResultErrors mr)+ liftedWrns = Lists.map (\w -> ErrorPackaging.InvalidPackageErrorInvalidModule w) (Validation.validationResultWarnings mr)+ newErrs =+ Lists.take (Validation.validationProfileMaxErrors p) (Lists.concat2 (Validation.validationResultErrors acc) liftedErrs)+ newWrns =+ Lists.take (Validation.validationProfileMaxWarnings p) (Lists.concat2 (Validation.validationResultWarnings acc) liftedWrns)+ in Validation.ValidationResult {+ Validation.validationResultErrors = newErrs,+ Validation.validationResultWarnings = newWrns})) accPkg (Packaging.packageModules pkg))++-- | Build a map from every name defined in the universe to its owning module+undeclaredDependencyOwners :: [Packaging.Module] -> M.Map Model.Name Packaging.ModuleName+undeclaredDependencyOwners universe =+ Maps.fromList (Lists.concat (Lists.map (\m -> Lists.map (\def -> (definitionName def, (Packaging.moduleName m))) (Packaging.moduleDefinitions m)) universe))
@@ -0,0 +1,76 @@+-- Note: this is an automatically generated file. Do not edit.++-- | The TermGraph : TypeGraph conformance relation: path erasure (a subterm position maps to the subtype position of its type) plus node typing, partial on the computation fragment.++module Hydra.Core.Validate.Paths where++import qualified Hydra.Core.Ast as Ast+import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Diff as Diff+import qualified Hydra.Core.Docs as Docs+import qualified Hydra.Core.Error.Checking as Checking+import qualified Hydra.Core.Error.File as ErrorFile+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Error.Packaging as ErrorPackaging+import qualified Hydra.Core.Error.System as ErrorSystem+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Json.Model as JsonModel+import qualified Hydra.Core.Overlay.Haskell.Lib.Lists as Lists+import qualified Hydra.Core.Overlay.Haskell.Lib.Logic as Logic+import qualified Hydra.Core.Overlay.Haskell.Lib.Optionals as Optionals+import qualified Hydra.Core.Overlay.Haskell.Lib.Pairs as Pairs+import qualified Hydra.Core.Markdown as Markdown+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Parsing as Parsing+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Query as Query+import qualified Hydra.Core.Regex as Regex+import qualified Hydra.Core.Relational as Relational+import qualified Hydra.Core.System as System+import qualified Hydra.Core.Tabular as Tabular+import qualified Hydra.Core.Testing as Testing+import qualified Hydra.Core.Time as Time+import qualified Hydra.Core.Topology as Topology+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Validation as Validation+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | Erase a subterm path to the subtype path of its type, if wholly within the data fragment+eraseSubtermPath :: Paths.SubtermPath -> Maybe Paths.SubtypePath+eraseSubtermPath path =++ let steps = Paths.unSubtermPath path+ go =+ \acc -> \step -> Optionals.match acc Nothing (\stateP ->+ let out = Pairs.first stateP+ pendingEntry = Pairs.second stateP+ in (Logic.ifElse pendingEntry (case step of+ Paths.SubtermStepPairFirst -> Just (Lists.concat2 out [+ Paths.SubtypeStepMapKeys], False)+ Paths.SubtermStepPairSecond -> Just (Lists.concat2 out [+ Paths.SubtypeStepMapValues], False)+ _ -> Nothing) (case step of+ Paths.SubtermStepMapEntry _ -> Just (out, True)+ _ -> Optionals.map (\st -> (Lists.concat2 out [+ st], False)) (eraseSubtermStep step))))+ result = Lists.foldl go (Just ([], False)) steps+ in (Optionals.bind result (\stateP -> Logic.ifElse (Pairs.second stateP) Nothing (Just (Paths.SubtypePath (Pairs.first stateP)))))++-- | The subtype-side analog of a subterm step on the data fragment, or nothing on the computation fragment+eraseSubtermStep :: Paths.SubtermStep -> Maybe Paths.SubtypeStep+eraseSubtermStep step =+ case step of+ Paths.SubtermStepListElement _ -> Just Paths.SubtypeStepListElement+ Paths.SubtermStepSetElement _ -> Just Paths.SubtypeStepSetElement+ Paths.SubtermStepOptionalGiven -> Just Paths.SubtypeStepOptionalElement+ Paths.SubtermStepInjectField v0 -> Just (Paths.SubtypeStepUnionField v0)+ Paths.SubtermStepRecordField v0 -> Just (Paths.SubtypeStepRecordField v0)+ _ -> Nothing
@@ -0,0 +1,50 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Framework types for configurable validation: profiles classify checks as errors or warnings, and results accumulate findings up to caller-specified bounds.++module Hydra.Core.Validation where++import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Model as Model+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void+import qualified Data.Set as S++-- | Configuration for a validation pass: which check rules are active, how each is classified, and the upper bounds on collected findings. A check whose rule name appears in neither set is never evaluated. Errors hard-stop the traversal once maxErrors is reached; warnings only stop being collected once maxWarnings is reached, never causing termination.+data ValidationProfile =+ ValidationProfile {+ -- | The set of fully qualified rule names whose findings are treated as errors. Each name has the form 'hydra.core.error.<package>.<UnionType>.<variant>', e.g. 'hydra.core.error.model.InvalidTermError.duplicateBinding'.+ validationProfileErrorRules :: (S.Set Model.Name),+ -- | The set of fully qualified rule names whose findings are treated as warnings. Same name format as errorRules.+ validationProfileWarningRules :: (S.Set Model.Name),+ -- | Hard upper bound on collected errors. Validation terminates as soon as the errors list reaches this length. A value of 1 reproduces the legacy 'first error wins' behaviour.+ validationProfileMaxErrors :: Int,+ -- | Soft upper bound on collected warnings. Once the warnings list reaches this length, further warning matches are silently dropped, but validation does not terminate; it continues until maxErrors is reached or the traversal completes.+ validationProfileMaxWarnings :: Int}+ deriving (Eq, Ord, Read, Show)++_ValidationProfile = Model.Name "hydra.core.validation.ValidationProfile"++_ValidationProfile_errorRules = Model.Name "errorRules"++_ValidationProfile_warningRules = Model.Name "warningRules"++_ValidationProfile_maxErrors = Model.Name "maxErrors"++_ValidationProfile_maxWarnings = Model.Name "maxWarnings"++-- | The outcome of a validation pass: an ordered list of error findings and an ordered list of warning findings, each parameterized by the finding payload type. The pass is considered successful when 'errors' is empty; warnings are informational and do not affect that judgement.+data ValidationResult e =+ ValidationResult {+ -- | Findings classified as errors, in traversal order, bounded by the profile's maxErrors.+ validationResultErrors :: [e],+ -- | Findings classified as warnings, in traversal order, bounded by the profile's maxWarnings.+ validationResultWarnings :: [e]}+ deriving (Eq, Ord, Read, Show)++_ValidationResult = Model.Name "hydra.core.validation.ValidationResult"++_ValidationResult_errors = Model.Name "errors"++_ValidationResult_warnings = Model.Name "warnings"
@@ -0,0 +1,322 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Free variable analysis, term-level substitution, and unshadowing++module Hydra.Core.Variables where++import qualified Hydra.Core.Ast as Ast+import qualified Hydra.Core.Coders as Coders+import qualified Hydra.Core.Diff as Diff+import qualified Hydra.Core.Docs as Docs+import qualified Hydra.Core.Error.Checking as Checking+import qualified Hydra.Core.Error.File as ErrorFile+import qualified Hydra.Core.Error.Model as ErrorModel+import qualified Hydra.Core.Error.Packaging as ErrorPackaging+import qualified Hydra.Core.Error.System as ErrorSystem+import qualified Hydra.Core.Errors as Errors+import qualified Hydra.Core.File as File+import qualified Hydra.Core.Graph as Graph+import qualified Hydra.Core.Json.Model as JsonModel+import qualified Hydra.Core.Overlay.Haskell.Lib.Equality as Equality+import qualified Hydra.Core.Overlay.Haskell.Lib.Lists as Lists+import qualified Hydra.Core.Overlay.Haskell.Lib.Literals as Literals+import qualified Hydra.Core.Overlay.Haskell.Lib.Logic as Logic+import qualified Hydra.Core.Overlay.Haskell.Lib.Maps as Maps+import qualified Hydra.Core.Overlay.Haskell.Lib.Math as Math+import qualified Hydra.Core.Overlay.Haskell.Lib.Optionals as Optionals+import qualified Hydra.Core.Overlay.Haskell.Lib.Pairs as Pairs+import qualified Hydra.Core.Overlay.Haskell.Lib.Sets as Sets+import qualified Hydra.Core.Overlay.Haskell.Lib.Strings as Strings+import qualified Hydra.Core.Markdown as Markdown+import qualified Hydra.Core.Model as Model+import qualified Hydra.Core.Names as Names+import qualified Hydra.Core.Packaging as Packaging+import qualified Hydra.Core.Parsing as Parsing+import qualified Hydra.Core.Paths as Paths+import qualified Hydra.Core.Query as Query+import qualified Hydra.Core.Regex as Regex+import qualified Hydra.Core.Relational as Relational+import qualified Hydra.Core.Rewriting as Rewriting+import qualified Hydra.Core.System as System+import qualified Hydra.Core.Tabular as Tabular+import qualified Hydra.Core.Testing as Testing+import qualified Hydra.Core.Time as Time+import qualified Hydra.Core.Topology as Topology+import qualified Hydra.Core.Typed as Typed+import qualified Hydra.Core.Typing as Typing+import qualified Hydra.Core.Util as Util+import qualified Hydra.Core.Validation as Validation+import qualified Hydra.Core.Variants as Variants+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void+import qualified Data.Map as M+import qualified Data.Set as S++-- | Get the set of free type variables in a term (including schema names, where they appear in type annotations). In this context, only the type schemes of let bindings can bind type variables; type lambdas do not.+freeTypeVariablesInTerm :: Model.Term -> S.Set Model.Name+freeTypeVariablesInTerm term0 =++ let allOf = \sets -> Lists.foldl Sets.union Sets.empty sets+ tryType = \tvars -> \typ -> Sets.difference (freeVariablesInType typ) tvars+ getAll =+ \vars -> \term ->+ let recurse = getAll vars+ dflt = allOf (Lists.map recurse (Rewriting.subterms term))+ in case term of+ Model.TermLambda v0 ->+ let domt = Optionals.match (Model.lambdaDomain v0) Sets.empty (tryType vars)+ in (Sets.union domt (recurse (Model.lambdaBody v0)))+ Model.TermLet v0 ->+ let forBinding =+ \b ->+ let newVars =+ Optionals.match (Model.bindingTypeScheme b) vars (\ts -> Sets.union vars (Sets.fromList (Model.typeSchemeVariables ts)))+ in (Sets.union (getAll newVars (Model.bindingTerm b)) (Optionals.match (Model.bindingTypeScheme b) Sets.empty (\ts -> tryType newVars (Model.typeSchemeBody ts))))+ in (Sets.union (allOf (Lists.map forBinding (Model.letBindings v0))) (recurse (Model.letBody v0)))+ Model.TermTypeApplication v0 -> Sets.union (tryType vars (Model.typeApplicationTermType v0)) (recurse (Model.typeApplicationTermBody v0))+ Model.TermTypeLambda v0 -> Sets.union (tryType vars (Model.TypeVariable (Model.typeLambdaParameter v0))) (recurse (Model.typeLambdaBody v0))+ _ -> dflt+ in (getAll Sets.empty term0)++-- | Find the free variables (i.e. variables not bound by a lambda or let) in a term+freeVariablesInTerm :: Model.Term -> S.Set Model.Name+freeVariablesInTerm term =++ let dfltVars = \_ -> Lists.foldl (\s -> \t -> Sets.union s (freeVariablesInTerm t)) Sets.empty (Rewriting.subterms term)+ in case term of+ Model.TermLambda v0 -> Sets.delete (Model.lambdaParameter v0) (freeVariablesInTerm (Model.lambdaBody v0))+ Model.TermLet v0 -> Sets.difference (dfltVars ()) (Sets.fromList (Lists.map Model.bindingName (Model.letBindings v0)))+ Model.TermVariable v0 -> Sets.singleton v0+ _ -> dfltVars ()++-- | Find the free variables (i.e. variables not bound by a lambda or let) in a type+freeVariablesInType :: Model.Type -> S.Set Model.Name+freeVariablesInType typ =++ let dfltVars = Lists.foldl (\s -> \t -> Sets.union s (freeVariablesInType t)) Sets.empty (Rewriting.subtypes typ)+ in case typ of+ Model.TypeForall v0 -> Sets.delete (Model.forallTypeParameter v0) (freeVariablesInType (Model.forallTypeBody v0))+ Model.TypeVariable v0 -> Sets.singleton v0+ _ -> dfltVars++-- | Find the free variables in a type in deterministic left-to-right order+freeVariablesInTypeOrdered :: Model.Type -> [Model.Name]+freeVariablesInTypeOrdered typ =++ let collectVars =+ \boundVars -> \t -> case t of+ Model.TypeVariable v0 -> Logic.ifElse (Sets.member v0 boundVars) [] [+ v0]+ Model.TypeForall v0 -> collectVars (Sets.insert (Model.forallTypeParameter v0) boundVars) (Model.forallTypeBody v0)+ _ -> Lists.concat (Lists.map (collectVars boundVars) (Rewriting.subtypes t))+ in (Lists.distinct (collectVars Sets.empty typ))++-- | Find free variables in a type scheme+freeVariablesInTypeScheme :: Model.TypeScheme -> S.Set Model.Name+freeVariablesInTypeScheme ts =++ let vars = Model.typeSchemeVariables ts+ t = Model.typeSchemeBody ts+ in (Sets.difference (freeVariablesInType t) (Sets.fromList vars))++-- | Find free variables in a type scheme (simple version)+freeVariablesInTypeSchemeSimple :: Model.TypeScheme -> S.Set Model.Name+freeVariablesInTypeSchemeSimple ts =++ let vars = Model.typeSchemeVariables ts+ t = Model.typeSchemeBody ts+ in (Sets.difference (freeVariablesInTypeSimple t) (Sets.fromList vars))++-- | Same as freeVariablesInType, but ignores the binding action of lambda types+freeVariablesInTypeSimple :: Model.Type -> S.Set Model.Name+freeVariablesInTypeSimple typ =++ let helper =+ \types -> \typ2 -> case typ2 of+ Model.TypeVariable v0 -> Sets.insert v0 types+ _ -> types+ in (Rewriting.foldOverType Coders.TraversalOrderPre helper Sets.empty typ)++-- | Check whether a variable is free (not bound) in a term+isFreeVariableInTerm :: Model.Name -> Model.Term -> Bool+isFreeVariableInTerm v term = Logic.not (Sets.member v (freeVariablesInTerm term))++-- | Recursively replace the type variables of let bindings with the systematic type variables t0, t1, t2, ...+normalizeTypeVariablesInTerm :: Model.Term -> Model.Term+normalizeTypeVariablesInTerm term =++ let replaceName = \subst -> \v -> Optionals.withDefault v (Maps.lookup v subst)+ substType =+ \subst -> \typ ->+ let rewrite =+ \recurse -> \typ2 -> case typ2 of+ Model.TypeVariable v0 -> Model.TypeVariable (replaceName subst v0)+ _ -> recurse typ2+ in (Rewriting.rewriteType rewrite typ)+ rewriteWithSubst =+ \state -> \term0 ->+ let sb = Pairs.first state+ next = Pairs.second state+ subst = Pairs.first sb+ boundVars = Pairs.second sb+ rewrite =+ \recurse -> \term2 -> case term2 of+ Model.TermLambda v0 ->+ let domain = Model.lambdaDomain v0+ in (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = (Model.lambdaParameter v0),+ Model.lambdaDomain = (Optionals.map (substType subst) domain),+ Model.lambdaBody = (rewriteWithSubst ((subst, boundVars), next) (Model.lambdaBody v0))}))+ Model.TermLet v0 ->+ let bindings0 = Model.letBindings v0+ body0 = Model.letBody v0+ step =+ \acc -> \bs -> Optionals.match (Lists.uncons bs) (Lists.reverse acc) (\uc ->+ let b = Pairs.first uc+ tl = Pairs.second uc+ noType =++ let newVal = rewriteWithSubst ((subst, boundVars), next) (Model.bindingTerm b)+ b1 =+ Model.Binding {+ Model.bindingName = (Model.bindingName b),+ Model.bindingTerm = newVal,+ Model.bindingTypeScheme = Nothing}+ in (step (Lists.cons b1 acc) tl)+ withType =+ \ts ->+ let vars = Model.typeSchemeVariables ts+ typ = Model.typeSchemeBody ts+ k = Lists.length vars+ gen =+ \i -> \rem -> \acc2 ->+ let ti = Model.Name (Strings.concat2 "t" (Literals.printInt32 (Math.add next i)))+ in (Logic.ifElse (Equality.equal rem 0) (Lists.reverse acc2) (gen (Math.add i 1) (Math.sub rem 1) (Lists.cons ti acc2)))+ newVars = gen 0 k []+ newSubst = Maps.union (Maps.fromList (Lists.zip vars newVars)) subst+ newBound = Sets.union boundVars (Sets.fromList newVars)+ newVal = rewriteWithSubst ((newSubst, newBound), (Math.add next k)) (Model.bindingTerm b)+ renameConstraintKeys =+ \constraintMap -> Maps.fromList (Lists.map (\p ->+ let oldName = Pairs.first p+ meta = Pairs.second p+ newName = Optionals.withDefault oldName (Maps.lookup oldName newSubst)+ in (newName, meta)) (Maps.toList constraintMap))+ oldConstraints = Model.typeSchemeConstraints ts+ newConstraints = renameConstraintKeys oldConstraints+ b1 =+ Model.Binding {+ Model.bindingName = (Model.bindingName b),+ Model.bindingTerm = newVal,+ Model.bindingTypeScheme = (Just (Model.TypeScheme {+ Model.typeSchemeVariables = newVars,+ Model.typeSchemeBody = (substType newSubst typ),+ Model.typeSchemeConstraints = newConstraints}))}+ in (step (Lists.cons b1 acc) tl)+ in (Optionals.match (Model.bindingTypeScheme b) noType (\ts -> withType ts)))+ bindings1 = step [] bindings0+ in (Model.TermLet (Model.Let {+ Model.letBindings = bindings1,+ Model.letBody = (rewriteWithSubst ((subst, boundVars), next) body0)}))+ Model.TermTypeApplication v0 -> Model.TermTypeApplication (Model.TypeApplicationTerm {+ Model.typeApplicationTermBody = (rewriteWithSubst ((subst, boundVars), next) (Model.typeApplicationTermBody v0)),+ Model.typeApplicationTermType = (substType subst (Model.typeApplicationTermType v0))})+ Model.TermTypeLambda v0 -> Model.TermTypeLambda (Model.TypeLambda {+ Model.typeLambdaParameter = (replaceName subst (Model.typeLambdaParameter v0)),+ Model.typeLambdaBody = (rewriteWithSubst ((subst, boundVars), next) (Model.typeLambdaBody v0))})+ _ -> recurse term2+ in (Rewriting.rewriteTerm rewrite term0)+ in (rewriteWithSubst ((Maps.empty, Sets.empty), 0) term)++-- | Replace a free variable in a term+replaceFreeTermVariable :: Model.Name -> Model.Term -> Model.Term -> Model.Term+replaceFreeTermVariable vold tnew term =++ let rewrite =+ \recurse -> \t -> case t of+ Model.TermLambda v0 ->+ let v = Model.lambdaParameter v0+ in (Logic.ifElse (Equality.equal v vold) t (recurse t))+ Model.TermVariable v0 -> Logic.ifElse (Equality.equal v0 vold) tnew (Model.TermVariable v0)+ _ -> recurse t+ in (Rewriting.rewriteTerm rewrite term)++-- | Replace free occurrences of a name in a type+replaceFreeTypeVariable :: Model.Name -> Model.Type -> Model.Type -> Model.Type+replaceFreeTypeVariable v rep typ =++ let mapExpr =+ \recurse -> \t -> case t of+ Model.TypeForall v0 -> Logic.ifElse (Equality.equal v (Model.forallTypeParameter v0)) t (Model.TypeForall (Model.ForallType {+ Model.forallTypeParameter = (Model.forallTypeParameter v0),+ Model.forallTypeBody = (recurse (Model.forallTypeBody v0))}))+ Model.TypeVariable v0 -> Logic.ifElse (Equality.equal v v0) rep t+ _ -> recurse t+ in (Rewriting.rewriteType mapExpr typ)++-- | Substitute type variables in a type+substituteTypeVariables :: M.Map Model.Name Model.Name -> Model.Type -> Model.Type+substituteTypeVariables subst typ =++ let replace =+ \recurse -> \typ2 -> case typ2 of+ Model.TypeVariable v0 -> Model.TypeVariable (Optionals.withDefault v0 (Maps.lookup v0 subst))+ _ -> recurse typ2+ in (Rewriting.rewriteType replace typ)++-- | Substitute one variable for another in a term+substituteVariable :: Model.Name -> Model.Name -> Model.Term -> Model.Term+substituteVariable from to term =++ let replace =+ \recurse -> \term2 -> case term2 of+ Model.TermVariable v0 -> Model.TermVariable (Logic.ifElse (Equality.equal v0 from) to v0)+ Model.TermLambda v0 -> Logic.ifElse (Equality.equal (Model.lambdaParameter v0) from) term2 (recurse term2)+ _ -> recurse term2+ in (Rewriting.rewriteTerm replace term)++-- | Substitute multiple variables in a term+substituteVariables :: M.Map Model.Name Model.Name -> Model.Term -> Model.Term+substituteVariables subst term =++ let replace =+ \recurse -> \term2 -> case term2 of+ Model.TermVariable v0 -> Model.TermVariable (Optionals.withDefault v0 (Maps.lookup v0 subst))+ Model.TermLambda v0 -> Optionals.match (Maps.lookup (Model.lambdaParameter v0) subst) (recurse term2) (\_ -> term2)+ _ -> recurse term2+ in (Rewriting.rewriteTerm replace term)++-- | Rename all shadowed variables (both lambda parameters and let-bound variables that shadow lambda parameters) in a term.+unshadowVariables :: Model.Term -> Model.Term+unshadowVariables term0 =++ let freshName =+ \base -> \i -> \m ->+ let candidate = Model.Name (Strings.concat2 (Model.unName base) (Literals.printInt32 i))+ in (Logic.ifElse (Maps.member candidate m) (freshName base (Math.add i 1) m) candidate)+ f =+ \recurse -> \m -> \term -> case term of+ Model.TermLambda v0 ->+ let v = Model.lambdaParameter v0+ domain = Model.lambdaDomain v0+ body = Model.lambdaBody v0+ in (Logic.ifElse (Maps.member v m) (+ let v2 = freshName v 2 m+ m2 = Maps.insert v v2 (Maps.insert v2 v2 m)+ in (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = v2,+ Model.lambdaDomain = domain,+ Model.lambdaBody = (f recurse m2 body)}))) (Model.TermLambda (Model.Lambda {+ Model.lambdaParameter = v,+ Model.lambdaDomain = domain,+ Model.lambdaBody = (f recurse (Maps.insert v v m) body)})))+ Model.TermLet v0 ->+ let m2 =+ Lists.foldl (\acc -> \b ->+ let bname = Model.bindingName b+ in (Logic.ifElse (Maps.member bname acc) acc (Maps.insert bname bname acc))) m (Model.letBindings v0)+ in (recurse m2 term)+ Model.TermVariable v0 -> Model.TermVariable (Optionals.match (Maps.lookup v0 m) v0 (\renamed -> renamed))+ _ -> recurse m term+ in (Rewriting.rewriteTermWithContext f Maps.empty term0)
@@ -0,0 +1,163 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Variant types which describe the structure of Hydra core types and terms.++module Hydra.Core.Variants where++import qualified Hydra.Core.Model as Model+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void++-- | The identifier of a literal constructor+data LiteralVariant =+ LiteralVariantBinary |+ LiteralVariantBoolean |+ LiteralVariantDecimal |+ LiteralVariantFloat |+ LiteralVariantInteger |+ LiteralVariantString+ deriving (Eq, Ord, Read, Show)++_LiteralVariant = Model.Name "hydra.core.variants.LiteralVariant"++_LiteralVariant_binary = Model.Name "binary"++_LiteralVariant_boolean = Model.Name "boolean"++_LiteralVariant_decimal = Model.Name "decimal"++_LiteralVariant_float = Model.Name "float"++_LiteralVariant_integer = Model.Name "integer"++_LiteralVariant_string = Model.Name "string"++-- | The identifier of a term expression constructor+data TermVariant =+ TermVariantAnnotated |+ TermVariantApplication |+ TermVariantCases |+ TermVariantEither |+ TermVariantInject |+ TermVariantLambda |+ TermVariantLet |+ TermVariantList |+ TermVariantLiteral |+ TermVariantMap |+ TermVariantOptional |+ TermVariantPair |+ TermVariantProject |+ TermVariantRecord |+ TermVariantSet |+ TermVariantTypeApplication |+ TermVariantTypeLambda |+ TermVariantUnit |+ TermVariantUnwrap |+ TermVariantVariable |+ TermVariantWrap+ deriving (Eq, Ord, Read, Show)++_TermVariant = Model.Name "hydra.core.variants.TermVariant"++_TermVariant_annotated = Model.Name "annotated"++_TermVariant_application = Model.Name "application"++_TermVariant_cases = Model.Name "cases"++_TermVariant_either = Model.Name "either"++_TermVariant_inject = Model.Name "inject"++_TermVariant_lambda = Model.Name "lambda"++_TermVariant_let = Model.Name "let"++_TermVariant_list = Model.Name "list"++_TermVariant_literal = Model.Name "literal"++_TermVariant_map = Model.Name "map"++_TermVariant_optional = Model.Name "optional"++_TermVariant_pair = Model.Name "pair"++_TermVariant_project = Model.Name "project"++_TermVariant_record = Model.Name "record"++_TermVariant_set = Model.Name "set"++_TermVariant_typeApplication = Model.Name "typeApplication"++_TermVariant_typeLambda = Model.Name "typeLambda"++_TermVariant_unit = Model.Name "unit"++_TermVariant_unwrap = Model.Name "unwrap"++_TermVariant_variable = Model.Name "variable"++_TermVariant_wrap = Model.Name "wrap"++-- | The identifier of a type constructor+data TypeVariant =+ TypeVariantAnnotated |+ TypeVariantApplication |+ TypeVariantEffect |+ TypeVariantEither |+ TypeVariantForall |+ TypeVariantFunction |+ TypeVariantList |+ TypeVariantLiteral |+ TypeVariantMap |+ TypeVariantOptional |+ TypeVariantPair |+ TypeVariantRecord |+ TypeVariantSet |+ TypeVariantUnion |+ TypeVariantUnit |+ TypeVariantVariable |+ TypeVariantVoid |+ TypeVariantWrap+ deriving (Eq, Ord, Read, Show)++_TypeVariant = Model.Name "hydra.core.variants.TypeVariant"++_TypeVariant_annotated = Model.Name "annotated"++_TypeVariant_application = Model.Name "application"++_TypeVariant_effect = Model.Name "effect"++_TypeVariant_either = Model.Name "either"++_TypeVariant_forall = Model.Name "forall"++_TypeVariant_function = Model.Name "function"++_TypeVariant_list = Model.Name "list"++_TypeVariant_literal = Model.Name "literal"++_TypeVariant_map = Model.Name "map"++_TypeVariant_optional = Model.Name "optional"++_TypeVariant_pair = Model.Name "pair"++_TypeVariant_record = Model.Name "record"++_TypeVariant_set = Model.Name "set"++_TypeVariant_union = Model.Name "union"++_TypeVariant_unit = Model.Name "unit"++_TypeVariant_variable = Model.Name "variable"++_TypeVariant_void = Model.Name "void"++_TypeVariant_wrap = Model.Name "wrap"
@@ -0,0 +1,63 @@+-- Note: this is an automatically generated file. Do not edit.++-- | A basic YAML representation model. Based on:+-- | https://yaml.org/spec/1.2/spec.html+-- | The Serialization and Presentation properties of YAML,+-- | including directives, comments, anchors, style, formatting, and aliases, are not supported by this model.+-- | In addition, tags are omitted from this model, and non-standard scalars are unsupported.++module Hydra.Core.Yaml.Model where++import qualified Hydra.Core.Model as Model+import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void+import qualified Data.Map as M++-- | A YAML node (value)+data Node =+ -- | A mapping from nodes to nodes+ NodeMapping (M.Map Node Node) |+ -- | A scalar value+ NodeScalar Scalar |+ -- | A sequence of nodes+ NodeSequence [Node]+ deriving (Eq, Ord, Read, Show)++_Node = Model.Name "hydra.core.yaml.model.Node"++_Node_mapping = Model.Name "mapping"++_Node_scalar = Model.Name "scalar"++_Node_sequence = Model.Name "sequence"++-- | A union of scalars supported in the YAML failsafe and JSON schemas. Other scalars are not supported here+data Scalar =+ -- | Represents a true/false value+ ScalarBool Bool |+ -- | An arbitrary-precision decimal number (lexically a valid JSON number)+ ScalarDecimal Sci.Scientific |+ -- | Represents an approximation to real numbers+ ScalarFloat Double |+ -- | Represents arbitrary sized finite mathematical integers+ ScalarInt Integer |+ -- | Represents the lack of a value+ ScalarNull |+ -- | A string value+ ScalarStr String+ deriving (Eq, Ord, Read, Show)++_Scalar = Model.Name "hydra.core.yaml.model.Scalar"++_Scalar_bool = Model.Name "bool"++_Scalar_decimal = Model.Name "decimal"++_Scalar_float = Model.Name "float"++_Scalar_int = Model.Name "int"++_Scalar_null = Model.Name "null"++_Scalar_str = Model.Name "str"
@@ -1,249 +0,0 @@--- Note: this is an automatically generated file. Do not edit.---- | Term decoders for hydra.ast--module Hydra.Decode.Ast where--import qualified Hydra.Ast as Ast-import qualified Hydra.Core as Core-import qualified Hydra.Decode.Core as DecodeCore-import qualified Hydra.Errors as Errors-import qualified Hydra.Extract.Core as ExtractCore-import qualified Hydra.Graph as Graph-import qualified Hydra.Lexical as Lexical-import qualified Hydra.Overlay.Haskell.Lib.Eithers as Eithers-import qualified Hydra.Overlay.Haskell.Lib.Maps as Maps-import qualified Hydra.Overlay.Haskell.Lib.Optionals as Optionals-import qualified Hydra.Overlay.Haskell.Lib.Strings as Strings-import qualified Hydra.Rewriting as Rewriting-import qualified Hydra.Util as Util-import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)-import qualified Data.Scientific as Sci-import Data.Void---- | Decoder for hydra.ast.Associativity-associativity :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Ast.Associativity-associativity cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermInject v0 ->- let field = Core.injectionField v0- fname = Core.fieldName field- fterm = Core.fieldTerm field- variantMap =- Maps.fromList [- (Core.Name "none", (\input -> Eithers.map (\t -> Ast.AssociativityNone) (ExtractCore.decodeUnit cx input))),- (Core.Name "left", (\input -> Eithers.map (\t -> Ast.AssociativityLeft) (ExtractCore.decodeUnit cx input))),- (Core.Name "right", (\input -> Eithers.map (\t -> Ast.AssociativityRight) (ExtractCore.decodeUnit cx input))),- (Core.Name "both", (\input -> Eithers.map (\t -> Ast.AssociativityBoth) (ExtractCore.decodeUnit cx input)))]- in (Optionals.match (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [- "no such field ",- (Core.unName fname),- " in union"]))) (\f -> f fterm))- _ -> Left (Errors.DecodingError "expected union")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.ast.BlockStyle-blockStyle :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Ast.BlockStyle-blockStyle cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "indent" (ExtractCore.decodeMaybe (\cx2 -> \raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of- Core.TermLiteral v1 -> case v1 of- Core.LiteralString v2 -> Right v2- _ -> Left (Errors.DecodingError "expected string literal")- _ -> Left (Errors.DecodingError "expected literal")) (ExtractCore.stripWithDecodingError cx2 raw2))) fieldMap cx) (\field_indent -> Eithers.bind (ExtractCore.requireField "newlineBeforeContent" (\cx2 -> \raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of- Core.TermLiteral v1 -> case v1 of- Core.LiteralBoolean v2 -> Right v2- _ -> Left (Errors.DecodingError "expected boolean literal")- _ -> Left (Errors.DecodingError "expected literal")) (ExtractCore.stripWithDecodingError cx2 raw2)) fieldMap cx) (\field_newlineBeforeContent -> Eithers.bind (ExtractCore.requireField "newlineAfterContent" (\cx2 -> \raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of- Core.TermLiteral v1 -> case v1 of- Core.LiteralBoolean v2 -> Right v2- _ -> Left (Errors.DecodingError "expected boolean literal")- _ -> Left (Errors.DecodingError "expected literal")) (ExtractCore.stripWithDecodingError cx2 raw2)) fieldMap cx) (\field_newlineAfterContent -> Right (Ast.BlockStyle {- Ast.blockStyleIndent = field_indent,- Ast.blockStyleNewlineBeforeContent = field_newlineBeforeContent,- Ast.blockStyleNewlineAfterContent = field_newlineAfterContent})))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.ast.BlockStyle")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.ast.BracketExpr-bracketExpr :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Ast.BracketExpr-bracketExpr cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "brackets" brackets fieldMap cx) (\field_brackets -> Eithers.bind (ExtractCore.requireField "enclosed" expr fieldMap cx) (\field_enclosed -> Eithers.bind (ExtractCore.requireField "style" blockStyle fieldMap cx) (\field_style -> Right (Ast.BracketExpr {- Ast.bracketExprBrackets = field_brackets,- Ast.bracketExprEnclosed = field_enclosed,- Ast.bracketExprStyle = field_style})))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.ast.BracketExpr")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.ast.Brackets-brackets :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Ast.Brackets-brackets cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "open" symbol fieldMap cx) (\field_open -> Eithers.bind (ExtractCore.requireField "close" symbol fieldMap cx) (\field_close -> Right (Ast.Brackets {- Ast.bracketsOpen = field_open,- Ast.bracketsClose = field_close}))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.ast.Brackets")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.ast.Expr-expr :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Ast.Expr-expr cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermInject v0 ->- let field = Core.injectionField v0- fname = Core.fieldName field- fterm = Core.fieldTerm field- variantMap =- Maps.fromList [- (Core.Name "const", (\input -> Eithers.map (\t -> Ast.ExprConst t) (symbol cx input))),- (Core.Name "indent", (\input -> Eithers.map (\t -> Ast.ExprIndent t) (indentedExpression cx input))),- (Core.Name "op", (\input -> Eithers.map (\t -> Ast.ExprOp t) (opExpr cx input))),- (Core.Name "brackets", (\input -> Eithers.map (\t -> Ast.ExprBrackets t) (bracketExpr cx input))),- (Core.Name "seq", (\input -> Eithers.map (\t -> Ast.ExprSeq t) (seqExpr cx input)))]- in (Optionals.match (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [- "no such field ",- (Core.unName fname),- " in union"]))) (\f -> f fterm))- _ -> Left (Errors.DecodingError "expected union")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.ast.IndentStyle-indentStyle :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Ast.IndentStyle-indentStyle cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermInject v0 ->- let field = Core.injectionField v0- fname = Core.fieldName field- fterm = Core.fieldTerm field- variantMap =- Maps.fromList [- (- Core.Name "allLines",- (\input -> Eithers.map (\t -> Ast.IndentStyleAllLines t) (Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of- Core.TermLiteral v1 -> case v1 of- Core.LiteralString v2 -> Right v2- _ -> Left (Errors.DecodingError "expected string literal")- _ -> Left (Errors.DecodingError "expected literal")) (ExtractCore.stripWithDecodingError cx input)))),- (- Core.Name "subsequentLines",- (\input -> Eithers.map (\t -> Ast.IndentStyleSubsequentLines t) (Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of- Core.TermLiteral v1 -> case v1 of- Core.LiteralString v2 -> Right v2- _ -> Left (Errors.DecodingError "expected string literal")- _ -> Left (Errors.DecodingError "expected literal")) (ExtractCore.stripWithDecodingError cx input))))]- in (Optionals.match (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [- "no such field ",- (Core.unName fname),- " in union"]))) (\f -> f fterm))- _ -> Left (Errors.DecodingError "expected union")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.ast.IndentedExpression-indentedExpression :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Ast.IndentedExpression-indentedExpression cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "style" indentStyle fieldMap cx) (\field_style -> Eithers.bind (ExtractCore.requireField "expr" expr fieldMap cx) (\field_expr -> Right (Ast.IndentedExpression {- Ast.indentedExpressionStyle = field_style,- Ast.indentedExpressionExpr = field_expr}))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.ast.IndentedExpression")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.ast.Op-op :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Ast.Op-op cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "symbol" symbol fieldMap cx) (\field_symbol -> Eithers.bind (ExtractCore.requireField "padding" padding fieldMap cx) (\field_padding -> Eithers.bind (ExtractCore.requireField "precedence" precedence fieldMap cx) (\field_precedence -> Eithers.bind (ExtractCore.requireField "associativity" associativity fieldMap cx) (\field_associativity -> Right (Ast.Op {- Ast.opSymbol = field_symbol,- Ast.opPadding = field_padding,- Ast.opPrecedence = field_precedence,- Ast.opAssociativity = field_associativity}))))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.ast.Op")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.ast.OpExpr-opExpr :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Ast.OpExpr-opExpr cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "op" op fieldMap cx) (\field_op -> Eithers.bind (ExtractCore.requireField "lhs" expr fieldMap cx) (\field_lhs -> Eithers.bind (ExtractCore.requireField "rhs" expr fieldMap cx) (\field_rhs -> Right (Ast.OpExpr {- Ast.opExprOp = field_op,- Ast.opExprLhs = field_lhs,- Ast.opExprRhs = field_rhs})))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.ast.OpExpr")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.ast.Padding-padding :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Ast.Padding-padding cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "left" ws fieldMap cx) (\field_left -> Eithers.bind (ExtractCore.requireField "right" ws fieldMap cx) (\field_right -> Right (Ast.Padding {- Ast.paddingLeft = field_left,- Ast.paddingRight = field_right}))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.ast.Padding")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.ast.Precedence-precedence :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Ast.Precedence-precedence cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermWrap v0 -> Eithers.map (\b -> Ast.Precedence b) ((\raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of- Core.TermLiteral v1 -> case v1 of- Core.LiteralInteger v2 -> case v2 of- Core.IntegerValueInt32 v3 -> Right v3- _ -> Left (Errors.DecodingError "expected int32 value")- _ -> Left (Errors.DecodingError "expected int32 literal")- _ -> Left (Errors.DecodingError "expected literal")) (ExtractCore.stripWithDecodingError cx raw2)) (Core.wrappedTermBody v0))- _ -> Left (Errors.DecodingError "expected wrapped type")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.ast.SeqExpr-seqExpr :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Ast.SeqExpr-seqExpr cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "op" op fieldMap cx) (\field_op -> Eithers.bind (ExtractCore.requireField "elements" (ExtractCore.decodeList expr) fieldMap cx) (\field_elements -> Right (Ast.SeqExpr {- Ast.seqExprOp = field_op,- Ast.seqExprElements = field_elements}))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.ast.SeqExpr")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.ast.Symbol-symbol :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Ast.Symbol-symbol cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermWrap v0 -> Eithers.map (\b -> Ast.Symbol b) ((\raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of- Core.TermLiteral v1 -> case v1 of- Core.LiteralString v2 -> Right v2- _ -> Left (Errors.DecodingError "expected string literal")- _ -> Left (Errors.DecodingError "expected literal")) (ExtractCore.stripWithDecodingError cx raw2)) (Core.wrappedTermBody v0))- _ -> Left (Errors.DecodingError "expected wrapped type")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.ast.Ws-ws :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Ast.Ws-ws cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermInject v0 ->- let field = Core.injectionField v0- fname = Core.fieldName field- fterm = Core.fieldTerm field- variantMap =- Maps.fromList [- (Core.Name "none", (\input -> Eithers.map (\t -> Ast.WsNone) (ExtractCore.decodeUnit cx input))),- (Core.Name "space", (\input -> Eithers.map (\t -> Ast.WsSpace) (ExtractCore.decodeUnit cx input))),- (Core.Name "break", (\input -> Eithers.map (\t -> Ast.WsBreak) (ExtractCore.decodeUnit cx input))),- (- Core.Name "breakAndIndent",- (\input -> Eithers.map (\t -> Ast.WsBreakAndIndent t) (Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of- Core.TermLiteral v1 -> case v1 of- Core.LiteralString v2 -> Right v2- _ -> Left (Errors.DecodingError "expected string literal")- _ -> Left (Errors.DecodingError "expected literal")) (ExtractCore.stripWithDecodingError cx input)))),- (Core.Name "doubleBreak", (\input -> Eithers.map (\t -> Ast.WsDoubleBreak) (ExtractCore.decodeUnit cx input)))]- in (Optionals.match (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [- "no such field ",- (Core.unName fname),- " in union"]))) (\f -> f fterm))- _ -> Left (Errors.DecodingError "expected union")) (ExtractCore.stripWithDecodingError cx raw)
@@ -1,117 +0,0 @@--- Note: this is an automatically generated file. Do not edit.---- | Term decoders for hydra.coders--module Hydra.Decode.Coders where--import qualified Hydra.Coders as Coders-import qualified Hydra.Core as Core-import qualified Hydra.Decode.Core as DecodeCore-import qualified Hydra.Decode.Errors as DecodeErrors-import qualified Hydra.Decode.File as File-import qualified Hydra.Decode.Util as DecodeUtil-import qualified Hydra.Decode.Variants as Variants-import qualified Hydra.Errors as Errors-import qualified Hydra.Extract.Core as ExtractCore-import qualified Hydra.Graph as Graph-import qualified Hydra.Lexical as Lexical-import qualified Hydra.Overlay.Haskell.Lib.Eithers as Eithers-import qualified Hydra.Overlay.Haskell.Lib.Maps as Maps-import qualified Hydra.Overlay.Haskell.Lib.Optionals as Optionals-import qualified Hydra.Overlay.Haskell.Lib.Strings as Strings-import qualified Hydra.Rewriting as Rewriting-import qualified Hydra.Util as Util-import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)-import qualified Data.Scientific as Sci-import Data.Void---- | Decoder for hydra.coders.CaseConventions-caseConventions :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Coders.CaseConventions-caseConventions cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "constant" DecodeUtil.caseConvention fieldMap cx) (\field_constant -> Eithers.bind (ExtractCore.requireField "directory" DecodeUtil.caseConvention fieldMap cx) (\field_directory -> Eithers.bind (ExtractCore.requireField "enumValue" DecodeUtil.caseConvention fieldMap cx) (\field_enumValue -> Eithers.bind (ExtractCore.requireField "field" DecodeUtil.caseConvention fieldMap cx) (\field_field -> Eithers.bind (ExtractCore.requireField "file" DecodeUtil.caseConvention fieldMap cx) (\field_file -> Eithers.bind (ExtractCore.requireField "module" DecodeUtil.caseConvention fieldMap cx) (\field_module -> Eithers.bind (ExtractCore.requireField "term" DecodeUtil.caseConvention fieldMap cx) (\field_term -> Eithers.bind (ExtractCore.requireField "termVariable" DecodeUtil.caseConvention fieldMap cx) (\field_termVariable -> Eithers.bind (ExtractCore.requireField "type" DecodeUtil.caseConvention fieldMap cx) (\field_type -> Eithers.bind (ExtractCore.requireField "typeVariable" DecodeUtil.caseConvention fieldMap cx) (\field_typeVariable -> Right (Coders.CaseConventions {- Coders.caseConventionsConstant = field_constant,- Coders.caseConventionsDirectory = field_directory,- Coders.caseConventionsEnumValue = field_enumValue,- Coders.caseConventionsField = field_field,- Coders.caseConventionsFile = field_file,- Coders.caseConventionsModule = field_module,- Coders.caseConventionsTerm = field_term,- Coders.caseConventionsTermVariable = field_termVariable,- Coders.caseConventionsType = field_type,- Coders.caseConventionsTypeVariable = field_typeVariable}))))))))))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.coders.CaseConventions")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.coders.CoderDirection-coderDirection :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Coders.CoderDirection-coderDirection cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermInject v0 ->- let field = Core.injectionField v0- fname = Core.fieldName field- fterm = Core.fieldTerm field- variantMap =- Maps.fromList [- (Core.Name "encode", (\input -> Eithers.map (\t -> Coders.CoderDirectionEncode) (ExtractCore.decodeUnit cx input))),- (Core.Name "decode", (\input -> Eithers.map (\t -> Coders.CoderDirectionDecode) (ExtractCore.decodeUnit cx input)))]- in (Optionals.match (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [- "no such field ",- (Core.unName fname),- " in union"]))) (\f -> f fterm))- _ -> Left (Errors.DecodingError "expected union")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.coders.LanguageFeature-languageFeature :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Coders.LanguageFeature-languageFeature cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermInject v0 ->- let field = Core.injectionField v0- fname = Core.fieldName field- fterm = Core.fieldTerm field- variantMap =- Maps.fromList [- (- Core.Name "partialApplication",- (\input -> Eithers.map (\t -> Coders.LanguageFeaturePartialApplication) (ExtractCore.decodeUnit cx input))),- (- Core.Name "nestedCaseStatements",- (\input -> Eithers.map (\t -> Coders.LanguageFeatureNestedCaseStatements) (ExtractCore.decodeUnit cx input))),- (- Core.Name "nestedPolymorphicLetBindings",- (\input -> Eithers.map (\t -> Coders.LanguageFeatureNestedPolymorphicLetBindings) (ExtractCore.decodeUnit cx input)))]- in (Optionals.match (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [- "no such field ",- (Core.unName fname),- " in union"]))) (\f -> f fterm))- _ -> Left (Errors.DecodingError "expected union")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.coders.LanguageName-languageName :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Coders.LanguageName-languageName cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermWrap v0 -> Eithers.map (\b -> Coders.LanguageName b) ((\raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of- Core.TermLiteral v1 -> case v1 of- Core.LiteralString v2 -> Right v2- _ -> Left (Errors.DecodingError "expected string literal")- _ -> Left (Errors.DecodingError "expected literal")) (ExtractCore.stripWithDecodingError cx raw2)) (Core.wrappedTermBody v0))- _ -> Left (Errors.DecodingError "expected wrapped type")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.coders.TraversalOrder-traversalOrder :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Coders.TraversalOrder-traversalOrder cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermInject v0 ->- let field = Core.injectionField v0- fname = Core.fieldName field- fterm = Core.fieldTerm field- variantMap =- Maps.fromList [- (Core.Name "pre", (\input -> Eithers.map (\t -> Coders.TraversalOrderPre) (ExtractCore.decodeUnit cx input))),- (Core.Name "post", (\input -> Eithers.map (\t -> Coders.TraversalOrderPost) (ExtractCore.decodeUnit cx input)))]- in (Optionals.match (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [- "no such field ",- (Core.unName fname),- " in union"]))) (\f -> f fterm))- _ -> Left (Errors.DecodingError "expected union")) (ExtractCore.stripWithDecodingError cx raw)
@@ -1,628 +0,0 @@--- Note: this is an automatically generated file. Do not edit.---- | Term decoders for hydra.core--module Hydra.Decode.Core where--import qualified Hydra.Core as Core-import qualified Hydra.Errors as Errors-import qualified Hydra.Extract.Core as ExtractCore-import qualified Hydra.Graph as Graph-import qualified Hydra.Lexical as Lexical-import qualified Hydra.Overlay.Haskell.Lib.Eithers as Eithers-import qualified Hydra.Overlay.Haskell.Lib.Maps as Maps-import qualified Hydra.Overlay.Haskell.Lib.Optionals as Optionals-import qualified Hydra.Overlay.Haskell.Lib.Strings as Strings-import qualified Hydra.Rewriting as Rewriting-import qualified Hydra.Util as Util-import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)-import qualified Data.Scientific as Sci-import Data.Void---- | Decoder for hydra.core.AnnotatedTerm-annotatedTerm :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Core.AnnotatedTerm-annotatedTerm cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "body" term fieldMap cx) (\field_body -> Eithers.bind (ExtractCore.requireField "annotation" term fieldMap cx) (\field_annotation -> Right (Core.AnnotatedTerm {- Core.annotatedTermBody = field_body,- Core.annotatedTermAnnotation = field_annotation}))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.core.AnnotatedTerm")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.core.AnnotatedType-annotatedType :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Core.AnnotatedType-annotatedType cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "body" type_ fieldMap cx) (\field_body -> Eithers.bind (ExtractCore.requireField "annotation" term fieldMap cx) (\field_annotation -> Right (Core.AnnotatedType {- Core.annotatedTypeBody = field_body,- Core.annotatedTypeAnnotation = field_annotation}))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.core.AnnotatedType")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.core.Application-application :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Core.Application-application cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "function" term fieldMap cx) (\field_function -> Eithers.bind (ExtractCore.requireField "argument" term fieldMap cx) (\field_argument -> Right (Core.Application {- Core.applicationFunction = field_function,- Core.applicationArgument = field_argument}))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.core.Application")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.core.ApplicationType-applicationType :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Core.ApplicationType-applicationType cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "function" type_ fieldMap cx) (\field_function -> Eithers.bind (ExtractCore.requireField "argument" type_ fieldMap cx) (\field_argument -> Right (Core.ApplicationType {- Core.applicationTypeFunction = field_function,- Core.applicationTypeArgument = field_argument}))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.core.ApplicationType")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.core.Binding-binding :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Core.Binding-binding cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "name" name fieldMap cx) (\field_name -> Eithers.bind (ExtractCore.requireField "term" term fieldMap cx) (\field_term -> Eithers.bind (ExtractCore.requireField "typeScheme" (ExtractCore.decodeMaybe typeScheme) fieldMap cx) (\field_typeScheme -> Right (Core.Binding {- Core.bindingName = field_name,- Core.bindingTerm = field_term,- Core.bindingTypeScheme = field_typeScheme})))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.core.Binding")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.core.CaseAlternative-caseAlternative :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Core.CaseAlternative-caseAlternative cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "name" name fieldMap cx) (\field_name -> Eithers.bind (ExtractCore.requireField "handler" term fieldMap cx) (\field_handler -> Right (Core.CaseAlternative {- Core.caseAlternativeName = field_name,- Core.caseAlternativeHandler = field_handler}))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.core.CaseAlternative")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.core.CaseStatement-caseStatement :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Core.CaseStatement-caseStatement cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "typeName" name fieldMap cx) (\field_typeName -> Eithers.bind (ExtractCore.requireField "default" (ExtractCore.decodeMaybe term) fieldMap cx) (\field_default -> Eithers.bind (ExtractCore.requireField "cases" (ExtractCore.decodeList caseAlternative) fieldMap cx) (\field_cases -> Right (Core.CaseStatement {- Core.caseStatementTypeName = field_typeName,- Core.caseStatementDefault = field_default,- Core.caseStatementCases = field_cases})))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.core.CaseStatement")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.core.EitherType-eitherType :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Core.EitherType-eitherType cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "left" type_ fieldMap cx) (\field_left -> Eithers.bind (ExtractCore.requireField "right" type_ fieldMap cx) (\field_right -> Right (Core.EitherType {- Core.eitherTypeLeft = field_left,- Core.eitherTypeRight = field_right}))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.core.EitherType")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.core.Field-field :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Core.Field-field cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "name" name fieldMap cx) (\field_name -> Eithers.bind (ExtractCore.requireField "term" term fieldMap cx) (\field_term -> Right (Core.Field {- Core.fieldName = field_name,- Core.fieldTerm = field_term}))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.core.Field")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.core.FieldType-fieldType :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Core.FieldType-fieldType cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "name" name fieldMap cx) (\field_name -> Eithers.bind (ExtractCore.requireField "type" type_ fieldMap cx) (\field_type -> Right (Core.FieldType {- Core.fieldTypeName = field_name,- Core.fieldTypeType = field_type}))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.core.FieldType")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.core.FloatType-floatType :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Core.FloatType-floatType cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermInject v0 ->- let field = Core.injectionField v0- fname = Core.fieldName field- fterm = Core.fieldTerm field- variantMap =- Maps.fromList [- (Core.Name "float32", (\input -> Eithers.map (\t -> Core.FloatTypeFloat32) (ExtractCore.decodeUnit cx input))),- (Core.Name "float64", (\input -> Eithers.map (\t -> Core.FloatTypeFloat64) (ExtractCore.decodeUnit cx input)))]- in (Optionals.match (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [- "no such field ",- (Core.unName fname),- " in union"]))) (\f -> f fterm))- _ -> Left (Errors.DecodingError "expected union")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.core.FloatValue-floatValue :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Core.FloatValue-floatValue cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermInject v0 ->- let field = Core.injectionField v0- fname = Core.fieldName field- fterm = Core.fieldTerm field- variantMap =- Maps.fromList [- (- Core.Name "float32",- (\input -> Eithers.map (\t -> Core.FloatValueFloat32 t) (Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of- Core.TermLiteral v1 -> case v1 of- Core.LiteralFloat v2 -> case v2 of- Core.FloatValueFloat32 v3 -> Right v3- _ -> Left (Errors.DecodingError "expected float32 value")- _ -> Left (Errors.DecodingError "expected float32 literal")- _ -> Left (Errors.DecodingError "expected literal")) (ExtractCore.stripWithDecodingError cx input)))),- (- Core.Name "float64",- (\input -> Eithers.map (\t -> Core.FloatValueFloat64 t) (Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of- Core.TermLiteral v1 -> case v1 of- Core.LiteralFloat v2 -> case v2 of- Core.FloatValueFloat64 v3 -> Right v3- _ -> Left (Errors.DecodingError "expected float64 value")- _ -> Left (Errors.DecodingError "expected float64 literal")- _ -> Left (Errors.DecodingError "expected literal")) (ExtractCore.stripWithDecodingError cx input))))]- in (Optionals.match (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [- "no such field ",- (Core.unName fname),- " in union"]))) (\f -> f fterm))- _ -> Left (Errors.DecodingError "expected union")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.core.ForallType-forallType :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Core.ForallType-forallType cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "parameter" name fieldMap cx) (\field_parameter -> Eithers.bind (ExtractCore.requireField "body" type_ fieldMap cx) (\field_body -> Right (Core.ForallType {- Core.forallTypeParameter = field_parameter,- Core.forallTypeBody = field_body}))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.core.ForallType")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.core.FunctionType-functionType :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Core.FunctionType-functionType cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "domain" type_ fieldMap cx) (\field_domain -> Eithers.bind (ExtractCore.requireField "codomain" type_ fieldMap cx) (\field_codomain -> Right (Core.FunctionType {- Core.functionTypeDomain = field_domain,- Core.functionTypeCodomain = field_codomain}))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.core.FunctionType")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.core.Injection-injection :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Core.Injection-injection cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "typeName" name fieldMap cx) (\field_typeName -> Eithers.bind (ExtractCore.requireField "field" field fieldMap cx) (\field_field -> Right (Core.Injection {- Core.injectionTypeName = field_typeName,- Core.injectionField = field_field}))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.core.Injection")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.core.IntegerType-integerType :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Core.IntegerType-integerType cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermInject v0 ->- let field = Core.injectionField v0- fname = Core.fieldName field- fterm = Core.fieldTerm field- variantMap =- Maps.fromList [- (Core.Name "bigint", (\input -> Eithers.map (\t -> Core.IntegerTypeBigint) (ExtractCore.decodeUnit cx input))),- (Core.Name "int8", (\input -> Eithers.map (\t -> Core.IntegerTypeInt8) (ExtractCore.decodeUnit cx input))),- (Core.Name "int16", (\input -> Eithers.map (\t -> Core.IntegerTypeInt16) (ExtractCore.decodeUnit cx input))),- (Core.Name "int32", (\input -> Eithers.map (\t -> Core.IntegerTypeInt32) (ExtractCore.decodeUnit cx input))),- (Core.Name "int64", (\input -> Eithers.map (\t -> Core.IntegerTypeInt64) (ExtractCore.decodeUnit cx input))),- (Core.Name "uint8", (\input -> Eithers.map (\t -> Core.IntegerTypeUint8) (ExtractCore.decodeUnit cx input))),- (Core.Name "uint16", (\input -> Eithers.map (\t -> Core.IntegerTypeUint16) (ExtractCore.decodeUnit cx input))),- (Core.Name "uint32", (\input -> Eithers.map (\t -> Core.IntegerTypeUint32) (ExtractCore.decodeUnit cx input))),- (Core.Name "uint64", (\input -> Eithers.map (\t -> Core.IntegerTypeUint64) (ExtractCore.decodeUnit cx input)))]- in (Optionals.match (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [- "no such field ",- (Core.unName fname),- " in union"]))) (\f -> f fterm))- _ -> Left (Errors.DecodingError "expected union")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.core.IntegerValue-integerValue :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Core.IntegerValue-integerValue cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermInject v0 ->- let field = Core.injectionField v0- fname = Core.fieldName field- fterm = Core.fieldTerm field- variantMap =- Maps.fromList [- (- Core.Name "bigint",- (\input -> Eithers.map (\t -> Core.IntegerValueBigint t) (Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of- Core.TermLiteral v1 -> case v1 of- Core.LiteralInteger v2 -> case v2 of- Core.IntegerValueBigint v3 -> Right v3- _ -> Left (Errors.DecodingError "expected bigint value")- _ -> Left (Errors.DecodingError "expected bigint literal")- _ -> Left (Errors.DecodingError "expected literal")) (ExtractCore.stripWithDecodingError cx input)))),- (- Core.Name "int8",- (\input -> Eithers.map (\t -> Core.IntegerValueInt8 t) (Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of- Core.TermLiteral v1 -> case v1 of- Core.LiteralInteger v2 -> case v2 of- Core.IntegerValueInt8 v3 -> Right v3- _ -> Left (Errors.DecodingError "expected int8 value")- _ -> Left (Errors.DecodingError "expected int8 literal")- _ -> Left (Errors.DecodingError "expected literal")) (ExtractCore.stripWithDecodingError cx input)))),- (- Core.Name "int16",- (\input -> Eithers.map (\t -> Core.IntegerValueInt16 t) (Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of- Core.TermLiteral v1 -> case v1 of- Core.LiteralInteger v2 -> case v2 of- Core.IntegerValueInt16 v3 -> Right v3- _ -> Left (Errors.DecodingError "expected int16 value")- _ -> Left (Errors.DecodingError "expected int16 literal")- _ -> Left (Errors.DecodingError "expected literal")) (ExtractCore.stripWithDecodingError cx input)))),- (- Core.Name "int32",- (\input -> Eithers.map (\t -> Core.IntegerValueInt32 t) (Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of- Core.TermLiteral v1 -> case v1 of- Core.LiteralInteger v2 -> case v2 of- Core.IntegerValueInt32 v3 -> Right v3- _ -> Left (Errors.DecodingError "expected int32 value")- _ -> Left (Errors.DecodingError "expected int32 literal")- _ -> Left (Errors.DecodingError "expected literal")) (ExtractCore.stripWithDecodingError cx input)))),- (- Core.Name "int64",- (\input -> Eithers.map (\t -> Core.IntegerValueInt64 t) (Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of- Core.TermLiteral v1 -> case v1 of- Core.LiteralInteger v2 -> case v2 of- Core.IntegerValueInt64 v3 -> Right v3- _ -> Left (Errors.DecodingError "expected int64 value")- _ -> Left (Errors.DecodingError "expected int64 literal")- _ -> Left (Errors.DecodingError "expected literal")) (ExtractCore.stripWithDecodingError cx input)))),- (- Core.Name "uint8",- (\input -> Eithers.map (\t -> Core.IntegerValueUint8 t) (Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of- Core.TermLiteral v1 -> case v1 of- Core.LiteralInteger v2 -> case v2 of- Core.IntegerValueUint8 v3 -> Right v3- _ -> Left (Errors.DecodingError "expected uint8 value")- _ -> Left (Errors.DecodingError "expected uint8 literal")- _ -> Left (Errors.DecodingError "expected literal")) (ExtractCore.stripWithDecodingError cx input)))),- (- Core.Name "uint16",- (\input -> Eithers.map (\t -> Core.IntegerValueUint16 t) (Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of- Core.TermLiteral v1 -> case v1 of- Core.LiteralInteger v2 -> case v2 of- Core.IntegerValueUint16 v3 -> Right v3- _ -> Left (Errors.DecodingError "expected uint16 value")- _ -> Left (Errors.DecodingError "expected uint16 literal")- _ -> Left (Errors.DecodingError "expected literal")) (ExtractCore.stripWithDecodingError cx input)))),- (- Core.Name "uint32",- (\input -> Eithers.map (\t -> Core.IntegerValueUint32 t) (Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of- Core.TermLiteral v1 -> case v1 of- Core.LiteralInteger v2 -> case v2 of- Core.IntegerValueUint32 v3 -> Right v3- _ -> Left (Errors.DecodingError "expected uint32 value")- _ -> Left (Errors.DecodingError "expected uint32 literal")- _ -> Left (Errors.DecodingError "expected literal")) (ExtractCore.stripWithDecodingError cx input)))),- (- Core.Name "uint64",- (\input -> Eithers.map (\t -> Core.IntegerValueUint64 t) (Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of- Core.TermLiteral v1 -> case v1 of- Core.LiteralInteger v2 -> case v2 of- Core.IntegerValueUint64 v3 -> Right v3- _ -> Left (Errors.DecodingError "expected uint64 value")- _ -> Left (Errors.DecodingError "expected uint64 literal")- _ -> Left (Errors.DecodingError "expected literal")) (ExtractCore.stripWithDecodingError cx input))))]- in (Optionals.match (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [- "no such field ",- (Core.unName fname),- " in union"]))) (\f -> f fterm))- _ -> Left (Errors.DecodingError "expected union")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.core.Lambda-lambda :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Core.Lambda-lambda cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "parameter" name fieldMap cx) (\field_parameter -> Eithers.bind (ExtractCore.requireField "domain" (ExtractCore.decodeMaybe type_) fieldMap cx) (\field_domain -> Eithers.bind (ExtractCore.requireField "body" term fieldMap cx) (\field_body -> Right (Core.Lambda {- Core.lambdaParameter = field_parameter,- Core.lambdaDomain = field_domain,- Core.lambdaBody = field_body})))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.core.Lambda")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.core.Let-let_ :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Core.Let-let_ cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "bindings" (ExtractCore.decodeList binding) fieldMap cx) (\field_bindings -> Eithers.bind (ExtractCore.requireField "body" term fieldMap cx) (\field_body -> Right (Core.Let {- Core.letBindings = field_bindings,- Core.letBody = field_body}))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.core.Let")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.core.Literal-literal :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Core.Literal-literal cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermInject v0 ->- let field = Core.injectionField v0- fname = Core.fieldName field- fterm = Core.fieldTerm field- variantMap =- Maps.fromList [- (- Core.Name "binary",- (\input -> Eithers.map (\t -> Core.LiteralBinary t) (Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of- Core.TermLiteral v1 -> case v1 of- Core.LiteralBinary v2 -> Right v2- _ -> Left (Errors.DecodingError "expected binary literal")- _ -> Left (Errors.DecodingError "expected literal")) (ExtractCore.stripWithDecodingError cx input)))),- (- Core.Name "boolean",- (\input -> Eithers.map (\t -> Core.LiteralBoolean t) (Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of- Core.TermLiteral v1 -> case v1 of- Core.LiteralBoolean v2 -> Right v2- _ -> Left (Errors.DecodingError "expected boolean literal")- _ -> Left (Errors.DecodingError "expected literal")) (ExtractCore.stripWithDecodingError cx input)))),- (- Core.Name "decimal",- (\input -> Eithers.map (\t -> Core.LiteralDecimal t) (Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of- Core.TermLiteral v1 -> case v1 of- Core.LiteralDecimal v2 -> Right v2- _ -> Left (Errors.DecodingError "expected decimal literal")- _ -> Left (Errors.DecodingError "expected literal")) (ExtractCore.stripWithDecodingError cx input)))),- (Core.Name "float", (\input -> Eithers.map (\t -> Core.LiteralFloat t) (floatValue cx input))),- (Core.Name "integer", (\input -> Eithers.map (\t -> Core.LiteralInteger t) (integerValue cx input))),- (- Core.Name "string",- (\input -> Eithers.map (\t -> Core.LiteralString t) (Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of- Core.TermLiteral v1 -> case v1 of- Core.LiteralString v2 -> Right v2- _ -> Left (Errors.DecodingError "expected string literal")- _ -> Left (Errors.DecodingError "expected literal")) (ExtractCore.stripWithDecodingError cx input))))]- in (Optionals.match (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [- "no such field ",- (Core.unName fname),- " in union"]))) (\f -> f fterm))- _ -> Left (Errors.DecodingError "expected union")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.core.LiteralType-literalType :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Core.LiteralType-literalType cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermInject v0 ->- let field = Core.injectionField v0- fname = Core.fieldName field- fterm = Core.fieldTerm field- variantMap =- Maps.fromList [- (Core.Name "binary", (\input -> Eithers.map (\t -> Core.LiteralTypeBinary) (ExtractCore.decodeUnit cx input))),- (Core.Name "boolean", (\input -> Eithers.map (\t -> Core.LiteralTypeBoolean) (ExtractCore.decodeUnit cx input))),- (Core.Name "decimal", (\input -> Eithers.map (\t -> Core.LiteralTypeDecimal) (ExtractCore.decodeUnit cx input))),- (Core.Name "float", (\input -> Eithers.map (\t -> Core.LiteralTypeFloat t) (floatType cx input))),- (Core.Name "integer", (\input -> Eithers.map (\t -> Core.LiteralTypeInteger t) (integerType cx input))),- (Core.Name "string", (\input -> Eithers.map (\t -> Core.LiteralTypeString) (ExtractCore.decodeUnit cx input)))]- in (Optionals.match (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [- "no such field ",- (Core.unName fname),- " in union"]))) (\f -> f fterm))- _ -> Left (Errors.DecodingError "expected union")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.core.MapType-mapType :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Core.MapType-mapType cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "keys" type_ fieldMap cx) (\field_keys -> Eithers.bind (ExtractCore.requireField "values" type_ fieldMap cx) (\field_values -> Right (Core.MapType {- Core.mapTypeKeys = field_keys,- Core.mapTypeValues = field_values}))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.core.MapType")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.core.Name-name :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Core.Name-name cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermWrap v0 -> Eithers.map (\b -> Core.Name b) ((\raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of- Core.TermLiteral v1 -> case v1 of- Core.LiteralString v2 -> Right v2- _ -> Left (Errors.DecodingError "expected string literal")- _ -> Left (Errors.DecodingError "expected literal")) (ExtractCore.stripWithDecodingError cx raw2)) (Core.wrappedTermBody v0))- _ -> Left (Errors.DecodingError "expected wrapped type")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.core.PairType-pairType :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Core.PairType-pairType cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "first" type_ fieldMap cx) (\field_first -> Eithers.bind (ExtractCore.requireField "second" type_ fieldMap cx) (\field_second -> Right (Core.PairType {- Core.pairTypeFirst = field_first,- Core.pairTypeSecond = field_second}))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.core.PairType")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.core.Projection-projection :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Core.Projection-projection cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "typeName" name fieldMap cx) (\field_typeName -> Eithers.bind (ExtractCore.requireField "fieldName" name fieldMap cx) (\field_fieldName -> Right (Core.Projection {- Core.projectionTypeName = field_typeName,- Core.projectionFieldName = field_fieldName}))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.core.Projection")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.core.Record-record :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Core.Record-record cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "typeName" name fieldMap cx) (\field_typeName -> Eithers.bind (ExtractCore.requireField "fields" (ExtractCore.decodeList field) fieldMap cx) (\field_fields -> Right (Core.Record {- Core.recordTypeName = field_typeName,- Core.recordFields = field_fields}))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.core.Record")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.core.Term-term :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Core.Term-term cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermInject v0 ->- let field = Core.injectionField v0- fname = Core.fieldName field- fterm = Core.fieldTerm field- variantMap =- Maps.fromList [- (Core.Name "annotated", (\input -> Eithers.map (\t -> Core.TermAnnotated t) (annotatedTerm cx input))),- (Core.Name "application", (\input -> Eithers.map (\t -> Core.TermApplication t) (application cx input))),- (Core.Name "cases", (\input -> Eithers.map (\t -> Core.TermCases t) (caseStatement cx input))),- (Core.Name "either", (\input -> Eithers.map (\t -> Core.TermEither t) (ExtractCore.decodeEither term term cx input))),- (Core.Name "inject", (\input -> Eithers.map (\t -> Core.TermInject t) (injection cx input))),- (Core.Name "lambda", (\input -> Eithers.map (\t -> Core.TermLambda t) (lambda cx input))),- (Core.Name "let", (\input -> Eithers.map (\t -> Core.TermLet t) (let_ cx input))),- (Core.Name "list", (\input -> Eithers.map (\t -> Core.TermList t) (ExtractCore.decodeList term cx input))),- (Core.Name "literal", (\input -> Eithers.map (\t -> Core.TermLiteral t) (literal cx input))),- (Core.Name "map", (\input -> Eithers.map (\t -> Core.TermMap t) (ExtractCore.decodeMap term term cx input))),- (Core.Name "optional", (\input -> Eithers.map (\t -> Core.TermOptional t) (ExtractCore.decodeMaybe term cx input))),- (Core.Name "pair", (\input -> Eithers.map (\t -> Core.TermPair t) (ExtractCore.decodePair term term cx input))),- (Core.Name "project", (\input -> Eithers.map (\t -> Core.TermProject t) (projection cx input))),- (Core.Name "record", (\input -> Eithers.map (\t -> Core.TermRecord t) (record cx input))),- (Core.Name "set", (\input -> Eithers.map (\t -> Core.TermSet t) (ExtractCore.decodeSet term cx input))),- (Core.Name "typeApplication", (\input -> Eithers.map (\t -> Core.TermTypeApplication t) (typeApplicationTerm cx input))),- (Core.Name "typeLambda", (\input -> Eithers.map (\t -> Core.TermTypeLambda t) (typeLambda cx input))),- (Core.Name "unit", (\input -> Eithers.map (\t -> Core.TermUnit) (ExtractCore.decodeUnit cx input))),- (Core.Name "unwrap", (\input -> Eithers.map (\t -> Core.TermUnwrap t) (name cx input))),- (Core.Name "variable", (\input -> Eithers.map (\t -> Core.TermVariable t) (name cx input))),- (Core.Name "wrap", (\input -> Eithers.map (\t -> Core.TermWrap t) (wrappedTerm cx input)))]- in (Optionals.match (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [- "no such field ",- (Core.unName fname),- " in union"]))) (\f -> f fterm))- _ -> Left (Errors.DecodingError "expected union")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.core.Type-type_ :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Core.Type-type_ cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermInject v0 ->- let field = Core.injectionField v0- fname = Core.fieldName field- fterm = Core.fieldTerm field- variantMap =- Maps.fromList [- (Core.Name "annotated", (\input -> Eithers.map (\t -> Core.TypeAnnotated t) (annotatedType cx input))),- (Core.Name "application", (\input -> Eithers.map (\t -> Core.TypeApplication t) (applicationType cx input))),- (Core.Name "effect", (\input -> Eithers.map (\t -> Core.TypeEffect t) (type_ cx input))),- (Core.Name "either", (\input -> Eithers.map (\t -> Core.TypeEither t) (eitherType cx input))),- (Core.Name "forall", (\input -> Eithers.map (\t -> Core.TypeForall t) (forallType cx input))),- (Core.Name "function", (\input -> Eithers.map (\t -> Core.TypeFunction t) (functionType cx input))),- (Core.Name "list", (\input -> Eithers.map (\t -> Core.TypeList t) (type_ cx input))),- (Core.Name "literal", (\input -> Eithers.map (\t -> Core.TypeLiteral t) (literalType cx input))),- (Core.Name "map", (\input -> Eithers.map (\t -> Core.TypeMap t) (mapType cx input))),- (Core.Name "optional", (\input -> Eithers.map (\t -> Core.TypeOptional t) (type_ cx input))),- (Core.Name "pair", (\input -> Eithers.map (\t -> Core.TypePair t) (pairType cx input))),- (Core.Name "record", (\input -> Eithers.map (\t -> Core.TypeRecord t) (ExtractCore.decodeList fieldType cx input))),- (Core.Name "set", (\input -> Eithers.map (\t -> Core.TypeSet t) (type_ cx input))),- (Core.Name "union", (\input -> Eithers.map (\t -> Core.TypeUnion t) (ExtractCore.decodeList fieldType cx input))),- (Core.Name "unit", (\input -> Eithers.map (\t -> Core.TypeUnit) (ExtractCore.decodeUnit cx input))),- (Core.Name "variable", (\input -> Eithers.map (\t -> Core.TypeVariable t) (name cx input))),- (Core.Name "void", (\input -> Eithers.map (\t -> Core.TypeVoid) (ExtractCore.decodeUnit cx input))),- (Core.Name "wrap", (\input -> Eithers.map (\t -> Core.TypeWrap t) (type_ cx input)))]- in (Optionals.match (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [- "no such field ",- (Core.unName fname),- " in union"]))) (\f -> f fterm))- _ -> Left (Errors.DecodingError "expected union")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.core.TypeApplicationTerm-typeApplicationTerm :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Core.TypeApplicationTerm-typeApplicationTerm cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "body" term fieldMap cx) (\field_body -> Eithers.bind (ExtractCore.requireField "type" type_ fieldMap cx) (\field_type -> Right (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = field_body,- Core.typeApplicationTermType = field_type}))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.core.TypeApplicationTerm")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.core.TypeClassConstraint-typeClassConstraint :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Core.TypeClassConstraint-typeClassConstraint cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermInject v0 ->- let field = Core.injectionField v0- fname = Core.fieldName field- fterm = Core.fieldTerm field- variantMap =- Maps.fromList [- (Core.Name "simple", (\input -> Eithers.map (\t -> Core.TypeClassConstraintSimple t) (name cx input)))]- in (Optionals.match (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [- "no such field ",- (Core.unName fname),- " in union"]))) (\f -> f fterm))- _ -> Left (Errors.DecodingError "expected union")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.core.TypeLambda-typeLambda :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Core.TypeLambda-typeLambda cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "parameter" name fieldMap cx) (\field_parameter -> Eithers.bind (ExtractCore.requireField "body" term fieldMap cx) (\field_body -> Right (Core.TypeLambda {- Core.typeLambdaParameter = field_parameter,- Core.typeLambdaBody = field_body}))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.core.TypeLambda")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.core.TypeScheme-typeScheme :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Core.TypeScheme-typeScheme cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "variables" (ExtractCore.decodeList name) fieldMap cx) (\field_variables -> Eithers.bind (ExtractCore.requireField "body" type_ fieldMap cx) (\field_body -> Eithers.bind (ExtractCore.requireField "constraints" (ExtractCore.decodeMap name typeVariableConstraints) fieldMap cx) (\field_constraints -> Right (Core.TypeScheme {- Core.typeSchemeVariables = field_variables,- Core.typeSchemeBody = field_body,- Core.typeSchemeConstraints = field_constraints})))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.core.TypeScheme")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.core.TypeVariableConstraints-typeVariableConstraints :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Core.TypeVariableConstraints-typeVariableConstraints cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "classes" (ExtractCore.decodeSet typeClassConstraint) fieldMap cx) (\field_classes -> Right (Core.TypeVariableConstraints {- Core.typeVariableConstraintsClasses = field_classes})))- _ -> Left (Errors.DecodingError "expected a record of type hydra.core.TypeVariableConstraints")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.core.WrappedTerm-wrappedTerm :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Core.WrappedTerm-wrappedTerm cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "typeName" name fieldMap cx) (\field_typeName -> Eithers.bind (ExtractCore.requireField "body" term fieldMap cx) (\field_body -> Right (Core.WrappedTerm {- Core.wrappedTermTypeName = field_typeName,- Core.wrappedTermBody = field_body}))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.core.WrappedTerm")) (ExtractCore.stripWithDecodingError cx raw)
@@ -1,46 +0,0 @@--- Note: this is an automatically generated file. Do not edit.---- | Term decoders for hydra.docs--module Hydra.Decode.Docs where--import qualified Hydra.Core as Core-import qualified Hydra.Decode.Packaging as Packaging-import qualified Hydra.Docs as Docs-import qualified Hydra.Errors as Errors-import qualified Hydra.Extract.Core as ExtractCore-import qualified Hydra.Graph as Graph-import qualified Hydra.Lexical as Lexical-import qualified Hydra.Overlay.Haskell.Lib.Eithers as Eithers-import qualified Hydra.Overlay.Haskell.Lib.Maps as Maps-import qualified Hydra.Overlay.Haskell.Lib.Optionals as Optionals-import qualified Hydra.Overlay.Haskell.Lib.Strings as Strings-import qualified Hydra.Rewriting as Rewriting-import qualified Hydra.Util as Util-import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)-import qualified Data.Scientific as Sci-import Data.Void---- | Decoder for hydra.docs.DocSegment-docSegment :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Docs.DocSegment-docSegment cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermInject v0 ->- let field = Core.injectionField v0- fname = Core.fieldName field- fterm = Core.fieldTerm field- variantMap =- Maps.fromList [- (Core.Name "ref", (\input -> Eithers.map (\t -> Docs.DocSegmentRef t) (Packaging.entityReference cx input))),- (- Core.Name "text",- (\input -> Eithers.map (\t -> Docs.DocSegmentText t) (Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of- Core.TermLiteral v1 -> case v1 of- Core.LiteralString v2 -> Right v2- _ -> Left (Errors.DecodingError "expected string literal")- _ -> Left (Errors.DecodingError "expected literal")) (ExtractCore.stripWithDecodingError cx input))))]- in (Optionals.match (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [- "no such field ",- (Core.unName fname),- " in union"]))) (\f -> f fterm))- _ -> Left (Errors.DecodingError "expected union")) (ExtractCore.stripWithDecodingError cx raw)
@@ -1,238 +0,0 @@--- Note: this is an automatically generated file. Do not edit.---- | Term decoders for hydra.error.checking--module Hydra.Decode.Error.Checking where--import qualified Hydra.Core as Core-import qualified Hydra.Decode.Core as DecodeCore-import qualified Hydra.Decode.Paths as Paths-import qualified Hydra.Decode.Typing as Typing-import qualified Hydra.Decode.Variants as Variants-import qualified Hydra.Error.Checking as Checking-import qualified Hydra.Errors as Errors-import qualified Hydra.Extract.Core as ExtractCore-import qualified Hydra.Graph as Graph-import qualified Hydra.Lexical as Lexical-import qualified Hydra.Overlay.Haskell.Lib.Eithers as Eithers-import qualified Hydra.Overlay.Haskell.Lib.Maps as Maps-import qualified Hydra.Overlay.Haskell.Lib.Optionals as Optionals-import qualified Hydra.Overlay.Haskell.Lib.Strings as Strings-import qualified Hydra.Rewriting as Rewriting-import qualified Hydra.Util as Util-import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)-import qualified Data.Scientific as Sci-import Data.Void---- | Decoder for hydra.error.checking.CheckingError-checkingError :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Checking.CheckingError-checkingError cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermInject v0 ->- let field = Core.injectionField v0- fname = Core.fieldName field- fterm = Core.fieldTerm field- variantMap =- Maps.fromList [- (- Core.Name "incorrectUnification",- (\input -> Eithers.map (\t -> Checking.CheckingErrorIncorrectUnification t) (incorrectUnificationError cx input))),- (- Core.Name "notAForallType",- (\input -> Eithers.map (\t -> Checking.CheckingErrorNotAForallType t) (notAForallTypeError cx input))),- (- Core.Name "notAFunctionType",- (\input -> Eithers.map (\t -> Checking.CheckingErrorNotAFunctionType t) (notAFunctionTypeError cx input))),- (Core.Name "other", (\input -> Eithers.map (\t -> Checking.CheckingErrorOther t) (otherCheckingError cx input))),- (- Core.Name "typeArityMismatch",- (\input -> Eithers.map (\t -> Checking.CheckingErrorTypeArityMismatch t) (typeArityMismatchError cx input))),- (- Core.Name "typeMismatch",- (\input -> Eithers.map (\t -> Checking.CheckingErrorTypeMismatch t) (typeMismatchError cx input))),- (- Core.Name "unboundTypeVariables",- (\input -> Eithers.map (\t -> Checking.CheckingErrorUnboundTypeVariables t) (unboundTypeVariablesError cx input))),- (- Core.Name "undefinedTermVariable",- (\input -> Eithers.map (\t -> Checking.CheckingErrorUndefinedTermVariable t) (undefinedTermVariableCheckingError cx input))),- (- Core.Name "unequalTypes",- (\input -> Eithers.map (\t -> Checking.CheckingErrorUnequalTypes t) (unequalTypesError cx input))),- (- Core.Name "unsupportedTermVariant",- (\input -> Eithers.map (\t -> Checking.CheckingErrorUnsupportedTermVariant t) (unsupportedTermVariantError cx input))),- (- Core.Name "untypedLambda",- (\input -> Eithers.map (\t -> Checking.CheckingErrorUntypedLambda t) (untypedLambdaError cx input))),- (- Core.Name "untypedLetBinding",- (\input -> Eithers.map (\t -> Checking.CheckingErrorUntypedLetBinding t) (untypedLetBindingError cx input))),- (- Core.Name "untypedTermVariable",- (\input -> Eithers.map (\t -> Checking.CheckingErrorUntypedTermVariable t) (untypedTermVariableCheckingError cx input)))]- in (Optionals.match (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [- "no such field ",- (Core.unName fname),- " in union"]))) (\f -> f fterm))- _ -> Left (Errors.DecodingError "expected union")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.error.checking.IncorrectUnificationError-incorrectUnificationError :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Checking.IncorrectUnificationError-incorrectUnificationError cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "substitution" Typing.typeSubst fieldMap cx) (\field_substitution -> Right (Checking.IncorrectUnificationError {- Checking.incorrectUnificationErrorSubstitution = field_substitution})))- _ -> Left (Errors.DecodingError "expected a record of type hydra.error.checking.IncorrectUnificationError")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.error.checking.NotAForallTypeError-notAForallTypeError :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Checking.NotAForallTypeError-notAForallTypeError cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "type" DecodeCore.type_ fieldMap cx) (\field_type -> Eithers.bind (ExtractCore.requireField "typeArguments" (ExtractCore.decodeList DecodeCore.type_) fieldMap cx) (\field_typeArguments -> Right (Checking.NotAForallTypeError {- Checking.notAForallTypeErrorType = field_type,- Checking.notAForallTypeErrorTypeArguments = field_typeArguments}))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.error.checking.NotAForallTypeError")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.error.checking.NotAFunctionTypeError-notAFunctionTypeError :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Checking.NotAFunctionTypeError-notAFunctionTypeError cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "type" DecodeCore.type_ fieldMap cx) (\field_type -> Right (Checking.NotAFunctionTypeError {- Checking.notAFunctionTypeErrorType = field_type})))- _ -> Left (Errors.DecodingError "expected a record of type hydra.error.checking.NotAFunctionTypeError")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.error.checking.OtherCheckingError-otherCheckingError :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Checking.OtherCheckingError-otherCheckingError cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "path" Paths.subtermPath fieldMap cx) (\field_path -> Eithers.bind (ExtractCore.requireField "message" (\cx2 -> \raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of- Core.TermLiteral v1 -> case v1 of- Core.LiteralString v2 -> Right v2- _ -> Left (Errors.DecodingError "expected string literal")- _ -> Left (Errors.DecodingError "expected literal")) (ExtractCore.stripWithDecodingError cx2 raw2)) fieldMap cx) (\field_message -> Right (Checking.OtherCheckingError {- Checking.otherCheckingErrorPath = field_path,- Checking.otherCheckingErrorMessage = field_message}))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.error.checking.OtherCheckingError")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.error.checking.TypeArityMismatchError-typeArityMismatchError :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Checking.TypeArityMismatchError-typeArityMismatchError cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "type" DecodeCore.type_ fieldMap cx) (\field_type -> Eithers.bind (ExtractCore.requireField "expectedArity" (\cx2 -> \raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of- Core.TermLiteral v1 -> case v1 of- Core.LiteralInteger v2 -> case v2 of- Core.IntegerValueInt32 v3 -> Right v3- _ -> Left (Errors.DecodingError "expected int32 value")- _ -> Left (Errors.DecodingError "expected int32 literal")- _ -> Left (Errors.DecodingError "expected literal")) (ExtractCore.stripWithDecodingError cx2 raw2)) fieldMap cx) (\field_expectedArity -> Eithers.bind (ExtractCore.requireField "actualArity" (\cx2 -> \raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of- Core.TermLiteral v1 -> case v1 of- Core.LiteralInteger v2 -> case v2 of- Core.IntegerValueInt32 v3 -> Right v3- _ -> Left (Errors.DecodingError "expected int32 value")- _ -> Left (Errors.DecodingError "expected int32 literal")- _ -> Left (Errors.DecodingError "expected literal")) (ExtractCore.stripWithDecodingError cx2 raw2)) fieldMap cx) (\field_actualArity -> Eithers.bind (ExtractCore.requireField "typeArguments" (ExtractCore.decodeList DecodeCore.type_) fieldMap cx) (\field_typeArguments -> Right (Checking.TypeArityMismatchError {- Checking.typeArityMismatchErrorType = field_type,- Checking.typeArityMismatchErrorExpectedArity = field_expectedArity,- Checking.typeArityMismatchErrorActualArity = field_actualArity,- Checking.typeArityMismatchErrorTypeArguments = field_typeArguments}))))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.error.checking.TypeArityMismatchError")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.error.checking.TypeMismatchError-typeMismatchError :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Checking.TypeMismatchError-typeMismatchError cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "expectedType" DecodeCore.type_ fieldMap cx) (\field_expectedType -> Eithers.bind (ExtractCore.requireField "actualType" DecodeCore.type_ fieldMap cx) (\field_actualType -> Right (Checking.TypeMismatchError {- Checking.typeMismatchErrorExpectedType = field_expectedType,- Checking.typeMismatchErrorActualType = field_actualType}))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.error.checking.TypeMismatchError")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.error.checking.UnboundTypeVariablesError-unboundTypeVariablesError :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Checking.UnboundTypeVariablesError-unboundTypeVariablesError cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "variables" (ExtractCore.decodeSet DecodeCore.name) fieldMap cx) (\field_variables -> Eithers.bind (ExtractCore.requireField "type" DecodeCore.type_ fieldMap cx) (\field_type -> Right (Checking.UnboundTypeVariablesError {- Checking.unboundTypeVariablesErrorVariables = field_variables,- Checking.unboundTypeVariablesErrorType = field_type}))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.error.checking.UnboundTypeVariablesError")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.error.checking.UndefinedTermVariableCheckingError-undefinedTermVariableCheckingError :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Checking.UndefinedTermVariableCheckingError-undefinedTermVariableCheckingError cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "path" Paths.subtermPath fieldMap cx) (\field_path -> Eithers.bind (ExtractCore.requireField "name" DecodeCore.name fieldMap cx) (\field_name -> Right (Checking.UndefinedTermVariableCheckingError {- Checking.undefinedTermVariableCheckingErrorPath = field_path,- Checking.undefinedTermVariableCheckingErrorName = field_name}))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.error.checking.UndefinedTermVariableCheckingError")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.error.checking.UnequalTypesError-unequalTypesError :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Checking.UnequalTypesError-unequalTypesError cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "types" (ExtractCore.decodeList DecodeCore.type_) fieldMap cx) (\field_types -> Eithers.bind (ExtractCore.requireField "description" (\cx2 -> \raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of- Core.TermLiteral v1 -> case v1 of- Core.LiteralString v2 -> Right v2- _ -> Left (Errors.DecodingError "expected string literal")- _ -> Left (Errors.DecodingError "expected literal")) (ExtractCore.stripWithDecodingError cx2 raw2)) fieldMap cx) (\field_description -> Right (Checking.UnequalTypesError {- Checking.unequalTypesErrorTypes = field_types,- Checking.unequalTypesErrorDescription = field_description}))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.error.checking.UnequalTypesError")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.error.checking.UnsupportedTermVariantError-unsupportedTermVariantError :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Checking.UnsupportedTermVariantError-unsupportedTermVariantError cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "termVariant" Variants.termVariant fieldMap cx) (\field_termVariant -> Right (Checking.UnsupportedTermVariantError {- Checking.unsupportedTermVariantErrorTermVariant = field_termVariant})))- _ -> Left (Errors.DecodingError "expected a record of type hydra.error.checking.UnsupportedTermVariantError")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.error.checking.UntypedLambdaError-untypedLambdaError :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Checking.UntypedLambdaError-untypedLambdaError cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Right (Checking.UntypedLambdaError {- }))- _ -> Left (Errors.DecodingError "expected a record of type hydra.error.checking.UntypedLambdaError")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.error.checking.UntypedLetBindingError-untypedLetBindingError :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Checking.UntypedLetBindingError-untypedLetBindingError cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "binding" DecodeCore.binding fieldMap cx) (\field_binding -> Right (Checking.UntypedLetBindingError {- Checking.untypedLetBindingErrorBinding = field_binding})))- _ -> Left (Errors.DecodingError "expected a record of type hydra.error.checking.UntypedLetBindingError")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.error.checking.UntypedTermVariableCheckingError-untypedTermVariableCheckingError :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Checking.UntypedTermVariableCheckingError-untypedTermVariableCheckingError cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "path" Paths.subtermPath fieldMap cx) (\field_path -> Eithers.bind (ExtractCore.requireField "name" DecodeCore.name fieldMap cx) (\field_name -> Right (Checking.UntypedTermVariableCheckingError {- Checking.untypedTermVariableCheckingErrorPath = field_path,- Checking.untypedTermVariableCheckingErrorName = field_name}))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.error.checking.UntypedTermVariableCheckingError")) (ExtractCore.stripWithDecodingError cx raw)
@@ -1,737 +0,0 @@--- Note: this is an automatically generated file. Do not edit.---- | Term decoders for hydra.error.core--module Hydra.Decode.Error.Core where--import qualified Hydra.Core as Core-import qualified Hydra.Decode.Core as DecodeCore-import qualified Hydra.Decode.Paths as Paths-import qualified Hydra.Decode.Variants as Variants-import qualified Hydra.Error.Core as ErrorCore-import qualified Hydra.Errors as Errors-import qualified Hydra.Extract.Core as ExtractCore-import qualified Hydra.Graph as Graph-import qualified Hydra.Lexical as Lexical-import qualified Hydra.Overlay.Haskell.Lib.Eithers as Eithers-import qualified Hydra.Overlay.Haskell.Lib.Maps as Maps-import qualified Hydra.Overlay.Haskell.Lib.Optionals as Optionals-import qualified Hydra.Overlay.Haskell.Lib.Strings as Strings-import qualified Hydra.Rewriting as Rewriting-import qualified Hydra.Util as Util-import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)-import qualified Data.Scientific as Sci-import Data.Void---- | Decoder for hydra.error.core.ConstantConditionError-constantConditionError :: Graph.Graph -> Core.Term -> Either Errors.DecodingError ErrorCore.ConstantConditionError-constantConditionError cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "location" Paths.subtermPath fieldMap cx) (\field_location -> Eithers.bind (ExtractCore.requireField "value" (\cx2 -> \raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of- Core.TermLiteral v1 -> case v1 of- Core.LiteralBoolean v2 -> Right v2- _ -> Left (Errors.DecodingError "expected boolean literal")- _ -> Left (Errors.DecodingError "expected literal")) (ExtractCore.stripWithDecodingError cx2 raw2)) fieldMap cx) (\field_value -> Right (ErrorCore.ConstantConditionError {- ErrorCore.constantConditionErrorLocation = field_location,- ErrorCore.constantConditionErrorValue = field_value}))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.error.core.ConstantConditionError")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.error.core.DuplicateBindingError-duplicateBindingError :: Graph.Graph -> Core.Term -> Either Errors.DecodingError ErrorCore.DuplicateBindingError-duplicateBindingError cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "location" Paths.subtermPath fieldMap cx) (\field_location -> Eithers.bind (ExtractCore.requireField "name" DecodeCore.name fieldMap cx) (\field_name -> Right (ErrorCore.DuplicateBindingError {- ErrorCore.duplicateBindingErrorLocation = field_location,- ErrorCore.duplicateBindingErrorName = field_name}))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.error.core.DuplicateBindingError")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.error.core.DuplicateFieldError-duplicateFieldError :: Graph.Graph -> Core.Term -> Either Errors.DecodingError ErrorCore.DuplicateFieldError-duplicateFieldError cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "location" Paths.subtermPath fieldMap cx) (\field_location -> Eithers.bind (ExtractCore.requireField "name" DecodeCore.name fieldMap cx) (\field_name -> Right (ErrorCore.DuplicateFieldError {- ErrorCore.duplicateFieldErrorLocation = field_location,- ErrorCore.duplicateFieldErrorName = field_name}))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.error.core.DuplicateFieldError")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.error.core.DuplicateRecordTypeFieldNamesError-duplicateRecordTypeFieldNamesError :: Graph.Graph -> Core.Term -> Either Errors.DecodingError ErrorCore.DuplicateRecordTypeFieldNamesError-duplicateRecordTypeFieldNamesError cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "location" Paths.subtermPath fieldMap cx) (\field_location -> Eithers.bind (ExtractCore.requireField "name" DecodeCore.name fieldMap cx) (\field_name -> Right (ErrorCore.DuplicateRecordTypeFieldNamesError {- ErrorCore.duplicateRecordTypeFieldNamesErrorLocation = field_location,- ErrorCore.duplicateRecordTypeFieldNamesErrorName = field_name}))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.error.core.DuplicateRecordTypeFieldNamesError")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.error.core.DuplicateUnionTypeFieldNamesError-duplicateUnionTypeFieldNamesError :: Graph.Graph -> Core.Term -> Either Errors.DecodingError ErrorCore.DuplicateUnionTypeFieldNamesError-duplicateUnionTypeFieldNamesError cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "location" Paths.subtermPath fieldMap cx) (\field_location -> Eithers.bind (ExtractCore.requireField "name" DecodeCore.name fieldMap cx) (\field_name -> Right (ErrorCore.DuplicateUnionTypeFieldNamesError {- ErrorCore.duplicateUnionTypeFieldNamesErrorLocation = field_location,- ErrorCore.duplicateUnionTypeFieldNamesErrorName = field_name}))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.error.core.DuplicateUnionTypeFieldNamesError")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.error.core.EmptyCaseStatementError-emptyCaseStatementError :: Graph.Graph -> Core.Term -> Either Errors.DecodingError ErrorCore.EmptyCaseStatementError-emptyCaseStatementError cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "location" Paths.subtermPath fieldMap cx) (\field_location -> Eithers.bind (ExtractCore.requireField "typeName" DecodeCore.name fieldMap cx) (\field_typeName -> Right (ErrorCore.EmptyCaseStatementError {- ErrorCore.emptyCaseStatementErrorLocation = field_location,- ErrorCore.emptyCaseStatementErrorTypeName = field_typeName}))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.error.core.EmptyCaseStatementError")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.error.core.EmptyLetBindingsError-emptyLetBindingsError :: Graph.Graph -> Core.Term -> Either Errors.DecodingError ErrorCore.EmptyLetBindingsError-emptyLetBindingsError cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "location" Paths.subtermPath fieldMap cx) (\field_location -> Right (ErrorCore.EmptyLetBindingsError {- ErrorCore.emptyLetBindingsErrorLocation = field_location})))- _ -> Left (Errors.DecodingError "expected a record of type hydra.error.core.EmptyLetBindingsError")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.error.core.EmptyRecordTypeError-emptyRecordTypeError :: Graph.Graph -> Core.Term -> Either Errors.DecodingError ErrorCore.EmptyRecordTypeError-emptyRecordTypeError cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "location" Paths.subtermPath fieldMap cx) (\field_location -> Right (ErrorCore.EmptyRecordTypeError {- ErrorCore.emptyRecordTypeErrorLocation = field_location})))- _ -> Left (Errors.DecodingError "expected a record of type hydra.error.core.EmptyRecordTypeError")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.error.core.EmptyTermAnnotationError-emptyTermAnnotationError :: Graph.Graph -> Core.Term -> Either Errors.DecodingError ErrorCore.EmptyTermAnnotationError-emptyTermAnnotationError cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "location" Paths.subtermPath fieldMap cx) (\field_location -> Right (ErrorCore.EmptyTermAnnotationError {- ErrorCore.emptyTermAnnotationErrorLocation = field_location})))- _ -> Left (Errors.DecodingError "expected a record of type hydra.error.core.EmptyTermAnnotationError")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.error.core.EmptyTypeAnnotationError-emptyTypeAnnotationError :: Graph.Graph -> Core.Term -> Either Errors.DecodingError ErrorCore.EmptyTypeAnnotationError-emptyTypeAnnotationError cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "location" Paths.subtermPath fieldMap cx) (\field_location -> Right (ErrorCore.EmptyTypeAnnotationError {- ErrorCore.emptyTypeAnnotationErrorLocation = field_location})))- _ -> Left (Errors.DecodingError "expected a record of type hydra.error.core.EmptyTypeAnnotationError")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.error.core.EmptyTypeNameInTermError-emptyTypeNameInTermError :: Graph.Graph -> Core.Term -> Either Errors.DecodingError ErrorCore.EmptyTypeNameInTermError-emptyTypeNameInTermError cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "location" Paths.subtermPath fieldMap cx) (\field_location -> Right (ErrorCore.EmptyTypeNameInTermError {- ErrorCore.emptyTypeNameInTermErrorLocation = field_location})))- _ -> Left (Errors.DecodingError "expected a record of type hydra.error.core.EmptyTypeNameInTermError")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.error.core.EmptyUnionTypeError-emptyUnionTypeError :: Graph.Graph -> Core.Term -> Either Errors.DecodingError ErrorCore.EmptyUnionTypeError-emptyUnionTypeError cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "location" Paths.subtermPath fieldMap cx) (\field_location -> Right (ErrorCore.EmptyUnionTypeError {- ErrorCore.emptyUnionTypeErrorLocation = field_location})))- _ -> Left (Errors.DecodingError "expected a record of type hydra.error.core.EmptyUnionTypeError")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.error.core.ExtraRecordFieldsError-extraRecordFieldsError :: Graph.Graph -> Core.Term -> Either Errors.DecodingError ErrorCore.ExtraRecordFieldsError-extraRecordFieldsError cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "location" Paths.subtermPath fieldMap cx) (\field_location -> Eithers.bind (ExtractCore.requireField "typeName" DecodeCore.name fieldMap cx) (\field_typeName -> Eithers.bind (ExtractCore.requireField "fieldNames" (ExtractCore.decodeList DecodeCore.name) fieldMap cx) (\field_fieldNames -> Right (ErrorCore.ExtraRecordFieldsError {- ErrorCore.extraRecordFieldsErrorLocation = field_location,- ErrorCore.extraRecordFieldsErrorTypeName = field_typeName,- ErrorCore.extraRecordFieldsErrorFieldNames = field_fieldNames})))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.error.core.ExtraRecordFieldsError")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.error.core.InvalidForallParameterNameError-invalidForallParameterNameError :: Graph.Graph -> Core.Term -> Either Errors.DecodingError ErrorCore.InvalidForallParameterNameError-invalidForallParameterNameError cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "location" Paths.subtermPath fieldMap cx) (\field_location -> Eithers.bind (ExtractCore.requireField "name" DecodeCore.name fieldMap cx) (\field_name -> Right (ErrorCore.InvalidForallParameterNameError {- ErrorCore.invalidForallParameterNameErrorLocation = field_location,- ErrorCore.invalidForallParameterNameErrorName = field_name}))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.error.core.InvalidForallParameterNameError")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.error.core.InvalidLambdaParameterNameError-invalidLambdaParameterNameError :: Graph.Graph -> Core.Term -> Either Errors.DecodingError ErrorCore.InvalidLambdaParameterNameError-invalidLambdaParameterNameError cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "location" Paths.subtermPath fieldMap cx) (\field_location -> Eithers.bind (ExtractCore.requireField "name" DecodeCore.name fieldMap cx) (\field_name -> Right (ErrorCore.InvalidLambdaParameterNameError {- ErrorCore.invalidLambdaParameterNameErrorLocation = field_location,- ErrorCore.invalidLambdaParameterNameErrorName = field_name}))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.error.core.InvalidLambdaParameterNameError")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.error.core.InvalidLetBindingNameError-invalidLetBindingNameError :: Graph.Graph -> Core.Term -> Either Errors.DecodingError ErrorCore.InvalidLetBindingNameError-invalidLetBindingNameError cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "location" Paths.subtermPath fieldMap cx) (\field_location -> Eithers.bind (ExtractCore.requireField "name" DecodeCore.name fieldMap cx) (\field_name -> Right (ErrorCore.InvalidLetBindingNameError {- ErrorCore.invalidLetBindingNameErrorLocation = field_location,- ErrorCore.invalidLetBindingNameErrorName = field_name}))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.error.core.InvalidLetBindingNameError")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.error.core.InvalidLiteralError-invalidLiteralError :: Graph.Graph -> Core.Term -> Either Errors.DecodingError ErrorCore.InvalidLiteralError-invalidLiteralError cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermInject v0 ->- let field = Core.injectionField v0- fname = Core.fieldName field- fterm = Core.fieldTerm field- variantMap =- Maps.fromList [- (- Core.Name "typeMismatch",- (\input -> Eithers.map (\t -> ErrorCore.InvalidLiteralErrorTypeMismatch t) (literalTypeMismatchError cx input)))]- in (Optionals.match (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [- "no such field ",- (Core.unName fname),- " in union"]))) (\f -> f fterm))- _ -> Left (Errors.DecodingError "expected union")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.error.core.InvalidTermError-invalidTermError :: Graph.Graph -> Core.Term -> Either Errors.DecodingError ErrorCore.InvalidTermError-invalidTermError cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermInject v0 ->- let field = Core.injectionField v0- fname = Core.fieldName field- fterm = Core.fieldTerm field- variantMap =- Maps.fromList [- (- Core.Name "constantCondition",- (\input -> Eithers.map (\t -> ErrorCore.InvalidTermErrorConstantCondition t) (constantConditionError cx input))),- (- Core.Name "duplicateBinding",- (\input -> Eithers.map (\t -> ErrorCore.InvalidTermErrorDuplicateBinding t) (duplicateBindingError cx input))),- (- Core.Name "duplicateField",- (\input -> Eithers.map (\t -> ErrorCore.InvalidTermErrorDuplicateField t) (duplicateFieldError cx input))),- (- Core.Name "emptyCaseStatement",- (\input -> Eithers.map (\t -> ErrorCore.InvalidTermErrorEmptyCaseStatement t) (emptyCaseStatementError cx input))),- (- Core.Name "emptyLetBindings",- (\input -> Eithers.map (\t -> ErrorCore.InvalidTermErrorEmptyLetBindings t) (emptyLetBindingsError cx input))),- (- Core.Name "emptyTermAnnotation",- (\input -> Eithers.map (\t -> ErrorCore.InvalidTermErrorEmptyTermAnnotation t) (emptyTermAnnotationError cx input))),- (- Core.Name "emptyTypeNameInTerm",- (\input -> Eithers.map (\t -> ErrorCore.InvalidTermErrorEmptyTypeNameInTerm t) (emptyTypeNameInTermError cx input))),- (- Core.Name "extraRecordFields",- (\input -> Eithers.map (\t -> ErrorCore.InvalidTermErrorExtraRecordFields t) (extraRecordFieldsError cx input))),- (- Core.Name "invalidLambdaParameterName",- (\input -> Eithers.map (\t -> ErrorCore.InvalidTermErrorInvalidLambdaParameterName t) (invalidLambdaParameterNameError cx input))),- (- Core.Name "invalidLetBindingName",- (\input -> Eithers.map (\t -> ErrorCore.InvalidTermErrorInvalidLetBindingName t) (invalidLetBindingNameError cx input))),- (- Core.Name "invalidTypeLambdaParameterName",- (\input -> Eithers.map (\t -> ErrorCore.InvalidTermErrorInvalidTypeLambdaParameterName t) (invalidTypeLambdaParameterNameError cx input))),- (- Core.Name "missingCaseBranches",- (\input -> Eithers.map (\t -> ErrorCore.InvalidTermErrorMissingCaseBranches t) (missingCaseBranchesError cx input))),- (- Core.Name "missingRecordFields",- (\input -> Eithers.map (\t -> ErrorCore.InvalidTermErrorMissingRecordFields t) (missingRecordFieldsError cx input))),- (- Core.Name "nestedTermAnnotation",- (\input -> Eithers.map (\t -> ErrorCore.InvalidTermErrorNestedTermAnnotation t) (nestedTermAnnotationError cx input))),- (- Core.Name "nominalTypeKindMismatch",- (\input -> Eithers.map (\t -> ErrorCore.InvalidTermErrorNominalTypeKindMismatch t) (nominalTypeKindMismatchError cx input))),- (- Core.Name "redundantWrapUnwrap",- (\input -> Eithers.map (\t -> ErrorCore.InvalidTermErrorRedundantWrapUnwrap t) (redundantWrapUnwrapError cx input))),- (- Core.Name "selfApplication",- (\input -> Eithers.map (\t -> ErrorCore.InvalidTermErrorSelfApplication t) (selfApplicationError cx input))),- (- Core.Name "termVariableShadowing",- (\input -> Eithers.map (\t -> ErrorCore.InvalidTermErrorTermVariableShadowing t) (termVariableShadowingError cx input))),- (- Core.Name "typeVariableShadowingInTypeLambda",- (\input -> Eithers.map (\t -> ErrorCore.InvalidTermErrorTypeVariableShadowingInTypeLambda t) (typeVariableShadowingInTypeLambdaError cx input))),- (- Core.Name "undeclaredVariant",- (\input -> Eithers.map (\t -> ErrorCore.InvalidTermErrorUndeclaredVariant t) (undeclaredVariantError cx input))),- (- Core.Name "undefinedTermVariable",- (\input -> Eithers.map (\t -> ErrorCore.InvalidTermErrorUndefinedTermVariable t) (undefinedTermVariableError cx input))),- (- Core.Name "undefinedTypeVariableInBindingType",- (\input -> Eithers.map (\t -> ErrorCore.InvalidTermErrorUndefinedTypeVariableInBindingType t) (undefinedTypeVariableInBindingTypeError cx input))),- (- Core.Name "undefinedTypeVariableInLambdaDomain",- (\input -> Eithers.map (\t -> ErrorCore.InvalidTermErrorUndefinedTypeVariableInLambdaDomain t) (undefinedTypeVariableInLambdaDomainError cx input))),- (- Core.Name "undefinedTypeVariableInTypeApplication",- (\input -> Eithers.map (\t -> ErrorCore.InvalidTermErrorUndefinedTypeVariableInTypeApplication t) (undefinedTypeVariableInTypeApplicationError cx input))),- (- Core.Name "unknownCaseAlternative",- (\input -> Eithers.map (\t -> ErrorCore.InvalidTermErrorUnknownCaseAlternative t) (unknownCaseAlternativeError cx input))),- (- Core.Name "unknownPrimitiveName",- (\input -> Eithers.map (\t -> ErrorCore.InvalidTermErrorUnknownPrimitiveName t) (unknownPrimitiveNameError cx input))),- (- Core.Name "unknownProjectedField",- (\input -> Eithers.map (\t -> ErrorCore.InvalidTermErrorUnknownProjectedField t) (unknownProjectedFieldError cx input))),- (- Core.Name "unnecessaryIdentityApplication",- (\input -> Eithers.map (\t -> ErrorCore.InvalidTermErrorUnnecessaryIdentityApplication t) (unnecessaryIdentityApplicationError cx input))),- (- Core.Name "unresolvedNominalType",- (\input -> Eithers.map (\t -> ErrorCore.InvalidTermErrorUnresolvedNominalType t) (unresolvedNominalTypeError cx input))),- (- Core.Name "untypedTermVariable",- (\input -> Eithers.map (\t -> ErrorCore.InvalidTermErrorUntypedTermVariable t) (untypedTermVariableError cx input)))]- in (Optionals.match (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [- "no such field ",- (Core.unName fname),- " in union"]))) (\f -> f fterm))- _ -> Left (Errors.DecodingError "expected union")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.error.core.InvalidTypeError-invalidTypeError :: Graph.Graph -> Core.Term -> Either Errors.DecodingError ErrorCore.InvalidTypeError-invalidTypeError cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermInject v0 ->- let field = Core.injectionField v0- fname = Core.fieldName field- fterm = Core.fieldTerm field- variantMap =- Maps.fromList [- (- Core.Name "duplicateRecordTypeFieldNames",- (\input -> Eithers.map (\t -> ErrorCore.InvalidTypeErrorDuplicateRecordTypeFieldNames t) (duplicateRecordTypeFieldNamesError cx input))),- (- Core.Name "duplicateUnionTypeFieldNames",- (\input -> Eithers.map (\t -> ErrorCore.InvalidTypeErrorDuplicateUnionTypeFieldNames t) (duplicateUnionTypeFieldNamesError cx input))),- (- Core.Name "emptyRecordType",- (\input -> Eithers.map (\t -> ErrorCore.InvalidTypeErrorEmptyRecordType t) (emptyRecordTypeError cx input))),- (- Core.Name "emptyTypeAnnotation",- (\input -> Eithers.map (\t -> ErrorCore.InvalidTypeErrorEmptyTypeAnnotation t) (emptyTypeAnnotationError cx input))),- (- Core.Name "emptyUnionType",- (\input -> Eithers.map (\t -> ErrorCore.InvalidTypeErrorEmptyUnionType t) (emptyUnionTypeError cx input))),- (- Core.Name "invalidForallParameterName",- (\input -> Eithers.map (\t -> ErrorCore.InvalidTypeErrorInvalidForallParameterName t) (invalidForallParameterNameError cx input))),- (- Core.Name "invalidTypeSchemeVariableName",- (\input -> Eithers.map (\t -> ErrorCore.InvalidTypeErrorInvalidTypeSchemeVariableName t) (invalidTypeSchemeVariableNameError cx input))),- (- Core.Name "nestedTypeAnnotation",- (\input -> Eithers.map (\t -> ErrorCore.InvalidTypeErrorNestedTypeAnnotation t) (nestedTypeAnnotationError cx input))),- (- Core.Name "nonComparableMapKeyType",- (\input -> Eithers.map (\t -> ErrorCore.InvalidTypeErrorNonComparableMapKeyType t) (nonComparableMapKeyTypeError cx input))),- (- Core.Name "nonComparableSetElementType",- (\input -> Eithers.map (\t -> ErrorCore.InvalidTypeErrorNonComparableSetElementType t) (nonComparableSetElementTypeError cx input))),- (- Core.Name "singleVariantUnion",- (\input -> Eithers.map (\t -> ErrorCore.InvalidTypeErrorSingleVariantUnion t) (singleVariantUnionError cx input))),- (- Core.Name "typeVariableShadowingInForall",- (\input -> Eithers.map (\t -> ErrorCore.InvalidTypeErrorTypeVariableShadowingInForall t) (typeVariableShadowingInForallError cx input))),- (- Core.Name "undefinedTypeVariable",- (\input -> Eithers.map (\t -> ErrorCore.InvalidTypeErrorUndefinedTypeVariable t) (undefinedTypeVariableError cx input))),- (- Core.Name "voidInNonBottomPosition",- (\input -> Eithers.map (\t -> ErrorCore.InvalidTypeErrorVoidInNonBottomPosition t) (voidInNonBottomPositionError cx input)))]- in (Optionals.match (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [- "no such field ",- (Core.unName fname),- " in union"]))) (\f -> f fterm))- _ -> Left (Errors.DecodingError "expected union")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.error.core.InvalidTypeLambdaParameterNameError-invalidTypeLambdaParameterNameError :: Graph.Graph -> Core.Term -> Either Errors.DecodingError ErrorCore.InvalidTypeLambdaParameterNameError-invalidTypeLambdaParameterNameError cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "location" Paths.subtermPath fieldMap cx) (\field_location -> Eithers.bind (ExtractCore.requireField "name" DecodeCore.name fieldMap cx) (\field_name -> Right (ErrorCore.InvalidTypeLambdaParameterNameError {- ErrorCore.invalidTypeLambdaParameterNameErrorLocation = field_location,- ErrorCore.invalidTypeLambdaParameterNameErrorName = field_name}))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.error.core.InvalidTypeLambdaParameterNameError")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.error.core.InvalidTypeSchemeVariableNameError-invalidTypeSchemeVariableNameError :: Graph.Graph -> Core.Term -> Either Errors.DecodingError ErrorCore.InvalidTypeSchemeVariableNameError-invalidTypeSchemeVariableNameError cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "location" Paths.subtermPath fieldMap cx) (\field_location -> Eithers.bind (ExtractCore.requireField "name" DecodeCore.name fieldMap cx) (\field_name -> Right (ErrorCore.InvalidTypeSchemeVariableNameError {- ErrorCore.invalidTypeSchemeVariableNameErrorLocation = field_location,- ErrorCore.invalidTypeSchemeVariableNameErrorName = field_name}))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.error.core.InvalidTypeSchemeVariableNameError")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.error.core.LiteralTypeMismatchError-literalTypeMismatchError :: Graph.Graph -> Core.Term -> Either Errors.DecodingError ErrorCore.LiteralTypeMismatchError-literalTypeMismatchError cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "expectedType" DecodeCore.literalType fieldMap cx) (\field_expectedType -> Eithers.bind (ExtractCore.requireField "actualType" DecodeCore.literalType fieldMap cx) (\field_actualType -> Right (ErrorCore.LiteralTypeMismatchError {- ErrorCore.literalTypeMismatchErrorExpectedType = field_expectedType,- ErrorCore.literalTypeMismatchErrorActualType = field_actualType}))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.error.core.LiteralTypeMismatchError")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.error.core.MissingCaseBranchesError-missingCaseBranchesError :: Graph.Graph -> Core.Term -> Either Errors.DecodingError ErrorCore.MissingCaseBranchesError-missingCaseBranchesError cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "location" Paths.subtermPath fieldMap cx) (\field_location -> Eithers.bind (ExtractCore.requireField "typeName" DecodeCore.name fieldMap cx) (\field_typeName -> Eithers.bind (ExtractCore.requireField "variantNames" (ExtractCore.decodeList DecodeCore.name) fieldMap cx) (\field_variantNames -> Right (ErrorCore.MissingCaseBranchesError {- ErrorCore.missingCaseBranchesErrorLocation = field_location,- ErrorCore.missingCaseBranchesErrorTypeName = field_typeName,- ErrorCore.missingCaseBranchesErrorVariantNames = field_variantNames})))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.error.core.MissingCaseBranchesError")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.error.core.MissingRecordFieldsError-missingRecordFieldsError :: Graph.Graph -> Core.Term -> Either Errors.DecodingError ErrorCore.MissingRecordFieldsError-missingRecordFieldsError cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "location" Paths.subtermPath fieldMap cx) (\field_location -> Eithers.bind (ExtractCore.requireField "typeName" DecodeCore.name fieldMap cx) (\field_typeName -> Eithers.bind (ExtractCore.requireField "fieldNames" (ExtractCore.decodeList DecodeCore.name) fieldMap cx) (\field_fieldNames -> Right (ErrorCore.MissingRecordFieldsError {- ErrorCore.missingRecordFieldsErrorLocation = field_location,- ErrorCore.missingRecordFieldsErrorTypeName = field_typeName,- ErrorCore.missingRecordFieldsErrorFieldNames = field_fieldNames})))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.error.core.MissingRecordFieldsError")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.error.core.NestedTermAnnotationError-nestedTermAnnotationError :: Graph.Graph -> Core.Term -> Either Errors.DecodingError ErrorCore.NestedTermAnnotationError-nestedTermAnnotationError cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "location" Paths.subtermPath fieldMap cx) (\field_location -> Right (ErrorCore.NestedTermAnnotationError {- ErrorCore.nestedTermAnnotationErrorLocation = field_location})))- _ -> Left (Errors.DecodingError "expected a record of type hydra.error.core.NestedTermAnnotationError")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.error.core.NestedTypeAnnotationError-nestedTypeAnnotationError :: Graph.Graph -> Core.Term -> Either Errors.DecodingError ErrorCore.NestedTypeAnnotationError-nestedTypeAnnotationError cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "location" Paths.subtermPath fieldMap cx) (\field_location -> Right (ErrorCore.NestedTypeAnnotationError {- ErrorCore.nestedTypeAnnotationErrorLocation = field_location})))- _ -> Left (Errors.DecodingError "expected a record of type hydra.error.core.NestedTypeAnnotationError")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.error.core.NominalTypeKindMismatchError-nominalTypeKindMismatchError :: Graph.Graph -> Core.Term -> Either Errors.DecodingError ErrorCore.NominalTypeKindMismatchError-nominalTypeKindMismatchError cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "location" Paths.subtermPath fieldMap cx) (\field_location -> Eithers.bind (ExtractCore.requireField "typeName" DecodeCore.name fieldMap cx) (\field_typeName -> Eithers.bind (ExtractCore.requireField "expectedVariant" Variants.typeVariant fieldMap cx) (\field_expectedVariant -> Eithers.bind (ExtractCore.requireField "actualVariant" Variants.typeVariant fieldMap cx) (\field_actualVariant -> Right (ErrorCore.NominalTypeKindMismatchError {- ErrorCore.nominalTypeKindMismatchErrorLocation = field_location,- ErrorCore.nominalTypeKindMismatchErrorTypeName = field_typeName,- ErrorCore.nominalTypeKindMismatchErrorExpectedVariant = field_expectedVariant,- ErrorCore.nominalTypeKindMismatchErrorActualVariant = field_actualVariant}))))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.error.core.NominalTypeKindMismatchError")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.error.core.NonComparableMapKeyTypeError-nonComparableMapKeyTypeError :: Graph.Graph -> Core.Term -> Either Errors.DecodingError ErrorCore.NonComparableMapKeyTypeError-nonComparableMapKeyTypeError cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "location" Paths.subtermPath fieldMap cx) (\field_location -> Eithers.bind (ExtractCore.requireField "keyType" DecodeCore.type_ fieldMap cx) (\field_keyType -> Right (ErrorCore.NonComparableMapKeyTypeError {- ErrorCore.nonComparableMapKeyTypeErrorLocation = field_location,- ErrorCore.nonComparableMapKeyTypeErrorKeyType = field_keyType}))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.error.core.NonComparableMapKeyTypeError")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.error.core.NonComparableSetElementTypeError-nonComparableSetElementTypeError :: Graph.Graph -> Core.Term -> Either Errors.DecodingError ErrorCore.NonComparableSetElementTypeError-nonComparableSetElementTypeError cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "location" Paths.subtermPath fieldMap cx) (\field_location -> Eithers.bind (ExtractCore.requireField "elementType" DecodeCore.type_ fieldMap cx) (\field_elementType -> Right (ErrorCore.NonComparableSetElementTypeError {- ErrorCore.nonComparableSetElementTypeErrorLocation = field_location,- ErrorCore.nonComparableSetElementTypeErrorElementType = field_elementType}))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.error.core.NonComparableSetElementTypeError")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.error.core.RedundantWrapUnwrapError-redundantWrapUnwrapError :: Graph.Graph -> Core.Term -> Either Errors.DecodingError ErrorCore.RedundantWrapUnwrapError-redundantWrapUnwrapError cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "location" Paths.subtermPath fieldMap cx) (\field_location -> Eithers.bind (ExtractCore.requireField "typeName" DecodeCore.name fieldMap cx) (\field_typeName -> Right (ErrorCore.RedundantWrapUnwrapError {- ErrorCore.redundantWrapUnwrapErrorLocation = field_location,- ErrorCore.redundantWrapUnwrapErrorTypeName = field_typeName}))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.error.core.RedundantWrapUnwrapError")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.error.core.SelfApplicationError-selfApplicationError :: Graph.Graph -> Core.Term -> Either Errors.DecodingError ErrorCore.SelfApplicationError-selfApplicationError cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "location" Paths.subtermPath fieldMap cx) (\field_location -> Eithers.bind (ExtractCore.requireField "name" DecodeCore.name fieldMap cx) (\field_name -> Right (ErrorCore.SelfApplicationError {- ErrorCore.selfApplicationErrorLocation = field_location,- ErrorCore.selfApplicationErrorName = field_name}))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.error.core.SelfApplicationError")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.error.core.SingleVariantUnionError-singleVariantUnionError :: Graph.Graph -> Core.Term -> Either Errors.DecodingError ErrorCore.SingleVariantUnionError-singleVariantUnionError cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "location" Paths.subtermPath fieldMap cx) (\field_location -> Eithers.bind (ExtractCore.requireField "fieldName" DecodeCore.name fieldMap cx) (\field_fieldName -> Right (ErrorCore.SingleVariantUnionError {- ErrorCore.singleVariantUnionErrorLocation = field_location,- ErrorCore.singleVariantUnionErrorFieldName = field_fieldName}))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.error.core.SingleVariantUnionError")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.error.core.TermVariableShadowingError-termVariableShadowingError :: Graph.Graph -> Core.Term -> Either Errors.DecodingError ErrorCore.TermVariableShadowingError-termVariableShadowingError cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "location" Paths.subtermPath fieldMap cx) (\field_location -> Eithers.bind (ExtractCore.requireField "name" DecodeCore.name fieldMap cx) (\field_name -> Right (ErrorCore.TermVariableShadowingError {- ErrorCore.termVariableShadowingErrorLocation = field_location,- ErrorCore.termVariableShadowingErrorName = field_name}))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.error.core.TermVariableShadowingError")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.error.core.TypeVariableShadowingInForallError-typeVariableShadowingInForallError :: Graph.Graph -> Core.Term -> Either Errors.DecodingError ErrorCore.TypeVariableShadowingInForallError-typeVariableShadowingInForallError cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "location" Paths.subtermPath fieldMap cx) (\field_location -> Eithers.bind (ExtractCore.requireField "name" DecodeCore.name fieldMap cx) (\field_name -> Right (ErrorCore.TypeVariableShadowingInForallError {- ErrorCore.typeVariableShadowingInForallErrorLocation = field_location,- ErrorCore.typeVariableShadowingInForallErrorName = field_name}))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.error.core.TypeVariableShadowingInForallError")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.error.core.TypeVariableShadowingInTypeLambdaError-typeVariableShadowingInTypeLambdaError :: Graph.Graph -> Core.Term -> Either Errors.DecodingError ErrorCore.TypeVariableShadowingInTypeLambdaError-typeVariableShadowingInTypeLambdaError cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "location" Paths.subtermPath fieldMap cx) (\field_location -> Eithers.bind (ExtractCore.requireField "name" DecodeCore.name fieldMap cx) (\field_name -> Right (ErrorCore.TypeVariableShadowingInTypeLambdaError {- ErrorCore.typeVariableShadowingInTypeLambdaErrorLocation = field_location,- ErrorCore.typeVariableShadowingInTypeLambdaErrorName = field_name}))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.error.core.TypeVariableShadowingInTypeLambdaError")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.error.core.UndeclaredVariantError-undeclaredVariantError :: Graph.Graph -> Core.Term -> Either Errors.DecodingError ErrorCore.UndeclaredVariantError-undeclaredVariantError cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "location" Paths.subtermPath fieldMap cx) (\field_location -> Eithers.bind (ExtractCore.requireField "typeName" DecodeCore.name fieldMap cx) (\field_typeName -> Eithers.bind (ExtractCore.requireField "variantName" DecodeCore.name fieldMap cx) (\field_variantName -> Right (ErrorCore.UndeclaredVariantError {- ErrorCore.undeclaredVariantErrorLocation = field_location,- ErrorCore.undeclaredVariantErrorTypeName = field_typeName,- ErrorCore.undeclaredVariantErrorVariantName = field_variantName})))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.error.core.UndeclaredVariantError")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.error.core.UndefinedFieldError-undefinedFieldError :: Graph.Graph -> Core.Term -> Either Errors.DecodingError ErrorCore.UndefinedFieldError-undefinedFieldError cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "fieldName" DecodeCore.name fieldMap cx) (\field_fieldName -> Eithers.bind (ExtractCore.requireField "typeName" DecodeCore.name fieldMap cx) (\field_typeName -> Right (ErrorCore.UndefinedFieldError {- ErrorCore.undefinedFieldErrorFieldName = field_fieldName,- ErrorCore.undefinedFieldErrorTypeName = field_typeName}))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.error.core.UndefinedFieldError")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.error.core.UndefinedTermVariableError-undefinedTermVariableError :: Graph.Graph -> Core.Term -> Either Errors.DecodingError ErrorCore.UndefinedTermVariableError-undefinedTermVariableError cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "location" Paths.subtermPath fieldMap cx) (\field_location -> Eithers.bind (ExtractCore.requireField "name" DecodeCore.name fieldMap cx) (\field_name -> Right (ErrorCore.UndefinedTermVariableError {- ErrorCore.undefinedTermVariableErrorLocation = field_location,- ErrorCore.undefinedTermVariableErrorName = field_name}))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.error.core.UndefinedTermVariableError")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.error.core.UndefinedTypeVariableError-undefinedTypeVariableError :: Graph.Graph -> Core.Term -> Either Errors.DecodingError ErrorCore.UndefinedTypeVariableError-undefinedTypeVariableError cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "location" Paths.subtermPath fieldMap cx) (\field_location -> Eithers.bind (ExtractCore.requireField "name" DecodeCore.name fieldMap cx) (\field_name -> Right (ErrorCore.UndefinedTypeVariableError {- ErrorCore.undefinedTypeVariableErrorLocation = field_location,- ErrorCore.undefinedTypeVariableErrorName = field_name}))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.error.core.UndefinedTypeVariableError")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.error.core.UndefinedTypeVariableInBindingTypeError-undefinedTypeVariableInBindingTypeError :: Graph.Graph -> Core.Term -> Either Errors.DecodingError ErrorCore.UndefinedTypeVariableInBindingTypeError-undefinedTypeVariableInBindingTypeError cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "location" Paths.subtermPath fieldMap cx) (\field_location -> Eithers.bind (ExtractCore.requireField "name" DecodeCore.name fieldMap cx) (\field_name -> Right (ErrorCore.UndefinedTypeVariableInBindingTypeError {- ErrorCore.undefinedTypeVariableInBindingTypeErrorLocation = field_location,- ErrorCore.undefinedTypeVariableInBindingTypeErrorName = field_name}))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.error.core.UndefinedTypeVariableInBindingTypeError")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.error.core.UndefinedTypeVariableInLambdaDomainError-undefinedTypeVariableInLambdaDomainError :: Graph.Graph -> Core.Term -> Either Errors.DecodingError ErrorCore.UndefinedTypeVariableInLambdaDomainError-undefinedTypeVariableInLambdaDomainError cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "location" Paths.subtermPath fieldMap cx) (\field_location -> Eithers.bind (ExtractCore.requireField "name" DecodeCore.name fieldMap cx) (\field_name -> Right (ErrorCore.UndefinedTypeVariableInLambdaDomainError {- ErrorCore.undefinedTypeVariableInLambdaDomainErrorLocation = field_location,- ErrorCore.undefinedTypeVariableInLambdaDomainErrorName = field_name}))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.error.core.UndefinedTypeVariableInLambdaDomainError")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.error.core.UndefinedTypeVariableInTypeApplicationError-undefinedTypeVariableInTypeApplicationError :: Graph.Graph -> Core.Term -> Either Errors.DecodingError ErrorCore.UndefinedTypeVariableInTypeApplicationError-undefinedTypeVariableInTypeApplicationError cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "location" Paths.subtermPath fieldMap cx) (\field_location -> Eithers.bind (ExtractCore.requireField "name" DecodeCore.name fieldMap cx) (\field_name -> Right (ErrorCore.UndefinedTypeVariableInTypeApplicationError {- ErrorCore.undefinedTypeVariableInTypeApplicationErrorLocation = field_location,- ErrorCore.undefinedTypeVariableInTypeApplicationErrorName = field_name}))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.error.core.UndefinedTypeVariableInTypeApplicationError")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.error.core.UnexpectedTermVariantError-unexpectedTermVariantError :: Graph.Graph -> Core.Term -> Either Errors.DecodingError ErrorCore.UnexpectedTermVariantError-unexpectedTermVariantError cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "expectedVariant" Variants.termVariant fieldMap cx) (\field_expectedVariant -> Eithers.bind (ExtractCore.requireField "actualTerm" DecodeCore.term fieldMap cx) (\field_actualTerm -> Right (ErrorCore.UnexpectedTermVariantError {- ErrorCore.unexpectedTermVariantErrorExpectedVariant = field_expectedVariant,- ErrorCore.unexpectedTermVariantErrorActualTerm = field_actualTerm}))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.error.core.UnexpectedTermVariantError")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.error.core.UnexpectedTypeVariantError-unexpectedTypeVariantError :: Graph.Graph -> Core.Term -> Either Errors.DecodingError ErrorCore.UnexpectedTypeVariantError-unexpectedTypeVariantError cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "expectedVariant" Variants.typeVariant fieldMap cx) (\field_expectedVariant -> Eithers.bind (ExtractCore.requireField "actualType" DecodeCore.type_ fieldMap cx) (\field_actualType -> Right (ErrorCore.UnexpectedTypeVariantError {- ErrorCore.unexpectedTypeVariantErrorExpectedVariant = field_expectedVariant,- ErrorCore.unexpectedTypeVariantErrorActualType = field_actualType}))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.error.core.UnexpectedTypeVariantError")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.error.core.UnknownCaseAlternativeError-unknownCaseAlternativeError :: Graph.Graph -> Core.Term -> Either Errors.DecodingError ErrorCore.UnknownCaseAlternativeError-unknownCaseAlternativeError cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "location" Paths.subtermPath fieldMap cx) (\field_location -> Eithers.bind (ExtractCore.requireField "typeName" DecodeCore.name fieldMap cx) (\field_typeName -> Eithers.bind (ExtractCore.requireField "name" DecodeCore.name fieldMap cx) (\field_name -> Right (ErrorCore.UnknownCaseAlternativeError {- ErrorCore.unknownCaseAlternativeErrorLocation = field_location,- ErrorCore.unknownCaseAlternativeErrorTypeName = field_typeName,- ErrorCore.unknownCaseAlternativeErrorName = field_name})))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.error.core.UnknownCaseAlternativeError")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.error.core.UnknownPrimitiveNameError-unknownPrimitiveNameError :: Graph.Graph -> Core.Term -> Either Errors.DecodingError ErrorCore.UnknownPrimitiveNameError-unknownPrimitiveNameError cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "location" Paths.subtermPath fieldMap cx) (\field_location -> Eithers.bind (ExtractCore.requireField "name" DecodeCore.name fieldMap cx) (\field_name -> Right (ErrorCore.UnknownPrimitiveNameError {- ErrorCore.unknownPrimitiveNameErrorLocation = field_location,- ErrorCore.unknownPrimitiveNameErrorName = field_name}))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.error.core.UnknownPrimitiveNameError")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.error.core.UnknownProjectedFieldError-unknownProjectedFieldError :: Graph.Graph -> Core.Term -> Either Errors.DecodingError ErrorCore.UnknownProjectedFieldError-unknownProjectedFieldError cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "location" Paths.subtermPath fieldMap cx) (\field_location -> Eithers.bind (ExtractCore.requireField "typeName" DecodeCore.name fieldMap cx) (\field_typeName -> Eithers.bind (ExtractCore.requireField "fieldName" DecodeCore.name fieldMap cx) (\field_fieldName -> Right (ErrorCore.UnknownProjectedFieldError {- ErrorCore.unknownProjectedFieldErrorLocation = field_location,- ErrorCore.unknownProjectedFieldErrorTypeName = field_typeName,- ErrorCore.unknownProjectedFieldErrorFieldName = field_fieldName})))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.error.core.UnknownProjectedFieldError")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.error.core.UnnecessaryIdentityApplicationError-unnecessaryIdentityApplicationError :: Graph.Graph -> Core.Term -> Either Errors.DecodingError ErrorCore.UnnecessaryIdentityApplicationError-unnecessaryIdentityApplicationError cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "location" Paths.subtermPath fieldMap cx) (\field_location -> Right (ErrorCore.UnnecessaryIdentityApplicationError {- ErrorCore.unnecessaryIdentityApplicationErrorLocation = field_location})))- _ -> Left (Errors.DecodingError "expected a record of type hydra.error.core.UnnecessaryIdentityApplicationError")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.error.core.UnresolvedNominalTypeError-unresolvedNominalTypeError :: Graph.Graph -> Core.Term -> Either Errors.DecodingError ErrorCore.UnresolvedNominalTypeError-unresolvedNominalTypeError cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "location" Paths.subtermPath fieldMap cx) (\field_location -> Eithers.bind (ExtractCore.requireField "typeName" DecodeCore.name fieldMap cx) (\field_typeName -> Right (ErrorCore.UnresolvedNominalTypeError {- ErrorCore.unresolvedNominalTypeErrorLocation = field_location,- ErrorCore.unresolvedNominalTypeErrorTypeName = field_typeName}))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.error.core.UnresolvedNominalTypeError")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.error.core.UntypedTermVariableError-untypedTermVariableError :: Graph.Graph -> Core.Term -> Either Errors.DecodingError ErrorCore.UntypedTermVariableError-untypedTermVariableError cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "location" Paths.subtermPath fieldMap cx) (\field_location -> Eithers.bind (ExtractCore.requireField "name" DecodeCore.name fieldMap cx) (\field_name -> Right (ErrorCore.UntypedTermVariableError {- ErrorCore.untypedTermVariableErrorLocation = field_location,- ErrorCore.untypedTermVariableErrorName = field_name}))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.error.core.UntypedTermVariableError")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.error.core.VoidInNonBottomPositionError-voidInNonBottomPositionError :: Graph.Graph -> Core.Term -> Either Errors.DecodingError ErrorCore.VoidInNonBottomPositionError-voidInNonBottomPositionError cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "location" Paths.subtermPath fieldMap cx) (\field_location -> Right (ErrorCore.VoidInNonBottomPositionError {- ErrorCore.voidInNonBottomPositionErrorLocation = field_location})))- _ -> Left (Errors.DecodingError "expected a record of type hydra.error.core.VoidInNonBottomPositionError")) (ExtractCore.stripWithDecodingError cx raw)
@@ -1,59 +0,0 @@--- Note: this is an automatically generated file. Do not edit.---- | Term decoders for hydra.error.file--module Hydra.Decode.Error.File where--import qualified Hydra.Core as Core-import qualified Hydra.Decode.File as DecodeFile-import qualified Hydra.Error.File as ErrorFile-import qualified Hydra.Errors as Errors-import qualified Hydra.Extract.Core as ExtractCore-import qualified Hydra.Graph as Graph-import qualified Hydra.Lexical as Lexical-import qualified Hydra.Overlay.Haskell.Lib.Eithers as Eithers-import qualified Hydra.Overlay.Haskell.Lib.Maps as Maps-import qualified Hydra.Overlay.Haskell.Lib.Optionals as Optionals-import qualified Hydra.Overlay.Haskell.Lib.Strings as Strings-import qualified Hydra.Rewriting as Rewriting-import qualified Hydra.Util as Util-import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)-import qualified Data.Scientific as Sci-import Data.Void---- | Decoder for hydra.error.file.FileError-fileError :: Graph.Graph -> Core.Term -> Either Errors.DecodingError ErrorFile.FileError-fileError cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermInject v0 ->- let field = Core.injectionField v0- fname = Core.fieldName field- fterm = Core.fieldTerm field- variantMap =- Maps.fromList [- (- Core.Name "alreadyExists",- (\input -> Eithers.map (\t -> ErrorFile.FileErrorAlreadyExists t) (DecodeFile.filePath cx input))),- (- Core.Name "invalidPath",- (\input -> Eithers.map (\t -> ErrorFile.FileErrorInvalidPath t) (Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of- Core.TermLiteral v1 -> case v1 of- Core.LiteralString v2 -> Right v2- _ -> Left (Errors.DecodingError "expected string literal")- _ -> Left (Errors.DecodingError "expected literal")) (ExtractCore.stripWithDecodingError cx input)))),- (Core.Name "notFound", (\input -> Eithers.map (\t -> ErrorFile.FileErrorNotFound t) (DecodeFile.filePath cx input))),- (- Core.Name "other",- (\input -> Eithers.map (\t -> ErrorFile.FileErrorOther t) (Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of- Core.TermLiteral v1 -> case v1 of- Core.LiteralString v2 -> Right v2- _ -> Left (Errors.DecodingError "expected string literal")- _ -> Left (Errors.DecodingError "expected literal")) (ExtractCore.stripWithDecodingError cx input)))),- (- Core.Name "permissionDenied",- (\input -> Eithers.map (\t -> ErrorFile.FileErrorPermissionDenied t) (DecodeFile.filePath cx input)))]- in (Optionals.match (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [- "no such field ",- (Core.unName fname),- " in union"]))) (\f -> f fterm))- _ -> Left (Errors.DecodingError "expected union")) (ExtractCore.stripWithDecodingError cx raw)
@@ -1,244 +0,0 @@--- Note: this is an automatically generated file. Do not edit.---- | Term decoders for hydra.error.packaging--module Hydra.Decode.Error.Packaging where--import qualified Hydra.Core as Core-import qualified Hydra.Decode.Core as DecodeCore-import qualified Hydra.Decode.Packaging as DecodePackaging-import qualified Hydra.Decode.Util as DecodeUtil-import qualified Hydra.Error.Packaging as ErrorPackaging-import qualified Hydra.Errors as Errors-import qualified Hydra.Extract.Core as ExtractCore-import qualified Hydra.Graph as Graph-import qualified Hydra.Lexical as Lexical-import qualified Hydra.Overlay.Haskell.Lib.Eithers as Eithers-import qualified Hydra.Overlay.Haskell.Lib.Maps as Maps-import qualified Hydra.Overlay.Haskell.Lib.Optionals as Optionals-import qualified Hydra.Overlay.Haskell.Lib.Strings as Strings-import qualified Hydra.Rewriting as Rewriting-import qualified Hydra.Util as Util-import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)-import qualified Data.Scientific as Sci-import Data.Void---- | Decoder for hydra.error.packaging.ConflictingModuleNameError-conflictingModuleNameError :: Graph.Graph -> Core.Term -> Either Errors.DecodingError ErrorPackaging.ConflictingModuleNameError-conflictingModuleNameError cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "first" DecodePackaging.moduleName fieldMap cx) (\field_first -> Eithers.bind (ExtractCore.requireField "second" DecodePackaging.moduleName fieldMap cx) (\field_second -> Right (ErrorPackaging.ConflictingModuleNameError {- ErrorPackaging.conflictingModuleNameErrorFirst = field_first,- ErrorPackaging.conflictingModuleNameErrorSecond = field_second}))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.error.packaging.ConflictingModuleNameError")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.error.packaging.ConflictingVariantNameError-conflictingVariantNameError :: Graph.Graph -> Core.Term -> Either Errors.DecodingError ErrorPackaging.ConflictingVariantNameError-conflictingVariantNameError cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "moduleName" DecodePackaging.moduleName fieldMap cx) (\field_moduleName -> Eithers.bind (ExtractCore.requireField "typeName" DecodeCore.name fieldMap cx) (\field_typeName -> Eithers.bind (ExtractCore.requireField "variantName" DecodeCore.name fieldMap cx) (\field_variantName -> Eithers.bind (ExtractCore.requireField "conflictingName" DecodeCore.name fieldMap cx) (\field_conflictingName -> Right (ErrorPackaging.ConflictingVariantNameError {- ErrorPackaging.conflictingVariantNameErrorModuleName = field_moduleName,- ErrorPackaging.conflictingVariantNameErrorTypeName = field_typeName,- ErrorPackaging.conflictingVariantNameErrorVariantName = field_variantName,- ErrorPackaging.conflictingVariantNameErrorConflictingName = field_conflictingName}))))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.error.packaging.ConflictingVariantNameError")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.error.packaging.DefinitionNotInModuleNameError-definitionNotInModuleNameError :: Graph.Graph -> Core.Term -> Either Errors.DecodingError ErrorPackaging.DefinitionNotInModuleNameError-definitionNotInModuleNameError cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "moduleName" DecodePackaging.moduleName fieldMap cx) (\field_moduleName -> Eithers.bind (ExtractCore.requireField "name" DecodeCore.name fieldMap cx) (\field_name -> Right (ErrorPackaging.DefinitionNotInModuleNameError {- ErrorPackaging.definitionNotInModuleNameErrorModuleName = field_moduleName,- ErrorPackaging.definitionNotInModuleNameErrorName = field_name}))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.error.packaging.DefinitionNotInModuleNameError")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.error.packaging.DefinitionsOutOfOrderError-definitionsOutOfOrderError :: Graph.Graph -> Core.Term -> Either Errors.DecodingError ErrorPackaging.DefinitionsOutOfOrderError-definitionsOutOfOrderError cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "moduleName" DecodePackaging.moduleName fieldMap cx) (\field_moduleName -> Eithers.bind (ExtractCore.requireField "precedingName" DecodeCore.name fieldMap cx) (\field_precedingName -> Eithers.bind (ExtractCore.requireField "followingName" DecodeCore.name fieldMap cx) (\field_followingName -> Right (ErrorPackaging.DefinitionsOutOfOrderError {- ErrorPackaging.definitionsOutOfOrderErrorModuleName = field_moduleName,- ErrorPackaging.definitionsOutOfOrderErrorPrecedingName = field_precedingName,- ErrorPackaging.definitionsOutOfOrderErrorFollowingName = field_followingName})))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.error.packaging.DefinitionsOutOfOrderError")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.error.packaging.DuplicateDefinitionNameError-duplicateDefinitionNameError :: Graph.Graph -> Core.Term -> Either Errors.DecodingError ErrorPackaging.DuplicateDefinitionNameError-duplicateDefinitionNameError cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "moduleName" DecodePackaging.moduleName fieldMap cx) (\field_moduleName -> Eithers.bind (ExtractCore.requireField "name" DecodeCore.name fieldMap cx) (\field_name -> Right (ErrorPackaging.DuplicateDefinitionNameError {- ErrorPackaging.duplicateDefinitionNameErrorModuleName = field_moduleName,- ErrorPackaging.duplicateDefinitionNameErrorName = field_name}))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.error.packaging.DuplicateDefinitionNameError")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.error.packaging.DuplicateModuleNameError-duplicateModuleNameError :: Graph.Graph -> Core.Term -> Either Errors.DecodingError ErrorPackaging.DuplicateModuleNameError-duplicateModuleNameError cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "moduleName" DecodePackaging.moduleName fieldMap cx) (\field_moduleName -> Right (ErrorPackaging.DuplicateModuleNameError {- ErrorPackaging.duplicateModuleNameErrorModuleName = field_moduleName})))- _ -> Left (Errors.DecodingError "expected a record of type hydra.error.packaging.DuplicateModuleNameError")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.error.packaging.InvalidDefinitionNameError-invalidDefinitionNameError :: Graph.Graph -> Core.Term -> Either Errors.DecodingError ErrorPackaging.InvalidDefinitionNameError-invalidDefinitionNameError cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "moduleName" DecodePackaging.moduleName fieldMap cx) (\field_moduleName -> Eithers.bind (ExtractCore.requireField "name" DecodeCore.name fieldMap cx) (\field_name -> Eithers.bind (ExtractCore.requireField "expectedConvention" DecodeUtil.caseConvention fieldMap cx) (\field_expectedConvention -> Right (ErrorPackaging.InvalidDefinitionNameError {- ErrorPackaging.invalidDefinitionNameErrorModuleName = field_moduleName,- ErrorPackaging.invalidDefinitionNameErrorName = field_name,- ErrorPackaging.invalidDefinitionNameErrorExpectedConvention = field_expectedConvention})))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.error.packaging.InvalidDefinitionNameError")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.error.packaging.InvalidModuleError-invalidModuleError :: Graph.Graph -> Core.Term -> Either Errors.DecodingError ErrorPackaging.InvalidModuleError-invalidModuleError cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermInject v0 ->- let field = Core.injectionField v0- fname = Core.fieldName field- fterm = Core.fieldTerm field- variantMap =- Maps.fromList [- (- Core.Name "conflictingVariantName",- (\input -> Eithers.map (\t -> ErrorPackaging.InvalidModuleErrorConflictingVariantName t) (conflictingVariantNameError cx input))),- (- Core.Name "definitionNotInModuleName",- (\input -> Eithers.map (\t -> ErrorPackaging.InvalidModuleErrorDefinitionNotInModuleName t) (definitionNotInModuleNameError cx input))),- (- Core.Name "definitionsOutOfOrder",- (\input -> Eithers.map (\t -> ErrorPackaging.InvalidModuleErrorDefinitionsOutOfOrder t) (definitionsOutOfOrderError cx input))),- (- Core.Name "duplicateDefinitionName",- (\input -> Eithers.map (\t -> ErrorPackaging.InvalidModuleErrorDuplicateDefinitionName t) (duplicateDefinitionNameError cx input))),- (- Core.Name "invalidDefinitionName",- (\input -> Eithers.map (\t -> ErrorPackaging.InvalidModuleErrorInvalidDefinitionName t) (invalidDefinitionNameError cx input))),- (- Core.Name "invalidModuleNameConvention",- (\input -> Eithers.map (\t -> ErrorPackaging.InvalidModuleErrorInvalidModuleNameConvention t) (invalidModuleNameConventionError cx input))),- (- Core.Name "missingDocumentation",- (\input -> Eithers.map (\t -> ErrorPackaging.InvalidModuleErrorMissingDocumentation t) (missingDocumentationError cx input)))]- in (Optionals.match (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [- "no such field ",- (Core.unName fname),- " in union"]))) (\f -> f fterm))- _ -> Left (Errors.DecodingError "expected union")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.error.packaging.InvalidModuleNameConventionError-invalidModuleNameConventionError :: Graph.Graph -> Core.Term -> Either Errors.DecodingError ErrorPackaging.InvalidModuleNameConventionError-invalidModuleNameConventionError cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "moduleName" DecodePackaging.moduleName fieldMap cx) (\field_moduleName -> Right (ErrorPackaging.InvalidModuleNameConventionError {- ErrorPackaging.invalidModuleNameConventionErrorModuleName = field_moduleName})))- _ -> Left (Errors.DecodingError "expected a record of type hydra.error.packaging.InvalidModuleNameConventionError")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.error.packaging.InvalidPackageError-invalidPackageError :: Graph.Graph -> Core.Term -> Either Errors.DecodingError ErrorPackaging.InvalidPackageError-invalidPackageError cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermInject v0 ->- let field = Core.injectionField v0- fname = Core.fieldName field- fterm = Core.fieldTerm field- variantMap =- Maps.fromList [- (- Core.Name "conflictingModuleName",- (\input -> Eithers.map (\t -> ErrorPackaging.InvalidPackageErrorConflictingModuleName t) (conflictingModuleNameError cx input))),- (- Core.Name "duplicateModuleName",- (\input -> Eithers.map (\t -> ErrorPackaging.InvalidPackageErrorDuplicateModuleName t) (duplicateModuleNameError cx input))),- (- Core.Name "invalidModule",- (\input -> Eithers.map (\t -> ErrorPackaging.InvalidPackageErrorInvalidModule t) (invalidModuleError cx input))),- (- Core.Name "invalidPackageName",- (\input -> Eithers.map (\t -> ErrorPackaging.InvalidPackageErrorInvalidPackageName t) (invalidPackageNameError cx input))),- (- Core.Name "moduleInMultiplePackages",- (\input -> Eithers.map (\t -> ErrorPackaging.InvalidPackageErrorModuleInMultiplePackages t) (moduleInMultiplePackagesError cx input))),- (- Core.Name "nestedModuleName",- (\input -> Eithers.map (\t -> ErrorPackaging.InvalidPackageErrorNestedModuleName t) (nestedModuleNameError cx input))),- (- Core.Name "undeclaredDependency",- (\input -> Eithers.map (\t -> ErrorPackaging.InvalidPackageErrorUndeclaredDependency t) (undeclaredDependencyError cx input)))]- in (Optionals.match (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [- "no such field ",- (Core.unName fname),- " in union"]))) (\f -> f fterm))- _ -> Left (Errors.DecodingError "expected union")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.error.packaging.InvalidPackageNameError-invalidPackageNameError :: Graph.Graph -> Core.Term -> Either Errors.DecodingError ErrorPackaging.InvalidPackageNameError-invalidPackageNameError cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "packageName" DecodePackaging.packageName fieldMap cx) (\field_packageName -> Right (ErrorPackaging.InvalidPackageNameError {- ErrorPackaging.invalidPackageNameErrorPackageName = field_packageName})))- _ -> Left (Errors.DecodingError "expected a record of type hydra.error.packaging.InvalidPackageNameError")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.error.packaging.MissingDocumentationError-missingDocumentationError :: Graph.Graph -> Core.Term -> Either Errors.DecodingError ErrorPackaging.MissingDocumentationError-missingDocumentationError cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "moduleName" DecodePackaging.moduleName fieldMap cx) (\field_moduleName -> Eithers.bind (ExtractCore.requireField "name" DecodeCore.name fieldMap cx) (\field_name -> Right (ErrorPackaging.MissingDocumentationError {- ErrorPackaging.missingDocumentationErrorModuleName = field_moduleName,- ErrorPackaging.missingDocumentationErrorName = field_name}))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.error.packaging.MissingDocumentationError")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.error.packaging.ModuleInMultiplePackagesError-moduleInMultiplePackagesError :: Graph.Graph -> Core.Term -> Either Errors.DecodingError ErrorPackaging.ModuleInMultiplePackagesError-moduleInMultiplePackagesError cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "moduleName" DecodePackaging.moduleName fieldMap cx) (\field_moduleName -> Eithers.bind (ExtractCore.requireField "firstPackage" DecodePackaging.packageName fieldMap cx) (\field_firstPackage -> Eithers.bind (ExtractCore.requireField "secondPackage" DecodePackaging.packageName fieldMap cx) (\field_secondPackage -> Right (ErrorPackaging.ModuleInMultiplePackagesError {- ErrorPackaging.moduleInMultiplePackagesErrorModuleName = field_moduleName,- ErrorPackaging.moduleInMultiplePackagesErrorFirstPackage = field_firstPackage,- ErrorPackaging.moduleInMultiplePackagesErrorSecondPackage = field_secondPackage})))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.error.packaging.ModuleInMultiplePackagesError")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.error.packaging.NestedModuleNameError-nestedModuleNameError :: Graph.Graph -> Core.Term -> Either Errors.DecodingError ErrorPackaging.NestedModuleNameError-nestedModuleNameError cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "outer" DecodePackaging.moduleName fieldMap cx) (\field_outer -> Eithers.bind (ExtractCore.requireField "inner" DecodePackaging.moduleName fieldMap cx) (\field_inner -> Right (ErrorPackaging.NestedModuleNameError {- ErrorPackaging.nestedModuleNameErrorOuter = field_outer,- ErrorPackaging.nestedModuleNameErrorInner = field_inner}))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.error.packaging.NestedModuleNameError")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.error.packaging.UndeclaredDependencyError-undeclaredDependencyError :: Graph.Graph -> Core.Term -> Either Errors.DecodingError ErrorPackaging.UndeclaredDependencyError-undeclaredDependencyError cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "moduleName" DecodePackaging.moduleName fieldMap cx) (\field_moduleName -> Eithers.bind (ExtractCore.requireField "referencedName" DecodeCore.name fieldMap cx) (\field_referencedName -> Eithers.bind (ExtractCore.requireField "owningModuleName" DecodePackaging.moduleName fieldMap cx) (\field_owningModuleName -> Right (ErrorPackaging.UndeclaredDependencyError {- ErrorPackaging.undeclaredDependencyErrorModuleName = field_moduleName,- ErrorPackaging.undeclaredDependencyErrorReferencedName = field_referencedName,- ErrorPackaging.undeclaredDependencyErrorOwningModuleName = field_owningModuleName})))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.error.packaging.UndeclaredDependencyError")) (ExtractCore.stripWithDecodingError cx raw)
@@ -1,55 +0,0 @@--- Note: this is an automatically generated file. Do not edit.---- | Term decoders for hydra.error.system--module Hydra.Decode.Error.System where--import qualified Hydra.Core as Core-import qualified Hydra.Decode.File as File-import qualified Hydra.Error.System as System-import qualified Hydra.Errors as Errors-import qualified Hydra.Extract.Core as ExtractCore-import qualified Hydra.Graph as Graph-import qualified Hydra.Lexical as Lexical-import qualified Hydra.Overlay.Haskell.Lib.Eithers as Eithers-import qualified Hydra.Overlay.Haskell.Lib.Maps as Maps-import qualified Hydra.Overlay.Haskell.Lib.Optionals as Optionals-import qualified Hydra.Overlay.Haskell.Lib.Strings as Strings-import qualified Hydra.Rewriting as Rewriting-import qualified Hydra.Util as Util-import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)-import qualified Data.Scientific as Sci-import Data.Void---- | Decoder for hydra.error.system.SystemError-systemError :: Graph.Graph -> Core.Term -> Either Errors.DecodingError System.SystemError-systemError cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermInject v0 ->- let field = Core.injectionField v0- fname = Core.fieldName field- fterm = Core.fieldTerm field- variantMap =- Maps.fromList [- (- Core.Name "commandNotFound",- (\input -> Eithers.map (\t -> System.SystemErrorCommandNotFound t) (File.filePath cx input))),- (- Core.Name "permissionDenied",- (\input -> Eithers.map (\t -> System.SystemErrorPermissionDenied t) (File.filePath cx input))),- (- Core.Name "invalidWorkingDirectory",- (\input -> Eithers.map (\t -> System.SystemErrorInvalidWorkingDirectory t) (File.filePath cx input))),- (Core.Name "interrupted", (\input -> Eithers.map (\t -> System.SystemErrorInterrupted) (ExtractCore.decodeUnit cx input))),- (- Core.Name "other",- (\input -> Eithers.map (\t -> System.SystemErrorOther t) (Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of- Core.TermLiteral v1 -> case v1 of- Core.LiteralString v2 -> Right v2- _ -> Left (Errors.DecodingError "expected string literal")- _ -> Left (Errors.DecodingError "expected literal")) (ExtractCore.stripWithDecodingError cx input))))]- in (Optionals.match (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [- "no such field ",- (Core.unName fname),- " in union"]))) (\f -> f fterm))- _ -> Left (Errors.DecodingError "expected union")) (ExtractCore.stripWithDecodingError cx raw)
@@ -1,310 +0,0 @@--- Note: this is an automatically generated file. Do not edit.---- | Term decoders for hydra.errors--module Hydra.Decode.Errors where--import qualified Hydra.Core as Core-import qualified Hydra.Decode.Core as DecodeCore-import qualified Hydra.Decode.Error.Checking as Checking-import qualified Hydra.Decode.Error.Core as ErrorCore-import qualified Hydra.Decode.Paths as Paths-import qualified Hydra.Decode.Typing as Typing-import qualified Hydra.Decode.Variants as Variants-import qualified Hydra.Errors as Errors-import qualified Hydra.Extract.Core as ExtractCore-import qualified Hydra.Graph as Graph-import qualified Hydra.Lexical as Lexical-import qualified Hydra.Overlay.Haskell.Lib.Eithers as Eithers-import qualified Hydra.Overlay.Haskell.Lib.Maps as Maps-import qualified Hydra.Overlay.Haskell.Lib.Optionals as Optionals-import qualified Hydra.Overlay.Haskell.Lib.Strings as Strings-import qualified Hydra.Rewriting as Rewriting-import qualified Hydra.Util as Util-import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)-import qualified Data.Scientific as Sci-import Data.Void---- | Decoder for hydra.errors.DecodingError-decodingError :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Errors.DecodingError-decodingError cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermWrap v0 -> Eithers.map (\b -> Errors.DecodingError b) ((\raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of- Core.TermLiteral v1 -> case v1 of- Core.LiteralString v2 -> Right v2- _ -> Left (Errors.DecodingError "expected string literal")- _ -> Left (Errors.DecodingError "expected literal")) (ExtractCore.stripWithDecodingError cx raw2)) (Core.wrappedTermBody v0))- _ -> Left (Errors.DecodingError "expected wrapped type")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.errors.EmptyListError-emptyListError :: Graph.Graph -> Core.Term -> Either Errors.DecodingError ()-emptyListError cx t = ExtractCore.decodeUnit cx t---- | Decoder for hydra.errors.Error-error :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Errors.Error-error cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermInject v0 ->- let field = Core.injectionField v0- fname = Core.fieldName field- fterm = Core.fieldTerm field- variantMap =- Maps.fromList [- (Core.Name "checking", (\input -> Eithers.map (\t -> Errors.ErrorChecking t) (Checking.checkingError cx input))),- (Core.Name "decoding", (\input -> Eithers.map (\t -> Errors.ErrorDecoding t) (decodingError cx input))),- (- Core.Name "duplicateBinding",- (\input -> Eithers.map (\t -> Errors.ErrorDuplicateBinding t) (ErrorCore.duplicateBindingError cx input))),- (- Core.Name "duplicateField",- (\input -> Eithers.map (\t -> Errors.ErrorDuplicateField t) (ErrorCore.duplicateFieldError cx input))),- (Core.Name "extraction", (\input -> Eithers.map (\t -> Errors.ErrorExtraction t) (extractionError cx input))),- (Core.Name "inference", (\input -> Eithers.map (\t -> Errors.ErrorInference t) (inferenceError cx input))),- (- Core.Name "invalidLiteral",- (\input -> Eithers.map (\t -> Errors.ErrorInvalidLiteral t) (ErrorCore.invalidLiteralError cx input))),- (Core.Name "other", (\input -> Eithers.map (\t -> Errors.ErrorOther t) (otherError cx input))),- (Core.Name "resolution", (\input -> Eithers.map (\t -> Errors.ErrorResolution t) (resolutionError cx input))),- (- Core.Name "undefinedField",- (\input -> Eithers.map (\t -> Errors.ErrorUndefinedField t) (ErrorCore.undefinedFieldError cx input))),- (- Core.Name "undefinedTermVariable",- (\input -> Eithers.map (\t -> Errors.ErrorUndefinedTermVariable t) (ErrorCore.undefinedTermVariableError cx input))),- (- Core.Name "untypedTermVariable",- (\input -> Eithers.map (\t -> Errors.ErrorUntypedTermVariable t) (ErrorCore.untypedTermVariableError cx input))),- (- Core.Name "unexpectedTermVariant",- (\input -> Eithers.map (\t -> Errors.ErrorUnexpectedTermVariant t) (ErrorCore.unexpectedTermVariantError cx input))),- (- Core.Name "unexpectedTypeVariant",- (\input -> Eithers.map (\t -> Errors.ErrorUnexpectedTypeVariant t) (ErrorCore.unexpectedTypeVariantError cx input))),- (Core.Name "unification", (\input -> Eithers.map (\t -> Errors.ErrorUnification t) (unificationError cx input)))]- in (Optionals.match (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [- "no such field ",- (Core.unName fname),- " in union"]))) (\f -> f fterm))- _ -> Left (Errors.DecodingError "expected union")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.errors.ExtractionError-extractionError :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Errors.ExtractionError-extractionError cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermInject v0 ->- let field = Core.injectionField v0- fname = Core.fieldName field- fterm = Core.fieldTerm field- variantMap =- Maps.fromList [- (Core.Name "emptyList", (\input -> Eithers.map (\t -> Errors.ExtractionErrorEmptyList t) (emptyListError cx input))),- (- Core.Name "multipleBindings",- (\input -> Eithers.map (\t -> Errors.ExtractionErrorMultipleBindings t) (multipleBindingsError cx input))),- (- Core.Name "multipleFields",- (\input -> Eithers.map (\t -> Errors.ExtractionErrorMultipleFields t) (multipleFieldsError cx input))),- (- Core.Name "noMatchingField",- (\input -> Eithers.map (\t -> Errors.ExtractionErrorNoMatchingField t) (noMatchingFieldError cx input))),- (- Core.Name "noSuchBinding",- (\input -> Eithers.map (\t -> Errors.ExtractionErrorNoSuchBinding t) (noSuchBindingError cx input))),- (- Core.Name "notEnoughCases",- (\input -> Eithers.map (\t -> Errors.ExtractionErrorNotEnoughCases t) (notEnoughCasesError cx input))),- (- Core.Name "unexpectedShape",- (\input -> Eithers.map (\t -> Errors.ExtractionErrorUnexpectedShape t) (unexpectedShapeError cx input)))]- in (Optionals.match (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [- "no such field ",- (Core.unName fname),- " in union"]))) (\f -> f fterm))- _ -> Left (Errors.DecodingError "expected union")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.errors.InferenceError-inferenceError :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Errors.InferenceError-inferenceError cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermInject v0 ->- let field = Core.injectionField v0- fname = Core.fieldName field- fterm = Core.fieldTerm field- variantMap =- Maps.fromList [- (Core.Name "checking", (\input -> Eithers.map (\t -> Errors.InferenceErrorChecking t) (Checking.checkingError cx input))),- (Core.Name "other", (\input -> Eithers.map (\t -> Errors.InferenceErrorOther t) (otherInferenceError cx input))),- (- Core.Name "unification",- (\input -> Eithers.map (\t -> Errors.InferenceErrorUnification t) (unificationInferenceError cx input)))]- in (Optionals.match (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [- "no such field ",- (Core.unName fname),- " in union"]))) (\f -> f fterm))- _ -> Left (Errors.DecodingError "expected union")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.errors.MultipleBindingsError-multipleBindingsError :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Errors.MultipleBindingsError-multipleBindingsError cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "name" DecodeCore.name fieldMap cx) (\field_name -> Right (Errors.MultipleBindingsError {- Errors.multipleBindingsErrorName = field_name})))- _ -> Left (Errors.DecodingError "expected a record of type hydra.errors.MultipleBindingsError")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.errors.MultipleFieldsError-multipleFieldsError :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Errors.MultipleFieldsError-multipleFieldsError cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "fieldName" DecodeCore.name fieldMap cx) (\field_fieldName -> Right (Errors.MultipleFieldsError {- Errors.multipleFieldsErrorFieldName = field_fieldName})))- _ -> Left (Errors.DecodingError "expected a record of type hydra.errors.MultipleFieldsError")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.errors.NoMatchingFieldError-noMatchingFieldError :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Errors.NoMatchingFieldError-noMatchingFieldError cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "fieldName" DecodeCore.name fieldMap cx) (\field_fieldName -> Right (Errors.NoMatchingFieldError {- Errors.noMatchingFieldErrorFieldName = field_fieldName})))- _ -> Left (Errors.DecodingError "expected a record of type hydra.errors.NoMatchingFieldError")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.errors.NoSuchBindingError-noSuchBindingError :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Errors.NoSuchBindingError-noSuchBindingError cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "name" DecodeCore.name fieldMap cx) (\field_name -> Right (Errors.NoSuchBindingError {- Errors.noSuchBindingErrorName = field_name})))- _ -> Left (Errors.DecodingError "expected a record of type hydra.errors.NoSuchBindingError")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.errors.NoSuchPrimitiveError-noSuchPrimitiveError :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Errors.NoSuchPrimitiveError-noSuchPrimitiveError cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "name" DecodeCore.name fieldMap cx) (\field_name -> Right (Errors.NoSuchPrimitiveError {- Errors.noSuchPrimitiveErrorName = field_name})))- _ -> Left (Errors.DecodingError "expected a record of type hydra.errors.NoSuchPrimitiveError")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.errors.NotEnoughCasesError-notEnoughCasesError :: Graph.Graph -> Core.Term -> Either Errors.DecodingError ()-notEnoughCasesError cx t = ExtractCore.decodeUnit cx t---- | Decoder for hydra.errors.OtherError-otherError :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Errors.OtherError-otherError cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermWrap v0 -> Eithers.map (\b -> Errors.OtherError b) ((\raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of- Core.TermLiteral v1 -> case v1 of- Core.LiteralString v2 -> Right v2- _ -> Left (Errors.DecodingError "expected string literal")- _ -> Left (Errors.DecodingError "expected literal")) (ExtractCore.stripWithDecodingError cx raw2)) (Core.wrappedTermBody v0))- _ -> Left (Errors.DecodingError "expected wrapped type")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.errors.OtherInferenceError-otherInferenceError :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Errors.OtherInferenceError-otherInferenceError cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "path" Paths.subtermPath fieldMap cx) (\field_path -> Eithers.bind (ExtractCore.requireField "message" (\cx2 -> \raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of- Core.TermLiteral v1 -> case v1 of- Core.LiteralString v2 -> Right v2- _ -> Left (Errors.DecodingError "expected string literal")- _ -> Left (Errors.DecodingError "expected literal")) (ExtractCore.stripWithDecodingError cx2 raw2)) fieldMap cx) (\field_message -> Right (Errors.OtherInferenceError {- Errors.otherInferenceErrorPath = field_path,- Errors.otherInferenceErrorMessage = field_message}))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.errors.OtherInferenceError")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.errors.OtherResolutionError-otherResolutionError :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Errors.OtherResolutionError-otherResolutionError cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermWrap v0 -> Eithers.map (\b -> Errors.OtherResolutionError b) ((\raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of- Core.TermLiteral v1 -> case v1 of- Core.LiteralString v2 -> Right v2- _ -> Left (Errors.DecodingError "expected string literal")- _ -> Left (Errors.DecodingError "expected literal")) (ExtractCore.stripWithDecodingError cx raw2)) (Core.wrappedTermBody v0))- _ -> Left (Errors.DecodingError "expected wrapped type")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.errors.ResolutionError-resolutionError :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Errors.ResolutionError-resolutionError cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermInject v0 ->- let field = Core.injectionField v0- fname = Core.fieldName field- fterm = Core.fieldTerm field- variantMap =- Maps.fromList [- (- Core.Name "noSuchBinding",- (\input -> Eithers.map (\t -> Errors.ResolutionErrorNoSuchBinding t) (noSuchBindingError cx input))),- (- Core.Name "noSuchPrimitive",- (\input -> Eithers.map (\t -> Errors.ResolutionErrorNoSuchPrimitive t) (noSuchPrimitiveError cx input))),- (- Core.Name "noMatchingField",- (\input -> Eithers.map (\t -> Errors.ResolutionErrorNoMatchingField t) (noMatchingFieldError cx input))),- (Core.Name "other", (\input -> Eithers.map (\t -> Errors.ResolutionErrorOther t) (otherResolutionError cx input))),- (- Core.Name "unexpectedShape",- (\input -> Eithers.map (\t -> Errors.ResolutionErrorUnexpectedShape t) (unexpectedShapeError cx input)))]- in (Optionals.match (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [- "no such field ",- (Core.unName fname),- " in union"]))) (\f -> f fterm))- _ -> Left (Errors.DecodingError "expected union")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.errors.UnexpectedShapeError-unexpectedShapeError :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Errors.UnexpectedShapeError-unexpectedShapeError cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "expected" (\cx2 -> \raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of- Core.TermLiteral v1 -> case v1 of- Core.LiteralString v2 -> Right v2- _ -> Left (Errors.DecodingError "expected string literal")- _ -> Left (Errors.DecodingError "expected literal")) (ExtractCore.stripWithDecodingError cx2 raw2)) fieldMap cx) (\field_expected -> Eithers.bind (ExtractCore.requireField "actual" (\cx2 -> \raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of- Core.TermLiteral v1 -> case v1 of- Core.LiteralString v2 -> Right v2- _ -> Left (Errors.DecodingError "expected string literal")- _ -> Left (Errors.DecodingError "expected literal")) (ExtractCore.stripWithDecodingError cx2 raw2)) fieldMap cx) (\field_actual -> Right (Errors.UnexpectedShapeError {- Errors.unexpectedShapeErrorExpected = field_expected,- Errors.unexpectedShapeErrorActual = field_actual}))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.errors.UnexpectedShapeError")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.errors.UnificationError-unificationError :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Errors.UnificationError-unificationError cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "leftType" DecodeCore.type_ fieldMap cx) (\field_leftType -> Eithers.bind (ExtractCore.requireField "rightType" DecodeCore.type_ fieldMap cx) (\field_rightType -> Eithers.bind (ExtractCore.requireField "message" (\cx2 -> \raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of- Core.TermLiteral v1 -> case v1 of- Core.LiteralString v2 -> Right v2- _ -> Left (Errors.DecodingError "expected string literal")- _ -> Left (Errors.DecodingError "expected literal")) (ExtractCore.stripWithDecodingError cx2 raw2)) fieldMap cx) (\field_message -> Right (Errors.UnificationError {- Errors.unificationErrorLeftType = field_leftType,- Errors.unificationErrorRightType = field_rightType,- Errors.unificationErrorMessage = field_message})))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.errors.UnificationError")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.errors.UnificationInferenceError-unificationInferenceError :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Errors.UnificationInferenceError-unificationInferenceError cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "path" Paths.subtermPath fieldMap cx) (\field_path -> Eithers.bind (ExtractCore.requireField "cause" unificationError fieldMap cx) (\field_cause -> Right (Errors.UnificationInferenceError {- Errors.unificationInferenceErrorPath = field_path,- Errors.unificationInferenceErrorCause = field_cause}))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.errors.UnificationInferenceError")) (ExtractCore.stripWithDecodingError cx raw)
@@ -1,88 +0,0 @@--- Note: this is an automatically generated file. Do not edit.---- | Term decoders for hydra.file--module Hydra.Decode.File where--import qualified Hydra.Core as Core-import qualified Hydra.Decode.Core as DecodeCore-import qualified Hydra.Decode.Time as Time-import qualified Hydra.Errors as Errors-import qualified Hydra.Extract.Core as ExtractCore-import qualified Hydra.File as File-import qualified Hydra.Graph as Graph-import qualified Hydra.Lexical as Lexical-import qualified Hydra.Overlay.Haskell.Lib.Eithers as Eithers-import qualified Hydra.Overlay.Haskell.Lib.Maps as Maps-import qualified Hydra.Overlay.Haskell.Lib.Optionals as Optionals-import qualified Hydra.Overlay.Haskell.Lib.Strings as Strings-import qualified Hydra.Rewriting as Rewriting-import qualified Hydra.Util as Util-import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)-import qualified Data.Scientific as Sci-import Data.Void---- | Decoder for hydra.file.FileExtension-fileExtension :: Graph.Graph -> Core.Term -> Either Errors.DecodingError File.FileExtension-fileExtension cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermWrap v0 -> Eithers.map (\b -> File.FileExtension b) ((\raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of- Core.TermLiteral v1 -> case v1 of- Core.LiteralString v2 -> Right v2- _ -> Left (Errors.DecodingError "expected string literal")- _ -> Left (Errors.DecodingError "expected literal")) (ExtractCore.stripWithDecodingError cx raw2)) (Core.wrappedTermBody v0))- _ -> Left (Errors.DecodingError "expected wrapped type")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.file.FilePath-filePath :: Graph.Graph -> Core.Term -> Either Errors.DecodingError File.FilePath-filePath cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermWrap v0 -> Eithers.map (\b -> File.FilePath b) ((\raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of- Core.TermLiteral v1 -> case v1 of- Core.LiteralString v2 -> Right v2- _ -> Left (Errors.DecodingError "expected string literal")- _ -> Left (Errors.DecodingError "expected literal")) (ExtractCore.stripWithDecodingError cx raw2)) (Core.wrappedTermBody v0))- _ -> Left (Errors.DecodingError "expected wrapped type")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.file.FileStatus-fileStatus :: Graph.Graph -> Core.Term -> Either Errors.DecodingError File.FileStatus-fileStatus cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "fileType" fileType fieldMap cx) (\field_fileType -> Eithers.bind (ExtractCore.requireField "size" (\cx2 -> \raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of- Core.TermLiteral v1 -> case v1 of- Core.LiteralInteger v2 -> case v2 of- Core.IntegerValueInt64 v3 -> Right v3- _ -> Left (Errors.DecodingError "expected int64 value")- _ -> Left (Errors.DecodingError "expected int64 literal")- _ -> Left (Errors.DecodingError "expected literal")) (ExtractCore.stripWithDecodingError cx2 raw2)) fieldMap cx) (\field_size -> Eithers.bind (ExtractCore.requireField "modificationTime" Time.timespec fieldMap cx) (\field_modificationTime -> Eithers.bind (ExtractCore.requireField "accessTime" (ExtractCore.decodeMaybe Time.timespec) fieldMap cx) (\field_accessTime -> Eithers.bind (ExtractCore.requireField "statusChangeTime" (ExtractCore.decodeMaybe Time.timespec) fieldMap cx) (\field_statusChangeTime -> Right (File.FileStatus {- File.fileStatusFileType = field_fileType,- File.fileStatusSize = field_size,- File.fileStatusModificationTime = field_modificationTime,- File.fileStatusAccessTime = field_accessTime,- File.fileStatusStatusChangeTime = field_statusChangeTime})))))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.file.FileStatus")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.file.FileType-fileType :: Graph.Graph -> Core.Term -> Either Errors.DecodingError File.FileType-fileType cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermInject v0 ->- let field = Core.injectionField v0- fname = Core.fieldName field- fterm = Core.fieldTerm field- variantMap =- Maps.fromList [- (Core.Name "block", (\input -> Eithers.map (\t -> File.FileTypeBlock) (ExtractCore.decodeUnit cx input))),- (Core.Name "character", (\input -> Eithers.map (\t -> File.FileTypeCharacter) (ExtractCore.decodeUnit cx input))),- (Core.Name "directory", (\input -> Eithers.map (\t -> File.FileTypeDirectory) (ExtractCore.decodeUnit cx input))),- (Core.Name "fifo", (\input -> Eithers.map (\t -> File.FileTypeFifo) (ExtractCore.decodeUnit cx input))),- (Core.Name "regular", (\input -> Eithers.map (\t -> File.FileTypeRegular) (ExtractCore.decodeUnit cx input))),- (Core.Name "link", (\input -> Eithers.map (\t -> File.FileTypeLink) (ExtractCore.decodeUnit cx input))),- (Core.Name "socket", (\input -> Eithers.map (\t -> File.FileTypeSocket) (ExtractCore.decodeUnit cx input)))]- in (Optionals.match (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [- "no such field ",- (Core.unName fname),- " in union"]))) (\f -> f fterm))- _ -> Left (Errors.DecodingError "expected union")) (ExtractCore.stripWithDecodingError cx raw)
@@ -1,68 +0,0 @@--- Note: this is an automatically generated file. Do not edit.---- | Term decoders for hydra.json.model--module Hydra.Decode.Json.Model where--import qualified Hydra.Core as Core-import qualified Hydra.Decode.Core as DecodeCore-import qualified Hydra.Errors as Errors-import qualified Hydra.Extract.Core as ExtractCore-import qualified Hydra.Graph as Graph-import qualified Hydra.Json.Model as Model-import qualified Hydra.Lexical as Lexical-import qualified Hydra.Overlay.Haskell.Lib.Eithers as Eithers-import qualified Hydra.Overlay.Haskell.Lib.Maps as Maps-import qualified Hydra.Overlay.Haskell.Lib.Optionals as Optionals-import qualified Hydra.Overlay.Haskell.Lib.Strings as Strings-import qualified Hydra.Rewriting as Rewriting-import qualified Hydra.Util as Util-import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)-import qualified Data.Scientific as Sci-import Data.Void---- | Decoder for hydra.json.model.Value-value :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Model.Value-value cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermInject v0 ->- let field = Core.injectionField v0- fname = Core.fieldName field- fterm = Core.fieldTerm field- variantMap =- Maps.fromList [- (Core.Name "array", (\input -> Eithers.map (\t -> Model.ValueArray t) (ExtractCore.decodeList value cx input))),- (- Core.Name "boolean",- (\input -> Eithers.map (\t -> Model.ValueBoolean t) (Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of- Core.TermLiteral v1 -> case v1 of- Core.LiteralBoolean v2 -> Right v2- _ -> Left (Errors.DecodingError "expected boolean literal")- _ -> Left (Errors.DecodingError "expected literal")) (ExtractCore.stripWithDecodingError cx input)))),- (Core.Name "null", (\input -> Eithers.map (\t -> Model.ValueNull) (ExtractCore.decodeUnit cx input))),- (- Core.Name "number",- (\input -> Eithers.map (\t -> Model.ValueNumber t) (Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of- Core.TermLiteral v1 -> case v1 of- Core.LiteralDecimal v2 -> Right v2- _ -> Left (Errors.DecodingError "expected decimal literal")- _ -> Left (Errors.DecodingError "expected literal")) (ExtractCore.stripWithDecodingError cx input)))),- (- Core.Name "object",- (\input -> Eithers.map (\t -> Model.ValueObject t) (ExtractCore.decodeList (ExtractCore.decodePair (\cx2 -> \raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of- Core.TermLiteral v1 -> case v1 of- Core.LiteralString v2 -> Right v2- _ -> Left (Errors.DecodingError "expected string literal")- _ -> Left (Errors.DecodingError "expected literal")) (ExtractCore.stripWithDecodingError cx2 raw2)) value) cx input))),- (- Core.Name "string",- (\input -> Eithers.map (\t -> Model.ValueString t) (Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of- Core.TermLiteral v1 -> case v1 of- Core.LiteralString v2 -> Right v2- _ -> Left (Errors.DecodingError "expected string literal")- _ -> Left (Errors.DecodingError "expected literal")) (ExtractCore.stripWithDecodingError cx input))))]- in (Optionals.match (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [- "no such field ",- (Core.unName fname),- " in union"]))) (\f -> f fterm))- _ -> Left (Errors.DecodingError "expected union")) (ExtractCore.stripWithDecodingError cx raw)
@@ -1,350 +0,0 @@--- Note: this is an automatically generated file. Do not edit.---- | Term decoders for hydra.packaging--module Hydra.Decode.Packaging where--import qualified Hydra.Core as Core-import qualified Hydra.Decode.Core as DecodeCore-import qualified Hydra.Decode.Typing as Typing-import qualified Hydra.Errors as Errors-import qualified Hydra.Extract.Core as ExtractCore-import qualified Hydra.Graph as Graph-import qualified Hydra.Lexical as Lexical-import qualified Hydra.Overlay.Haskell.Lib.Eithers as Eithers-import qualified Hydra.Overlay.Haskell.Lib.Maps as Maps-import qualified Hydra.Overlay.Haskell.Lib.Optionals as Optionals-import qualified Hydra.Overlay.Haskell.Lib.Strings as Strings-import qualified Hydra.Packaging as Packaging-import qualified Hydra.Rewriting as Rewriting-import qualified Hydra.Util as Util-import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)-import qualified Data.Scientific as Sci-import Data.Void---- | Decoder for hydra.packaging.Definition-definition :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Packaging.Definition-definition cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermInject v0 ->- let field = Core.injectionField v0- fname = Core.fieldName field- fterm = Core.fieldTerm field- variantMap =- Maps.fromList [- (Core.Name "primitive", (\input -> Eithers.map (\t -> Packaging.DefinitionPrimitive t) (primitiveDefinition cx input))),- (Core.Name "term", (\input -> Eithers.map (\t -> Packaging.DefinitionTerm t) (termDefinition cx input))),- (Core.Name "type", (\input -> Eithers.map (\t -> Packaging.DefinitionType t) (typeDefinition cx input)))]- in (Optionals.match (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [- "no such field ",- (Core.unName fname),- " in union"]))) (\f -> f fterm))- _ -> Left (Errors.DecodingError "expected union")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.packaging.DefinitionReference-definitionReference :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Packaging.DefinitionReference-definitionReference cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermInject v0 ->- let field = Core.injectionField v0- fname = Core.fieldName field- fterm = Core.fieldTerm field- variantMap =- Maps.fromList [- (- Core.Name "primitive",- (\input -> Eithers.map (\t -> Packaging.DefinitionReferencePrimitive t) (DecodeCore.name cx input))),- (Core.Name "term", (\input -> Eithers.map (\t -> Packaging.DefinitionReferenceTerm t) (DecodeCore.name cx input))),- (Core.Name "type", (\input -> Eithers.map (\t -> Packaging.DefinitionReferenceType t) (DecodeCore.name cx input)))]- in (Optionals.match (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [- "no such field ",- (Core.unName fname),- " in union"]))) (\f -> f fterm))- _ -> Left (Errors.DecodingError "expected union")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.packaging.DependencyScope-dependencyScope :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Packaging.DependencyScope-dependencyScope cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermInject v0 ->- let field = Core.injectionField v0- fname = Core.fieldName field- fterm = Core.fieldTerm field- variantMap =- Maps.fromList [- (Core.Name "api", (\input -> Eithers.map (\t -> Packaging.DependencyScopeApi) (ExtractCore.decodeUnit cx input))),- (Core.Name "runtime", (\input -> Eithers.map (\t -> Packaging.DependencyScopeRuntime) (ExtractCore.decodeUnit cx input))),- (Core.Name "test", (\input -> Eithers.map (\t -> Packaging.DependencyScopeTest) (ExtractCore.decodeUnit cx input))),- (Core.Name "tool", (\input -> Eithers.map (\t -> Packaging.DependencyScopeTool) (ExtractCore.decodeUnit cx input)))]- in (Optionals.match (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [- "no such field ",- (Core.unName fname),- " in union"]))) (\f -> f fterm))- _ -> Left (Errors.DecodingError "expected union")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.packaging.EntityMetadata-entityMetadata :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Packaging.EntityMetadata-entityMetadata cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "description" (ExtractCore.decodeMaybe (\cx2 -> \raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of- Core.TermLiteral v1 -> case v1 of- Core.LiteralString v2 -> Right v2- _ -> Left (Errors.DecodingError "expected string literal")- _ -> Left (Errors.DecodingError "expected literal")) (ExtractCore.stripWithDecodingError cx2 raw2))) fieldMap cx) (\field_description -> Eithers.bind (ExtractCore.requireField "comments" (ExtractCore.decodeList (\cx2 -> \raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of- Core.TermLiteral v1 -> case v1 of- Core.LiteralString v2 -> Right v2- _ -> Left (Errors.DecodingError "expected string literal")- _ -> Left (Errors.DecodingError "expected literal")) (ExtractCore.stripWithDecodingError cx2 raw2))) fieldMap cx) (\field_comments -> Eithers.bind (ExtractCore.requireField "seeAlso" (ExtractCore.decodeList entityReference) fieldMap cx) (\field_seeAlso -> Eithers.bind (ExtractCore.requireField "lifecycle" (ExtractCore.decodeMaybe lifecycleInfo) fieldMap cx) (\field_lifecycle -> Eithers.bind (ExtractCore.requireField "provisions" (ExtractCore.decodeList provision) fieldMap cx) (\field_provisions -> Right (Packaging.EntityMetadata {- Packaging.entityMetadataDescription = field_description,- Packaging.entityMetadataComments = field_comments,- Packaging.entityMetadataSeeAlso = field_seeAlso,- Packaging.entityMetadataLifecycle = field_lifecycle,- Packaging.entityMetadataProvisions = field_provisions})))))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.packaging.EntityMetadata")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.packaging.EntityReference-entityReference :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Packaging.EntityReference-entityReference cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermInject v0 ->- let field = Core.injectionField v0- fname = Core.fieldName field- fterm = Core.fieldTerm field- variantMap =- Maps.fromList [- (- Core.Name "definition",- (\input -> Eithers.map (\t -> Packaging.EntityReferenceDefinition t) (definitionReference cx input))),- (Core.Name "module", (\input -> Eithers.map (\t -> Packaging.EntityReferenceModule t) (moduleName cx input))),- (Core.Name "package", (\input -> Eithers.map (\t -> Packaging.EntityReferencePackage t) (packageName cx input))),- (- Core.Name "termExpr",- (\input -> Eithers.map (\t -> Packaging.EntityReferenceTermExpr t) (Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of- Core.TermLiteral v1 -> case v1 of- Core.LiteralString v2 -> Right v2- _ -> Left (Errors.DecodingError "expected string literal")- _ -> Left (Errors.DecodingError "expected literal")) (ExtractCore.stripWithDecodingError cx input)))),- (- Core.Name "typeExpr",- (\input -> Eithers.map (\t -> Packaging.EntityReferenceTypeExpr t) (Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of- Core.TermLiteral v1 -> case v1 of- Core.LiteralString v2 -> Right v2- _ -> Left (Errors.DecodingError "expected string literal")- _ -> Left (Errors.DecodingError "expected literal")) (ExtractCore.stripWithDecodingError cx input))))]- in (Optionals.match (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [- "no such field ",- (Core.unName fname),- " in union"]))) (\f -> f fterm))- _ -> Left (Errors.DecodingError "expected union")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.packaging.LifecycleInfo-lifecycleInfo :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Packaging.LifecycleInfo-lifecycleInfo cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "availableSince" (ExtractCore.decodeMaybe version) fieldMap cx) (\field_availableSince -> Eithers.bind (ExtractCore.requireField "deprecatedSince" (ExtractCore.decodeMaybe version) fieldMap cx) (\field_deprecatedSince -> Right (Packaging.LifecycleInfo {- Packaging.lifecycleInfoAvailableSince = field_availableSince,- Packaging.lifecycleInfoDeprecatedSince = field_deprecatedSince}))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.packaging.LifecycleInfo")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.packaging.Module-module_ :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Packaging.Module-module_ cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "name" moduleName fieldMap cx) (\field_name -> Eithers.bind (ExtractCore.requireField "metadata" (ExtractCore.decodeMaybe entityMetadata) fieldMap cx) (\field_metadata -> Eithers.bind (ExtractCore.requireField "dependencies" (ExtractCore.decodeList moduleDependency) fieldMap cx) (\field_dependencies -> Eithers.bind (ExtractCore.requireField "definitions" (ExtractCore.decodeList definition) fieldMap cx) (\field_definitions -> Right (Packaging.Module {- Packaging.moduleName = field_name,- Packaging.moduleMetadata = field_metadata,- Packaging.moduleDependencies = field_dependencies,- Packaging.moduleDefinitions = field_definitions}))))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.packaging.Module")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.packaging.ModuleDependency-moduleDependency :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Packaging.ModuleDependency-moduleDependency cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "module" moduleName fieldMap cx) (\field_module -> Eithers.bind (ExtractCore.requireField "package" (ExtractCore.decodeMaybe packageName) fieldMap cx) (\field_package -> Right (Packaging.ModuleDependency {- Packaging.moduleDependencyModule = field_module,- Packaging.moduleDependencyPackage = field_package}))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.packaging.ModuleDependency")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.packaging.ModuleName-moduleName :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Packaging.ModuleName-moduleName cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermWrap v0 -> Eithers.map (\b -> Packaging.ModuleName b) ((\raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of- Core.TermLiteral v1 -> case v1 of- Core.LiteralString v2 -> Right v2- _ -> Left (Errors.DecodingError "expected string literal")- _ -> Left (Errors.DecodingError "expected literal")) (ExtractCore.stripWithDecodingError cx raw2)) (Core.wrappedTermBody v0))- _ -> Left (Errors.DecodingError "expected wrapped type")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.packaging.Package-package :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Packaging.Package-package cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "name" packageName fieldMap cx) (\field_name -> Eithers.bind (ExtractCore.requireField "metadata" (ExtractCore.decodeMaybe entityMetadata) fieldMap cx) (\field_metadata -> Eithers.bind (ExtractCore.requireField "dependencies" (ExtractCore.decodeList packageDependency) fieldMap cx) (\field_dependencies -> Eithers.bind (ExtractCore.requireField "modules" (ExtractCore.decodeList module_) fieldMap cx) (\field_modules -> Right (Packaging.Package {- Packaging.packageName = field_name,- Packaging.packageMetadata = field_metadata,- Packaging.packageDependencies = field_dependencies,- Packaging.packageModules = field_modules}))))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.packaging.Package")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.packaging.PackageDependency-packageDependency :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Packaging.PackageDependency-packageDependency cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "name" packageName fieldMap cx) (\field_name -> Eithers.bind (ExtractCore.requireField "version" versionSpecifier fieldMap cx) (\field_version -> Eithers.bind (ExtractCore.requireField "scope" (ExtractCore.decodeMaybe dependencyScope) fieldMap cx) (\field_scope -> Right (Packaging.PackageDependency {- Packaging.packageDependencyName = field_name,- Packaging.packageDependencyVersion = field_version,- Packaging.packageDependencyScope = field_scope})))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.packaging.PackageDependency")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.packaging.PackageName-packageName :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Packaging.PackageName-packageName cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermWrap v0 -> Eithers.map (\b -> Packaging.PackageName b) ((\raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of- Core.TermLiteral v1 -> case v1 of- Core.LiteralString v2 -> Right v2- _ -> Left (Errors.DecodingError "expected string literal")- _ -> Left (Errors.DecodingError "expected literal")) (ExtractCore.stripWithDecodingError cx raw2)) (Core.wrappedTermBody v0))- _ -> Left (Errors.DecodingError "expected wrapped type")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.packaging.PrimitiveDefinition-primitiveDefinition :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Packaging.PrimitiveDefinition-primitiveDefinition cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "name" DecodeCore.name fieldMap cx) (\field_name -> Eithers.bind (ExtractCore.requireField "metadata" (ExtractCore.decodeMaybe entityMetadata) fieldMap cx) (\field_metadata -> Eithers.bind (ExtractCore.requireField "signature" Typing.termSignature fieldMap cx) (\field_signature -> Eithers.bind (ExtractCore.requireField "isPure" (\cx2 -> \raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of- Core.TermLiteral v1 -> case v1 of- Core.LiteralBoolean v2 -> Right v2- _ -> Left (Errors.DecodingError "expected boolean literal")- _ -> Left (Errors.DecodingError "expected literal")) (ExtractCore.stripWithDecodingError cx2 raw2)) fieldMap cx) (\field_isPure -> Eithers.bind (ExtractCore.requireField "isTotal" (\cx2 -> \raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of- Core.TermLiteral v1 -> case v1 of- Core.LiteralBoolean v2 -> Right v2- _ -> Left (Errors.DecodingError "expected boolean literal")- _ -> Left (Errors.DecodingError "expected literal")) (ExtractCore.stripWithDecodingError cx2 raw2)) fieldMap cx) (\field_isTotal -> Eithers.bind (ExtractCore.requireField "defaultImplementation" (ExtractCore.decodeMaybe DecodeCore.term) fieldMap cx) (\field_defaultImplementation -> Right (Packaging.PrimitiveDefinition {- Packaging.primitiveDefinitionName = field_name,- Packaging.primitiveDefinitionMetadata = field_metadata,- Packaging.primitiveDefinitionSignature = field_signature,- Packaging.primitiveDefinitionIsPure = field_isPure,- Packaging.primitiveDefinitionIsTotal = field_isTotal,- Packaging.primitiveDefinitionDefaultImplementation = field_defaultImplementation}))))))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.packaging.PrimitiveDefinition")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.packaging.Provision-provision :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Packaging.Provision-provision cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "name" DecodeCore.name fieldMap cx) (\field_name -> Eithers.bind (ExtractCore.requireField "kind" provisionKind fieldMap cx) (\field_kind -> Eithers.bind (ExtractCore.requireField "statement" (\cx2 -> \raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of- Core.TermLiteral v1 -> case v1 of- Core.LiteralString v2 -> Right v2- _ -> Left (Errors.DecodingError "expected string literal")- _ -> Left (Errors.DecodingError "expected literal")) (ExtractCore.stripWithDecodingError cx2 raw2)) fieldMap cx) (\field_statement -> Right (Packaging.Provision {- Packaging.provisionName = field_name,- Packaging.provisionKind = field_kind,- Packaging.provisionStatement = field_statement})))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.packaging.Provision")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.packaging.ProvisionKind-provisionKind :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Packaging.ProvisionKind-provisionKind cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermInject v0 ->- let field = Core.injectionField v0- fname = Core.fieldName field- fterm = Core.fieldTerm field- variantMap =- Maps.fromList [- (- Core.Name "requirement",- (\input -> Eithers.map (\t -> Packaging.ProvisionKindRequirement) (ExtractCore.decodeUnit cx input))),- (- Core.Name "recommendation",- (\input -> Eithers.map (\t -> Packaging.ProvisionKindRecommendation) (ExtractCore.decodeUnit cx input)))]- in (Optionals.match (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [- "no such field ",- (Core.unName fname),- " in union"]))) (\f -> f fterm))- _ -> Left (Errors.DecodingError "expected union")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.packaging.TermDefinition-termDefinition :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Packaging.TermDefinition-termDefinition cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "name" DecodeCore.name fieldMap cx) (\field_name -> Eithers.bind (ExtractCore.requireField "metadata" (ExtractCore.decodeMaybe entityMetadata) fieldMap cx) (\field_metadata -> Eithers.bind (ExtractCore.requireField "signature" (ExtractCore.decodeMaybe Typing.termSignature) fieldMap cx) (\field_signature -> Eithers.bind (ExtractCore.requireField "body" DecodeCore.term fieldMap cx) (\field_body -> Right (Packaging.TermDefinition {- Packaging.termDefinitionName = field_name,- Packaging.termDefinitionMetadata = field_metadata,- Packaging.termDefinitionSignature = field_signature,- Packaging.termDefinitionBody = field_body}))))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.packaging.TermDefinition")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.packaging.TypeDefinition-typeDefinition :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Packaging.TypeDefinition-typeDefinition cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "name" DecodeCore.name fieldMap cx) (\field_name -> Eithers.bind (ExtractCore.requireField "metadata" (ExtractCore.decodeMaybe entityMetadata) fieldMap cx) (\field_metadata -> Eithers.bind (ExtractCore.requireField "body" DecodeCore.typeScheme fieldMap cx) (\field_body -> Right (Packaging.TypeDefinition {- Packaging.typeDefinitionName = field_name,- Packaging.typeDefinitionMetadata = field_metadata,- Packaging.typeDefinitionBody = field_body})))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.packaging.TypeDefinition")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.packaging.Version-version :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Packaging.Version-version cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermWrap v0 -> Eithers.map (\b -> Packaging.Version b) ((\raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of- Core.TermLiteral v1 -> case v1 of- Core.LiteralString v2 -> Right v2- _ -> Left (Errors.DecodingError "expected string literal")- _ -> Left (Errors.DecodingError "expected literal")) (ExtractCore.stripWithDecodingError cx raw2)) (Core.wrappedTermBody v0))- _ -> Left (Errors.DecodingError "expected wrapped type")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.packaging.VersionRange-versionRange :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Packaging.VersionRange-versionRange cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "lowerInclusive" (ExtractCore.decodeMaybe version) fieldMap cx) (\field_lowerInclusive -> Eithers.bind (ExtractCore.requireField "upperExclusive" (ExtractCore.decodeMaybe version) fieldMap cx) (\field_upperExclusive -> Right (Packaging.VersionRange {- Packaging.versionRangeLowerInclusive = field_lowerInclusive,- Packaging.versionRangeUpperExclusive = field_upperExclusive}))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.packaging.VersionRange")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.packaging.VersionSpecifier-versionSpecifier :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Packaging.VersionSpecifier-versionSpecifier cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermInject v0 ->- let field = Core.injectionField v0- fname = Core.fieldName field- fterm = Core.fieldTerm field- variantMap =- Maps.fromList [- (Core.Name "any", (\input -> Eithers.map (\t -> Packaging.VersionSpecifierAny) (ExtractCore.decodeUnit cx input))),- (Core.Name "exact", (\input -> Eithers.map (\t -> Packaging.VersionSpecifierExact t) (version cx input))),- (Core.Name "atLeast", (\input -> Eithers.map (\t -> Packaging.VersionSpecifierAtLeast t) (version cx input))),- (Core.Name "range", (\input -> Eithers.map (\t -> Packaging.VersionSpecifierRange t) (versionRange cx input)))]- in (Optionals.match (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [- "no such field ",- (Core.unName fname),- " in union"]))) (\f -> f fterm))- _ -> Left (Errors.DecodingError "expected union")) (ExtractCore.stripWithDecodingError cx raw)
@@ -1,78 +0,0 @@--- Note: this is an automatically generated file. Do not edit.---- | Term decoders for hydra.parsing--module Hydra.Decode.Parsing where--import qualified Hydra.Core as Core-import qualified Hydra.Decode.Core as DecodeCore-import qualified Hydra.Errors as Errors-import qualified Hydra.Extract.Core as ExtractCore-import qualified Hydra.Graph as Graph-import qualified Hydra.Lexical as Lexical-import qualified Hydra.Overlay.Haskell.Lib.Eithers as Eithers-import qualified Hydra.Overlay.Haskell.Lib.Maps as Maps-import qualified Hydra.Overlay.Haskell.Lib.Optionals as Optionals-import qualified Hydra.Overlay.Haskell.Lib.Strings as Strings-import qualified Hydra.Parsing as Parsing-import qualified Hydra.Rewriting as Rewriting-import qualified Hydra.Util as Util-import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)-import qualified Data.Scientific as Sci-import Data.Void---- | Decoder for hydra.parsing.ParseError-parseError :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Parsing.ParseError-parseError cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "message" (\cx2 -> \raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of- Core.TermLiteral v1 -> case v1 of- Core.LiteralString v2 -> Right v2- _ -> Left (Errors.DecodingError "expected string literal")- _ -> Left (Errors.DecodingError "expected literal")) (ExtractCore.stripWithDecodingError cx2 raw2)) fieldMap cx) (\field_message -> Eithers.bind (ExtractCore.requireField "remainder" (ExtractCore.decodeList (\cx2 -> \raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of- Core.TermLiteral v1 -> case v1 of- Core.LiteralInteger v2 -> case v2 of- Core.IntegerValueInt32 v3 -> Right v3- _ -> Left (Errors.DecodingError "expected int32 value")- _ -> Left (Errors.DecodingError "expected int32 literal")- _ -> Left (Errors.DecodingError "expected literal")) (ExtractCore.stripWithDecodingError cx2 raw2))) fieldMap cx) (\field_remainder -> Right (Parsing.ParseError {- Parsing.parseErrorMessage = field_message,- Parsing.parseErrorRemainder = field_remainder}))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.parsing.ParseError")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.parsing.ParseResult-parseResult :: (Graph.Graph -> Core.Term -> Either Errors.DecodingError a) -> Graph.Graph -> Core.Term -> Either Errors.DecodingError (Parsing.ParseResult a)-parseResult a cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermInject v0 ->- let field = Core.injectionField v0- fname = Core.fieldName field- fterm = Core.fieldTerm field- variantMap =- Maps.fromList [- (Core.Name "success", (\input -> Eithers.map (\t -> Parsing.ParseResultSuccess t) (parseSuccess a cx input))),- (Core.Name "failure", (\input -> Eithers.map (\t -> Parsing.ParseResultFailure t) (parseError cx input)))]- in (Optionals.match (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [- "no such field ",- (Core.unName fname),- " in union"]))) (\f -> f fterm))- _ -> Left (Errors.DecodingError "expected union")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.parsing.ParseSuccess-parseSuccess :: (Graph.Graph -> Core.Term -> Either Errors.DecodingError a) -> Graph.Graph -> Core.Term -> Either Errors.DecodingError (Parsing.ParseSuccess a)-parseSuccess a cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "value" a fieldMap cx) (\field_value -> Eithers.bind (ExtractCore.requireField "remainder" (ExtractCore.decodeList (\cx2 -> \raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of- Core.TermLiteral v1 -> case v1 of- Core.LiteralInteger v2 -> case v2 of- Core.IntegerValueInt32 v3 -> Right v3- _ -> Left (Errors.DecodingError "expected int32 value")- _ -> Left (Errors.DecodingError "expected int32 literal")- _ -> Left (Errors.DecodingError "expected literal")) (ExtractCore.stripWithDecodingError cx2 raw2))) fieldMap cx) (\field_remainder -> Right (Parsing.ParseSuccess {- Parsing.parseSuccessValue = field_value,- Parsing.parseSuccessRemainder = field_remainder}))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.parsing.ParseSuccess")) (ExtractCore.stripWithDecodingError cx raw)
@@ -1,477 +0,0 @@--- Note: this is an automatically generated file. Do not edit.---- | Term decoders for hydra.paths--module Hydra.Decode.Paths where--import qualified Hydra.Core as Core-import qualified Hydra.Decode.Core as DecodeCore-import qualified Hydra.Errors as Errors-import qualified Hydra.Extract.Core as ExtractCore-import qualified Hydra.Graph as Graph-import qualified Hydra.Lexical as Lexical-import qualified Hydra.Overlay.Haskell.Lib.Eithers as Eithers-import qualified Hydra.Overlay.Haskell.Lib.Maps as Maps-import qualified Hydra.Overlay.Haskell.Lib.Optionals as Optionals-import qualified Hydra.Overlay.Haskell.Lib.Strings as Strings-import qualified Hydra.Paths as Paths-import qualified Hydra.Rewriting as Rewriting-import qualified Hydra.Util as Util-import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)-import qualified Data.Scientific as Sci-import Data.Void---- | Decoder for hydra.paths.LambdaVariableReference-lambdaVariableReference :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Paths.LambdaVariableReference-lambdaVariableReference cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "variable" DecodeCore.name fieldMap cx) (\field_variable -> Eithers.bind (ExtractCore.requireField "boundByNode" termNodeId fieldMap cx) (\field_boundByNode -> Eithers.bind (ExtractCore.requireField "type" DecodeCore.type_ fieldMap cx) (\field_type -> Right (Paths.LambdaVariableReference {- Paths.lambdaVariableReferenceVariable = field_variable,- Paths.lambdaVariableReferenceBoundByNode = field_boundByNode,- Paths.lambdaVariableReferenceType = field_type})))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.paths.LambdaVariableReference")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.paths.LetVariableReference-letVariableReference :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Paths.LetVariableReference-letVariableReference cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "variable" DecodeCore.name fieldMap cx) (\field_variable -> Eithers.bind (ExtractCore.requireField "bindingNode" termNodeId fieldMap cx) (\field_bindingNode -> Eithers.bind (ExtractCore.requireField "type" DecodeCore.type_ fieldMap cx) (\field_type -> Right (Paths.LetVariableReference {- Paths.letVariableReferenceVariable = field_variable,- Paths.letVariableReferenceBindingNode = field_bindingNode,- Paths.letVariableReferenceType = field_type})))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.paths.LetVariableReference")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.paths.NominalTypeReference-nominalTypeReference :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Paths.NominalTypeReference-nominalTypeReference cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "name" DecodeCore.name fieldMap cx) (\field_name -> Right (Paths.NominalTypeReference {- Paths.nominalTypeReferenceName = field_name})))- _ -> Left (Errors.DecodingError "expected a record of type hydra.paths.NominalTypeReference")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.paths.PrimitiveReference-primitiveReference :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Paths.PrimitiveReference-primitiveReference cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "name" DecodeCore.name fieldMap cx) (\field_name -> Eithers.bind (ExtractCore.requireField "type" DecodeCore.type_ fieldMap cx) (\field_type -> Right (Paths.PrimitiveReference {- Paths.primitiveReferenceName = field_name,- Paths.primitiveReferenceType = field_type}))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.paths.PrimitiveReference")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.paths.SubtermLink-subtermLink :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Paths.SubtermLink-subtermLink cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "step" subtermStep fieldMap cx) (\field_step -> Eithers.bind (ExtractCore.requireField "child" termNode fieldMap cx) (\field_child -> Right (Paths.SubtermLink {- Paths.subtermLinkStep = field_step,- Paths.subtermLinkChild = field_child}))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.paths.SubtermLink")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.paths.SubtermPath-subtermPath :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Paths.SubtermPath-subtermPath cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermWrap v0 -> Eithers.map (\b -> Paths.SubtermPath b) (ExtractCore.decodeList subtermStep cx (Core.wrappedTermBody v0))- _ -> Left (Errors.DecodingError "expected wrapped type")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.paths.SubtermStep-subtermStep :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Paths.SubtermStep-subtermStep cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermInject v0 ->- let field = Core.injectionField v0- fname = Core.fieldName field- fterm = Core.fieldTerm field- variantMap =- Maps.fromList [- (- Core.Name "annotatedAnnotation",- (\input -> Eithers.map (\t -> Paths.SubtermStepAnnotatedAnnotation) (ExtractCore.decodeUnit cx input))),- (- Core.Name "annotatedBody",- (\input -> Eithers.map (\t -> Paths.SubtermStepAnnotatedBody) (ExtractCore.decodeUnit cx input))),- (- Core.Name "applicationArgument",- (\input -> Eithers.map (\t -> Paths.SubtermStepApplicationArgument) (ExtractCore.decodeUnit cx input))),- (- Core.Name "applicationFunction",- (\input -> Eithers.map (\t -> Paths.SubtermStepApplicationFunction) (ExtractCore.decodeUnit cx input))),- (Core.Name "casesCase", (\input -> Eithers.map (\t -> Paths.SubtermStepCasesCase t) (DecodeCore.name cx input))),- (- Core.Name "casesDefault",- (\input -> Eithers.map (\t -> Paths.SubtermStepCasesDefault) (ExtractCore.decodeUnit cx input))),- (Core.Name "eitherLeft", (\input -> Eithers.map (\t -> Paths.SubtermStepEitherLeft) (ExtractCore.decodeUnit cx input))),- (Core.Name "eitherRight", (\input -> Eithers.map (\t -> Paths.SubtermStepEitherRight) (ExtractCore.decodeUnit cx input))),- (Core.Name "injectField", (\input -> Eithers.map (\t -> Paths.SubtermStepInjectField t) (DecodeCore.name cx input))),- (Core.Name "lambdaBody", (\input -> Eithers.map (\t -> Paths.SubtermStepLambdaBody) (ExtractCore.decodeUnit cx input))),- (Core.Name "letBinding", (\input -> Eithers.map (\t -> Paths.SubtermStepLetBinding t) (DecodeCore.name cx input))),- (Core.Name "letBody", (\input -> Eithers.map (\t -> Paths.SubtermStepLetBody) (ExtractCore.decodeUnit cx input))),- (- Core.Name "listElement",- (\input -> Eithers.map (\t -> Paths.SubtermStepListElement t) (Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of- Core.TermLiteral v1 -> case v1 of- Core.LiteralInteger v2 -> case v2 of- Core.IntegerValueInt32 v3 -> Right v3- _ -> Left (Errors.DecodingError "expected int32 value")- _ -> Left (Errors.DecodingError "expected int32 literal")- _ -> Left (Errors.DecodingError "expected literal")) (ExtractCore.stripWithDecodingError cx input)))),- (- Core.Name "mapEntry",- (\input -> Eithers.map (\t -> Paths.SubtermStepMapEntry t) (Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of- Core.TermLiteral v1 -> case v1 of- Core.LiteralInteger v2 -> case v2 of- Core.IntegerValueInt32 v3 -> Right v3- _ -> Left (Errors.DecodingError "expected int32 value")- _ -> Left (Errors.DecodingError "expected int32 literal")- _ -> Left (Errors.DecodingError "expected literal")) (ExtractCore.stripWithDecodingError cx input)))),- (- Core.Name "optionalGiven",- (\input -> Eithers.map (\t -> Paths.SubtermStepOptionalGiven) (ExtractCore.decodeUnit cx input))),- (Core.Name "pairFirst", (\input -> Eithers.map (\t -> Paths.SubtermStepPairFirst) (ExtractCore.decodeUnit cx input))),- (Core.Name "pairSecond", (\input -> Eithers.map (\t -> Paths.SubtermStepPairSecond) (ExtractCore.decodeUnit cx input))),- (Core.Name "recordField", (\input -> Eithers.map (\t -> Paths.SubtermStepRecordField t) (DecodeCore.name cx input))),- (- Core.Name "setElement",- (\input -> Eithers.map (\t -> Paths.SubtermStepSetElement t) (Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of- Core.TermLiteral v1 -> case v1 of- Core.LiteralInteger v2 -> case v2 of- Core.IntegerValueInt32 v3 -> Right v3- _ -> Left (Errors.DecodingError "expected int32 value")- _ -> Left (Errors.DecodingError "expected int32 literal")- _ -> Left (Errors.DecodingError "expected literal")) (ExtractCore.stripWithDecodingError cx input)))),- (- Core.Name "typeApplicationBody",- (\input -> Eithers.map (\t -> Paths.SubtermStepTypeApplicationBody) (ExtractCore.decodeUnit cx input))),- (- Core.Name "typeLambdaBody",- (\input -> Eithers.map (\t -> Paths.SubtermStepTypeLambdaBody) (ExtractCore.decodeUnit cx input))),- (Core.Name "wrapBody", (\input -> Eithers.map (\t -> Paths.SubtermStepWrapBody) (ExtractCore.decodeUnit cx input)))]- in (Optionals.match (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [- "no such field ",- (Core.unName fname),- " in union"]))) (\f -> f fterm))- _ -> Left (Errors.DecodingError "expected union")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.paths.SubtypeLink-subtypeLink :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Paths.SubtypeLink-subtypeLink cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "step" subtypeStep fieldMap cx) (\field_step -> Eithers.bind (ExtractCore.requireField "child" typeNode fieldMap cx) (\field_child -> Right (Paths.SubtypeLink {- Paths.subtypeLinkStep = field_step,- Paths.subtypeLinkChild = field_child}))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.paths.SubtypeLink")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.paths.SubtypePath-subtypePath :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Paths.SubtypePath-subtypePath cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermWrap v0 -> Eithers.map (\b -> Paths.SubtypePath b) (ExtractCore.decodeList subtypeStep cx (Core.wrappedTermBody v0))- _ -> Left (Errors.DecodingError "expected wrapped type")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.paths.SubtypeStep-subtypeStep :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Paths.SubtypeStep-subtypeStep cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermInject v0 ->- let field = Core.injectionField v0- fname = Core.fieldName field- fterm = Core.fieldTerm field- variantMap =- Maps.fromList [- (- Core.Name "annotatedBody",- (\input -> Eithers.map (\t -> Paths.SubtypeStepAnnotatedBody) (ExtractCore.decodeUnit cx input))),- (- Core.Name "applicationArgument",- (\input -> Eithers.map (\t -> Paths.SubtypeStepApplicationArgument) (ExtractCore.decodeUnit cx input))),- (- Core.Name "applicationFunction",- (\input -> Eithers.map (\t -> Paths.SubtypeStepApplicationFunction) (ExtractCore.decodeUnit cx input))),- (Core.Name "effectValue", (\input -> Eithers.map (\t -> Paths.SubtypeStepEffectValue) (ExtractCore.decodeUnit cx input))),- (Core.Name "eitherLeft", (\input -> Eithers.map (\t -> Paths.SubtypeStepEitherLeft) (ExtractCore.decodeUnit cx input))),- (Core.Name "eitherRight", (\input -> Eithers.map (\t -> Paths.SubtypeStepEitherRight) (ExtractCore.decodeUnit cx input))),- (Core.Name "forallBody", (\input -> Eithers.map (\t -> Paths.SubtypeStepForallBody) (ExtractCore.decodeUnit cx input))),- (- Core.Name "functionCodomain",- (\input -> Eithers.map (\t -> Paths.SubtypeStepFunctionCodomain) (ExtractCore.decodeUnit cx input))),- (- Core.Name "functionDomain",- (\input -> Eithers.map (\t -> Paths.SubtypeStepFunctionDomain) (ExtractCore.decodeUnit cx input))),- (Core.Name "listElement", (\input -> Eithers.map (\t -> Paths.SubtypeStepListElement) (ExtractCore.decodeUnit cx input))),- (Core.Name "mapKeys", (\input -> Eithers.map (\t -> Paths.SubtypeStepMapKeys) (ExtractCore.decodeUnit cx input))),- (Core.Name "mapValues", (\input -> Eithers.map (\t -> Paths.SubtypeStepMapValues) (ExtractCore.decodeUnit cx input))),- (- Core.Name "optionalElement",- (\input -> Eithers.map (\t -> Paths.SubtypeStepOptionalElement) (ExtractCore.decodeUnit cx input))),- (Core.Name "pairFirst", (\input -> Eithers.map (\t -> Paths.SubtypeStepPairFirst) (ExtractCore.decodeUnit cx input))),- (Core.Name "pairSecond", (\input -> Eithers.map (\t -> Paths.SubtypeStepPairSecond) (ExtractCore.decodeUnit cx input))),- (Core.Name "recordField", (\input -> Eithers.map (\t -> Paths.SubtypeStepRecordField t) (DecodeCore.name cx input))),- (Core.Name "setElement", (\input -> Eithers.map (\t -> Paths.SubtypeStepSetElement) (ExtractCore.decodeUnit cx input))),- (Core.Name "unionField", (\input -> Eithers.map (\t -> Paths.SubtypeStepUnionField t) (DecodeCore.name cx input))),- (Core.Name "wrapBody", (\input -> Eithers.map (\t -> Paths.SubtypeStepWrapBody) (ExtractCore.decodeUnit cx input)))]- in (Optionals.match (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [- "no such field ",- (Core.unName fname),- " in union"]))) (\f -> f fterm))- _ -> Left (Errors.DecodingError "expected union")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.paths.TermAttributeLink-termAttributeLink :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Paths.TermAttributeLink-termAttributeLink cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermInject v0 ->- let field = Core.injectionField v0- fname = Core.fieldName field- fterm = Core.fieldTerm field- variantMap =- Maps.fromList [- (- Core.Name "casesTypeName",- (\input -> Eithers.map (\t -> Paths.TermAttributeLinkCasesTypeName t) (DecodeCore.name cx input))),- (- Core.Name "injectTypeName",- (\input -> Eithers.map (\t -> Paths.TermAttributeLinkInjectTypeName t) (DecodeCore.name cx input))),- (- Core.Name "lambdaDomainGiven",- (\input -> Eithers.map (\t -> Paths.TermAttributeLinkLambdaDomainGiven t) (DecodeCore.type_ cx input))),- (- Core.Name "lambdaParameter",- (\input -> Eithers.map (\t -> Paths.TermAttributeLinkLambdaParameter t) (DecodeCore.name cx input))),- (- Core.Name "letBindingTypeSchemeGiven",- (\input -> Eithers.map (\t -> Paths.TermAttributeLinkLetBindingTypeSchemeGiven t) (ExtractCore.decodePair DecodeCore.name DecodeCore.typeScheme cx input))),- (Core.Name "literal", (\input -> Eithers.map (\t -> Paths.TermAttributeLinkLiteral t) (DecodeCore.literal cx input))),- (- Core.Name "projectFieldName",- (\input -> Eithers.map (\t -> Paths.TermAttributeLinkProjectFieldName t) (DecodeCore.name cx input))),- (- Core.Name "projectTypeName",- (\input -> Eithers.map (\t -> Paths.TermAttributeLinkProjectTypeName t) (DecodeCore.name cx input))),- (- Core.Name "recordTypeName",- (\input -> Eithers.map (\t -> Paths.TermAttributeLinkRecordTypeName t) (DecodeCore.name cx input))),- (- Core.Name "typeApplicationType",- (\input -> Eithers.map (\t -> Paths.TermAttributeLinkTypeApplicationType t) (DecodeCore.type_ cx input))),- (- Core.Name "typeLambdaParameter",- (\input -> Eithers.map (\t -> Paths.TermAttributeLinkTypeLambdaParameter t) (DecodeCore.name cx input))),- (- Core.Name "unwrapTypeName",- (\input -> Eithers.map (\t -> Paths.TermAttributeLinkUnwrapTypeName t) (DecodeCore.name cx input))),- (- Core.Name "wrapTypeName",- (\input -> Eithers.map (\t -> Paths.TermAttributeLinkWrapTypeName t) (DecodeCore.name cx input)))]- in (Optionals.match (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [- "no such field ",- (Core.unName fname),- " in union"]))) (\f -> f fterm))- _ -> Left (Errors.DecodingError "expected union")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.paths.TermGraph-termGraph :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Paths.TermGraph-termGraph cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "roots" (ExtractCore.decodeMap DecodeCore.name termNode) fieldMap cx) (\field_roots -> Right (Paths.TermGraph {- Paths.termGraphRoots = field_roots})))- _ -> Left (Errors.DecodingError "expected a record of type hydra.paths.TermGraph")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.paths.TermLink-termLink :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Paths.TermLink-termLink cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermInject v0 ->- let field = Core.injectionField v0- fname = Core.fieldName field- fterm = Core.fieldTerm field- variantMap =- Maps.fromList [- (Core.Name "attribute", (\input -> Eithers.map (\t -> Paths.TermLinkAttribute t) (termAttributeLink cx input))),- (Core.Name "reference", (\input -> Eithers.map (\t -> Paths.TermLinkReference t) (termReferenceLink cx input))),- (Core.Name "subterm", (\input -> Eithers.map (\t -> Paths.TermLinkSubterm t) (subtermLink cx input)))]- in (Optionals.match (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [- "no such field ",- (Core.unName fname),- " in union"]))) (\f -> f fterm))- _ -> Left (Errors.DecodingError "expected union")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.paths.TermNode-termNode :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Paths.TermNode-termNode cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "term" DecodeCore.term fieldMap cx) (\field_term -> Eithers.bind (ExtractCore.requireField "type" DecodeCore.type_ fieldMap cx) (\field_type -> Eithers.bind (ExtractCore.requireField "links" (ExtractCore.decodeList termLink) fieldMap cx) (\field_links -> Right (Paths.TermNode {- Paths.termNodeTerm = field_term,- Paths.termNodeType = field_type,- Paths.termNodeLinks = field_links})))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.paths.TermNode")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.paths.TermNodeId-termNodeId :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Paths.TermNodeId-termNodeId cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "root" DecodeCore.name fieldMap cx) (\field_root -> Eithers.bind (ExtractCore.requireField "path" subtermPath fieldMap cx) (\field_path -> Right (Paths.TermNodeId {- Paths.termNodeIdRoot = field_root,- Paths.termNodeIdPath = field_path}))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.paths.TermNodeId")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.paths.TermReference-termReference :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Paths.TermReference-termReference cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermInject v0 ->- let field = Core.injectionField v0- fname = Core.fieldName field- fterm = Core.fieldTerm field- variantMap =- Maps.fromList [- (Core.Name "lambda", (\input -> Eithers.map (\t -> Paths.TermReferenceLambda t) (lambdaVariableReference cx input))),- (Core.Name "let", (\input -> Eithers.map (\t -> Paths.TermReferenceLet t) (letVariableReference cx input))),- (Core.Name "primitive", (\input -> Eithers.map (\t -> Paths.TermReferencePrimitive t) (primitiveReference cx input)))]- in (Optionals.match (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [- "no such field ",- (Core.unName fname),- " in union"]))) (\f -> f fterm))- _ -> Left (Errors.DecodingError "expected union")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.paths.TermReferenceLink-termReferenceLink :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Paths.TermReferenceLink-termReferenceLink cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "step" subtermStep fieldMap cx) (\field_step -> Eithers.bind (ExtractCore.requireField "target" termReference fieldMap cx) (\field_target -> Right (Paths.TermReferenceLink {- Paths.termReferenceLinkStep = field_step,- Paths.termReferenceLinkTarget = field_target}))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.paths.TermReferenceLink")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.paths.TypeAttributeLink-typeAttributeLink :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Paths.TypeAttributeLink-typeAttributeLink cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermInject v0 ->- let field = Core.injectionField v0- fname = Core.fieldName field- fterm = Core.fieldTerm field- variantMap =- Maps.fromList [- (- Core.Name "annotatedAnnotation",- (\input -> Eithers.map (\t -> Paths.TypeAttributeLinkAnnotatedAnnotation t) (DecodeCore.term cx input))),- (- Core.Name "forallParameter",- (\input -> Eithers.map (\t -> Paths.TypeAttributeLinkForallParameter t) (DecodeCore.name cx input))),- (Core.Name "literal", (\input -> Eithers.map (\t -> Paths.TypeAttributeLinkLiteral t) (DecodeCore.literalType cx input)))]- in (Optionals.match (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [- "no such field ",- (Core.unName fname),- " in union"]))) (\f -> f fterm))- _ -> Left (Errors.DecodingError "expected union")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.paths.TypeGraph-typeGraph :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Paths.TypeGraph-typeGraph cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "roots" (ExtractCore.decodeMap DecodeCore.name typeNode) fieldMap cx) (\field_roots -> Right (Paths.TypeGraph {- Paths.typeGraphRoots = field_roots})))- _ -> Left (Errors.DecodingError "expected a record of type hydra.paths.TypeGraph")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.paths.TypeLink-typeLink :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Paths.TypeLink-typeLink cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermInject v0 ->- let field = Core.injectionField v0- fname = Core.fieldName field- fterm = Core.fieldTerm field- variantMap =- Maps.fromList [- (Core.Name "attribute", (\input -> Eithers.map (\t -> Paths.TypeLinkAttribute t) (typeAttributeLink cx input))),- (Core.Name "reference", (\input -> Eithers.map (\t -> Paths.TypeLinkReference t) (typeReferenceLink cx input))),- (Core.Name "subtype", (\input -> Eithers.map (\t -> Paths.TypeLinkSubtype t) (subtypeLink cx input)))]- in (Optionals.match (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [- "no such field ",- (Core.unName fname),- " in union"]))) (\f -> f fterm))- _ -> Left (Errors.DecodingError "expected union")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.paths.TypeNode-typeNode :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Paths.TypeNode-typeNode cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "type" DecodeCore.type_ fieldMap cx) (\field_type -> Eithers.bind (ExtractCore.requireField "links" (ExtractCore.decodeList typeLink) fieldMap cx) (\field_links -> Right (Paths.TypeNode {- Paths.typeNodeType = field_type,- Paths.typeNodeLinks = field_links}))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.paths.TypeNode")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.paths.TypeNodeId-typeNodeId :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Paths.TypeNodeId-typeNodeId cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "root" DecodeCore.name fieldMap cx) (\field_root -> Eithers.bind (ExtractCore.requireField "path" subtypePath fieldMap cx) (\field_path -> Right (Paths.TypeNodeId {- Paths.typeNodeIdRoot = field_root,- Paths.typeNodeIdPath = field_path}))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.paths.TypeNodeId")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.paths.TypeReference-typeReference :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Paths.TypeReference-typeReference cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermInject v0 ->- let field = Core.injectionField v0- fname = Core.fieldName field- fterm = Core.fieldTerm field- variantMap =- Maps.fromList [- (Core.Name "nominal", (\input -> Eithers.map (\t -> Paths.TypeReferenceNominal t) (nominalTypeReference cx input))),- (Core.Name "variable", (\input -> Eithers.map (\t -> Paths.TypeReferenceVariable t) (typeVariableReference cx input)))]- in (Optionals.match (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [- "no such field ",- (Core.unName fname),- " in union"]))) (\f -> f fterm))- _ -> Left (Errors.DecodingError "expected union")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.paths.TypeReferenceLink-typeReferenceLink :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Paths.TypeReferenceLink-typeReferenceLink cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "step" subtypeStep fieldMap cx) (\field_step -> Eithers.bind (ExtractCore.requireField "target" typeReference fieldMap cx) (\field_target -> Right (Paths.TypeReferenceLink {- Paths.typeReferenceLinkStep = field_step,- Paths.typeReferenceLinkTarget = field_target}))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.paths.TypeReferenceLink")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.paths.TypeVariableReference-typeVariableReference :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Paths.TypeVariableReference-typeVariableReference cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "variable" DecodeCore.name fieldMap cx) (\field_variable -> Eithers.bind (ExtractCore.requireField "boundByNode" typeNodeId fieldMap cx) (\field_boundByNode -> Right (Paths.TypeVariableReference {- Paths.typeVariableReferenceVariable = field_variable,- Paths.typeVariableReferenceBoundByNode = field_boundByNode}))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.paths.TypeVariableReference")) (ExtractCore.stripWithDecodingError cx raw)
@@ -1,290 +0,0 @@--- Note: this is an automatically generated file. Do not edit.---- | Term decoders for hydra.query--module Hydra.Decode.Query where--import qualified Hydra.Core as Core-import qualified Hydra.Decode.Core as DecodeCore-import qualified Hydra.Errors as Errors-import qualified Hydra.Extract.Core as ExtractCore-import qualified Hydra.Graph as Graph-import qualified Hydra.Lexical as Lexical-import qualified Hydra.Overlay.Haskell.Lib.Eithers as Eithers-import qualified Hydra.Overlay.Haskell.Lib.Maps as Maps-import qualified Hydra.Overlay.Haskell.Lib.Optionals as Optionals-import qualified Hydra.Overlay.Haskell.Lib.Strings as Strings-import qualified Hydra.Query as Query-import qualified Hydra.Rewriting as Rewriting-import qualified Hydra.Util as Util-import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)-import qualified Data.Scientific as Sci-import Data.Void---- | Decoder for hydra.query.ComparisonConstraint-comparisonConstraint :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Query.ComparisonConstraint-comparisonConstraint cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermInject v0 ->- let field = Core.injectionField v0- fname = Core.fieldName field- fterm = Core.fieldTerm field- variantMap =- Maps.fromList [- (Core.Name "equal", (\input -> Eithers.map (\t -> Query.ComparisonConstraintEqual) (ExtractCore.decodeUnit cx input))),- (- Core.Name "notEqual",- (\input -> Eithers.map (\t -> Query.ComparisonConstraintNotEqual) (ExtractCore.decodeUnit cx input))),- (- Core.Name "lessThan",- (\input -> Eithers.map (\t -> Query.ComparisonConstraintLessThan) (ExtractCore.decodeUnit cx input))),- (- Core.Name "greaterThan",- (\input -> Eithers.map (\t -> Query.ComparisonConstraintGreaterThan) (ExtractCore.decodeUnit cx input))),- (- Core.Name "lessThanOrEqual",- (\input -> Eithers.map (\t -> Query.ComparisonConstraintLessThanOrEqual) (ExtractCore.decodeUnit cx input))),- (- Core.Name "greaterThanOrEqual",- (\input -> Eithers.map (\t -> Query.ComparisonConstraintGreaterThanOrEqual) (ExtractCore.decodeUnit cx input)))]- in (Optionals.match (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [- "no such field ",- (Core.unName fname),- " in union"]))) (\f -> f fterm))- _ -> Left (Errors.DecodingError "expected union")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.query.Edge-edge :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Query.Edge-edge cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "type" DecodeCore.name fieldMap cx) (\field_type -> Eithers.bind (ExtractCore.requireField "out" (ExtractCore.decodeMaybe DecodeCore.name) fieldMap cx) (\field_out -> Eithers.bind (ExtractCore.requireField "in" (ExtractCore.decodeMaybe DecodeCore.name) fieldMap cx) (\field_in -> Right (Query.Edge {- Query.edgeType = field_type,- Query.edgeOut = field_out,- Query.edgeIn = field_in})))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.query.Edge")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.query.GraphPattern-graphPattern :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Query.GraphPattern-graphPattern cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "graph" DecodeCore.name fieldMap cx) (\field_graph -> Eithers.bind (ExtractCore.requireField "patterns" (ExtractCore.decodeList pattern) fieldMap cx) (\field_patterns -> Right (Query.GraphPattern {- Query.graphPatternGraph = field_graph,- Query.graphPatternPatterns = field_patterns}))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.query.GraphPattern")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.query.Node-node :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Query.Node-node cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermInject v0 ->- let field = Core.injectionField v0- fname = Core.fieldName field- fterm = Core.fieldTerm field- variantMap =- Maps.fromList [- (Core.Name "term", (\input -> Eithers.map (\t -> Query.NodeTerm t) (DecodeCore.term cx input))),- (Core.Name "variable", (\input -> Eithers.map (\t -> Query.NodeVariable t) (variable cx input))),- (Core.Name "wildcard", (\input -> Eithers.map (\t -> Query.NodeWildcard) (ExtractCore.decodeUnit cx input)))]- in (Optionals.match (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [- "no such field ",- (Core.unName fname),- " in union"]))) (\f -> f fterm))- _ -> Left (Errors.DecodingError "expected union")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.query.Path-path :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Query.Path-path cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermInject v0 ->- let field = Core.injectionField v0- fname = Core.fieldName field- fterm = Core.fieldTerm field- variantMap =- Maps.fromList [- (Core.Name "step", (\input -> Eithers.map (\t -> Query.PathStep t) (step cx input))),- (Core.Name "regex", (\input -> Eithers.map (\t -> Query.PathRegex t) (regexSequence cx input))),- (Core.Name "inverse", (\input -> Eithers.map (\t -> Query.PathInverse t) (path cx input)))]- in (Optionals.match (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [- "no such field ",- (Core.unName fname),- " in union"]))) (\f -> f fterm))- _ -> Left (Errors.DecodingError "expected union")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.query.PathEquation-pathEquation :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Query.PathEquation-pathEquation cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "left" path fieldMap cx) (\field_left -> Eithers.bind (ExtractCore.requireField "right" path fieldMap cx) (\field_right -> Right (Query.PathEquation {- Query.pathEquationLeft = field_left,- Query.pathEquationRight = field_right}))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.query.PathEquation")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.query.Pattern-pattern :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Query.Pattern-pattern cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermInject v0 ->- let field = Core.injectionField v0- fname = Core.fieldName field- fterm = Core.fieldTerm field- variantMap =- Maps.fromList [- (Core.Name "triple", (\input -> Eithers.map (\t -> Query.PatternTriple t) (triplePattern cx input))),- (Core.Name "negation", (\input -> Eithers.map (\t -> Query.PatternNegation t) (pattern cx input))),- (- Core.Name "conjunction",- (\input -> Eithers.map (\t -> Query.PatternConjunction t) (ExtractCore.decodeList pattern cx input))),- (- Core.Name "disjunction",- (\input -> Eithers.map (\t -> Query.PatternDisjunction t) (ExtractCore.decodeList pattern cx input))),- (Core.Name "graph", (\input -> Eithers.map (\t -> Query.PatternGraph t) (graphPattern cx input)))]- in (Optionals.match (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [- "no such field ",- (Core.unName fname),- " in union"]))) (\f -> f fterm))- _ -> Left (Errors.DecodingError "expected union")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.query.PatternImplication-patternImplication :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Query.PatternImplication-patternImplication cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "antecedent" pattern fieldMap cx) (\field_antecedent -> Eithers.bind (ExtractCore.requireField "consequent" pattern fieldMap cx) (\field_consequent -> Right (Query.PatternImplication {- Query.patternImplicationAntecedent = field_antecedent,- Query.patternImplicationConsequent = field_consequent}))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.query.PatternImplication")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.query.Query-query :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Query.Query-query cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "variables" (ExtractCore.decodeList variable) fieldMap cx) (\field_variables -> Eithers.bind (ExtractCore.requireField "patterns" (ExtractCore.decodeList pattern) fieldMap cx) (\field_patterns -> Right (Query.Query {- Query.queryVariables = field_variables,- Query.queryPatterns = field_patterns}))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.query.Query")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.query.Range-range :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Query.Range-range cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "min" (\cx2 -> \raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of- Core.TermLiteral v1 -> case v1 of- Core.LiteralInteger v2 -> case v2 of- Core.IntegerValueInt32 v3 -> Right v3- _ -> Left (Errors.DecodingError "expected int32 value")- _ -> Left (Errors.DecodingError "expected int32 literal")- _ -> Left (Errors.DecodingError "expected literal")) (ExtractCore.stripWithDecodingError cx2 raw2)) fieldMap cx) (\field_min -> Eithers.bind (ExtractCore.requireField "max" (\cx2 -> \raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of- Core.TermLiteral v1 -> case v1 of- Core.LiteralInteger v2 -> case v2 of- Core.IntegerValueInt32 v3 -> Right v3- _ -> Left (Errors.DecodingError "expected int32 value")- _ -> Left (Errors.DecodingError "expected int32 literal")- _ -> Left (Errors.DecodingError "expected literal")) (ExtractCore.stripWithDecodingError cx2 raw2)) fieldMap cx) (\field_max -> Right (Query.Range {- Query.rangeMin = field_min,- Query.rangeMax = field_max}))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.query.Range")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.query.RegexQuantifier-regexQuantifier :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Query.RegexQuantifier-regexQuantifier cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermInject v0 ->- let field = Core.injectionField v0- fname = Core.fieldName field- fterm = Core.fieldTerm field- variantMap =- Maps.fromList [- (Core.Name "one", (\input -> Eithers.map (\t -> Query.RegexQuantifierOne) (ExtractCore.decodeUnit cx input))),- (Core.Name "zeroOrOne", (\input -> Eithers.map (\t -> Query.RegexQuantifierZeroOrOne) (ExtractCore.decodeUnit cx input))),- (- Core.Name "zeroOrMore",- (\input -> Eithers.map (\t -> Query.RegexQuantifierZeroOrMore) (ExtractCore.decodeUnit cx input))),- (Core.Name "oneOrMore", (\input -> Eithers.map (\t -> Query.RegexQuantifierOneOrMore) (ExtractCore.decodeUnit cx input))),- (- Core.Name "exactly",- (\input -> Eithers.map (\t -> Query.RegexQuantifierExactly t) (Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of- Core.TermLiteral v1 -> case v1 of- Core.LiteralInteger v2 -> case v2 of- Core.IntegerValueInt32 v3 -> Right v3- _ -> Left (Errors.DecodingError "expected int32 value")- _ -> Left (Errors.DecodingError "expected int32 literal")- _ -> Left (Errors.DecodingError "expected literal")) (ExtractCore.stripWithDecodingError cx input)))),- (- Core.Name "atLeast",- (\input -> Eithers.map (\t -> Query.RegexQuantifierAtLeast t) (Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of- Core.TermLiteral v1 -> case v1 of- Core.LiteralInteger v2 -> case v2 of- Core.IntegerValueInt32 v3 -> Right v3- _ -> Left (Errors.DecodingError "expected int32 value")- _ -> Left (Errors.DecodingError "expected int32 literal")- _ -> Left (Errors.DecodingError "expected literal")) (ExtractCore.stripWithDecodingError cx input)))),- (Core.Name "range", (\input -> Eithers.map (\t -> Query.RegexQuantifierRange t) (range cx input)))]- in (Optionals.match (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [- "no such field ",- (Core.unName fname),- " in union"]))) (\f -> f fterm))- _ -> Left (Errors.DecodingError "expected union")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.query.RegexSequence-regexSequence :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Query.RegexSequence-regexSequence cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "path" path fieldMap cx) (\field_path -> Eithers.bind (ExtractCore.requireField "quantifier" regexQuantifier fieldMap cx) (\field_quantifier -> Right (Query.RegexSequence {- Query.regexSequencePath = field_path,- Query.regexSequenceQuantifier = field_quantifier}))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.query.RegexSequence")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.query.Step-step :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Query.Step-step cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermInject v0 ->- let field = Core.injectionField v0- fname = Core.fieldName field- fterm = Core.fieldTerm field- variantMap =- Maps.fromList [- (Core.Name "edge", (\input -> Eithers.map (\t -> Query.StepEdge t) (edge cx input))),- (Core.Name "project", (\input -> Eithers.map (\t -> Query.StepProject t) (DecodeCore.projection cx input))),- (Core.Name "compare", (\input -> Eithers.map (\t -> Query.StepCompare t) (comparisonConstraint cx input)))]- in (Optionals.match (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [- "no such field ",- (Core.unName fname),- " in union"]))) (\f -> f fterm))- _ -> Left (Errors.DecodingError "expected union")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.query.TriplePattern-triplePattern :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Query.TriplePattern-triplePattern cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "subject" node fieldMap cx) (\field_subject -> Eithers.bind (ExtractCore.requireField "predicate" path fieldMap cx) (\field_predicate -> Eithers.bind (ExtractCore.requireField "object" node fieldMap cx) (\field_object -> Right (Query.TriplePattern {- Query.triplePatternSubject = field_subject,- Query.triplePatternPredicate = field_predicate,- Query.triplePatternObject = field_object})))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.query.TriplePattern")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.query.Variable-variable :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Query.Variable-variable cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermWrap v0 -> Eithers.map (\b -> Query.Variable b) ((\raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of- Core.TermLiteral v1 -> case v1 of- Core.LiteralString v2 -> Right v2- _ -> Left (Errors.DecodingError "expected string literal")- _ -> Left (Errors.DecodingError "expected literal")) (ExtractCore.stripWithDecodingError cx raw2)) (Core.wrappedTermBody v0))- _ -> Left (Errors.DecodingError "expected wrapped type")) (ExtractCore.stripWithDecodingError cx raw)
@@ -1,201 +0,0 @@--- Note: this is an automatically generated file. Do not edit.---- | Term decoders for hydra.regex--module Hydra.Decode.Regex where--import qualified Hydra.Core as Core-import qualified Hydra.Decode.Core as DecodeCore-import qualified Hydra.Errors as Errors-import qualified Hydra.Extract.Core as ExtractCore-import qualified Hydra.Graph as Graph-import qualified Hydra.Lexical as Lexical-import qualified Hydra.Overlay.Haskell.Lib.Eithers as Eithers-import qualified Hydra.Overlay.Haskell.Lib.Maps as Maps-import qualified Hydra.Overlay.Haskell.Lib.Optionals as Optionals-import qualified Hydra.Overlay.Haskell.Lib.Strings as Strings-import qualified Hydra.Regex as Regex-import qualified Hydra.Rewriting as Rewriting-import qualified Hydra.Util as Util-import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)-import qualified Data.Scientific as Sci-import Data.Void---- | Decoder for hydra.regex.Alternation-alternation :: Graph.Graph -> Core.Term -> Either Errors.DecodingError [Regex.RegexSequence]-alternation = ExtractCore.decodeList regexSequence---- | Decoder for hydra.regex.Atom-atom :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Regex.Atom-atom cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermInject v0 ->- let field = Core.injectionField v0- fname = Core.fieldName field- fterm = Core.fieldTerm field- variantMap =- Maps.fromList [- (- Core.Name "literal",- (\input -> Eithers.map (\t -> Regex.AtomLiteral t) (Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of- Core.TermLiteral v1 -> case v1 of- Core.LiteralInteger v2 -> case v2 of- Core.IntegerValueInt32 v3 -> Right v3- _ -> Left (Errors.DecodingError "expected int32 value")- _ -> Left (Errors.DecodingError "expected int32 literal")- _ -> Left (Errors.DecodingError "expected literal")) (ExtractCore.stripWithDecodingError cx input)))),- (Core.Name "any", (\input -> Eithers.map (\t -> Regex.AtomAny) (ExtractCore.decodeUnit cx input))),- (Core.Name "anchorStart", (\input -> Eithers.map (\t -> Regex.AtomAnchorStart) (ExtractCore.decodeUnit cx input))),- (Core.Name "anchorEnd", (\input -> Eithers.map (\t -> Regex.AtomAnchorEnd) (ExtractCore.decodeUnit cx input))),- (Core.Name "group", (\input -> Eithers.map (\t -> Regex.AtomGroup t) (alternation cx input))),- (Core.Name "class", (\input -> Eithers.map (\t -> Regex.AtomClass t) (characterClass cx input)))]- in (Optionals.match (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [- "no such field ",- (Core.unName fname),- " in union"]))) (\f -> f fterm))- _ -> Left (Errors.DecodingError "expected union")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.regex.CharacterClass-characterClass :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Regex.CharacterClass-characterClass cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "negated" (\cx2 -> \raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of- Core.TermLiteral v1 -> case v1 of- Core.LiteralBoolean v2 -> Right v2- _ -> Left (Errors.DecodingError "expected boolean literal")- _ -> Left (Errors.DecodingError "expected literal")) (ExtractCore.stripWithDecodingError cx2 raw2)) fieldMap cx) (\field_negated -> Eithers.bind (ExtractCore.requireField "items" (ExtractCore.decodeList classItem) fieldMap cx) (\field_items -> Right (Regex.CharacterClass {- Regex.characterClassNegated = field_negated,- Regex.characterClassItems = field_items}))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.regex.CharacterClass")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.regex.CharacterRange-characterRange :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Regex.CharacterRange-characterRange cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "from" (\cx2 -> \raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of- Core.TermLiteral v1 -> case v1 of- Core.LiteralInteger v2 -> case v2 of- Core.IntegerValueInt32 v3 -> Right v3- _ -> Left (Errors.DecodingError "expected int32 value")- _ -> Left (Errors.DecodingError "expected int32 literal")- _ -> Left (Errors.DecodingError "expected literal")) (ExtractCore.stripWithDecodingError cx2 raw2)) fieldMap cx) (\field_from -> Eithers.bind (ExtractCore.requireField "to" (\cx2 -> \raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of- Core.TermLiteral v1 -> case v1 of- Core.LiteralInteger v2 -> case v2 of- Core.IntegerValueInt32 v3 -> Right v3- _ -> Left (Errors.DecodingError "expected int32 value")- _ -> Left (Errors.DecodingError "expected int32 literal")- _ -> Left (Errors.DecodingError "expected literal")) (ExtractCore.stripWithDecodingError cx2 raw2)) fieldMap cx) (\field_to -> Right (Regex.CharacterRange {- Regex.characterRangeFrom = field_from,- Regex.characterRangeTo = field_to}))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.regex.CharacterRange")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.regex.ClassItem-classItem :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Regex.ClassItem-classItem cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermInject v0 ->- let field = Core.injectionField v0- fname = Core.fieldName field- fterm = Core.fieldTerm field- variantMap =- Maps.fromList [- (- Core.Name "character",- (\input -> Eithers.map (\t -> Regex.ClassItemCharacter t) (Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of- Core.TermLiteral v1 -> case v1 of- Core.LiteralInteger v2 -> case v2 of- Core.IntegerValueInt32 v3 -> Right v3- _ -> Left (Errors.DecodingError "expected int32 value")- _ -> Left (Errors.DecodingError "expected int32 literal")- _ -> Left (Errors.DecodingError "expected literal")) (ExtractCore.stripWithDecodingError cx input)))),- (Core.Name "range", (\input -> Eithers.map (\t -> Regex.ClassItemRange t) (characterRange cx input)))]- in (Optionals.match (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [- "no such field ",- (Core.unName fname),- " in union"]))) (\f -> f fterm))- _ -> Left (Errors.DecodingError "expected union")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.regex.Quantified-quantified :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Regex.Quantified-quantified cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "atom" atom fieldMap cx) (\field_atom -> Eithers.bind (ExtractCore.requireField "quantifier" quantifier fieldMap cx) (\field_quantifier -> Right (Regex.Quantified {- Regex.quantifiedAtom = field_atom,- Regex.quantifiedQuantifier = field_quantifier}))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.regex.Quantified")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.regex.Quantifier-quantifier :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Regex.Quantifier-quantifier cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermInject v0 ->- let field = Core.injectionField v0- fname = Core.fieldName field- fterm = Core.fieldTerm field- variantMap =- Maps.fromList [- (Core.Name "one", (\input -> Eithers.map (\t -> Regex.QuantifierOne) (ExtractCore.decodeUnit cx input))),- (Core.Name "zeroOrOne", (\input -> Eithers.map (\t -> Regex.QuantifierZeroOrOne) (ExtractCore.decodeUnit cx input))),- (Core.Name "zeroOrMore", (\input -> Eithers.map (\t -> Regex.QuantifierZeroOrMore) (ExtractCore.decodeUnit cx input))),- (Core.Name "oneOrMore", (\input -> Eithers.map (\t -> Regex.QuantifierOneOrMore) (ExtractCore.decodeUnit cx input))),- (- Core.Name "exactly",- (\input -> Eithers.map (\t -> Regex.QuantifierExactly t) (Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of- Core.TermLiteral v1 -> case v1 of- Core.LiteralInteger v2 -> case v2 of- Core.IntegerValueInt32 v3 -> Right v3- _ -> Left (Errors.DecodingError "expected int32 value")- _ -> Left (Errors.DecodingError "expected int32 literal")- _ -> Left (Errors.DecodingError "expected literal")) (ExtractCore.stripWithDecodingError cx input)))),- (- Core.Name "atLeast",- (\input -> Eithers.map (\t -> Regex.QuantifierAtLeast t) (Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of- Core.TermLiteral v1 -> case v1 of- Core.LiteralInteger v2 -> case v2 of- Core.IntegerValueInt32 v3 -> Right v3- _ -> Left (Errors.DecodingError "expected int32 value")- _ -> Left (Errors.DecodingError "expected int32 literal")- _ -> Left (Errors.DecodingError "expected literal")) (ExtractCore.stripWithDecodingError cx input)))),- (Core.Name "range", (\input -> Eithers.map (\t -> Regex.QuantifierRange_ t) (quantifierRange cx input)))]- in (Optionals.match (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [- "no such field ",- (Core.unName fname),- " in union"]))) (\f -> f fterm))- _ -> Left (Errors.DecodingError "expected union")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.regex.QuantifierRange-quantifierRange :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Regex.QuantifierRange-quantifierRange cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "min" (\cx2 -> \raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of- Core.TermLiteral v1 -> case v1 of- Core.LiteralInteger v2 -> case v2 of- Core.IntegerValueInt32 v3 -> Right v3- _ -> Left (Errors.DecodingError "expected int32 value")- _ -> Left (Errors.DecodingError "expected int32 literal")- _ -> Left (Errors.DecodingError "expected literal")) (ExtractCore.stripWithDecodingError cx2 raw2)) fieldMap cx) (\field_min -> Eithers.bind (ExtractCore.requireField "max" (\cx2 -> \raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of- Core.TermLiteral v1 -> case v1 of- Core.LiteralInteger v2 -> case v2 of- Core.IntegerValueInt32 v3 -> Right v3- _ -> Left (Errors.DecodingError "expected int32 value")- _ -> Left (Errors.DecodingError "expected int32 literal")- _ -> Left (Errors.DecodingError "expected literal")) (ExtractCore.stripWithDecodingError cx2 raw2)) fieldMap cx) (\field_max -> Right (Regex.QuantifierRange {- Regex.quantifierRangeMin = field_min,- Regex.quantifierRangeMax = field_max}))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.regex.QuantifierRange")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.regex.Regex-regex :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Regex.Alternation-regex = alternation---- | Decoder for hydra.regex.RegexSequence-regexSequence :: Graph.Graph -> Core.Term -> Either Errors.DecodingError [Regex.Quantified]-regexSequence = ExtractCore.decodeList quantified
@@ -1,104 +0,0 @@--- Note: this is an automatically generated file. Do not edit.---- | Term decoders for hydra.relational--module Hydra.Decode.Relational where--import qualified Hydra.Core as Core-import qualified Hydra.Decode.Core as DecodeCore-import qualified Hydra.Errors as Errors-import qualified Hydra.Extract.Core as ExtractCore-import qualified Hydra.Graph as Graph-import qualified Hydra.Lexical as Lexical-import qualified Hydra.Overlay.Haskell.Lib.Eithers as Eithers-import qualified Hydra.Relational as Relational-import qualified Hydra.Rewriting as Rewriting-import qualified Hydra.Util as Util-import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)-import qualified Data.Scientific as Sci-import Data.Void---- | Decoder for hydra.relational.ColumnName-columnName :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Relational.ColumnName-columnName cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermWrap v0 -> Eithers.map (\b -> Relational.ColumnName b) ((\raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of- Core.TermLiteral v1 -> case v1 of- Core.LiteralString v2 -> Right v2- _ -> Left (Errors.DecodingError "expected string literal")- _ -> Left (Errors.DecodingError "expected literal")) (ExtractCore.stripWithDecodingError cx raw2)) (Core.wrappedTermBody v0))- _ -> Left (Errors.DecodingError "expected wrapped type")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.relational.ColumnSchema-columnSchema :: (Graph.Graph -> Core.Term -> Either Errors.DecodingError t) -> Graph.Graph -> Core.Term -> Either Errors.DecodingError (Relational.ColumnSchema t)-columnSchema t cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "name" columnName fieldMap cx) (\field_name -> Eithers.bind (ExtractCore.requireField "domain" t fieldMap cx) (\field_domain -> Right (Relational.ColumnSchema {- Relational.columnSchemaName = field_name,- Relational.columnSchemaDomain = field_domain}))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.relational.ColumnSchema")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.relational.ForeignKey-foreignKey :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Relational.ForeignKey-foreignKey cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "foreignRelation" relationName fieldMap cx) (\field_foreignRelation -> Eithers.bind (ExtractCore.requireField "keys" (ExtractCore.decodeMap columnName columnName) fieldMap cx) (\field_keys -> Right (Relational.ForeignKey {- Relational.foreignKeyForeignRelation = field_foreignRelation,- Relational.foreignKeyKeys = field_keys}))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.relational.ForeignKey")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.relational.PrimaryKey-primaryKey :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Relational.PrimaryKey-primaryKey cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermWrap v0 -> Eithers.map (\b -> Relational.PrimaryKey b) (ExtractCore.decodeList columnName cx (Core.wrappedTermBody v0))- _ -> Left (Errors.DecodingError "expected wrapped type")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.relational.Relation-relation :: (Graph.Graph -> Core.Term -> Either Errors.DecodingError v) -> Graph.Graph -> Core.Term -> Either Errors.DecodingError (Relational.Relation v)-relation v cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermWrap v0 -> Eithers.map (\b -> Relational.Relation b) (ExtractCore.decodeList (row v) cx (Core.wrappedTermBody v0))- _ -> Left (Errors.DecodingError "expected wrapped type")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.relational.RelationName-relationName :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Relational.RelationName-relationName cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermWrap v0 -> Eithers.map (\b -> Relational.RelationName b) ((\raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of- Core.TermLiteral v1 -> case v1 of- Core.LiteralString v2 -> Right v2- _ -> Left (Errors.DecodingError "expected string literal")- _ -> Left (Errors.DecodingError "expected literal")) (ExtractCore.stripWithDecodingError cx raw2)) (Core.wrappedTermBody v0))- _ -> Left (Errors.DecodingError "expected wrapped type")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.relational.RelationSchema-relationSchema :: (Graph.Graph -> Core.Term -> Either Errors.DecodingError t) -> Graph.Graph -> Core.Term -> Either Errors.DecodingError (Relational.RelationSchema t)-relationSchema t cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "name" relationName fieldMap cx) (\field_name -> Eithers.bind (ExtractCore.requireField "columns" (ExtractCore.decodeList (columnSchema t)) fieldMap cx) (\field_columns -> Eithers.bind (ExtractCore.requireField "primaryKeys" (ExtractCore.decodeList primaryKey) fieldMap cx) (\field_primaryKeys -> Eithers.bind (ExtractCore.requireField "foreignKeys" (ExtractCore.decodeList foreignKey) fieldMap cx) (\field_foreignKeys -> Right (Relational.RelationSchema {- Relational.relationSchemaName = field_name,- Relational.relationSchemaColumns = field_columns,- Relational.relationSchemaPrimaryKeys = field_primaryKeys,- Relational.relationSchemaForeignKeys = field_foreignKeys}))))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.relational.RelationSchema")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.relational.Relationship-relationship :: Ord v => ((Graph.Graph -> Core.Term -> Either Errors.DecodingError v) -> Graph.Graph -> Core.Term -> Either Errors.DecodingError (Relational.Relationship v))-relationship v cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermWrap v0 -> Eithers.map (\b -> Relational.Relationship b) (ExtractCore.decodeSet (ExtractCore.decodeMap columnName v) cx (Core.wrappedTermBody v0))- _ -> Left (Errors.DecodingError "expected wrapped type")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.relational.Row-row :: (Graph.Graph -> Core.Term -> Either Errors.DecodingError v) -> Graph.Graph -> Core.Term -> Either Errors.DecodingError (Relational.Row v)-row v cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermWrap v0 -> Eithers.map (\b -> Relational.Row b) (ExtractCore.decodeList v cx (Core.wrappedTermBody v0))- _ -> Left (Errors.DecodingError "expected wrapped type")) (ExtractCore.stripWithDecodingError cx raw)
@@ -1,85 +0,0 @@--- Note: this is an automatically generated file. Do not edit.---- | Term decoders for hydra.system--module Hydra.Decode.System where--import qualified Hydra.Core as Core-import qualified Hydra.Decode.Core as DecodeCore-import qualified Hydra.Decode.File as File-import qualified Hydra.Errors as Errors-import qualified Hydra.Extract.Core as ExtractCore-import qualified Hydra.Graph as Graph-import qualified Hydra.Lexical as Lexical-import qualified Hydra.Overlay.Haskell.Lib.Eithers as Eithers-import qualified Hydra.Rewriting as Rewriting-import qualified Hydra.System as System-import qualified Hydra.Util as Util-import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)-import qualified Data.Scientific as Sci-import Data.Void---- | Decoder for hydra.system.Command-command :: Graph.Graph -> Core.Term -> Either Errors.DecodingError System.Command-command cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "program" File.filePath fieldMap cx) (\field_program -> Eithers.bind (ExtractCore.requireField "arguments" (ExtractCore.decodeList (\cx2 -> \raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of- Core.TermLiteral v1 -> case v1 of- Core.LiteralString v2 -> Right v2- _ -> Left (Errors.DecodingError "expected string literal")- _ -> Left (Errors.DecodingError "expected literal")) (ExtractCore.stripWithDecodingError cx2 raw2))) fieldMap cx) (\field_arguments -> Eithers.bind (ExtractCore.requireField "workingDirectory" (ExtractCore.decodeMaybe File.filePath) fieldMap cx) (\field_workingDirectory -> Eithers.bind (ExtractCore.requireField "environment" (ExtractCore.decodeMaybe (ExtractCore.decodeMap environmentVariable (\cx2 -> \raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of- Core.TermLiteral v1 -> case v1 of- Core.LiteralString v2 -> Right v2- _ -> Left (Errors.DecodingError "expected string literal")- _ -> Left (Errors.DecodingError "expected literal")) (ExtractCore.stripWithDecodingError cx2 raw2)))) fieldMap cx) (\field_environment -> Right (System.Command {- System.commandProgram = field_program,- System.commandArguments = field_arguments,- System.commandWorkingDirectory = field_workingDirectory,- System.commandEnvironment = field_environment}))))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.system.Command")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.system.EnvironmentVariable-environmentVariable :: Graph.Graph -> Core.Term -> Either Errors.DecodingError System.EnvironmentVariable-environmentVariable cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermWrap v0 -> Eithers.map (\b -> System.EnvironmentVariable b) ((\raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of- Core.TermLiteral v1 -> case v1 of- Core.LiteralString v2 -> Right v2- _ -> Left (Errors.DecodingError "expected string literal")- _ -> Left (Errors.DecodingError "expected literal")) (ExtractCore.stripWithDecodingError cx raw2)) (Core.wrappedTermBody v0))- _ -> Left (Errors.DecodingError "expected wrapped type")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.system.ProcessResult-processResult :: Graph.Graph -> Core.Term -> Either Errors.DecodingError System.ProcessResult-processResult cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "exitCode" statusCode fieldMap cx) (\field_exitCode -> Eithers.bind (ExtractCore.requireField "stdout" (\cx2 -> \raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of- Core.TermLiteral v1 -> case v1 of- Core.LiteralBinary v2 -> Right v2- _ -> Left (Errors.DecodingError "expected binary literal")- _ -> Left (Errors.DecodingError "expected literal")) (ExtractCore.stripWithDecodingError cx2 raw2)) fieldMap cx) (\field_stdout -> Eithers.bind (ExtractCore.requireField "stderr" (\cx2 -> \raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of- Core.TermLiteral v1 -> case v1 of- Core.LiteralBinary v2 -> Right v2- _ -> Left (Errors.DecodingError "expected binary literal")- _ -> Left (Errors.DecodingError "expected literal")) (ExtractCore.stripWithDecodingError cx2 raw2)) fieldMap cx) (\field_stderr -> Right (System.ProcessResult {- System.processResultExitCode = field_exitCode,- System.processResultStdout = field_stdout,- System.processResultStderr = field_stderr})))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.system.ProcessResult")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.system.StatusCode-statusCode :: Graph.Graph -> Core.Term -> Either Errors.DecodingError System.StatusCode-statusCode cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermWrap v0 -> Eithers.map (\b -> System.StatusCode b) ((\raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of- Core.TermLiteral v1 -> case v1 of- Core.LiteralInteger v2 -> case v2 of- Core.IntegerValueInt32 v3 -> Right v3- _ -> Left (Errors.DecodingError "expected int32 value")- _ -> Left (Errors.DecodingError "expected int32 literal")- _ -> Left (Errors.DecodingError "expected literal")) (ExtractCore.stripWithDecodingError cx raw2)) (Core.wrappedTermBody v0))- _ -> Left (Errors.DecodingError "expected wrapped type")) (ExtractCore.stripWithDecodingError cx raw)
@@ -1,71 +0,0 @@--- Note: this is an automatically generated file. Do not edit.---- | Term decoders for hydra.tabular--module Hydra.Decode.Tabular where--import qualified Hydra.Core as Core-import qualified Hydra.Decode.Core as DecodeCore-import qualified Hydra.Decode.Relational as Relational-import qualified Hydra.Errors as Errors-import qualified Hydra.Extract.Core as ExtractCore-import qualified Hydra.Graph as Graph-import qualified Hydra.Lexical as Lexical-import qualified Hydra.Overlay.Haskell.Lib.Eithers as Eithers-import qualified Hydra.Rewriting as Rewriting-import qualified Hydra.Tabular as Tabular-import qualified Hydra.Util as Util-import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)-import qualified Data.Scientific as Sci-import Data.Void---- | Decoder for hydra.tabular.ColumnType-columnType :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Tabular.ColumnType-columnType cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "name" Relational.columnName fieldMap cx) (\field_name -> Eithers.bind (ExtractCore.requireField "type" DecodeCore.type_ fieldMap cx) (\field_type -> Right (Tabular.ColumnType {- Tabular.columnTypeName = field_name,- Tabular.columnTypeType = field_type}))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.tabular.ColumnType")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.tabular.DataRow-dataRow :: (Graph.Graph -> Core.Term -> Either Errors.DecodingError v) -> Graph.Graph -> Core.Term -> Either Errors.DecodingError (Tabular.DataRow v)-dataRow v cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermWrap v0 -> Eithers.map (\b -> Tabular.DataRow b) (ExtractCore.decodeList (ExtractCore.decodeMaybe v) cx (Core.wrappedTermBody v0))- _ -> Left (Errors.DecodingError "expected wrapped type")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.tabular.HeaderRow-headerRow :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Tabular.HeaderRow-headerRow cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermWrap v0 -> Eithers.map (\b -> Tabular.HeaderRow b) (ExtractCore.decodeList (\cx2 -> \raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of- Core.TermLiteral v1 -> case v1 of- Core.LiteralString v2 -> Right v2- _ -> Left (Errors.DecodingError "expected string literal")- _ -> Left (Errors.DecodingError "expected literal")) (ExtractCore.stripWithDecodingError cx2 raw2)) cx (Core.wrappedTermBody v0))- _ -> Left (Errors.DecodingError "expected wrapped type")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.tabular.Table-table :: (Graph.Graph -> Core.Term -> Either Errors.DecodingError v) -> Graph.Graph -> Core.Term -> Either Errors.DecodingError (Tabular.Table v)-table v cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "header" (ExtractCore.decodeMaybe headerRow) fieldMap cx) (\field_header -> Eithers.bind (ExtractCore.requireField "data" (ExtractCore.decodeList (dataRow v)) fieldMap cx) (\field_data -> Right (Tabular.Table {- Tabular.tableHeader = field_header,- Tabular.tableData = field_data}))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.tabular.Table")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.tabular.TableType-tableType :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Tabular.TableType-tableType cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "name" Relational.relationName fieldMap cx) (\field_name -> Eithers.bind (ExtractCore.requireField "columns" (ExtractCore.decodeList columnType) fieldMap cx) (\field_columns -> Right (Tabular.TableType {- Tabular.tableTypeName = field_name,- Tabular.tableTypeColumns = field_columns}))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.tabular.TableType")) (ExtractCore.stripWithDecodingError cx raw)
@@ -1,30 +0,0 @@--- Note: this is an automatically generated file. Do not edit.---- | Term decoders for hydra.testing--module Hydra.Decode.Testing where--import qualified Hydra.Core as Core-import qualified Hydra.Decode.Core as DecodeCore-import qualified Hydra.Errors as Errors-import qualified Hydra.Extract.Core as ExtractCore-import qualified Hydra.Graph as Graph-import qualified Hydra.Lexical as Lexical-import qualified Hydra.Overlay.Haskell.Lib.Eithers as Eithers-import qualified Hydra.Rewriting as Rewriting-import qualified Hydra.Testing as Testing-import qualified Hydra.Util as Util-import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)-import qualified Data.Scientific as Sci-import Data.Void---- | Decoder for hydra.testing.Tag-tag :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Testing.Tag-tag cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermWrap v0 -> Eithers.map (\b -> Testing.Tag b) ((\raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of- Core.TermLiteral v1 -> case v1 of- Core.LiteralString v2 -> Right v2- _ -> Left (Errors.DecodingError "expected string literal")- _ -> Left (Errors.DecodingError "expected literal")) (ExtractCore.stripWithDecodingError cx raw2)) (Core.wrappedTermBody v0))- _ -> Left (Errors.DecodingError "expected wrapped type")) (ExtractCore.stripWithDecodingError cx raw)
@@ -1,42 +0,0 @@--- Note: this is an automatically generated file. Do not edit.---- | Term decoders for hydra.time--module Hydra.Decode.Time where--import qualified Hydra.Core as Core-import qualified Hydra.Decode.Core as DecodeCore-import qualified Hydra.Errors as Errors-import qualified Hydra.Extract.Core as ExtractCore-import qualified Hydra.Graph as Graph-import qualified Hydra.Lexical as Lexical-import qualified Hydra.Overlay.Haskell.Lib.Eithers as Eithers-import qualified Hydra.Rewriting as Rewriting-import qualified Hydra.Time as Time-import qualified Hydra.Util as Util-import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)-import qualified Data.Scientific as Sci-import Data.Void---- | Decoder for hydra.time.Timespec-timespec :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Time.Timespec-timespec cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "seconds" (\cx2 -> \raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of- Core.TermLiteral v1 -> case v1 of- Core.LiteralInteger v2 -> case v2 of- Core.IntegerValueInt64 v3 -> Right v3- _ -> Left (Errors.DecodingError "expected int64 value")- _ -> Left (Errors.DecodingError "expected int64 literal")- _ -> Left (Errors.DecodingError "expected literal")) (ExtractCore.stripWithDecodingError cx2 raw2)) fieldMap cx) (\field_seconds -> Eithers.bind (ExtractCore.requireField "nanoseconds" (\cx2 -> \raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of- Core.TermLiteral v1 -> case v1 of- Core.LiteralInteger v2 -> case v2 of- Core.IntegerValueUint32 v3 -> Right v3- _ -> Left (Errors.DecodingError "expected uint32 value")- _ -> Left (Errors.DecodingError "expected uint32 literal")- _ -> Left (Errors.DecodingError "expected literal")) (ExtractCore.stripWithDecodingError cx2 raw2)) fieldMap cx) (\field_nanoseconds -> Right (Time.Timespec {- Time.timespecSeconds = field_seconds,- Time.timespecNanoseconds = field_nanoseconds}))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.time.Timespec")) (ExtractCore.stripWithDecodingError cx raw)
@@ -1,68 +0,0 @@--- Note: this is an automatically generated file. Do not edit.---- | Term decoders for hydra.topology--module Hydra.Decode.Topology where--import qualified Hydra.Core as Core-import qualified Hydra.Decode.Core as DecodeCore-import qualified Hydra.Errors as Errors-import qualified Hydra.Extract.Core as ExtractCore-import qualified Hydra.Graph as Graph-import qualified Hydra.Lexical as Lexical-import qualified Hydra.Overlay.Haskell.Lib.Eithers as Eithers-import qualified Hydra.Rewriting as Rewriting-import qualified Hydra.Topology as Topology-import qualified Hydra.Util as Util-import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)-import qualified Data.Scientific as Sci-import Data.Void-import qualified Data.Map as M---- | Decoder for hydra.topology.Graph-graph :: Graph.Graph -> Core.Term -> Either Errors.DecodingError (M.Map Topology.Vertex [Topology.Vertex])-graph = ExtractCore.decodeMap vertex (ExtractCore.decodeList vertex)---- | Decoder for hydra.topology.TarjanState-tarjanState :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Topology.TarjanState-tarjanState cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "counter" (\cx2 -> \raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of- Core.TermLiteral v1 -> case v1 of- Core.LiteralInteger v2 -> case v2 of- Core.IntegerValueInt32 v3 -> Right v3- _ -> Left (Errors.DecodingError "expected int32 value")- _ -> Left (Errors.DecodingError "expected int32 literal")- _ -> Left (Errors.DecodingError "expected literal")) (ExtractCore.stripWithDecodingError cx2 raw2)) fieldMap cx) (\field_counter -> Eithers.bind (ExtractCore.requireField "indices" (ExtractCore.decodeMap vertex (\cx2 -> \raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of- Core.TermLiteral v1 -> case v1 of- Core.LiteralInteger v2 -> case v2 of- Core.IntegerValueInt32 v3 -> Right v3- _ -> Left (Errors.DecodingError "expected int32 value")- _ -> Left (Errors.DecodingError "expected int32 literal")- _ -> Left (Errors.DecodingError "expected literal")) (ExtractCore.stripWithDecodingError cx2 raw2))) fieldMap cx) (\field_indices -> Eithers.bind (ExtractCore.requireField "lowLinks" (ExtractCore.decodeMap vertex (\cx2 -> \raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of- Core.TermLiteral v1 -> case v1 of- Core.LiteralInteger v2 -> case v2 of- Core.IntegerValueInt32 v3 -> Right v3- _ -> Left (Errors.DecodingError "expected int32 value")- _ -> Left (Errors.DecodingError "expected int32 literal")- _ -> Left (Errors.DecodingError "expected literal")) (ExtractCore.stripWithDecodingError cx2 raw2))) fieldMap cx) (\field_lowLinks -> Eithers.bind (ExtractCore.requireField "stack" (ExtractCore.decodeList vertex) fieldMap cx) (\field_stack -> Eithers.bind (ExtractCore.requireField "onStack" (ExtractCore.decodeSet vertex) fieldMap cx) (\field_onStack -> Eithers.bind (ExtractCore.requireField "sccs" (ExtractCore.decodeList (ExtractCore.decodeList vertex)) fieldMap cx) (\field_sccs -> Right (Topology.TarjanState {- Topology.tarjanStateCounter = field_counter,- Topology.tarjanStateIndices = field_indices,- Topology.tarjanStateLowLinks = field_lowLinks,- Topology.tarjanStateStack = field_stack,- Topology.tarjanStateOnStack = field_onStack,- Topology.tarjanStateSccs = field_sccs}))))))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.topology.TarjanState")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.topology.Vertex-vertex :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Int-vertex cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermLiteral v0 -> case v0 of- Core.LiteralInteger v1 -> case v1 of- Core.IntegerValueInt32 v2 -> Right v2- _ -> Left (Errors.DecodingError "expected int32 value")- _ -> Left (Errors.DecodingError "expected int32 literal")- _ -> Left (Errors.DecodingError "expected literal")) (ExtractCore.stripWithDecodingError cx raw)
@@ -1,55 +0,0 @@--- Note: this is an automatically generated file. Do not edit.---- | Term decoders for hydra.typed--module Hydra.Decode.Typed where--import qualified Hydra.Core as Core-import qualified Hydra.Decode.Core as DecodeCore-import qualified Hydra.Errors as Errors-import qualified Hydra.Extract.Core as ExtractCore-import qualified Hydra.Graph as Graph-import qualified Hydra.Lexical as Lexical-import qualified Hydra.Overlay.Haskell.Lib.Eithers as Eithers-import qualified Hydra.Rewriting as Rewriting-import qualified Hydra.Typed as Typed-import qualified Hydra.Util as Util-import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)-import qualified Data.Scientific as Sci-import Data.Void---- | Decoder for hydra.typed.TypedBinding-typedBinding :: (Graph.Graph -> Core.Term -> Either Errors.DecodingError a) -> Graph.Graph -> Core.Term -> Either Errors.DecodingError (Typed.TypedBinding a)-typedBinding a cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "name" DecodeCore.name fieldMap cx) (\field_name -> Eithers.bind (ExtractCore.requireField "term" (typedTerm a) fieldMap cx) (\field_term -> Right (Typed.TypedBinding {- Typed.typedBindingName = field_name,- Typed.typedBindingTerm = field_term}))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.typed.TypedBinding")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.typed.TypedName-typedName :: (Graph.Graph -> Core.Term -> Either Errors.DecodingError a) -> Graph.Graph -> Core.Term -> Either Errors.DecodingError (Typed.TypedName a)-typedName a cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermWrap v0 -> Eithers.map (\b -> Typed.TypedName b) (DecodeCore.name cx (Core.wrappedTermBody v0))- _ -> Left (Errors.DecodingError "expected wrapped type")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.typed.TypedTerm-typedTerm :: (Graph.Graph -> Core.Term -> Either Errors.DecodingError a) -> Graph.Graph -> Core.Term -> Either Errors.DecodingError (Typed.TypedTerm a)-typedTerm a cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermWrap v0 -> Eithers.map (\b -> Typed.TypedTerm b) (DecodeCore.term cx (Core.wrappedTermBody v0))- _ -> Left (Errors.DecodingError "expected wrapped type")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.typed.TypedTermDefinition-typedTermDefinition :: (Graph.Graph -> Core.Term -> Either Errors.DecodingError a) -> Graph.Graph -> Core.Term -> Either Errors.DecodingError (Typed.TypedTermDefinition a)-typedTermDefinition a cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "name" DecodeCore.name fieldMap cx) (\field_name -> Eithers.bind (ExtractCore.requireField "term" (typedTerm a) fieldMap cx) (\field_term -> Right (Typed.TypedTermDefinition {- Typed.typedTermDefinitionName = field_name,- Typed.typedTermDefinitionTerm = field_term}))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.typed.TypedTermDefinition")) (ExtractCore.stripWithDecodingError cx raw)
@@ -1,170 +0,0 @@--- Note: this is an automatically generated file. Do not edit.---- | Term decoders for hydra.typing--module Hydra.Decode.Typing where--import qualified Hydra.Core as Core-import qualified Hydra.Decode.Core as DecodeCore-import qualified Hydra.Decode.Paths as Paths-import qualified Hydra.Errors as Errors-import qualified Hydra.Extract.Core as ExtractCore-import qualified Hydra.Graph as Graph-import qualified Hydra.Lexical as Lexical-import qualified Hydra.Overlay.Haskell.Lib.Eithers as Eithers-import qualified Hydra.Rewriting as Rewriting-import qualified Hydra.Typing as Typing-import qualified Hydra.Util as Util-import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)-import qualified Data.Scientific as Sci-import Data.Void---- | Decoder for hydra.typing.FunctionStructure-functionStructure :: (Graph.Graph -> Core.Term -> Either Errors.DecodingError env) -> Graph.Graph -> Core.Term -> Either Errors.DecodingError (Typing.FunctionStructure env)-functionStructure env cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "typeParams" (ExtractCore.decodeList DecodeCore.name) fieldMap cx) (\field_typeParams -> Eithers.bind (ExtractCore.requireField "params" (ExtractCore.decodeList DecodeCore.name) fieldMap cx) (\field_params -> Eithers.bind (ExtractCore.requireField "bindings" (ExtractCore.decodeList DecodeCore.binding) fieldMap cx) (\field_bindings -> Eithers.bind (ExtractCore.requireField "body" DecodeCore.term fieldMap cx) (\field_body -> Eithers.bind (ExtractCore.requireField "domains" (ExtractCore.decodeList DecodeCore.type_) fieldMap cx) (\field_domains -> Eithers.bind (ExtractCore.requireField "codomain" (ExtractCore.decodeMaybe DecodeCore.type_) fieldMap cx) (\field_codomain -> Eithers.bind (ExtractCore.requireField "environment" env fieldMap cx) (\field_environment -> Right (Typing.FunctionStructure {- Typing.functionStructureTypeParams = field_typeParams,- Typing.functionStructureParams = field_params,- Typing.functionStructureBindings = field_bindings,- Typing.functionStructureBody = field_body,- Typing.functionStructureDomains = field_domains,- Typing.functionStructureCodomain = field_codomain,- Typing.functionStructureEnvironment = field_environment})))))))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.typing.FunctionStructure")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.typing.InferenceContext-inferenceContext :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Typing.InferenceContext-inferenceContext cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "freshTypeVariableCount" (\cx2 -> \raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of- Core.TermLiteral v1 -> case v1 of- Core.LiteralInteger v2 -> case v2 of- Core.IntegerValueInt32 v3 -> Right v3- _ -> Left (Errors.DecodingError "expected int32 value")- _ -> Left (Errors.DecodingError "expected int32 literal")- _ -> Left (Errors.DecodingError "expected literal")) (ExtractCore.stripWithDecodingError cx2 raw2)) fieldMap cx) (\field_freshTypeVariableCount -> Eithers.bind (ExtractCore.requireField "trace" (ExtractCore.decodeList Paths.subtermStep) fieldMap cx) (\field_trace -> Right (Typing.InferenceContext {- Typing.inferenceContextFreshTypeVariableCount = field_freshTypeVariableCount,- Typing.inferenceContextTrace = field_trace}))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.typing.InferenceContext")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.typing.InferenceResult-inferenceResult :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Typing.InferenceResult-inferenceResult cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "term" DecodeCore.term fieldMap cx) (\field_term -> Eithers.bind (ExtractCore.requireField "type" DecodeCore.type_ fieldMap cx) (\field_type -> Eithers.bind (ExtractCore.requireField "subst" typeSubst fieldMap cx) (\field_subst -> Eithers.bind (ExtractCore.requireField "classConstraints" (ExtractCore.decodeMap DecodeCore.name DecodeCore.typeVariableConstraints) fieldMap cx) (\field_classConstraints -> Eithers.bind (ExtractCore.requireField "context" inferenceContext fieldMap cx) (\field_context -> Right (Typing.InferenceResult {- Typing.inferenceResultTerm = field_term,- Typing.inferenceResultType = field_type,- Typing.inferenceResultSubst = field_subst,- Typing.inferenceResultClassConstraints = field_classConstraints,- Typing.inferenceResultContext = field_context})))))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.typing.InferenceResult")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.typing.Parameter-parameter :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Typing.Parameter-parameter cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "name" DecodeCore.name fieldMap cx) (\field_name -> Eithers.bind (ExtractCore.requireField "description" (ExtractCore.decodeMaybe (\cx2 -> \raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of- Core.TermLiteral v1 -> case v1 of- Core.LiteralString v2 -> Right v2- _ -> Left (Errors.DecodingError "expected string literal")- _ -> Left (Errors.DecodingError "expected literal")) (ExtractCore.stripWithDecodingError cx2 raw2))) fieldMap cx) (\field_description -> Eithers.bind (ExtractCore.requireField "type" DecodeCore.type_ fieldMap cx) (\field_type -> Eithers.bind (ExtractCore.requireField "isLazy" (\cx2 -> \raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of- Core.TermLiteral v1 -> case v1 of- Core.LiteralBoolean v2 -> Right v2- _ -> Left (Errors.DecodingError "expected boolean literal")- _ -> Left (Errors.DecodingError "expected literal")) (ExtractCore.stripWithDecodingError cx2 raw2)) fieldMap cx) (\field_isLazy -> Right (Typing.Parameter {- Typing.parameterName = field_name,- Typing.parameterDescription = field_description,- Typing.parameterType = field_type,- Typing.parameterIsLazy = field_isLazy}))))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.typing.Parameter")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.typing.Result-result :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Typing.Result-result cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "description" (ExtractCore.decodeMaybe (\cx2 -> \raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of- Core.TermLiteral v1 -> case v1 of- Core.LiteralString v2 -> Right v2- _ -> Left (Errors.DecodingError "expected string literal")- _ -> Left (Errors.DecodingError "expected literal")) (ExtractCore.stripWithDecodingError cx2 raw2))) fieldMap cx) (\field_description -> Eithers.bind (ExtractCore.requireField "type" DecodeCore.type_ fieldMap cx) (\field_type -> Right (Typing.Result {- Typing.resultDescription = field_description,- Typing.resultType = field_type}))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.typing.Result")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.typing.TermSignature-termSignature :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Typing.TermSignature-termSignature cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "typeParameters" (ExtractCore.decodeList typeParameter) fieldMap cx) (\field_typeParameters -> Eithers.bind (ExtractCore.requireField "parameters" (ExtractCore.decodeList parameter) fieldMap cx) (\field_parameters -> Eithers.bind (ExtractCore.requireField "result" result fieldMap cx) (\field_result -> Right (Typing.TermSignature {- Typing.termSignatureTypeParameters = field_typeParameters,- Typing.termSignatureParameters = field_parameters,- Typing.termSignatureResult = field_result})))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.typing.TermSignature")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.typing.TermSubst-termSubst :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Typing.TermSubst-termSubst cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermWrap v0 -> Eithers.map (\b -> Typing.TermSubst b) (ExtractCore.decodeMap DecodeCore.name DecodeCore.term cx (Core.wrappedTermBody v0))- _ -> Left (Errors.DecodingError "expected wrapped type")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.typing.TypeClass-typeClass :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Typing.TypeClass-typeClass cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "description" (\cx2 -> \raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of- Core.TermLiteral v1 -> case v1 of- Core.LiteralString v2 -> Right v2- _ -> Left (Errors.DecodingError "expected string literal")- _ -> Left (Errors.DecodingError "expected literal")) (ExtractCore.stripWithDecodingError cx2 raw2)) fieldMap cx) (\field_description -> Right (Typing.TypeClass {- Typing.typeClassDescription = field_description})))- _ -> Left (Errors.DecodingError "expected a record of type hydra.typing.TypeClass")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.typing.TypeConstraint-typeConstraint :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Typing.TypeConstraint-typeConstraint cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "left" DecodeCore.type_ fieldMap cx) (\field_left -> Eithers.bind (ExtractCore.requireField "right" DecodeCore.type_ fieldMap cx) (\field_right -> Eithers.bind (ExtractCore.requireField "comment" (\cx2 -> \raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of- Core.TermLiteral v1 -> case v1 of- Core.LiteralString v2 -> Right v2- _ -> Left (Errors.DecodingError "expected string literal")- _ -> Left (Errors.DecodingError "expected literal")) (ExtractCore.stripWithDecodingError cx2 raw2)) fieldMap cx) (\field_comment -> Right (Typing.TypeConstraint {- Typing.typeConstraintLeft = field_left,- Typing.typeConstraintRight = field_right,- Typing.typeConstraintComment = field_comment})))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.typing.TypeConstraint")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.typing.TypeParameter-typeParameter :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Typing.TypeParameter-typeParameter cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "name" DecodeCore.name fieldMap cx) (\field_name -> Eithers.bind (ExtractCore.requireField "constraints" (ExtractCore.decodeList DecodeCore.typeClassConstraint) fieldMap cx) (\field_constraints -> Right (Typing.TypeParameter {- Typing.typeParameterName = field_name,- Typing.typeParameterConstraints = field_constraints}))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.typing.TypeParameter")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.typing.TypeSubst-typeSubst :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Typing.TypeSubst-typeSubst cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermWrap v0 -> Eithers.map (\b -> Typing.TypeSubst b) (ExtractCore.decodeMap DecodeCore.name DecodeCore.type_ cx (Core.wrappedTermBody v0))- _ -> Left (Errors.DecodingError "expected wrapped type")) (ExtractCore.stripWithDecodingError cx raw)
@@ -1,116 +0,0 @@--- Note: this is an automatically generated file. Do not edit.---- | Term decoders for hydra.util--module Hydra.Decode.Util where--import qualified Hydra.Core as Core-import qualified Hydra.Decode.Core as DecodeCore-import qualified Hydra.Decode.Packaging as Packaging-import qualified Hydra.Errors as Errors-import qualified Hydra.Extract.Core as ExtractCore-import qualified Hydra.Graph as Graph-import qualified Hydra.Lexical as Lexical-import qualified Hydra.Overlay.Haskell.Lib.Eithers as Eithers-import qualified Hydra.Overlay.Haskell.Lib.Maps as Maps-import qualified Hydra.Overlay.Haskell.Lib.Optionals as Optionals-import qualified Hydra.Overlay.Haskell.Lib.Strings as Strings-import qualified Hydra.Rewriting as Rewriting-import qualified Hydra.Util as Util-import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)-import qualified Data.Scientific as Sci-import Data.Void---- | Decoder for hydra.util.CaseConvention-caseConvention :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Util.CaseConvention-caseConvention cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermInject v0 ->- let field = Core.injectionField v0- fname = Core.fieldName field- fterm = Core.fieldTerm field- variantMap =- Maps.fromList [- (Core.Name "camel", (\input -> Eithers.map (\t -> Util.CaseConventionCamel) (ExtractCore.decodeUnit cx input))),- (Core.Name "pascal", (\input -> Eithers.map (\t -> Util.CaseConventionPascal) (ExtractCore.decodeUnit cx input))),- (Core.Name "lowerSnake", (\input -> Eithers.map (\t -> Util.CaseConventionLowerSnake) (ExtractCore.decodeUnit cx input))),- (Core.Name "upperSnake", (\input -> Eithers.map (\t -> Util.CaseConventionUpperSnake) (ExtractCore.decodeUnit cx input))),- (- Core.Name "upperDashed",- (\input -> Eithers.map (\t -> Util.CaseConventionUpperDashed) (ExtractCore.decodeUnit cx input)))]- in (Optionals.match (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [- "no such field ",- (Core.unName fname),- " in union"]))) (\f -> f fterm))- _ -> Left (Errors.DecodingError "expected union")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.util.Comparison-comparison :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Util.Comparison-comparison cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermInject v0 ->- let field = Core.injectionField v0- fname = Core.fieldName field- fterm = Core.fieldTerm field- variantMap =- Maps.fromList [- (Core.Name "lessThan", (\input -> Eithers.map (\t -> Util.ComparisonLessThan) (ExtractCore.decodeUnit cx input))),- (Core.Name "equalTo", (\input -> Eithers.map (\t -> Util.ComparisonEqualTo) (ExtractCore.decodeUnit cx input))),- (Core.Name "greaterThan", (\input -> Eithers.map (\t -> Util.ComparisonGreaterThan) (ExtractCore.decodeUnit cx input)))]- in (Optionals.match (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [- "no such field ",- (Core.unName fname),- " in union"]))) (\f -> f fterm))- _ -> Left (Errors.DecodingError "expected union")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.util.ModuleNames-moduleNames :: (Graph.Graph -> Core.Term -> Either Errors.DecodingError n) -> Graph.Graph -> Core.Term -> Either Errors.DecodingError (Util.ModuleNames n)-moduleNames n cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "focus" (ExtractCore.decodePair Packaging.moduleName n) fieldMap cx) (\field_focus -> Eithers.bind (ExtractCore.requireField "mapping" (ExtractCore.decodeMap Packaging.moduleName n) fieldMap cx) (\field_mapping -> Right (Util.ModuleNames {- Util.moduleNamesFocus = field_focus,- Util.moduleNamesMapping = field_mapping}))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.util.ModuleNames")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.util.Precision-precision :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Util.Precision-precision cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermInject v0 ->- let field = Core.injectionField v0- fname = Core.fieldName field- fterm = Core.fieldTerm field- variantMap =- Maps.fromList [- (Core.Name "arbitrary", (\input -> Eithers.map (\t -> Util.PrecisionArbitrary) (ExtractCore.decodeUnit cx input))),- (- Core.Name "bits",- (\input -> Eithers.map (\t -> Util.PrecisionBits t) (Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of- Core.TermLiteral v1 -> case v1 of- Core.LiteralInteger v2 -> case v2 of- Core.IntegerValueInt32 v3 -> Right v3- _ -> Left (Errors.DecodingError "expected int32 value")- _ -> Left (Errors.DecodingError "expected int32 literal")- _ -> Left (Errors.DecodingError "expected literal")) (ExtractCore.stripWithDecodingError cx input))))]- in (Optionals.match (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [- "no such field ",- (Core.unName fname),- " in union"]))) (\f -> f fterm))- _ -> Left (Errors.DecodingError "expected union")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.util.QualifiedName-qualifiedName :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Util.QualifiedName-qualifiedName cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "moduleName" (ExtractCore.decodeMaybe Packaging.moduleName) fieldMap cx) (\field_moduleName -> Eithers.bind (ExtractCore.requireField "local" (\cx2 -> \raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of- Core.TermLiteral v1 -> case v1 of- Core.LiteralString v2 -> Right v2- _ -> Left (Errors.DecodingError "expected string literal")- _ -> Left (Errors.DecodingError "expected literal")) (ExtractCore.stripWithDecodingError cx2 raw2)) fieldMap cx) (\field_local -> Right (Util.QualifiedName {- Util.qualifiedNameModuleName = field_moduleName,- Util.qualifiedNameLocal = field_local}))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.util.QualifiedName")) (ExtractCore.stripWithDecodingError cx raw)
@@ -1,56 +0,0 @@--- Note: this is an automatically generated file. Do not edit.---- | Term decoders for hydra.validation--module Hydra.Decode.Validation where--import qualified Hydra.Core as Core-import qualified Hydra.Decode.Core as DecodeCore-import qualified Hydra.Decode.Error.Core as ErrorCore-import qualified Hydra.Errors as Errors-import qualified Hydra.Extract.Core as ExtractCore-import qualified Hydra.Graph as Graph-import qualified Hydra.Lexical as Lexical-import qualified Hydra.Overlay.Haskell.Lib.Eithers as Eithers-import qualified Hydra.Rewriting as Rewriting-import qualified Hydra.Util as Util-import qualified Hydra.Validation as Validation-import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)-import qualified Data.Scientific as Sci-import Data.Void---- | Decoder for hydra.validation.ValidationProfile-validationProfile :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Validation.ValidationProfile-validationProfile cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "errorRules" (ExtractCore.decodeSet DecodeCore.name) fieldMap cx) (\field_errorRules -> Eithers.bind (ExtractCore.requireField "warningRules" (ExtractCore.decodeSet DecodeCore.name) fieldMap cx) (\field_warningRules -> Eithers.bind (ExtractCore.requireField "maxErrors" (\cx2 -> \raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of- Core.TermLiteral v1 -> case v1 of- Core.LiteralInteger v2 -> case v2 of- Core.IntegerValueInt32 v3 -> Right v3- _ -> Left (Errors.DecodingError "expected int32 value")- _ -> Left (Errors.DecodingError "expected int32 literal")- _ -> Left (Errors.DecodingError "expected literal")) (ExtractCore.stripWithDecodingError cx2 raw2)) fieldMap cx) (\field_maxErrors -> Eithers.bind (ExtractCore.requireField "maxWarnings" (\cx2 -> \raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of- Core.TermLiteral v1 -> case v1 of- Core.LiteralInteger v2 -> case v2 of- Core.IntegerValueInt32 v3 -> Right v3- _ -> Left (Errors.DecodingError "expected int32 value")- _ -> Left (Errors.DecodingError "expected int32 literal")- _ -> Left (Errors.DecodingError "expected literal")) (ExtractCore.stripWithDecodingError cx2 raw2)) fieldMap cx) (\field_maxWarnings -> Right (Validation.ValidationProfile {- Validation.validationProfileErrorRules = field_errorRules,- Validation.validationProfileWarningRules = field_warningRules,- Validation.validationProfileMaxErrors = field_maxErrors,- Validation.validationProfileMaxWarnings = field_maxWarnings}))))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.validation.ValidationProfile")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.validation.ValidationResult-validationResult :: (Graph.Graph -> Core.Term -> Either Errors.DecodingError e) -> Graph.Graph -> Core.Term -> Either Errors.DecodingError (Validation.ValidationResult e)-validationResult e cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermRecord v0 ->- let fieldMap = ExtractCore.toFieldMap v0- in (Eithers.bind (ExtractCore.requireField "errors" (ExtractCore.decodeList e) fieldMap cx) (\field_errors -> Eithers.bind (ExtractCore.requireField "warnings" (ExtractCore.decodeList e) fieldMap cx) (\field_warnings -> Right (Validation.ValidationResult {- Validation.validationResultErrors = field_errors,- Validation.validationResultWarnings = field_warnings}))))- _ -> Left (Errors.DecodingError "expected a record of type hydra.validation.ValidationResult")) (ExtractCore.stripWithDecodingError cx raw)
@@ -1,121 +0,0 @@--- Note: this is an automatically generated file. Do not edit.---- | Term decoders for hydra.variants--module Hydra.Decode.Variants where--import qualified Hydra.Core as Core-import qualified Hydra.Decode.Core as DecodeCore-import qualified Hydra.Errors as Errors-import qualified Hydra.Extract.Core as ExtractCore-import qualified Hydra.Graph as Graph-import qualified Hydra.Lexical as Lexical-import qualified Hydra.Overlay.Haskell.Lib.Eithers as Eithers-import qualified Hydra.Overlay.Haskell.Lib.Maps as Maps-import qualified Hydra.Overlay.Haskell.Lib.Optionals as Optionals-import qualified Hydra.Overlay.Haskell.Lib.Strings as Strings-import qualified Hydra.Rewriting as Rewriting-import qualified Hydra.Util as Util-import qualified Hydra.Variants as Variants-import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)-import qualified Data.Scientific as Sci-import Data.Void---- | Decoder for hydra.variants.LiteralVariant-literalVariant :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Variants.LiteralVariant-literalVariant cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermInject v0 ->- let field = Core.injectionField v0- fname = Core.fieldName field- fterm = Core.fieldTerm field- variantMap =- Maps.fromList [- (Core.Name "binary", (\input -> Eithers.map (\t -> Variants.LiteralVariantBinary) (ExtractCore.decodeUnit cx input))),- (Core.Name "boolean", (\input -> Eithers.map (\t -> Variants.LiteralVariantBoolean) (ExtractCore.decodeUnit cx input))),- (Core.Name "decimal", (\input -> Eithers.map (\t -> Variants.LiteralVariantDecimal) (ExtractCore.decodeUnit cx input))),- (Core.Name "float", (\input -> Eithers.map (\t -> Variants.LiteralVariantFloat) (ExtractCore.decodeUnit cx input))),- (Core.Name "integer", (\input -> Eithers.map (\t -> Variants.LiteralVariantInteger) (ExtractCore.decodeUnit cx input))),- (Core.Name "string", (\input -> Eithers.map (\t -> Variants.LiteralVariantString) (ExtractCore.decodeUnit cx input)))]- in (Optionals.match (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [- "no such field ",- (Core.unName fname),- " in union"]))) (\f -> f fterm))- _ -> Left (Errors.DecodingError "expected union")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.variants.TermVariant-termVariant :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Variants.TermVariant-termVariant cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermInject v0 ->- let field = Core.injectionField v0- fname = Core.fieldName field- fterm = Core.fieldTerm field- variantMap =- Maps.fromList [- (Core.Name "annotated", (\input -> Eithers.map (\t -> Variants.TermVariantAnnotated) (ExtractCore.decodeUnit cx input))),- (- Core.Name "application",- (\input -> Eithers.map (\t -> Variants.TermVariantApplication) (ExtractCore.decodeUnit cx input))),- (Core.Name "cases", (\input -> Eithers.map (\t -> Variants.TermVariantCases) (ExtractCore.decodeUnit cx input))),- (Core.Name "either", (\input -> Eithers.map (\t -> Variants.TermVariantEither) (ExtractCore.decodeUnit cx input))),- (Core.Name "inject", (\input -> Eithers.map (\t -> Variants.TermVariantInject) (ExtractCore.decodeUnit cx input))),- (Core.Name "lambda", (\input -> Eithers.map (\t -> Variants.TermVariantLambda) (ExtractCore.decodeUnit cx input))),- (Core.Name "let", (\input -> Eithers.map (\t -> Variants.TermVariantLet) (ExtractCore.decodeUnit cx input))),- (Core.Name "list", (\input -> Eithers.map (\t -> Variants.TermVariantList) (ExtractCore.decodeUnit cx input))),- (Core.Name "literal", (\input -> Eithers.map (\t -> Variants.TermVariantLiteral) (ExtractCore.decodeUnit cx input))),- (Core.Name "map", (\input -> Eithers.map (\t -> Variants.TermVariantMap) (ExtractCore.decodeUnit cx input))),- (Core.Name "optional", (\input -> Eithers.map (\t -> Variants.TermVariantOptional) (ExtractCore.decodeUnit cx input))),- (Core.Name "pair", (\input -> Eithers.map (\t -> Variants.TermVariantPair) (ExtractCore.decodeUnit cx input))),- (Core.Name "project", (\input -> Eithers.map (\t -> Variants.TermVariantProject) (ExtractCore.decodeUnit cx input))),- (Core.Name "record", (\input -> Eithers.map (\t -> Variants.TermVariantRecord) (ExtractCore.decodeUnit cx input))),- (Core.Name "set", (\input -> Eithers.map (\t -> Variants.TermVariantSet) (ExtractCore.decodeUnit cx input))),- (- Core.Name "typeApplication",- (\input -> Eithers.map (\t -> Variants.TermVariantTypeApplication) (ExtractCore.decodeUnit cx input))),- (Core.Name "typeLambda", (\input -> Eithers.map (\t -> Variants.TermVariantTypeLambda) (ExtractCore.decodeUnit cx input))),- (Core.Name "unit", (\input -> Eithers.map (\t -> Variants.TermVariantUnit) (ExtractCore.decodeUnit cx input))),- (Core.Name "unwrap", (\input -> Eithers.map (\t -> Variants.TermVariantUnwrap) (ExtractCore.decodeUnit cx input))),- (Core.Name "variable", (\input -> Eithers.map (\t -> Variants.TermVariantVariable) (ExtractCore.decodeUnit cx input))),- (Core.Name "wrap", (\input -> Eithers.map (\t -> Variants.TermVariantWrap) (ExtractCore.decodeUnit cx input)))]- in (Optionals.match (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [- "no such field ",- (Core.unName fname),- " in union"]))) (\f -> f fterm))- _ -> Left (Errors.DecodingError "expected union")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.variants.TypeVariant-typeVariant :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Variants.TypeVariant-typeVariant cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermInject v0 ->- let field = Core.injectionField v0- fname = Core.fieldName field- fterm = Core.fieldTerm field- variantMap =- Maps.fromList [- (Core.Name "annotated", (\input -> Eithers.map (\t -> Variants.TypeVariantAnnotated) (ExtractCore.decodeUnit cx input))),- (- Core.Name "application",- (\input -> Eithers.map (\t -> Variants.TypeVariantApplication) (ExtractCore.decodeUnit cx input))),- (Core.Name "effect", (\input -> Eithers.map (\t -> Variants.TypeVariantEffect) (ExtractCore.decodeUnit cx input))),- (Core.Name "either", (\input -> Eithers.map (\t -> Variants.TypeVariantEither) (ExtractCore.decodeUnit cx input))),- (Core.Name "forall", (\input -> Eithers.map (\t -> Variants.TypeVariantForall) (ExtractCore.decodeUnit cx input))),- (Core.Name "function", (\input -> Eithers.map (\t -> Variants.TypeVariantFunction) (ExtractCore.decodeUnit cx input))),- (Core.Name "list", (\input -> Eithers.map (\t -> Variants.TypeVariantList) (ExtractCore.decodeUnit cx input))),- (Core.Name "literal", (\input -> Eithers.map (\t -> Variants.TypeVariantLiteral) (ExtractCore.decodeUnit cx input))),- (Core.Name "map", (\input -> Eithers.map (\t -> Variants.TypeVariantMap) (ExtractCore.decodeUnit cx input))),- (Core.Name "optional", (\input -> Eithers.map (\t -> Variants.TypeVariantOptional) (ExtractCore.decodeUnit cx input))),- (Core.Name "pair", (\input -> Eithers.map (\t -> Variants.TypeVariantPair) (ExtractCore.decodeUnit cx input))),- (Core.Name "record", (\input -> Eithers.map (\t -> Variants.TypeVariantRecord) (ExtractCore.decodeUnit cx input))),- (Core.Name "set", (\input -> Eithers.map (\t -> Variants.TypeVariantSet) (ExtractCore.decodeUnit cx input))),- (Core.Name "union", (\input -> Eithers.map (\t -> Variants.TypeVariantUnion) (ExtractCore.decodeUnit cx input))),- (Core.Name "unit", (\input -> Eithers.map (\t -> Variants.TypeVariantUnit) (ExtractCore.decodeUnit cx input))),- (Core.Name "variable", (\input -> Eithers.map (\t -> Variants.TypeVariantVariable) (ExtractCore.decodeUnit cx input))),- (Core.Name "void", (\input -> Eithers.map (\t -> Variants.TypeVariantVoid) (ExtractCore.decodeUnit cx input))),- (Core.Name "wrap", (\input -> Eithers.map (\t -> Variants.TypeVariantWrap) (ExtractCore.decodeUnit cx input)))]- in (Optionals.match (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [- "no such field ",- (Core.unName fname),- " in union"]))) (\f -> f fterm))- _ -> Left (Errors.DecodingError "expected union")) (ExtractCore.stripWithDecodingError cx raw)
@@ -1,97 +0,0 @@--- Note: this is an automatically generated file. Do not edit.---- | Term decoders for hydra.yaml.model--module Hydra.Decode.Yaml.Model where--import qualified Hydra.Core as Core-import qualified Hydra.Decode.Core as DecodeCore-import qualified Hydra.Errors as Errors-import qualified Hydra.Extract.Core as ExtractCore-import qualified Hydra.Graph as Graph-import qualified Hydra.Lexical as Lexical-import qualified Hydra.Overlay.Haskell.Lib.Eithers as Eithers-import qualified Hydra.Overlay.Haskell.Lib.Maps as Maps-import qualified Hydra.Overlay.Haskell.Lib.Optionals as Optionals-import qualified Hydra.Overlay.Haskell.Lib.Strings as Strings-import qualified Hydra.Rewriting as Rewriting-import qualified Hydra.Util as Util-import qualified Hydra.Yaml.Model as Model-import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)-import qualified Data.Scientific as Sci-import Data.Void---- | Decoder for hydra.yaml.model.Node-node :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Model.Node-node cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermInject v0 ->- let field = Core.injectionField v0- fname = Core.fieldName field- fterm = Core.fieldTerm field- variantMap =- Maps.fromList [- (Core.Name "mapping", (\input -> Eithers.map (\t -> Model.NodeMapping t) (ExtractCore.decodeMap node node cx input))),- (Core.Name "scalar", (\input -> Eithers.map (\t -> Model.NodeScalar t) (scalar cx input))),- (Core.Name "sequence", (\input -> Eithers.map (\t -> Model.NodeSequence t) (ExtractCore.decodeList node cx input)))]- in (Optionals.match (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [- "no such field ",- (Core.unName fname),- " in union"]))) (\f -> f fterm))- _ -> Left (Errors.DecodingError "expected union")) (ExtractCore.stripWithDecodingError cx raw)---- | Decoder for hydra.yaml.model.Scalar-scalar :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Model.Scalar-scalar cx raw =- Eithers.either (\err -> Left err) (\stripped -> case stripped of- Core.TermInject v0 ->- let field = Core.injectionField v0- fname = Core.fieldName field- fterm = Core.fieldTerm field- variantMap =- Maps.fromList [- (- Core.Name "bool",- (\input -> Eithers.map (\t -> Model.ScalarBool t) (Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of- Core.TermLiteral v1 -> case v1 of- Core.LiteralBoolean v2 -> Right v2- _ -> Left (Errors.DecodingError "expected boolean literal")- _ -> Left (Errors.DecodingError "expected literal")) (ExtractCore.stripWithDecodingError cx input)))),- (- Core.Name "decimal",- (\input -> Eithers.map (\t -> Model.ScalarDecimal t) (Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of- Core.TermLiteral v1 -> case v1 of- Core.LiteralDecimal v2 -> Right v2- _ -> Left (Errors.DecodingError "expected decimal literal")- _ -> Left (Errors.DecodingError "expected literal")) (ExtractCore.stripWithDecodingError cx input)))),- (- Core.Name "float",- (\input -> Eithers.map (\t -> Model.ScalarFloat t) (Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of- Core.TermLiteral v1 -> case v1 of- Core.LiteralFloat v2 -> case v2 of- Core.FloatValueFloat64 v3 -> Right v3- _ -> Left (Errors.DecodingError "expected float64 value")- _ -> Left (Errors.DecodingError "expected float64 literal")- _ -> Left (Errors.DecodingError "expected literal")) (ExtractCore.stripWithDecodingError cx input)))),- (- Core.Name "int",- (\input -> Eithers.map (\t -> Model.ScalarInt t) (Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of- Core.TermLiteral v1 -> case v1 of- Core.LiteralInteger v2 -> case v2 of- Core.IntegerValueBigint v3 -> Right v3- _ -> Left (Errors.DecodingError "expected bigint value")- _ -> Left (Errors.DecodingError "expected bigint literal")- _ -> Left (Errors.DecodingError "expected literal")) (ExtractCore.stripWithDecodingError cx input)))),- (Core.Name "null", (\input -> Eithers.map (\t -> Model.ScalarNull) (ExtractCore.decodeUnit cx input))),- (- Core.Name "str",- (\input -> Eithers.map (\t -> Model.ScalarStr t) (Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of- Core.TermLiteral v1 -> case v1 of- Core.LiteralString v2 -> Right v2- _ -> Left (Errors.DecodingError "expected string literal")- _ -> Left (Errors.DecodingError "expected literal")) (ExtractCore.stripWithDecodingError cx input))))]- in (Optionals.match (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [- "no such field ",- (Core.unName fname),- " in union"]))) (\f -> f fterm))- _ -> Left (Errors.DecodingError "expected union")) (ExtractCore.stripWithDecodingError cx raw)
@@ -1,2258 +0,0 @@--- Note: this is an automatically generated file. Do not edit.---- | Functions for generating term decoders from type modules--module Hydra.Decoding where--import qualified Hydra.Annotations as Annotations-import qualified Hydra.Ast as Ast-import qualified Hydra.Coders as Coders-import qualified Hydra.Constants as Constants-import qualified Hydra.Core as Core-import qualified Hydra.Decode.Core as DecodeCore-import qualified Hydra.Docs as Docs-import qualified Hydra.Encode.Core as EncodeCore-import qualified Hydra.Error.Checking as Checking-import qualified Hydra.Error.Core as ErrorCore-import qualified Hydra.Error.File as ErrorFile-import qualified Hydra.Error.Packaging as ErrorPackaging-import qualified Hydra.Error.System as ErrorSystem-import qualified Hydra.Errors as Errors-import qualified Hydra.Extract.Core as ExtractCore-import qualified Hydra.File as File-import qualified Hydra.Formatting as Formatting-import qualified Hydra.Graph as Graph-import qualified Hydra.Json.Model as Model-import qualified Hydra.Lexical as Lexical-import qualified Hydra.Overlay.Haskell.Lib.Eithers as Eithers-import qualified Hydra.Overlay.Haskell.Lib.Lists as Lists-import qualified Hydra.Overlay.Haskell.Lib.Logic as Logic-import qualified Hydra.Overlay.Haskell.Lib.Maps as Maps-import qualified Hydra.Overlay.Haskell.Lib.Optionals as Optionals-import qualified Hydra.Overlay.Haskell.Lib.Sets as Sets-import qualified Hydra.Overlay.Haskell.Lib.Strings as Strings-import qualified Hydra.Names as Names-import qualified Hydra.Packaging as Packaging-import qualified Hydra.Parsing as Parsing-import qualified Hydra.Paths as Paths-import qualified Hydra.Predicates as Predicates-import qualified Hydra.Print.Core as PrintCore-import qualified Hydra.Query as Query-import qualified Hydra.Regex as Regex-import qualified Hydra.Relational as Relational-import qualified Hydra.Rewriting as Rewriting-import qualified Hydra.Scoping as Scoping-import qualified Hydra.System as System-import qualified Hydra.Tabular as Tabular-import qualified Hydra.Testing as Testing-import qualified Hydra.Time as Time-import qualified Hydra.Topology as Topology-import qualified Hydra.Typed as Typed-import qualified Hydra.Typing as Typing-import qualified Hydra.Util as Util-import qualified Hydra.Validation as Validation-import qualified Hydra.Variants as Variants-import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)-import qualified Data.Scientific as Sci-import Data.Void---- | Collect forall type variable names from a type-collectForallVariables :: Core.Type -> [Core.Name]-collectForallVariables typ =- case typ of- Core.TypeAnnotated v0 -> collectForallVariables (Core.annotatedTypeBody v0)- Core.TypeForall v0 -> Lists.cons (Core.forallTypeParameter v0) (collectForallVariables (Core.forallTypeBody v0))- _ -> []---- | Collect type variables needing Ord constraints (from Map key and Set element types)-collectOrdConstrainedVariables :: Core.Type -> [Core.Name]-collectOrdConstrainedVariables typ =- case typ of- Core.TypeAnnotated v0 -> collectOrdConstrainedVariables (Core.annotatedTypeBody v0)- Core.TypeApplication v0 -> Lists.concat2 (collectOrdConstrainedVariables (Core.applicationTypeFunction v0)) (collectOrdConstrainedVariables (Core.applicationTypeArgument v0))- Core.TypeEffect v0 -> collectOrdConstrainedVariables v0- Core.TypeEither v0 -> Lists.concat2 (collectOrdConstrainedVariables (Core.eitherTypeLeft v0)) (collectOrdConstrainedVariables (Core.eitherTypeRight v0))- Core.TypeForall v0 -> collectOrdConstrainedVariables (Core.forallTypeBody v0)- Core.TypeList v0 -> collectOrdConstrainedVariables v0- Core.TypeMap v0 -> Lists.concat [- collectTypeVariablesFromType (Core.mapTypeKeys v0),- (collectOrdConstrainedVariables (Core.mapTypeKeys v0)),- (collectOrdConstrainedVariables (Core.mapTypeValues v0))]- Core.TypeOptional v0 -> collectOrdConstrainedVariables v0- Core.TypePair v0 -> Lists.concat2 (collectOrdConstrainedVariables (Core.pairTypeFirst v0)) (collectOrdConstrainedVariables (Core.pairTypeSecond v0))- Core.TypeRecord v0 -> Lists.concat (Lists.map (\ft -> collectOrdConstrainedVariables (Core.fieldTypeType ft)) v0)- Core.TypeSet v0 -> Lists.concat2 (collectTypeVariablesFromType v0) (collectOrdConstrainedVariables v0)- Core.TypeUnion v0 -> Lists.concat (Lists.map (\ft -> collectOrdConstrainedVariables (Core.fieldTypeType ft)) v0)- Core.TypeWrap v0 -> collectOrdConstrainedVariables v0- _ -> []---- | Collect type variable names from a type (forall parameters only)-collectTypeVariables :: Core.Type -> [Core.Name]-collectTypeVariables typ = collectForallVariables typ---- | Collect all type variable names from a type expression-collectTypeVariablesFromType :: Core.Type -> [Core.Name]-collectTypeVariablesFromType typ =- case typ of- Core.TypeAnnotated v0 -> collectTypeVariablesFromType (Core.annotatedTypeBody v0)- Core.TypeApplication v0 -> Lists.concat2 (collectTypeVariablesFromType (Core.applicationTypeFunction v0)) (collectTypeVariablesFromType (Core.applicationTypeArgument v0))- Core.TypeEffect v0 -> collectTypeVariablesFromType v0- Core.TypeEither v0 -> Lists.concat2 (collectTypeVariablesFromType (Core.eitherTypeLeft v0)) (collectTypeVariablesFromType (Core.eitherTypeRight v0))- Core.TypeForall v0 -> collectTypeVariablesFromType (Core.forallTypeBody v0)- Core.TypeList v0 -> collectTypeVariablesFromType v0- Core.TypeMap v0 -> Lists.concat2 (collectTypeVariablesFromType (Core.mapTypeKeys v0)) (collectTypeVariablesFromType (Core.mapTypeValues v0))- Core.TypeOptional v0 -> collectTypeVariablesFromType v0- Core.TypePair v0 -> Lists.concat2 (collectTypeVariablesFromType (Core.pairTypeFirst v0)) (collectTypeVariablesFromType (Core.pairTypeSecond v0))- Core.TypeRecord v0 -> Lists.concat (Lists.map (\ft -> collectTypeVariablesFromType (Core.fieldTypeType ft)) v0)- Core.TypeSet v0 -> collectTypeVariablesFromType v0- Core.TypeUnion v0 -> Lists.concat (Lists.map (\ft -> collectTypeVariablesFromType (Core.fieldTypeType ft)) v0)- Core.TypeVariable v0 -> [- v0]- Core.TypeWrap v0 -> collectTypeVariablesFromType v0- _ -> []---- | Transform a type binding into a decoder binding-decodeBinding :: t0 -> Graph.Graph -> Core.Binding -> Either Errors.DecodingError Core.Binding-decodeBinding cx graph b =- Eithers.bind (DecodeCore.type_ graph (Core.bindingTerm b)) (\typ ->- let rtype = decoderFullResultTypeNamed (Core.bindingName b) typ- rawBody = decodeTypeNamed (Core.bindingName b) typ rtype- description =- Strings.concat [- "Decoder for ",- (Core.unName (Core.bindingName b))]- in (Right (Core.Binding {- Core.bindingName = (decodeBindingName (Core.bindingName b)),- Core.bindingTerm = (Annotations.setTermDescription (Just description) rawBody),- Core.bindingTypeScheme = (Just (decoderTypeSchemeNamed (Core.bindingName b) typ))})))---- | Generate a binding name for a decoder function from a type name-decodeBindingName :: Core.Name -> Core.Name-decodeBindingName =- Names.derivedBindingName [- "hydra",- "decode"] True---- | Generate a decoder for an Either type-decodeEitherType :: Core.EitherType -> Core.Term-decodeEitherType et =-- let leftDecoder = decodeType (Core.eitherTypeLeft et)- rightDecoder = decodeType (Core.eitherTypeRight et)- in (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermVariable (Core.Name "hydra.extract.core.decodeEither")),- Core.typeApplicationTermType = (decoderFullResultType (Core.eitherTypeLeft et))})),- Core.typeApplicationTermType = (decoderFullResultType (Core.eitherTypeRight et))})),- Core.applicationArgument = leftDecoder})),- Core.applicationArgument = rightDecoder}))---- | Generate a decoder for a polymorphic (forall) type-decodeForallType :: Core.ForallType -> Core.Term-decodeForallType ft =- Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (decodeBindingName (Core.forallTypeParameter ft)),- Core.lambdaDomain = (Just (Core.TypeFunction (Core.FunctionType {- Core.functionTypeDomain = (Core.TypeVariable (Core.Name "hydra.graph.Graph")),- Core.functionTypeCodomain = (Core.TypeFunction (Core.FunctionType {- Core.functionTypeDomain = (Core.TypeVariable (Core.Name "hydra.core.Term")),- Core.functionTypeCodomain = (Core.TypeEither (Core.EitherType {- Core.eitherTypeLeft = (Core.TypeVariable (Core.Name "hydra.errors.DecodingError")),- Core.eitherTypeRight = (Core.TypeVariable (Core.forallTypeParameter ft))}))}))}))),- Core.lambdaBody = (decodeType (Core.forallTypeBody ft))})---- | Generate a decoder for a list type-decodeListType :: Core.Type -> Core.Term-decodeListType elemType =-- let elemDecoder = decodeType elemType- in (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermVariable (Core.Name "hydra.extract.core.decodeList")),- Core.typeApplicationTermType = (decoderFullResultType elemType)})),- Core.applicationArgument = elemDecoder}))---- | Generate a decoder for a literal type-decodeLiteralType :: Core.LiteralType -> Core.Term-decodeLiteralType lt =- case lt of- Core.LiteralTypeBinary -> Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "cx"),- Core.lambdaDomain = (Just (Core.TypeVariable (Core.Name "hydra.graph.Graph"))),- Core.lambdaBody = (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "raw"),- Core.lambdaDomain = (Just (Core.TypeVariable (Core.Name "hydra.core.Term"))),- Core.lambdaBody = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermVariable (Core.Name "hydra.lib.eithers.either")),- Core.typeApplicationTermType = (Core.TypeVariable (Core.Name "hydra.errors.DecodingError"))})),- Core.typeApplicationTermType = (Core.TypeVariable (Core.Name "hydra.core.Term"))})),- Core.typeApplicationTermType = (Core.TypeEither (Core.EitherType {- Core.eitherTypeLeft = (Core.TypeVariable (Core.Name "hydra.errors.DecodingError")),- Core.eitherTypeRight = (Core.TypeLiteral Core.LiteralTypeBinary)}))})),- Core.applicationArgument = (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "err"),- Core.lambdaDomain = (Just (Core.TypeVariable (Core.Name "hydra.errors.DecodingError"))),- Core.lambdaBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermEither (Left (Core.TermVariable (Core.Name "err")))),- Core.typeApplicationTermType = (Core.TypeVariable (Core.Name "hydra.errors.DecodingError"))})),- Core.typeApplicationTermType = (Core.TypeLiteral Core.LiteralTypeBinary)}))}))})),- Core.applicationArgument = (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "stripped"),- Core.lambdaDomain = (Just (Core.TypeVariable (Core.Name "hydra.core.Term"))),- Core.lambdaBody = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermCases (Core.CaseStatement {- Core.caseStatementTypeName = (Core.Name "hydra.core.Term"),- Core.caseStatementDefault = (Just (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermEither (Left (Core.TermWrap (Core.WrappedTerm {- Core.wrappedTermTypeName = (Core.Name "hydra.errors.DecodingError"),- Core.wrappedTermBody = (Core.TermLiteral (Core.LiteralString "expected literal"))})))),- Core.typeApplicationTermType = (Core.TypeVariable (Core.Name "hydra.errors.DecodingError"))})),- Core.typeApplicationTermType = (Core.TypeLiteral Core.LiteralTypeBinary)}))),- Core.caseStatementCases = [- Core.CaseAlternative {- Core.caseAlternativeName = (Core.Name "literal"),- Core.caseAlternativeHandler = (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "v"),- Core.lambdaDomain = (Just (Core.TypeVariable (Core.Name "hydra.core.Literal"))),- Core.lambdaBody = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermCases (Core.CaseStatement {- Core.caseStatementTypeName = (Core.Name "hydra.core.Literal"),- Core.caseStatementDefault = (Just (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermEither (Left (Core.TermWrap (Core.WrappedTerm {- Core.wrappedTermTypeName = (Core.Name "hydra.errors.DecodingError"),- Core.wrappedTermBody = (Core.TermLiteral (Core.LiteralString "expected binary literal"))})))),- Core.typeApplicationTermType = (Core.TypeVariable (Core.Name "hydra.errors.DecodingError"))})),- Core.typeApplicationTermType = (Core.TypeLiteral Core.LiteralTypeBinary)}))),- Core.caseStatementCases = [- Core.CaseAlternative {- Core.caseAlternativeName = (Core.Name "binary"),- Core.caseAlternativeHandler = (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "b"),- Core.lambdaDomain = (Just (Core.TypeLiteral Core.LiteralTypeBinary)),- Core.lambdaBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermEither (Right (Core.TermVariable (Core.Name "b")))),- Core.typeApplicationTermType = (Core.TypeVariable (Core.Name "hydra.errors.DecodingError"))})),- Core.typeApplicationTermType = (Core.TypeLiteral Core.LiteralTypeBinary)}))}))}]})),- Core.applicationArgument = (Core.TermVariable (Core.Name "v"))}))}))}]})),- Core.applicationArgument = (Core.TermVariable (Core.Name "stripped"))}))}))})),- Core.applicationArgument = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.extract.core.stripWithDecodingError")),- Core.applicationArgument = (Core.TermVariable (Core.Name "cx"))})),- Core.applicationArgument = (Core.TermVariable (Core.Name "raw"))}))}))}))})- Core.LiteralTypeBoolean -> Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "cx"),- Core.lambdaDomain = (Just (Core.TypeVariable (Core.Name "hydra.graph.Graph"))),- Core.lambdaBody = (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "raw"),- Core.lambdaDomain = (Just (Core.TypeVariable (Core.Name "hydra.core.Term"))),- Core.lambdaBody = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermVariable (Core.Name "hydra.lib.eithers.either")),- Core.typeApplicationTermType = (Core.TypeVariable (Core.Name "hydra.errors.DecodingError"))})),- Core.typeApplicationTermType = (Core.TypeVariable (Core.Name "hydra.core.Term"))})),- Core.typeApplicationTermType = (Core.TypeEither (Core.EitherType {- Core.eitherTypeLeft = (Core.TypeVariable (Core.Name "hydra.errors.DecodingError")),- Core.eitherTypeRight = (Core.TypeLiteral Core.LiteralTypeBoolean)}))})),- Core.applicationArgument = (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "err"),- Core.lambdaDomain = (Just (Core.TypeVariable (Core.Name "hydra.errors.DecodingError"))),- Core.lambdaBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermEither (Left (Core.TermVariable (Core.Name "err")))),- Core.typeApplicationTermType = (Core.TypeVariable (Core.Name "hydra.errors.DecodingError"))})),- Core.typeApplicationTermType = (Core.TypeLiteral Core.LiteralTypeBoolean)}))}))})),- Core.applicationArgument = (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "stripped"),- Core.lambdaDomain = (Just (Core.TypeVariable (Core.Name "hydra.core.Term"))),- Core.lambdaBody = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermCases (Core.CaseStatement {- Core.caseStatementTypeName = (Core.Name "hydra.core.Term"),- Core.caseStatementDefault = (Just (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermEither (Left (Core.TermWrap (Core.WrappedTerm {- Core.wrappedTermTypeName = (Core.Name "hydra.errors.DecodingError"),- Core.wrappedTermBody = (Core.TermLiteral (Core.LiteralString "expected literal"))})))),- Core.typeApplicationTermType = (Core.TypeVariable (Core.Name "hydra.errors.DecodingError"))})),- Core.typeApplicationTermType = (Core.TypeLiteral Core.LiteralTypeBoolean)}))),- Core.caseStatementCases = [- Core.CaseAlternative {- Core.caseAlternativeName = (Core.Name "literal"),- Core.caseAlternativeHandler = (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "v"),- Core.lambdaDomain = (Just (Core.TypeVariable (Core.Name "hydra.core.Literal"))),- Core.lambdaBody = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermCases (Core.CaseStatement {- Core.caseStatementTypeName = (Core.Name "hydra.core.Literal"),- Core.caseStatementDefault = (Just (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermEither (Left (Core.TermWrap (Core.WrappedTerm {- Core.wrappedTermTypeName = (Core.Name "hydra.errors.DecodingError"),- Core.wrappedTermBody = (Core.TermLiteral (Core.LiteralString "expected boolean literal"))})))),- Core.typeApplicationTermType = (Core.TypeVariable (Core.Name "hydra.errors.DecodingError"))})),- Core.typeApplicationTermType = (Core.TypeLiteral Core.LiteralTypeBoolean)}))),- Core.caseStatementCases = [- Core.CaseAlternative {- Core.caseAlternativeName = (Core.Name "boolean"),- Core.caseAlternativeHandler = (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "b"),- Core.lambdaDomain = (Just (Core.TypeLiteral Core.LiteralTypeBoolean)),- Core.lambdaBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermEither (Right (Core.TermVariable (Core.Name "b")))),- Core.typeApplicationTermType = (Core.TypeVariable (Core.Name "hydra.errors.DecodingError"))})),- Core.typeApplicationTermType = (Core.TypeLiteral Core.LiteralTypeBoolean)}))}))}]})),- Core.applicationArgument = (Core.TermVariable (Core.Name "v"))}))}))}]})),- Core.applicationArgument = (Core.TermVariable (Core.Name "stripped"))}))}))})),- Core.applicationArgument = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.extract.core.stripWithDecodingError")),- Core.applicationArgument = (Core.TermVariable (Core.Name "cx"))})),- Core.applicationArgument = (Core.TermVariable (Core.Name "raw"))}))}))}))})- Core.LiteralTypeDecimal -> Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "cx"),- Core.lambdaDomain = (Just (Core.TypeVariable (Core.Name "hydra.graph.Graph"))),- Core.lambdaBody = (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "raw"),- Core.lambdaDomain = (Just (Core.TypeVariable (Core.Name "hydra.core.Term"))),- Core.lambdaBody = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermVariable (Core.Name "hydra.lib.eithers.either")),- Core.typeApplicationTermType = (Core.TypeVariable (Core.Name "hydra.errors.DecodingError"))})),- Core.typeApplicationTermType = (Core.TypeVariable (Core.Name "hydra.core.Term"))})),- Core.typeApplicationTermType = (Core.TypeEither (Core.EitherType {- Core.eitherTypeLeft = (Core.TypeVariable (Core.Name "hydra.errors.DecodingError")),- Core.eitherTypeRight = (Core.TypeLiteral Core.LiteralTypeDecimal)}))})),- Core.applicationArgument = (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "err"),- Core.lambdaDomain = (Just (Core.TypeVariable (Core.Name "hydra.errors.DecodingError"))),- Core.lambdaBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermEither (Left (Core.TermVariable (Core.Name "err")))),- Core.typeApplicationTermType = (Core.TypeVariable (Core.Name "hydra.errors.DecodingError"))})),- Core.typeApplicationTermType = (Core.TypeLiteral Core.LiteralTypeDecimal)}))}))})),- Core.applicationArgument = (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "stripped"),- Core.lambdaDomain = (Just (Core.TypeVariable (Core.Name "hydra.core.Term"))),- Core.lambdaBody = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermCases (Core.CaseStatement {- Core.caseStatementTypeName = (Core.Name "hydra.core.Term"),- Core.caseStatementDefault = (Just (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermEither (Left (Core.TermWrap (Core.WrappedTerm {- Core.wrappedTermTypeName = (Core.Name "hydra.errors.DecodingError"),- Core.wrappedTermBody = (Core.TermLiteral (Core.LiteralString "expected literal"))})))),- Core.typeApplicationTermType = (Core.TypeVariable (Core.Name "hydra.errors.DecodingError"))})),- Core.typeApplicationTermType = (Core.TypeLiteral Core.LiteralTypeDecimal)}))),- Core.caseStatementCases = [- Core.CaseAlternative {- Core.caseAlternativeName = (Core.Name "literal"),- Core.caseAlternativeHandler = (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "v"),- Core.lambdaDomain = (Just (Core.TypeVariable (Core.Name "hydra.core.Literal"))),- Core.lambdaBody = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermCases (Core.CaseStatement {- Core.caseStatementTypeName = (Core.Name "hydra.core.Literal"),- Core.caseStatementDefault = (Just (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermEither (Left (Core.TermWrap (Core.WrappedTerm {- Core.wrappedTermTypeName = (Core.Name "hydra.errors.DecodingError"),- Core.wrappedTermBody = (Core.TermLiteral (Core.LiteralString "expected decimal literal"))})))),- Core.typeApplicationTermType = (Core.TypeVariable (Core.Name "hydra.errors.DecodingError"))})),- Core.typeApplicationTermType = (Core.TypeLiteral Core.LiteralTypeDecimal)}))),- Core.caseStatementCases = [- Core.CaseAlternative {- Core.caseAlternativeName = (Core.Name "decimal"),- Core.caseAlternativeHandler = (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "d"),- Core.lambdaDomain = (Just (Core.TypeLiteral Core.LiteralTypeDecimal)),- Core.lambdaBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermEither (Right (Core.TermVariable (Core.Name "d")))),- Core.typeApplicationTermType = (Core.TypeVariable (Core.Name "hydra.errors.DecodingError"))})),- Core.typeApplicationTermType = (Core.TypeLiteral Core.LiteralTypeDecimal)}))}))}]})),- Core.applicationArgument = (Core.TermVariable (Core.Name "v"))}))}))}]})),- Core.applicationArgument = (Core.TermVariable (Core.Name "stripped"))}))}))})),- Core.applicationArgument = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.extract.core.stripWithDecodingError")),- Core.applicationArgument = (Core.TermVariable (Core.Name "cx"))})),- Core.applicationArgument = (Core.TermVariable (Core.Name "raw"))}))}))}))})- Core.LiteralTypeFloat v0 -> case v0 of- Core.FloatTypeFloat32 -> Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "cx"),- Core.lambdaDomain = (Just (Core.TypeVariable (Core.Name "hydra.graph.Graph"))),- Core.lambdaBody = (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "raw"),- Core.lambdaDomain = (Just (Core.TypeVariable (Core.Name "hydra.core.Term"))),- Core.lambdaBody = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermVariable (Core.Name "hydra.lib.eithers.either")),- Core.typeApplicationTermType = (Core.TypeVariable (Core.Name "hydra.errors.DecodingError"))})),- Core.typeApplicationTermType = (Core.TypeVariable (Core.Name "hydra.core.Term"))})),- Core.typeApplicationTermType = (Core.TypeEither (Core.EitherType {- Core.eitherTypeLeft = (Core.TypeVariable (Core.Name "hydra.errors.DecodingError")),- Core.eitherTypeRight = (Core.TypeLiteral (Core.LiteralTypeFloat v0))}))})),- Core.applicationArgument = (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "err"),- Core.lambdaDomain = (Just (Core.TypeVariable (Core.Name "hydra.errors.DecodingError"))),- Core.lambdaBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermEither (Left (Core.TermVariable (Core.Name "err")))),- Core.typeApplicationTermType = (Core.TypeVariable (Core.Name "hydra.errors.DecodingError"))})),- Core.typeApplicationTermType = (Core.TypeLiteral (Core.LiteralTypeFloat v0))}))}))})),- Core.applicationArgument = (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "stripped"),- Core.lambdaDomain = (Just (Core.TypeVariable (Core.Name "hydra.core.Term"))),- Core.lambdaBody = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermCases (Core.CaseStatement {- Core.caseStatementTypeName = (Core.Name "hydra.core.Term"),- Core.caseStatementDefault = (Just (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermEither (Left (Core.TermWrap (Core.WrappedTerm {- Core.wrappedTermTypeName = (Core.Name "hydra.errors.DecodingError"),- Core.wrappedTermBody = (Core.TermLiteral (Core.LiteralString "expected literal"))})))),- Core.typeApplicationTermType = (Core.TypeVariable (Core.Name "hydra.errors.DecodingError"))})),- Core.typeApplicationTermType = (Core.TypeLiteral (Core.LiteralTypeFloat v0))}))),- Core.caseStatementCases = [- Core.CaseAlternative {- Core.caseAlternativeName = (Core.Name "literal"),- Core.caseAlternativeHandler = (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "v"),- Core.lambdaDomain = (Just (Core.TypeVariable (Core.Name "hydra.core.Literal"))),- Core.lambdaBody = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermCases (Core.CaseStatement {- Core.caseStatementTypeName = (Core.Name "hydra.core.Literal"),- Core.caseStatementDefault = (Just (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermEither (Left (Core.TermWrap (Core.WrappedTerm {- Core.wrappedTermTypeName = (Core.Name "hydra.errors.DecodingError"),- Core.wrappedTermBody = (Core.TermLiteral (Core.LiteralString (Strings.concat [- "expected ",- "float32",- " literal"])))})))),- Core.typeApplicationTermType = (Core.TypeVariable (Core.Name "hydra.errors.DecodingError"))})),- Core.typeApplicationTermType = (Core.TypeLiteral (Core.LiteralTypeFloat v0))}))),- Core.caseStatementCases = [- Core.CaseAlternative {- Core.caseAlternativeName = (Core.Name "float"),- Core.caseAlternativeHandler = (Core.TermCases (Core.CaseStatement {- Core.caseStatementTypeName = (Core.Name "hydra.core.FloatValue"),- Core.caseStatementDefault = (Just (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermEither (Left (Core.TermWrap (Core.WrappedTerm {- Core.wrappedTermTypeName = (Core.Name "hydra.errors.DecodingError"),- Core.wrappedTermBody = (Core.TermLiteral (Core.LiteralString (Strings.concat [- "expected ",- "float32",- " value"])))})))),- Core.typeApplicationTermType = (Core.TypeVariable (Core.Name "hydra.errors.DecodingError"))})),- Core.typeApplicationTermType = (Core.TypeLiteral (Core.LiteralTypeFloat v0))}))),- Core.caseStatementCases = [- Core.CaseAlternative {- Core.caseAlternativeName = (Core.Name "float32"),- Core.caseAlternativeHandler = (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "f"),- Core.lambdaDomain = (Just (Core.TypeLiteral (Core.LiteralTypeFloat v0))),- Core.lambdaBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermEither (Right (Core.TermVariable (Core.Name "f")))),- Core.typeApplicationTermType = (Core.TypeVariable (Core.Name "hydra.errors.DecodingError"))})),- Core.typeApplicationTermType = (Core.TypeLiteral (Core.LiteralTypeFloat v0))}))}))}]}))}]})),- Core.applicationArgument = (Core.TermVariable (Core.Name "v"))}))}))}]})),- Core.applicationArgument = (Core.TermVariable (Core.Name "stripped"))}))}))})),- Core.applicationArgument = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.extract.core.stripWithDecodingError")),- Core.applicationArgument = (Core.TermVariable (Core.Name "cx"))})),- Core.applicationArgument = (Core.TermVariable (Core.Name "raw"))}))}))}))})- Core.FloatTypeFloat64 -> Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "cx"),- Core.lambdaDomain = (Just (Core.TypeVariable (Core.Name "hydra.graph.Graph"))),- Core.lambdaBody = (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "raw"),- Core.lambdaDomain = (Just (Core.TypeVariable (Core.Name "hydra.core.Term"))),- Core.lambdaBody = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermVariable (Core.Name "hydra.lib.eithers.either")),- Core.typeApplicationTermType = (Core.TypeVariable (Core.Name "hydra.errors.DecodingError"))})),- Core.typeApplicationTermType = (Core.TypeVariable (Core.Name "hydra.core.Term"))})),- Core.typeApplicationTermType = (Core.TypeEither (Core.EitherType {- Core.eitherTypeLeft = (Core.TypeVariable (Core.Name "hydra.errors.DecodingError")),- Core.eitherTypeRight = (Core.TypeLiteral (Core.LiteralTypeFloat v0))}))})),- Core.applicationArgument = (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "err"),- Core.lambdaDomain = (Just (Core.TypeVariable (Core.Name "hydra.errors.DecodingError"))),- Core.lambdaBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermEither (Left (Core.TermVariable (Core.Name "err")))),- Core.typeApplicationTermType = (Core.TypeVariable (Core.Name "hydra.errors.DecodingError"))})),- Core.typeApplicationTermType = (Core.TypeLiteral (Core.LiteralTypeFloat v0))}))}))})),- Core.applicationArgument = (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "stripped"),- Core.lambdaDomain = (Just (Core.TypeVariable (Core.Name "hydra.core.Term"))),- Core.lambdaBody = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermCases (Core.CaseStatement {- Core.caseStatementTypeName = (Core.Name "hydra.core.Term"),- Core.caseStatementDefault = (Just (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermEither (Left (Core.TermWrap (Core.WrappedTerm {- Core.wrappedTermTypeName = (Core.Name "hydra.errors.DecodingError"),- Core.wrappedTermBody = (Core.TermLiteral (Core.LiteralString "expected literal"))})))),- Core.typeApplicationTermType = (Core.TypeVariable (Core.Name "hydra.errors.DecodingError"))})),- Core.typeApplicationTermType = (Core.TypeLiteral (Core.LiteralTypeFloat v0))}))),- Core.caseStatementCases = [- Core.CaseAlternative {- Core.caseAlternativeName = (Core.Name "literal"),- Core.caseAlternativeHandler = (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "v"),- Core.lambdaDomain = (Just (Core.TypeVariable (Core.Name "hydra.core.Literal"))),- Core.lambdaBody = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermCases (Core.CaseStatement {- Core.caseStatementTypeName = (Core.Name "hydra.core.Literal"),- Core.caseStatementDefault = (Just (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermEither (Left (Core.TermWrap (Core.WrappedTerm {- Core.wrappedTermTypeName = (Core.Name "hydra.errors.DecodingError"),- Core.wrappedTermBody = (Core.TermLiteral (Core.LiteralString (Strings.concat [- "expected ",- "float64",- " literal"])))})))),- Core.typeApplicationTermType = (Core.TypeVariable (Core.Name "hydra.errors.DecodingError"))})),- Core.typeApplicationTermType = (Core.TypeLiteral (Core.LiteralTypeFloat v0))}))),- Core.caseStatementCases = [- Core.CaseAlternative {- Core.caseAlternativeName = (Core.Name "float"),- Core.caseAlternativeHandler = (Core.TermCases (Core.CaseStatement {- Core.caseStatementTypeName = (Core.Name "hydra.core.FloatValue"),- Core.caseStatementDefault = (Just (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermEither (Left (Core.TermWrap (Core.WrappedTerm {- Core.wrappedTermTypeName = (Core.Name "hydra.errors.DecodingError"),- Core.wrappedTermBody = (Core.TermLiteral (Core.LiteralString (Strings.concat [- "expected ",- "float64",- " value"])))})))),- Core.typeApplicationTermType = (Core.TypeVariable (Core.Name "hydra.errors.DecodingError"))})),- Core.typeApplicationTermType = (Core.TypeLiteral (Core.LiteralTypeFloat v0))}))),- Core.caseStatementCases = [- Core.CaseAlternative {- Core.caseAlternativeName = (Core.Name "float64"),- Core.caseAlternativeHandler = (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "f"),- Core.lambdaDomain = (Just (Core.TypeLiteral (Core.LiteralTypeFloat v0))),- Core.lambdaBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermEither (Right (Core.TermVariable (Core.Name "f")))),- Core.typeApplicationTermType = (Core.TypeVariable (Core.Name "hydra.errors.DecodingError"))})),- Core.typeApplicationTermType = (Core.TypeLiteral (Core.LiteralTypeFloat v0))}))}))}]}))}]})),- Core.applicationArgument = (Core.TermVariable (Core.Name "v"))}))}))}]})),- Core.applicationArgument = (Core.TermVariable (Core.Name "stripped"))}))}))})),- Core.applicationArgument = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.extract.core.stripWithDecodingError")),- Core.applicationArgument = (Core.TermVariable (Core.Name "cx"))})),- Core.applicationArgument = (Core.TermVariable (Core.Name "raw"))}))}))}))})- Core.LiteralTypeInteger v0 -> case v0 of- Core.IntegerTypeBigint -> Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "cx"),- Core.lambdaDomain = (Just (Core.TypeVariable (Core.Name "hydra.graph.Graph"))),- Core.lambdaBody = (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "raw"),- Core.lambdaDomain = (Just (Core.TypeVariable (Core.Name "hydra.core.Term"))),- Core.lambdaBody = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermVariable (Core.Name "hydra.lib.eithers.either")),- Core.typeApplicationTermType = (Core.TypeVariable (Core.Name "hydra.errors.DecodingError"))})),- Core.typeApplicationTermType = (Core.TypeVariable (Core.Name "hydra.core.Term"))})),- Core.typeApplicationTermType = (Core.TypeEither (Core.EitherType {- Core.eitherTypeLeft = (Core.TypeVariable (Core.Name "hydra.errors.DecodingError")),- Core.eitherTypeRight = (Core.TypeLiteral (Core.LiteralTypeInteger v0))}))})),- Core.applicationArgument = (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "err"),- Core.lambdaDomain = (Just (Core.TypeVariable (Core.Name "hydra.errors.DecodingError"))),- Core.lambdaBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermEither (Left (Core.TermVariable (Core.Name "err")))),- Core.typeApplicationTermType = (Core.TypeVariable (Core.Name "hydra.errors.DecodingError"))})),- Core.typeApplicationTermType = (Core.TypeLiteral (Core.LiteralTypeInteger v0))}))}))})),- Core.applicationArgument = (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "stripped"),- Core.lambdaDomain = (Just (Core.TypeVariable (Core.Name "hydra.core.Term"))),- Core.lambdaBody = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermCases (Core.CaseStatement {- Core.caseStatementTypeName = (Core.Name "hydra.core.Term"),- Core.caseStatementDefault = (Just (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermEither (Left (Core.TermWrap (Core.WrappedTerm {- Core.wrappedTermTypeName = (Core.Name "hydra.errors.DecodingError"),- Core.wrappedTermBody = (Core.TermLiteral (Core.LiteralString "expected literal"))})))),- Core.typeApplicationTermType = (Core.TypeVariable (Core.Name "hydra.errors.DecodingError"))})),- Core.typeApplicationTermType = (Core.TypeLiteral (Core.LiteralTypeInteger v0))}))),- Core.caseStatementCases = [- Core.CaseAlternative {- Core.caseAlternativeName = (Core.Name "literal"),- Core.caseAlternativeHandler = (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "v"),- Core.lambdaDomain = (Just (Core.TypeVariable (Core.Name "hydra.core.Literal"))),- Core.lambdaBody = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermCases (Core.CaseStatement {- Core.caseStatementTypeName = (Core.Name "hydra.core.Literal"),- Core.caseStatementDefault = (Just (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermEither (Left (Core.TermWrap (Core.WrappedTerm {- Core.wrappedTermTypeName = (Core.Name "hydra.errors.DecodingError"),- Core.wrappedTermBody = (Core.TermLiteral (Core.LiteralString (Strings.concat [- "expected ",- "bigint",- " literal"])))})))),- Core.typeApplicationTermType = (Core.TypeVariable (Core.Name "hydra.errors.DecodingError"))})),- Core.typeApplicationTermType = (Core.TypeLiteral (Core.LiteralTypeInteger v0))}))),- Core.caseStatementCases = [- Core.CaseAlternative {- Core.caseAlternativeName = (Core.Name "integer"),- Core.caseAlternativeHandler = (Core.TermCases (Core.CaseStatement {- Core.caseStatementTypeName = (Core.Name "hydra.core.IntegerValue"),- Core.caseStatementDefault = (Just (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermEither (Left (Core.TermWrap (Core.WrappedTerm {- Core.wrappedTermTypeName = (Core.Name "hydra.errors.DecodingError"),- Core.wrappedTermBody = (Core.TermLiteral (Core.LiteralString (Strings.concat [- "expected ",- "bigint",- " value"])))})))),- Core.typeApplicationTermType = (Core.TypeVariable (Core.Name "hydra.errors.DecodingError"))})),- Core.typeApplicationTermType = (Core.TypeLiteral (Core.LiteralTypeInteger v0))}))),- Core.caseStatementCases = [- Core.CaseAlternative {- Core.caseAlternativeName = (Core.Name "bigint"),- Core.caseAlternativeHandler = (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "i"),- Core.lambdaDomain = (Just (Core.TypeLiteral (Core.LiteralTypeInteger v0))),- Core.lambdaBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermEither (Right (Core.TermVariable (Core.Name "i")))),- Core.typeApplicationTermType = (Core.TypeVariable (Core.Name "hydra.errors.DecodingError"))})),- Core.typeApplicationTermType = (Core.TypeLiteral (Core.LiteralTypeInteger v0))}))}))}]}))}]})),- Core.applicationArgument = (Core.TermVariable (Core.Name "v"))}))}))}]})),- Core.applicationArgument = (Core.TermVariable (Core.Name "stripped"))}))}))})),- Core.applicationArgument = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.extract.core.stripWithDecodingError")),- Core.applicationArgument = (Core.TermVariable (Core.Name "cx"))})),- Core.applicationArgument = (Core.TermVariable (Core.Name "raw"))}))}))}))})- Core.IntegerTypeInt8 -> Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "cx"),- Core.lambdaDomain = (Just (Core.TypeVariable (Core.Name "hydra.graph.Graph"))),- Core.lambdaBody = (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "raw"),- Core.lambdaDomain = (Just (Core.TypeVariable (Core.Name "hydra.core.Term"))),- Core.lambdaBody = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermVariable (Core.Name "hydra.lib.eithers.either")),- Core.typeApplicationTermType = (Core.TypeVariable (Core.Name "hydra.errors.DecodingError"))})),- Core.typeApplicationTermType = (Core.TypeVariable (Core.Name "hydra.core.Term"))})),- Core.typeApplicationTermType = (Core.TypeEither (Core.EitherType {- Core.eitherTypeLeft = (Core.TypeVariable (Core.Name "hydra.errors.DecodingError")),- Core.eitherTypeRight = (Core.TypeLiteral (Core.LiteralTypeInteger v0))}))})),- Core.applicationArgument = (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "err"),- Core.lambdaDomain = (Just (Core.TypeVariable (Core.Name "hydra.errors.DecodingError"))),- Core.lambdaBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermEither (Left (Core.TermVariable (Core.Name "err")))),- Core.typeApplicationTermType = (Core.TypeVariable (Core.Name "hydra.errors.DecodingError"))})),- Core.typeApplicationTermType = (Core.TypeLiteral (Core.LiteralTypeInteger v0))}))}))})),- Core.applicationArgument = (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "stripped"),- Core.lambdaDomain = (Just (Core.TypeVariable (Core.Name "hydra.core.Term"))),- Core.lambdaBody = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermCases (Core.CaseStatement {- Core.caseStatementTypeName = (Core.Name "hydra.core.Term"),- Core.caseStatementDefault = (Just (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermEither (Left (Core.TermWrap (Core.WrappedTerm {- Core.wrappedTermTypeName = (Core.Name "hydra.errors.DecodingError"),- Core.wrappedTermBody = (Core.TermLiteral (Core.LiteralString "expected literal"))})))),- Core.typeApplicationTermType = (Core.TypeVariable (Core.Name "hydra.errors.DecodingError"))})),- Core.typeApplicationTermType = (Core.TypeLiteral (Core.LiteralTypeInteger v0))}))),- Core.caseStatementCases = [- Core.CaseAlternative {- Core.caseAlternativeName = (Core.Name "literal"),- Core.caseAlternativeHandler = (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "v"),- Core.lambdaDomain = (Just (Core.TypeVariable (Core.Name "hydra.core.Literal"))),- Core.lambdaBody = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermCases (Core.CaseStatement {- Core.caseStatementTypeName = (Core.Name "hydra.core.Literal"),- Core.caseStatementDefault = (Just (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermEither (Left (Core.TermWrap (Core.WrappedTerm {- Core.wrappedTermTypeName = (Core.Name "hydra.errors.DecodingError"),- Core.wrappedTermBody = (Core.TermLiteral (Core.LiteralString (Strings.concat [- "expected ",- "int8",- " literal"])))})))),- Core.typeApplicationTermType = (Core.TypeVariable (Core.Name "hydra.errors.DecodingError"))})),- Core.typeApplicationTermType = (Core.TypeLiteral (Core.LiteralTypeInteger v0))}))),- Core.caseStatementCases = [- Core.CaseAlternative {- Core.caseAlternativeName = (Core.Name "integer"),- Core.caseAlternativeHandler = (Core.TermCases (Core.CaseStatement {- Core.caseStatementTypeName = (Core.Name "hydra.core.IntegerValue"),- Core.caseStatementDefault = (Just (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermEither (Left (Core.TermWrap (Core.WrappedTerm {- Core.wrappedTermTypeName = (Core.Name "hydra.errors.DecodingError"),- Core.wrappedTermBody = (Core.TermLiteral (Core.LiteralString (Strings.concat [- "expected ",- "int8",- " value"])))})))),- Core.typeApplicationTermType = (Core.TypeVariable (Core.Name "hydra.errors.DecodingError"))})),- Core.typeApplicationTermType = (Core.TypeLiteral (Core.LiteralTypeInteger v0))}))),- Core.caseStatementCases = [- Core.CaseAlternative {- Core.caseAlternativeName = (Core.Name "int8"),- Core.caseAlternativeHandler = (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "i"),- Core.lambdaDomain = (Just (Core.TypeLiteral (Core.LiteralTypeInteger v0))),- Core.lambdaBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermEither (Right (Core.TermVariable (Core.Name "i")))),- Core.typeApplicationTermType = (Core.TypeVariable (Core.Name "hydra.errors.DecodingError"))})),- Core.typeApplicationTermType = (Core.TypeLiteral (Core.LiteralTypeInteger v0))}))}))}]}))}]})),- Core.applicationArgument = (Core.TermVariable (Core.Name "v"))}))}))}]})),- Core.applicationArgument = (Core.TermVariable (Core.Name "stripped"))}))}))})),- Core.applicationArgument = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.extract.core.stripWithDecodingError")),- Core.applicationArgument = (Core.TermVariable (Core.Name "cx"))})),- Core.applicationArgument = (Core.TermVariable (Core.Name "raw"))}))}))}))})- Core.IntegerTypeInt16 -> Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "cx"),- Core.lambdaDomain = (Just (Core.TypeVariable (Core.Name "hydra.graph.Graph"))),- Core.lambdaBody = (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "raw"),- Core.lambdaDomain = (Just (Core.TypeVariable (Core.Name "hydra.core.Term"))),- Core.lambdaBody = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermVariable (Core.Name "hydra.lib.eithers.either")),- Core.typeApplicationTermType = (Core.TypeVariable (Core.Name "hydra.errors.DecodingError"))})),- Core.typeApplicationTermType = (Core.TypeVariable (Core.Name "hydra.core.Term"))})),- Core.typeApplicationTermType = (Core.TypeEither (Core.EitherType {- Core.eitherTypeLeft = (Core.TypeVariable (Core.Name "hydra.errors.DecodingError")),- Core.eitherTypeRight = (Core.TypeLiteral (Core.LiteralTypeInteger v0))}))})),- Core.applicationArgument = (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "err"),- Core.lambdaDomain = (Just (Core.TypeVariable (Core.Name "hydra.errors.DecodingError"))),- Core.lambdaBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermEither (Left (Core.TermVariable (Core.Name "err")))),- Core.typeApplicationTermType = (Core.TypeVariable (Core.Name "hydra.errors.DecodingError"))})),- Core.typeApplicationTermType = (Core.TypeLiteral (Core.LiteralTypeInteger v0))}))}))})),- Core.applicationArgument = (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "stripped"),- Core.lambdaDomain = (Just (Core.TypeVariable (Core.Name "hydra.core.Term"))),- Core.lambdaBody = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermCases (Core.CaseStatement {- Core.caseStatementTypeName = (Core.Name "hydra.core.Term"),- Core.caseStatementDefault = (Just (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermEither (Left (Core.TermWrap (Core.WrappedTerm {- Core.wrappedTermTypeName = (Core.Name "hydra.errors.DecodingError"),- Core.wrappedTermBody = (Core.TermLiteral (Core.LiteralString "expected literal"))})))),- Core.typeApplicationTermType = (Core.TypeVariable (Core.Name "hydra.errors.DecodingError"))})),- Core.typeApplicationTermType = (Core.TypeLiteral (Core.LiteralTypeInteger v0))}))),- Core.caseStatementCases = [- Core.CaseAlternative {- Core.caseAlternativeName = (Core.Name "literal"),- Core.caseAlternativeHandler = (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "v"),- Core.lambdaDomain = (Just (Core.TypeVariable (Core.Name "hydra.core.Literal"))),- Core.lambdaBody = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermCases (Core.CaseStatement {- Core.caseStatementTypeName = (Core.Name "hydra.core.Literal"),- Core.caseStatementDefault = (Just (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermEither (Left (Core.TermWrap (Core.WrappedTerm {- Core.wrappedTermTypeName = (Core.Name "hydra.errors.DecodingError"),- Core.wrappedTermBody = (Core.TermLiteral (Core.LiteralString (Strings.concat [- "expected ",- "int16",- " literal"])))})))),- Core.typeApplicationTermType = (Core.TypeVariable (Core.Name "hydra.errors.DecodingError"))})),- Core.typeApplicationTermType = (Core.TypeLiteral (Core.LiteralTypeInteger v0))}))),- Core.caseStatementCases = [- Core.CaseAlternative {- Core.caseAlternativeName = (Core.Name "integer"),- Core.caseAlternativeHandler = (Core.TermCases (Core.CaseStatement {- Core.caseStatementTypeName = (Core.Name "hydra.core.IntegerValue"),- Core.caseStatementDefault = (Just (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermEither (Left (Core.TermWrap (Core.WrappedTerm {- Core.wrappedTermTypeName = (Core.Name "hydra.errors.DecodingError"),- Core.wrappedTermBody = (Core.TermLiteral (Core.LiteralString (Strings.concat [- "expected ",- "int16",- " value"])))})))),- Core.typeApplicationTermType = (Core.TypeVariable (Core.Name "hydra.errors.DecodingError"))})),- Core.typeApplicationTermType = (Core.TypeLiteral (Core.LiteralTypeInteger v0))}))),- Core.caseStatementCases = [- Core.CaseAlternative {- Core.caseAlternativeName = (Core.Name "int16"),- Core.caseAlternativeHandler = (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "i"),- Core.lambdaDomain = (Just (Core.TypeLiteral (Core.LiteralTypeInteger v0))),- Core.lambdaBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermEither (Right (Core.TermVariable (Core.Name "i")))),- Core.typeApplicationTermType = (Core.TypeVariable (Core.Name "hydra.errors.DecodingError"))})),- Core.typeApplicationTermType = (Core.TypeLiteral (Core.LiteralTypeInteger v0))}))}))}]}))}]})),- Core.applicationArgument = (Core.TermVariable (Core.Name "v"))}))}))}]})),- Core.applicationArgument = (Core.TermVariable (Core.Name "stripped"))}))}))})),- Core.applicationArgument = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.extract.core.stripWithDecodingError")),- Core.applicationArgument = (Core.TermVariable (Core.Name "cx"))})),- Core.applicationArgument = (Core.TermVariable (Core.Name "raw"))}))}))}))})- Core.IntegerTypeInt32 -> Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "cx"),- Core.lambdaDomain = (Just (Core.TypeVariable (Core.Name "hydra.graph.Graph"))),- Core.lambdaBody = (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "raw"),- Core.lambdaDomain = (Just (Core.TypeVariable (Core.Name "hydra.core.Term"))),- Core.lambdaBody = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermVariable (Core.Name "hydra.lib.eithers.either")),- Core.typeApplicationTermType = (Core.TypeVariable (Core.Name "hydra.errors.DecodingError"))})),- Core.typeApplicationTermType = (Core.TypeVariable (Core.Name "hydra.core.Term"))})),- Core.typeApplicationTermType = (Core.TypeEither (Core.EitherType {- Core.eitherTypeLeft = (Core.TypeVariable (Core.Name "hydra.errors.DecodingError")),- Core.eitherTypeRight = (Core.TypeLiteral (Core.LiteralTypeInteger v0))}))})),- Core.applicationArgument = (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "err"),- Core.lambdaDomain = (Just (Core.TypeVariable (Core.Name "hydra.errors.DecodingError"))),- Core.lambdaBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermEither (Left (Core.TermVariable (Core.Name "err")))),- Core.typeApplicationTermType = (Core.TypeVariable (Core.Name "hydra.errors.DecodingError"))})),- Core.typeApplicationTermType = (Core.TypeLiteral (Core.LiteralTypeInteger v0))}))}))})),- Core.applicationArgument = (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "stripped"),- Core.lambdaDomain = (Just (Core.TypeVariable (Core.Name "hydra.core.Term"))),- Core.lambdaBody = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermCases (Core.CaseStatement {- Core.caseStatementTypeName = (Core.Name "hydra.core.Term"),- Core.caseStatementDefault = (Just (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermEither (Left (Core.TermWrap (Core.WrappedTerm {- Core.wrappedTermTypeName = (Core.Name "hydra.errors.DecodingError"),- Core.wrappedTermBody = (Core.TermLiteral (Core.LiteralString "expected literal"))})))),- Core.typeApplicationTermType = (Core.TypeVariable (Core.Name "hydra.errors.DecodingError"))})),- Core.typeApplicationTermType = (Core.TypeLiteral (Core.LiteralTypeInteger v0))}))),- Core.caseStatementCases = [- Core.CaseAlternative {- Core.caseAlternativeName = (Core.Name "literal"),- Core.caseAlternativeHandler = (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "v"),- Core.lambdaDomain = (Just (Core.TypeVariable (Core.Name "hydra.core.Literal"))),- Core.lambdaBody = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermCases (Core.CaseStatement {- Core.caseStatementTypeName = (Core.Name "hydra.core.Literal"),- Core.caseStatementDefault = (Just (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermEither (Left (Core.TermWrap (Core.WrappedTerm {- Core.wrappedTermTypeName = (Core.Name "hydra.errors.DecodingError"),- Core.wrappedTermBody = (Core.TermLiteral (Core.LiteralString (Strings.concat [- "expected ",- "int32",- " literal"])))})))),- Core.typeApplicationTermType = (Core.TypeVariable (Core.Name "hydra.errors.DecodingError"))})),- Core.typeApplicationTermType = (Core.TypeLiteral (Core.LiteralTypeInteger v0))}))),- Core.caseStatementCases = [- Core.CaseAlternative {- Core.caseAlternativeName = (Core.Name "integer"),- Core.caseAlternativeHandler = (Core.TermCases (Core.CaseStatement {- Core.caseStatementTypeName = (Core.Name "hydra.core.IntegerValue"),- Core.caseStatementDefault = (Just (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermEither (Left (Core.TermWrap (Core.WrappedTerm {- Core.wrappedTermTypeName = (Core.Name "hydra.errors.DecodingError"),- Core.wrappedTermBody = (Core.TermLiteral (Core.LiteralString (Strings.concat [- "expected ",- "int32",- " value"])))})))),- Core.typeApplicationTermType = (Core.TypeVariable (Core.Name "hydra.errors.DecodingError"))})),- Core.typeApplicationTermType = (Core.TypeLiteral (Core.LiteralTypeInteger v0))}))),- Core.caseStatementCases = [- Core.CaseAlternative {- Core.caseAlternativeName = (Core.Name "int32"),- Core.caseAlternativeHandler = (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "i"),- Core.lambdaDomain = (Just (Core.TypeLiteral (Core.LiteralTypeInteger v0))),- Core.lambdaBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermEither (Right (Core.TermVariable (Core.Name "i")))),- Core.typeApplicationTermType = (Core.TypeVariable (Core.Name "hydra.errors.DecodingError"))})),- Core.typeApplicationTermType = (Core.TypeLiteral (Core.LiteralTypeInteger v0))}))}))}]}))}]})),- Core.applicationArgument = (Core.TermVariable (Core.Name "v"))}))}))}]})),- Core.applicationArgument = (Core.TermVariable (Core.Name "stripped"))}))}))})),- Core.applicationArgument = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.extract.core.stripWithDecodingError")),- Core.applicationArgument = (Core.TermVariable (Core.Name "cx"))})),- Core.applicationArgument = (Core.TermVariable (Core.Name "raw"))}))}))}))})- Core.IntegerTypeInt64 -> Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "cx"),- Core.lambdaDomain = (Just (Core.TypeVariable (Core.Name "hydra.graph.Graph"))),- Core.lambdaBody = (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "raw"),- Core.lambdaDomain = (Just (Core.TypeVariable (Core.Name "hydra.core.Term"))),- Core.lambdaBody = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermVariable (Core.Name "hydra.lib.eithers.either")),- Core.typeApplicationTermType = (Core.TypeVariable (Core.Name "hydra.errors.DecodingError"))})),- Core.typeApplicationTermType = (Core.TypeVariable (Core.Name "hydra.core.Term"))})),- Core.typeApplicationTermType = (Core.TypeEither (Core.EitherType {- Core.eitherTypeLeft = (Core.TypeVariable (Core.Name "hydra.errors.DecodingError")),- Core.eitherTypeRight = (Core.TypeLiteral (Core.LiteralTypeInteger v0))}))})),- Core.applicationArgument = (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "err"),- Core.lambdaDomain = (Just (Core.TypeVariable (Core.Name "hydra.errors.DecodingError"))),- Core.lambdaBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermEither (Left (Core.TermVariable (Core.Name "err")))),- Core.typeApplicationTermType = (Core.TypeVariable (Core.Name "hydra.errors.DecodingError"))})),- Core.typeApplicationTermType = (Core.TypeLiteral (Core.LiteralTypeInteger v0))}))}))})),- Core.applicationArgument = (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "stripped"),- Core.lambdaDomain = (Just (Core.TypeVariable (Core.Name "hydra.core.Term"))),- Core.lambdaBody = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermCases (Core.CaseStatement {- Core.caseStatementTypeName = (Core.Name "hydra.core.Term"),- Core.caseStatementDefault = (Just (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermEither (Left (Core.TermWrap (Core.WrappedTerm {- Core.wrappedTermTypeName = (Core.Name "hydra.errors.DecodingError"),- Core.wrappedTermBody = (Core.TermLiteral (Core.LiteralString "expected literal"))})))),- Core.typeApplicationTermType = (Core.TypeVariable (Core.Name "hydra.errors.DecodingError"))})),- Core.typeApplicationTermType = (Core.TypeLiteral (Core.LiteralTypeInteger v0))}))),- Core.caseStatementCases = [- Core.CaseAlternative {- Core.caseAlternativeName = (Core.Name "literal"),- Core.caseAlternativeHandler = (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "v"),- Core.lambdaDomain = (Just (Core.TypeVariable (Core.Name "hydra.core.Literal"))),- Core.lambdaBody = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermCases (Core.CaseStatement {- Core.caseStatementTypeName = (Core.Name "hydra.core.Literal"),- Core.caseStatementDefault = (Just (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermEither (Left (Core.TermWrap (Core.WrappedTerm {- Core.wrappedTermTypeName = (Core.Name "hydra.errors.DecodingError"),- Core.wrappedTermBody = (Core.TermLiteral (Core.LiteralString (Strings.concat [- "expected ",- "int64",- " literal"])))})))),- Core.typeApplicationTermType = (Core.TypeVariable (Core.Name "hydra.errors.DecodingError"))})),- Core.typeApplicationTermType = (Core.TypeLiteral (Core.LiteralTypeInteger v0))}))),- Core.caseStatementCases = [- Core.CaseAlternative {- Core.caseAlternativeName = (Core.Name "integer"),- Core.caseAlternativeHandler = (Core.TermCases (Core.CaseStatement {- Core.caseStatementTypeName = (Core.Name "hydra.core.IntegerValue"),- Core.caseStatementDefault = (Just (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermEither (Left (Core.TermWrap (Core.WrappedTerm {- Core.wrappedTermTypeName = (Core.Name "hydra.errors.DecodingError"),- Core.wrappedTermBody = (Core.TermLiteral (Core.LiteralString (Strings.concat [- "expected ",- "int64",- " value"])))})))),- Core.typeApplicationTermType = (Core.TypeVariable (Core.Name "hydra.errors.DecodingError"))})),- Core.typeApplicationTermType = (Core.TypeLiteral (Core.LiteralTypeInteger v0))}))),- Core.caseStatementCases = [- Core.CaseAlternative {- Core.caseAlternativeName = (Core.Name "int64"),- Core.caseAlternativeHandler = (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "i"),- Core.lambdaDomain = (Just (Core.TypeLiteral (Core.LiteralTypeInteger v0))),- Core.lambdaBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermEither (Right (Core.TermVariable (Core.Name "i")))),- Core.typeApplicationTermType = (Core.TypeVariable (Core.Name "hydra.errors.DecodingError"))})),- Core.typeApplicationTermType = (Core.TypeLiteral (Core.LiteralTypeInteger v0))}))}))}]}))}]})),- Core.applicationArgument = (Core.TermVariable (Core.Name "v"))}))}))}]})),- Core.applicationArgument = (Core.TermVariable (Core.Name "stripped"))}))}))})),- Core.applicationArgument = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.extract.core.stripWithDecodingError")),- Core.applicationArgument = (Core.TermVariable (Core.Name "cx"))})),- Core.applicationArgument = (Core.TermVariable (Core.Name "raw"))}))}))}))})- Core.IntegerTypeUint8 -> Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "cx"),- Core.lambdaDomain = (Just (Core.TypeVariable (Core.Name "hydra.graph.Graph"))),- Core.lambdaBody = (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "raw"),- Core.lambdaDomain = (Just (Core.TypeVariable (Core.Name "hydra.core.Term"))),- Core.lambdaBody = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermVariable (Core.Name "hydra.lib.eithers.either")),- Core.typeApplicationTermType = (Core.TypeVariable (Core.Name "hydra.errors.DecodingError"))})),- Core.typeApplicationTermType = (Core.TypeVariable (Core.Name "hydra.core.Term"))})),- Core.typeApplicationTermType = (Core.TypeEither (Core.EitherType {- Core.eitherTypeLeft = (Core.TypeVariable (Core.Name "hydra.errors.DecodingError")),- Core.eitherTypeRight = (Core.TypeLiteral (Core.LiteralTypeInteger v0))}))})),- Core.applicationArgument = (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "err"),- Core.lambdaDomain = (Just (Core.TypeVariable (Core.Name "hydra.errors.DecodingError"))),- Core.lambdaBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermEither (Left (Core.TermVariable (Core.Name "err")))),- Core.typeApplicationTermType = (Core.TypeVariable (Core.Name "hydra.errors.DecodingError"))})),- Core.typeApplicationTermType = (Core.TypeLiteral (Core.LiteralTypeInteger v0))}))}))})),- Core.applicationArgument = (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "stripped"),- Core.lambdaDomain = (Just (Core.TypeVariable (Core.Name "hydra.core.Term"))),- Core.lambdaBody = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermCases (Core.CaseStatement {- Core.caseStatementTypeName = (Core.Name "hydra.core.Term"),- Core.caseStatementDefault = (Just (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermEither (Left (Core.TermWrap (Core.WrappedTerm {- Core.wrappedTermTypeName = (Core.Name "hydra.errors.DecodingError"),- Core.wrappedTermBody = (Core.TermLiteral (Core.LiteralString "expected literal"))})))),- Core.typeApplicationTermType = (Core.TypeVariable (Core.Name "hydra.errors.DecodingError"))})),- Core.typeApplicationTermType = (Core.TypeLiteral (Core.LiteralTypeInteger v0))}))),- Core.caseStatementCases = [- Core.CaseAlternative {- Core.caseAlternativeName = (Core.Name "literal"),- Core.caseAlternativeHandler = (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "v"),- Core.lambdaDomain = (Just (Core.TypeVariable (Core.Name "hydra.core.Literal"))),- Core.lambdaBody = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermCases (Core.CaseStatement {- Core.caseStatementTypeName = (Core.Name "hydra.core.Literal"),- Core.caseStatementDefault = (Just (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermEither (Left (Core.TermWrap (Core.WrappedTerm {- Core.wrappedTermTypeName = (Core.Name "hydra.errors.DecodingError"),- Core.wrappedTermBody = (Core.TermLiteral (Core.LiteralString (Strings.concat [- "expected ",- "uint8",- " literal"])))})))),- Core.typeApplicationTermType = (Core.TypeVariable (Core.Name "hydra.errors.DecodingError"))})),- Core.typeApplicationTermType = (Core.TypeLiteral (Core.LiteralTypeInteger v0))}))),- Core.caseStatementCases = [- Core.CaseAlternative {- Core.caseAlternativeName = (Core.Name "integer"),- Core.caseAlternativeHandler = (Core.TermCases (Core.CaseStatement {- Core.caseStatementTypeName = (Core.Name "hydra.core.IntegerValue"),- Core.caseStatementDefault = (Just (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermEither (Left (Core.TermWrap (Core.WrappedTerm {- Core.wrappedTermTypeName = (Core.Name "hydra.errors.DecodingError"),- Core.wrappedTermBody = (Core.TermLiteral (Core.LiteralString (Strings.concat [- "expected ",- "uint8",- " value"])))})))),- Core.typeApplicationTermType = (Core.TypeVariable (Core.Name "hydra.errors.DecodingError"))})),- Core.typeApplicationTermType = (Core.TypeLiteral (Core.LiteralTypeInteger v0))}))),- Core.caseStatementCases = [- Core.CaseAlternative {- Core.caseAlternativeName = (Core.Name "uint8"),- Core.caseAlternativeHandler = (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "i"),- Core.lambdaDomain = (Just (Core.TypeLiteral (Core.LiteralTypeInteger v0))),- Core.lambdaBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermEither (Right (Core.TermVariable (Core.Name "i")))),- Core.typeApplicationTermType = (Core.TypeVariable (Core.Name "hydra.errors.DecodingError"))})),- Core.typeApplicationTermType = (Core.TypeLiteral (Core.LiteralTypeInteger v0))}))}))}]}))}]})),- Core.applicationArgument = (Core.TermVariable (Core.Name "v"))}))}))}]})),- Core.applicationArgument = (Core.TermVariable (Core.Name "stripped"))}))}))})),- Core.applicationArgument = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.extract.core.stripWithDecodingError")),- Core.applicationArgument = (Core.TermVariable (Core.Name "cx"))})),- Core.applicationArgument = (Core.TermVariable (Core.Name "raw"))}))}))}))})- Core.IntegerTypeUint16 -> Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "cx"),- Core.lambdaDomain = (Just (Core.TypeVariable (Core.Name "hydra.graph.Graph"))),- Core.lambdaBody = (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "raw"),- Core.lambdaDomain = (Just (Core.TypeVariable (Core.Name "hydra.core.Term"))),- Core.lambdaBody = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermVariable (Core.Name "hydra.lib.eithers.either")),- Core.typeApplicationTermType = (Core.TypeVariable (Core.Name "hydra.errors.DecodingError"))})),- Core.typeApplicationTermType = (Core.TypeVariable (Core.Name "hydra.core.Term"))})),- Core.typeApplicationTermType = (Core.TypeEither (Core.EitherType {- Core.eitherTypeLeft = (Core.TypeVariable (Core.Name "hydra.errors.DecodingError")),- Core.eitherTypeRight = (Core.TypeLiteral (Core.LiteralTypeInteger v0))}))})),- Core.applicationArgument = (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "err"),- Core.lambdaDomain = (Just (Core.TypeVariable (Core.Name "hydra.errors.DecodingError"))),- Core.lambdaBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermEither (Left (Core.TermVariable (Core.Name "err")))),- Core.typeApplicationTermType = (Core.TypeVariable (Core.Name "hydra.errors.DecodingError"))})),- Core.typeApplicationTermType = (Core.TypeLiteral (Core.LiteralTypeInteger v0))}))}))})),- Core.applicationArgument = (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "stripped"),- Core.lambdaDomain = (Just (Core.TypeVariable (Core.Name "hydra.core.Term"))),- Core.lambdaBody = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermCases (Core.CaseStatement {- Core.caseStatementTypeName = (Core.Name "hydra.core.Term"),- Core.caseStatementDefault = (Just (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermEither (Left (Core.TermWrap (Core.WrappedTerm {- Core.wrappedTermTypeName = (Core.Name "hydra.errors.DecodingError"),- Core.wrappedTermBody = (Core.TermLiteral (Core.LiteralString "expected literal"))})))),- Core.typeApplicationTermType = (Core.TypeVariable (Core.Name "hydra.errors.DecodingError"))})),- Core.typeApplicationTermType = (Core.TypeLiteral (Core.LiteralTypeInteger v0))}))),- Core.caseStatementCases = [- Core.CaseAlternative {- Core.caseAlternativeName = (Core.Name "literal"),- Core.caseAlternativeHandler = (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "v"),- Core.lambdaDomain = (Just (Core.TypeVariable (Core.Name "hydra.core.Literal"))),- Core.lambdaBody = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermCases (Core.CaseStatement {- Core.caseStatementTypeName = (Core.Name "hydra.core.Literal"),- Core.caseStatementDefault = (Just (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermEither (Left (Core.TermWrap (Core.WrappedTerm {- Core.wrappedTermTypeName = (Core.Name "hydra.errors.DecodingError"),- Core.wrappedTermBody = (Core.TermLiteral (Core.LiteralString (Strings.concat [- "expected ",- "uint16",- " literal"])))})))),- Core.typeApplicationTermType = (Core.TypeVariable (Core.Name "hydra.errors.DecodingError"))})),- Core.typeApplicationTermType = (Core.TypeLiteral (Core.LiteralTypeInteger v0))}))),- Core.caseStatementCases = [- Core.CaseAlternative {- Core.caseAlternativeName = (Core.Name "integer"),- Core.caseAlternativeHandler = (Core.TermCases (Core.CaseStatement {- Core.caseStatementTypeName = (Core.Name "hydra.core.IntegerValue"),- Core.caseStatementDefault = (Just (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermEither (Left (Core.TermWrap (Core.WrappedTerm {- Core.wrappedTermTypeName = (Core.Name "hydra.errors.DecodingError"),- Core.wrappedTermBody = (Core.TermLiteral (Core.LiteralString (Strings.concat [- "expected ",- "uint16",- " value"])))})))),- Core.typeApplicationTermType = (Core.TypeVariable (Core.Name "hydra.errors.DecodingError"))})),- Core.typeApplicationTermType = (Core.TypeLiteral (Core.LiteralTypeInteger v0))}))),- Core.caseStatementCases = [- Core.CaseAlternative {- Core.caseAlternativeName = (Core.Name "uint16"),- Core.caseAlternativeHandler = (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "i"),- Core.lambdaDomain = (Just (Core.TypeLiteral (Core.LiteralTypeInteger v0))),- Core.lambdaBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermEither (Right (Core.TermVariable (Core.Name "i")))),- Core.typeApplicationTermType = (Core.TypeVariable (Core.Name "hydra.errors.DecodingError"))})),- Core.typeApplicationTermType = (Core.TypeLiteral (Core.LiteralTypeInteger v0))}))}))}]}))}]})),- Core.applicationArgument = (Core.TermVariable (Core.Name "v"))}))}))}]})),- Core.applicationArgument = (Core.TermVariable (Core.Name "stripped"))}))}))})),- Core.applicationArgument = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.extract.core.stripWithDecodingError")),- Core.applicationArgument = (Core.TermVariable (Core.Name "cx"))})),- Core.applicationArgument = (Core.TermVariable (Core.Name "raw"))}))}))}))})- Core.IntegerTypeUint32 -> Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "cx"),- Core.lambdaDomain = (Just (Core.TypeVariable (Core.Name "hydra.graph.Graph"))),- Core.lambdaBody = (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "raw"),- Core.lambdaDomain = (Just (Core.TypeVariable (Core.Name "hydra.core.Term"))),- Core.lambdaBody = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermVariable (Core.Name "hydra.lib.eithers.either")),- Core.typeApplicationTermType = (Core.TypeVariable (Core.Name "hydra.errors.DecodingError"))})),- Core.typeApplicationTermType = (Core.TypeVariable (Core.Name "hydra.core.Term"))})),- Core.typeApplicationTermType = (Core.TypeEither (Core.EitherType {- Core.eitherTypeLeft = (Core.TypeVariable (Core.Name "hydra.errors.DecodingError")),- Core.eitherTypeRight = (Core.TypeLiteral (Core.LiteralTypeInteger v0))}))})),- Core.applicationArgument = (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "err"),- Core.lambdaDomain = (Just (Core.TypeVariable (Core.Name "hydra.errors.DecodingError"))),- Core.lambdaBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermEither (Left (Core.TermVariable (Core.Name "err")))),- Core.typeApplicationTermType = (Core.TypeVariable (Core.Name "hydra.errors.DecodingError"))})),- Core.typeApplicationTermType = (Core.TypeLiteral (Core.LiteralTypeInteger v0))}))}))})),- Core.applicationArgument = (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "stripped"),- Core.lambdaDomain = (Just (Core.TypeVariable (Core.Name "hydra.core.Term"))),- Core.lambdaBody = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermCases (Core.CaseStatement {- Core.caseStatementTypeName = (Core.Name "hydra.core.Term"),- Core.caseStatementDefault = (Just (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermEither (Left (Core.TermWrap (Core.WrappedTerm {- Core.wrappedTermTypeName = (Core.Name "hydra.errors.DecodingError"),- Core.wrappedTermBody = (Core.TermLiteral (Core.LiteralString "expected literal"))})))),- Core.typeApplicationTermType = (Core.TypeVariable (Core.Name "hydra.errors.DecodingError"))})),- Core.typeApplicationTermType = (Core.TypeLiteral (Core.LiteralTypeInteger v0))}))),- Core.caseStatementCases = [- Core.CaseAlternative {- Core.caseAlternativeName = (Core.Name "literal"),- Core.caseAlternativeHandler = (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "v"),- Core.lambdaDomain = (Just (Core.TypeVariable (Core.Name "hydra.core.Literal"))),- Core.lambdaBody = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermCases (Core.CaseStatement {- Core.caseStatementTypeName = (Core.Name "hydra.core.Literal"),- Core.caseStatementDefault = (Just (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermEither (Left (Core.TermWrap (Core.WrappedTerm {- Core.wrappedTermTypeName = (Core.Name "hydra.errors.DecodingError"),- Core.wrappedTermBody = (Core.TermLiteral (Core.LiteralString (Strings.concat [- "expected ",- "uint32",- " literal"])))})))),- Core.typeApplicationTermType = (Core.TypeVariable (Core.Name "hydra.errors.DecodingError"))})),- Core.typeApplicationTermType = (Core.TypeLiteral (Core.LiteralTypeInteger v0))}))),- Core.caseStatementCases = [- Core.CaseAlternative {- Core.caseAlternativeName = (Core.Name "integer"),- Core.caseAlternativeHandler = (Core.TermCases (Core.CaseStatement {- Core.caseStatementTypeName = (Core.Name "hydra.core.IntegerValue"),- Core.caseStatementDefault = (Just (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermEither (Left (Core.TermWrap (Core.WrappedTerm {- Core.wrappedTermTypeName = (Core.Name "hydra.errors.DecodingError"),- Core.wrappedTermBody = (Core.TermLiteral (Core.LiteralString (Strings.concat [- "expected ",- "uint32",- " value"])))})))),- Core.typeApplicationTermType = (Core.TypeVariable (Core.Name "hydra.errors.DecodingError"))})),- Core.typeApplicationTermType = (Core.TypeLiteral (Core.LiteralTypeInteger v0))}))),- Core.caseStatementCases = [- Core.CaseAlternative {- Core.caseAlternativeName = (Core.Name "uint32"),- Core.caseAlternativeHandler = (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "i"),- Core.lambdaDomain = (Just (Core.TypeLiteral (Core.LiteralTypeInteger v0))),- Core.lambdaBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermEither (Right (Core.TermVariable (Core.Name "i")))),- Core.typeApplicationTermType = (Core.TypeVariable (Core.Name "hydra.errors.DecodingError"))})),- Core.typeApplicationTermType = (Core.TypeLiteral (Core.LiteralTypeInteger v0))}))}))}]}))}]})),- Core.applicationArgument = (Core.TermVariable (Core.Name "v"))}))}))}]})),- Core.applicationArgument = (Core.TermVariable (Core.Name "stripped"))}))}))})),- Core.applicationArgument = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.extract.core.stripWithDecodingError")),- Core.applicationArgument = (Core.TermVariable (Core.Name "cx"))})),- Core.applicationArgument = (Core.TermVariable (Core.Name "raw"))}))}))}))})- Core.IntegerTypeUint64 -> Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "cx"),- Core.lambdaDomain = (Just (Core.TypeVariable (Core.Name "hydra.graph.Graph"))),- Core.lambdaBody = (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "raw"),- Core.lambdaDomain = (Just (Core.TypeVariable (Core.Name "hydra.core.Term"))),- Core.lambdaBody = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermVariable (Core.Name "hydra.lib.eithers.either")),- Core.typeApplicationTermType = (Core.TypeVariable (Core.Name "hydra.errors.DecodingError"))})),- Core.typeApplicationTermType = (Core.TypeVariable (Core.Name "hydra.core.Term"))})),- Core.typeApplicationTermType = (Core.TypeEither (Core.EitherType {- Core.eitherTypeLeft = (Core.TypeVariable (Core.Name "hydra.errors.DecodingError")),- Core.eitherTypeRight = (Core.TypeLiteral (Core.LiteralTypeInteger v0))}))})),- Core.applicationArgument = (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "err"),- Core.lambdaDomain = (Just (Core.TypeVariable (Core.Name "hydra.errors.DecodingError"))),- Core.lambdaBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermEither (Left (Core.TermVariable (Core.Name "err")))),- Core.typeApplicationTermType = (Core.TypeVariable (Core.Name "hydra.errors.DecodingError"))})),- Core.typeApplicationTermType = (Core.TypeLiteral (Core.LiteralTypeInteger v0))}))}))})),- Core.applicationArgument = (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "stripped"),- Core.lambdaDomain = (Just (Core.TypeVariable (Core.Name "hydra.core.Term"))),- Core.lambdaBody = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermCases (Core.CaseStatement {- Core.caseStatementTypeName = (Core.Name "hydra.core.Term"),- Core.caseStatementDefault = (Just (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermEither (Left (Core.TermWrap (Core.WrappedTerm {- Core.wrappedTermTypeName = (Core.Name "hydra.errors.DecodingError"),- Core.wrappedTermBody = (Core.TermLiteral (Core.LiteralString "expected literal"))})))),- Core.typeApplicationTermType = (Core.TypeVariable (Core.Name "hydra.errors.DecodingError"))})),- Core.typeApplicationTermType = (Core.TypeLiteral (Core.LiteralTypeInteger v0))}))),- Core.caseStatementCases = [- Core.CaseAlternative {- Core.caseAlternativeName = (Core.Name "literal"),- Core.caseAlternativeHandler = (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "v"),- Core.lambdaDomain = (Just (Core.TypeVariable (Core.Name "hydra.core.Literal"))),- Core.lambdaBody = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermCases (Core.CaseStatement {- Core.caseStatementTypeName = (Core.Name "hydra.core.Literal"),- Core.caseStatementDefault = (Just (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermEither (Left (Core.TermWrap (Core.WrappedTerm {- Core.wrappedTermTypeName = (Core.Name "hydra.errors.DecodingError"),- Core.wrappedTermBody = (Core.TermLiteral (Core.LiteralString (Strings.concat [- "expected ",- "uint64",- " literal"])))})))),- Core.typeApplicationTermType = (Core.TypeVariable (Core.Name "hydra.errors.DecodingError"))})),- Core.typeApplicationTermType = (Core.TypeLiteral (Core.LiteralTypeInteger v0))}))),- Core.caseStatementCases = [- Core.CaseAlternative {- Core.caseAlternativeName = (Core.Name "integer"),- Core.caseAlternativeHandler = (Core.TermCases (Core.CaseStatement {- Core.caseStatementTypeName = (Core.Name "hydra.core.IntegerValue"),- Core.caseStatementDefault = (Just (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermEither (Left (Core.TermWrap (Core.WrappedTerm {- Core.wrappedTermTypeName = (Core.Name "hydra.errors.DecodingError"),- Core.wrappedTermBody = (Core.TermLiteral (Core.LiteralString (Strings.concat [- "expected ",- "uint64",- " value"])))})))),- Core.typeApplicationTermType = (Core.TypeVariable (Core.Name "hydra.errors.DecodingError"))})),- Core.typeApplicationTermType = (Core.TypeLiteral (Core.LiteralTypeInteger v0))}))),- Core.caseStatementCases = [- Core.CaseAlternative {- Core.caseAlternativeName = (Core.Name "uint64"),- Core.caseAlternativeHandler = (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "i"),- Core.lambdaDomain = (Just (Core.TypeLiteral (Core.LiteralTypeInteger v0))),- Core.lambdaBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermEither (Right (Core.TermVariable (Core.Name "i")))),- Core.typeApplicationTermType = (Core.TypeVariable (Core.Name "hydra.errors.DecodingError"))})),- Core.typeApplicationTermType = (Core.TypeLiteral (Core.LiteralTypeInteger v0))}))}))}]}))}]})),- Core.applicationArgument = (Core.TermVariable (Core.Name "v"))}))}))}]})),- Core.applicationArgument = (Core.TermVariable (Core.Name "stripped"))}))}))})),- Core.applicationArgument = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.extract.core.stripWithDecodingError")),- Core.applicationArgument = (Core.TermVariable (Core.Name "cx"))})),- Core.applicationArgument = (Core.TermVariable (Core.Name "raw"))}))}))}))})- Core.LiteralTypeString -> Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "cx"),- Core.lambdaDomain = (Just (Core.TypeVariable (Core.Name "hydra.graph.Graph"))),- Core.lambdaBody = (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "raw"),- Core.lambdaDomain = (Just (Core.TypeVariable (Core.Name "hydra.core.Term"))),- Core.lambdaBody = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermVariable (Core.Name "hydra.lib.eithers.either")),- Core.typeApplicationTermType = (Core.TypeVariable (Core.Name "hydra.errors.DecodingError"))})),- Core.typeApplicationTermType = (Core.TypeVariable (Core.Name "hydra.core.Term"))})),- Core.typeApplicationTermType = (Core.TypeEither (Core.EitherType {- Core.eitherTypeLeft = (Core.TypeVariable (Core.Name "hydra.errors.DecodingError")),- Core.eitherTypeRight = (Core.TypeLiteral Core.LiteralTypeString)}))})),- Core.applicationArgument = (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "err"),- Core.lambdaDomain = (Just (Core.TypeVariable (Core.Name "hydra.errors.DecodingError"))),- Core.lambdaBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermEither (Left (Core.TermVariable (Core.Name "err")))),- Core.typeApplicationTermType = (Core.TypeVariable (Core.Name "hydra.errors.DecodingError"))})),- Core.typeApplicationTermType = (Core.TypeLiteral Core.LiteralTypeString)}))}))})),- Core.applicationArgument = (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "stripped"),- Core.lambdaDomain = (Just (Core.TypeVariable (Core.Name "hydra.core.Term"))),- Core.lambdaBody = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermCases (Core.CaseStatement {- Core.caseStatementTypeName = (Core.Name "hydra.core.Term"),- Core.caseStatementDefault = (Just (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermEither (Left (Core.TermWrap (Core.WrappedTerm {- Core.wrappedTermTypeName = (Core.Name "hydra.errors.DecodingError"),- Core.wrappedTermBody = (Core.TermLiteral (Core.LiteralString "expected literal"))})))),- Core.typeApplicationTermType = (Core.TypeVariable (Core.Name "hydra.errors.DecodingError"))})),- Core.typeApplicationTermType = (Core.TypeLiteral Core.LiteralTypeString)}))),- Core.caseStatementCases = [- Core.CaseAlternative {- Core.caseAlternativeName = (Core.Name "literal"),- Core.caseAlternativeHandler = (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "v"),- Core.lambdaDomain = (Just (Core.TypeVariable (Core.Name "hydra.core.Literal"))),- Core.lambdaBody = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermCases (Core.CaseStatement {- Core.caseStatementTypeName = (Core.Name "hydra.core.Literal"),- Core.caseStatementDefault = (Just (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermEither (Left (Core.TermWrap (Core.WrappedTerm {- Core.wrappedTermTypeName = (Core.Name "hydra.errors.DecodingError"),- Core.wrappedTermBody = (Core.TermLiteral (Core.LiteralString "expected string literal"))})))),- Core.typeApplicationTermType = (Core.TypeVariable (Core.Name "hydra.errors.DecodingError"))})),- Core.typeApplicationTermType = (Core.TypeLiteral Core.LiteralTypeString)}))),- Core.caseStatementCases = [- Core.CaseAlternative {- Core.caseAlternativeName = (Core.Name "string"),- Core.caseAlternativeHandler = (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "s"),- Core.lambdaDomain = (Just (Core.TypeLiteral Core.LiteralTypeString)),- Core.lambdaBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermEither (Right (Core.TermVariable (Core.Name "s")))),- Core.typeApplicationTermType = (Core.TypeVariable (Core.Name "hydra.errors.DecodingError"))})),- Core.typeApplicationTermType = (Core.TypeLiteral Core.LiteralTypeString)}))}))}]})),- Core.applicationArgument = (Core.TermVariable (Core.Name "v"))}))}))}]})),- Core.applicationArgument = (Core.TermVariable (Core.Name "stripped"))}))}))})),- Core.applicationArgument = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.extract.core.stripWithDecodingError")),- Core.applicationArgument = (Core.TermVariable (Core.Name "cx"))})),- Core.applicationArgument = (Core.TermVariable (Core.Name "raw"))}))}))}))})---- | Generate a decoder for a map type-decodeMapType :: Core.MapType -> Core.Term-decodeMapType mt =-- let keyDecoder = decodeType (Core.mapTypeKeys mt)- valDecoder = decodeType (Core.mapTypeValues mt)- in (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermVariable (Core.Name "hydra.extract.core.decodeMap")),- Core.typeApplicationTermType = (decoderFullResultType (Core.mapTypeKeys mt))})),- Core.typeApplicationTermType = (decoderFullResultType (Core.mapTypeValues mt))})),- Core.applicationArgument = keyDecoder})),- Core.applicationArgument = valDecoder}))---- | Generate a decoder for an optional type-decodeMaybeType :: Core.Type -> Core.Term-decodeMaybeType elemType =-- let elemDecoder = decodeType elemType- in (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermVariable (Core.Name "hydra.extract.core.decodeMaybe")),- Core.typeApplicationTermType = (decoderFullResultType elemType)})),- Core.applicationArgument = elemDecoder}))---- | Transform a type module into a decoder module-decodeModule :: t0 -> Graph.Graph -> Packaging.Module -> Either Errors.Error (Maybe Packaging.Module)-decodeModule cx graph mod =- Eithers.bind (filterTypeBindings cx graph (Optionals.givens (Lists.map (\d -> case d of- Packaging.DefinitionType v0 -> Just ((\name -> \typ ->- let schemaTerm = Core.TermVariable (Core.Name "hydra.core.Type")- dataTerm =- Annotations.normalizeTermAnnotations (Core.TermAnnotated (Core.AnnotatedTerm {- Core.annotatedTermBody = (EncodeCore.type_ typ),- Core.annotatedTermAnnotation = (Annotations.wrapAnnotationMap (Maps.fromList [- (Constants.keyType, schemaTerm)]))}))- in Core.Binding {- Core.bindingName = name,- Core.bindingTerm = dataTerm,- Core.bindingTypeScheme = (Just (Core.TypeScheme {- Core.typeSchemeVariables = [],- Core.typeSchemeBody = (Core.TypeVariable (Core.Name "hydra.core.Type")),- Core.typeSchemeConstraints = Maps.empty}))}) (Packaging.typeDefinitionName v0) (Core.typeSchemeBody (Packaging.typeDefinitionBody v0)))- _ -> Nothing) (Packaging.moduleDefinitions mod)))) (\typeBindings -> Logic.ifElse (Lists.isEmpty typeBindings) (Right Nothing) (Eithers.bind (Eithers.mapList (\b -> Eithers.bimap (\_e -> Errors.ErrorDecoding _e) (\x -> x) (decodeBinding cx graph b)) typeBindings) (\decodedBindings ->- let allDecodedDeps =- Lists.distinct (Lists.map decodeModuleName (Lists.map (\dep -> Packaging.moduleDependencyModule dep) (Packaging.moduleDependencies mod)))- in (Right (Just (Packaging.Module {- Packaging.moduleName = (decodeModuleName (Packaging.moduleName mod)),- Packaging.moduleMetadata = (Just (Packaging.EntityMetadata {- Packaging.entityMetadataDescription = (Just (Strings.concat [- "Term decoders for ",- (Packaging.unModuleName (Packaging.moduleName mod))])),- Packaging.entityMetadataComments = [],- Packaging.entityMetadataSeeAlso = [],- Packaging.entityMetadataLifecycle = Nothing,- Packaging.entityMetadataProvisions = []})),- Packaging.moduleDependencies = (Lists.map (\ns -> Packaging.ModuleDependency {- Packaging.moduleDependencyModule = ns,- Packaging.moduleDependencyPackage = Nothing}) (Lists.concat2 [- Packaging.ModuleName "hydra.extract.core",- (Packaging.ModuleName "hydra.lexical"),- (Packaging.ModuleName "hydra.rewriting"),- (Packaging.moduleName mod),- (Packaging.ModuleName "hydra.util")] allDecodedDeps)),- Packaging.moduleDefinitions = (Lists.map (\b -> Packaging.DefinitionTerm (Packaging.TermDefinition {- Packaging.termDefinitionName = (Core.bindingName b),- Packaging.termDefinitionMetadata = Nothing,- Packaging.termDefinitionSignature = (Optionals.map Scoping.typeSchemeToTermSignature (Core.bindingTypeScheme b)),- Packaging.termDefinitionBody = (Core.bindingTerm b)})) decodedBindings)}))))))---- | Generate a decoder module name from a source module name-decodeModuleName :: Packaging.ModuleName -> Packaging.ModuleName-decodeModuleName =- Names.derivedModuleName [- "hydra",- "decode"] True---- | Generate a decoder for a pair type-decodePairType :: Core.PairType -> Core.Term-decodePairType pt =-- let firstDecoder = decodeType (Core.pairTypeFirst pt)- secondDecoder = decodeType (Core.pairTypeSecond pt)- in (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermVariable (Core.Name "hydra.extract.core.decodePair")),- Core.typeApplicationTermType = (decoderFullResultType (Core.pairTypeFirst pt))})),- Core.typeApplicationTermType = (decoderFullResultType (Core.pairTypeSecond pt))})),- Core.applicationArgument = firstDecoder})),- Core.applicationArgument = secondDecoder}))---- | Generate a decoder for a record type-decodeRecordType :: [Core.FieldType] -> Core.Term-decodeRecordType rt = decodeRecordTypeImpl (Core.Name "unknown") rt (Core.TypeVariable (Core.Name "unknown"))---- | Generate a decoder for a record type with a type name. rtype is the fully-applied result type (e.g. Table<v>) used for the record's body annotations. (#476)-decodeRecordTypeImpl :: Core.Name -> [Core.FieldType] -> Core.Type -> Core.Term-decodeRecordTypeImpl tname rt rtype =-- let recType = rtype- graphType = Core.TypeVariable (Core.Name "hydra.graph.Graph")- termType = Core.TypeVariable (Core.Name "hydra.core.Term")- decodeFieldTerm =- \ft -> Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermVariable (Core.Name "hydra.extract.core.requireField")),- Core.typeApplicationTermType = graphType})),- Core.typeApplicationTermType = termType})),- Core.typeApplicationTermType = (decoderFullResultType (Core.fieldTypeType ft))})),- Core.applicationArgument = (Core.TermLiteral (Core.LiteralString (Core.unName (Core.fieldTypeName ft))))})),- Core.applicationArgument = (decodeType (Core.fieldTypeType ft))})),- Core.applicationArgument = (Core.TermVariable (Core.Name "fieldMap"))})),- Core.applicationArgument = (Core.TermVariable (Core.Name "cx"))})- localVarName =- \ft -> Core.Name (Strings.concat [- "field_",- (Core.unName (Core.fieldTypeName ft))])- toFieldLambda =- \ft -> \body -> Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (localVarName ft),- Core.lambdaDomain = (Just (decoderFullResultType (Core.fieldTypeType ft))),- Core.lambdaBody = body})- decodeBody =- Lists.foldl (\acc -> \ft -> Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermVariable (Core.Name "hydra.lib.eithers.bind")),- Core.typeApplicationTermType = (Core.TypeVariable (Core.Name "hydra.errors.DecodingError"))})),- Core.typeApplicationTermType = (decoderFullResultType (Core.fieldTypeType ft))})),- Core.typeApplicationTermType = recType})),- Core.applicationArgument = (decodeFieldTerm ft)})),- Core.applicationArgument = (toFieldLambda ft acc)})) (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermEither (Right (Core.TermRecord (Core.Record {- Core.recordTypeName = tname,- Core.recordFields = (Lists.map (\ft -> Core.Field {- Core.fieldName = (Core.fieldTypeName ft),- Core.fieldTerm = (Core.TermVariable (localVarName ft))}) rt)})))),- Core.typeApplicationTermType = (Core.TypeVariable (Core.Name "hydra.errors.DecodingError"))})),- Core.typeApplicationTermType = recType})) (Lists.reverse rt)- in (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "cx"),- Core.lambdaDomain = (Just (Core.TypeVariable (Core.Name "hydra.graph.Graph"))),- Core.lambdaBody = (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "raw"),- Core.lambdaDomain = (Just (Core.TypeVariable (Core.Name "hydra.core.Term"))),- Core.lambdaBody = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermVariable (Core.Name "hydra.lib.eithers.either")),- Core.typeApplicationTermType = (Core.TypeVariable (Core.Name "hydra.errors.DecodingError"))})),- Core.typeApplicationTermType = (Core.TypeVariable (Core.Name "hydra.core.Term"))})),- Core.typeApplicationTermType = (Core.TypeEither (Core.EitherType {- Core.eitherTypeLeft = (Core.TypeVariable (Core.Name "hydra.errors.DecodingError")),- Core.eitherTypeRight = recType}))})),- Core.applicationArgument = (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "err"),- Core.lambdaDomain = (Just (Core.TypeVariable (Core.Name "hydra.errors.DecodingError"))),- Core.lambdaBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermEither (Left (Core.TermVariable (Core.Name "err")))),- Core.typeApplicationTermType = (Core.TypeVariable (Core.Name "hydra.errors.DecodingError"))})),- Core.typeApplicationTermType = recType}))}))})),- Core.applicationArgument = (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "stripped"),- Core.lambdaDomain = (Just (Core.TypeVariable (Core.Name "hydra.core.Term"))),- Core.lambdaBody = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermCases (Core.CaseStatement {- Core.caseStatementTypeName = (Core.Name "hydra.core.Term"),- Core.caseStatementDefault = (Just (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermEither (Left (Core.TermWrap (Core.WrappedTerm {- Core.wrappedTermTypeName = (Core.Name "hydra.errors.DecodingError"),- Core.wrappedTermBody = (Core.TermLiteral (Core.LiteralString (Strings.concat [- "expected a record of type ",- (Core.unName tname)])))})))),- Core.typeApplicationTermType = (Core.TypeVariable (Core.Name "hydra.errors.DecodingError"))})),- Core.typeApplicationTermType = recType}))),- Core.caseStatementCases = [- Core.CaseAlternative {- Core.caseAlternativeName = (Core.Name "record"),- Core.caseAlternativeHandler = (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "record"),- Core.lambdaDomain = (Just (Core.TypeVariable (Core.Name "hydra.core.Record"))),- Core.lambdaBody = (Core.TermLet (Core.Let {- Core.letBindings = [- Core.Binding {- Core.bindingName = (Core.Name "fieldMap"),- Core.bindingTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.extract.core.toFieldMap")),- Core.applicationArgument = (Core.TermVariable (Core.Name "record"))})),- Core.bindingTypeScheme = (Just (Core.TypeScheme {- Core.typeSchemeVariables = [],- Core.typeSchemeBody = (Core.TypeMap (Core.MapType {- Core.mapTypeKeys = (Core.TypeVariable (Core.Name "hydra.core.Name")),- Core.mapTypeValues = (Core.TypeVariable (Core.Name "hydra.core.Term"))})),- Core.typeSchemeConstraints = Maps.empty}))}],- Core.letBody = decodeBody}))}))}]})),- Core.applicationArgument = (Core.TermVariable (Core.Name "stripped"))}))}))})),- Core.applicationArgument = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.extract.core.stripWithDecodingError")),- Core.applicationArgument = (Core.TermVariable (Core.Name "cx"))})),- Core.applicationArgument = (Core.TermVariable (Core.Name "raw"))}))}))}))}))---- | Generate a decoder for a record type with element name-decodeRecordTypeNamed :: Core.Name -> [Core.FieldType] -> Core.Type -> Core.Term-decodeRecordTypeNamed ename rt rtype = decodeRecordTypeImpl ename rt rtype---- | Generate a decoder for a set type-decodeSetType :: Core.Type -> Core.Term-decodeSetType elemType =-- let elemDecoder = decodeType elemType- in (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermVariable (Core.Name "hydra.extract.core.decodeSet")),- Core.typeApplicationTermType = (decoderFullResultType elemType)})),- Core.applicationArgument = elemDecoder}))---- | Generate a decoder term for a Type-decodeType :: Core.Type -> Core.Term-decodeType typ =- case typ of- Core.TypeAnnotated v0 -> decodeType (Core.annotatedTypeBody v0)- Core.TypeApplication v0 -> Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (decodeType (Core.applicationTypeFunction v0)),- Core.typeApplicationTermType = (decoderFullResultType (Core.applicationTypeArgument v0))})),- Core.applicationArgument = (decodeType (Core.applicationTypeArgument v0))})- Core.TypeEither v0 -> decodeEitherType v0- Core.TypeForall v0 -> decodeForallType v0- Core.TypeList v0 -> decodeListType v0- Core.TypeLiteral v0 -> decodeLiteralType v0- Core.TypeMap v0 -> decodeMapType v0- Core.TypeOptional v0 -> decodeMaybeType v0- Core.TypePair v0 -> decodePairType v0- Core.TypeRecord v0 -> decodeRecordType v0- Core.TypeSet v0 -> decodeSetType v0- Core.TypeUnion v0 -> decodeUnionType v0- Core.TypeUnit -> decodeUnitType- Core.TypeVoid -> decodeUnitType- Core.TypeWrap v0 -> decodeWrappedType v0- Core.TypeVariable v0 -> Core.TermVariable (decodeBindingName v0)- _ -> Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "cx"),- Core.lambdaDomain = (Just (Core.TypeVariable (Core.Name "hydra.graph.Graph"))),- Core.lambdaBody = (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "t"),- Core.lambdaDomain = (Just (Core.TypeVariable (Core.Name "hydra.core.Term"))),- Core.lambdaBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermEither (Left (Core.TermWrap (Core.WrappedTerm {- Core.wrappedTermTypeName = (Core.Name "hydra.errors.DecodingError"),- Core.wrappedTermBody = (Core.TermLiteral (Core.LiteralString "unsupported type variant"))})))),- Core.typeApplicationTermType = (Core.TypeVariable (Core.Name "hydra.errors.DecodingError"))})),- Core.typeApplicationTermType = (Core.TypeVariable (Core.Name "hydra.core.Term"))}))}))})---- | Generate a decoder term for a Type, with element name for nominal types. rtype is the FULLY-APPLIED result type for nominal bodies (e.g. DataRow<v> for forall v. wrap...), so the body's intermediate type annotations carry the type parameters rather than a bare nominal name — otherwise Java/Scala coders emit raw types that fail to compile against the parameterized signature. (#476)-decodeTypeNamed :: Core.Name -> Core.Type -> Core.Type -> Core.Term-decodeTypeNamed ename typ rtype =- case typ of- Core.TypeAnnotated v0 -> decodeTypeNamed ename (Core.annotatedTypeBody v0) rtype- Core.TypeApplication v0 -> Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (decodeType (Core.applicationTypeFunction v0)),- Core.typeApplicationTermType = (decoderFullResultType (Core.applicationTypeArgument v0))})),- Core.applicationArgument = (decodeType (Core.applicationTypeArgument v0))})- Core.TypeEither v0 -> decodeEitherType v0- Core.TypeForall v0 -> Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (decodeBindingName (Core.forallTypeParameter v0)),- Core.lambdaDomain = (Just (Core.TypeFunction (Core.FunctionType {- Core.functionTypeDomain = (Core.TypeVariable (Core.Name "hydra.graph.Graph")),- Core.functionTypeCodomain = (Core.TypeFunction (Core.FunctionType {- Core.functionTypeDomain = (Core.TypeVariable (Core.Name "hydra.core.Term")),- Core.functionTypeCodomain = (Core.TypeEither (Core.EitherType {- Core.eitherTypeLeft = (Core.TypeVariable (Core.Name "hydra.errors.DecodingError")),- Core.eitherTypeRight = (Core.TypeVariable (Core.forallTypeParameter v0))}))}))}))),- Core.lambdaBody = (decodeTypeNamed ename (Core.forallTypeBody v0) rtype)})- Core.TypeList v0 -> decodeListType v0- Core.TypeLiteral v0 -> decodeLiteralType v0- Core.TypeMap v0 -> decodeMapType v0- Core.TypeOptional v0 -> decodeMaybeType v0- Core.TypePair v0 -> decodePairType v0- Core.TypeRecord v0 -> decodeRecordTypeNamed ename v0 rtype- Core.TypeSet v0 -> decodeSetType v0- Core.TypeUnion v0 -> decodeUnionTypeNamed ename v0 rtype- Core.TypeUnit -> decodeUnitType- Core.TypeVoid -> decodeUnitType- Core.TypeWrap v0 -> decodeWrappedTypeNamed ename v0 rtype- Core.TypeVariable v0 -> Core.TermVariable (decodeBindingName v0)- _ -> Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "cx"),- Core.lambdaDomain = (Just (Core.TypeVariable (Core.Name "hydra.graph.Graph"))),- Core.lambdaBody = (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "t"),- Core.lambdaDomain = (Just (Core.TypeVariable (Core.Name "hydra.core.Term"))),- Core.lambdaBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermEither (Left (Core.TermWrap (Core.WrappedTerm {- Core.wrappedTermTypeName = (Core.Name "hydra.errors.DecodingError"),- Core.wrappedTermBody = (Core.TermLiteral (Core.LiteralString "unsupported type variant"))})))),- Core.typeApplicationTermType = (Core.TypeVariable (Core.Name "hydra.errors.DecodingError"))})),- Core.typeApplicationTermType = (Core.TypeVariable (Core.Name "hydra.core.Term"))}))}))})---- | Generate a decoder for a union type-decodeUnionType :: [Core.FieldType] -> Core.Term-decodeUnionType rt = decodeUnionTypeNamed (Core.Name "unknown") rt (Core.TypeVariable (Core.Name "unknown"))---- | Generate a decoder for a union type with the given element name. rtype is the fully-applied result type (e.g. Foo<v>) used for body annotations. (#476)-decodeUnionTypeNamed :: Core.Name -> [Core.FieldType] -> Core.Type -> Core.Term-decodeUnionTypeNamed ename rt rtype =-- let unionType = rtype- decErrType = Core.TypeVariable (Core.Name "hydra.errors.DecodingError")- nameType = Core.TypeVariable (Core.Name "hydra.core.Name")- variantFnType =- Core.TypeFunction (Core.FunctionType {- Core.functionTypeDomain = (Core.TypeVariable (Core.Name "hydra.core.Term")),- Core.functionTypeCodomain = (Core.TypeEither (Core.EitherType {- Core.eitherTypeLeft = decErrType,- Core.eitherTypeRight = unionType}))})- toVariantPair =- \ft ->- let fldType = decoderFullResultType (Core.fieldTypeType ft)- in (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermPair (- Core.TermWrap (Core.WrappedTerm {- Core.wrappedTermTypeName = (Core.Name "hydra.core.Name"),- Core.wrappedTermBody = (Core.TermLiteral (Core.LiteralString (Core.unName (Core.fieldTypeName ft))))}),- (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "input"),- Core.lambdaDomain = (Just (Core.TypeVariable (Core.Name "hydra.core.Term"))),- Core.lambdaBody = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermVariable (Core.Name "hydra.lib.eithers.map")),- Core.typeApplicationTermType = fldType})),- Core.typeApplicationTermType = unionType})),- Core.typeApplicationTermType = decErrType})),- Core.applicationArgument = (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "t"),- Core.lambdaDomain = (Just fldType),- Core.lambdaBody = (Core.TermInject (Core.Injection {- Core.injectionTypeName = ename,- Core.injectionField = Core.Field {- Core.fieldName = (Core.fieldTypeName ft),- Core.fieldTerm = (Core.TermVariable (Core.Name "t"))}}))}))})),- Core.applicationArgument = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (decodeType (Core.fieldTypeType ft)),- Core.applicationArgument = (Core.TermVariable (Core.Name "cx"))})),- Core.applicationArgument = (Core.TermVariable (Core.Name "input"))}))}))})))),- Core.typeApplicationTermType = (Core.TypeVariable (Core.Name "hydra.core.Name"))})),- Core.typeApplicationTermType = variantFnType}))- in (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "cx"),- Core.lambdaDomain = (Just (Core.TypeVariable (Core.Name "hydra.graph.Graph"))),- Core.lambdaBody = (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "raw"),- Core.lambdaDomain = (Just (Core.TypeVariable (Core.Name "hydra.core.Term"))),- Core.lambdaBody = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermVariable (Core.Name "hydra.lib.eithers.either")),- Core.typeApplicationTermType = (Core.TypeVariable (Core.Name "hydra.errors.DecodingError"))})),- Core.typeApplicationTermType = (Core.TypeVariable (Core.Name "hydra.core.Term"))})),- Core.typeApplicationTermType = (Core.TypeEither (Core.EitherType {- Core.eitherTypeLeft = (Core.TypeVariable (Core.Name "hydra.errors.DecodingError")),- Core.eitherTypeRight = unionType}))})),- Core.applicationArgument = (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "err"),- Core.lambdaDomain = (Just (Core.TypeVariable (Core.Name "hydra.errors.DecodingError"))),- Core.lambdaBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermEither (Left (Core.TermVariable (Core.Name "err")))),- Core.typeApplicationTermType = (Core.TypeVariable (Core.Name "hydra.errors.DecodingError"))})),- Core.typeApplicationTermType = unionType}))}))})),- Core.applicationArgument = (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "stripped"),- Core.lambdaDomain = (Just (Core.TypeVariable (Core.Name "hydra.core.Term"))),- Core.lambdaBody = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermCases (Core.CaseStatement {- Core.caseStatementTypeName = (Core.Name "hydra.core.Term"),- Core.caseStatementDefault = (Just (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermEither (Left (Core.TermWrap (Core.WrappedTerm {- Core.wrappedTermTypeName = (Core.Name "hydra.errors.DecodingError"),- Core.wrappedTermBody = (Core.TermLiteral (Core.LiteralString "expected union"))})))),- Core.typeApplicationTermType = (Core.TypeVariable (Core.Name "hydra.errors.DecodingError"))})),- Core.typeApplicationTermType = unionType}))),- Core.caseStatementCases = [- Core.CaseAlternative {- Core.caseAlternativeName = (Core.Name "inject"),- Core.caseAlternativeHandler = (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "inj"),- Core.lambdaDomain = (Just (Core.TypeVariable (Core.Name "hydra.core.Injection"))),- Core.lambdaBody = (Core.TermLet (Core.Let {- Core.letBindings = [- Core.Binding {- Core.bindingName = (Core.Name "field"),- Core.bindingTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.core.Injection"),- Core.projectionFieldName = (Core.Name "field")})),- Core.applicationArgument = (Core.TermVariable (Core.Name "inj"))})),- Core.bindingTypeScheme = (Just (Core.TypeScheme {- Core.typeSchemeVariables = [],- Core.typeSchemeBody = (Core.TypeVariable (Core.Name "hydra.core.Field")),- Core.typeSchemeConstraints = Maps.empty}))},- Core.Binding {- Core.bindingName = (Core.Name "fname"),- Core.bindingTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.core.Field"),- Core.projectionFieldName = (Core.Name "name")})),- Core.applicationArgument = (Core.TermVariable (Core.Name "field"))})),- Core.bindingTypeScheme = (Just (Core.TypeScheme {- Core.typeSchemeVariables = [],- Core.typeSchemeBody = (Core.TypeVariable (Core.Name "hydra.core.Name")),- Core.typeSchemeConstraints = Maps.empty}))},- Core.Binding {- Core.bindingName = (Core.Name "fterm"),- Core.bindingTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.core.Field"),- Core.projectionFieldName = (Core.Name "term")})),- Core.applicationArgument = (Core.TermVariable (Core.Name "field"))})),- Core.bindingTypeScheme = (Just (Core.TypeScheme {- Core.typeSchemeVariables = [],- Core.typeSchemeBody = (Core.TypeVariable (Core.Name "hydra.core.Term")),- Core.typeSchemeConstraints = Maps.empty}))},- Core.Binding {- Core.bindingName = (Core.Name "variantMap"),- Core.bindingTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermVariable (Core.Name "hydra.lib.maps.fromList")),- Core.typeApplicationTermType = nameType})),- Core.typeApplicationTermType = variantFnType})),- Core.applicationArgument = (Core.TermList (Lists.map toVariantPair rt))})),- Core.bindingTypeScheme = (Just (Core.TypeScheme {- Core.typeSchemeVariables = [],- Core.typeSchemeBody = (Core.TypeMap (Core.MapType {- Core.mapTypeKeys = nameType,- Core.mapTypeValues = variantFnType})),- Core.typeSchemeConstraints = Maps.empty}))}],- Core.letBody = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermVariable (Core.Name "hydra.lib.optionals.match")),- Core.typeApplicationTermType = variantFnType})),- Core.typeApplicationTermType = (Core.TypeEither (Core.EitherType {- Core.eitherTypeLeft = decErrType,- Core.eitherTypeRight = unionType}))})),- Core.applicationArgument = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermVariable (Core.Name "hydra.lib.maps.lookup")),- Core.typeApplicationTermType = nameType})),- Core.typeApplicationTermType = variantFnType})),- Core.applicationArgument = (Core.TermVariable (Core.Name "fname"))})),- Core.applicationArgument = (Core.TermVariable (Core.Name "variantMap"))}))})),- Core.applicationArgument = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermEither (Left (Core.TermWrap (Core.WrappedTerm {- Core.wrappedTermTypeName = (Core.Name "hydra.errors.DecodingError"),- Core.wrappedTermBody = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.strings.concat")),- Core.applicationArgument = (Core.TermList [- Core.TermLiteral (Core.LiteralString "no such field "),- (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermUnwrap (Core.Name "hydra.core.Name")),- Core.applicationArgument = (Core.TermVariable (Core.Name "fname"))})),- (Core.TermLiteral (Core.LiteralString " in union"))])}))})))),- Core.typeApplicationTermType = (Core.TypeVariable (Core.Name "hydra.errors.DecodingError"))})),- Core.typeApplicationTermType = unionType}))})),- Core.applicationArgument = (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "f"),- Core.lambdaDomain = (Just variantFnType),- Core.lambdaBody = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "f")),- Core.applicationArgument = (Core.TermVariable (Core.Name "fterm"))}))}))}))}))}))}]})),- Core.applicationArgument = (Core.TermVariable (Core.Name "stripped"))}))}))})),- Core.applicationArgument = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.extract.core.stripWithDecodingError")),- Core.applicationArgument = (Core.TermVariable (Core.Name "cx"))})),- Core.applicationArgument = (Core.TermVariable (Core.Name "raw"))}))}))}))}))---- | Generate a decoder for the unit type-decodeUnitType :: Core.Term-decodeUnitType =- Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "cx"),- Core.lambdaDomain = (Just (Core.TypeVariable (Core.Name "hydra.graph.Graph"))),- Core.lambdaBody = (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "t"),- Core.lambdaDomain = (Just (Core.TypeVariable (Core.Name "hydra.core.Term"))),- Core.lambdaBody = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.extract.core.decodeUnit")),- Core.applicationArgument = (Core.TermVariable (Core.Name "cx"))})),- Core.applicationArgument = (Core.TermVariable (Core.Name "t"))}))}))})---- | Generate a decoder for a wrapped type-decodeWrappedType :: Core.Type -> Core.Term-decodeWrappedType wt = decodeWrappedTypeNamed (Core.Name "unknown") wt (Core.TypeVariable (Core.Name "unknown"))---- | Generate a decoder for a wrapped type with the given element name. rtype is the fully-applied result type (e.g. DataRow<v>) used for body annotations. (#476)-decodeWrappedTypeNamed :: Core.Name -> Core.Type -> Core.Type -> Core.Term-decodeWrappedTypeNamed ename wt rtype =-- let bodyDecoder = decodeType wt- bodyType = decoderFullResultType wt- in (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "cx"),- Core.lambdaDomain = (Just (Core.TypeVariable (Core.Name "hydra.graph.Graph"))),- Core.lambdaBody = (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "raw"),- Core.lambdaDomain = (Just (Core.TypeVariable (Core.Name "hydra.core.Term"))),- Core.lambdaBody = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermVariable (Core.Name "hydra.lib.eithers.either")),- Core.typeApplicationTermType = (Core.TypeVariable (Core.Name "hydra.errors.DecodingError"))})),- Core.typeApplicationTermType = (Core.TypeVariable (Core.Name "hydra.core.Term"))})),- Core.typeApplicationTermType = (Core.TypeEither (Core.EitherType {- Core.eitherTypeLeft = (Core.TypeVariable (Core.Name "hydra.errors.DecodingError")),- Core.eitherTypeRight = rtype}))})),- Core.applicationArgument = (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "err"),- Core.lambdaDomain = (Just (Core.TypeVariable (Core.Name "hydra.errors.DecodingError"))),- Core.lambdaBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermEither (Left (Core.TermVariable (Core.Name "err")))),- Core.typeApplicationTermType = (Core.TypeVariable (Core.Name "hydra.errors.DecodingError"))})),- Core.typeApplicationTermType = rtype}))}))})),- Core.applicationArgument = (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "stripped"),- Core.lambdaDomain = (Just (Core.TypeVariable (Core.Name "hydra.core.Term"))),- Core.lambdaBody = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermCases (Core.CaseStatement {- Core.caseStatementTypeName = (Core.Name "hydra.core.Term"),- Core.caseStatementDefault = (Just (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermEither (Left (Core.TermWrap (Core.WrappedTerm {- Core.wrappedTermTypeName = (Core.Name "hydra.errors.DecodingError"),- Core.wrappedTermBody = (Core.TermLiteral (Core.LiteralString "expected wrapped type"))})))),- Core.typeApplicationTermType = (Core.TypeVariable (Core.Name "hydra.errors.DecodingError"))})),- Core.typeApplicationTermType = rtype}))),- Core.caseStatementCases = [- Core.CaseAlternative {- Core.caseAlternativeName = (Core.Name "wrap"),- Core.caseAlternativeHandler = (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "wrappedTerm"),- Core.lambdaDomain = (Just (Core.TypeVariable (Core.Name "hydra.core.WrappedTerm"))),- Core.lambdaBody = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm {- Core.typeApplicationTermBody = (Core.TermVariable (Core.Name "hydra.lib.eithers.map")),- Core.typeApplicationTermType = bodyType})),- Core.typeApplicationTermType = rtype})),- Core.typeApplicationTermType = (Core.TypeVariable (Core.Name "hydra.errors.DecodingError"))})),- Core.applicationArgument = (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "b"),- Core.lambdaDomain = (Just bodyType),- Core.lambdaBody = (Core.TermWrap (Core.WrappedTerm {- Core.wrappedTermTypeName = ename,- Core.wrappedTermBody = (Core.TermVariable (Core.Name "b"))}))}))})),- Core.applicationArgument = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = bodyDecoder,- Core.applicationArgument = (Core.TermVariable (Core.Name "cx"))})),- Core.applicationArgument = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.core.WrappedTerm"),- Core.projectionFieldName = (Core.Name "body")})),- Core.applicationArgument = (Core.TermVariable (Core.Name "wrappedTerm"))}))}))}))}))}]})),- Core.applicationArgument = (Core.TermVariable (Core.Name "stripped"))}))}))})),- Core.applicationArgument = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.extract.core.stripWithDecodingError")),- Core.applicationArgument = (Core.TermVariable (Core.Name "cx"))})),- Core.applicationArgument = (Core.TermVariable (Core.Name "raw"))}))}))}))}))---- | Get full result type for decoder-decoderFullResultType :: Core.Type -> Core.Type-decoderFullResultType typ =- case typ of- Core.TypeAnnotated v0 -> decoderFullResultType (Core.annotatedTypeBody v0)- Core.TypeApplication v0 -> Core.TypeApplication (Core.ApplicationType {- Core.applicationTypeFunction = (decoderFullResultType (Core.applicationTypeFunction v0)),- Core.applicationTypeArgument = (Core.applicationTypeArgument v0)})- Core.TypeEffect v0 -> Core.TypeEffect (decoderFullResultType v0)- Core.TypeEither v0 -> Core.TypeEither (Core.EitherType {- Core.eitherTypeLeft = (decoderFullResultType (Core.eitherTypeLeft v0)),- Core.eitherTypeRight = (decoderFullResultType (Core.eitherTypeRight v0))})- Core.TypeForall v0 -> Core.TypeApplication (Core.ApplicationType {- Core.applicationTypeFunction = (decoderFullResultType (Core.forallTypeBody v0)),- Core.applicationTypeArgument = (Core.TypeVariable (Core.forallTypeParameter v0))})- Core.TypeList v0 -> Core.TypeList (decoderFullResultType v0)- Core.TypeLiteral v0 -> Core.TypeLiteral v0- Core.TypeMap v0 -> Core.TypeMap (Core.MapType {- Core.mapTypeKeys = (decoderFullResultType (Core.mapTypeKeys v0)),- Core.mapTypeValues = (decoderFullResultType (Core.mapTypeValues v0))})- Core.TypeOptional v0 -> Core.TypeOptional (decoderFullResultType v0)- Core.TypePair v0 -> Core.TypePair (Core.PairType {- Core.pairTypeFirst = (decoderFullResultType (Core.pairTypeFirst v0)),- Core.pairTypeSecond = (decoderFullResultType (Core.pairTypeSecond v0))})- Core.TypeRecord _ -> Core.TypeVariable (Core.Name "hydra.core.Term")- Core.TypeSet v0 -> Core.TypeSet (decoderFullResultType v0)- Core.TypeUnion _ -> Core.TypeVariable (Core.Name "hydra.core.Term")- Core.TypeUnit -> Core.TypeUnit- Core.TypeVariable v0 -> Core.TypeVariable v0- Core.TypeVoid -> Core.TypeVoid- Core.TypeWrap v0 -> decoderFullResultType v0- _ -> Core.TypeVariable (Core.Name "hydra.core.Term")---- | Get full result type for decoder with element name-decoderFullResultTypeNamed :: Core.Name -> Core.Type -> Core.Type-decoderFullResultTypeNamed ename typ =- case typ of- Core.TypeAnnotated v0 -> decoderFullResultTypeNamed ename (Core.annotatedTypeBody v0)- Core.TypeForall v0 -> Core.TypeApplication (Core.ApplicationType {- Core.applicationTypeFunction = (decoderFullResultTypeNamed ename (Core.forallTypeBody v0)),- Core.applicationTypeArgument = (Core.TypeVariable (Core.forallTypeParameter v0))})- Core.TypeRecord _ -> Core.TypeVariable ename- Core.TypeUnion _ -> Core.TypeVariable ename- Core.TypeWrap _ -> Core.TypeVariable ename- Core.TypeApplication v0 -> Core.TypeApplication (Core.ApplicationType {- Core.applicationTypeFunction = (decoderFullResultType (Core.applicationTypeFunction v0)),- Core.applicationTypeArgument = (Core.applicationTypeArgument v0)})- Core.TypeEffect v0 -> Core.TypeEffect (decoderFullResultType v0)- Core.TypeEither v0 -> Core.TypeEither (Core.EitherType {- Core.eitherTypeLeft = (decoderFullResultType (Core.eitherTypeLeft v0)),- Core.eitherTypeRight = (decoderFullResultType (Core.eitherTypeRight v0))})- Core.TypeList v0 -> Core.TypeList (decoderFullResultType v0)- Core.TypeLiteral v0 -> Core.TypeLiteral v0- Core.TypeMap v0 -> Core.TypeMap (Core.MapType {- Core.mapTypeKeys = (decoderFullResultType (Core.mapTypeKeys v0)),- Core.mapTypeValues = (decoderFullResultType (Core.mapTypeValues v0))})- Core.TypeOptional v0 -> Core.TypeOptional (decoderFullResultType v0)- Core.TypePair v0 -> Core.TypePair (Core.PairType {- Core.pairTypeFirst = (decoderFullResultType (Core.pairTypeFirst v0)),- Core.pairTypeSecond = (decoderFullResultType (Core.pairTypeSecond v0))})- Core.TypeSet v0 -> Core.TypeSet (decoderFullResultType v0)- Core.TypeUnit -> Core.TypeUnit- Core.TypeVariable v0 -> Core.TypeVariable v0- Core.TypeVoid -> Core.TypeVoid- _ -> Core.TypeVariable (Core.Name "hydra.core.Term")---- | Compute the result type name for a decoder-decoderResultType :: Core.Type -> Core.Name-decoderResultType typ =- case typ of- Core.TypeAnnotated v0 -> decoderResultType (Core.annotatedTypeBody v0)- Core.TypeApplication v0 -> decoderResultType (Core.applicationTypeFunction v0)- Core.TypeForall v0 -> decoderResultType (Core.forallTypeBody v0)- Core.TypeLiteral _ -> Core.Name "hydra.core.Literal"- Core.TypeRecord _ -> Core.Name "hydra.core.Term"- Core.TypeUnion _ -> Core.Name "hydra.core.Term"- Core.TypeWrap _ -> Core.Name "hydra.core.Term"- _ -> Core.Name "hydra.core.Term"---- | Build decoder function type-decoderType :: Core.Type -> Core.Type-decoderType typ =-- let resultType = decoderFullResultType typ- baseType =- Core.TypeFunction (Core.FunctionType {- Core.functionTypeDomain = (Core.TypeVariable (Core.Name "hydra.graph.Graph")),- Core.functionTypeCodomain = (Core.TypeFunction (Core.FunctionType {- Core.functionTypeDomain = (Core.TypeVariable (Core.Name "hydra.core.Term")),- Core.functionTypeCodomain = (Core.TypeEither (Core.EitherType {- Core.eitherTypeLeft = (Core.TypeVariable (Core.Name "hydra.errors.DecodingError")),- Core.eitherTypeRight = resultType}))}))})- in (prependForallDecoders baseType typ)---- | Build decoder function type with element name-decoderTypeNamed :: Core.Name -> Core.Type -> Core.Type-decoderTypeNamed ename typ =-- let resultType = decoderFullResultTypeNamed ename typ- baseType =- Core.TypeFunction (Core.FunctionType {- Core.functionTypeDomain = (Core.TypeVariable (Core.Name "hydra.graph.Graph")),- Core.functionTypeCodomain = (Core.TypeFunction (Core.FunctionType {- Core.functionTypeDomain = (Core.TypeVariable (Core.Name "hydra.core.Term")),- Core.functionTypeCodomain = (Core.TypeEither (Core.EitherType {- Core.eitherTypeLeft = (Core.TypeVariable (Core.Name "hydra.errors.DecodingError")),- Core.eitherTypeRight = resultType}))}))})- in (prependForallDecoders baseType typ)---- | Build type scheme for a decoder function-decoderTypeScheme :: Core.Type -> Core.TypeScheme-decoderTypeScheme typ =-- let typeVars = collectTypeVariables typ- allOrdVars = collectOrdConstrainedVariables typ- ordVars = Lists.filter (\v -> Lists.member v typeVars) allOrdVars- constraints =- Maps.fromList (Lists.map (\v -> (- v,- Core.TypeVariableConstraints {- Core.typeVariableConstraintsClasses = (Sets.singleton (Core.TypeClassConstraintSimple (Core.Name "ordering")))})) ordVars)- in Core.TypeScheme {- Core.typeSchemeVariables = typeVars,- Core.typeSchemeBody = (decoderType typ),- Core.typeSchemeConstraints = constraints}---- | Build type scheme for a decoder function with element name-decoderTypeSchemeNamed :: Core.Name -> Core.Type -> Core.TypeScheme-decoderTypeSchemeNamed ename typ =-- let typeVars = collectTypeVariables typ- allOrdVars = collectOrdConstrainedVariables typ- ordVars = Lists.filter (\v -> Lists.member v typeVars) allOrdVars- constraints =- Maps.fromList (Lists.map (\v -> (- v,- Core.TypeVariableConstraints {- Core.typeVariableConstraintsClasses = (Sets.singleton (Core.TypeClassConstraintSimple (Core.Name "ordering")))})) ordVars)- in Core.TypeScheme {- Core.typeSchemeVariables = typeVars,- Core.typeSchemeBody = (decoderTypeNamed ename typ),- Core.typeSchemeConstraints = constraints}---- | Filter bindings to only decodable type definitions-filterTypeBindings :: t0 -> Graph.Graph -> [Core.Binding] -> Either Errors.Error [Core.Binding]-filterTypeBindings cx graph bindings =- Eithers.map Optionals.givens (Eithers.mapList (isDecodableBinding cx graph) (Lists.filter Annotations.isNativeType bindings))---- | Check if a binding is decodable (serializable type)-isDecodableBinding :: t0 -> Graph.Graph -> Core.Binding -> Either Errors.Error (Maybe Core.Binding)-isDecodableBinding cx graph b =- Eithers.bind (Predicates.isSerializableByName cx graph (Core.bindingName b)) (\serializable -> Right (Logic.ifElse serializable (Just b) Nothing))---- | Prepend decoder types for forall parameters to base type-prependForallDecoders :: Core.Type -> Core.Type -> Core.Type-prependForallDecoders baseType typ =- case typ of- Core.TypeAnnotated v0 -> prependForallDecoders baseType (Core.annotatedTypeBody v0)- Core.TypeForall v0 -> Core.TypeFunction (Core.FunctionType {- Core.functionTypeDomain = (Core.TypeFunction (Core.FunctionType {- Core.functionTypeDomain = (Core.TypeVariable (Core.Name "hydra.graph.Graph")),- Core.functionTypeCodomain = (Core.TypeFunction (Core.FunctionType {- Core.functionTypeDomain = (Core.TypeVariable (Core.Name "hydra.core.Term")),- Core.functionTypeCodomain = (Core.TypeEither (Core.EitherType {- Core.eitherTypeLeft = (Core.TypeVariable (Core.Name "hydra.errors.DecodingError")),- Core.eitherTypeRight = (Core.TypeVariable (Core.forallTypeParameter v0))}))}))})),- Core.functionTypeCodomain = (prependForallDecoders baseType (Core.forallTypeBody v0))})- _ -> baseType
@@ -1,358 +0,0 @@--- Note: this is an automatically generated file. Do not edit.---- | Dependency extraction, binding sort, and let normalization--module Hydra.Dependencies where--import qualified Hydra.Annotations as Annotations-import qualified Hydra.Ast as Ast-import qualified Hydra.Coders as Coders-import qualified Hydra.Constants as Constants-import qualified Hydra.Core as Core-import qualified Hydra.Docs as Docs-import qualified Hydra.Error.Checking as Checking-import qualified Hydra.Error.Core as ErrorCore-import qualified Hydra.Error.File as ErrorFile-import qualified Hydra.Error.Packaging as ErrorPackaging-import qualified Hydra.Error.System as ErrorSystem-import qualified Hydra.Errors as Errors-import qualified Hydra.File as File-import qualified Hydra.Graph as Graph-import qualified Hydra.Json.Model as Model-import qualified Hydra.Lexical as Lexical-import qualified Hydra.Overlay.Haskell.Lib.Eithers as Eithers-import qualified Hydra.Overlay.Haskell.Lib.Equality as Equality-import qualified Hydra.Overlay.Haskell.Lib.Lists as Lists-import qualified Hydra.Overlay.Haskell.Lib.Literals as Literals-import qualified Hydra.Overlay.Haskell.Lib.Logic as Logic-import qualified Hydra.Overlay.Haskell.Lib.Maps as Maps-import qualified Hydra.Overlay.Haskell.Lib.Math as Math-import qualified Hydra.Overlay.Haskell.Lib.Optionals as Optionals-import qualified Hydra.Overlay.Haskell.Lib.Ordering as Ordering-import qualified Hydra.Overlay.Haskell.Lib.Pairs as Pairs-import qualified Hydra.Overlay.Haskell.Lib.Sets as Sets-import qualified Hydra.Overlay.Haskell.Lib.Strings as Strings-import qualified Hydra.Names as Names-import qualified Hydra.Packaging as Packaging-import qualified Hydra.Parsing as Parsing-import qualified Hydra.Paths as Paths-import qualified Hydra.Query as Query-import qualified Hydra.Regex as Regex-import qualified Hydra.Relational as Relational-import qualified Hydra.Rewriting as Rewriting-import qualified Hydra.Sorting as Sorting-import qualified Hydra.Strip as Strip-import qualified Hydra.System as System-import qualified Hydra.Tabular as Tabular-import qualified Hydra.Testing as Testing-import qualified Hydra.Time as Time-import qualified Hydra.Topology as Topology-import qualified Hydra.Typed as Typed-import qualified Hydra.Typing as Typing-import qualified Hydra.Util as Util-import qualified Hydra.Validation as Validation-import qualified Hydra.Variables as Variables-import qualified Hydra.Variants as Variants-import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)-import qualified Data.Scientific as Sci-import Data.Void-import qualified Data.Map as M-import qualified Data.Set as S---- | Get definitions with their dependencies-definitionsWithDependencies :: t0 -> Graph.Graph -> [Core.Binding] -> Either Errors.Error [Core.Binding]-definitionsWithDependencies cx graph original =-- let depNames = \el -> Sets.toList (termDependencyNames True False False (Core.bindingTerm el))- allDepNames = Lists.distinct (Lists.concat2 (Lists.map Core.bindingName original) (Lists.concat (Lists.map depNames original)))- in (Eithers.mapList (\name -> Lexical.requireBinding graph name) allDepNames)---- | Flatten nested let expressions-flattenLetTerms :: Core.Term -> Core.Term-flattenLetTerms term =-- let rewriteBinding =- \binding ->- let key0 = Core.bindingName binding- val0 = Core.bindingTerm binding- t = Core.bindingTypeScheme binding- in case val0 of- Core.TermAnnotated v0 ->- let val1 = Core.annotatedTermBody v0- ann = Core.annotatedTermAnnotation v0- recursive =- rewriteBinding (Core.Binding {- Core.bindingName = key0,- Core.bindingTerm = val1,- Core.bindingTypeScheme = t})- innerBinding = Pairs.first recursive- deps = Pairs.second recursive- val2 = Core.bindingTerm innerBinding- in (- Core.Binding {- Core.bindingName = key0,- Core.bindingTerm = (Core.TermAnnotated (Core.AnnotatedTerm {- Core.annotatedTermBody = val2,- Core.annotatedTermAnnotation = ann})),- Core.bindingTypeScheme = t},- deps)- Core.TermLet v0 ->- let bindings1 = Core.letBindings v0- body1 = Core.letBody v0- prefix = Strings.concat2 (Core.unName key0) "_"- qualify = \n -> Core.Name (Strings.concat2 prefix (Core.unName n))- toSubstPair = \b -> (Core.bindingName b, (qualify (Core.bindingName b)))- subst = Maps.fromList (Lists.map toSubstPair bindings1)- replaceVars = Variables.substituteVariables subst- newBody = replaceVars body1- newBinding =- \b -> Core.Binding {- Core.bindingName = (qualify (Core.bindingName b)),- Core.bindingTerm = (replaceVars (Core.bindingTerm b)),- Core.bindingTypeScheme = (Core.bindingTypeScheme b)}- in (- Core.Binding {- Core.bindingName = key0,- Core.bindingTerm = newBody,- Core.bindingTypeScheme = t},- (Lists.map newBinding bindings1))- _ -> (- Core.Binding {- Core.bindingName = key0,- Core.bindingTerm = val0,- Core.bindingTypeScheme = t},- [])- flattenBodyLet =- \bindings -> \body -> case body of- Core.TermLet v0 ->- let innerBindings = Core.letBindings v0- innerBody = Core.letBody v0- in (flattenBodyLet (Lists.concat2 bindings innerBindings) innerBody)- _ -> (Lists.concat2 [] bindings, body)- flatten =- \recurse -> \term2 ->- let rewritten = recurse term2- in case rewritten of- Core.TermLet v0 ->- let bindings = Core.letBindings v0- body = Core.letBody v0- forResult = \hr -> Lists.concat2 (Pairs.second hr) (Lists.singleton (Pairs.first hr))- flattenedBindings = Lists.concat (Lists.map (\arg_ -> forResult (rewriteBinding arg_)) bindings)- merged = flattenBodyLet flattenedBindings body- newBindings = Pairs.first merged- newBody = Pairs.second merged- in (Core.TermLet (Core.Let {- Core.letBindings = newBindings,- Core.letBody = newBody}))- _ -> rewritten- in (Rewriting.rewriteTerm flatten term)---- | Inline all type variables in a type using the provided schema (Either version). Note: this function is only appropriate for nonrecursive type definitions-inlineType :: M.Map Core.Name Core.Type -> Core.Type -> Either Errors.Error Core.Type-inlineType schema typ =-- let f =- \recurse -> \typ2 ->- let afterRecurse =- \tr -> case tr of- Core.TypeVariable v0 -> Optionals.match (Maps.lookup v0 schema) (Left (Errors.ErrorOther (Errors.OtherError (Strings.concat2 "No such type in schema: " (Core.unName v0))))) (inlineType schema)- _ -> Right tr- in (Eithers.bind (recurse typ2) (\tr -> afterRecurse tr))- in (Rewriting.rewriteTypeM f typ)---- | Check whether a term is a lambda, possibly nested within let and/or annotation terms-isLambda :: Core.Term -> Bool-isLambda term =- case (Strip.deannotateTerm term) of- Core.TermLambda _ -> True- Core.TermLet v0 -> isLambda (Core.letBody v0)- _ -> False---- | Rewrite terms like `let foo = bar in λx.baz` to `λx.let foo = bar in baz`, lifting lambda-bound variables above let-bound variables, recursively. This is helpful for targets such as Python.-liftLambdaAboveLet :: Core.Term -> Core.Term-liftLambdaAboveLet term0 =-- let rewrite =- \recurse -> \term ->- let rewriteBinding =- \b -> Core.Binding {- Core.bindingName = (Core.bindingName b),- Core.bindingTerm = (rewrite recurse (Core.bindingTerm b)),- Core.bindingTypeScheme = (Core.bindingTypeScheme b)}- rewriteBindings = \bs -> Lists.map rewriteBinding bs- digForLambdas =- \original -> \cons -> \term2 -> case term2 of- Core.TermAnnotated v0 -> digForLambdas original (\t -> Core.TermAnnotated (Core.AnnotatedTerm {- Core.annotatedTermBody = (cons t),- Core.annotatedTermAnnotation = (Core.annotatedTermAnnotation v0)})) (Core.annotatedTermBody v0)- Core.TermLambda v0 -> Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.lambdaParameter v0),- Core.lambdaDomain = (Core.lambdaDomain v0),- Core.lambdaBody = (digForLambdas (cons (Core.lambdaBody v0)) (\t -> cons t) (Core.lambdaBody v0))})- Core.TermLet v0 -> digForLambdas original (\t -> cons (Core.TermLet (Core.Let {- Core.letBindings = (rewriteBindings (Core.letBindings v0)),- Core.letBody = t}))) (Core.letBody v0)- _ -> recurse original- in case term of- Core.TermLet v0 -> digForLambdas term (\t -> Core.TermLet (Core.Let {- Core.letBindings = (rewriteBindings (Core.letBindings v0)),- Core.letBody = t})) (Core.letBody v0)- _ -> recurse term- in (Rewriting.rewriteTerm rewrite term0)---- | Given a let expression, remove any unused bindings. The resulting expression is still a let, even if has no remaining bindings-pruneLet :: Core.Let -> Core.Let-pruneLet l =-- let bindingMap = Maps.fromList (Lists.map (\b -> (Core.bindingName b, (Core.bindingTerm b))) (Core.letBindings l))- rootName = Core.Name "[[[root]]]"- adj =- \n -> Sets.intersection (Sets.fromList (Maps.keys bindingMap)) (Variables.freeVariablesInTerm (Logic.ifElse (Equality.equal n rootName) (Core.letBody l) (Optionals.withDefault Core.TermUnit (Maps.lookup n bindingMap))))- reachable = Sorting.findReachableNodes adj rootName- prunedBindings = Lists.filter (\b -> Sets.member (Core.bindingName b) reachable) (Core.letBindings l)- in Core.Let {- Core.letBindings = prunedBindings,- Core.letBody = (Core.letBody l)}---- | Replace all occurrences of simple typedefs (type aliases) with the aliased types, recursively-replaceTypedefs :: M.Map Core.Name Core.TypeScheme -> Core.Type -> Core.Type-replaceTypedefs types typ0 =-- let rewrite =- \recurse -> \typ -> case typ of- Core.TypeAnnotated v0 -> Core.TypeAnnotated (Core.AnnotatedType {- Core.annotatedTypeBody = (rewrite recurse (Core.annotatedTypeBody v0)),- Core.annotatedTypeAnnotation = (Core.annotatedTypeAnnotation v0)})- Core.TypeRecord _ -> typ- Core.TypeUnion _ -> typ- Core.TypeVariable v0 ->- let forMono =- \t -> case t of- Core.TypeRecord _ -> typ- Core.TypeUnion _ -> typ- Core.TypeWrap _ -> typ- _ -> rewrite recurse t- forTypeScheme =- \ts ->- let t = Core.typeSchemeBody ts- in (Logic.ifElse (Lists.isEmpty (Core.typeSchemeVariables ts)) (forMono t) typ)- in (Optionals.match (Maps.lookup v0 types) typ (\ts -> forTypeScheme ts))- Core.TypeWrap _ -> typ- _ -> recurse typ- in (Rewriting.rewriteType rewrite typ0)---- | Simplify terms by applying beta reduction where possible-simplifyTerm :: Core.Term -> Core.Term-simplifyTerm term =-- let simplify =- \recurse -> \term2 ->- let forRhs =- \rhs -> \var -> \body -> case (Strip.deannotateTerm rhs) of- Core.TermVariable v0 -> simplifyTerm (Variables.substituteVariable var v0 body)- _ -> term2- forLhs =- \lhs -> \rhs -> case (Strip.deannotateTerm lhs) of- Core.TermLambda v0 ->- let var = Core.lambdaParameter v0- body = Core.lambdaBody v0- in (Logic.ifElse (Sets.member var (Variables.freeVariablesInTerm body)) (forRhs rhs var body) (simplifyTerm body))- _ -> term2- forTerm =- \stripped -> case stripped of- Core.TermApplication v0 ->- let lhs = Core.applicationFunction v0- rhs = Core.applicationArgument v0- in (forLhs lhs rhs)- _ -> term2- stripped = Strip.deannotateTerm term2- in (recurse (forTerm stripped))- in (Rewriting.rewriteTerm simplify term)---- | Note: does not distinguish between bound and free variables; use freeVariablesInTerm for that-termDependencyNames :: Bool -> Bool -> Bool -> Core.Term -> S.Set Core.Name-termDependencyNames binds withPrims withNoms term0 =-- let addNames =- \names -> \term ->- let nominal = \name -> Logic.ifElse withNoms (Sets.insert name names) names- prim = \name -> Logic.ifElse withPrims (Sets.insert name names) names- var = \name -> Logic.ifElse binds (Sets.insert name names) names- in case term of- Core.TermCases v0 -> nominal (Core.caseStatementTypeName v0)- Core.TermProject v0 -> nominal (Core.projectionTypeName v0)- Core.TermUnwrap v0 -> nominal v0- Core.TermRecord v0 -> nominal (Core.recordTypeName v0)- Core.TermInject v0 -> nominal (Core.injectionTypeName v0)- Core.TermVariable v0 -> var v0- Core.TermWrap v0 -> nominal (Core.wrappedTermTypeName v0)- _ -> names- in (Rewriting.foldOverTerm Coders.TraversalOrderPre addNames Sets.empty term0)---- | Generate short names from a list of fully qualified names-toShortNames :: [Core.Name] -> M.Map Core.Name Core.Name-toShortNames original =-- let addName =- \acc -> \name ->- let local = Names.localNameOf name- group = Optionals.withDefault Sets.empty (Maps.lookup local acc)- in (Maps.insert local (Sets.insert name group) acc)- groupNamesByLocal = \names -> Lists.foldl addName Maps.empty names- groups = groupNamesByLocal original- renameGroup =- \localNames ->- let local = Pairs.first localNames- names = Pairs.second localNames- rangeFrom = \start -> Lists.cons start (rangeFrom (Math.add start 1))- rename =- \name -> \i -> (name, (Core.Name (Logic.ifElse (Ordering.gt i 1) (Strings.concat2 local (Literals.printInt32 i)) local)))- in (Lists.zipWith rename (Sets.toList names) (rangeFrom 1))- in (Maps.fromList (Lists.concat (Lists.map renameGroup (Maps.toList groups))))---- | Topological sort of connected components, in terms of dependencies between variable/term binding pairs. The SCC partitioning is what makes the result usable as an emission order in every target language: non-recursive bindings emit in dependency order, while a mutually recursive cluster is delivered together so the emitter can wrap it in whatever construct the host requires (mutual `let`s, joint class files, forward declarations).-topologicalSortBindingMap :: M.Map Core.Name Core.Term -> [[(Core.Name, Core.Term)]]-topologicalSortBindingMap bindingMap =-- let bindings = Maps.toList bindingMap- keys = Sets.fromList (Lists.map Pairs.first bindings)- hasTypeAnnotation = \term -> Optionals.isGiven (Annotations.getTermAnnotation Constants.keyType term)- depsOf =- \nameAndTerm ->- let name = Pairs.first nameAndTerm- term = Pairs.second nameAndTerm- in (name, (Logic.ifElse (hasTypeAnnotation term) [] (Sets.toList (Sets.intersection keys (Variables.freeVariablesInTerm term)))))- toPair =- \name -> (name, (Optionals.withDefault (Core.TermLiteral (Core.LiteralString "Impossible!")) (Maps.lookup name bindingMap)))- in (Lists.map (Lists.map toPair) (Sorting.topologicalSortComponents (Lists.map depsOf bindings)))---- | Topological sort of bindings based on their dependencies. Returns `Right` with a flat order when the dependency graph is acyclic; returns `Left` with the cyclic SCCs when it is not. Use this variant when the consumer needs a strict acyclic ordering and must reject cycles (e.g. import resolution); use `topologicalSortBindingMap` when mutual recursion should be packaged into SCC groups instead.-topologicalSortBindings :: [Core.Binding] -> Either [[Core.Name]] [Core.Name]-topologicalSortBindings els =-- let adjlist = \e -> (Core.bindingName e, (Sets.toList (termDependencyNames False True True (Core.bindingTerm e))))- in (Sorting.topologicalSort (Lists.map adjlist els))---- | Topologically sort type definitions by their structural dependencies, grouped into SCCs. The SCC grouping handles mutually recursive types (e.g. a pair of records that reference each other's names) by delivering them together as one cluster, so the emitter can produce a coherent set of declarations rather than failing with an undefined-name error mid-emission.-topologicalSortTypeDefinitions :: [Packaging.TypeDefinition] -> [[Packaging.TypeDefinition]]-topologicalSortTypeDefinitions defs =-- let toPair =- \def -> (- Packaging.typeDefinitionName def,- (Sets.toList (typeDependencyNames False (Core.typeSchemeBody (Packaging.typeDefinitionBody def)))))- nameToDef = Maps.fromList (Lists.map (\d -> (Packaging.typeDefinitionName d, d)) defs)- sorted = Sorting.topologicalSortComponents (Lists.map toPair defs)- in (Lists.map (\names -> Optionals.givens (Lists.map (\n -> Maps.lookup n nameToDef) names)) sorted)---- | Collect all type names referenced by a type. The boolean controls whether type-scheme references (free variables in type expressions) are included alongside structural references-typeDependencyNames :: Bool -> Core.Type -> S.Set Core.Name-typeDependencyNames withSchema typ =- Logic.ifElse withSchema (Sets.union (Variables.freeVariablesInType typ) (typeNamesInType typ)) (Variables.freeVariablesInType typ)---- | Collect every type name that appears anywhere inside a type expression-typeNamesInType :: Ord t0 => (Core.Type -> S.Set t0)-typeNamesInType typ0 =-- let addNames = \names -> \typ -> names- in (Rewriting.foldOverType Coders.TraversalOrderPre addNames Sets.empty typ0)
@@ -1,449 +0,0 @@--- Note: this is an automatically generated file. Do not edit.---- | Source-to-source automatic differentiation for Float64 terms.--module Hydra.Differentiation where--import qualified Hydra.Ast as Ast-import qualified Hydra.Coders as Coders-import qualified Hydra.Core as Core-import qualified Hydra.Docs as Docs-import qualified Hydra.Error.Checking as Checking-import qualified Hydra.Error.Core as ErrorCore-import qualified Hydra.Error.File as ErrorFile-import qualified Hydra.Error.Packaging as ErrorPackaging-import qualified Hydra.Error.System as ErrorSystem-import qualified Hydra.Errors as Errors-import qualified Hydra.File as File-import qualified Hydra.Graph as Graph-import qualified Hydra.Json.Model as Model-import qualified Hydra.Overlay.Haskell.Lib.Equality as Equality-import qualified Hydra.Overlay.Haskell.Lib.Lists as Lists-import qualified Hydra.Overlay.Haskell.Lib.Logic as Logic-import qualified Hydra.Overlay.Haskell.Lib.Optionals as Optionals-import qualified Hydra.Overlay.Haskell.Lib.Pairs as Pairs-import qualified Hydra.Packaging as Packaging-import qualified Hydra.Parsing as Parsing-import qualified Hydra.Paths as Paths-import qualified Hydra.Query as Query-import qualified Hydra.Regex as Regex-import qualified Hydra.Relational as Relational-import qualified Hydra.Strip as Strip-import qualified Hydra.System as System-import qualified Hydra.Tabular as Tabular-import qualified Hydra.Testing as Testing-import qualified Hydra.Time as Time-import qualified Hydra.Topology as Topology-import qualified Hydra.Typed as Typed-import qualified Hydra.Typing as Typing-import qualified Hydra.Util as Util-import qualified Hydra.Validation as Validation-import qualified Hydra.Variables as Variables-import qualified Hydra.Variants as Variants-import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)-import qualified Data.Scientific as Sci-import Data.Void---- | Differentiate a binary primitive application given both arguments and their derivatives-differentiateBinary :: Core.Name -> Core.Term -> Core.Term -> Core.Term -> Core.Term -> Core.Term-differentiateBinary bfname a b da db =- Logic.ifElse (Logic.or (Equality.equal bfname (Core.Name "hydra.lib.math.add")) (Equality.equal bfname (Core.Name "hydra.lib.math.addFloat64"))) (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.math.addFloat64")),- Core.applicationArgument = da})),- Core.applicationArgument = db})) (Logic.ifElse (Logic.or (Equality.equal bfname (Core.Name "hydra.lib.math.sub")) (Equality.equal bfname (Core.Name "hydra.lib.math.subFloat64"))) (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.math.subFloat64")),- Core.applicationArgument = da})),- Core.applicationArgument = db})) (Logic.ifElse (Logic.or (Equality.equal bfname (Core.Name "hydra.lib.math.mul")) (Equality.equal bfname (Core.Name "hydra.lib.math.mulFloat64"))) (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.math.addFloat64")),- Core.applicationArgument = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.math.mulFloat64")),- Core.applicationArgument = a})),- Core.applicationArgument = db}))})),- Core.applicationArgument = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.math.mulFloat64")),- Core.applicationArgument = b})),- Core.applicationArgument = da}))})) (Logic.ifElse (Equality.equal bfname (Core.Name "hydra.lib.math.pow")) (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.math.mulFloat64")),- Core.applicationArgument = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.math.pow")),- Core.applicationArgument = a})),- Core.applicationArgument = b}))})),- Core.applicationArgument = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.math.addFloat64")),- Core.applicationArgument = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.math.mulFloat64")),- Core.applicationArgument = db})),- Core.applicationArgument = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.math.log")),- Core.applicationArgument = a}))}))})),- Core.applicationArgument = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.math.mulFloat64")),- Core.applicationArgument = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.math.mulFloat64")),- Core.applicationArgument = b})),- Core.applicationArgument = da}))})),- Core.applicationArgument = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.math.pow")),- Core.applicationArgument = a})),- Core.applicationArgument = (Core.TermLiteral (Core.LiteralFloat (Core.FloatValueFloat64 (-1.0))))}))}))}))})) (Logic.ifElse (Equality.equal bfname (Core.Name "hydra.lib.math.atan2")) (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.math.mulFloat64")),- Core.applicationArgument = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.math.subFloat64")),- Core.applicationArgument = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.math.mulFloat64")),- Core.applicationArgument = b})),- Core.applicationArgument = da}))})),- Core.applicationArgument = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.math.mulFloat64")),- Core.applicationArgument = a})),- Core.applicationArgument = db}))}))})),- Core.applicationArgument = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.math.pow")),- Core.applicationArgument = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.math.addFloat64")),- Core.applicationArgument = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.math.mulFloat64")),- Core.applicationArgument = a})),- Core.applicationArgument = a}))})),- Core.applicationArgument = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.math.mulFloat64")),- Core.applicationArgument = b})),- Core.applicationArgument = b}))}))})),- Core.applicationArgument = (Core.TermLiteral (Core.LiteralFloat (Core.FloatValueFloat64 (-1.0))))}))})) (Logic.ifElse (Equality.equal bfname (Core.Name "hydra.lib.math.logBase")) (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.math.mulFloat64")),- Core.applicationArgument = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.math.subFloat64")),- Core.applicationArgument = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.math.mulFloat64")),- Core.applicationArgument = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.math.log")),- Core.applicationArgument = a}))})),- Core.applicationArgument = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.math.mulFloat64")),- Core.applicationArgument = db})),- Core.applicationArgument = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.math.pow")),- Core.applicationArgument = b})),- Core.applicationArgument = (Core.TermLiteral (Core.LiteralFloat (Core.FloatValueFloat64 (-1.0))))}))}))}))})),- Core.applicationArgument = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.math.mulFloat64")),- Core.applicationArgument = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.math.log")),- Core.applicationArgument = b}))})),- Core.applicationArgument = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.math.mulFloat64")),- Core.applicationArgument = da})),- Core.applicationArgument = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.math.pow")),- Core.applicationArgument = a})),- Core.applicationArgument = (Core.TermLiteral (Core.LiteralFloat (Core.FloatValueFloat64 (-1.0))))}))}))}))}))})),- Core.applicationArgument = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.math.pow")),- Core.applicationArgument = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.math.mulFloat64")),- Core.applicationArgument = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.math.log")),- Core.applicationArgument = a}))})),- Core.applicationArgument = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.math.log")),- Core.applicationArgument = a}))}))})),- Core.applicationArgument = (Core.TermLiteral (Core.LiteralFloat (Core.FloatValueFloat64 (-1.0))))}))})) (Core.TermLiteral (Core.LiteralFloat (Core.FloatValueFloat64 0.0))))))))---- | Differentiate a function term (Float64 -> Float64) with respect to its parameter-differentiateFunction :: Core.Term -> Core.Term-differentiateFunction term =- case term of- Core.TermAnnotated v0 -> differentiateFunction (Core.annotatedTermBody v0)- Core.TermLambda v0 ->- let paramName = Core.lambdaParameter v0- body = Core.lambdaBody v0- in (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = paramName,- Core.lambdaDomain = (Core.lambdaDomain v0),- Core.lambdaBody = (differentiateTerm paramName body)}))- _ -> term---- | Differentiate a term with respect to a named variable-differentiateTerm :: Core.Name -> Core.Term -> Core.Term-differentiateTerm dx term =- case term of- Core.TermVariable v0 -> Logic.ifElse (Equality.equal v0 dx) (Core.TermLiteral (Core.LiteralFloat (Core.FloatValueFloat64 1.0))) (Core.TermLiteral (Core.LiteralFloat (Core.FloatValueFloat64 0.0)))- Core.TermLiteral _ -> Core.TermLiteral (Core.LiteralFloat (Core.FloatValueFloat64 0.0))- Core.TermApplication v0 ->- let func = Core.applicationFunction v0- arg = Core.applicationArgument v0- in case func of- Core.TermVariable v1 -> Optionals.match (primitiveDerivative v1) (differentiateTerm dx (Core.TermApplication (Core.Application {- Core.applicationFunction = func,- Core.applicationArgument = arg}))) (\derivTerm -> Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.math.mulFloat64")),- Core.applicationArgument = (Core.TermApplication (Core.Application {- Core.applicationFunction = derivTerm,- Core.applicationArgument = arg}))})),- Core.applicationArgument = (differentiateTerm dx arg)}))- Core.TermApplication v1 ->- let innerFunc = Core.applicationFunction v1- innerArg = Core.applicationArgument v1- in case innerFunc of- Core.TermVariable v2 -> differentiateBinary v2 innerArg arg (differentiateTerm dx innerArg) (differentiateTerm dx arg)- _ -> Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.math.mulFloat64")),- Core.applicationArgument = (differentiateTerm dx (Core.TermApplication (Core.Application {- Core.applicationFunction = func,- Core.applicationArgument = arg})))})),- Core.applicationArgument = (differentiateTerm dx arg)})- _ -> Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.math.mulFloat64")),- Core.applicationArgument = (differentiateTerm dx (Core.TermApplication (Core.Application {- Core.applicationFunction = func,- Core.applicationArgument = arg})))})),- Core.applicationArgument = (differentiateTerm dx arg)})- Core.TermLambda v0 -> Logic.ifElse (Equality.equal (Core.lambdaParameter v0) dx) (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.lambdaParameter v0),- Core.lambdaDomain = (Core.lambdaDomain v0),- Core.lambdaBody = (Core.TermLiteral (Core.LiteralFloat (Core.FloatValueFloat64 0.0)))})) (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.lambdaParameter v0),- Core.lambdaDomain = (Core.lambdaDomain v0),- Core.lambdaBody = (differentiateTerm dx (Core.lambdaBody v0))}))- Core.TermCases _ -> Core.TermLiteral (Core.LiteralFloat (Core.FloatValueFloat64 0.0))- Core.TermProject _ -> Core.TermLiteral (Core.LiteralFloat (Core.FloatValueFloat64 0.0))- Core.TermUnwrap _ -> Core.TermLiteral (Core.LiteralFloat (Core.FloatValueFloat64 0.0))- Core.TermLet v0 -> Core.TermLet (Core.Let {- Core.letBindings = (Lists.map (\b -> Core.Binding {- Core.bindingName = (Core.bindingName b),- Core.bindingTerm = (differentiateTerm dx (Core.bindingTerm b)),- Core.bindingTypeScheme = Nothing}) (Core.letBindings v0)),- Core.letBody = (differentiateTerm dx (Core.letBody v0))})- Core.TermAnnotated v0 -> differentiateTerm dx (Core.annotatedTermBody v0)- Core.TermList v0 -> Core.TermList (Lists.map (differentiateTerm dx) v0)- Core.TermPair v0 -> Core.TermPair (differentiateTerm dx (Pairs.first v0), (differentiateTerm dx (Pairs.second v0)))- Core.TermRecord v0 -> Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.recordTypeName v0),- Core.recordFields = (Lists.map (\fld -> Core.Field {- Core.fieldName = (Core.fieldName fld),- Core.fieldTerm = (differentiateTerm dx (Core.fieldTerm fld))}) (Core.recordFields v0))})- Core.TermTypeApplication v0 -> differentiateTerm dx (Core.typeApplicationTermBody v0)- Core.TermTypeLambda v0 -> differentiateTerm dx (Core.typeLambdaBody v0)- Core.TermUnit -> Core.TermLiteral (Core.LiteralFloat (Core.FloatValueFloat64 0.0))- Core.TermSet _ -> Core.TermLiteral (Core.LiteralFloat (Core.FloatValueFloat64 0.0))- Core.TermMap _ -> Core.TermLiteral (Core.LiteralFloat (Core.FloatValueFloat64 0.0))- Core.TermEither _ -> Core.TermLiteral (Core.LiteralFloat (Core.FloatValueFloat64 0.0))- Core.TermOptional _ -> Core.TermLiteral (Core.LiteralFloat (Core.FloatValueFloat64 0.0))- Core.TermInject _ -> Core.TermLiteral (Core.LiteralFloat (Core.FloatValueFloat64 0.0))- Core.TermWrap _ -> Core.TermLiteral (Core.LiteralFloat (Core.FloatValueFloat64 0.0))---- | Compute the gradient of a term as a record of partial derivatives-gradient :: Core.Name -> [Core.Name] -> Core.Term -> Core.Term-gradient typeName vars term =- Core.TermRecord (Core.Record {- Core.recordTypeName = typeName,- Core.recordFields = (Lists.map (\v -> Core.Field {- Core.fieldName = v,- Core.fieldTerm = (differentiateTerm v term)}) vars)})---- | Look up the derivative of a unary Float64 primitive-primitiveDerivative :: Core.Name -> Maybe Core.Term-primitiveDerivative name =- Logic.ifElse (Equality.equal name (Core.Name "hydra.lib.math.sin")) (Just (Core.TermVariable (Core.Name "hydra.lib.math.cos"))) (Logic.ifElse (Equality.equal name (Core.Name "hydra.lib.math.cos")) (Just (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "_x"),- Core.lambdaDomain = Nothing,- Core.lambdaBody = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.math.negateFloat64")),- Core.applicationArgument = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.math.sin")),- Core.applicationArgument = (Core.TermVariable (Core.Name "_x"))}))}))}))) (Logic.ifElse (Equality.equal name (Core.Name "hydra.lib.math.tan")) (Just (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "_x"),- Core.lambdaDomain = Nothing,- Core.lambdaBody = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.math.pow")),- Core.applicationArgument = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.math.cos")),- Core.applicationArgument = (Core.TermVariable (Core.Name "_x"))}))})),- Core.applicationArgument = (Core.TermLiteral (Core.LiteralFloat (Core.FloatValueFloat64 (-2.0))))}))}))) (Logic.ifElse (Equality.equal name (Core.Name "hydra.lib.math.exp")) (Just (Core.TermVariable (Core.Name "hydra.lib.math.exp"))) (Logic.ifElse (Equality.equal name (Core.Name "hydra.lib.math.log")) (Just (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "_x"),- Core.lambdaDomain = Nothing,- Core.lambdaBody = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.math.pow")),- Core.applicationArgument = (Core.TermVariable (Core.Name "_x"))})),- Core.applicationArgument = (Core.TermLiteral (Core.LiteralFloat (Core.FloatValueFloat64 (-1.0))))}))}))) (Logic.ifElse (Equality.equal name (Core.Name "hydra.lib.math.sqrt")) (Just (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "_x"),- Core.lambdaDomain = Nothing,- Core.lambdaBody = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.math.mulFloat64")),- Core.applicationArgument = (Core.TermLiteral (Core.LiteralFloat (Core.FloatValueFloat64 0.5)))})),- Core.applicationArgument = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.math.pow")),- Core.applicationArgument = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.math.sqrt")),- Core.applicationArgument = (Core.TermVariable (Core.Name "_x"))}))})),- Core.applicationArgument = (Core.TermLiteral (Core.LiteralFloat (Core.FloatValueFloat64 (-1.0))))}))}))}))) (Logic.ifElse (Equality.equal name (Core.Name "hydra.lib.math.asin")) (Just (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "_x"),- Core.lambdaDomain = Nothing,- Core.lambdaBody = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.math.pow")),- Core.applicationArgument = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.math.sqrt")),- Core.applicationArgument = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.math.subFloat64")),- Core.applicationArgument = (Core.TermLiteral (Core.LiteralFloat (Core.FloatValueFloat64 1.0)))})),- Core.applicationArgument = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.math.mulFloat64")),- Core.applicationArgument = (Core.TermVariable (Core.Name "_x"))})),- Core.applicationArgument = (Core.TermVariable (Core.Name "_x"))}))}))}))})),- Core.applicationArgument = (Core.TermLiteral (Core.LiteralFloat (Core.FloatValueFloat64 (-1.0))))}))}))) (Logic.ifElse (Equality.equal name (Core.Name "hydra.lib.math.acos")) (Just (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "_x"),- Core.lambdaDomain = Nothing,- Core.lambdaBody = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.math.negateFloat64")),- Core.applicationArgument = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.math.pow")),- Core.applicationArgument = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.math.sqrt")),- Core.applicationArgument = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.math.subFloat64")),- Core.applicationArgument = (Core.TermLiteral (Core.LiteralFloat (Core.FloatValueFloat64 1.0)))})),- Core.applicationArgument = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.math.mulFloat64")),- Core.applicationArgument = (Core.TermVariable (Core.Name "_x"))})),- Core.applicationArgument = (Core.TermVariable (Core.Name "_x"))}))}))}))})),- Core.applicationArgument = (Core.TermLiteral (Core.LiteralFloat (Core.FloatValueFloat64 (-1.0))))}))}))}))) (Logic.ifElse (Equality.equal name (Core.Name "hydra.lib.math.atan")) (Just (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "_x"),- Core.lambdaDomain = Nothing,- Core.lambdaBody = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.math.pow")),- Core.applicationArgument = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.math.addFloat64")),- Core.applicationArgument = (Core.TermLiteral (Core.LiteralFloat (Core.FloatValueFloat64 1.0)))})),- Core.applicationArgument = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.math.mulFloat64")),- Core.applicationArgument = (Core.TermVariable (Core.Name "_x"))})),- Core.applicationArgument = (Core.TermVariable (Core.Name "_x"))}))}))})),- Core.applicationArgument = (Core.TermLiteral (Core.LiteralFloat (Core.FloatValueFloat64 (-1.0))))}))}))) (Logic.ifElse (Equality.equal name (Core.Name "hydra.lib.math.sinh")) (Just (Core.TermVariable (Core.Name "hydra.lib.math.cosh"))) (Logic.ifElse (Equality.equal name (Core.Name "hydra.lib.math.cosh")) (Just (Core.TermVariable (Core.Name "hydra.lib.math.sinh"))) (Logic.ifElse (Equality.equal name (Core.Name "hydra.lib.math.tanh")) (Just (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "_x"),- Core.lambdaDomain = Nothing,- Core.lambdaBody = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.math.subFloat64")),- Core.applicationArgument = (Core.TermLiteral (Core.LiteralFloat (Core.FloatValueFloat64 1.0)))})),- Core.applicationArgument = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.math.mulFloat64")),- Core.applicationArgument = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.math.tanh")),- Core.applicationArgument = (Core.TermVariable (Core.Name "_x"))}))})),- Core.applicationArgument = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.math.tanh")),- Core.applicationArgument = (Core.TermVariable (Core.Name "_x"))}))}))}))}))) (Logic.ifElse (Equality.equal name (Core.Name "hydra.lib.math.asinh")) (Just (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "_x"),- Core.lambdaDomain = Nothing,- Core.lambdaBody = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.math.pow")),- Core.applicationArgument = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.math.sqrt")),- Core.applicationArgument = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.math.addFloat64")),- Core.applicationArgument = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.math.mulFloat64")),- Core.applicationArgument = (Core.TermVariable (Core.Name "_x"))})),- Core.applicationArgument = (Core.TermVariable (Core.Name "_x"))}))})),- Core.applicationArgument = (Core.TermLiteral (Core.LiteralFloat (Core.FloatValueFloat64 1.0)))}))}))})),- Core.applicationArgument = (Core.TermLiteral (Core.LiteralFloat (Core.FloatValueFloat64 (-1.0))))}))}))) (Logic.ifElse (Equality.equal name (Core.Name "hydra.lib.math.acosh")) (Just (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "_x"),- Core.lambdaDomain = Nothing,- Core.lambdaBody = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.math.pow")),- Core.applicationArgument = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.math.sqrt")),- Core.applicationArgument = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.math.subFloat64")),- Core.applicationArgument = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.math.mulFloat64")),- Core.applicationArgument = (Core.TermVariable (Core.Name "_x"))})),- Core.applicationArgument = (Core.TermVariable (Core.Name "_x"))}))})),- Core.applicationArgument = (Core.TermLiteral (Core.LiteralFloat (Core.FloatValueFloat64 1.0)))}))}))})),- Core.applicationArgument = (Core.TermLiteral (Core.LiteralFloat (Core.FloatValueFloat64 (-1.0))))}))}))) (Logic.ifElse (Equality.equal name (Core.Name "hydra.lib.math.atanh")) (Just (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "_x"),- Core.lambdaDomain = Nothing,- Core.lambdaBody = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.math.pow")),- Core.applicationArgument = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.math.subFloat64")),- Core.applicationArgument = (Core.TermLiteral (Core.LiteralFloat (Core.FloatValueFloat64 1.0)))})),- Core.applicationArgument = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.math.mulFloat64")),- Core.applicationArgument = (Core.TermVariable (Core.Name "_x"))})),- Core.applicationArgument = (Core.TermVariable (Core.Name "_x"))}))}))})),- Core.applicationArgument = (Core.TermLiteral (Core.LiteralFloat (Core.FloatValueFloat64 (-1.0))))}))}))) (Logic.ifElse (Equality.equal name (Core.Name "hydra.lib.math.negate")) (Just (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "_x"),- Core.lambdaDomain = Nothing,- Core.lambdaBody = (Core.TermLiteral (Core.LiteralFloat (Core.FloatValueFloat64 (-1.0))))}))) (Logic.ifElse (Equality.equal name (Core.Name "hydra.lib.math.abs")) (Just (Core.TermVariable (Core.Name "hydra.lib.math.signum"))) (Logic.ifElse (Equality.equal name (Core.Name "hydra.lib.math.ceiling")) (Just (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "_x"),- Core.lambdaDomain = Nothing,- Core.lambdaBody = (Core.TermLiteral (Core.LiteralFloat (Core.FloatValueFloat64 0.0)))}))) (Logic.ifElse (Equality.equal name (Core.Name "hydra.lib.math.floor")) (Just (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "_x"),- Core.lambdaDomain = Nothing,- Core.lambdaBody = (Core.TermLiteral (Core.LiteralFloat (Core.FloatValueFloat64 0.0)))}))) (Logic.ifElse (Equality.equal name (Core.Name "hydra.lib.math.round")) (Just (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "_x"),- Core.lambdaDomain = Nothing,- Core.lambdaBody = (Core.TermLiteral (Core.LiteralFloat (Core.FloatValueFloat64 0.0)))}))) (Logic.ifElse (Equality.equal name (Core.Name "hydra.lib.math.truncate")) (Just (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "_x"),- Core.lambdaDomain = Nothing,- Core.lambdaBody = (Core.TermLiteral (Core.LiteralFloat (Core.FloatValueFloat64 0.0)))}))) (Logic.ifElse (Equality.equal name (Core.Name "hydra.lib.math.signum")) (Just (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "_x"),- Core.lambdaDomain = Nothing,- Core.lambdaBody = (Core.TermLiteral (Core.LiteralFloat (Core.FloatValueFloat64 0.0)))}))) Nothing)))))))))))))))))))))
@@ -1,25 +0,0 @@--- Note: this is an automatically generated file. Do not edit.---- | A model for Hydra documentation strings, including inline annotations and entity references--module Hydra.Docs where--import qualified Hydra.Core as Core-import qualified Hydra.Packaging as Packaging-import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)-import qualified Data.Scientific as Sci-import Data.Void---- | A segment of a documentation string, either a raw text fragment or an inline entity reference. Documentation strings are parsed into a sequence of DocSegments for host-specific rendering.-data DocSegment =- -- | An inline reference to a Hydra entity- DocSegmentRef Packaging.EntityReference |- -- | A raw prose fragment, passed through verbatim- DocSegmentText String- deriving (Eq, Ord, Read, Show)--_DocSegment = Core.Name "hydra.docs.DocSegment"--_DocSegment_ref = Core.Name "ref"--_DocSegment_text = Core.Name "text"
@@ -1,310 +0,0 @@--- Note: this is an automatically generated file. Do not edit.---- | DSL functions for hydra.analysis--module Hydra.Dsl.Analysis where--import qualified Hydra.Analysis as Analysis-import qualified Hydra.Annotations as Annotations-import qualified Hydra.Arity as Arity-import qualified Hydra.Ast as Ast-import qualified Hydra.Checking as Checking-import qualified Hydra.Coders as Coders-import qualified Hydra.Constants as Constants-import qualified Hydra.Core as Core-import qualified Hydra.Decode.Core as DecodeCore-import qualified Hydra.Dependencies as Dependencies-import qualified Hydra.Docs as Docs-import qualified Hydra.Dsl.Annotations as DslAnnotations-import qualified Hydra.Dsl.Arity as DslArity-import qualified Hydra.Dsl.Ast as DslAst-import qualified Hydra.Dsl.Checking as DslChecking-import qualified Hydra.Dsl.Coders as DslCoders-import qualified Hydra.Dsl.Constants as DslConstants-import qualified Hydra.Dsl.Core as DslCore-import qualified Hydra.Dsl.Dependencies as DslDependencies-import qualified Hydra.Dsl.Docs as DslDocs-import qualified Hydra.Dsl.Error.Checking as DslErrorChecking-import qualified Hydra.Dsl.Error.Core as DslErrorCore-import qualified Hydra.Dsl.Error.File as DslErrorFile-import qualified Hydra.Dsl.Error.Packaging as DslErrorPackaging-import qualified Hydra.Dsl.Error.System as DslErrorSystem-import qualified Hydra.Dsl.Errors as DslErrors-import qualified Hydra.Dsl.File as DslFile-import qualified Hydra.Dsl.Graph as DslGraph-import qualified Hydra.Dsl.Json.Model as JsonModel-import qualified Hydra.Dsl.Lexical as DslLexical-import qualified Hydra.Dsl.Names as DslNames-import qualified Hydra.Dsl.Packaging as DslPackaging-import qualified Hydra.Dsl.Parsing as DslParsing-import qualified Hydra.Dsl.Paths as DslPaths-import qualified Hydra.Dsl.Predicates as DslPredicates-import qualified Hydra.Dsl.Query as DslQuery-import qualified Hydra.Dsl.Regex as DslRegex-import qualified Hydra.Dsl.Relational as DslRelational-import qualified Hydra.Dsl.Rewriting as DslRewriting-import qualified Hydra.Dsl.Scoping as DslScoping-import qualified Hydra.Dsl.Strip as DslStrip-import qualified Hydra.Dsl.System as DslSystem-import qualified Hydra.Dsl.Tabular as DslTabular-import qualified Hydra.Dsl.Testing as DslTesting-import qualified Hydra.Dsl.Time as DslTime-import qualified Hydra.Dsl.Topology as DslTopology-import qualified Hydra.Dsl.Typing as DslTyping-import qualified Hydra.Dsl.Util as DslUtil-import qualified Hydra.Dsl.Validation as DslValidation-import qualified Hydra.Dsl.Variables as DslVariables-import qualified Hydra.Dsl.Variants as DslVariants-import qualified Hydra.Error.Checking as ErrorChecking-import qualified Hydra.Error.Core as ErrorCore-import qualified Hydra.Error.File as ErrorFile-import qualified Hydra.Error.Packaging as ErrorPackaging-import qualified Hydra.Error.System as ErrorSystem-import qualified Hydra.Errors as Errors-import qualified Hydra.File as File-import qualified Hydra.Graph as Graph-import qualified Hydra.Json.Model as Model-import qualified Hydra.Lexical as Lexical-import qualified Hydra.Names as Names-import qualified Hydra.Packaging as Packaging-import qualified Hydra.Parsing as Parsing-import qualified Hydra.Paths as Paths-import qualified Hydra.Predicates as Predicates-import qualified Hydra.Query as Query-import qualified Hydra.Regex as Regex-import qualified Hydra.Relational as Relational-import qualified Hydra.Rewriting as Rewriting-import qualified Hydra.Scoping as Scoping-import qualified Hydra.Strip as Strip-import qualified Hydra.System as System-import qualified Hydra.Tabular as Tabular-import qualified Hydra.Testing as Testing-import qualified Hydra.Time as Time-import qualified Hydra.Topology as Topology-import qualified Hydra.Typed as Typed-import qualified Hydra.Typing as Typing-import qualified Hydra.Util as Util-import qualified Hydra.Validation as Validation-import qualified Hydra.Variables as Variables-import qualified Hydra.Variants as Variants-import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)-import qualified Data.Scientific as Sci-import Data.Void-import qualified Data.Set as S---- | DSL reference to hydra.analysis.addNamesToModuleNames-addNamesToModuleNames :: Typed.TypedTerm (Packaging.ModuleName -> t0) -> Typed.TypedTerm (S.Set Core.Name) -> Typed.TypedTerm (Util.ModuleNames t0) -> Typed.TypedTerm (Util.ModuleNames t0)-addNamesToModuleNames arg0 arg1 arg2 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.analysis.addNamesToModuleNames")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)})),- Core.applicationArgument = (Typed.unTypedTerm arg2)}))---- | DSL reference to hydra.analysis.analyzeFunctionTerm-analyzeFunctionTerm :: Typed.TypedTerm Typing.InferenceContext -> Typed.TypedTerm (t0 -> Graph.Graph) -> Typed.TypedTerm (Graph.Graph -> t0 -> t0) -> Typed.TypedTerm t0 -> Typed.TypedTerm Core.Term -> Typed.TypedTerm (Either t1 (Typing.FunctionStructure t0))-analyzeFunctionTerm arg0 arg1 arg2 arg3 arg4 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.analysis.analyzeFunctionTerm")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)})),- Core.applicationArgument = (Typed.unTypedTerm arg2)})),- Core.applicationArgument = (Typed.unTypedTerm arg3)})),- Core.applicationArgument = (Typed.unTypedTerm arg4)}))---- | DSL reference to hydra.analysis.analyzeFunctionTermWith-analyzeFunctionTermWith :: Typed.TypedTerm Typing.InferenceContext -> Typed.TypedTerm (Graph.Graph -> Core.Binding -> Maybe Core.Term) -> Typed.TypedTerm (t0 -> Graph.Graph) -> Typed.TypedTerm (Graph.Graph -> t0 -> t0) -> Typed.TypedTerm t0 -> Typed.TypedTerm Core.Term -> Typed.TypedTerm (Either t1 (Typing.FunctionStructure t0))-analyzeFunctionTermWith arg0 arg1 arg2 arg3 arg4 arg5 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.analysis.analyzeFunctionTermWith")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)})),- Core.applicationArgument = (Typed.unTypedTerm arg2)})),- Core.applicationArgument = (Typed.unTypedTerm arg3)})),- Core.applicationArgument = (Typed.unTypedTerm arg4)})),- Core.applicationArgument = (Typed.unTypedTerm arg5)}))---- | DSL reference to hydra.analysis.analyzeFunctionTermWithFinish-analyzeFunctionTermWithFinish :: Typed.TypedTerm Typing.InferenceContext -> Typed.TypedTerm (t0 -> Graph.Graph) -> Typed.TypedTerm t0 -> Typed.TypedTerm [Core.Name] -> Typed.TypedTerm [Core.Name] -> Typed.TypedTerm [Core.Binding] -> Typed.TypedTerm [Core.Type] -> Typed.TypedTerm [Core.Type] -> Typed.TypedTerm Core.Term -> Typed.TypedTerm (Either t1 (Typing.FunctionStructure t0))-analyzeFunctionTermWithFinish arg0 arg1 arg2 arg3 arg4 arg5 arg6 arg7 arg8 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.analysis.analyzeFunctionTermWithFinish")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)})),- Core.applicationArgument = (Typed.unTypedTerm arg2)})),- Core.applicationArgument = (Typed.unTypedTerm arg3)})),- Core.applicationArgument = (Typed.unTypedTerm arg4)})),- Core.applicationArgument = (Typed.unTypedTerm arg5)})),- Core.applicationArgument = (Typed.unTypedTerm arg6)})),- Core.applicationArgument = (Typed.unTypedTerm arg7)})),- Core.applicationArgument = (Typed.unTypedTerm arg8)}))---- | DSL reference to hydra.analysis.analyzeFunctionTermWithGather-analyzeFunctionTermWithGather :: Typed.TypedTerm Typing.InferenceContext -> Typed.TypedTerm (Graph.Graph -> Core.Binding -> Maybe Core.Term) -> Typed.TypedTerm (t0 -> Graph.Graph) -> Typed.TypedTerm (Graph.Graph -> t0 -> t0) -> Typed.TypedTerm Bool -> Typed.TypedTerm t0 -> Typed.TypedTerm [Core.Name] -> Typed.TypedTerm [Core.Name] -> Typed.TypedTerm [Core.Binding] -> Typed.TypedTerm [Core.Type] -> Typed.TypedTerm [Core.Type] -> Typed.TypedTerm Core.Term -> Typed.TypedTerm (Either t1 (Typing.FunctionStructure t0))-analyzeFunctionTermWithGather arg0 arg1 arg2 arg3 arg4 arg5 arg6 arg7 arg8 arg9 arg10 arg11 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.analysis.analyzeFunctionTermWithGather")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)})),- Core.applicationArgument = (Typed.unTypedTerm arg2)})),- Core.applicationArgument = (Typed.unTypedTerm arg3)})),- Core.applicationArgument = (Typed.unTypedTerm arg4)})),- Core.applicationArgument = (Typed.unTypedTerm arg5)})),- Core.applicationArgument = (Typed.unTypedTerm arg6)})),- Core.applicationArgument = (Typed.unTypedTerm arg7)})),- Core.applicationArgument = (Typed.unTypedTerm arg8)})),- Core.applicationArgument = (Typed.unTypedTerm arg9)})),- Core.applicationArgument = (Typed.unTypedTerm arg10)})),- Core.applicationArgument = (Typed.unTypedTerm arg11)}))---- | DSL reference to hydra.analysis.definitionDependencyModuleNames-definitionDependencyModuleNames :: Typed.TypedTerm [Packaging.Definition] -> Typed.TypedTerm (S.Set Packaging.ModuleName)-definitionDependencyModuleNames arg0 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.analysis.definitionDependencyModuleNames")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))---- | DSL reference to hydra.analysis.dependencyModuleNames-dependencyModuleNames :: Typed.TypedTerm t0 -> Typed.TypedTerm Graph.Graph -> Typed.TypedTerm Bool -> Typed.TypedTerm Bool -> Typed.TypedTerm Bool -> Typed.TypedTerm Bool -> Typed.TypedTerm [Core.Binding] -> Typed.TypedTerm (Either Errors.Error (S.Set Packaging.ModuleName))-dependencyModuleNames arg0 arg1 arg2 arg3 arg4 arg5 arg6 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.analysis.dependencyModuleNames")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)})),- Core.applicationArgument = (Typed.unTypedTerm arg2)})),- Core.applicationArgument = (Typed.unTypedTerm arg3)})),- Core.applicationArgument = (Typed.unTypedTerm arg4)})),- Core.applicationArgument = (Typed.unTypedTerm arg5)})),- Core.applicationArgument = (Typed.unTypedTerm arg6)}))---- | DSL reference to hydra.analysis.gatherApplications-gatherApplications :: Typed.TypedTerm Core.Term -> Typed.TypedTerm ([Core.Term], Core.Term)-gatherApplications arg0 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.analysis.gatherApplications")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))---- | DSL reference to hydra.analysis.gatherArgs-gatherArgs :: Typed.TypedTerm Core.Term -> Typed.TypedTerm [Core.Term] -> Typed.TypedTerm (Core.Term, [Core.Term])-gatherArgs arg0 arg1 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.analysis.gatherArgs")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))---- | DSL reference to hydra.analysis.gatherArgsWithTypeApps-gatherArgsWithTypeApps :: Typed.TypedTerm Core.Term -> Typed.TypedTerm [Core.Term] -> Typed.TypedTerm [Core.Type] -> Typed.TypedTerm (Core.Term, ([Core.Term], [Core.Type]))-gatherArgsWithTypeApps arg0 arg1 arg2 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.analysis.gatherArgsWithTypeApps")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)})),- Core.applicationArgument = (Typed.unTypedTerm arg2)}))---- | DSL reference to hydra.analysis.isSelfTailRecursive-isSelfTailRecursive :: Typed.TypedTerm Core.Name -> Typed.TypedTerm Core.Term -> Typed.TypedTerm Bool-isSelfTailRecursive arg0 arg1 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.analysis.isSelfTailRecursive")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))---- | DSL reference to hydra.analysis.isSimpleAssignment-isSimpleAssignment :: Typed.TypedTerm Core.Term -> Typed.TypedTerm Bool-isSimpleAssignment arg0 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.analysis.isSimpleAssignment")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))---- | DSL reference to hydra.analysis.isTailRecursiveInTailPosition-isTailRecursiveInTailPosition :: Typed.TypedTerm Core.Name -> Typed.TypedTerm Core.Term -> Typed.TypedTerm Bool-isTailRecursiveInTailPosition arg0 arg1 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.analysis.isTailRecursiveInTailPosition")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))---- | DSL reference to hydra.analysis.moduleContainsBinaryLiterals-moduleContainsBinaryLiterals :: Typed.TypedTerm Packaging.Module -> Typed.TypedTerm Bool-moduleContainsBinaryLiterals arg0 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.analysis.moduleContainsBinaryLiterals")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))---- | DSL reference to hydra.analysis.moduleContainsDecimalLiterals-moduleContainsDecimalLiterals :: Typed.TypedTerm Packaging.Module -> Typed.TypedTerm Bool-moduleContainsDecimalLiterals arg0 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.analysis.moduleContainsDecimalLiterals")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))---- | DSL reference to hydra.analysis.moduleDependencyModuleNames-moduleDependencyModuleNames :: Typed.TypedTerm t0 -> Typed.TypedTerm Graph.Graph -> Typed.TypedTerm Bool -> Typed.TypedTerm Bool -> Typed.TypedTerm Bool -> Typed.TypedTerm Bool -> Typed.TypedTerm Packaging.Module -> Typed.TypedTerm (Either Errors.Error (S.Set Packaging.ModuleName))-moduleDependencyModuleNames arg0 arg1 arg2 arg3 arg4 arg5 arg6 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.analysis.moduleDependencyModuleNames")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)})),- Core.applicationArgument = (Typed.unTypedTerm arg2)})),- Core.applicationArgument = (Typed.unTypedTerm arg3)})),- Core.applicationArgument = (Typed.unTypedTerm arg4)})),- Core.applicationArgument = (Typed.unTypedTerm arg5)})),- Core.applicationArgument = (Typed.unTypedTerm arg6)}))---- | DSL reference to hydra.analysis.moduleNamesForDefinitions-moduleNamesForDefinitions :: Typed.TypedTerm (Packaging.ModuleName -> t0) -> Typed.TypedTerm Packaging.ModuleName -> Typed.TypedTerm [Packaging.Definition] -> Typed.TypedTerm (Util.ModuleNames t0)-moduleNamesForDefinitions arg0 arg1 arg2 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.analysis.moduleNamesForDefinitions")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)})),- Core.applicationArgument = (Typed.unTypedTerm arg2)}))
@@ -1,327 +0,0 @@--- Note: this is an automatically generated file. Do not edit.---- | DSL functions for hydra.annotations--module Hydra.Dsl.Annotations where--import qualified Hydra.Annotations as Annotations-import qualified Hydra.Ast as Ast-import qualified Hydra.Coders as Coders-import qualified Hydra.Constants as Constants-import qualified Hydra.Core as Core-import qualified Hydra.Decode.Core as DecodeCore-import qualified Hydra.Docs as Docs-import qualified Hydra.Dsl.Ast as DslAst-import qualified Hydra.Dsl.Coders as DslCoders-import qualified Hydra.Dsl.Constants as DslConstants-import qualified Hydra.Dsl.Core as DslCore-import qualified Hydra.Dsl.Docs as DslDocs-import qualified Hydra.Dsl.Error.Checking as ErrorChecking-import qualified Hydra.Dsl.Error.Core as DslErrorCore-import qualified Hydra.Dsl.Error.File as DslErrorFile-import qualified Hydra.Dsl.Error.Packaging as DslErrorPackaging-import qualified Hydra.Dsl.Error.System as DslErrorSystem-import qualified Hydra.Dsl.Errors as DslErrors-import qualified Hydra.Dsl.File as DslFile-import qualified Hydra.Dsl.Graph as DslGraph-import qualified Hydra.Dsl.Json.Model as JsonModel-import qualified Hydra.Dsl.Lexical as DslLexical-import qualified Hydra.Dsl.Packaging as DslPackaging-import qualified Hydra.Dsl.Parsing as DslParsing-import qualified Hydra.Dsl.Paths as DslPaths-import qualified Hydra.Dsl.Query as DslQuery-import qualified Hydra.Dsl.Regex as DslRegex-import qualified Hydra.Dsl.Relational as DslRelational-import qualified Hydra.Dsl.Strip as DslStrip-import qualified Hydra.Dsl.System as DslSystem-import qualified Hydra.Dsl.Tabular as DslTabular-import qualified Hydra.Dsl.Testing as DslTesting-import qualified Hydra.Dsl.Time as DslTime-import qualified Hydra.Dsl.Topology as DslTopology-import qualified Hydra.Dsl.Typing as DslTyping-import qualified Hydra.Dsl.Util as DslUtil-import qualified Hydra.Dsl.Validation as DslValidation-import qualified Hydra.Dsl.Variants as DslVariants-import qualified Hydra.Encode.Core as EncodeCore-import qualified Hydra.Error.Checking as Checking-import qualified Hydra.Error.Core as ErrorCore-import qualified Hydra.Error.File as ErrorFile-import qualified Hydra.Error.Packaging as ErrorPackaging-import qualified Hydra.Error.System as ErrorSystem-import qualified Hydra.Errors as Errors-import qualified Hydra.Extract.Core as ExtractCore-import qualified Hydra.File as File-import qualified Hydra.Graph as Graph-import qualified Hydra.Json.Model as Model-import qualified Hydra.Lexical as Lexical-import qualified Hydra.Packaging as Packaging-import qualified Hydra.Parsing as Parsing-import qualified Hydra.Paths as Paths-import qualified Hydra.Print.Core as PrintCore-import qualified Hydra.Print.Errors as PrintErrors-import qualified Hydra.Query as Query-import qualified Hydra.Regex as Regex-import qualified Hydra.Relational as Relational-import qualified Hydra.Strip as Strip-import qualified Hydra.System as System-import qualified Hydra.Tabular as Tabular-import qualified Hydra.Testing as Testing-import qualified Hydra.Time as Time-import qualified Hydra.Topology as Topology-import qualified Hydra.Typed as Typed-import qualified Hydra.Typing as Typing-import qualified Hydra.Util as Util-import qualified Hydra.Validation as Validation-import qualified Hydra.Variants as Variants-import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)-import qualified Data.Scientific as Sci-import Data.Void-import qualified Data.Map as M-import qualified Data.Set as S---- | DSL reference to hydra.annotations.aggregateAnnotations-aggregateAnnotations :: Typed.TypedTerm (t0 -> Maybe t1) -> Typed.TypedTerm (t1 -> t0) -> Typed.TypedTerm (t1 -> M.Map t2 t3) -> Typed.TypedTerm t0 -> Typed.TypedTerm (M.Map t2 t3)-aggregateAnnotations arg0 arg1 arg2 arg3 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.annotations.aggregateAnnotations")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)})),- Core.applicationArgument = (Typed.unTypedTerm arg2)})),- Core.applicationArgument = (Typed.unTypedTerm arg3)}))---- | DSL reference to hydra.annotations.commentsFromBinding-commentsFromBinding :: Typed.TypedTerm t0 -> Typed.TypedTerm Graph.Graph -> Typed.TypedTerm Core.Binding -> Typed.TypedTerm (Either Errors.Error (Maybe String))-commentsFromBinding arg0 arg1 arg2 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.annotations.commentsFromBinding")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)})),- Core.applicationArgument = (Typed.unTypedTerm arg2)}))---- | DSL reference to hydra.annotations.commentsFromFieldType-commentsFromFieldType :: Typed.TypedTerm t0 -> Typed.TypedTerm Graph.Graph -> Typed.TypedTerm Core.FieldType -> Typed.TypedTerm (Either Errors.Error (Maybe String))-commentsFromFieldType arg0 arg1 arg2 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.annotations.commentsFromFieldType")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)})),- Core.applicationArgument = (Typed.unTypedTerm arg2)}))---- | DSL reference to hydra.annotations.getAnnotationMap-getAnnotationMap :: Typed.TypedTerm Core.Term -> Typed.TypedTerm (M.Map Core.Name Core.Term)-getAnnotationMap arg0 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.annotations.getAnnotationMap")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))---- | DSL reference to hydra.annotations.getDescription-getDescription :: Typed.TypedTerm t0 -> Typed.TypedTerm Graph.Graph -> Typed.TypedTerm (M.Map Core.Name Core.Term) -> Typed.TypedTerm (Either Errors.Error (Maybe String))-getDescription arg0 arg1 arg2 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.annotations.getDescription")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)})),- Core.applicationArgument = (Typed.unTypedTerm arg2)}))---- | DSL reference to hydra.annotations.getTermAnnotation-getTermAnnotation :: Typed.TypedTerm Core.Name -> Typed.TypedTerm Core.Term -> Typed.TypedTerm (Maybe Core.Term)-getTermAnnotation arg0 arg1 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.annotations.getTermAnnotation")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))---- | DSL reference to hydra.annotations.getTermDescription-getTermDescription :: Typed.TypedTerm t0 -> Typed.TypedTerm Graph.Graph -> Typed.TypedTerm Core.Term -> Typed.TypedTerm (Either Errors.Error (Maybe String))-getTermDescription arg0 arg1 arg2 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.annotations.getTermDescription")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)})),- Core.applicationArgument = (Typed.unTypedTerm arg2)}))---- | DSL reference to hydra.annotations.getType-getType :: Typed.TypedTerm Graph.Graph -> Typed.TypedTerm (M.Map Core.Name Core.Term) -> Typed.TypedTerm (Either Errors.DecodingError (Maybe Core.Type))-getType arg0 arg1 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.annotations.getType")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))---- | DSL reference to hydra.annotations.getTypeAnnotation-getTypeAnnotation :: Typed.TypedTerm Core.Name -> Typed.TypedTerm Core.Type -> Typed.TypedTerm (Maybe Core.Term)-getTypeAnnotation arg0 arg1 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.annotations.getTypeAnnotation")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))---- | DSL reference to hydra.annotations.getTypeClasses-getTypeClasses :: Typed.TypedTerm t0 -> Typed.TypedTerm Graph.Graph -> Typed.TypedTerm Core.Term -> Typed.TypedTerm (Either Errors.Error (M.Map Core.Name (S.Set Core.Name)))-getTypeClasses arg0 arg1 arg2 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.annotations.getTypeClasses")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)})),- Core.applicationArgument = (Typed.unTypedTerm arg2)}))---- | DSL reference to hydra.annotations.getTypeDescription-getTypeDescription :: Typed.TypedTerm t0 -> Typed.TypedTerm Graph.Graph -> Typed.TypedTerm Core.Type -> Typed.TypedTerm (Either Errors.Error (Maybe String))-getTypeDescription arg0 arg1 arg2 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.annotations.getTypeDescription")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)})),- Core.applicationArgument = (Typed.unTypedTerm arg2)}))---- | DSL reference to hydra.annotations.hasDescription-hasDescription :: Typed.TypedTerm (M.Map Core.Name t0) -> Typed.TypedTerm Bool-hasDescription arg0 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.annotations.hasDescription")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))---- | DSL reference to hydra.annotations.hasTypeDescription-hasTypeDescription :: Typed.TypedTerm Core.Type -> Typed.TypedTerm Bool-hasTypeDescription arg0 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.annotations.hasTypeDescription")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))---- | DSL reference to hydra.annotations.isNativeType-isNativeType :: Typed.TypedTerm Core.Binding -> Typed.TypedTerm Bool-isNativeType arg0 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.annotations.isNativeType")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))---- | DSL reference to hydra.annotations.normalizeTermAnnotations-normalizeTermAnnotations :: Typed.TypedTerm Core.Term -> Typed.TypedTerm Core.Term-normalizeTermAnnotations arg0 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.annotations.normalizeTermAnnotations")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))---- | DSL reference to hydra.annotations.normalizeTypeAnnotations-normalizeTypeAnnotations :: Typed.TypedTerm Core.Type -> Typed.TypedTerm Core.Type-normalizeTypeAnnotations arg0 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.annotations.normalizeTypeAnnotations")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))---- | DSL reference to hydra.annotations.setAnnotation-setAnnotation :: Typed.TypedTerm t0 -> Typed.TypedTerm (Maybe t1) -> Typed.TypedTerm (M.Map t0 t1) -> Typed.TypedTerm (M.Map t0 t1)-setAnnotation arg0 arg1 arg2 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.annotations.setAnnotation")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)})),- Core.applicationArgument = (Typed.unTypedTerm arg2)}))---- | DSL reference to hydra.annotations.setDescription-setDescription :: Typed.TypedTerm (Maybe String) -> Typed.TypedTerm (M.Map Core.Name Core.Term) -> Typed.TypedTerm (M.Map Core.Name Core.Term)-setDescription arg0 arg1 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.annotations.setDescription")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))---- | DSL reference to hydra.annotations.setTermAnnotation-setTermAnnotation :: Typed.TypedTerm Core.Name -> Typed.TypedTerm (Maybe Core.Term) -> Typed.TypedTerm Core.Term -> Typed.TypedTerm Core.Term-setTermAnnotation arg0 arg1 arg2 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.annotations.setTermAnnotation")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)})),- Core.applicationArgument = (Typed.unTypedTerm arg2)}))---- | DSL reference to hydra.annotations.setTermDescription-setTermDescription :: Typed.TypedTerm (Maybe String) -> Typed.TypedTerm Core.Term -> Typed.TypedTerm Core.Term-setTermDescription arg0 arg1 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.annotations.setTermDescription")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))---- | DSL reference to hydra.annotations.setType-setType :: Typed.TypedTerm (Maybe Core.Type) -> Typed.TypedTerm (M.Map Core.Name Core.Term) -> Typed.TypedTerm (M.Map Core.Name Core.Term)-setType arg0 arg1 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.annotations.setType")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))---- | DSL reference to hydra.annotations.setTypeAnnotation-setTypeAnnotation :: Typed.TypedTerm Core.Name -> Typed.TypedTerm (Maybe Core.Term) -> Typed.TypedTerm Core.Type -> Typed.TypedTerm Core.Type-setTypeAnnotation arg0 arg1 arg2 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.annotations.setTypeAnnotation")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)})),- Core.applicationArgument = (Typed.unTypedTerm arg2)}))---- | DSL reference to hydra.annotations.setTypeClasses-setTypeClasses :: Typed.TypedTerm (M.Map Core.Name (S.Set Core.Name)) -> Typed.TypedTerm Core.Term -> Typed.TypedTerm Core.Term-setTypeClasses arg0 arg1 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.annotations.setTypeClasses")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))---- | DSL reference to hydra.annotations.setTypeDescription-setTypeDescription :: Typed.TypedTerm (Maybe String) -> Typed.TypedTerm Core.Type -> Typed.TypedTerm Core.Type-setTypeDescription arg0 arg1 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.annotations.setTypeDescription")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))---- | DSL reference to hydra.annotations.termAnnotationInternal-termAnnotationInternal :: Typed.TypedTerm Core.Term -> Typed.TypedTerm (M.Map Core.Name Core.Term)-termAnnotationInternal arg0 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.annotations.termAnnotationInternal")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))---- | DSL reference to hydra.annotations.typeAnnotationInternal-typeAnnotationInternal :: Typed.TypedTerm Core.Type -> Typed.TypedTerm (M.Map Core.Name Core.Term)-typeAnnotationInternal arg0 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.annotations.typeAnnotationInternal")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))---- | DSL reference to hydra.annotations.wrapAnnotationMap-wrapAnnotationMap :: Typed.TypedTerm (M.Map Core.Name Core.Term) -> Typed.TypedTerm Core.Term-wrapAnnotationMap arg0 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.annotations.wrapAnnotationMap")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))
@@ -1,102 +0,0 @@--- Note: this is an automatically generated file. Do not edit.---- | DSL functions for hydra.arity--module Hydra.Dsl.Arity where--import qualified Hydra.Arity as Arity-import qualified Hydra.Ast as Ast-import qualified Hydra.Coders as Coders-import qualified Hydra.Core as Core-import qualified Hydra.Docs as Docs-import qualified Hydra.Dsl.Ast as DslAst-import qualified Hydra.Dsl.Coders as DslCoders-import qualified Hydra.Dsl.Core as DslCore-import qualified Hydra.Dsl.Docs as DslDocs-import qualified Hydra.Dsl.Error.Checking as ErrorChecking-import qualified Hydra.Dsl.Error.Core as DslErrorCore-import qualified Hydra.Dsl.Error.File as DslErrorFile-import qualified Hydra.Dsl.Error.Packaging as DslErrorPackaging-import qualified Hydra.Dsl.Error.System as DslErrorSystem-import qualified Hydra.Dsl.Errors as DslErrors-import qualified Hydra.Dsl.File as DslFile-import qualified Hydra.Dsl.Graph as DslGraph-import qualified Hydra.Dsl.Json.Model as JsonModel-import qualified Hydra.Dsl.Packaging as DslPackaging-import qualified Hydra.Dsl.Parsing as DslParsing-import qualified Hydra.Dsl.Paths as DslPaths-import qualified Hydra.Dsl.Query as DslQuery-import qualified Hydra.Dsl.Regex as DslRegex-import qualified Hydra.Dsl.Relational as DslRelational-import qualified Hydra.Dsl.System as DslSystem-import qualified Hydra.Dsl.Tabular as DslTabular-import qualified Hydra.Dsl.Testing as DslTesting-import qualified Hydra.Dsl.Time as DslTime-import qualified Hydra.Dsl.Topology as DslTopology-import qualified Hydra.Dsl.Typing as DslTyping-import qualified Hydra.Dsl.Util as DslUtil-import qualified Hydra.Dsl.Validation as DslValidation-import qualified Hydra.Dsl.Variants as DslVariants-import qualified Hydra.Error.Checking as Checking-import qualified Hydra.Error.Core as ErrorCore-import qualified Hydra.Error.File as ErrorFile-import qualified Hydra.Error.Packaging as ErrorPackaging-import qualified Hydra.Error.System as ErrorSystem-import qualified Hydra.Errors as Errors-import qualified Hydra.File as File-import qualified Hydra.Graph as Graph-import qualified Hydra.Json.Model as Model-import qualified Hydra.Packaging as Packaging-import qualified Hydra.Parsing as Parsing-import qualified Hydra.Paths as Paths-import qualified Hydra.Query as Query-import qualified Hydra.Regex as Regex-import qualified Hydra.Relational as Relational-import qualified Hydra.System as System-import qualified Hydra.Tabular as Tabular-import qualified Hydra.Testing as Testing-import qualified Hydra.Time as Time-import qualified Hydra.Topology as Topology-import qualified Hydra.Typed as Typed-import qualified Hydra.Typing as Typing-import qualified Hydra.Util as Util-import qualified Hydra.Validation as Validation-import qualified Hydra.Variants as Variants-import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)-import qualified Data.Scientific as Sci-import Data.Void---- | DSL reference to hydra.arity.primitiveArity-primitiveArity :: Typed.TypedTerm Graph.Primitive -> Typed.TypedTerm Int-primitiveArity arg0 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.arity.primitiveArity")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))---- | DSL reference to hydra.arity.termArity-termArity :: Typed.TypedTerm Core.Term -> Typed.TypedTerm Int-termArity arg0 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.arity.termArity")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))---- | DSL reference to hydra.arity.typeArity-typeArity :: Typed.TypedTerm Core.Type -> Typed.TypedTerm Int-typeArity arg0 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.arity.typeArity")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))---- | DSL reference to hydra.arity.typeSchemeArity-typeSchemeArity :: Typed.TypedTerm Core.TypeScheme -> Typed.TypedTerm Int-typeSchemeArity arg0 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.arity.typeSchemeArity")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))---- | DSL reference to hydra.arity.uncurryType-uncurryType :: Typed.TypedTerm Core.Type -> Typed.TypedTerm [Core.Type]-uncurryType arg0 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.arity.uncurryType")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))
@@ -1,1027 +0,0 @@--- Note: this is an automatically generated file. Do not edit.---- | DSL functions for hydra.ast--module Hydra.Dsl.Ast where--import qualified Hydra.Ast as Ast-import qualified Hydra.Core as Core-import qualified Hydra.Decode.Ast as DecodeAst-import qualified Hydra.Dsl.Core as DslCore-import qualified Hydra.Encode.Ast as EncodeAst-import qualified Hydra.Typed as Typed-import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)-import qualified Data.Scientific as Sci-import Data.Void---- | DSL name token for hydra.ast.Associativity-associativityAssociativity :: Typed.TypedName Ast.Associativity-associativityAssociativity = Typed.TypedName (Core.Name "hydra.ast.Associativity")---- | DSL injection for the both variant of hydra.ast.Associativity-associativityBoth :: Typed.TypedTerm Ast.Associativity-associativityBoth =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.ast.Associativity"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "both"),- Core.fieldTerm = Core.TermUnit}}))---- | DSL injection for the left variant of hydra.ast.Associativity-associativityLeft :: Typed.TypedTerm Ast.Associativity-associativityLeft =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.ast.Associativity"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "left"),- Core.fieldTerm = Core.TermUnit}}))---- | DSL injection for the none variant of hydra.ast.Associativity-associativityNone :: Typed.TypedTerm Ast.Associativity-associativityNone =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.ast.Associativity"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "none"),- Core.fieldTerm = Core.TermUnit}}))---- | DSL injection for the right variant of hydra.ast.Associativity-associativityRight :: Typed.TypedTerm Ast.Associativity-associativityRight =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.ast.Associativity"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "right"),- Core.fieldTerm = Core.TermUnit}}))---- | DSL constructor for hydra.ast.BlockStyle-blockStyle :: Typed.TypedTerm (Maybe String) -> Typed.TypedTerm Bool -> Typed.TypedTerm Bool -> Typed.TypedTerm Ast.BlockStyle-blockStyle indent newlineBeforeContent newlineAfterContent =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.ast.BlockStyle"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "indent"),- Core.fieldTerm = (Typed.unTypedTerm indent)},- Core.Field {- Core.fieldName = (Core.Name "newlineBeforeContent"),- Core.fieldTerm = (Typed.unTypedTerm newlineBeforeContent)},- Core.Field {- Core.fieldName = (Core.Name "newlineAfterContent"),- Core.fieldTerm = (Typed.unTypedTerm newlineAfterContent)}]}))---- | DSL name token for hydra.ast.BlockStyle-blockStyleBlockStyle :: Typed.TypedName Ast.BlockStyle-blockStyleBlockStyle = Typed.TypedName (Core.Name "hydra.ast.BlockStyle")---- | DSL accessor for the indent field of hydra.ast.BlockStyle-blockStyleIndent :: Typed.TypedTerm Ast.BlockStyle -> Typed.TypedTerm (Maybe String)-blockStyleIndent x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.ast.BlockStyle"),- Core.projectionFieldName = (Core.Name "indent")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL accessor for the newlineAfterContent field of hydra.ast.BlockStyle-blockStyleNewlineAfterContent :: Typed.TypedTerm Ast.BlockStyle -> Typed.TypedTerm Bool-blockStyleNewlineAfterContent x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.ast.BlockStyle"),- Core.projectionFieldName = (Core.Name "newlineAfterContent")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL accessor for the newlineBeforeContent field of hydra.ast.BlockStyle-blockStyleNewlineBeforeContent :: Typed.TypedTerm Ast.BlockStyle -> Typed.TypedTerm Bool-blockStyleNewlineBeforeContent x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.ast.BlockStyle"),- Core.projectionFieldName = (Core.Name "newlineBeforeContent")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL updater for the indent field of hydra.ast.BlockStyle-blockStyleWithIndent :: Typed.TypedTerm Ast.BlockStyle -> Typed.TypedTerm (Maybe String) -> Typed.TypedTerm Ast.BlockStyle-blockStyleWithIndent original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.ast.BlockStyle"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "indent"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "newlineBeforeContent"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.ast.BlockStyle"),- Core.projectionFieldName = (Core.Name "newlineBeforeContent")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "newlineAfterContent"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.ast.BlockStyle"),- Core.projectionFieldName = (Core.Name "newlineAfterContent")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL updater for the newlineAfterContent field of hydra.ast.BlockStyle-blockStyleWithNewlineAfterContent :: Typed.TypedTerm Ast.BlockStyle -> Typed.TypedTerm Bool -> Typed.TypedTerm Ast.BlockStyle-blockStyleWithNewlineAfterContent original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.ast.BlockStyle"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "indent"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.ast.BlockStyle"),- Core.projectionFieldName = (Core.Name "indent")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "newlineBeforeContent"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.ast.BlockStyle"),- Core.projectionFieldName = (Core.Name "newlineBeforeContent")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "newlineAfterContent"),- Core.fieldTerm = (Typed.unTypedTerm newVal)}]}))---- | DSL updater for the newlineBeforeContent field of hydra.ast.BlockStyle-blockStyleWithNewlineBeforeContent :: Typed.TypedTerm Ast.BlockStyle -> Typed.TypedTerm Bool -> Typed.TypedTerm Ast.BlockStyle-blockStyleWithNewlineBeforeContent original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.ast.BlockStyle"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "indent"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.ast.BlockStyle"),- Core.projectionFieldName = (Core.Name "indent")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "newlineBeforeContent"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "newlineAfterContent"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.ast.BlockStyle"),- Core.projectionFieldName = (Core.Name "newlineAfterContent")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL constructor for hydra.ast.BracketExpr-bracketExpr :: Typed.TypedTerm Ast.Brackets -> Typed.TypedTerm Ast.Expr -> Typed.TypedTerm Ast.BlockStyle -> Typed.TypedTerm Ast.BracketExpr-bracketExpr brackets enclosed style =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.ast.BracketExpr"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "brackets"),- Core.fieldTerm = (Typed.unTypedTerm brackets)},- Core.Field {- Core.fieldName = (Core.Name "enclosed"),- Core.fieldTerm = (Typed.unTypedTerm enclosed)},- Core.Field {- Core.fieldName = (Core.Name "style"),- Core.fieldTerm = (Typed.unTypedTerm style)}]}))---- | DSL name token for hydra.ast.BracketExpr-bracketExprBracketExpr :: Typed.TypedName Ast.BracketExpr-bracketExprBracketExpr = Typed.TypedName (Core.Name "hydra.ast.BracketExpr")---- | DSL accessor for the brackets field of hydra.ast.BracketExpr-bracketExprBrackets :: Typed.TypedTerm Ast.BracketExpr -> Typed.TypedTerm Ast.Brackets-bracketExprBrackets x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.ast.BracketExpr"),- Core.projectionFieldName = (Core.Name "brackets")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL accessor for the enclosed field of hydra.ast.BracketExpr-bracketExprEnclosed :: Typed.TypedTerm Ast.BracketExpr -> Typed.TypedTerm Ast.Expr-bracketExprEnclosed x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.ast.BracketExpr"),- Core.projectionFieldName = (Core.Name "enclosed")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL accessor for the style field of hydra.ast.BracketExpr-bracketExprStyle :: Typed.TypedTerm Ast.BracketExpr -> Typed.TypedTerm Ast.BlockStyle-bracketExprStyle x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.ast.BracketExpr"),- Core.projectionFieldName = (Core.Name "style")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL updater for the brackets field of hydra.ast.BracketExpr-bracketExprWithBrackets :: Typed.TypedTerm Ast.BracketExpr -> Typed.TypedTerm Ast.Brackets -> Typed.TypedTerm Ast.BracketExpr-bracketExprWithBrackets original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.ast.BracketExpr"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "brackets"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "enclosed"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.ast.BracketExpr"),- Core.projectionFieldName = (Core.Name "enclosed")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "style"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.ast.BracketExpr"),- Core.projectionFieldName = (Core.Name "style")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL updater for the enclosed field of hydra.ast.BracketExpr-bracketExprWithEnclosed :: Typed.TypedTerm Ast.BracketExpr -> Typed.TypedTerm Ast.Expr -> Typed.TypedTerm Ast.BracketExpr-bracketExprWithEnclosed original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.ast.BracketExpr"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "brackets"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.ast.BracketExpr"),- Core.projectionFieldName = (Core.Name "brackets")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "enclosed"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "style"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.ast.BracketExpr"),- Core.projectionFieldName = (Core.Name "style")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL updater for the style field of hydra.ast.BracketExpr-bracketExprWithStyle :: Typed.TypedTerm Ast.BracketExpr -> Typed.TypedTerm Ast.BlockStyle -> Typed.TypedTerm Ast.BracketExpr-bracketExprWithStyle original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.ast.BracketExpr"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "brackets"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.ast.BracketExpr"),- Core.projectionFieldName = (Core.Name "brackets")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "enclosed"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.ast.BracketExpr"),- Core.projectionFieldName = (Core.Name "enclosed")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "style"),- Core.fieldTerm = (Typed.unTypedTerm newVal)}]}))---- | DSL constructor for hydra.ast.Brackets-brackets :: Typed.TypedTerm Ast.Symbol -> Typed.TypedTerm Ast.Symbol -> Typed.TypedTerm Ast.Brackets-brackets open close =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.ast.Brackets"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "open"),- Core.fieldTerm = (Typed.unTypedTerm open)},- Core.Field {- Core.fieldName = (Core.Name "close"),- Core.fieldTerm = (Typed.unTypedTerm close)}]}))---- | DSL name token for hydra.ast.Brackets-bracketsBrackets :: Typed.TypedName Ast.Brackets-bracketsBrackets = Typed.TypedName (Core.Name "hydra.ast.Brackets")---- | DSL accessor for the close field of hydra.ast.Brackets-bracketsClose :: Typed.TypedTerm Ast.Brackets -> Typed.TypedTerm Ast.Symbol-bracketsClose x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.ast.Brackets"),- Core.projectionFieldName = (Core.Name "close")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL accessor for the open field of hydra.ast.Brackets-bracketsOpen :: Typed.TypedTerm Ast.Brackets -> Typed.TypedTerm Ast.Symbol-bracketsOpen x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.ast.Brackets"),- Core.projectionFieldName = (Core.Name "open")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL updater for the close field of hydra.ast.Brackets-bracketsWithClose :: Typed.TypedTerm Ast.Brackets -> Typed.TypedTerm Ast.Symbol -> Typed.TypedTerm Ast.Brackets-bracketsWithClose original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.ast.Brackets"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "open"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.ast.Brackets"),- Core.projectionFieldName = (Core.Name "open")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "close"),- Core.fieldTerm = (Typed.unTypedTerm newVal)}]}))---- | DSL updater for the open field of hydra.ast.Brackets-bracketsWithOpen :: Typed.TypedTerm Ast.Brackets -> Typed.TypedTerm Ast.Symbol -> Typed.TypedTerm Ast.Brackets-bracketsWithOpen original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.ast.Brackets"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "open"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "close"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.ast.Brackets"),- Core.projectionFieldName = (Core.Name "close")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL injection for the brackets variant of hydra.ast.Expr-exprBrackets :: Typed.TypedTerm Ast.BracketExpr -> Typed.TypedTerm Ast.Expr-exprBrackets x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.ast.Expr"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "brackets"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the const variant of hydra.ast.Expr-exprConst :: Typed.TypedTerm Ast.Symbol -> Typed.TypedTerm Ast.Expr-exprConst x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.ast.Expr"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "const"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL name token for hydra.ast.Expr-exprExpr :: Typed.TypedName Ast.Expr-exprExpr = Typed.TypedName (Core.Name "hydra.ast.Expr")---- | DSL injection for the indent variant of hydra.ast.Expr-exprIndent :: Typed.TypedTerm Ast.IndentedExpression -> Typed.TypedTerm Ast.Expr-exprIndent x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.ast.Expr"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "indent"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the op variant of hydra.ast.Expr-exprOp :: Typed.TypedTerm Ast.OpExpr -> Typed.TypedTerm Ast.Expr-exprOp x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.ast.Expr"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "op"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the seq variant of hydra.ast.Expr-exprSeq :: Typed.TypedTerm Ast.SeqExpr -> Typed.TypedTerm Ast.Expr-exprSeq x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.ast.Expr"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "seq"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the allLines variant of hydra.ast.IndentStyle-indentStyleAllLines :: Typed.TypedTerm String -> Typed.TypedTerm Ast.IndentStyle-indentStyleAllLines x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.ast.IndentStyle"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "allLines"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL name token for hydra.ast.IndentStyle-indentStyleIndentStyle :: Typed.TypedName Ast.IndentStyle-indentStyleIndentStyle = Typed.TypedName (Core.Name "hydra.ast.IndentStyle")---- | DSL injection for the subsequentLines variant of hydra.ast.IndentStyle-indentStyleSubsequentLines :: Typed.TypedTerm String -> Typed.TypedTerm Ast.IndentStyle-indentStyleSubsequentLines x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.ast.IndentStyle"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "subsequentLines"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL constructor for hydra.ast.IndentedExpression-indentedExpression :: Typed.TypedTerm Ast.IndentStyle -> Typed.TypedTerm Ast.Expr -> Typed.TypedTerm Ast.IndentedExpression-indentedExpression style expr =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.ast.IndentedExpression"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "style"),- Core.fieldTerm = (Typed.unTypedTerm style)},- Core.Field {- Core.fieldName = (Core.Name "expr"),- Core.fieldTerm = (Typed.unTypedTerm expr)}]}))---- | DSL accessor for the expr field of hydra.ast.IndentedExpression-indentedExpressionExpr :: Typed.TypedTerm Ast.IndentedExpression -> Typed.TypedTerm Ast.Expr-indentedExpressionExpr x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.ast.IndentedExpression"),- Core.projectionFieldName = (Core.Name "expr")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL name token for hydra.ast.IndentedExpression-indentedExpressionIndentedExpression :: Typed.TypedName Ast.IndentedExpression-indentedExpressionIndentedExpression = Typed.TypedName (Core.Name "hydra.ast.IndentedExpression")---- | DSL accessor for the style field of hydra.ast.IndentedExpression-indentedExpressionStyle :: Typed.TypedTerm Ast.IndentedExpression -> Typed.TypedTerm Ast.IndentStyle-indentedExpressionStyle x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.ast.IndentedExpression"),- Core.projectionFieldName = (Core.Name "style")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL updater for the expr field of hydra.ast.IndentedExpression-indentedExpressionWithExpr :: Typed.TypedTerm Ast.IndentedExpression -> Typed.TypedTerm Ast.Expr -> Typed.TypedTerm Ast.IndentedExpression-indentedExpressionWithExpr original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.ast.IndentedExpression"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "style"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.ast.IndentedExpression"),- Core.projectionFieldName = (Core.Name "style")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "expr"),- Core.fieldTerm = (Typed.unTypedTerm newVal)}]}))---- | DSL updater for the style field of hydra.ast.IndentedExpression-indentedExpressionWithStyle :: Typed.TypedTerm Ast.IndentedExpression -> Typed.TypedTerm Ast.IndentStyle -> Typed.TypedTerm Ast.IndentedExpression-indentedExpressionWithStyle original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.ast.IndentedExpression"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "style"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "expr"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.ast.IndentedExpression"),- Core.projectionFieldName = (Core.Name "expr")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL constructor for hydra.ast.Op-op :: Typed.TypedTerm Ast.Symbol -> Typed.TypedTerm Ast.Padding -> Typed.TypedTerm Ast.Precedence -> Typed.TypedTerm Ast.Associativity -> Typed.TypedTerm Ast.Op-op symbol padding precedence associativity =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.ast.Op"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "symbol"),- Core.fieldTerm = (Typed.unTypedTerm symbol)},- Core.Field {- Core.fieldName = (Core.Name "padding"),- Core.fieldTerm = (Typed.unTypedTerm padding)},- Core.Field {- Core.fieldName = (Core.Name "precedence"),- Core.fieldTerm = (Typed.unTypedTerm precedence)},- Core.Field {- Core.fieldName = (Core.Name "associativity"),- Core.fieldTerm = (Typed.unTypedTerm associativity)}]}))---- | DSL accessor for the associativity field of hydra.ast.Op-opAssociativity :: Typed.TypedTerm Ast.Op -> Typed.TypedTerm Ast.Associativity-opAssociativity x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.ast.Op"),- Core.projectionFieldName = (Core.Name "associativity")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL constructor for hydra.ast.OpExpr-opExpr :: Typed.TypedTerm Ast.Op -> Typed.TypedTerm Ast.Expr -> Typed.TypedTerm Ast.Expr -> Typed.TypedTerm Ast.OpExpr-opExpr op lhs rhs =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.ast.OpExpr"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "op"),- Core.fieldTerm = (Typed.unTypedTerm op)},- Core.Field {- Core.fieldName = (Core.Name "lhs"),- Core.fieldTerm = (Typed.unTypedTerm lhs)},- Core.Field {- Core.fieldName = (Core.Name "rhs"),- Core.fieldTerm = (Typed.unTypedTerm rhs)}]}))---- | DSL accessor for the lhs field of hydra.ast.OpExpr-opExprLhs :: Typed.TypedTerm Ast.OpExpr -> Typed.TypedTerm Ast.Expr-opExprLhs x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.ast.OpExpr"),- Core.projectionFieldName = (Core.Name "lhs")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL accessor for the op field of hydra.ast.OpExpr-opExprOp :: Typed.TypedTerm Ast.OpExpr -> Typed.TypedTerm Ast.Op-opExprOp x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.ast.OpExpr"),- Core.projectionFieldName = (Core.Name "op")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL name token for hydra.ast.OpExpr-opExprOpExpr :: Typed.TypedName Ast.OpExpr-opExprOpExpr = Typed.TypedName (Core.Name "hydra.ast.OpExpr")---- | DSL accessor for the rhs field of hydra.ast.OpExpr-opExprRhs :: Typed.TypedTerm Ast.OpExpr -> Typed.TypedTerm Ast.Expr-opExprRhs x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.ast.OpExpr"),- Core.projectionFieldName = (Core.Name "rhs")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL updater for the lhs field of hydra.ast.OpExpr-opExprWithLhs :: Typed.TypedTerm Ast.OpExpr -> Typed.TypedTerm Ast.Expr -> Typed.TypedTerm Ast.OpExpr-opExprWithLhs original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.ast.OpExpr"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "op"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.ast.OpExpr"),- Core.projectionFieldName = (Core.Name "op")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "lhs"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "rhs"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.ast.OpExpr"),- Core.projectionFieldName = (Core.Name "rhs")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL updater for the op field of hydra.ast.OpExpr-opExprWithOp :: Typed.TypedTerm Ast.OpExpr -> Typed.TypedTerm Ast.Op -> Typed.TypedTerm Ast.OpExpr-opExprWithOp original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.ast.OpExpr"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "op"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "lhs"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.ast.OpExpr"),- Core.projectionFieldName = (Core.Name "lhs")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "rhs"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.ast.OpExpr"),- Core.projectionFieldName = (Core.Name "rhs")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL updater for the rhs field of hydra.ast.OpExpr-opExprWithRhs :: Typed.TypedTerm Ast.OpExpr -> Typed.TypedTerm Ast.Expr -> Typed.TypedTerm Ast.OpExpr-opExprWithRhs original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.ast.OpExpr"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "op"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.ast.OpExpr"),- Core.projectionFieldName = (Core.Name "op")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "lhs"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.ast.OpExpr"),- Core.projectionFieldName = (Core.Name "lhs")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "rhs"),- Core.fieldTerm = (Typed.unTypedTerm newVal)}]}))---- | DSL name token for hydra.ast.Op-opOp :: Typed.TypedName Ast.Op-opOp = Typed.TypedName (Core.Name "hydra.ast.Op")---- | DSL accessor for the padding field of hydra.ast.Op-opPadding :: Typed.TypedTerm Ast.Op -> Typed.TypedTerm Ast.Padding-opPadding x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.ast.Op"),- Core.projectionFieldName = (Core.Name "padding")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL accessor for the precedence field of hydra.ast.Op-opPrecedence :: Typed.TypedTerm Ast.Op -> Typed.TypedTerm Ast.Precedence-opPrecedence x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.ast.Op"),- Core.projectionFieldName = (Core.Name "precedence")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL accessor for the symbol field of hydra.ast.Op-opSymbol :: Typed.TypedTerm Ast.Op -> Typed.TypedTerm Ast.Symbol-opSymbol x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.ast.Op"),- Core.projectionFieldName = (Core.Name "symbol")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL updater for the associativity field of hydra.ast.Op-opWithAssociativity :: Typed.TypedTerm Ast.Op -> Typed.TypedTerm Ast.Associativity -> Typed.TypedTerm Ast.Op-opWithAssociativity original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.ast.Op"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "symbol"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.ast.Op"),- Core.projectionFieldName = (Core.Name "symbol")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "padding"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.ast.Op"),- Core.projectionFieldName = (Core.Name "padding")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "precedence"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.ast.Op"),- Core.projectionFieldName = (Core.Name "precedence")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "associativity"),- Core.fieldTerm = (Typed.unTypedTerm newVal)}]}))---- | DSL updater for the padding field of hydra.ast.Op-opWithPadding :: Typed.TypedTerm Ast.Op -> Typed.TypedTerm Ast.Padding -> Typed.TypedTerm Ast.Op-opWithPadding original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.ast.Op"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "symbol"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.ast.Op"),- Core.projectionFieldName = (Core.Name "symbol")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "padding"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "precedence"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.ast.Op"),- Core.projectionFieldName = (Core.Name "precedence")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "associativity"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.ast.Op"),- Core.projectionFieldName = (Core.Name "associativity")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL updater for the precedence field of hydra.ast.Op-opWithPrecedence :: Typed.TypedTerm Ast.Op -> Typed.TypedTerm Ast.Precedence -> Typed.TypedTerm Ast.Op-opWithPrecedence original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.ast.Op"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "symbol"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.ast.Op"),- Core.projectionFieldName = (Core.Name "symbol")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "padding"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.ast.Op"),- Core.projectionFieldName = (Core.Name "padding")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "precedence"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "associativity"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.ast.Op"),- Core.projectionFieldName = (Core.Name "associativity")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL updater for the symbol field of hydra.ast.Op-opWithSymbol :: Typed.TypedTerm Ast.Op -> Typed.TypedTerm Ast.Symbol -> Typed.TypedTerm Ast.Op-opWithSymbol original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.ast.Op"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "symbol"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "padding"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.ast.Op"),- Core.projectionFieldName = (Core.Name "padding")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "precedence"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.ast.Op"),- Core.projectionFieldName = (Core.Name "precedence")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "associativity"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.ast.Op"),- Core.projectionFieldName = (Core.Name "associativity")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL constructor for hydra.ast.Padding-padding :: Typed.TypedTerm Ast.Ws -> Typed.TypedTerm Ast.Ws -> Typed.TypedTerm Ast.Padding-padding left right =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.ast.Padding"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "left"),- Core.fieldTerm = (Typed.unTypedTerm left)},- Core.Field {- Core.fieldName = (Core.Name "right"),- Core.fieldTerm = (Typed.unTypedTerm right)}]}))---- | DSL accessor for the left field of hydra.ast.Padding-paddingLeft :: Typed.TypedTerm Ast.Padding -> Typed.TypedTerm Ast.Ws-paddingLeft x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.ast.Padding"),- Core.projectionFieldName = (Core.Name "left")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL name token for hydra.ast.Padding-paddingPadding :: Typed.TypedName Ast.Padding-paddingPadding = Typed.TypedName (Core.Name "hydra.ast.Padding")---- | DSL accessor for the right field of hydra.ast.Padding-paddingRight :: Typed.TypedTerm Ast.Padding -> Typed.TypedTerm Ast.Ws-paddingRight x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.ast.Padding"),- Core.projectionFieldName = (Core.Name "right")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL updater for the left field of hydra.ast.Padding-paddingWithLeft :: Typed.TypedTerm Ast.Padding -> Typed.TypedTerm Ast.Ws -> Typed.TypedTerm Ast.Padding-paddingWithLeft original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.ast.Padding"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "left"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "right"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.ast.Padding"),- Core.projectionFieldName = (Core.Name "right")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL updater for the right field of hydra.ast.Padding-paddingWithRight :: Typed.TypedTerm Ast.Padding -> Typed.TypedTerm Ast.Ws -> Typed.TypedTerm Ast.Padding-paddingWithRight original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.ast.Padding"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "left"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.ast.Padding"),- Core.projectionFieldName = (Core.Name "left")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "right"),- Core.fieldTerm = (Typed.unTypedTerm newVal)}]}))---- | DSL constructor for the hydra.ast.Precedence wrapper-precedence :: Typed.TypedTerm Int -> Typed.TypedTerm Ast.Precedence-precedence x =- Typed.TypedTerm (Core.TermWrap (Core.WrappedTerm {- Core.wrappedTermTypeName = (Core.Name "hydra.ast.Precedence"),- Core.wrappedTermBody = (Typed.unTypedTerm x)}))---- | DSL name token for hydra.ast.Precedence-precedencePrecedence :: Typed.TypedName Ast.Precedence-precedencePrecedence = Typed.TypedName (Core.Name "hydra.ast.Precedence")---- | DSL constructor for hydra.ast.SeqExpr-seqExpr :: Typed.TypedTerm Ast.Op -> Typed.TypedTerm [Ast.Expr] -> Typed.TypedTerm Ast.SeqExpr-seqExpr op elements =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.ast.SeqExpr"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "op"),- Core.fieldTerm = (Typed.unTypedTerm op)},- Core.Field {- Core.fieldName = (Core.Name "elements"),- Core.fieldTerm = (Typed.unTypedTerm elements)}]}))---- | DSL accessor for the elements field of hydra.ast.SeqExpr-seqExprElements :: Typed.TypedTerm Ast.SeqExpr -> Typed.TypedTerm [Ast.Expr]-seqExprElements x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.ast.SeqExpr"),- Core.projectionFieldName = (Core.Name "elements")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL accessor for the op field of hydra.ast.SeqExpr-seqExprOp :: Typed.TypedTerm Ast.SeqExpr -> Typed.TypedTerm Ast.Op-seqExprOp x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.ast.SeqExpr"),- Core.projectionFieldName = (Core.Name "op")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL name token for hydra.ast.SeqExpr-seqExprSeqExpr :: Typed.TypedName Ast.SeqExpr-seqExprSeqExpr = Typed.TypedName (Core.Name "hydra.ast.SeqExpr")---- | DSL updater for the elements field of hydra.ast.SeqExpr-seqExprWithElements :: Typed.TypedTerm Ast.SeqExpr -> Typed.TypedTerm [Ast.Expr] -> Typed.TypedTerm Ast.SeqExpr-seqExprWithElements original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.ast.SeqExpr"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "op"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.ast.SeqExpr"),- Core.projectionFieldName = (Core.Name "op")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "elements"),- Core.fieldTerm = (Typed.unTypedTerm newVal)}]}))---- | DSL updater for the op field of hydra.ast.SeqExpr-seqExprWithOp :: Typed.TypedTerm Ast.SeqExpr -> Typed.TypedTerm Ast.Op -> Typed.TypedTerm Ast.SeqExpr-seqExprWithOp original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.ast.SeqExpr"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "op"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "elements"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.ast.SeqExpr"),- Core.projectionFieldName = (Core.Name "elements")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL constructor for the hydra.ast.Symbol wrapper-symbol :: Typed.TypedTerm String -> Typed.TypedTerm Ast.Symbol-symbol x =- Typed.TypedTerm (Core.TermWrap (Core.WrappedTerm {- Core.wrappedTermTypeName = (Core.Name "hydra.ast.Symbol"),- Core.wrappedTermBody = (Typed.unTypedTerm x)}))---- | DSL name token for hydra.ast.Symbol-symbolSymbol :: Typed.TypedName Ast.Symbol-symbolSymbol = Typed.TypedName (Core.Name "hydra.ast.Symbol")---- | DSL accessor for the body of hydra.ast.Precedence-unPrecedence :: Typed.TypedTerm Ast.Precedence -> Typed.TypedTerm Int-unPrecedence x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermUnwrap (Core.Name "hydra.ast.Precedence")),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL accessor for the body of hydra.ast.Symbol-unSymbol :: Typed.TypedTerm Ast.Symbol -> Typed.TypedTerm String-unSymbol x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermUnwrap (Core.Name "hydra.ast.Symbol")),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL injection for the break variant of hydra.ast.Ws-wsBreak :: Typed.TypedTerm Ast.Ws-wsBreak =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.ast.Ws"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "break"),- Core.fieldTerm = Core.TermUnit}}))---- | DSL injection for the breakAndIndent variant of hydra.ast.Ws-wsBreakAndIndent :: Typed.TypedTerm String -> Typed.TypedTerm Ast.Ws-wsBreakAndIndent x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.ast.Ws"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "breakAndIndent"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the doubleBreak variant of hydra.ast.Ws-wsDoubleBreak :: Typed.TypedTerm Ast.Ws-wsDoubleBreak =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.ast.Ws"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "doubleBreak"),- Core.fieldTerm = Core.TermUnit}}))---- | DSL injection for the none variant of hydra.ast.Ws-wsNone :: Typed.TypedTerm Ast.Ws-wsNone =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.ast.Ws"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "none"),- Core.fieldTerm = Core.TermUnit}}))---- | DSL injection for the space variant of hydra.ast.Ws-wsSpace :: Typed.TypedTerm Ast.Ws-wsSpace =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.ast.Ws"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "space"),- Core.fieldTerm = Core.TermUnit}}))---- | DSL name token for hydra.ast.Ws-wsWs :: Typed.TypedName Ast.Ws-wsWs = Typed.TypedName (Core.Name "hydra.ast.Ws")
@@ -1,512 +0,0 @@--- Note: this is an automatically generated file. Do not edit.---- | DSL functions for hydra.checking--module Hydra.Dsl.Checking where--import qualified Hydra.Ast as Ast-import qualified Hydra.Checking as Checking-import qualified Hydra.Coders as Coders-import qualified Hydra.Constants as Constants-import qualified Hydra.Core as Core-import qualified Hydra.Dependencies as Dependencies-import qualified Hydra.Docs as Docs-import qualified Hydra.Dsl.Ast as DslAst-import qualified Hydra.Dsl.Coders as DslCoders-import qualified Hydra.Dsl.Constants as DslConstants-import qualified Hydra.Dsl.Core as DslCore-import qualified Hydra.Dsl.Dependencies as DslDependencies-import qualified Hydra.Dsl.Docs as DslDocs-import qualified Hydra.Dsl.Error.Checking as DslErrorChecking-import qualified Hydra.Dsl.Error.Core as DslErrorCore-import qualified Hydra.Dsl.Error.File as DslErrorFile-import qualified Hydra.Dsl.Error.Packaging as DslErrorPackaging-import qualified Hydra.Dsl.Error.System as DslErrorSystem-import qualified Hydra.Dsl.Errors as DslErrors-import qualified Hydra.Dsl.File as DslFile-import qualified Hydra.Dsl.Formatting as DslFormatting-import qualified Hydra.Dsl.Graph as DslGraph-import qualified Hydra.Dsl.Json.Model as JsonModel-import qualified Hydra.Dsl.Lexical as DslLexical-import qualified Hydra.Dsl.Names as DslNames-import qualified Hydra.Dsl.Packaging as DslPackaging-import qualified Hydra.Dsl.Parsing as DslParsing-import qualified Hydra.Dsl.Paths as DslPaths-import qualified Hydra.Dsl.Query as DslQuery-import qualified Hydra.Dsl.Regex as DslRegex-import qualified Hydra.Dsl.Relational as DslRelational-import qualified Hydra.Dsl.Resolution as DslResolution-import qualified Hydra.Dsl.Rewriting as DslRewriting-import qualified Hydra.Dsl.Scoping as DslScoping-import qualified Hydra.Dsl.Strip as DslStrip-import qualified Hydra.Dsl.System as DslSystem-import qualified Hydra.Dsl.Tabular as DslTabular-import qualified Hydra.Dsl.Testing as DslTesting-import qualified Hydra.Dsl.Time as DslTime-import qualified Hydra.Dsl.Topology as DslTopology-import qualified Hydra.Dsl.Typing as DslTyping-import qualified Hydra.Dsl.Util as DslUtil-import qualified Hydra.Dsl.Validation as DslValidation-import qualified Hydra.Dsl.Variables as DslVariables-import qualified Hydra.Dsl.Variants as DslVariants-import qualified Hydra.Error.Checking as ErrorChecking-import qualified Hydra.Error.Core as ErrorCore-import qualified Hydra.Error.File as ErrorFile-import qualified Hydra.Error.Packaging as ErrorPackaging-import qualified Hydra.Error.System as ErrorSystem-import qualified Hydra.Errors as Errors-import qualified Hydra.Extract.Core as ExtractCore-import qualified Hydra.File as File-import qualified Hydra.Formatting as Formatting-import qualified Hydra.Graph as Graph-import qualified Hydra.Json.Model as Model-import qualified Hydra.Lexical as Lexical-import qualified Hydra.Names as Names-import qualified Hydra.Packaging as Packaging-import qualified Hydra.Parsing as Parsing-import qualified Hydra.Paths as Paths-import qualified Hydra.Print.Core as PrintCore-import qualified Hydra.Print.Errors as PrintErrors-import qualified Hydra.Print.Variants as PrintVariants-import qualified Hydra.Query as Query-import qualified Hydra.Reflect as Reflect-import qualified Hydra.Regex as Regex-import qualified Hydra.Relational as Relational-import qualified Hydra.Resolution as Resolution-import qualified Hydra.Rewriting as Rewriting-import qualified Hydra.Scoping as Scoping-import qualified Hydra.Strip as Strip-import qualified Hydra.Substitution as Substitution-import qualified Hydra.System as System-import qualified Hydra.Tabular as Tabular-import qualified Hydra.Testing as Testing-import qualified Hydra.Time as Time-import qualified Hydra.Topology as Topology-import qualified Hydra.Typed as Typed-import qualified Hydra.Typing as Typing-import qualified Hydra.Util as Util-import qualified Hydra.Validation as Validation-import qualified Hydra.Variables as Variables-import qualified Hydra.Variants as Variants-import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)-import qualified Data.Scientific as Sci-import Data.Void-import qualified Data.Map as M-import qualified Data.Set as S---- | DSL reference to hydra.checking.allEqual-allEqual :: Typed.TypedTerm [t0] -> Typed.TypedTerm Bool-allEqual arg0 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.checking.allEqual")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))---- | DSL reference to hydra.checking.applyTypeArgumentsToType-applyTypeArgumentsToType :: Typed.TypedTerm Typing.InferenceContext -> Typed.TypedTerm Graph.Graph -> Typed.TypedTerm [Core.Type] -> Typed.TypedTerm Core.Type -> Typed.TypedTerm (Either Errors.Error Core.Type)-applyTypeArgumentsToType arg0 arg1 arg2 arg3 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.checking.applyTypeArgumentsToType")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)})),- Core.applicationArgument = (Typed.unTypedTerm arg2)})),- Core.applicationArgument = (Typed.unTypedTerm arg3)}))---- | DSL reference to hydra.checking.checkForUnboundTypeVariables-checkForUnboundTypeVariables :: Typed.TypedTerm t0 -> Typed.TypedTerm Graph.Graph -> Typed.TypedTerm Core.Term -> Typed.TypedTerm (Either Errors.Error ())-checkForUnboundTypeVariables arg0 arg1 arg2 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.checking.checkForUnboundTypeVariables")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)})),- Core.applicationArgument = (Typed.unTypedTerm arg2)}))---- | DSL reference to hydra.checking.checkSameType-checkSameType :: Typed.TypedTerm t0 -> Typed.TypedTerm Graph.Graph -> Typed.TypedTerm String -> Typed.TypedTerm [Core.Type] -> Typed.TypedTerm (Either Errors.Error Core.Type)-checkSameType arg0 arg1 arg2 arg3 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.checking.checkSameType")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)})),- Core.applicationArgument = (Typed.unTypedTerm arg2)})),- Core.applicationArgument = (Typed.unTypedTerm arg3)}))---- | DSL reference to hydra.checking.checkTypeSubst-checkTypeSubst :: Typed.TypedTerm t0 -> Typed.TypedTerm Graph.Graph -> Typed.TypedTerm Typing.TypeSubst -> Typed.TypedTerm (Either Errors.Error Typing.TypeSubst)-checkTypeSubst arg0 arg1 arg2 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.checking.checkTypeSubst")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)})),- Core.applicationArgument = (Typed.unTypedTerm arg2)}))---- | DSL reference to hydra.checking.containsInScopeTypeVars-containsInScopeTypeVars :: Typed.TypedTerm Graph.Graph -> Typed.TypedTerm Core.Type -> Typed.TypedTerm Bool-containsInScopeTypeVars arg0 arg1 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.checking.containsInScopeTypeVars")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))---- | DSL reference to hydra.checking.normalizeTypeFreeVars-normalizeTypeFreeVars :: Typed.TypedTerm Core.Type -> Typed.TypedTerm Core.Type-normalizeTypeFreeVars arg0 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.checking.normalizeTypeFreeVars")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))---- | DSL reference to hydra.checking.toFContext-toFContext :: Typed.TypedTerm Graph.Graph -> Typed.TypedTerm (M.Map Core.Name Core.Type)-toFContext arg0 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.checking.toFContext")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))---- | DSL reference to hydra.checking.typeListsEffectivelyEqual-typeListsEffectivelyEqual :: Typed.TypedTerm Graph.Graph -> Typed.TypedTerm [Core.Type] -> Typed.TypedTerm [Core.Type] -> Typed.TypedTerm Bool-typeListsEffectivelyEqual arg0 arg1 arg2 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.checking.typeListsEffectivelyEqual")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)})),- Core.applicationArgument = (Typed.unTypedTerm arg2)}))---- | DSL reference to hydra.checking.typeOf-typeOf :: Typed.TypedTerm Typing.InferenceContext -> Typed.TypedTerm Graph.Graph -> Typed.TypedTerm [Core.Type] -> Typed.TypedTerm Core.Term -> Typed.TypedTerm (Either Errors.Error (Core.Type, Typing.InferenceContext))-typeOf arg0 arg1 arg2 arg3 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.checking.typeOf")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)})),- Core.applicationArgument = (Typed.unTypedTerm arg2)})),- Core.applicationArgument = (Typed.unTypedTerm arg3)}))---- | DSL reference to hydra.checking.typeOfAnnotatedTerm-typeOfAnnotatedTerm :: Typed.TypedTerm Typing.InferenceContext -> Typed.TypedTerm Graph.Graph -> Typed.TypedTerm [Core.Type] -> Typed.TypedTerm Core.AnnotatedTerm -> Typed.TypedTerm (Either Errors.Error (Core.Type, Typing.InferenceContext))-typeOfAnnotatedTerm arg0 arg1 arg2 arg3 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.checking.typeOfAnnotatedTerm")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)})),- Core.applicationArgument = (Typed.unTypedTerm arg2)})),- Core.applicationArgument = (Typed.unTypedTerm arg3)}))---- | DSL reference to hydra.checking.typeOfApplication-typeOfApplication :: Typed.TypedTerm Typing.InferenceContext -> Typed.TypedTerm Graph.Graph -> Typed.TypedTerm [Core.Type] -> Typed.TypedTerm Core.Application -> Typed.TypedTerm (Either Errors.Error (Core.Type, Typing.InferenceContext))-typeOfApplication arg0 arg1 arg2 arg3 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.checking.typeOfApplication")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)})),- Core.applicationArgument = (Typed.unTypedTerm arg2)})),- Core.applicationArgument = (Typed.unTypedTerm arg3)}))---- | DSL reference to hydra.checking.typeOfCaseStatement-typeOfCaseStatement :: Typed.TypedTerm Typing.InferenceContext -> Typed.TypedTerm Graph.Graph -> Typed.TypedTerm [Core.Type] -> Typed.TypedTerm Core.CaseStatement -> Typed.TypedTerm (Either Errors.Error (Core.Type, Typing.InferenceContext))-typeOfCaseStatement arg0 arg1 arg2 arg3 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.checking.typeOfCaseStatement")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)})),- Core.applicationArgument = (Typed.unTypedTerm arg2)})),- Core.applicationArgument = (Typed.unTypedTerm arg3)}))---- | DSL reference to hydra.checking.typeOfEither-typeOfEither :: Typed.TypedTerm Typing.InferenceContext -> Typed.TypedTerm Graph.Graph -> Typed.TypedTerm [Core.Type] -> Typed.TypedTerm (Either Core.Term Core.Term) -> Typed.TypedTerm (Either Errors.Error (Core.Type, Typing.InferenceContext))-typeOfEither arg0 arg1 arg2 arg3 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.checking.typeOfEither")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)})),- Core.applicationArgument = (Typed.unTypedTerm arg2)})),- Core.applicationArgument = (Typed.unTypedTerm arg3)}))---- | DSL reference to hydra.checking.typeOfInjection-typeOfInjection :: Typed.TypedTerm Typing.InferenceContext -> Typed.TypedTerm Graph.Graph -> Typed.TypedTerm [Core.Type] -> Typed.TypedTerm Core.Injection -> Typed.TypedTerm (Either Errors.Error (Core.Type, Typing.InferenceContext))-typeOfInjection arg0 arg1 arg2 arg3 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.checking.typeOfInjection")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)})),- Core.applicationArgument = (Typed.unTypedTerm arg2)})),- Core.applicationArgument = (Typed.unTypedTerm arg3)}))---- | DSL reference to hydra.checking.typeOfLambda-typeOfLambda :: Typed.TypedTerm Typing.InferenceContext -> Typed.TypedTerm Graph.Graph -> Typed.TypedTerm [Core.Type] -> Typed.TypedTerm Core.Lambda -> Typed.TypedTerm (Either Errors.Error (Core.Type, Typing.InferenceContext))-typeOfLambda arg0 arg1 arg2 arg3 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.checking.typeOfLambda")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)})),- Core.applicationArgument = (Typed.unTypedTerm arg2)})),- Core.applicationArgument = (Typed.unTypedTerm arg3)}))---- | DSL reference to hydra.checking.typeOfLet-typeOfLet :: Typed.TypedTerm Typing.InferenceContext -> Typed.TypedTerm Graph.Graph -> Typed.TypedTerm [Core.Type] -> Typed.TypedTerm Core.Let -> Typed.TypedTerm (Either Errors.Error (Core.Type, Typing.InferenceContext))-typeOfLet arg0 arg1 arg2 arg3 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.checking.typeOfLet")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)})),- Core.applicationArgument = (Typed.unTypedTerm arg2)})),- Core.applicationArgument = (Typed.unTypedTerm arg3)}))---- | DSL reference to hydra.checking.typeOfList-typeOfList :: Typed.TypedTerm Typing.InferenceContext -> Typed.TypedTerm Graph.Graph -> Typed.TypedTerm [Core.Type] -> Typed.TypedTerm [Core.Term] -> Typed.TypedTerm (Either Errors.Error (Core.Type, Typing.InferenceContext))-typeOfList arg0 arg1 arg2 arg3 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.checking.typeOfList")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)})),- Core.applicationArgument = (Typed.unTypedTerm arg2)})),- Core.applicationArgument = (Typed.unTypedTerm arg3)}))---- | DSL reference to hydra.checking.typeOfLiteral-typeOfLiteral :: Typed.TypedTerm Typing.InferenceContext -> Typed.TypedTerm Graph.Graph -> Typed.TypedTerm [Core.Type] -> Typed.TypedTerm Core.Literal -> Typed.TypedTerm (Either Errors.Error (Core.Type, Typing.InferenceContext))-typeOfLiteral arg0 arg1 arg2 arg3 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.checking.typeOfLiteral")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)})),- Core.applicationArgument = (Typed.unTypedTerm arg2)})),- Core.applicationArgument = (Typed.unTypedTerm arg3)}))---- | DSL reference to hydra.checking.typeOfMap-typeOfMap :: Typed.TypedTerm Typing.InferenceContext -> Typed.TypedTerm Graph.Graph -> Typed.TypedTerm [Core.Type] -> Typed.TypedTerm (M.Map Core.Term Core.Term) -> Typed.TypedTerm (Either Errors.Error (Core.Type, Typing.InferenceContext))-typeOfMap arg0 arg1 arg2 arg3 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.checking.typeOfMap")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)})),- Core.applicationArgument = (Typed.unTypedTerm arg2)})),- Core.applicationArgument = (Typed.unTypedTerm arg3)}))---- | DSL reference to hydra.checking.typeOfMaybe-typeOfMaybe :: Typed.TypedTerm Typing.InferenceContext -> Typed.TypedTerm Graph.Graph -> Typed.TypedTerm [Core.Type] -> Typed.TypedTerm (Maybe Core.Term) -> Typed.TypedTerm (Either Errors.Error (Core.Type, Typing.InferenceContext))-typeOfMaybe arg0 arg1 arg2 arg3 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.checking.typeOfMaybe")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)})),- Core.applicationArgument = (Typed.unTypedTerm arg2)})),- Core.applicationArgument = (Typed.unTypedTerm arg3)}))---- | DSL reference to hydra.checking.typeOfPair-typeOfPair :: Typed.TypedTerm Typing.InferenceContext -> Typed.TypedTerm Graph.Graph -> Typed.TypedTerm [Core.Type] -> Typed.TypedTerm (Core.Term, Core.Term) -> Typed.TypedTerm (Either Errors.Error (Core.Type, Typing.InferenceContext))-typeOfPair arg0 arg1 arg2 arg3 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.checking.typeOfPair")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)})),- Core.applicationArgument = (Typed.unTypedTerm arg2)})),- Core.applicationArgument = (Typed.unTypedTerm arg3)}))---- | DSL reference to hydra.checking.typeOfPrimitive-typeOfPrimitive :: Typed.TypedTerm Typing.InferenceContext -> Typed.TypedTerm Graph.Graph -> Typed.TypedTerm [Core.Type] -> Typed.TypedTerm Core.Name -> Typed.TypedTerm (Either Errors.Error (Core.Type, Typing.InferenceContext))-typeOfPrimitive arg0 arg1 arg2 arg3 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.checking.typeOfPrimitive")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)})),- Core.applicationArgument = (Typed.unTypedTerm arg2)})),- Core.applicationArgument = (Typed.unTypedTerm arg3)}))---- | DSL reference to hydra.checking.typeOfProjection-typeOfProjection :: Typed.TypedTerm Typing.InferenceContext -> Typed.TypedTerm Graph.Graph -> Typed.TypedTerm [Core.Type] -> Typed.TypedTerm Core.Projection -> Typed.TypedTerm (Either Errors.Error (Core.Type, Typing.InferenceContext))-typeOfProjection arg0 arg1 arg2 arg3 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.checking.typeOfProjection")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)})),- Core.applicationArgument = (Typed.unTypedTerm arg2)})),- Core.applicationArgument = (Typed.unTypedTerm arg3)}))---- | DSL reference to hydra.checking.typeOfRecord-typeOfRecord :: Typed.TypedTerm Typing.InferenceContext -> Typed.TypedTerm Graph.Graph -> Typed.TypedTerm [Core.Type] -> Typed.TypedTerm Core.Record -> Typed.TypedTerm (Either Errors.Error (Core.Type, Typing.InferenceContext))-typeOfRecord arg0 arg1 arg2 arg3 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.checking.typeOfRecord")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)})),- Core.applicationArgument = (Typed.unTypedTerm arg2)})),- Core.applicationArgument = (Typed.unTypedTerm arg3)}))---- | DSL reference to hydra.checking.typeOfSet-typeOfSet :: Typed.TypedTerm Typing.InferenceContext -> Typed.TypedTerm Graph.Graph -> Typed.TypedTerm [Core.Type] -> Typed.TypedTerm (S.Set Core.Term) -> Typed.TypedTerm (Either Errors.Error (Core.Type, Typing.InferenceContext))-typeOfSet arg0 arg1 arg2 arg3 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.checking.typeOfSet")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)})),- Core.applicationArgument = (Typed.unTypedTerm arg2)})),- Core.applicationArgument = (Typed.unTypedTerm arg3)}))---- | DSL reference to hydra.checking.typeOfTerm-typeOfTerm :: Typed.TypedTerm Typing.InferenceContext -> Typed.TypedTerm Graph.Graph -> Typed.TypedTerm Core.Term -> Typed.TypedTerm (Either Errors.Error Core.Type)-typeOfTerm arg0 arg1 arg2 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.checking.typeOfTerm")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)})),- Core.applicationArgument = (Typed.unTypedTerm arg2)}))---- | DSL reference to hydra.checking.typeOfTypeApplication-typeOfTypeApplication :: Typed.TypedTerm Typing.InferenceContext -> Typed.TypedTerm Graph.Graph -> Typed.TypedTerm [Core.Type] -> Typed.TypedTerm Core.TypeApplicationTerm -> Typed.TypedTerm (Either Errors.Error (Core.Type, Typing.InferenceContext))-typeOfTypeApplication arg0 arg1 arg2 arg3 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.checking.typeOfTypeApplication")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)})),- Core.applicationArgument = (Typed.unTypedTerm arg2)})),- Core.applicationArgument = (Typed.unTypedTerm arg3)}))---- | DSL reference to hydra.checking.typeOfTypeLambda-typeOfTypeLambda :: Typed.TypedTerm Typing.InferenceContext -> Typed.TypedTerm Graph.Graph -> Typed.TypedTerm [Core.Type] -> Typed.TypedTerm Core.TypeLambda -> Typed.TypedTerm (Either Errors.Error (Core.Type, Typing.InferenceContext))-typeOfTypeLambda arg0 arg1 arg2 arg3 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.checking.typeOfTypeLambda")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)})),- Core.applicationArgument = (Typed.unTypedTerm arg2)})),- Core.applicationArgument = (Typed.unTypedTerm arg3)}))---- | DSL reference to hydra.checking.typeOfUnit-typeOfUnit :: Typed.TypedTerm Typing.InferenceContext -> Typed.TypedTerm Graph.Graph -> Typed.TypedTerm [Core.Type] -> Typed.TypedTerm (Either Errors.Error (Core.Type, Typing.InferenceContext))-typeOfUnit arg0 arg1 arg2 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.checking.typeOfUnit")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)})),- Core.applicationArgument = (Typed.unTypedTerm arg2)}))---- | DSL reference to hydra.checking.typeOfUnwrap-typeOfUnwrap :: Typed.TypedTerm Typing.InferenceContext -> Typed.TypedTerm Graph.Graph -> Typed.TypedTerm [Core.Type] -> Typed.TypedTerm Core.Name -> Typed.TypedTerm (Either Errors.Error (Core.Type, Typing.InferenceContext))-typeOfUnwrap arg0 arg1 arg2 arg3 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.checking.typeOfUnwrap")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)})),- Core.applicationArgument = (Typed.unTypedTerm arg2)})),- Core.applicationArgument = (Typed.unTypedTerm arg3)}))---- | DSL reference to hydra.checking.typeOfVariable-typeOfVariable :: Typed.TypedTerm Typing.InferenceContext -> Typed.TypedTerm Graph.Graph -> Typed.TypedTerm [Core.Type] -> Typed.TypedTerm Core.Name -> Typed.TypedTerm (Either Errors.Error (Core.Type, Typing.InferenceContext))-typeOfVariable arg0 arg1 arg2 arg3 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.checking.typeOfVariable")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)})),- Core.applicationArgument = (Typed.unTypedTerm arg2)})),- Core.applicationArgument = (Typed.unTypedTerm arg3)}))---- | DSL reference to hydra.checking.typeOfWrappedTerm-typeOfWrappedTerm :: Typed.TypedTerm Typing.InferenceContext -> Typed.TypedTerm Graph.Graph -> Typed.TypedTerm [Core.Type] -> Typed.TypedTerm Core.WrappedTerm -> Typed.TypedTerm (Either Errors.Error (Core.Type, Typing.InferenceContext))-typeOfWrappedTerm arg0 arg1 arg2 arg3 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.checking.typeOfWrappedTerm")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)})),- Core.applicationArgument = (Typed.unTypedTerm arg2)})),- Core.applicationArgument = (Typed.unTypedTerm arg3)}))---- | DSL reference to hydra.checking.typesAllEffectivelyEqual-typesAllEffectivelyEqual :: Typed.TypedTerm Graph.Graph -> Typed.TypedTerm [Core.Type] -> Typed.TypedTerm Bool-typesAllEffectivelyEqual arg0 arg1 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.checking.typesAllEffectivelyEqual")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))---- | DSL reference to hydra.checking.typesEffectivelyEqual-typesEffectivelyEqual :: Typed.TypedTerm Graph.Graph -> Typed.TypedTerm Core.Type -> Typed.TypedTerm Core.Type -> Typed.TypedTerm Bool-typesEffectivelyEqual arg0 arg1 arg2 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.checking.typesEffectivelyEqual")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)})),- Core.applicationArgument = (Typed.unTypedTerm arg2)}))
@@ -1,2117 +0,0 @@--- Note: this is an automatically generated file. Do not edit.---- | DSL functions for hydra.coders--module Hydra.Dsl.Coders where--import qualified Hydra.Coders as Coders-import qualified Hydra.Core as Core-import qualified Hydra.Decode.Coders as DecodeCoders-import qualified Hydra.Dsl.Core as DslCore-import qualified Hydra.Dsl.Errors as DslErrors-import qualified Hydra.Dsl.File as DslFile-import qualified Hydra.Dsl.Graph as DslGraph-import qualified Hydra.Dsl.Util as DslUtil-import qualified Hydra.Dsl.Variants as DslVariants-import qualified Hydra.Encode.Coders as EncodeCoders-import qualified Hydra.Errors as Errors-import qualified Hydra.File as File-import qualified Hydra.Graph as Graph-import qualified Hydra.Typed as Typed-import qualified Hydra.Util as Util-import qualified Hydra.Variants as Variants-import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)-import qualified Data.Scientific as Sci-import Data.Void-import qualified Data.Map as M-import qualified Data.Set as S---- | DSL constructor for hydra.coders.Adapter-adapter :: Typed.TypedTerm Bool -> Typed.TypedTerm t1 -> Typed.TypedTerm t2 -> Typed.TypedTerm (Coders.Coder v1 v2 e) -> Typed.TypedTerm (Coders.Adapter t1 t2 v1 v2 e)-adapter isLossy source target coder =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.coders.Adapter"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "isLossy"),- Core.fieldTerm = (Typed.unTypedTerm isLossy)},- Core.Field {- Core.fieldName = (Core.Name "source"),- Core.fieldTerm = (Typed.unTypedTerm source)},- Core.Field {- Core.fieldName = (Core.Name "target"),- Core.fieldTerm = (Typed.unTypedTerm target)},- Core.Field {- Core.fieldName = (Core.Name "coder"),- Core.fieldTerm = (Typed.unTypedTerm coder)}]}))---- | DSL name token for hydra.coders.Adapter-adapterAdapter :: Typed.TypedName (Coders.Adapter t1 t2 v1 v2 e)-adapterAdapter = Typed.TypedName (Core.Name "hydra.coders.Adapter")---- | DSL accessor for the coder field of hydra.coders.Adapter-adapterCoder :: Typed.TypedTerm (Coders.Adapter t1 t2 v1 v2 e) -> Typed.TypedTerm (Coders.Coder v1 v2 e)-adapterCoder x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.Adapter"),- Core.projectionFieldName = (Core.Name "coder")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL constructor for hydra.coders.AdapterContext-adapterContext :: Typed.TypedTerm Graph.Graph -> Typed.TypedTerm Coders.Language -> Typed.TypedTerm (M.Map Core.Name (Coders.Adapter Core.Type Core.Type Core.Term Core.Term Errors.Error)) -> Typed.TypedTerm Coders.AdapterContext-adapterContext graph language adapters =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.coders.AdapterContext"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "graph"),- Core.fieldTerm = (Typed.unTypedTerm graph)},- Core.Field {- Core.fieldName = (Core.Name "language"),- Core.fieldTerm = (Typed.unTypedTerm language)},- Core.Field {- Core.fieldName = (Core.Name "adapters"),- Core.fieldTerm = (Typed.unTypedTerm adapters)}]}))---- | DSL name token for hydra.coders.AdapterContext-adapterContextAdapterContext :: Typed.TypedName Coders.AdapterContext-adapterContextAdapterContext = Typed.TypedName (Core.Name "hydra.coders.AdapterContext")---- | DSL accessor for the adapters field of hydra.coders.AdapterContext-adapterContextAdapters :: Typed.TypedTerm Coders.AdapterContext -> Typed.TypedTerm (M.Map Core.Name (Coders.Adapter Core.Type Core.Type Core.Term Core.Term Errors.Error))-adapterContextAdapters x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.AdapterContext"),- Core.projectionFieldName = (Core.Name "adapters")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL accessor for the graph field of hydra.coders.AdapterContext-adapterContextGraph :: Typed.TypedTerm Coders.AdapterContext -> Typed.TypedTerm Graph.Graph-adapterContextGraph x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.AdapterContext"),- Core.projectionFieldName = (Core.Name "graph")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL accessor for the language field of hydra.coders.AdapterContext-adapterContextLanguage :: Typed.TypedTerm Coders.AdapterContext -> Typed.TypedTerm Coders.Language-adapterContextLanguage x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.AdapterContext"),- Core.projectionFieldName = (Core.Name "language")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL updater for the adapters field of hydra.coders.AdapterContext-adapterContextWithAdapters :: Typed.TypedTerm Coders.AdapterContext -> Typed.TypedTerm (M.Map Core.Name (Coders.Adapter Core.Type Core.Type Core.Term Core.Term Errors.Error)) -> Typed.TypedTerm Coders.AdapterContext-adapterContextWithAdapters original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.coders.AdapterContext"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "graph"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.AdapterContext"),- Core.projectionFieldName = (Core.Name "graph")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "language"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.AdapterContext"),- Core.projectionFieldName = (Core.Name "language")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "adapters"),- Core.fieldTerm = (Typed.unTypedTerm newVal)}]}))---- | DSL updater for the graph field of hydra.coders.AdapterContext-adapterContextWithGraph :: Typed.TypedTerm Coders.AdapterContext -> Typed.TypedTerm Graph.Graph -> Typed.TypedTerm Coders.AdapterContext-adapterContextWithGraph original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.coders.AdapterContext"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "graph"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "language"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.AdapterContext"),- Core.projectionFieldName = (Core.Name "language")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "adapters"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.AdapterContext"),- Core.projectionFieldName = (Core.Name "adapters")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL updater for the language field of hydra.coders.AdapterContext-adapterContextWithLanguage :: Typed.TypedTerm Coders.AdapterContext -> Typed.TypedTerm Coders.Language -> Typed.TypedTerm Coders.AdapterContext-adapterContextWithLanguage original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.coders.AdapterContext"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "graph"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.AdapterContext"),- Core.projectionFieldName = (Core.Name "graph")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "language"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "adapters"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.AdapterContext"),- Core.projectionFieldName = (Core.Name "adapters")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL accessor for the isLossy field of hydra.coders.Adapter-adapterIsLossy :: Typed.TypedTerm (Coders.Adapter t1 t2 v1 v2 e) -> Typed.TypedTerm Bool-adapterIsLossy x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.Adapter"),- Core.projectionFieldName = (Core.Name "isLossy")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL accessor for the source field of hydra.coders.Adapter-adapterSource :: Typed.TypedTerm (Coders.Adapter t1 t2 v1 v2 e) -> Typed.TypedTerm t1-adapterSource x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.Adapter"),- Core.projectionFieldName = (Core.Name "source")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL accessor for the target field of hydra.coders.Adapter-adapterTarget :: Typed.TypedTerm (Coders.Adapter t1 t2 v1 v2 e) -> Typed.TypedTerm t2-adapterTarget x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.Adapter"),- Core.projectionFieldName = (Core.Name "target")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL updater for the coder field of hydra.coders.Adapter-adapterWithCoder :: Typed.TypedTerm (Coders.Adapter t1 t2 v1 v2 e) -> Typed.TypedTerm (Coders.Coder v1 v2 e) -> Typed.TypedTerm (Coders.Adapter t1 t2 v1 v2 e)-adapterWithCoder original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.coders.Adapter"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "isLossy"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.Adapter"),- Core.projectionFieldName = (Core.Name "isLossy")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "source"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.Adapter"),- Core.projectionFieldName = (Core.Name "source")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "target"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.Adapter"),- Core.projectionFieldName = (Core.Name "target")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "coder"),- Core.fieldTerm = (Typed.unTypedTerm newVal)}]}))---- | DSL updater for the isLossy field of hydra.coders.Adapter-adapterWithIsLossy :: Typed.TypedTerm (Coders.Adapter t1 t2 v1 v2 e) -> Typed.TypedTerm Bool -> Typed.TypedTerm (Coders.Adapter t1 t2 v1 v2 e)-adapterWithIsLossy original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.coders.Adapter"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "isLossy"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "source"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.Adapter"),- Core.projectionFieldName = (Core.Name "source")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "target"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.Adapter"),- Core.projectionFieldName = (Core.Name "target")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "coder"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.Adapter"),- Core.projectionFieldName = (Core.Name "coder")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL updater for the source field of hydra.coders.Adapter-adapterWithSource :: Typed.TypedTerm (Coders.Adapter t1 t2 v1 v2 e) -> Typed.TypedTerm t1 -> Typed.TypedTerm (Coders.Adapter t1 t2 v1 v2 e)-adapterWithSource original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.coders.Adapter"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "isLossy"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.Adapter"),- Core.projectionFieldName = (Core.Name "isLossy")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "source"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "target"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.Adapter"),- Core.projectionFieldName = (Core.Name "target")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "coder"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.Adapter"),- Core.projectionFieldName = (Core.Name "coder")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL updater for the target field of hydra.coders.Adapter-adapterWithTarget :: Typed.TypedTerm (Coders.Adapter t1 t2 v1 v2 e) -> Typed.TypedTerm t2 -> Typed.TypedTerm (Coders.Adapter t1 t2 v1 v2 e)-adapterWithTarget original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.coders.Adapter"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "isLossy"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.Adapter"),- Core.projectionFieldName = (Core.Name "isLossy")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "source"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.Adapter"),- Core.projectionFieldName = (Core.Name "source")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "target"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "coder"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.Adapter"),- Core.projectionFieldName = (Core.Name "coder")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL constructor for hydra.coders.Bicoder-bicoder :: Typed.TypedTerm (t1 -> Coders.Adapter t1 t2 v1 v2 e) -> Typed.TypedTerm (t2 -> Coders.Adapter t2 t1 v2 v1 e) -> Typed.TypedTerm (Coders.Bicoder t1 t2 v1 v2 e)-bicoder encode decode =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.coders.Bicoder"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "encode"),- Core.fieldTerm = (Typed.unTypedTerm encode)},- Core.Field {- Core.fieldName = (Core.Name "decode"),- Core.fieldTerm = (Typed.unTypedTerm decode)}]}))---- | DSL name token for hydra.coders.Bicoder-bicoderBicoder :: Typed.TypedName (Coders.Bicoder t1 t2 v1 v2 e)-bicoderBicoder = Typed.TypedName (Core.Name "hydra.coders.Bicoder")---- | DSL accessor for the decode field of hydra.coders.Bicoder-bicoderDecode :: Typed.TypedTerm (Coders.Bicoder t1 t2 v1 v2 e) -> Typed.TypedTerm (t2 -> Coders.Adapter t2 t1 v2 v1 e)-bicoderDecode x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.Bicoder"),- Core.projectionFieldName = (Core.Name "decode")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL accessor for the encode field of hydra.coders.Bicoder-bicoderEncode :: Typed.TypedTerm (Coders.Bicoder t1 t2 v1 v2 e) -> Typed.TypedTerm (t1 -> Coders.Adapter t1 t2 v1 v2 e)-bicoderEncode x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.Bicoder"),- Core.projectionFieldName = (Core.Name "encode")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL updater for the decode field of hydra.coders.Bicoder-bicoderWithDecode :: Typed.TypedTerm (Coders.Bicoder t1 t2 v1 v2 e) -> Typed.TypedTerm (t2 -> Coders.Adapter t2 t1 v2 v1 e) -> Typed.TypedTerm (Coders.Bicoder t1 t2 v1 v2 e)-bicoderWithDecode original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.coders.Bicoder"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "encode"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.Bicoder"),- Core.projectionFieldName = (Core.Name "encode")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "decode"),- Core.fieldTerm = (Typed.unTypedTerm newVal)}]}))---- | DSL updater for the encode field of hydra.coders.Bicoder-bicoderWithEncode :: Typed.TypedTerm (Coders.Bicoder t1 t2 v1 v2 e) -> Typed.TypedTerm (t1 -> Coders.Adapter t1 t2 v1 v2 e) -> Typed.TypedTerm (Coders.Bicoder t1 t2 v1 v2 e)-bicoderWithEncode original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.coders.Bicoder"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "encode"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "decode"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.Bicoder"),- Core.projectionFieldName = (Core.Name "decode")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL constructor for hydra.coders.CaseConventions-caseConventions :: Typed.TypedTerm Util.CaseConvention -> Typed.TypedTerm Util.CaseConvention -> Typed.TypedTerm Util.CaseConvention -> Typed.TypedTerm Util.CaseConvention -> Typed.TypedTerm Util.CaseConvention -> Typed.TypedTerm Util.CaseConvention -> Typed.TypedTerm Util.CaseConvention -> Typed.TypedTerm Util.CaseConvention -> Typed.TypedTerm Util.CaseConvention -> Typed.TypedTerm Util.CaseConvention -> Typed.TypedTerm Coders.CaseConventions-caseConventions constant directory enumValue field file module_ term termVariable type_ typeVariable =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.coders.CaseConventions"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "constant"),- Core.fieldTerm = (Typed.unTypedTerm constant)},- Core.Field {- Core.fieldName = (Core.Name "directory"),- Core.fieldTerm = (Typed.unTypedTerm directory)},- Core.Field {- Core.fieldName = (Core.Name "enumValue"),- Core.fieldTerm = (Typed.unTypedTerm enumValue)},- Core.Field {- Core.fieldName = (Core.Name "field"),- Core.fieldTerm = (Typed.unTypedTerm field)},- Core.Field {- Core.fieldName = (Core.Name "file"),- Core.fieldTerm = (Typed.unTypedTerm file)},- Core.Field {- Core.fieldName = (Core.Name "module"),- Core.fieldTerm = (Typed.unTypedTerm module_)},- Core.Field {- Core.fieldName = (Core.Name "term"),- Core.fieldTerm = (Typed.unTypedTerm term)},- Core.Field {- Core.fieldName = (Core.Name "termVariable"),- Core.fieldTerm = (Typed.unTypedTerm termVariable)},- Core.Field {- Core.fieldName = (Core.Name "type"),- Core.fieldTerm = (Typed.unTypedTerm type_)},- Core.Field {- Core.fieldName = (Core.Name "typeVariable"),- Core.fieldTerm = (Typed.unTypedTerm typeVariable)}]}))---- | DSL name token for hydra.coders.CaseConventions-caseConventionsCaseConventions :: Typed.TypedName Coders.CaseConventions-caseConventionsCaseConventions = Typed.TypedName (Core.Name "hydra.coders.CaseConventions")---- | DSL accessor for the constant field of hydra.coders.CaseConventions-caseConventionsConstant :: Typed.TypedTerm Coders.CaseConventions -> Typed.TypedTerm Util.CaseConvention-caseConventionsConstant x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.CaseConventions"),- Core.projectionFieldName = (Core.Name "constant")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL accessor for the directory field of hydra.coders.CaseConventions-caseConventionsDirectory :: Typed.TypedTerm Coders.CaseConventions -> Typed.TypedTerm Util.CaseConvention-caseConventionsDirectory x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.CaseConventions"),- Core.projectionFieldName = (Core.Name "directory")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL accessor for the enumValue field of hydra.coders.CaseConventions-caseConventionsEnumValue :: Typed.TypedTerm Coders.CaseConventions -> Typed.TypedTerm Util.CaseConvention-caseConventionsEnumValue x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.CaseConventions"),- Core.projectionFieldName = (Core.Name "enumValue")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL accessor for the field field of hydra.coders.CaseConventions-caseConventionsField :: Typed.TypedTerm Coders.CaseConventions -> Typed.TypedTerm Util.CaseConvention-caseConventionsField x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.CaseConventions"),- Core.projectionFieldName = (Core.Name "field")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL accessor for the file field of hydra.coders.CaseConventions-caseConventionsFile :: Typed.TypedTerm Coders.CaseConventions -> Typed.TypedTerm Util.CaseConvention-caseConventionsFile x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.CaseConventions"),- Core.projectionFieldName = (Core.Name "file")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL accessor for the module field of hydra.coders.CaseConventions-caseConventionsModule :: Typed.TypedTerm Coders.CaseConventions -> Typed.TypedTerm Util.CaseConvention-caseConventionsModule x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.CaseConventions"),- Core.projectionFieldName = (Core.Name "module")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL accessor for the term field of hydra.coders.CaseConventions-caseConventionsTerm :: Typed.TypedTerm Coders.CaseConventions -> Typed.TypedTerm Util.CaseConvention-caseConventionsTerm x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.CaseConventions"),- Core.projectionFieldName = (Core.Name "term")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL accessor for the termVariable field of hydra.coders.CaseConventions-caseConventionsTermVariable :: Typed.TypedTerm Coders.CaseConventions -> Typed.TypedTerm Util.CaseConvention-caseConventionsTermVariable x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.CaseConventions"),- Core.projectionFieldName = (Core.Name "termVariable")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL accessor for the type field of hydra.coders.CaseConventions-caseConventionsType :: Typed.TypedTerm Coders.CaseConventions -> Typed.TypedTerm Util.CaseConvention-caseConventionsType x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.CaseConventions"),- Core.projectionFieldName = (Core.Name "type")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL accessor for the typeVariable field of hydra.coders.CaseConventions-caseConventionsTypeVariable :: Typed.TypedTerm Coders.CaseConventions -> Typed.TypedTerm Util.CaseConvention-caseConventionsTypeVariable x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.CaseConventions"),- Core.projectionFieldName = (Core.Name "typeVariable")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL updater for the constant field of hydra.coders.CaseConventions-caseConventionsWithConstant :: Typed.TypedTerm Coders.CaseConventions -> Typed.TypedTerm Util.CaseConvention -> Typed.TypedTerm Coders.CaseConventions-caseConventionsWithConstant original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.coders.CaseConventions"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "constant"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "directory"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.CaseConventions"),- Core.projectionFieldName = (Core.Name "directory")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "enumValue"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.CaseConventions"),- Core.projectionFieldName = (Core.Name "enumValue")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "field"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.CaseConventions"),- Core.projectionFieldName = (Core.Name "field")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "file"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.CaseConventions"),- Core.projectionFieldName = (Core.Name "file")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "module"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.CaseConventions"),- Core.projectionFieldName = (Core.Name "module")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "term"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.CaseConventions"),- Core.projectionFieldName = (Core.Name "term")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "termVariable"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.CaseConventions"),- Core.projectionFieldName = (Core.Name "termVariable")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "type"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.CaseConventions"),- Core.projectionFieldName = (Core.Name "type")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "typeVariable"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.CaseConventions"),- Core.projectionFieldName = (Core.Name "typeVariable")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL updater for the directory field of hydra.coders.CaseConventions-caseConventionsWithDirectory :: Typed.TypedTerm Coders.CaseConventions -> Typed.TypedTerm Util.CaseConvention -> Typed.TypedTerm Coders.CaseConventions-caseConventionsWithDirectory original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.coders.CaseConventions"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "constant"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.CaseConventions"),- Core.projectionFieldName = (Core.Name "constant")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "directory"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "enumValue"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.CaseConventions"),- Core.projectionFieldName = (Core.Name "enumValue")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "field"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.CaseConventions"),- Core.projectionFieldName = (Core.Name "field")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "file"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.CaseConventions"),- Core.projectionFieldName = (Core.Name "file")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "module"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.CaseConventions"),- Core.projectionFieldName = (Core.Name "module")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "term"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.CaseConventions"),- Core.projectionFieldName = (Core.Name "term")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "termVariable"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.CaseConventions"),- Core.projectionFieldName = (Core.Name "termVariable")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "type"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.CaseConventions"),- Core.projectionFieldName = (Core.Name "type")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "typeVariable"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.CaseConventions"),- Core.projectionFieldName = (Core.Name "typeVariable")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL updater for the enumValue field of hydra.coders.CaseConventions-caseConventionsWithEnumValue :: Typed.TypedTerm Coders.CaseConventions -> Typed.TypedTerm Util.CaseConvention -> Typed.TypedTerm Coders.CaseConventions-caseConventionsWithEnumValue original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.coders.CaseConventions"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "constant"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.CaseConventions"),- Core.projectionFieldName = (Core.Name "constant")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "directory"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.CaseConventions"),- Core.projectionFieldName = (Core.Name "directory")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "enumValue"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "field"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.CaseConventions"),- Core.projectionFieldName = (Core.Name "field")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "file"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.CaseConventions"),- Core.projectionFieldName = (Core.Name "file")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "module"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.CaseConventions"),- Core.projectionFieldName = (Core.Name "module")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "term"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.CaseConventions"),- Core.projectionFieldName = (Core.Name "term")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "termVariable"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.CaseConventions"),- Core.projectionFieldName = (Core.Name "termVariable")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "type"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.CaseConventions"),- Core.projectionFieldName = (Core.Name "type")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "typeVariable"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.CaseConventions"),- Core.projectionFieldName = (Core.Name "typeVariable")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL updater for the field field of hydra.coders.CaseConventions-caseConventionsWithField :: Typed.TypedTerm Coders.CaseConventions -> Typed.TypedTerm Util.CaseConvention -> Typed.TypedTerm Coders.CaseConventions-caseConventionsWithField original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.coders.CaseConventions"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "constant"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.CaseConventions"),- Core.projectionFieldName = (Core.Name "constant")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "directory"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.CaseConventions"),- Core.projectionFieldName = (Core.Name "directory")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "enumValue"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.CaseConventions"),- Core.projectionFieldName = (Core.Name "enumValue")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "field"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "file"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.CaseConventions"),- Core.projectionFieldName = (Core.Name "file")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "module"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.CaseConventions"),- Core.projectionFieldName = (Core.Name "module")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "term"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.CaseConventions"),- Core.projectionFieldName = (Core.Name "term")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "termVariable"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.CaseConventions"),- Core.projectionFieldName = (Core.Name "termVariable")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "type"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.CaseConventions"),- Core.projectionFieldName = (Core.Name "type")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "typeVariable"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.CaseConventions"),- Core.projectionFieldName = (Core.Name "typeVariable")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL updater for the file field of hydra.coders.CaseConventions-caseConventionsWithFile :: Typed.TypedTerm Coders.CaseConventions -> Typed.TypedTerm Util.CaseConvention -> Typed.TypedTerm Coders.CaseConventions-caseConventionsWithFile original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.coders.CaseConventions"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "constant"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.CaseConventions"),- Core.projectionFieldName = (Core.Name "constant")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "directory"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.CaseConventions"),- Core.projectionFieldName = (Core.Name "directory")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "enumValue"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.CaseConventions"),- Core.projectionFieldName = (Core.Name "enumValue")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "field"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.CaseConventions"),- Core.projectionFieldName = (Core.Name "field")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "file"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "module"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.CaseConventions"),- Core.projectionFieldName = (Core.Name "module")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "term"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.CaseConventions"),- Core.projectionFieldName = (Core.Name "term")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "termVariable"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.CaseConventions"),- Core.projectionFieldName = (Core.Name "termVariable")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "type"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.CaseConventions"),- Core.projectionFieldName = (Core.Name "type")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "typeVariable"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.CaseConventions"),- Core.projectionFieldName = (Core.Name "typeVariable")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL updater for the module field of hydra.coders.CaseConventions-caseConventionsWithModule :: Typed.TypedTerm Coders.CaseConventions -> Typed.TypedTerm Util.CaseConvention -> Typed.TypedTerm Coders.CaseConventions-caseConventionsWithModule original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.coders.CaseConventions"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "constant"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.CaseConventions"),- Core.projectionFieldName = (Core.Name "constant")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "directory"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.CaseConventions"),- Core.projectionFieldName = (Core.Name "directory")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "enumValue"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.CaseConventions"),- Core.projectionFieldName = (Core.Name "enumValue")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "field"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.CaseConventions"),- Core.projectionFieldName = (Core.Name "field")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "file"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.CaseConventions"),- Core.projectionFieldName = (Core.Name "file")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "module"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "term"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.CaseConventions"),- Core.projectionFieldName = (Core.Name "term")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "termVariable"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.CaseConventions"),- Core.projectionFieldName = (Core.Name "termVariable")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "type"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.CaseConventions"),- Core.projectionFieldName = (Core.Name "type")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "typeVariable"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.CaseConventions"),- Core.projectionFieldName = (Core.Name "typeVariable")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL updater for the term field of hydra.coders.CaseConventions-caseConventionsWithTerm :: Typed.TypedTerm Coders.CaseConventions -> Typed.TypedTerm Util.CaseConvention -> Typed.TypedTerm Coders.CaseConventions-caseConventionsWithTerm original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.coders.CaseConventions"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "constant"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.CaseConventions"),- Core.projectionFieldName = (Core.Name "constant")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "directory"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.CaseConventions"),- Core.projectionFieldName = (Core.Name "directory")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "enumValue"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.CaseConventions"),- Core.projectionFieldName = (Core.Name "enumValue")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "field"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.CaseConventions"),- Core.projectionFieldName = (Core.Name "field")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "file"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.CaseConventions"),- Core.projectionFieldName = (Core.Name "file")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "module"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.CaseConventions"),- Core.projectionFieldName = (Core.Name "module")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "term"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "termVariable"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.CaseConventions"),- Core.projectionFieldName = (Core.Name "termVariable")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "type"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.CaseConventions"),- Core.projectionFieldName = (Core.Name "type")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "typeVariable"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.CaseConventions"),- Core.projectionFieldName = (Core.Name "typeVariable")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL updater for the termVariable field of hydra.coders.CaseConventions-caseConventionsWithTermVariable :: Typed.TypedTerm Coders.CaseConventions -> Typed.TypedTerm Util.CaseConvention -> Typed.TypedTerm Coders.CaseConventions-caseConventionsWithTermVariable original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.coders.CaseConventions"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "constant"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.CaseConventions"),- Core.projectionFieldName = (Core.Name "constant")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "directory"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.CaseConventions"),- Core.projectionFieldName = (Core.Name "directory")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "enumValue"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.CaseConventions"),- Core.projectionFieldName = (Core.Name "enumValue")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "field"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.CaseConventions"),- Core.projectionFieldName = (Core.Name "field")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "file"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.CaseConventions"),- Core.projectionFieldName = (Core.Name "file")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "module"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.CaseConventions"),- Core.projectionFieldName = (Core.Name "module")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "term"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.CaseConventions"),- Core.projectionFieldName = (Core.Name "term")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "termVariable"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "type"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.CaseConventions"),- Core.projectionFieldName = (Core.Name "type")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "typeVariable"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.CaseConventions"),- Core.projectionFieldName = (Core.Name "typeVariable")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL updater for the type field of hydra.coders.CaseConventions-caseConventionsWithType :: Typed.TypedTerm Coders.CaseConventions -> Typed.TypedTerm Util.CaseConvention -> Typed.TypedTerm Coders.CaseConventions-caseConventionsWithType original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.coders.CaseConventions"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "constant"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.CaseConventions"),- Core.projectionFieldName = (Core.Name "constant")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "directory"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.CaseConventions"),- Core.projectionFieldName = (Core.Name "directory")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "enumValue"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.CaseConventions"),- Core.projectionFieldName = (Core.Name "enumValue")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "field"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.CaseConventions"),- Core.projectionFieldName = (Core.Name "field")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "file"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.CaseConventions"),- Core.projectionFieldName = (Core.Name "file")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "module"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.CaseConventions"),- Core.projectionFieldName = (Core.Name "module")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "term"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.CaseConventions"),- Core.projectionFieldName = (Core.Name "term")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "termVariable"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.CaseConventions"),- Core.projectionFieldName = (Core.Name "termVariable")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "type"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "typeVariable"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.CaseConventions"),- Core.projectionFieldName = (Core.Name "typeVariable")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL updater for the typeVariable field of hydra.coders.CaseConventions-caseConventionsWithTypeVariable :: Typed.TypedTerm Coders.CaseConventions -> Typed.TypedTerm Util.CaseConvention -> Typed.TypedTerm Coders.CaseConventions-caseConventionsWithTypeVariable original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.coders.CaseConventions"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "constant"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.CaseConventions"),- Core.projectionFieldName = (Core.Name "constant")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "directory"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.CaseConventions"),- Core.projectionFieldName = (Core.Name "directory")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "enumValue"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.CaseConventions"),- Core.projectionFieldName = (Core.Name "enumValue")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "field"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.CaseConventions"),- Core.projectionFieldName = (Core.Name "field")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "file"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.CaseConventions"),- Core.projectionFieldName = (Core.Name "file")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "module"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.CaseConventions"),- Core.projectionFieldName = (Core.Name "module")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "term"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.CaseConventions"),- Core.projectionFieldName = (Core.Name "term")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "termVariable"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.CaseConventions"),- Core.projectionFieldName = (Core.Name "termVariable")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "type"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.CaseConventions"),- Core.projectionFieldName = (Core.Name "type")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "typeVariable"),- Core.fieldTerm = (Typed.unTypedTerm newVal)}]}))---- | DSL constructor for hydra.coders.Coder-coder :: Typed.TypedTerm (v1 -> Either e v2) -> Typed.TypedTerm (v2 -> Either e v1) -> Typed.TypedTerm (Coders.Coder v1 v2 e)-coder encode decode =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.coders.Coder"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "encode"),- Core.fieldTerm = (Typed.unTypedTerm encode)},- Core.Field {- Core.fieldName = (Core.Name "decode"),- Core.fieldTerm = (Typed.unTypedTerm decode)}]}))---- | DSL name token for hydra.coders.Coder-coderCoder :: Typed.TypedName (Coders.Coder v1 v2 e)-coderCoder = Typed.TypedName (Core.Name "hydra.coders.Coder")---- | DSL accessor for the decode field of hydra.coders.Coder-coderDecode :: Typed.TypedTerm (Coders.Coder v1 v2 e) -> Typed.TypedTerm (v2 -> Either e v1)-coderDecode x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.Coder"),- Core.projectionFieldName = (Core.Name "decode")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL name token for hydra.coders.CoderDirection-coderDirectionCoderDirection :: Typed.TypedName Coders.CoderDirection-coderDirectionCoderDirection = Typed.TypedName (Core.Name "hydra.coders.CoderDirection")---- | DSL injection for the decode variant of hydra.coders.CoderDirection-coderDirectionDecode :: Typed.TypedTerm Coders.CoderDirection-coderDirectionDecode =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.coders.CoderDirection"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "decode"),- Core.fieldTerm = Core.TermUnit}}))---- | DSL injection for the encode variant of hydra.coders.CoderDirection-coderDirectionEncode :: Typed.TypedTerm Coders.CoderDirection-coderDirectionEncode =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.coders.CoderDirection"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "encode"),- Core.fieldTerm = Core.TermUnit}}))---- | DSL accessor for the encode field of hydra.coders.Coder-coderEncode :: Typed.TypedTerm (Coders.Coder v1 v2 e) -> Typed.TypedTerm (v1 -> Either e v2)-coderEncode x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.Coder"),- Core.projectionFieldName = (Core.Name "encode")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL updater for the decode field of hydra.coders.Coder-coderWithDecode :: Typed.TypedTerm (Coders.Coder v1 v2 e) -> Typed.TypedTerm (v2 -> Either e v1) -> Typed.TypedTerm (Coders.Coder v1 v2 e)-coderWithDecode original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.coders.Coder"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "encode"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.Coder"),- Core.projectionFieldName = (Core.Name "encode")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "decode"),- Core.fieldTerm = (Typed.unTypedTerm newVal)}]}))---- | DSL updater for the encode field of hydra.coders.Coder-coderWithEncode :: Typed.TypedTerm (Coders.Coder v1 v2 e) -> Typed.TypedTerm (v1 -> Either e v2) -> Typed.TypedTerm (Coders.Coder v1 v2 e)-coderWithEncode original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.coders.Coder"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "encode"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "decode"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.Coder"),- Core.projectionFieldName = (Core.Name "decode")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL composition builder for the decoder of hydra.coders.Adapter-decodeAdapter :: Typed.TypedTerm (Graph.Graph -> Core.Term -> Either Errors.DecodingError t1) -> Typed.TypedTerm (Graph.Graph -> Core.Term -> Either Errors.DecodingError t2) -> Typed.TypedTerm (Graph.Graph -> Core.Term -> Either Errors.DecodingError v1) -> Typed.TypedTerm (Graph.Graph -> Core.Term -> Either Errors.DecodingError v2) -> Typed.TypedTerm (Graph.Graph -> Core.Term -> Either Errors.DecodingError e) -> Typed.TypedTerm (Graph.Graph -> Core.Term -> Either Errors.DecodingError (Coders.Adapter t1 t2 v1 v2 e))-decodeAdapter t1 t2 v1 v2 e =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.decode.coders.adapter")),- Core.applicationArgument = (Typed.unTypedTerm t1)})),- Core.applicationArgument = (Typed.unTypedTerm t2)})),- Core.applicationArgument = (Typed.unTypedTerm v1)})),- Core.applicationArgument = (Typed.unTypedTerm v2)})),- Core.applicationArgument = (Typed.unTypedTerm e)}))---- | DSL composition builder for the decoder of hydra.coders.Bicoder-decodeBicoder :: Typed.TypedTerm (Graph.Graph -> Core.Term -> Either Errors.DecodingError t1) -> Typed.TypedTerm (Graph.Graph -> Core.Term -> Either Errors.DecodingError t2) -> Typed.TypedTerm (Graph.Graph -> Core.Term -> Either Errors.DecodingError v1) -> Typed.TypedTerm (Graph.Graph -> Core.Term -> Either Errors.DecodingError v2) -> Typed.TypedTerm (Graph.Graph -> Core.Term -> Either Errors.DecodingError e) -> Typed.TypedTerm (Graph.Graph -> Core.Term -> Either Errors.DecodingError (Coders.Bicoder t1 t2 v1 v2 e))-decodeBicoder t1 t2 v1 v2 e =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.decode.coders.bicoder")),- Core.applicationArgument = (Typed.unTypedTerm t1)})),- Core.applicationArgument = (Typed.unTypedTerm t2)})),- Core.applicationArgument = (Typed.unTypedTerm v1)})),- Core.applicationArgument = (Typed.unTypedTerm v2)})),- Core.applicationArgument = (Typed.unTypedTerm e)}))---- | DSL composition builder for the decoder of hydra.coders.Coder-decodeCoder :: Typed.TypedTerm (Graph.Graph -> Core.Term -> Either Errors.DecodingError v1) -> Typed.TypedTerm (Graph.Graph -> Core.Term -> Either Errors.DecodingError v2) -> Typed.TypedTerm (Graph.Graph -> Core.Term -> Either Errors.DecodingError e) -> Typed.TypedTerm (Graph.Graph -> Core.Term -> Either Errors.DecodingError (Coders.Coder v1 v2 e))-decodeCoder v1 v2 e =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.decode.coders.coder")),- Core.applicationArgument = (Typed.unTypedTerm v1)})),- Core.applicationArgument = (Typed.unTypedTerm v2)})),- Core.applicationArgument = (Typed.unTypedTerm e)}))---- | DSL composition builder for the encoder of hydra.coders.Adapter-encodeAdapter :: Typed.TypedTerm (t1 -> Core.Term) -> Typed.TypedTerm (t2 -> Core.Term) -> Typed.TypedTerm (v1 -> Core.Term) -> Typed.TypedTerm (v2 -> Core.Term) -> Typed.TypedTerm (e -> Core.Term) -> Typed.TypedTerm (Coders.Adapter t1 t2 v1 v2 e -> Core.Term)-encodeAdapter t1 t2 v1 v2 e =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.encode.coders.adapter")),- Core.applicationArgument = (Typed.unTypedTerm t1)})),- Core.applicationArgument = (Typed.unTypedTerm t2)})),- Core.applicationArgument = (Typed.unTypedTerm v1)})),- Core.applicationArgument = (Typed.unTypedTerm v2)})),- Core.applicationArgument = (Typed.unTypedTerm e)}))---- | DSL composition builder for the encoder of hydra.coders.Bicoder-encodeBicoder :: Typed.TypedTerm (t1 -> Core.Term) -> Typed.TypedTerm (t2 -> Core.Term) -> Typed.TypedTerm (v1 -> Core.Term) -> Typed.TypedTerm (v2 -> Core.Term) -> Typed.TypedTerm (e -> Core.Term) -> Typed.TypedTerm (Coders.Bicoder t1 t2 v1 v2 e -> Core.Term)-encodeBicoder t1 t2 v1 v2 e =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.encode.coders.bicoder")),- Core.applicationArgument = (Typed.unTypedTerm t1)})),- Core.applicationArgument = (Typed.unTypedTerm t2)})),- Core.applicationArgument = (Typed.unTypedTerm v1)})),- Core.applicationArgument = (Typed.unTypedTerm v2)})),- Core.applicationArgument = (Typed.unTypedTerm e)}))---- | DSL composition builder for the encoder of hydra.coders.Coder-encodeCoder :: Typed.TypedTerm (v1 -> Core.Term) -> Typed.TypedTerm (v2 -> Core.Term) -> Typed.TypedTerm (e -> Core.Term) -> Typed.TypedTerm (Coders.Coder v1 v2 e -> Core.Term)-encodeCoder v1 v2 e =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.encode.coders.coder")),- Core.applicationArgument = (Typed.unTypedTerm v1)})),- Core.applicationArgument = (Typed.unTypedTerm v2)})),- Core.applicationArgument = (Typed.unTypedTerm e)}))---- | DSL constructor for hydra.coders.Language-language :: Typed.TypedTerm Coders.LanguageName -> Typed.TypedTerm Coders.LanguageConstraints -> Typed.TypedTerm (S.Set Coders.LanguageFeature) -> Typed.TypedTerm Coders.CaseConventions -> Typed.TypedTerm File.FileExtension -> Typed.TypedTerm Coders.Language-language name constraints supportedFeatures caseConventions defaultFileExtension =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.coders.Language"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "name"),- Core.fieldTerm = (Typed.unTypedTerm name)},- Core.Field {- Core.fieldName = (Core.Name "constraints"),- Core.fieldTerm = (Typed.unTypedTerm constraints)},- Core.Field {- Core.fieldName = (Core.Name "supportedFeatures"),- Core.fieldTerm = (Typed.unTypedTerm supportedFeatures)},- Core.Field {- Core.fieldName = (Core.Name "caseConventions"),- Core.fieldTerm = (Typed.unTypedTerm caseConventions)},- Core.Field {- Core.fieldName = (Core.Name "defaultFileExtension"),- Core.fieldTerm = (Typed.unTypedTerm defaultFileExtension)}]}))---- | DSL accessor for the caseConventions field of hydra.coders.Language-languageCaseConventions :: Typed.TypedTerm Coders.Language -> Typed.TypedTerm Coders.CaseConventions-languageCaseConventions x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.Language"),- Core.projectionFieldName = (Core.Name "caseConventions")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL accessor for the constraints field of hydra.coders.Language-languageConstraints :: Typed.TypedTerm Coders.Language -> Typed.TypedTerm Coders.LanguageConstraints-languageConstraints x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.Language"),- Core.projectionFieldName = (Core.Name "constraints")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL constructor for hydra.coders.LanguageConstraints-languageConstraints2 :: Typed.TypedTerm (S.Set Variants.LiteralVariant) -> Typed.TypedTerm (S.Set Core.FloatType) -> Typed.TypedTerm (S.Set Core.IntegerType) -> Typed.TypedTerm (S.Set Variants.TermVariant) -> Typed.TypedTerm (S.Set Variants.TypeVariant) -> Typed.TypedTerm (Core.Type -> Bool) -> Typed.TypedTerm Coders.LanguageConstraints-languageConstraints2 literalVariants floatTypes integerTypes termVariants typeVariants types =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.coders.LanguageConstraints"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "literalVariants"),- Core.fieldTerm = (Typed.unTypedTerm literalVariants)},- Core.Field {- Core.fieldName = (Core.Name "floatTypes"),- Core.fieldTerm = (Typed.unTypedTerm floatTypes)},- Core.Field {- Core.fieldName = (Core.Name "integerTypes"),- Core.fieldTerm = (Typed.unTypedTerm integerTypes)},- Core.Field {- Core.fieldName = (Core.Name "termVariants"),- Core.fieldTerm = (Typed.unTypedTerm termVariants)},- Core.Field {- Core.fieldName = (Core.Name "typeVariants"),- Core.fieldTerm = (Typed.unTypedTerm typeVariants)},- Core.Field {- Core.fieldName = (Core.Name "types"),- Core.fieldTerm = (Typed.unTypedTerm types)}]}))---- | DSL accessor for the floatTypes field of hydra.coders.LanguageConstraints-languageConstraintsFloatTypes :: Typed.TypedTerm Coders.LanguageConstraints -> Typed.TypedTerm (S.Set Core.FloatType)-languageConstraintsFloatTypes x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.LanguageConstraints"),- Core.projectionFieldName = (Core.Name "floatTypes")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL accessor for the integerTypes field of hydra.coders.LanguageConstraints-languageConstraintsIntegerTypes :: Typed.TypedTerm Coders.LanguageConstraints -> Typed.TypedTerm (S.Set Core.IntegerType)-languageConstraintsIntegerTypes x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.LanguageConstraints"),- Core.projectionFieldName = (Core.Name "integerTypes")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL name token for hydra.coders.LanguageConstraints-languageConstraintsLanguageConstraints :: Typed.TypedName Coders.LanguageConstraints-languageConstraintsLanguageConstraints = Typed.TypedName (Core.Name "hydra.coders.LanguageConstraints")---- | DSL accessor for the literalVariants field of hydra.coders.LanguageConstraints-languageConstraintsLiteralVariants :: Typed.TypedTerm Coders.LanguageConstraints -> Typed.TypedTerm (S.Set Variants.LiteralVariant)-languageConstraintsLiteralVariants x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.LanguageConstraints"),- Core.projectionFieldName = (Core.Name "literalVariants")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL accessor for the termVariants field of hydra.coders.LanguageConstraints-languageConstraintsTermVariants :: Typed.TypedTerm Coders.LanguageConstraints -> Typed.TypedTerm (S.Set Variants.TermVariant)-languageConstraintsTermVariants x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.LanguageConstraints"),- Core.projectionFieldName = (Core.Name "termVariants")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL accessor for the typeVariants field of hydra.coders.LanguageConstraints-languageConstraintsTypeVariants :: Typed.TypedTerm Coders.LanguageConstraints -> Typed.TypedTerm (S.Set Variants.TypeVariant)-languageConstraintsTypeVariants x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.LanguageConstraints"),- Core.projectionFieldName = (Core.Name "typeVariants")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL accessor for the types field of hydra.coders.LanguageConstraints-languageConstraintsTypes :: Typed.TypedTerm Coders.LanguageConstraints -> Typed.TypedTerm (Core.Type -> Bool)-languageConstraintsTypes x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.LanguageConstraints"),- Core.projectionFieldName = (Core.Name "types")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL updater for the floatTypes field of hydra.coders.LanguageConstraints-languageConstraintsWithFloatTypes :: Typed.TypedTerm Coders.LanguageConstraints -> Typed.TypedTerm (S.Set Core.FloatType) -> Typed.TypedTerm Coders.LanguageConstraints-languageConstraintsWithFloatTypes original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.coders.LanguageConstraints"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "literalVariants"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.LanguageConstraints"),- Core.projectionFieldName = (Core.Name "literalVariants")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "floatTypes"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "integerTypes"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.LanguageConstraints"),- Core.projectionFieldName = (Core.Name "integerTypes")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "termVariants"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.LanguageConstraints"),- Core.projectionFieldName = (Core.Name "termVariants")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "typeVariants"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.LanguageConstraints"),- Core.projectionFieldName = (Core.Name "typeVariants")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "types"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.LanguageConstraints"),- Core.projectionFieldName = (Core.Name "types")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL updater for the integerTypes field of hydra.coders.LanguageConstraints-languageConstraintsWithIntegerTypes :: Typed.TypedTerm Coders.LanguageConstraints -> Typed.TypedTerm (S.Set Core.IntegerType) -> Typed.TypedTerm Coders.LanguageConstraints-languageConstraintsWithIntegerTypes original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.coders.LanguageConstraints"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "literalVariants"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.LanguageConstraints"),- Core.projectionFieldName = (Core.Name "literalVariants")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "floatTypes"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.LanguageConstraints"),- Core.projectionFieldName = (Core.Name "floatTypes")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "integerTypes"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "termVariants"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.LanguageConstraints"),- Core.projectionFieldName = (Core.Name "termVariants")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "typeVariants"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.LanguageConstraints"),- Core.projectionFieldName = (Core.Name "typeVariants")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "types"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.LanguageConstraints"),- Core.projectionFieldName = (Core.Name "types")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL updater for the literalVariants field of hydra.coders.LanguageConstraints-languageConstraintsWithLiteralVariants :: Typed.TypedTerm Coders.LanguageConstraints -> Typed.TypedTerm (S.Set Variants.LiteralVariant) -> Typed.TypedTerm Coders.LanguageConstraints-languageConstraintsWithLiteralVariants original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.coders.LanguageConstraints"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "literalVariants"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "floatTypes"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.LanguageConstraints"),- Core.projectionFieldName = (Core.Name "floatTypes")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "integerTypes"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.LanguageConstraints"),- Core.projectionFieldName = (Core.Name "integerTypes")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "termVariants"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.LanguageConstraints"),- Core.projectionFieldName = (Core.Name "termVariants")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "typeVariants"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.LanguageConstraints"),- Core.projectionFieldName = (Core.Name "typeVariants")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "types"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.LanguageConstraints"),- Core.projectionFieldName = (Core.Name "types")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL updater for the termVariants field of hydra.coders.LanguageConstraints-languageConstraintsWithTermVariants :: Typed.TypedTerm Coders.LanguageConstraints -> Typed.TypedTerm (S.Set Variants.TermVariant) -> Typed.TypedTerm Coders.LanguageConstraints-languageConstraintsWithTermVariants original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.coders.LanguageConstraints"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "literalVariants"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.LanguageConstraints"),- Core.projectionFieldName = (Core.Name "literalVariants")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "floatTypes"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.LanguageConstraints"),- Core.projectionFieldName = (Core.Name "floatTypes")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "integerTypes"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.LanguageConstraints"),- Core.projectionFieldName = (Core.Name "integerTypes")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "termVariants"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "typeVariants"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.LanguageConstraints"),- Core.projectionFieldName = (Core.Name "typeVariants")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "types"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.LanguageConstraints"),- Core.projectionFieldName = (Core.Name "types")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL updater for the typeVariants field of hydra.coders.LanguageConstraints-languageConstraintsWithTypeVariants :: Typed.TypedTerm Coders.LanguageConstraints -> Typed.TypedTerm (S.Set Variants.TypeVariant) -> Typed.TypedTerm Coders.LanguageConstraints-languageConstraintsWithTypeVariants original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.coders.LanguageConstraints"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "literalVariants"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.LanguageConstraints"),- Core.projectionFieldName = (Core.Name "literalVariants")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "floatTypes"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.LanguageConstraints"),- Core.projectionFieldName = (Core.Name "floatTypes")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "integerTypes"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.LanguageConstraints"),- Core.projectionFieldName = (Core.Name "integerTypes")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "termVariants"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.LanguageConstraints"),- Core.projectionFieldName = (Core.Name "termVariants")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "typeVariants"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "types"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.LanguageConstraints"),- Core.projectionFieldName = (Core.Name "types")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL updater for the types field of hydra.coders.LanguageConstraints-languageConstraintsWithTypes :: Typed.TypedTerm Coders.LanguageConstraints -> Typed.TypedTerm (Core.Type -> Bool) -> Typed.TypedTerm Coders.LanguageConstraints-languageConstraintsWithTypes original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.coders.LanguageConstraints"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "literalVariants"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.LanguageConstraints"),- Core.projectionFieldName = (Core.Name "literalVariants")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "floatTypes"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.LanguageConstraints"),- Core.projectionFieldName = (Core.Name "floatTypes")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "integerTypes"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.LanguageConstraints"),- Core.projectionFieldName = (Core.Name "integerTypes")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "termVariants"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.LanguageConstraints"),- Core.projectionFieldName = (Core.Name "termVariants")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "typeVariants"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.LanguageConstraints"),- Core.projectionFieldName = (Core.Name "typeVariants")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "types"),- Core.fieldTerm = (Typed.unTypedTerm newVal)}]}))---- | DSL accessor for the defaultFileExtension field of hydra.coders.Language-languageDefaultFileExtension :: Typed.TypedTerm Coders.Language -> Typed.TypedTerm File.FileExtension-languageDefaultFileExtension x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.Language"),- Core.projectionFieldName = (Core.Name "defaultFileExtension")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL name token for hydra.coders.LanguageFeature-languageFeatureLanguageFeature :: Typed.TypedName Coders.LanguageFeature-languageFeatureLanguageFeature = Typed.TypedName (Core.Name "hydra.coders.LanguageFeature")---- | DSL injection for the nestedCaseStatements variant of hydra.coders.LanguageFeature-languageFeatureNestedCaseStatements :: Typed.TypedTerm Coders.LanguageFeature-languageFeatureNestedCaseStatements =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.coders.LanguageFeature"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "nestedCaseStatements"),- Core.fieldTerm = Core.TermUnit}}))---- | DSL injection for the nestedPolymorphicLetBindings variant of hydra.coders.LanguageFeature-languageFeatureNestedPolymorphicLetBindings :: Typed.TypedTerm Coders.LanguageFeature-languageFeatureNestedPolymorphicLetBindings =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.coders.LanguageFeature"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "nestedPolymorphicLetBindings"),- Core.fieldTerm = Core.TermUnit}}))---- | DSL injection for the partialApplication variant of hydra.coders.LanguageFeature-languageFeaturePartialApplication :: Typed.TypedTerm Coders.LanguageFeature-languageFeaturePartialApplication =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.coders.LanguageFeature"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "partialApplication"),- Core.fieldTerm = Core.TermUnit}}))---- | DSL name token for hydra.coders.Language-languageLanguage :: Typed.TypedName Coders.Language-languageLanguage = Typed.TypedName (Core.Name "hydra.coders.Language")---- | DSL accessor for the name field of hydra.coders.Language-languageName :: Typed.TypedTerm Coders.Language -> Typed.TypedTerm Coders.LanguageName-languageName x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.Language"),- Core.projectionFieldName = (Core.Name "name")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL constructor for the hydra.coders.LanguageName wrapper-languageName2 :: Typed.TypedTerm String -> Typed.TypedTerm Coders.LanguageName-languageName2 x =- Typed.TypedTerm (Core.TermWrap (Core.WrappedTerm {- Core.wrappedTermTypeName = (Core.Name "hydra.coders.LanguageName"),- Core.wrappedTermBody = (Typed.unTypedTerm x)}))---- | DSL name token for hydra.coders.LanguageName-languageNameLanguageName :: Typed.TypedName Coders.LanguageName-languageNameLanguageName = Typed.TypedName (Core.Name "hydra.coders.LanguageName")---- | DSL accessor for the supportedFeatures field of hydra.coders.Language-languageSupportedFeatures :: Typed.TypedTerm Coders.Language -> Typed.TypedTerm (S.Set Coders.LanguageFeature)-languageSupportedFeatures x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.Language"),- Core.projectionFieldName = (Core.Name "supportedFeatures")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL updater for the caseConventions field of hydra.coders.Language-languageWithCaseConventions :: Typed.TypedTerm Coders.Language -> Typed.TypedTerm Coders.CaseConventions -> Typed.TypedTerm Coders.Language-languageWithCaseConventions original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.coders.Language"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "name"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.Language"),- Core.projectionFieldName = (Core.Name "name")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "constraints"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.Language"),- Core.projectionFieldName = (Core.Name "constraints")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "supportedFeatures"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.Language"),- Core.projectionFieldName = (Core.Name "supportedFeatures")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "caseConventions"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "defaultFileExtension"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.Language"),- Core.projectionFieldName = (Core.Name "defaultFileExtension")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL updater for the constraints field of hydra.coders.Language-languageWithConstraints :: Typed.TypedTerm Coders.Language -> Typed.TypedTerm Coders.LanguageConstraints -> Typed.TypedTerm Coders.Language-languageWithConstraints original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.coders.Language"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "name"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.Language"),- Core.projectionFieldName = (Core.Name "name")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "constraints"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "supportedFeatures"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.Language"),- Core.projectionFieldName = (Core.Name "supportedFeatures")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "caseConventions"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.Language"),- Core.projectionFieldName = (Core.Name "caseConventions")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "defaultFileExtension"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.Language"),- Core.projectionFieldName = (Core.Name "defaultFileExtension")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL updater for the defaultFileExtension field of hydra.coders.Language-languageWithDefaultFileExtension :: Typed.TypedTerm Coders.Language -> Typed.TypedTerm File.FileExtension -> Typed.TypedTerm Coders.Language-languageWithDefaultFileExtension original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.coders.Language"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "name"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.Language"),- Core.projectionFieldName = (Core.Name "name")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "constraints"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.Language"),- Core.projectionFieldName = (Core.Name "constraints")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "supportedFeatures"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.Language"),- Core.projectionFieldName = (Core.Name "supportedFeatures")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "caseConventions"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.Language"),- Core.projectionFieldName = (Core.Name "caseConventions")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "defaultFileExtension"),- Core.fieldTerm = (Typed.unTypedTerm newVal)}]}))---- | DSL updater for the name field of hydra.coders.Language-languageWithName :: Typed.TypedTerm Coders.Language -> Typed.TypedTerm Coders.LanguageName -> Typed.TypedTerm Coders.Language-languageWithName original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.coders.Language"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "name"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "constraints"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.Language"),- Core.projectionFieldName = (Core.Name "constraints")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "supportedFeatures"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.Language"),- Core.projectionFieldName = (Core.Name "supportedFeatures")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "caseConventions"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.Language"),- Core.projectionFieldName = (Core.Name "caseConventions")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "defaultFileExtension"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.Language"),- Core.projectionFieldName = (Core.Name "defaultFileExtension")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL updater for the supportedFeatures field of hydra.coders.Language-languageWithSupportedFeatures :: Typed.TypedTerm Coders.Language -> Typed.TypedTerm (S.Set Coders.LanguageFeature) -> Typed.TypedTerm Coders.Language-languageWithSupportedFeatures original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.coders.Language"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "name"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.Language"),- Core.projectionFieldName = (Core.Name "name")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "constraints"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.Language"),- Core.projectionFieldName = (Core.Name "constraints")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "supportedFeatures"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "caseConventions"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.Language"),- Core.projectionFieldName = (Core.Name "caseConventions")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "defaultFileExtension"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.coders.Language"),- Core.projectionFieldName = (Core.Name "defaultFileExtension")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL injection for the post variant of hydra.coders.TraversalOrder-traversalOrderPost :: Typed.TypedTerm Coders.TraversalOrder-traversalOrderPost =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.coders.TraversalOrder"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "post"),- Core.fieldTerm = Core.TermUnit}}))---- | DSL injection for the pre variant of hydra.coders.TraversalOrder-traversalOrderPre :: Typed.TypedTerm Coders.TraversalOrder-traversalOrderPre =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.coders.TraversalOrder"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "pre"),- Core.fieldTerm = Core.TermUnit}}))---- | DSL name token for hydra.coders.TraversalOrder-traversalOrderTraversalOrder :: Typed.TypedName Coders.TraversalOrder-traversalOrderTraversalOrder = Typed.TypedName (Core.Name "hydra.coders.TraversalOrder")---- | DSL accessor for the body of hydra.coders.LanguageName-unLanguageName :: Typed.TypedTerm Coders.LanguageName -> Typed.TypedTerm String-unLanguageName x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermUnwrap (Core.Name "hydra.coders.LanguageName")),- Core.applicationArgument = (Typed.unTypedTerm x)}))
@@ -1,147 +0,0 @@--- Note: this is an automatically generated file. Do not edit.---- | DSL functions for hydra.constants--module Hydra.Dsl.Constants where--import qualified Hydra.Ast as Ast-import qualified Hydra.Coders as Coders-import qualified Hydra.Constants as Constants-import qualified Hydra.Core as Core-import qualified Hydra.Docs as Docs-import qualified Hydra.Dsl.Ast as DslAst-import qualified Hydra.Dsl.Coders as DslCoders-import qualified Hydra.Dsl.Core as DslCore-import qualified Hydra.Dsl.Docs as DslDocs-import qualified Hydra.Dsl.Error.Checking as ErrorChecking-import qualified Hydra.Dsl.Error.Core as DslErrorCore-import qualified Hydra.Dsl.Error.File as DslErrorFile-import qualified Hydra.Dsl.Error.Packaging as DslErrorPackaging-import qualified Hydra.Dsl.Error.System as DslErrorSystem-import qualified Hydra.Dsl.Errors as DslErrors-import qualified Hydra.Dsl.File as DslFile-import qualified Hydra.Dsl.Graph as DslGraph-import qualified Hydra.Dsl.Json.Model as JsonModel-import qualified Hydra.Dsl.Packaging as DslPackaging-import qualified Hydra.Dsl.Parsing as DslParsing-import qualified Hydra.Dsl.Paths as DslPaths-import qualified Hydra.Dsl.Query as DslQuery-import qualified Hydra.Dsl.Regex as DslRegex-import qualified Hydra.Dsl.Relational as DslRelational-import qualified Hydra.Dsl.System as DslSystem-import qualified Hydra.Dsl.Tabular as DslTabular-import qualified Hydra.Dsl.Testing as DslTesting-import qualified Hydra.Dsl.Time as DslTime-import qualified Hydra.Dsl.Topology as DslTopology-import qualified Hydra.Dsl.Typing as DslTyping-import qualified Hydra.Dsl.Util as DslUtil-import qualified Hydra.Dsl.Validation as DslValidation-import qualified Hydra.Dsl.Variants as DslVariants-import qualified Hydra.Error.Checking as Checking-import qualified Hydra.Error.Core as ErrorCore-import qualified Hydra.Error.File as ErrorFile-import qualified Hydra.Error.Packaging as ErrorPackaging-import qualified Hydra.Error.System as ErrorSystem-import qualified Hydra.Errors as Errors-import qualified Hydra.File as File-import qualified Hydra.Graph as Graph-import qualified Hydra.Json.Model as Model-import qualified Hydra.Packaging as Packaging-import qualified Hydra.Parsing as Parsing-import qualified Hydra.Paths as Paths-import qualified Hydra.Query as Query-import qualified Hydra.Regex as Regex-import qualified Hydra.Relational as Relational-import qualified Hydra.System as System-import qualified Hydra.Tabular as Tabular-import qualified Hydra.Testing as Testing-import qualified Hydra.Time as Time-import qualified Hydra.Topology as Topology-import qualified Hydra.Typed as Typed-import qualified Hydra.Typing as Typing-import qualified Hydra.Util as Util-import qualified Hydra.Validation as Validation-import qualified Hydra.Variants as Variants-import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)-import qualified Data.Scientific as Sci-import Data.Void---- | DSL reference to hydra.constants.fieldNameValue-fieldNameValue :: Typed.TypedTerm String-fieldNameValue = Typed.TypedTerm (Core.TermVariable (Core.Name "hydra.constants.fieldNameValue"))---- | DSL reference to hydra.constants.ignoredVariable-ignoredVariable :: Typed.TypedTerm String-ignoredVariable = Typed.TypedTerm (Core.TermVariable (Core.Name "hydra.constants.ignoredVariable"))---- | DSL reference to hydra.constants.keyClasses-keyClasses :: Typed.TypedTerm Core.Name-keyClasses = Typed.TypedTerm (Core.TermVariable (Core.Name "hydra.constants.keyClasses"))---- | DSL reference to hydra.constants.keyDebugId-keyDebugId :: Typed.TypedTerm Core.Name-keyDebugId = Typed.TypedTerm (Core.TermVariable (Core.Name "hydra.constants.keyDebugId"))---- | DSL reference to hydra.constants.keyDeprecated-keyDeprecated :: Typed.TypedTerm Core.Name-keyDeprecated = Typed.TypedTerm (Core.TermVariable (Core.Name "hydra.constants.keyDeprecated"))---- | DSL reference to hydra.constants.keyDescription-keyDescription :: Typed.TypedTerm Core.Name-keyDescription = Typed.TypedTerm (Core.TermVariable (Core.Name "hydra.constants.keyDescription"))---- | DSL reference to hydra.constants.keyExclude-keyExclude :: Typed.TypedTerm Core.Name-keyExclude = Typed.TypedTerm (Core.TermVariable (Core.Name "hydra.constants.keyExclude"))---- | DSL reference to hydra.constants.keyFirstClassType-keyFirstClassType :: Typed.TypedTerm Core.Name-keyFirstClassType = Typed.TypedTerm (Core.TermVariable (Core.Name "hydra.constants.keyFirstClassType"))---- | DSL reference to hydra.constants.keyFreshTypeVariableCount-keyFreshTypeVariableCount :: Typed.TypedTerm Core.Name-keyFreshTypeVariableCount = Typed.TypedTerm (Core.TermVariable (Core.Name "hydra.constants.keyFreshTypeVariableCount"))---- | DSL reference to hydra.constants.keyMaxLength-keyMaxLength :: Typed.TypedTerm Core.Name-keyMaxLength = Typed.TypedTerm (Core.TermVariable (Core.Name "hydra.constants.keyMaxLength"))---- | DSL reference to hydra.constants.keyMinLength-keyMinLength :: Typed.TypedTerm Core.Name-keyMinLength = Typed.TypedTerm (Core.TermVariable (Core.Name "hydra.constants.keyMinLength"))---- | DSL reference to hydra.constants.keyPreserveFieldName-keyPreserveFieldName :: Typed.TypedTerm Core.Name-keyPreserveFieldName = Typed.TypedTerm (Core.TermVariable (Core.Name "hydra.constants.keyPreserveFieldName"))---- | DSL reference to hydra.constants.keyType-keyType :: Typed.TypedTerm Core.Name-keyType = Typed.TypedTerm (Core.TermVariable (Core.Name "hydra.constants.keyType"))---- | DSL reference to hydra.constants.maxInt32-maxInt32 :: Typed.TypedTerm Int-maxInt32 = Typed.TypedTerm (Core.TermVariable (Core.Name "hydra.constants.maxInt32"))---- | DSL reference to hydra.constants.maxTraceDepth-maxTraceDepth :: Typed.TypedTerm Int-maxTraceDepth = Typed.TypedTerm (Core.TermVariable (Core.Name "hydra.constants.maxTraceDepth"))---- | DSL reference to hydra.constants.regexCamelCase-regexCamelCase :: Typed.TypedTerm String-regexCamelCase = Typed.TypedTerm (Core.TermVariable (Core.Name "hydra.constants.regexCamelCase"))---- | DSL reference to hydra.constants.regexNamespace-regexNamespace :: Typed.TypedTerm String-regexNamespace = Typed.TypedTerm (Core.TermVariable (Core.Name "hydra.constants.regexNamespace"))---- | DSL reference to hydra.constants.regexPackageName-regexPackageName :: Typed.TypedTerm String-regexPackageName = Typed.TypedTerm (Core.TermVariable (Core.Name "hydra.constants.regexPackageName"))---- | DSL reference to hydra.constants.regexPascalCase-regexPascalCase :: Typed.TypedTerm String-regexPascalCase = Typed.TypedTerm (Core.TermVariable (Core.Name "hydra.constants.regexPascalCase"))---- | DSL reference to hydra.constants.warningAutoGeneratedFile-warningAutoGeneratedFile :: Typed.TypedTerm String-warningAutoGeneratedFile = Typed.TypedTerm (Core.TermVariable (Core.Name "hydra.constants.warningAutoGeneratedFile"))
@@ -1,2557 +0,0 @@--- Note: this is an automatically generated file. Do not edit.---- | DSL functions for hydra.core--module Hydra.Dsl.Core where--import qualified Hydra.Core as Core-import qualified Hydra.Decode.Core as DecodeCore-import qualified Hydra.Encode.Core as EncodeCore-import qualified Hydra.Typed as Typed-import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)-import qualified Data.Scientific as Sci-import Data.Void-import qualified Data.ByteString as B-import qualified Data.Int as I-import qualified Data.Map as M-import qualified Data.Set as S---- | DSL constructor for hydra.core.AnnotatedTerm-annotatedTerm :: Typed.TypedTerm Core.Term -> Typed.TypedTerm Core.Term -> Typed.TypedTerm Core.AnnotatedTerm-annotatedTerm body annotation =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.core.AnnotatedTerm"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "body"),- Core.fieldTerm = (Typed.unTypedTerm body)},- Core.Field {- Core.fieldName = (Core.Name "annotation"),- Core.fieldTerm = (Typed.unTypedTerm annotation)}]}))---- | DSL name token for hydra.core.AnnotatedTerm-annotatedTermAnnotatedTerm :: Typed.TypedName Core.AnnotatedTerm-annotatedTermAnnotatedTerm = Typed.TypedName (Core.Name "hydra.core.AnnotatedTerm")---- | DSL accessor for the annotation field of hydra.core.AnnotatedTerm-annotatedTermAnnotation :: Typed.TypedTerm Core.AnnotatedTerm -> Typed.TypedTerm Core.Term-annotatedTermAnnotation x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.core.AnnotatedTerm"),- Core.projectionFieldName = (Core.Name "annotation")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL accessor for the body field of hydra.core.AnnotatedTerm-annotatedTermBody :: Typed.TypedTerm Core.AnnotatedTerm -> Typed.TypedTerm Core.Term-annotatedTermBody x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.core.AnnotatedTerm"),- Core.projectionFieldName = (Core.Name "body")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL updater for the annotation field of hydra.core.AnnotatedTerm-annotatedTermWithAnnotation :: Typed.TypedTerm Core.AnnotatedTerm -> Typed.TypedTerm Core.Term -> Typed.TypedTerm Core.AnnotatedTerm-annotatedTermWithAnnotation original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.core.AnnotatedTerm"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "body"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.core.AnnotatedTerm"),- Core.projectionFieldName = (Core.Name "body")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "annotation"),- Core.fieldTerm = (Typed.unTypedTerm newVal)}]}))---- | DSL updater for the body field of hydra.core.AnnotatedTerm-annotatedTermWithBody :: Typed.TypedTerm Core.AnnotatedTerm -> Typed.TypedTerm Core.Term -> Typed.TypedTerm Core.AnnotatedTerm-annotatedTermWithBody original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.core.AnnotatedTerm"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "body"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "annotation"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.core.AnnotatedTerm"),- Core.projectionFieldName = (Core.Name "annotation")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL constructor for hydra.core.AnnotatedType-annotatedType :: Typed.TypedTerm Core.Type -> Typed.TypedTerm Core.Term -> Typed.TypedTerm Core.AnnotatedType-annotatedType body annotation =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.core.AnnotatedType"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "body"),- Core.fieldTerm = (Typed.unTypedTerm body)},- Core.Field {- Core.fieldName = (Core.Name "annotation"),- Core.fieldTerm = (Typed.unTypedTerm annotation)}]}))---- | DSL name token for hydra.core.AnnotatedType-annotatedTypeAnnotatedType :: Typed.TypedName Core.AnnotatedType-annotatedTypeAnnotatedType = Typed.TypedName (Core.Name "hydra.core.AnnotatedType")---- | DSL accessor for the annotation field of hydra.core.AnnotatedType-annotatedTypeAnnotation :: Typed.TypedTerm Core.AnnotatedType -> Typed.TypedTerm Core.Term-annotatedTypeAnnotation x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.core.AnnotatedType"),- Core.projectionFieldName = (Core.Name "annotation")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL accessor for the body field of hydra.core.AnnotatedType-annotatedTypeBody :: Typed.TypedTerm Core.AnnotatedType -> Typed.TypedTerm Core.Type-annotatedTypeBody x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.core.AnnotatedType"),- Core.projectionFieldName = (Core.Name "body")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL updater for the annotation field of hydra.core.AnnotatedType-annotatedTypeWithAnnotation :: Typed.TypedTerm Core.AnnotatedType -> Typed.TypedTerm Core.Term -> Typed.TypedTerm Core.AnnotatedType-annotatedTypeWithAnnotation original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.core.AnnotatedType"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "body"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.core.AnnotatedType"),- Core.projectionFieldName = (Core.Name "body")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "annotation"),- Core.fieldTerm = (Typed.unTypedTerm newVal)}]}))---- | DSL updater for the body field of hydra.core.AnnotatedType-annotatedTypeWithBody :: Typed.TypedTerm Core.AnnotatedType -> Typed.TypedTerm Core.Type -> Typed.TypedTerm Core.AnnotatedType-annotatedTypeWithBody original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.core.AnnotatedType"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "body"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "annotation"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.core.AnnotatedType"),- Core.projectionFieldName = (Core.Name "annotation")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL constructor for hydra.core.Application-application :: Typed.TypedTerm Core.Term -> Typed.TypedTerm Core.Term -> Typed.TypedTerm Core.Application-application function argument =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.core.Application"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "function"),- Core.fieldTerm = (Typed.unTypedTerm function)},- Core.Field {- Core.fieldName = (Core.Name "argument"),- Core.fieldTerm = (Typed.unTypedTerm argument)}]}))---- | DSL name token for hydra.core.Application-applicationApplication :: Typed.TypedName Core.Application-applicationApplication = Typed.TypedName (Core.Name "hydra.core.Application")---- | DSL accessor for the argument field of hydra.core.Application-applicationArgument :: Typed.TypedTerm Core.Application -> Typed.TypedTerm Core.Term-applicationArgument x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.core.Application"),- Core.projectionFieldName = (Core.Name "argument")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL accessor for the function field of hydra.core.Application-applicationFunction :: Typed.TypedTerm Core.Application -> Typed.TypedTerm Core.Term-applicationFunction x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.core.Application"),- Core.projectionFieldName = (Core.Name "function")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL constructor for hydra.core.ApplicationType-applicationType :: Typed.TypedTerm Core.Type -> Typed.TypedTerm Core.Type -> Typed.TypedTerm Core.ApplicationType-applicationType function argument =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.core.ApplicationType"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "function"),- Core.fieldTerm = (Typed.unTypedTerm function)},- Core.Field {- Core.fieldName = (Core.Name "argument"),- Core.fieldTerm = (Typed.unTypedTerm argument)}]}))---- | DSL name token for hydra.core.ApplicationType-applicationTypeApplicationType :: Typed.TypedName Core.ApplicationType-applicationTypeApplicationType = Typed.TypedName (Core.Name "hydra.core.ApplicationType")---- | DSL accessor for the argument field of hydra.core.ApplicationType-applicationTypeArgument :: Typed.TypedTerm Core.ApplicationType -> Typed.TypedTerm Core.Type-applicationTypeArgument x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.core.ApplicationType"),- Core.projectionFieldName = (Core.Name "argument")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL accessor for the function field of hydra.core.ApplicationType-applicationTypeFunction :: Typed.TypedTerm Core.ApplicationType -> Typed.TypedTerm Core.Type-applicationTypeFunction x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.core.ApplicationType"),- Core.projectionFieldName = (Core.Name "function")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL updater for the argument field of hydra.core.ApplicationType-applicationTypeWithArgument :: Typed.TypedTerm Core.ApplicationType -> Typed.TypedTerm Core.Type -> Typed.TypedTerm Core.ApplicationType-applicationTypeWithArgument original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.core.ApplicationType"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "function"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.core.ApplicationType"),- Core.projectionFieldName = (Core.Name "function")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "argument"),- Core.fieldTerm = (Typed.unTypedTerm newVal)}]}))---- | DSL updater for the function field of hydra.core.ApplicationType-applicationTypeWithFunction :: Typed.TypedTerm Core.ApplicationType -> Typed.TypedTerm Core.Type -> Typed.TypedTerm Core.ApplicationType-applicationTypeWithFunction original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.core.ApplicationType"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "function"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "argument"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.core.ApplicationType"),- Core.projectionFieldName = (Core.Name "argument")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL updater for the argument field of hydra.core.Application-applicationWithArgument :: Typed.TypedTerm Core.Application -> Typed.TypedTerm Core.Term -> Typed.TypedTerm Core.Application-applicationWithArgument original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.core.Application"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "function"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.core.Application"),- Core.projectionFieldName = (Core.Name "function")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "argument"),- Core.fieldTerm = (Typed.unTypedTerm newVal)}]}))---- | DSL updater for the function field of hydra.core.Application-applicationWithFunction :: Typed.TypedTerm Core.Application -> Typed.TypedTerm Core.Term -> Typed.TypedTerm Core.Application-applicationWithFunction original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.core.Application"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "function"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "argument"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.core.Application"),- Core.projectionFieldName = (Core.Name "argument")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL constructor for hydra.core.Binding-binding :: Typed.TypedTerm Core.Name -> Typed.TypedTerm Core.Term -> Typed.TypedTerm (Maybe Core.TypeScheme) -> Typed.TypedTerm Core.Binding-binding name term typeScheme =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.core.Binding"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "name"),- Core.fieldTerm = (Typed.unTypedTerm name)},- Core.Field {- Core.fieldName = (Core.Name "term"),- Core.fieldTerm = (Typed.unTypedTerm term)},- Core.Field {- Core.fieldName = (Core.Name "typeScheme"),- Core.fieldTerm = (Typed.unTypedTerm typeScheme)}]}))---- | DSL name token for hydra.core.Binding-bindingBinding :: Typed.TypedName Core.Binding-bindingBinding = Typed.TypedName (Core.Name "hydra.core.Binding")---- | DSL accessor for the name field of hydra.core.Binding-bindingName :: Typed.TypedTerm Core.Binding -> Typed.TypedTerm Core.Name-bindingName x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.core.Binding"),- Core.projectionFieldName = (Core.Name "name")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL accessor for the term field of hydra.core.Binding-bindingTerm :: Typed.TypedTerm Core.Binding -> Typed.TypedTerm Core.Term-bindingTerm x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.core.Binding"),- Core.projectionFieldName = (Core.Name "term")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL accessor for the typeScheme field of hydra.core.Binding-bindingTypeScheme :: Typed.TypedTerm Core.Binding -> Typed.TypedTerm (Maybe Core.TypeScheme)-bindingTypeScheme x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.core.Binding"),- Core.projectionFieldName = (Core.Name "typeScheme")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL updater for the name field of hydra.core.Binding-bindingWithName :: Typed.TypedTerm Core.Binding -> Typed.TypedTerm Core.Name -> Typed.TypedTerm Core.Binding-bindingWithName original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.core.Binding"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "name"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "term"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.core.Binding"),- Core.projectionFieldName = (Core.Name "term")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "typeScheme"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.core.Binding"),- Core.projectionFieldName = (Core.Name "typeScheme")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL updater for the term field of hydra.core.Binding-bindingWithTerm :: Typed.TypedTerm Core.Binding -> Typed.TypedTerm Core.Term -> Typed.TypedTerm Core.Binding-bindingWithTerm original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.core.Binding"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "name"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.core.Binding"),- Core.projectionFieldName = (Core.Name "name")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "term"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "typeScheme"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.core.Binding"),- Core.projectionFieldName = (Core.Name "typeScheme")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL updater for the typeScheme field of hydra.core.Binding-bindingWithTypeScheme :: Typed.TypedTerm Core.Binding -> Typed.TypedTerm (Maybe Core.TypeScheme) -> Typed.TypedTerm Core.Binding-bindingWithTypeScheme original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.core.Binding"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "name"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.core.Binding"),- Core.projectionFieldName = (Core.Name "name")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "term"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.core.Binding"),- Core.projectionFieldName = (Core.Name "term")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "typeScheme"),- Core.fieldTerm = (Typed.unTypedTerm newVal)}]}))---- | DSL constructor for hydra.core.CaseAlternative-caseAlternative :: Typed.TypedTerm Core.Name -> Typed.TypedTerm Core.Term -> Typed.TypedTerm Core.CaseAlternative-caseAlternative name handler =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.core.CaseAlternative"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "name"),- Core.fieldTerm = (Typed.unTypedTerm name)},- Core.Field {- Core.fieldName = (Core.Name "handler"),- Core.fieldTerm = (Typed.unTypedTerm handler)}]}))---- | DSL name token for hydra.core.CaseAlternative-caseAlternativeCaseAlternative :: Typed.TypedName Core.CaseAlternative-caseAlternativeCaseAlternative = Typed.TypedName (Core.Name "hydra.core.CaseAlternative")---- | DSL accessor for the handler field of hydra.core.CaseAlternative-caseAlternativeHandler :: Typed.TypedTerm Core.CaseAlternative -> Typed.TypedTerm Core.Term-caseAlternativeHandler x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.core.CaseAlternative"),- Core.projectionFieldName = (Core.Name "handler")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL accessor for the name field of hydra.core.CaseAlternative-caseAlternativeName :: Typed.TypedTerm Core.CaseAlternative -> Typed.TypedTerm Core.Name-caseAlternativeName x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.core.CaseAlternative"),- Core.projectionFieldName = (Core.Name "name")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL updater for the handler field of hydra.core.CaseAlternative-caseAlternativeWithHandler :: Typed.TypedTerm Core.CaseAlternative -> Typed.TypedTerm Core.Term -> Typed.TypedTerm Core.CaseAlternative-caseAlternativeWithHandler original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.core.CaseAlternative"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "name"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.core.CaseAlternative"),- Core.projectionFieldName = (Core.Name "name")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "handler"),- Core.fieldTerm = (Typed.unTypedTerm newVal)}]}))---- | DSL updater for the name field of hydra.core.CaseAlternative-caseAlternativeWithName :: Typed.TypedTerm Core.CaseAlternative -> Typed.TypedTerm Core.Name -> Typed.TypedTerm Core.CaseAlternative-caseAlternativeWithName original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.core.CaseAlternative"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "name"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "handler"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.core.CaseAlternative"),- Core.projectionFieldName = (Core.Name "handler")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL constructor for hydra.core.CaseStatement-caseStatement :: Typed.TypedTerm Core.Name -> Typed.TypedTerm (Maybe Core.Term) -> Typed.TypedTerm [Core.CaseAlternative] -> Typed.TypedTerm Core.CaseStatement-caseStatement typeName default_ cases =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.core.CaseStatement"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "typeName"),- Core.fieldTerm = (Typed.unTypedTerm typeName)},- Core.Field {- Core.fieldName = (Core.Name "default"),- Core.fieldTerm = (Typed.unTypedTerm default_)},- Core.Field {- Core.fieldName = (Core.Name "cases"),- Core.fieldTerm = (Typed.unTypedTerm cases)}]}))---- | DSL name token for hydra.core.CaseStatement-caseStatementCaseStatement :: Typed.TypedName Core.CaseStatement-caseStatementCaseStatement = Typed.TypedName (Core.Name "hydra.core.CaseStatement")---- | DSL accessor for the cases field of hydra.core.CaseStatement-caseStatementCases :: Typed.TypedTerm Core.CaseStatement -> Typed.TypedTerm [Core.CaseAlternative]-caseStatementCases x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.core.CaseStatement"),- Core.projectionFieldName = (Core.Name "cases")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL accessor for the default field of hydra.core.CaseStatement-caseStatementDefault :: Typed.TypedTerm Core.CaseStatement -> Typed.TypedTerm (Maybe Core.Term)-caseStatementDefault x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.core.CaseStatement"),- Core.projectionFieldName = (Core.Name "default")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL accessor for the typeName field of hydra.core.CaseStatement-caseStatementTypeName :: Typed.TypedTerm Core.CaseStatement -> Typed.TypedTerm Core.Name-caseStatementTypeName x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.core.CaseStatement"),- Core.projectionFieldName = (Core.Name "typeName")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL updater for the cases field of hydra.core.CaseStatement-caseStatementWithCases :: Typed.TypedTerm Core.CaseStatement -> Typed.TypedTerm [Core.CaseAlternative] -> Typed.TypedTerm Core.CaseStatement-caseStatementWithCases original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.core.CaseStatement"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "typeName"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.core.CaseStatement"),- Core.projectionFieldName = (Core.Name "typeName")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "default"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.core.CaseStatement"),- Core.projectionFieldName = (Core.Name "default")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "cases"),- Core.fieldTerm = (Typed.unTypedTerm newVal)}]}))---- | DSL updater for the default field of hydra.core.CaseStatement-caseStatementWithDefault :: Typed.TypedTerm Core.CaseStatement -> Typed.TypedTerm (Maybe Core.Term) -> Typed.TypedTerm Core.CaseStatement-caseStatementWithDefault original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.core.CaseStatement"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "typeName"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.core.CaseStatement"),- Core.projectionFieldName = (Core.Name "typeName")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "default"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "cases"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.core.CaseStatement"),- Core.projectionFieldName = (Core.Name "cases")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL updater for the typeName field of hydra.core.CaseStatement-caseStatementWithTypeName :: Typed.TypedTerm Core.CaseStatement -> Typed.TypedTerm Core.Name -> Typed.TypedTerm Core.CaseStatement-caseStatementWithTypeName original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.core.CaseStatement"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "typeName"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "default"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.core.CaseStatement"),- Core.projectionFieldName = (Core.Name "default")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "cases"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.core.CaseStatement"),- Core.projectionFieldName = (Core.Name "cases")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL constructor for hydra.core.EitherType-eitherType :: Typed.TypedTerm Core.Type -> Typed.TypedTerm Core.Type -> Typed.TypedTerm Core.EitherType-eitherType left right =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.core.EitherType"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "left"),- Core.fieldTerm = (Typed.unTypedTerm left)},- Core.Field {- Core.fieldName = (Core.Name "right"),- Core.fieldTerm = (Typed.unTypedTerm right)}]}))---- | DSL name token for hydra.core.EitherType-eitherTypeEitherType :: Typed.TypedName Core.EitherType-eitherTypeEitherType = Typed.TypedName (Core.Name "hydra.core.EitherType")---- | DSL accessor for the left field of hydra.core.EitherType-eitherTypeLeft :: Typed.TypedTerm Core.EitherType -> Typed.TypedTerm Core.Type-eitherTypeLeft x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.core.EitherType"),- Core.projectionFieldName = (Core.Name "left")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL accessor for the right field of hydra.core.EitherType-eitherTypeRight :: Typed.TypedTerm Core.EitherType -> Typed.TypedTerm Core.Type-eitherTypeRight x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.core.EitherType"),- Core.projectionFieldName = (Core.Name "right")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL updater for the left field of hydra.core.EitherType-eitherTypeWithLeft :: Typed.TypedTerm Core.EitherType -> Typed.TypedTerm Core.Type -> Typed.TypedTerm Core.EitherType-eitherTypeWithLeft original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.core.EitherType"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "left"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "right"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.core.EitherType"),- Core.projectionFieldName = (Core.Name "right")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL updater for the right field of hydra.core.EitherType-eitherTypeWithRight :: Typed.TypedTerm Core.EitherType -> Typed.TypedTerm Core.Type -> Typed.TypedTerm Core.EitherType-eitherTypeWithRight original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.core.EitherType"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "left"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.core.EitherType"),- Core.projectionFieldName = (Core.Name "left")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "right"),- Core.fieldTerm = (Typed.unTypedTerm newVal)}]}))---- | DSL constructor for hydra.core.Field-field :: Typed.TypedTerm Core.Name -> Typed.TypedTerm Core.Term -> Typed.TypedTerm Core.Field-field name term =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.core.Field"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "name"),- Core.fieldTerm = (Typed.unTypedTerm name)},- Core.Field {- Core.fieldName = (Core.Name "term"),- Core.fieldTerm = (Typed.unTypedTerm term)}]}))---- | DSL name token for hydra.core.Field-fieldField :: Typed.TypedName Core.Field-fieldField = Typed.TypedName (Core.Name "hydra.core.Field")---- | DSL accessor for the name field of hydra.core.Field-fieldName :: Typed.TypedTerm Core.Field -> Typed.TypedTerm Core.Name-fieldName x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.core.Field"),- Core.projectionFieldName = (Core.Name "name")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL accessor for the term field of hydra.core.Field-fieldTerm :: Typed.TypedTerm Core.Field -> Typed.TypedTerm Core.Term-fieldTerm x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.core.Field"),- Core.projectionFieldName = (Core.Name "term")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL constructor for hydra.core.FieldType-fieldType :: Typed.TypedTerm Core.Name -> Typed.TypedTerm Core.Type -> Typed.TypedTerm Core.FieldType-fieldType name type_ =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.core.FieldType"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "name"),- Core.fieldTerm = (Typed.unTypedTerm name)},- Core.Field {- Core.fieldName = (Core.Name "type"),- Core.fieldTerm = (Typed.unTypedTerm type_)}]}))---- | DSL name token for hydra.core.FieldType-fieldTypeFieldType :: Typed.TypedName Core.FieldType-fieldTypeFieldType = Typed.TypedName (Core.Name "hydra.core.FieldType")---- | DSL accessor for the name field of hydra.core.FieldType-fieldTypeName :: Typed.TypedTerm Core.FieldType -> Typed.TypedTerm Core.Name-fieldTypeName x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.core.FieldType"),- Core.projectionFieldName = (Core.Name "name")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL accessor for the type field of hydra.core.FieldType-fieldTypeType :: Typed.TypedTerm Core.FieldType -> Typed.TypedTerm Core.Type-fieldTypeType x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.core.FieldType"),- Core.projectionFieldName = (Core.Name "type")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL updater for the name field of hydra.core.FieldType-fieldTypeWithName :: Typed.TypedTerm Core.FieldType -> Typed.TypedTerm Core.Name -> Typed.TypedTerm Core.FieldType-fieldTypeWithName original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.core.FieldType"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "name"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "type"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.core.FieldType"),- Core.projectionFieldName = (Core.Name "type")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL updater for the type field of hydra.core.FieldType-fieldTypeWithType :: Typed.TypedTerm Core.FieldType -> Typed.TypedTerm Core.Type -> Typed.TypedTerm Core.FieldType-fieldTypeWithType original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.core.FieldType"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "name"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.core.FieldType"),- Core.projectionFieldName = (Core.Name "name")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "type"),- Core.fieldTerm = (Typed.unTypedTerm newVal)}]}))---- | DSL updater for the name field of hydra.core.Field-fieldWithName :: Typed.TypedTerm Core.Field -> Typed.TypedTerm Core.Name -> Typed.TypedTerm Core.Field-fieldWithName original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.core.Field"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "name"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "term"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.core.Field"),- Core.projectionFieldName = (Core.Name "term")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL updater for the term field of hydra.core.Field-fieldWithTerm :: Typed.TypedTerm Core.Field -> Typed.TypedTerm Core.Term -> Typed.TypedTerm Core.Field-fieldWithTerm original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.core.Field"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "name"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.core.Field"),- Core.projectionFieldName = (Core.Name "name")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "term"),- Core.fieldTerm = (Typed.unTypedTerm newVal)}]}))---- | DSL injection for the float32 variant of hydra.core.FloatType-floatTypeFloat32 :: Typed.TypedTerm Core.FloatType-floatTypeFloat32 =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.core.FloatType"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "float32"),- Core.fieldTerm = Core.TermUnit}}))---- | DSL injection for the float64 variant of hydra.core.FloatType-floatTypeFloat64 :: Typed.TypedTerm Core.FloatType-floatTypeFloat64 =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.core.FloatType"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "float64"),- Core.fieldTerm = Core.TermUnit}}))---- | DSL name token for hydra.core.FloatType-floatTypeFloatType :: Typed.TypedName Core.FloatType-floatTypeFloatType = Typed.TypedName (Core.Name "hydra.core.FloatType")---- | DSL injection for the float32 variant of hydra.core.FloatValue-floatValueFloat32 :: Typed.TypedTerm Float -> Typed.TypedTerm Core.FloatValue-floatValueFloat32 x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.core.FloatValue"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "float32"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the float64 variant of hydra.core.FloatValue-floatValueFloat64 :: Typed.TypedTerm Double -> Typed.TypedTerm Core.FloatValue-floatValueFloat64 x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.core.FloatValue"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "float64"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL name token for hydra.core.FloatValue-floatValueFloatValue :: Typed.TypedName Core.FloatValue-floatValueFloatValue = Typed.TypedName (Core.Name "hydra.core.FloatValue")---- | DSL constructor for hydra.core.ForallType-forallType :: Typed.TypedTerm Core.Name -> Typed.TypedTerm Core.Type -> Typed.TypedTerm Core.ForallType-forallType parameter body =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.core.ForallType"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "parameter"),- Core.fieldTerm = (Typed.unTypedTerm parameter)},- Core.Field {- Core.fieldName = (Core.Name "body"),- Core.fieldTerm = (Typed.unTypedTerm body)}]}))---- | DSL accessor for the body field of hydra.core.ForallType-forallTypeBody :: Typed.TypedTerm Core.ForallType -> Typed.TypedTerm Core.Type-forallTypeBody x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.core.ForallType"),- Core.projectionFieldName = (Core.Name "body")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL name token for hydra.core.ForallType-forallTypeForallType :: Typed.TypedName Core.ForallType-forallTypeForallType = Typed.TypedName (Core.Name "hydra.core.ForallType")---- | DSL accessor for the parameter field of hydra.core.ForallType-forallTypeParameter :: Typed.TypedTerm Core.ForallType -> Typed.TypedTerm Core.Name-forallTypeParameter x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.core.ForallType"),- Core.projectionFieldName = (Core.Name "parameter")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL updater for the body field of hydra.core.ForallType-forallTypeWithBody :: Typed.TypedTerm Core.ForallType -> Typed.TypedTerm Core.Type -> Typed.TypedTerm Core.ForallType-forallTypeWithBody original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.core.ForallType"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "parameter"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.core.ForallType"),- Core.projectionFieldName = (Core.Name "parameter")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "body"),- Core.fieldTerm = (Typed.unTypedTerm newVal)}]}))---- | DSL updater for the parameter field of hydra.core.ForallType-forallTypeWithParameter :: Typed.TypedTerm Core.ForallType -> Typed.TypedTerm Core.Name -> Typed.TypedTerm Core.ForallType-forallTypeWithParameter original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.core.ForallType"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "parameter"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "body"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.core.ForallType"),- Core.projectionFieldName = (Core.Name "body")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL constructor for hydra.core.FunctionType-functionType :: Typed.TypedTerm Core.Type -> Typed.TypedTerm Core.Type -> Typed.TypedTerm Core.FunctionType-functionType domain codomain =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.core.FunctionType"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "domain"),- Core.fieldTerm = (Typed.unTypedTerm domain)},- Core.Field {- Core.fieldName = (Core.Name "codomain"),- Core.fieldTerm = (Typed.unTypedTerm codomain)}]}))---- | DSL accessor for the codomain field of hydra.core.FunctionType-functionTypeCodomain :: Typed.TypedTerm Core.FunctionType -> Typed.TypedTerm Core.Type-functionTypeCodomain x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.core.FunctionType"),- Core.projectionFieldName = (Core.Name "codomain")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL accessor for the domain field of hydra.core.FunctionType-functionTypeDomain :: Typed.TypedTerm Core.FunctionType -> Typed.TypedTerm Core.Type-functionTypeDomain x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.core.FunctionType"),- Core.projectionFieldName = (Core.Name "domain")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL name token for hydra.core.FunctionType-functionTypeFunctionType :: Typed.TypedName Core.FunctionType-functionTypeFunctionType = Typed.TypedName (Core.Name "hydra.core.FunctionType")---- | DSL updater for the codomain field of hydra.core.FunctionType-functionTypeWithCodomain :: Typed.TypedTerm Core.FunctionType -> Typed.TypedTerm Core.Type -> Typed.TypedTerm Core.FunctionType-functionTypeWithCodomain original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.core.FunctionType"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "domain"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.core.FunctionType"),- Core.projectionFieldName = (Core.Name "domain")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "codomain"),- Core.fieldTerm = (Typed.unTypedTerm newVal)}]}))---- | DSL updater for the domain field of hydra.core.FunctionType-functionTypeWithDomain :: Typed.TypedTerm Core.FunctionType -> Typed.TypedTerm Core.Type -> Typed.TypedTerm Core.FunctionType-functionTypeWithDomain original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.core.FunctionType"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "domain"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "codomain"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.core.FunctionType"),- Core.projectionFieldName = (Core.Name "codomain")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL constructor for hydra.core.Injection-injection :: Typed.TypedTerm Core.Name -> Typed.TypedTerm Core.Field -> Typed.TypedTerm Core.Injection-injection typeName field =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.core.Injection"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "typeName"),- Core.fieldTerm = (Typed.unTypedTerm typeName)},- Core.Field {- Core.fieldName = (Core.Name "field"),- Core.fieldTerm = (Typed.unTypedTerm field)}]}))---- | DSL accessor for the field field of hydra.core.Injection-injectionField :: Typed.TypedTerm Core.Injection -> Typed.TypedTerm Core.Field-injectionField x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.core.Injection"),- Core.projectionFieldName = (Core.Name "field")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL name token for hydra.core.Injection-injectionInjection :: Typed.TypedName Core.Injection-injectionInjection = Typed.TypedName (Core.Name "hydra.core.Injection")---- | DSL accessor for the typeName field of hydra.core.Injection-injectionTypeName :: Typed.TypedTerm Core.Injection -> Typed.TypedTerm Core.Name-injectionTypeName x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.core.Injection"),- Core.projectionFieldName = (Core.Name "typeName")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL updater for the field field of hydra.core.Injection-injectionWithField :: Typed.TypedTerm Core.Injection -> Typed.TypedTerm Core.Field -> Typed.TypedTerm Core.Injection-injectionWithField original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.core.Injection"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "typeName"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.core.Injection"),- Core.projectionFieldName = (Core.Name "typeName")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "field"),- Core.fieldTerm = (Typed.unTypedTerm newVal)}]}))---- | DSL updater for the typeName field of hydra.core.Injection-injectionWithTypeName :: Typed.TypedTerm Core.Injection -> Typed.TypedTerm Core.Name -> Typed.TypedTerm Core.Injection-injectionWithTypeName original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.core.Injection"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "typeName"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "field"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.core.Injection"),- Core.projectionFieldName = (Core.Name "field")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL injection for the bigint variant of hydra.core.IntegerType-integerTypeBigint :: Typed.TypedTerm Core.IntegerType-integerTypeBigint =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.core.IntegerType"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "bigint"),- Core.fieldTerm = Core.TermUnit}}))---- | DSL injection for the int16 variant of hydra.core.IntegerType-integerTypeInt16 :: Typed.TypedTerm Core.IntegerType-integerTypeInt16 =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.core.IntegerType"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "int16"),- Core.fieldTerm = Core.TermUnit}}))---- | DSL injection for the int32 variant of hydra.core.IntegerType-integerTypeInt32 :: Typed.TypedTerm Core.IntegerType-integerTypeInt32 =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.core.IntegerType"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "int32"),- Core.fieldTerm = Core.TermUnit}}))---- | DSL injection for the int64 variant of hydra.core.IntegerType-integerTypeInt64 :: Typed.TypedTerm Core.IntegerType-integerTypeInt64 =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.core.IntegerType"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "int64"),- Core.fieldTerm = Core.TermUnit}}))---- | DSL injection for the int8 variant of hydra.core.IntegerType-integerTypeInt8 :: Typed.TypedTerm Core.IntegerType-integerTypeInt8 =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.core.IntegerType"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "int8"),- Core.fieldTerm = Core.TermUnit}}))---- | DSL name token for hydra.core.IntegerType-integerTypeIntegerType :: Typed.TypedName Core.IntegerType-integerTypeIntegerType = Typed.TypedName (Core.Name "hydra.core.IntegerType")---- | DSL injection for the uint16 variant of hydra.core.IntegerType-integerTypeUint16 :: Typed.TypedTerm Core.IntegerType-integerTypeUint16 =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.core.IntegerType"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "uint16"),- Core.fieldTerm = Core.TermUnit}}))---- | DSL injection for the uint32 variant of hydra.core.IntegerType-integerTypeUint32 :: Typed.TypedTerm Core.IntegerType-integerTypeUint32 =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.core.IntegerType"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "uint32"),- Core.fieldTerm = Core.TermUnit}}))---- | DSL injection for the uint64 variant of hydra.core.IntegerType-integerTypeUint64 :: Typed.TypedTerm Core.IntegerType-integerTypeUint64 =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.core.IntegerType"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "uint64"),- Core.fieldTerm = Core.TermUnit}}))---- | DSL injection for the uint8 variant of hydra.core.IntegerType-integerTypeUint8 :: Typed.TypedTerm Core.IntegerType-integerTypeUint8 =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.core.IntegerType"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "uint8"),- Core.fieldTerm = Core.TermUnit}}))---- | DSL injection for the bigint variant of hydra.core.IntegerValue-integerValueBigint :: Typed.TypedTerm Integer -> Typed.TypedTerm Core.IntegerValue-integerValueBigint x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.core.IntegerValue"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "bigint"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the int16 variant of hydra.core.IntegerValue-integerValueInt16 :: Typed.TypedTerm I.Int16 -> Typed.TypedTerm Core.IntegerValue-integerValueInt16 x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.core.IntegerValue"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "int16"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the int32 variant of hydra.core.IntegerValue-integerValueInt32 :: Typed.TypedTerm Int -> Typed.TypedTerm Core.IntegerValue-integerValueInt32 x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.core.IntegerValue"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "int32"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the int64 variant of hydra.core.IntegerValue-integerValueInt64 :: Typed.TypedTerm I.Int64 -> Typed.TypedTerm Core.IntegerValue-integerValueInt64 x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.core.IntegerValue"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "int64"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the int8 variant of hydra.core.IntegerValue-integerValueInt8 :: Typed.TypedTerm I.Int8 -> Typed.TypedTerm Core.IntegerValue-integerValueInt8 x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.core.IntegerValue"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "int8"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL name token for hydra.core.IntegerValue-integerValueIntegerValue :: Typed.TypedName Core.IntegerValue-integerValueIntegerValue = Typed.TypedName (Core.Name "hydra.core.IntegerValue")---- | DSL injection for the uint16 variant of hydra.core.IntegerValue-integerValueUint16 :: Typed.TypedTerm Int -> Typed.TypedTerm Core.IntegerValue-integerValueUint16 x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.core.IntegerValue"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "uint16"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the uint32 variant of hydra.core.IntegerValue-integerValueUint32 :: Typed.TypedTerm I.Int64 -> Typed.TypedTerm Core.IntegerValue-integerValueUint32 x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.core.IntegerValue"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "uint32"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the uint64 variant of hydra.core.IntegerValue-integerValueUint64 :: Typed.TypedTerm Integer -> Typed.TypedTerm Core.IntegerValue-integerValueUint64 x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.core.IntegerValue"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "uint64"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the uint8 variant of hydra.core.IntegerValue-integerValueUint8 :: Typed.TypedTerm I.Int16 -> Typed.TypedTerm Core.IntegerValue-integerValueUint8 x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.core.IntegerValue"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "uint8"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL constructor for hydra.core.Lambda-lambda :: Typed.TypedTerm Core.Name -> Typed.TypedTerm (Maybe Core.Type) -> Typed.TypedTerm Core.Term -> Typed.TypedTerm Core.Lambda-lambda parameter domain body =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.core.Lambda"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "parameter"),- Core.fieldTerm = (Typed.unTypedTerm parameter)},- Core.Field {- Core.fieldName = (Core.Name "domain"),- Core.fieldTerm = (Typed.unTypedTerm domain)},- Core.Field {- Core.fieldName = (Core.Name "body"),- Core.fieldTerm = (Typed.unTypedTerm body)}]}))---- | DSL accessor for the body field of hydra.core.Lambda-lambdaBody :: Typed.TypedTerm Core.Lambda -> Typed.TypedTerm Core.Term-lambdaBody x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.core.Lambda"),- Core.projectionFieldName = (Core.Name "body")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL accessor for the domain field of hydra.core.Lambda-lambdaDomain :: Typed.TypedTerm Core.Lambda -> Typed.TypedTerm (Maybe Core.Type)-lambdaDomain x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.core.Lambda"),- Core.projectionFieldName = (Core.Name "domain")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL name token for hydra.core.Lambda-lambdaLambda :: Typed.TypedName Core.Lambda-lambdaLambda = Typed.TypedName (Core.Name "hydra.core.Lambda")---- | DSL accessor for the parameter field of hydra.core.Lambda-lambdaParameter :: Typed.TypedTerm Core.Lambda -> Typed.TypedTerm Core.Name-lambdaParameter x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.core.Lambda"),- Core.projectionFieldName = (Core.Name "parameter")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL updater for the body field of hydra.core.Lambda-lambdaWithBody :: Typed.TypedTerm Core.Lambda -> Typed.TypedTerm Core.Term -> Typed.TypedTerm Core.Lambda-lambdaWithBody original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.core.Lambda"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "parameter"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.core.Lambda"),- Core.projectionFieldName = (Core.Name "parameter")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "domain"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.core.Lambda"),- Core.projectionFieldName = (Core.Name "domain")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "body"),- Core.fieldTerm = (Typed.unTypedTerm newVal)}]}))---- | DSL updater for the domain field of hydra.core.Lambda-lambdaWithDomain :: Typed.TypedTerm Core.Lambda -> Typed.TypedTerm (Maybe Core.Type) -> Typed.TypedTerm Core.Lambda-lambdaWithDomain original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.core.Lambda"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "parameter"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.core.Lambda"),- Core.projectionFieldName = (Core.Name "parameter")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "domain"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "body"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.core.Lambda"),- Core.projectionFieldName = (Core.Name "body")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL updater for the parameter field of hydra.core.Lambda-lambdaWithParameter :: Typed.TypedTerm Core.Lambda -> Typed.TypedTerm Core.Name -> Typed.TypedTerm Core.Lambda-lambdaWithParameter original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.core.Lambda"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "parameter"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "domain"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.core.Lambda"),- Core.projectionFieldName = (Core.Name "domain")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "body"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.core.Lambda"),- Core.projectionFieldName = (Core.Name "body")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL constructor for hydra.core.Let-let_ :: Typed.TypedTerm [Core.Binding] -> Typed.TypedTerm Core.Term -> Typed.TypedTerm Core.Let-let_ bindings body =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.core.Let"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "bindings"),- Core.fieldTerm = (Typed.unTypedTerm bindings)},- Core.Field {- Core.fieldName = (Core.Name "body"),- Core.fieldTerm = (Typed.unTypedTerm body)}]}))---- | DSL accessor for the bindings field of hydra.core.Let-letBindings :: Typed.TypedTerm Core.Let -> Typed.TypedTerm [Core.Binding]-letBindings x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.core.Let"),- Core.projectionFieldName = (Core.Name "bindings")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL accessor for the body field of hydra.core.Let-letBody :: Typed.TypedTerm Core.Let -> Typed.TypedTerm Core.Term-letBody x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.core.Let"),- Core.projectionFieldName = (Core.Name "body")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL name token for hydra.core.Let-letLet :: Typed.TypedName Core.Let-letLet = Typed.TypedName (Core.Name "hydra.core.Let")---- | DSL updater for the bindings field of hydra.core.Let-letWithBindings :: Typed.TypedTerm Core.Let -> Typed.TypedTerm [Core.Binding] -> Typed.TypedTerm Core.Let-letWithBindings original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.core.Let"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "bindings"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "body"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.core.Let"),- Core.projectionFieldName = (Core.Name "body")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL updater for the body field of hydra.core.Let-letWithBody :: Typed.TypedTerm Core.Let -> Typed.TypedTerm Core.Term -> Typed.TypedTerm Core.Let-letWithBody original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.core.Let"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "bindings"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.core.Let"),- Core.projectionFieldName = (Core.Name "bindings")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "body"),- Core.fieldTerm = (Typed.unTypedTerm newVal)}]}))---- | DSL injection for the binary variant of hydra.core.Literal-literalBinary :: Typed.TypedTerm B.ByteString -> Typed.TypedTerm Core.Literal-literalBinary x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.core.Literal"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "binary"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the boolean variant of hydra.core.Literal-literalBoolean :: Typed.TypedTerm Bool -> Typed.TypedTerm Core.Literal-literalBoolean x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.core.Literal"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "boolean"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the decimal variant of hydra.core.Literal-literalDecimal :: Typed.TypedTerm Sci.Scientific -> Typed.TypedTerm Core.Literal-literalDecimal x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.core.Literal"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "decimal"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the float variant of hydra.core.Literal-literalFloat :: Typed.TypedTerm Core.FloatValue -> Typed.TypedTerm Core.Literal-literalFloat x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.core.Literal"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "float"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the integer variant of hydra.core.Literal-literalInteger :: Typed.TypedTerm Core.IntegerValue -> Typed.TypedTerm Core.Literal-literalInteger x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.core.Literal"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "integer"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL name token for hydra.core.Literal-literalLiteral :: Typed.TypedName Core.Literal-literalLiteral = Typed.TypedName (Core.Name "hydra.core.Literal")---- | DSL injection for the string variant of hydra.core.Literal-literalString :: Typed.TypedTerm String -> Typed.TypedTerm Core.Literal-literalString x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.core.Literal"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "string"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the binary variant of hydra.core.LiteralType-literalTypeBinary :: Typed.TypedTerm Core.LiteralType-literalTypeBinary =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.core.LiteralType"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "binary"),- Core.fieldTerm = Core.TermUnit}}))---- | DSL injection for the boolean variant of hydra.core.LiteralType-literalTypeBoolean :: Typed.TypedTerm Core.LiteralType-literalTypeBoolean =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.core.LiteralType"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "boolean"),- Core.fieldTerm = Core.TermUnit}}))---- | DSL injection for the decimal variant of hydra.core.LiteralType-literalTypeDecimal :: Typed.TypedTerm Core.LiteralType-literalTypeDecimal =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.core.LiteralType"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "decimal"),- Core.fieldTerm = Core.TermUnit}}))---- | DSL injection for the float variant of hydra.core.LiteralType-literalTypeFloat :: Typed.TypedTerm Core.FloatType -> Typed.TypedTerm Core.LiteralType-literalTypeFloat x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.core.LiteralType"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "float"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the integer variant of hydra.core.LiteralType-literalTypeInteger :: Typed.TypedTerm Core.IntegerType -> Typed.TypedTerm Core.LiteralType-literalTypeInteger x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.core.LiteralType"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "integer"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL name token for hydra.core.LiteralType-literalTypeLiteralType :: Typed.TypedName Core.LiteralType-literalTypeLiteralType = Typed.TypedName (Core.Name "hydra.core.LiteralType")---- | DSL injection for the string variant of hydra.core.LiteralType-literalTypeString :: Typed.TypedTerm Core.LiteralType-literalTypeString =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.core.LiteralType"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "string"),- Core.fieldTerm = Core.TermUnit}}))---- | DSL constructor for hydra.core.MapType-mapType :: Typed.TypedTerm Core.Type -> Typed.TypedTerm Core.Type -> Typed.TypedTerm Core.MapType-mapType keys values =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.core.MapType"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "keys"),- Core.fieldTerm = (Typed.unTypedTerm keys)},- Core.Field {- Core.fieldName = (Core.Name "values"),- Core.fieldTerm = (Typed.unTypedTerm values)}]}))---- | DSL accessor for the keys field of hydra.core.MapType-mapTypeKeys :: Typed.TypedTerm Core.MapType -> Typed.TypedTerm Core.Type-mapTypeKeys x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.core.MapType"),- Core.projectionFieldName = (Core.Name "keys")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL name token for hydra.core.MapType-mapTypeMapType :: Typed.TypedName Core.MapType-mapTypeMapType = Typed.TypedName (Core.Name "hydra.core.MapType")---- | DSL accessor for the values field of hydra.core.MapType-mapTypeValues :: Typed.TypedTerm Core.MapType -> Typed.TypedTerm Core.Type-mapTypeValues x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.core.MapType"),- Core.projectionFieldName = (Core.Name "values")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL updater for the keys field of hydra.core.MapType-mapTypeWithKeys :: Typed.TypedTerm Core.MapType -> Typed.TypedTerm Core.Type -> Typed.TypedTerm Core.MapType-mapTypeWithKeys original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.core.MapType"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "keys"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "values"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.core.MapType"),- Core.projectionFieldName = (Core.Name "values")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL updater for the values field of hydra.core.MapType-mapTypeWithValues :: Typed.TypedTerm Core.MapType -> Typed.TypedTerm Core.Type -> Typed.TypedTerm Core.MapType-mapTypeWithValues original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.core.MapType"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "keys"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.core.MapType"),- Core.projectionFieldName = (Core.Name "keys")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "values"),- Core.fieldTerm = (Typed.unTypedTerm newVal)}]}))---- | DSL constructor for the hydra.core.Name wrapper-name :: Typed.TypedTerm String -> Typed.TypedTerm Core.Name-name x =- Typed.TypedTerm (Core.TermWrap (Core.WrappedTerm {- Core.wrappedTermTypeName = (Core.Name "hydra.core.Name"),- Core.wrappedTermBody = (Typed.unTypedTerm x)}))---- | DSL name token for hydra.core.Name-nameName :: Typed.TypedName Core.Name-nameName = Typed.TypedName (Core.Name "hydra.core.Name")---- | DSL constructor for hydra.core.PairType-pairType :: Typed.TypedTerm Core.Type -> Typed.TypedTerm Core.Type -> Typed.TypedTerm Core.PairType-pairType first second =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.core.PairType"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "first"),- Core.fieldTerm = (Typed.unTypedTerm first)},- Core.Field {- Core.fieldName = (Core.Name "second"),- Core.fieldTerm = (Typed.unTypedTerm second)}]}))---- | DSL accessor for the first field of hydra.core.PairType-pairTypeFirst :: Typed.TypedTerm Core.PairType -> Typed.TypedTerm Core.Type-pairTypeFirst x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.core.PairType"),- Core.projectionFieldName = (Core.Name "first")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL name token for hydra.core.PairType-pairTypePairType :: Typed.TypedName Core.PairType-pairTypePairType = Typed.TypedName (Core.Name "hydra.core.PairType")---- | DSL accessor for the second field of hydra.core.PairType-pairTypeSecond :: Typed.TypedTerm Core.PairType -> Typed.TypedTerm Core.Type-pairTypeSecond x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.core.PairType"),- Core.projectionFieldName = (Core.Name "second")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL updater for the first field of hydra.core.PairType-pairTypeWithFirst :: Typed.TypedTerm Core.PairType -> Typed.TypedTerm Core.Type -> Typed.TypedTerm Core.PairType-pairTypeWithFirst original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.core.PairType"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "first"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "second"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.core.PairType"),- Core.projectionFieldName = (Core.Name "second")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL updater for the second field of hydra.core.PairType-pairTypeWithSecond :: Typed.TypedTerm Core.PairType -> Typed.TypedTerm Core.Type -> Typed.TypedTerm Core.PairType-pairTypeWithSecond original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.core.PairType"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "first"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.core.PairType"),- Core.projectionFieldName = (Core.Name "first")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "second"),- Core.fieldTerm = (Typed.unTypedTerm newVal)}]}))---- | DSL constructor for hydra.core.Projection-projection :: Typed.TypedTerm Core.Name -> Typed.TypedTerm Core.Name -> Typed.TypedTerm Core.Projection-projection typeName fieldName =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.core.Projection"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "typeName"),- Core.fieldTerm = (Typed.unTypedTerm typeName)},- Core.Field {- Core.fieldName = (Core.Name "fieldName"),- Core.fieldTerm = (Typed.unTypedTerm fieldName)}]}))---- | DSL accessor for the fieldName field of hydra.core.Projection-projectionFieldName :: Typed.TypedTerm Core.Projection -> Typed.TypedTerm Core.Name-projectionFieldName x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.core.Projection"),- Core.projectionFieldName = (Core.Name "fieldName")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL name token for hydra.core.Projection-projectionProjection :: Typed.TypedName Core.Projection-projectionProjection = Typed.TypedName (Core.Name "hydra.core.Projection")---- | DSL accessor for the typeName field of hydra.core.Projection-projectionTypeName :: Typed.TypedTerm Core.Projection -> Typed.TypedTerm Core.Name-projectionTypeName x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.core.Projection"),- Core.projectionFieldName = (Core.Name "typeName")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL updater for the fieldName field of hydra.core.Projection-projectionWithFieldName :: Typed.TypedTerm Core.Projection -> Typed.TypedTerm Core.Name -> Typed.TypedTerm Core.Projection-projectionWithFieldName original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.core.Projection"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "typeName"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.core.Projection"),- Core.projectionFieldName = (Core.Name "typeName")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "fieldName"),- Core.fieldTerm = (Typed.unTypedTerm newVal)}]}))---- | DSL updater for the typeName field of hydra.core.Projection-projectionWithTypeName :: Typed.TypedTerm Core.Projection -> Typed.TypedTerm Core.Name -> Typed.TypedTerm Core.Projection-projectionWithTypeName original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.core.Projection"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "typeName"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "fieldName"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.core.Projection"),- Core.projectionFieldName = (Core.Name "fieldName")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL constructor for hydra.core.Record-record :: Typed.TypedTerm Core.Name -> Typed.TypedTerm [Core.Field] -> Typed.TypedTerm Core.Record-record typeName fields =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.core.Record"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "typeName"),- Core.fieldTerm = (Typed.unTypedTerm typeName)},- Core.Field {- Core.fieldName = (Core.Name "fields"),- Core.fieldTerm = (Typed.unTypedTerm fields)}]}))---- | DSL accessor for the fields field of hydra.core.Record-recordFields :: Typed.TypedTerm Core.Record -> Typed.TypedTerm [Core.Field]-recordFields x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.core.Record"),- Core.projectionFieldName = (Core.Name "fields")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL name token for hydra.core.Record-recordRecord :: Typed.TypedName Core.Record-recordRecord = Typed.TypedName (Core.Name "hydra.core.Record")---- | DSL accessor for the typeName field of hydra.core.Record-recordTypeName :: Typed.TypedTerm Core.Record -> Typed.TypedTerm Core.Name-recordTypeName x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.core.Record"),- Core.projectionFieldName = (Core.Name "typeName")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL updater for the fields field of hydra.core.Record-recordWithFields :: Typed.TypedTerm Core.Record -> Typed.TypedTerm [Core.Field] -> Typed.TypedTerm Core.Record-recordWithFields original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.core.Record"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "typeName"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.core.Record"),- Core.projectionFieldName = (Core.Name "typeName")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "fields"),- Core.fieldTerm = (Typed.unTypedTerm newVal)}]}))---- | DSL updater for the typeName field of hydra.core.Record-recordWithTypeName :: Typed.TypedTerm Core.Record -> Typed.TypedTerm Core.Name -> Typed.TypedTerm Core.Record-recordWithTypeName original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.core.Record"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "typeName"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "fields"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.core.Record"),- Core.projectionFieldName = (Core.Name "fields")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL injection for the annotated variant of hydra.core.Term-termAnnotated :: Typed.TypedTerm Core.AnnotatedTerm -> Typed.TypedTerm Core.Term-termAnnotated x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.core.Term"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "annotated"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the application variant of hydra.core.Term-termApplication :: Typed.TypedTerm Core.Application -> Typed.TypedTerm Core.Term-termApplication x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.core.Term"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "application"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the cases variant of hydra.core.Term-termCases :: Typed.TypedTerm Core.CaseStatement -> Typed.TypedTerm Core.Term-termCases x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.core.Term"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "cases"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the either variant of hydra.core.Term-termEither :: Typed.TypedTerm (Either Core.Term Core.Term) -> Typed.TypedTerm Core.Term-termEither x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.core.Term"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "either"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the inject variant of hydra.core.Term-termInject :: Typed.TypedTerm Core.Injection -> Typed.TypedTerm Core.Term-termInject x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.core.Term"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "inject"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the lambda variant of hydra.core.Term-termLambda :: Typed.TypedTerm Core.Lambda -> Typed.TypedTerm Core.Term-termLambda x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.core.Term"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "lambda"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the let variant of hydra.core.Term-termLet :: Typed.TypedTerm Core.Let -> Typed.TypedTerm Core.Term-termLet x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.core.Term"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "let"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the list variant of hydra.core.Term-termList :: Typed.TypedTerm [Core.Term] -> Typed.TypedTerm Core.Term-termList x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.core.Term"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "list"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the literal variant of hydra.core.Term-termLiteral :: Typed.TypedTerm Core.Literal -> Typed.TypedTerm Core.Term-termLiteral x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.core.Term"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "literal"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the map variant of hydra.core.Term-termMap :: Typed.TypedTerm (M.Map Core.Term Core.Term) -> Typed.TypedTerm Core.Term-termMap x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.core.Term"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "map"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the optional variant of hydra.core.Term-termOptional :: Typed.TypedTerm (Maybe Core.Term) -> Typed.TypedTerm Core.Term-termOptional x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.core.Term"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "optional"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the pair variant of hydra.core.Term-termPair :: Typed.TypedTerm (Core.Term, Core.Term) -> Typed.TypedTerm Core.Term-termPair x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.core.Term"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "pair"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the project variant of hydra.core.Term-termProject :: Typed.TypedTerm Core.Projection -> Typed.TypedTerm Core.Term-termProject x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.core.Term"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "project"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the record variant of hydra.core.Term-termRecord :: Typed.TypedTerm Core.Record -> Typed.TypedTerm Core.Term-termRecord x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.core.Term"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "record"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the set variant of hydra.core.Term-termSet :: Typed.TypedTerm (S.Set Core.Term) -> Typed.TypedTerm Core.Term-termSet x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.core.Term"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "set"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL name token for hydra.core.Term-termTerm :: Typed.TypedName Core.Term-termTerm = Typed.TypedName (Core.Name "hydra.core.Term")---- | DSL injection for the typeApplication variant of hydra.core.Term-termTypeApplication :: Typed.TypedTerm Core.TypeApplicationTerm -> Typed.TypedTerm Core.Term-termTypeApplication x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.core.Term"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "typeApplication"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the typeLambda variant of hydra.core.Term-termTypeLambda :: Typed.TypedTerm Core.TypeLambda -> Typed.TypedTerm Core.Term-termTypeLambda x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.core.Term"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "typeLambda"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the unit variant of hydra.core.Term-termUnit :: Typed.TypedTerm Core.Term-termUnit =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.core.Term"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "unit"),- Core.fieldTerm = Core.TermUnit}}))---- | DSL injection for the unwrap variant of hydra.core.Term-termUnwrap :: Typed.TypedTerm Core.Name -> Typed.TypedTerm Core.Term-termUnwrap x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.core.Term"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "unwrap"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the variable variant of hydra.core.Term-termVariable :: Typed.TypedTerm Core.Name -> Typed.TypedTerm Core.Term-termVariable x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.core.Term"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "variable"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the wrap variant of hydra.core.Term-termWrap :: Typed.TypedTerm Core.WrappedTerm -> Typed.TypedTerm Core.Term-termWrap x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.core.Term"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "wrap"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the annotated variant of hydra.core.Type-typeAnnotated :: Typed.TypedTerm Core.AnnotatedType -> Typed.TypedTerm Core.Type-typeAnnotated x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.core.Type"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "annotated"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the application variant of hydra.core.Type-typeApplication :: Typed.TypedTerm Core.ApplicationType -> Typed.TypedTerm Core.Type-typeApplication x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.core.Type"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "application"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL constructor for hydra.core.TypeApplicationTerm-typeApplicationTerm :: Typed.TypedTerm Core.Term -> Typed.TypedTerm Core.Type -> Typed.TypedTerm Core.TypeApplicationTerm-typeApplicationTerm body type_ =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.core.TypeApplicationTerm"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "body"),- Core.fieldTerm = (Typed.unTypedTerm body)},- Core.Field {- Core.fieldName = (Core.Name "type"),- Core.fieldTerm = (Typed.unTypedTerm type_)}]}))---- | DSL accessor for the body field of hydra.core.TypeApplicationTerm-typeApplicationTermBody :: Typed.TypedTerm Core.TypeApplicationTerm -> Typed.TypedTerm Core.Term-typeApplicationTermBody x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.core.TypeApplicationTerm"),- Core.projectionFieldName = (Core.Name "body")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL accessor for the type field of hydra.core.TypeApplicationTerm-typeApplicationTermType :: Typed.TypedTerm Core.TypeApplicationTerm -> Typed.TypedTerm Core.Type-typeApplicationTermType x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.core.TypeApplicationTerm"),- Core.projectionFieldName = (Core.Name "type")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL name token for hydra.core.TypeApplicationTerm-typeApplicationTermTypeApplicationTerm :: Typed.TypedName Core.TypeApplicationTerm-typeApplicationTermTypeApplicationTerm = Typed.TypedName (Core.Name "hydra.core.TypeApplicationTerm")---- | DSL updater for the body field of hydra.core.TypeApplicationTerm-typeApplicationTermWithBody :: Typed.TypedTerm Core.TypeApplicationTerm -> Typed.TypedTerm Core.Term -> Typed.TypedTerm Core.TypeApplicationTerm-typeApplicationTermWithBody original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.core.TypeApplicationTerm"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "body"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "type"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.core.TypeApplicationTerm"),- Core.projectionFieldName = (Core.Name "type")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL updater for the type field of hydra.core.TypeApplicationTerm-typeApplicationTermWithType :: Typed.TypedTerm Core.TypeApplicationTerm -> Typed.TypedTerm Core.Type -> Typed.TypedTerm Core.TypeApplicationTerm-typeApplicationTermWithType original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.core.TypeApplicationTerm"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "body"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.core.TypeApplicationTerm"),- Core.projectionFieldName = (Core.Name "body")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "type"),- Core.fieldTerm = (Typed.unTypedTerm newVal)}]}))---- | DSL injection for the simple variant of hydra.core.TypeClassConstraint-typeClassConstraintSimple :: Typed.TypedTerm Core.Name -> Typed.TypedTerm Core.TypeClassConstraint-typeClassConstraintSimple x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.core.TypeClassConstraint"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "simple"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL name token for hydra.core.TypeClassConstraint-typeClassConstraintTypeClassConstraint :: Typed.TypedName Core.TypeClassConstraint-typeClassConstraintTypeClassConstraint = Typed.TypedName (Core.Name "hydra.core.TypeClassConstraint")---- | DSL injection for the effect variant of hydra.core.Type-typeEffect :: Typed.TypedTerm Core.Type -> Typed.TypedTerm Core.Type-typeEffect x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.core.Type"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "effect"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the either variant of hydra.core.Type-typeEither :: Typed.TypedTerm Core.EitherType -> Typed.TypedTerm Core.Type-typeEither x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.core.Type"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "either"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the forall variant of hydra.core.Type-typeForall :: Typed.TypedTerm Core.ForallType -> Typed.TypedTerm Core.Type-typeForall x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.core.Type"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "forall"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the function variant of hydra.core.Type-typeFunction :: Typed.TypedTerm Core.FunctionType -> Typed.TypedTerm Core.Type-typeFunction x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.core.Type"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "function"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL constructor for hydra.core.TypeLambda-typeLambda :: Typed.TypedTerm Core.Name -> Typed.TypedTerm Core.Term -> Typed.TypedTerm Core.TypeLambda-typeLambda parameter body =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.core.TypeLambda"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "parameter"),- Core.fieldTerm = (Typed.unTypedTerm parameter)},- Core.Field {- Core.fieldName = (Core.Name "body"),- Core.fieldTerm = (Typed.unTypedTerm body)}]}))---- | DSL accessor for the body field of hydra.core.TypeLambda-typeLambdaBody :: Typed.TypedTerm Core.TypeLambda -> Typed.TypedTerm Core.Term-typeLambdaBody x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.core.TypeLambda"),- Core.projectionFieldName = (Core.Name "body")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL accessor for the parameter field of hydra.core.TypeLambda-typeLambdaParameter :: Typed.TypedTerm Core.TypeLambda -> Typed.TypedTerm Core.Name-typeLambdaParameter x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.core.TypeLambda"),- Core.projectionFieldName = (Core.Name "parameter")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL name token for hydra.core.TypeLambda-typeLambdaTypeLambda :: Typed.TypedName Core.TypeLambda-typeLambdaTypeLambda = Typed.TypedName (Core.Name "hydra.core.TypeLambda")---- | DSL updater for the body field of hydra.core.TypeLambda-typeLambdaWithBody :: Typed.TypedTerm Core.TypeLambda -> Typed.TypedTerm Core.Term -> Typed.TypedTerm Core.TypeLambda-typeLambdaWithBody original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.core.TypeLambda"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "parameter"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.core.TypeLambda"),- Core.projectionFieldName = (Core.Name "parameter")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "body"),- Core.fieldTerm = (Typed.unTypedTerm newVal)}]}))---- | DSL updater for the parameter field of hydra.core.TypeLambda-typeLambdaWithParameter :: Typed.TypedTerm Core.TypeLambda -> Typed.TypedTerm Core.Name -> Typed.TypedTerm Core.TypeLambda-typeLambdaWithParameter original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.core.TypeLambda"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "parameter"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "body"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.core.TypeLambda"),- Core.projectionFieldName = (Core.Name "body")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL injection for the list variant of hydra.core.Type-typeList :: Typed.TypedTerm Core.Type -> Typed.TypedTerm Core.Type-typeList x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.core.Type"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "list"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the literal variant of hydra.core.Type-typeLiteral :: Typed.TypedTerm Core.LiteralType -> Typed.TypedTerm Core.Type-typeLiteral x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.core.Type"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "literal"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the map variant of hydra.core.Type-typeMap :: Typed.TypedTerm Core.MapType -> Typed.TypedTerm Core.Type-typeMap x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.core.Type"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "map"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the optional variant of hydra.core.Type-typeOptional :: Typed.TypedTerm Core.Type -> Typed.TypedTerm Core.Type-typeOptional x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.core.Type"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "optional"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the pair variant of hydra.core.Type-typePair :: Typed.TypedTerm Core.PairType -> Typed.TypedTerm Core.Type-typePair x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.core.Type"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "pair"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the record variant of hydra.core.Type-typeRecord :: Typed.TypedTerm [Core.FieldType] -> Typed.TypedTerm Core.Type-typeRecord x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.core.Type"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "record"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL constructor for hydra.core.TypeScheme-typeScheme :: Typed.TypedTerm [Core.Name] -> Typed.TypedTerm Core.Type -> Typed.TypedTerm (M.Map Core.Name Core.TypeVariableConstraints) -> Typed.TypedTerm Core.TypeScheme-typeScheme variables body constraints =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.core.TypeScheme"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "variables"),- Core.fieldTerm = (Typed.unTypedTerm variables)},- Core.Field {- Core.fieldName = (Core.Name "body"),- Core.fieldTerm = (Typed.unTypedTerm body)},- Core.Field {- Core.fieldName = (Core.Name "constraints"),- Core.fieldTerm = (Typed.unTypedTerm constraints)}]}))---- | DSL accessor for the body field of hydra.core.TypeScheme-typeSchemeBody :: Typed.TypedTerm Core.TypeScheme -> Typed.TypedTerm Core.Type-typeSchemeBody x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.core.TypeScheme"),- Core.projectionFieldName = (Core.Name "body")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL accessor for the constraints field of hydra.core.TypeScheme-typeSchemeConstraints :: Typed.TypedTerm Core.TypeScheme -> Typed.TypedTerm (M.Map Core.Name Core.TypeVariableConstraints)-typeSchemeConstraints x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.core.TypeScheme"),- Core.projectionFieldName = (Core.Name "constraints")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL name token for hydra.core.TypeScheme-typeSchemeTypeScheme :: Typed.TypedName Core.TypeScheme-typeSchemeTypeScheme = Typed.TypedName (Core.Name "hydra.core.TypeScheme")---- | DSL accessor for the variables field of hydra.core.TypeScheme-typeSchemeVariables :: Typed.TypedTerm Core.TypeScheme -> Typed.TypedTerm [Core.Name]-typeSchemeVariables x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.core.TypeScheme"),- Core.projectionFieldName = (Core.Name "variables")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL updater for the body field of hydra.core.TypeScheme-typeSchemeWithBody :: Typed.TypedTerm Core.TypeScheme -> Typed.TypedTerm Core.Type -> Typed.TypedTerm Core.TypeScheme-typeSchemeWithBody original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.core.TypeScheme"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "variables"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.core.TypeScheme"),- Core.projectionFieldName = (Core.Name "variables")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "body"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "constraints"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.core.TypeScheme"),- Core.projectionFieldName = (Core.Name "constraints")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL updater for the constraints field of hydra.core.TypeScheme-typeSchemeWithConstraints :: Typed.TypedTerm Core.TypeScheme -> Typed.TypedTerm (M.Map Core.Name Core.TypeVariableConstraints) -> Typed.TypedTerm Core.TypeScheme-typeSchemeWithConstraints original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.core.TypeScheme"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "variables"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.core.TypeScheme"),- Core.projectionFieldName = (Core.Name "variables")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "body"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.core.TypeScheme"),- Core.projectionFieldName = (Core.Name "body")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "constraints"),- Core.fieldTerm = (Typed.unTypedTerm newVal)}]}))---- | DSL updater for the variables field of hydra.core.TypeScheme-typeSchemeWithVariables :: Typed.TypedTerm Core.TypeScheme -> Typed.TypedTerm [Core.Name] -> Typed.TypedTerm Core.TypeScheme-typeSchemeWithVariables original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.core.TypeScheme"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "variables"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "body"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.core.TypeScheme"),- Core.projectionFieldName = (Core.Name "body")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "constraints"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.core.TypeScheme"),- Core.projectionFieldName = (Core.Name "constraints")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL injection for the set variant of hydra.core.Type-typeSet :: Typed.TypedTerm Core.Type -> Typed.TypedTerm Core.Type-typeSet x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.core.Type"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "set"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL name token for hydra.core.Type-typeType :: Typed.TypedName Core.Type-typeType = Typed.TypedName (Core.Name "hydra.core.Type")---- | DSL injection for the union variant of hydra.core.Type-typeUnion :: Typed.TypedTerm [Core.FieldType] -> Typed.TypedTerm Core.Type-typeUnion x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.core.Type"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "union"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the unit variant of hydra.core.Type-typeUnit :: Typed.TypedTerm Core.Type-typeUnit =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.core.Type"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "unit"),- Core.fieldTerm = Core.TermUnit}}))---- | DSL injection for the variable variant of hydra.core.Type-typeVariable :: Typed.TypedTerm Core.Name -> Typed.TypedTerm Core.Type-typeVariable x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.core.Type"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "variable"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL constructor for hydra.core.TypeVariableConstraints-typeVariableConstraints :: Typed.TypedTerm (S.Set Core.TypeClassConstraint) -> Typed.TypedTerm Core.TypeVariableConstraints-typeVariableConstraints classes =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.core.TypeVariableConstraints"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "classes"),- Core.fieldTerm = (Typed.unTypedTerm classes)}]}))---- | DSL accessor for the classes field of hydra.core.TypeVariableConstraints-typeVariableConstraintsClasses :: Typed.TypedTerm Core.TypeVariableConstraints -> Typed.TypedTerm (S.Set Core.TypeClassConstraint)-typeVariableConstraintsClasses x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.core.TypeVariableConstraints"),- Core.projectionFieldName = (Core.Name "classes")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL name token for hydra.core.TypeVariableConstraints-typeVariableConstraintsTypeVariableConstraints :: Typed.TypedName Core.TypeVariableConstraints-typeVariableConstraintsTypeVariableConstraints = Typed.TypedName (Core.Name "hydra.core.TypeVariableConstraints")---- | DSL updater for the classes field of hydra.core.TypeVariableConstraints-typeVariableConstraintsWithClasses :: Typed.TypedTerm Core.TypeVariableConstraints -> Typed.TypedTerm (S.Set Core.TypeClassConstraint) -> Typed.TypedTerm Core.TypeVariableConstraints-typeVariableConstraintsWithClasses original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.core.TypeVariableConstraints"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "classes"),- Core.fieldTerm = (Typed.unTypedTerm newVal)}]}))---- | DSL injection for the void variant of hydra.core.Type-typeVoid :: Typed.TypedTerm Core.Type-typeVoid =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.core.Type"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "void"),- Core.fieldTerm = Core.TermUnit}}))---- | DSL injection for the wrap variant of hydra.core.Type-typeWrap :: Typed.TypedTerm Core.Type -> Typed.TypedTerm Core.Type-typeWrap x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.core.Type"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "wrap"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL accessor for the body of hydra.core.Name-unName :: Typed.TypedTerm Core.Name -> Typed.TypedTerm String-unName x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermUnwrap (Core.Name "hydra.core.Name")),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL constructor for hydra.core.WrappedTerm-wrappedTerm :: Typed.TypedTerm Core.Name -> Typed.TypedTerm Core.Term -> Typed.TypedTerm Core.WrappedTerm-wrappedTerm typeName body =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.core.WrappedTerm"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "typeName"),- Core.fieldTerm = (Typed.unTypedTerm typeName)},- Core.Field {- Core.fieldName = (Core.Name "body"),- Core.fieldTerm = (Typed.unTypedTerm body)}]}))---- | DSL accessor for the body field of hydra.core.WrappedTerm-wrappedTermBody :: Typed.TypedTerm Core.WrappedTerm -> Typed.TypedTerm Core.Term-wrappedTermBody x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.core.WrappedTerm"),- Core.projectionFieldName = (Core.Name "body")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL accessor for the typeName field of hydra.core.WrappedTerm-wrappedTermTypeName :: Typed.TypedTerm Core.WrappedTerm -> Typed.TypedTerm Core.Name-wrappedTermTypeName x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.core.WrappedTerm"),- Core.projectionFieldName = (Core.Name "typeName")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL updater for the body field of hydra.core.WrappedTerm-wrappedTermWithBody :: Typed.TypedTerm Core.WrappedTerm -> Typed.TypedTerm Core.Term -> Typed.TypedTerm Core.WrappedTerm-wrappedTermWithBody original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.core.WrappedTerm"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "typeName"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.core.WrappedTerm"),- Core.projectionFieldName = (Core.Name "typeName")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "body"),- Core.fieldTerm = (Typed.unTypedTerm newVal)}]}))---- | DSL updater for the typeName field of hydra.core.WrappedTerm-wrappedTermWithTypeName :: Typed.TypedTerm Core.WrappedTerm -> Typed.TypedTerm Core.Name -> Typed.TypedTerm Core.WrappedTerm-wrappedTermWithTypeName original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.core.WrappedTerm"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "typeName"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "body"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.core.WrappedTerm"),- Core.projectionFieldName = (Core.Name "body")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL name token for hydra.core.WrappedTerm-wrappedTermWrappedTerm :: Typed.TypedName Core.WrappedTerm-wrappedTermWrappedTerm = Typed.TypedName (Core.Name "hydra.core.WrappedTerm")
@@ -1,206 +0,0 @@--- Note: this is an automatically generated file. Do not edit.---- | DSL functions for hydra.dependencies--module Hydra.Dsl.Dependencies where--import qualified Hydra.Annotations as Annotations-import qualified Hydra.Ast as Ast-import qualified Hydra.Coders as Coders-import qualified Hydra.Constants as Constants-import qualified Hydra.Core as Core-import qualified Hydra.Dependencies as Dependencies-import qualified Hydra.Docs as Docs-import qualified Hydra.Dsl.Annotations as DslAnnotations-import qualified Hydra.Dsl.Ast as DslAst-import qualified Hydra.Dsl.Coders as DslCoders-import qualified Hydra.Dsl.Constants as DslConstants-import qualified Hydra.Dsl.Core as DslCore-import qualified Hydra.Dsl.Docs as DslDocs-import qualified Hydra.Dsl.Error.Checking as ErrorChecking-import qualified Hydra.Dsl.Error.Core as DslErrorCore-import qualified Hydra.Dsl.Error.File as DslErrorFile-import qualified Hydra.Dsl.Error.Packaging as DslErrorPackaging-import qualified Hydra.Dsl.Error.System as DslErrorSystem-import qualified Hydra.Dsl.Errors as DslErrors-import qualified Hydra.Dsl.File as DslFile-import qualified Hydra.Dsl.Graph as DslGraph-import qualified Hydra.Dsl.Json.Model as JsonModel-import qualified Hydra.Dsl.Lexical as DslLexical-import qualified Hydra.Dsl.Names as DslNames-import qualified Hydra.Dsl.Packaging as DslPackaging-import qualified Hydra.Dsl.Parsing as DslParsing-import qualified Hydra.Dsl.Paths as DslPaths-import qualified Hydra.Dsl.Query as DslQuery-import qualified Hydra.Dsl.Regex as DslRegex-import qualified Hydra.Dsl.Relational as DslRelational-import qualified Hydra.Dsl.Rewriting as DslRewriting-import qualified Hydra.Dsl.Sorting as DslSorting-import qualified Hydra.Dsl.Strip as DslStrip-import qualified Hydra.Dsl.System as DslSystem-import qualified Hydra.Dsl.Tabular as DslTabular-import qualified Hydra.Dsl.Testing as DslTesting-import qualified Hydra.Dsl.Time as DslTime-import qualified Hydra.Dsl.Topology as DslTopology-import qualified Hydra.Dsl.Typing as DslTyping-import qualified Hydra.Dsl.Util as DslUtil-import qualified Hydra.Dsl.Validation as DslValidation-import qualified Hydra.Dsl.Variables as DslVariables-import qualified Hydra.Dsl.Variants as DslVariants-import qualified Hydra.Error.Checking as Checking-import qualified Hydra.Error.Core as ErrorCore-import qualified Hydra.Error.File as ErrorFile-import qualified Hydra.Error.Packaging as ErrorPackaging-import qualified Hydra.Error.System as ErrorSystem-import qualified Hydra.Errors as Errors-import qualified Hydra.File as File-import qualified Hydra.Graph as Graph-import qualified Hydra.Json.Model as Model-import qualified Hydra.Lexical as Lexical-import qualified Hydra.Names as Names-import qualified Hydra.Packaging as Packaging-import qualified Hydra.Parsing as Parsing-import qualified Hydra.Paths as Paths-import qualified Hydra.Query as Query-import qualified Hydra.Regex as Regex-import qualified Hydra.Relational as Relational-import qualified Hydra.Rewriting as Rewriting-import qualified Hydra.Sorting as Sorting-import qualified Hydra.Strip as Strip-import qualified Hydra.System as System-import qualified Hydra.Tabular as Tabular-import qualified Hydra.Testing as Testing-import qualified Hydra.Time as Time-import qualified Hydra.Topology as Topology-import qualified Hydra.Typed as Typed-import qualified Hydra.Typing as Typing-import qualified Hydra.Util as Util-import qualified Hydra.Validation as Validation-import qualified Hydra.Variables as Variables-import qualified Hydra.Variants as Variants-import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)-import qualified Data.Scientific as Sci-import Data.Void-import qualified Data.Map as M-import qualified Data.Set as S---- | DSL reference to hydra.dependencies.definitionsWithDependencies-definitionsWithDependencies :: Typed.TypedTerm t0 -> Typed.TypedTerm Graph.Graph -> Typed.TypedTerm [Core.Binding] -> Typed.TypedTerm (Either Errors.Error [Core.Binding])-definitionsWithDependencies arg0 arg1 arg2 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.dependencies.definitionsWithDependencies")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)})),- Core.applicationArgument = (Typed.unTypedTerm arg2)}))---- | DSL reference to hydra.dependencies.flattenLetTerms-flattenLetTerms :: Typed.TypedTerm Core.Term -> Typed.TypedTerm Core.Term-flattenLetTerms arg0 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.dependencies.flattenLetTerms")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))---- | DSL reference to hydra.dependencies.inlineType-inlineType :: Typed.TypedTerm (M.Map Core.Name Core.Type) -> Typed.TypedTerm Core.Type -> Typed.TypedTerm (Either Errors.Error Core.Type)-inlineType arg0 arg1 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.dependencies.inlineType")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))---- | DSL reference to hydra.dependencies.isLambda-isLambda :: Typed.TypedTerm Core.Term -> Typed.TypedTerm Bool-isLambda arg0 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.dependencies.isLambda")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))---- | DSL reference to hydra.dependencies.liftLambdaAboveLet-liftLambdaAboveLet :: Typed.TypedTerm Core.Term -> Typed.TypedTerm Core.Term-liftLambdaAboveLet arg0 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.dependencies.liftLambdaAboveLet")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))---- | DSL reference to hydra.dependencies.pruneLet-pruneLet :: Typed.TypedTerm Core.Let -> Typed.TypedTerm Core.Let-pruneLet arg0 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.dependencies.pruneLet")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))---- | DSL reference to hydra.dependencies.replaceTypedefs-replaceTypedefs :: Typed.TypedTerm (M.Map Core.Name Core.TypeScheme) -> Typed.TypedTerm Core.Type -> Typed.TypedTerm Core.Type-replaceTypedefs arg0 arg1 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.dependencies.replaceTypedefs")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))---- | DSL reference to hydra.dependencies.simplifyTerm-simplifyTerm :: Typed.TypedTerm Core.Term -> Typed.TypedTerm Core.Term-simplifyTerm arg0 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.dependencies.simplifyTerm")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))---- | DSL reference to hydra.dependencies.termDependencyNames-termDependencyNames :: Typed.TypedTerm Bool -> Typed.TypedTerm Bool -> Typed.TypedTerm Bool -> Typed.TypedTerm Core.Term -> Typed.TypedTerm (S.Set Core.Name)-termDependencyNames arg0 arg1 arg2 arg3 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.dependencies.termDependencyNames")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)})),- Core.applicationArgument = (Typed.unTypedTerm arg2)})),- Core.applicationArgument = (Typed.unTypedTerm arg3)}))---- | DSL reference to hydra.dependencies.toShortNames-toShortNames :: Typed.TypedTerm [Core.Name] -> Typed.TypedTerm (M.Map Core.Name Core.Name)-toShortNames arg0 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.dependencies.toShortNames")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))---- | DSL reference to hydra.dependencies.topologicalSortBindingMap-topologicalSortBindingMap :: Typed.TypedTerm (M.Map Core.Name Core.Term) -> Typed.TypedTerm [[(Core.Name, Core.Term)]]-topologicalSortBindingMap arg0 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.dependencies.topologicalSortBindingMap")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))---- | DSL reference to hydra.dependencies.topologicalSortBindings-topologicalSortBindings :: Typed.TypedTerm [Core.Binding] -> Typed.TypedTerm (Either [[Core.Name]] [Core.Name])-topologicalSortBindings arg0 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.dependencies.topologicalSortBindings")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))---- | DSL reference to hydra.dependencies.topologicalSortTypeDefinitions-topologicalSortTypeDefinitions :: Typed.TypedTerm [Packaging.TypeDefinition] -> Typed.TypedTerm [[Packaging.TypeDefinition]]-topologicalSortTypeDefinitions arg0 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.dependencies.topologicalSortTypeDefinitions")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))---- | DSL reference to hydra.dependencies.typeDependencyNames-typeDependencyNames :: Typed.TypedTerm Bool -> Typed.TypedTerm Core.Type -> Typed.TypedTerm (S.Set Core.Name)-typeDependencyNames arg0 arg1 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.dependencies.typeDependencyNames")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))---- | DSL reference to hydra.dependencies.typeNamesInType-typeNamesInType :: Typed.TypedTerm Core.Type -> Typed.TypedTerm (S.Set t0)-typeNamesInType arg0 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.dependencies.typeNamesInType")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))
@@ -1,38 +0,0 @@--- Note: this is an automatically generated file. Do not edit.---- | DSL functions for hydra.docs--module Hydra.Dsl.Docs where--import qualified Hydra.Core as Core-import qualified Hydra.Decode.Docs as DecodeDocs-import qualified Hydra.Docs as Docs-import qualified Hydra.Dsl.Packaging as DslPackaging-import qualified Hydra.Encode.Docs as EncodeDocs-import qualified Hydra.Packaging as Packaging-import qualified Hydra.Typed as Typed-import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)-import qualified Data.Scientific as Sci-import Data.Void---- | DSL name token for hydra.docs.DocSegment-docSegmentDocSegment :: Typed.TypedName Docs.DocSegment-docSegmentDocSegment = Typed.TypedName (Core.Name "hydra.docs.DocSegment")---- | DSL injection for the ref variant of hydra.docs.DocSegment-docSegmentRef :: Typed.TypedTerm Packaging.EntityReference -> Typed.TypedTerm Docs.DocSegment-docSegmentRef x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.docs.DocSegment"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "ref"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the text variant of hydra.docs.DocSegment-docSegmentText :: Typed.TypedTerm String -> Typed.TypedTerm Docs.DocSegment-docSegmentText x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.docs.DocSegment"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "text"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))
@@ -1,196 +0,0 @@--- Note: this is an automatically generated file. Do not edit.---- | DSL functions for hydra.environment--module Hydra.Dsl.Environment where--import qualified Hydra.Ast as Ast-import qualified Hydra.Coders as Coders-import qualified Hydra.Core as Core-import qualified Hydra.Decode.Core as DecodeCore-import qualified Hydra.Docs as Docs-import qualified Hydra.Dsl.Ast as DslAst-import qualified Hydra.Dsl.Coders as DslCoders-import qualified Hydra.Dsl.Core as DslCore-import qualified Hydra.Dsl.Docs as DslDocs-import qualified Hydra.Dsl.Error.Checking as ErrorChecking-import qualified Hydra.Dsl.Error.Core as DslErrorCore-import qualified Hydra.Dsl.Error.File as DslErrorFile-import qualified Hydra.Dsl.Error.Packaging as DslErrorPackaging-import qualified Hydra.Dsl.Error.System as DslErrorSystem-import qualified Hydra.Dsl.Errors as DslErrors-import qualified Hydra.Dsl.File as DslFile-import qualified Hydra.Dsl.Graph as DslGraph-import qualified Hydra.Dsl.Json.Model as JsonModel-import qualified Hydra.Dsl.Lexical as DslLexical-import qualified Hydra.Dsl.Packaging as DslPackaging-import qualified Hydra.Dsl.Parsing as DslParsing-import qualified Hydra.Dsl.Paths as DslPaths-import qualified Hydra.Dsl.Query as DslQuery-import qualified Hydra.Dsl.Regex as DslRegex-import qualified Hydra.Dsl.Relational as DslRelational-import qualified Hydra.Dsl.Scoping as DslScoping-import qualified Hydra.Dsl.Sorting as DslSorting-import qualified Hydra.Dsl.Strip as DslStrip-import qualified Hydra.Dsl.System as DslSystem-import qualified Hydra.Dsl.Tabular as DslTabular-import qualified Hydra.Dsl.Testing as DslTesting-import qualified Hydra.Dsl.Time as DslTime-import qualified Hydra.Dsl.Topology as DslTopology-import qualified Hydra.Dsl.Typing as DslTyping-import qualified Hydra.Dsl.Util as DslUtil-import qualified Hydra.Dsl.Validation as DslValidation-import qualified Hydra.Dsl.Variables as DslVariables-import qualified Hydra.Dsl.Variants as DslVariants-import qualified Hydra.Encode.Core as EncodeCore-import qualified Hydra.Environment as Environment-import qualified Hydra.Error.Checking as Checking-import qualified Hydra.Error.Core as ErrorCore-import qualified Hydra.Error.File as ErrorFile-import qualified Hydra.Error.Packaging as ErrorPackaging-import qualified Hydra.Error.System as ErrorSystem-import qualified Hydra.Errors as Errors-import qualified Hydra.File as File-import qualified Hydra.Graph as Graph-import qualified Hydra.Json.Model as Model-import qualified Hydra.Lexical as Lexical-import qualified Hydra.Packaging as Packaging-import qualified Hydra.Parsing as Parsing-import qualified Hydra.Paths as Paths-import qualified Hydra.Query as Query-import qualified Hydra.Regex as Regex-import qualified Hydra.Relational as Relational-import qualified Hydra.Scoping as Scoping-import qualified Hydra.Sorting as Sorting-import qualified Hydra.Strip as Strip-import qualified Hydra.System as System-import qualified Hydra.Tabular as Tabular-import qualified Hydra.Testing as Testing-import qualified Hydra.Time as Time-import qualified Hydra.Topology as Topology-import qualified Hydra.Typed as Typed-import qualified Hydra.Typing as Typing-import qualified Hydra.Util as Util-import qualified Hydra.Validation as Validation-import qualified Hydra.Variables as Variables-import qualified Hydra.Variants as Variants-import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)-import qualified Data.Scientific as Sci-import Data.Void-import qualified Data.Map as M---- | DSL reference to hydra.environment.definitionAsTypeApplicationTerm-definitionAsTypeApplicationTerm :: Typed.TypedTerm Core.Binding -> Typed.TypedTerm (Either Errors.Error Core.TypeApplicationTerm)-definitionAsTypeApplicationTerm arg0 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.environment.definitionAsTypeApplicationTerm")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))---- | DSL reference to hydra.environment.graphAsLet-graphAsLet :: Typed.TypedTerm [Core.Binding] -> Typed.TypedTerm Core.Term -> Typed.TypedTerm Core.Let-graphAsLet arg0 arg1 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.environment.graphAsLet")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))---- | DSL reference to hydra.environment.graphAsTerm-graphAsTerm :: Typed.TypedTerm [Core.Binding] -> Typed.TypedTerm Core.Term -> Typed.TypedTerm Core.Term-graphAsTerm arg0 arg1 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.environment.graphAsTerm")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))---- | DSL reference to hydra.environment.graphAsTypes-graphAsTypes :: Typed.TypedTerm Graph.Graph -> Typed.TypedTerm [Core.Binding] -> Typed.TypedTerm (Either Errors.DecodingError (M.Map Core.Name Core.Type))-graphAsTypes arg0 arg1 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.environment.graphAsTypes")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))---- | DSL reference to hydra.environment.partitionDefinitions-partitionDefinitions :: Typed.TypedTerm [Packaging.Definition] -> Typed.TypedTerm ([Packaging.TypeDefinition], [Packaging.TermDefinition])-partitionDefinitions arg0 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.environment.partitionDefinitions")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))---- | DSL reference to hydra.environment.reorderDefs-reorderDefs :: Typed.TypedTerm [Packaging.Definition] -> Typed.TypedTerm [Packaging.Definition]-reorderDefs arg0 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.environment.reorderDefs")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))---- | DSL reference to hydra.environment.schemaGraphToTypingEnvironment-schemaGraphToTypingEnvironment :: Typed.TypedTerm Graph.Graph -> Typed.TypedTerm (Either Errors.Error (M.Map Core.Name Core.TypeScheme))-schemaGraphToTypingEnvironment arg0 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.environment.schemaGraphToTypingEnvironment")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))---- | DSL reference to hydra.environment.termAsBindings-termAsBindings :: Typed.TypedTerm Core.Term -> Typed.TypedTerm [Core.Binding]-termAsBindings arg0 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.environment.termAsBindings")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))---- | DSL reference to hydra.environment.typesToDefinitions-typesToDefinitions :: Typed.TypedTerm (M.Map Core.Name Core.Type) -> Typed.TypedTerm [Core.Binding]-typesToDefinitions arg0 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.environment.typesToDefinitions")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))---- | DSL reference to hydra.environment.withLambdaContext-withLambdaContext :: Typed.TypedTerm (t0 -> Graph.Graph) -> Typed.TypedTerm (Graph.Graph -> t0 -> t1) -> Typed.TypedTerm t0 -> Typed.TypedTerm Core.Lambda -> Typed.TypedTerm (t1 -> t2) -> Typed.TypedTerm t2-withLambdaContext arg0 arg1 arg2 arg3 arg4 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.environment.withLambdaContext")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)})),- Core.applicationArgument = (Typed.unTypedTerm arg2)})),- Core.applicationArgument = (Typed.unTypedTerm arg3)})),- Core.applicationArgument = (Typed.unTypedTerm arg4)}))---- | DSL reference to hydra.environment.withLetContext-withLetContext :: Typed.TypedTerm (t0 -> Graph.Graph) -> Typed.TypedTerm (Graph.Graph -> t0 -> t1) -> Typed.TypedTerm (Graph.Graph -> Core.Binding -> Maybe Core.Term) -> Typed.TypedTerm t0 -> Typed.TypedTerm Core.Let -> Typed.TypedTerm (t1 -> t2) -> Typed.TypedTerm t2-withLetContext arg0 arg1 arg2 arg3 arg4 arg5 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.environment.withLetContext")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)})),- Core.applicationArgument = (Typed.unTypedTerm arg2)})),- Core.applicationArgument = (Typed.unTypedTerm arg3)})),- Core.applicationArgument = (Typed.unTypedTerm arg4)})),- Core.applicationArgument = (Typed.unTypedTerm arg5)}))---- | DSL reference to hydra.environment.withTypeLambdaContext-withTypeLambdaContext :: Typed.TypedTerm (t0 -> Graph.Graph) -> Typed.TypedTerm (Graph.Graph -> t0 -> t1) -> Typed.TypedTerm t0 -> Typed.TypedTerm Core.TypeLambda -> Typed.TypedTerm (t1 -> t2) -> Typed.TypedTerm t2-withTypeLambdaContext arg0 arg1 arg2 arg3 arg4 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.environment.withTypeLambdaContext")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)})),- Core.applicationArgument = (Typed.unTypedTerm arg2)})),- Core.applicationArgument = (Typed.unTypedTerm arg3)})),- Core.applicationArgument = (Typed.unTypedTerm arg4)}))
@@ -1,957 +0,0 @@--- Note: this is an automatically generated file. Do not edit.---- | DSL functions for hydra.error.checking--module Hydra.Dsl.Error.Checking where--import qualified Hydra.Core as Core-import qualified Hydra.Decode.Error.Checking as DecodeErrorChecking-import qualified Hydra.Dsl.Core as DslCore-import qualified Hydra.Dsl.Paths as DslPaths-import qualified Hydra.Dsl.Typing as DslTyping-import qualified Hydra.Dsl.Variants as DslVariants-import qualified Hydra.Encode.Error.Checking as EncodeErrorChecking-import qualified Hydra.Error.Checking as Checking-import qualified Hydra.Paths as Paths-import qualified Hydra.Typed as Typed-import qualified Hydra.Typing as Typing-import qualified Hydra.Variants as Variants-import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)-import qualified Data.Scientific as Sci-import Data.Void-import qualified Data.Set as S---- | DSL name token for hydra.error.checking.CheckingError-checkingErrorCheckingError :: Typed.TypedName Checking.CheckingError-checkingErrorCheckingError = Typed.TypedName (Core.Name "hydra.error.checking.CheckingError")---- | DSL injection for the incorrectUnification variant of hydra.error.checking.CheckingError-checkingErrorIncorrectUnification :: Typed.TypedTerm Checking.IncorrectUnificationError -> Typed.TypedTerm Checking.CheckingError-checkingErrorIncorrectUnification x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.error.checking.CheckingError"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "incorrectUnification"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the notAForallType variant of hydra.error.checking.CheckingError-checkingErrorNotAForallType :: Typed.TypedTerm Checking.NotAForallTypeError -> Typed.TypedTerm Checking.CheckingError-checkingErrorNotAForallType x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.error.checking.CheckingError"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "notAForallType"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the notAFunctionType variant of hydra.error.checking.CheckingError-checkingErrorNotAFunctionType :: Typed.TypedTerm Checking.NotAFunctionTypeError -> Typed.TypedTerm Checking.CheckingError-checkingErrorNotAFunctionType x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.error.checking.CheckingError"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "notAFunctionType"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the other variant of hydra.error.checking.CheckingError-checkingErrorOther :: Typed.TypedTerm Checking.OtherCheckingError -> Typed.TypedTerm Checking.CheckingError-checkingErrorOther x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.error.checking.CheckingError"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "other"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the typeArityMismatch variant of hydra.error.checking.CheckingError-checkingErrorTypeArityMismatch :: Typed.TypedTerm Checking.TypeArityMismatchError -> Typed.TypedTerm Checking.CheckingError-checkingErrorTypeArityMismatch x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.error.checking.CheckingError"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "typeArityMismatch"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the typeMismatch variant of hydra.error.checking.CheckingError-checkingErrorTypeMismatch :: Typed.TypedTerm Checking.TypeMismatchError -> Typed.TypedTerm Checking.CheckingError-checkingErrorTypeMismatch x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.error.checking.CheckingError"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "typeMismatch"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the unboundTypeVariables variant of hydra.error.checking.CheckingError-checkingErrorUnboundTypeVariables :: Typed.TypedTerm Checking.UnboundTypeVariablesError -> Typed.TypedTerm Checking.CheckingError-checkingErrorUnboundTypeVariables x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.error.checking.CheckingError"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "unboundTypeVariables"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the undefinedTermVariable variant of hydra.error.checking.CheckingError-checkingErrorUndefinedTermVariable :: Typed.TypedTerm Checking.UndefinedTermVariableCheckingError -> Typed.TypedTerm Checking.CheckingError-checkingErrorUndefinedTermVariable x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.error.checking.CheckingError"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "undefinedTermVariable"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the unequalTypes variant of hydra.error.checking.CheckingError-checkingErrorUnequalTypes :: Typed.TypedTerm Checking.UnequalTypesError -> Typed.TypedTerm Checking.CheckingError-checkingErrorUnequalTypes x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.error.checking.CheckingError"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "unequalTypes"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the unsupportedTermVariant variant of hydra.error.checking.CheckingError-checkingErrorUnsupportedTermVariant :: Typed.TypedTerm Checking.UnsupportedTermVariantError -> Typed.TypedTerm Checking.CheckingError-checkingErrorUnsupportedTermVariant x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.error.checking.CheckingError"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "unsupportedTermVariant"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the untypedLambda variant of hydra.error.checking.CheckingError-checkingErrorUntypedLambda :: Typed.TypedTerm Checking.UntypedLambdaError -> Typed.TypedTerm Checking.CheckingError-checkingErrorUntypedLambda x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.error.checking.CheckingError"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "untypedLambda"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the untypedLetBinding variant of hydra.error.checking.CheckingError-checkingErrorUntypedLetBinding :: Typed.TypedTerm Checking.UntypedLetBindingError -> Typed.TypedTerm Checking.CheckingError-checkingErrorUntypedLetBinding x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.error.checking.CheckingError"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "untypedLetBinding"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the untypedTermVariable variant of hydra.error.checking.CheckingError-checkingErrorUntypedTermVariable :: Typed.TypedTerm Checking.UntypedTermVariableCheckingError -> Typed.TypedTerm Checking.CheckingError-checkingErrorUntypedTermVariable x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.error.checking.CheckingError"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "untypedTermVariable"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL constructor for hydra.error.checking.IncorrectUnificationError-incorrectUnificationError :: Typed.TypedTerm Typing.TypeSubst -> Typed.TypedTerm Checking.IncorrectUnificationError-incorrectUnificationError substitution =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.checking.IncorrectUnificationError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "substitution"),- Core.fieldTerm = (Typed.unTypedTerm substitution)}]}))---- | DSL name token for hydra.error.checking.IncorrectUnificationError-incorrectUnificationErrorIncorrectUnificationError :: Typed.TypedName Checking.IncorrectUnificationError-incorrectUnificationErrorIncorrectUnificationError =- Typed.TypedName (Core.Name "hydra.error.checking.IncorrectUnificationError")---- | DSL accessor for the substitution field of hydra.error.checking.IncorrectUnificationError-incorrectUnificationErrorSubstitution :: Typed.TypedTerm Checking.IncorrectUnificationError -> Typed.TypedTerm Typing.TypeSubst-incorrectUnificationErrorSubstitution x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.checking.IncorrectUnificationError"),- Core.projectionFieldName = (Core.Name "substitution")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL updater for the substitution field of hydra.error.checking.IncorrectUnificationError-incorrectUnificationErrorWithSubstitution :: Typed.TypedTerm Checking.IncorrectUnificationError -> Typed.TypedTerm Typing.TypeSubst -> Typed.TypedTerm Checking.IncorrectUnificationError-incorrectUnificationErrorWithSubstitution original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.checking.IncorrectUnificationError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "substitution"),- Core.fieldTerm = (Typed.unTypedTerm newVal)}]}))---- | DSL constructor for hydra.error.checking.NotAForallTypeError-notAForallTypeError :: Typed.TypedTerm Core.Type -> Typed.TypedTerm [Core.Type] -> Typed.TypedTerm Checking.NotAForallTypeError-notAForallTypeError type_ typeArguments =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.checking.NotAForallTypeError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "type"),- Core.fieldTerm = (Typed.unTypedTerm type_)},- Core.Field {- Core.fieldName = (Core.Name "typeArguments"),- Core.fieldTerm = (Typed.unTypedTerm typeArguments)}]}))---- | DSL name token for hydra.error.checking.NotAForallTypeError-notAForallTypeErrorNotAForallTypeError :: Typed.TypedName Checking.NotAForallTypeError-notAForallTypeErrorNotAForallTypeError = Typed.TypedName (Core.Name "hydra.error.checking.NotAForallTypeError")---- | DSL accessor for the type field of hydra.error.checking.NotAForallTypeError-notAForallTypeErrorType :: Typed.TypedTerm Checking.NotAForallTypeError -> Typed.TypedTerm Core.Type-notAForallTypeErrorType x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.checking.NotAForallTypeError"),- Core.projectionFieldName = (Core.Name "type")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL accessor for the typeArguments field of hydra.error.checking.NotAForallTypeError-notAForallTypeErrorTypeArguments :: Typed.TypedTerm Checking.NotAForallTypeError -> Typed.TypedTerm [Core.Type]-notAForallTypeErrorTypeArguments x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.checking.NotAForallTypeError"),- Core.projectionFieldName = (Core.Name "typeArguments")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL updater for the type field of hydra.error.checking.NotAForallTypeError-notAForallTypeErrorWithType :: Typed.TypedTerm Checking.NotAForallTypeError -> Typed.TypedTerm Core.Type -> Typed.TypedTerm Checking.NotAForallTypeError-notAForallTypeErrorWithType original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.checking.NotAForallTypeError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "type"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "typeArguments"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.checking.NotAForallTypeError"),- Core.projectionFieldName = (Core.Name "typeArguments")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL updater for the typeArguments field of hydra.error.checking.NotAForallTypeError-notAForallTypeErrorWithTypeArguments :: Typed.TypedTerm Checking.NotAForallTypeError -> Typed.TypedTerm [Core.Type] -> Typed.TypedTerm Checking.NotAForallTypeError-notAForallTypeErrorWithTypeArguments original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.checking.NotAForallTypeError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "type"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.checking.NotAForallTypeError"),- Core.projectionFieldName = (Core.Name "type")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "typeArguments"),- Core.fieldTerm = (Typed.unTypedTerm newVal)}]}))---- | DSL constructor for hydra.error.checking.NotAFunctionTypeError-notAFunctionTypeError :: Typed.TypedTerm Core.Type -> Typed.TypedTerm Checking.NotAFunctionTypeError-notAFunctionTypeError type_ =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.checking.NotAFunctionTypeError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "type"),- Core.fieldTerm = (Typed.unTypedTerm type_)}]}))---- | DSL name token for hydra.error.checking.NotAFunctionTypeError-notAFunctionTypeErrorNotAFunctionTypeError :: Typed.TypedName Checking.NotAFunctionTypeError-notAFunctionTypeErrorNotAFunctionTypeError = Typed.TypedName (Core.Name "hydra.error.checking.NotAFunctionTypeError")---- | DSL accessor for the type field of hydra.error.checking.NotAFunctionTypeError-notAFunctionTypeErrorType :: Typed.TypedTerm Checking.NotAFunctionTypeError -> Typed.TypedTerm Core.Type-notAFunctionTypeErrorType x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.checking.NotAFunctionTypeError"),- Core.projectionFieldName = (Core.Name "type")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL updater for the type field of hydra.error.checking.NotAFunctionTypeError-notAFunctionTypeErrorWithType :: Typed.TypedTerm Checking.NotAFunctionTypeError -> Typed.TypedTerm Core.Type -> Typed.TypedTerm Checking.NotAFunctionTypeError-notAFunctionTypeErrorWithType original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.checking.NotAFunctionTypeError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "type"),- Core.fieldTerm = (Typed.unTypedTerm newVal)}]}))---- | DSL constructor for hydra.error.checking.OtherCheckingError-otherCheckingError :: Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm String -> Typed.TypedTerm Checking.OtherCheckingError-otherCheckingError path message =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.checking.OtherCheckingError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "path"),- Core.fieldTerm = (Typed.unTypedTerm path)},- Core.Field {- Core.fieldName = (Core.Name "message"),- Core.fieldTerm = (Typed.unTypedTerm message)}]}))---- | DSL accessor for the message field of hydra.error.checking.OtherCheckingError-otherCheckingErrorMessage :: Typed.TypedTerm Checking.OtherCheckingError -> Typed.TypedTerm String-otherCheckingErrorMessage x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.checking.OtherCheckingError"),- Core.projectionFieldName = (Core.Name "message")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL name token for hydra.error.checking.OtherCheckingError-otherCheckingErrorOtherCheckingError :: Typed.TypedName Checking.OtherCheckingError-otherCheckingErrorOtherCheckingError = Typed.TypedName (Core.Name "hydra.error.checking.OtherCheckingError")---- | DSL accessor for the path field of hydra.error.checking.OtherCheckingError-otherCheckingErrorPath :: Typed.TypedTerm Checking.OtherCheckingError -> Typed.TypedTerm Paths.SubtermPath-otherCheckingErrorPath x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.checking.OtherCheckingError"),- Core.projectionFieldName = (Core.Name "path")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL updater for the message field of hydra.error.checking.OtherCheckingError-otherCheckingErrorWithMessage :: Typed.TypedTerm Checking.OtherCheckingError -> Typed.TypedTerm String -> Typed.TypedTerm Checking.OtherCheckingError-otherCheckingErrorWithMessage original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.checking.OtherCheckingError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "path"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.checking.OtherCheckingError"),- Core.projectionFieldName = (Core.Name "path")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "message"),- Core.fieldTerm = (Typed.unTypedTerm newVal)}]}))---- | DSL updater for the path field of hydra.error.checking.OtherCheckingError-otherCheckingErrorWithPath :: Typed.TypedTerm Checking.OtherCheckingError -> Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm Checking.OtherCheckingError-otherCheckingErrorWithPath original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.checking.OtherCheckingError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "path"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "message"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.checking.OtherCheckingError"),- Core.projectionFieldName = (Core.Name "message")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL constructor for hydra.error.checking.TypeArityMismatchError-typeArityMismatchError :: Typed.TypedTerm Core.Type -> Typed.TypedTerm Int -> Typed.TypedTerm Int -> Typed.TypedTerm [Core.Type] -> Typed.TypedTerm Checking.TypeArityMismatchError-typeArityMismatchError type_ expectedArity actualArity typeArguments =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.checking.TypeArityMismatchError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "type"),- Core.fieldTerm = (Typed.unTypedTerm type_)},- Core.Field {- Core.fieldName = (Core.Name "expectedArity"),- Core.fieldTerm = (Typed.unTypedTerm expectedArity)},- Core.Field {- Core.fieldName = (Core.Name "actualArity"),- Core.fieldTerm = (Typed.unTypedTerm actualArity)},- Core.Field {- Core.fieldName = (Core.Name "typeArguments"),- Core.fieldTerm = (Typed.unTypedTerm typeArguments)}]}))---- | DSL accessor for the actualArity field of hydra.error.checking.TypeArityMismatchError-typeArityMismatchErrorActualArity :: Typed.TypedTerm Checking.TypeArityMismatchError -> Typed.TypedTerm Int-typeArityMismatchErrorActualArity x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.checking.TypeArityMismatchError"),- Core.projectionFieldName = (Core.Name "actualArity")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL accessor for the expectedArity field of hydra.error.checking.TypeArityMismatchError-typeArityMismatchErrorExpectedArity :: Typed.TypedTerm Checking.TypeArityMismatchError -> Typed.TypedTerm Int-typeArityMismatchErrorExpectedArity x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.checking.TypeArityMismatchError"),- Core.projectionFieldName = (Core.Name "expectedArity")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL accessor for the type field of hydra.error.checking.TypeArityMismatchError-typeArityMismatchErrorType :: Typed.TypedTerm Checking.TypeArityMismatchError -> Typed.TypedTerm Core.Type-typeArityMismatchErrorType x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.checking.TypeArityMismatchError"),- Core.projectionFieldName = (Core.Name "type")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL accessor for the typeArguments field of hydra.error.checking.TypeArityMismatchError-typeArityMismatchErrorTypeArguments :: Typed.TypedTerm Checking.TypeArityMismatchError -> Typed.TypedTerm [Core.Type]-typeArityMismatchErrorTypeArguments x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.checking.TypeArityMismatchError"),- Core.projectionFieldName = (Core.Name "typeArguments")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL name token for hydra.error.checking.TypeArityMismatchError-typeArityMismatchErrorTypeArityMismatchError :: Typed.TypedName Checking.TypeArityMismatchError-typeArityMismatchErrorTypeArityMismatchError = Typed.TypedName (Core.Name "hydra.error.checking.TypeArityMismatchError")---- | DSL updater for the actualArity field of hydra.error.checking.TypeArityMismatchError-typeArityMismatchErrorWithActualArity :: Typed.TypedTerm Checking.TypeArityMismatchError -> Typed.TypedTerm Int -> Typed.TypedTerm Checking.TypeArityMismatchError-typeArityMismatchErrorWithActualArity original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.checking.TypeArityMismatchError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "type"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.checking.TypeArityMismatchError"),- Core.projectionFieldName = (Core.Name "type")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "expectedArity"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.checking.TypeArityMismatchError"),- Core.projectionFieldName = (Core.Name "expectedArity")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "actualArity"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "typeArguments"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.checking.TypeArityMismatchError"),- Core.projectionFieldName = (Core.Name "typeArguments")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL updater for the expectedArity field of hydra.error.checking.TypeArityMismatchError-typeArityMismatchErrorWithExpectedArity :: Typed.TypedTerm Checking.TypeArityMismatchError -> Typed.TypedTerm Int -> Typed.TypedTerm Checking.TypeArityMismatchError-typeArityMismatchErrorWithExpectedArity original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.checking.TypeArityMismatchError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "type"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.checking.TypeArityMismatchError"),- Core.projectionFieldName = (Core.Name "type")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "expectedArity"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "actualArity"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.checking.TypeArityMismatchError"),- Core.projectionFieldName = (Core.Name "actualArity")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "typeArguments"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.checking.TypeArityMismatchError"),- Core.projectionFieldName = (Core.Name "typeArguments")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL updater for the type field of hydra.error.checking.TypeArityMismatchError-typeArityMismatchErrorWithType :: Typed.TypedTerm Checking.TypeArityMismatchError -> Typed.TypedTerm Core.Type -> Typed.TypedTerm Checking.TypeArityMismatchError-typeArityMismatchErrorWithType original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.checking.TypeArityMismatchError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "type"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "expectedArity"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.checking.TypeArityMismatchError"),- Core.projectionFieldName = (Core.Name "expectedArity")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "actualArity"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.checking.TypeArityMismatchError"),- Core.projectionFieldName = (Core.Name "actualArity")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "typeArguments"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.checking.TypeArityMismatchError"),- Core.projectionFieldName = (Core.Name "typeArguments")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL updater for the typeArguments field of hydra.error.checking.TypeArityMismatchError-typeArityMismatchErrorWithTypeArguments :: Typed.TypedTerm Checking.TypeArityMismatchError -> Typed.TypedTerm [Core.Type] -> Typed.TypedTerm Checking.TypeArityMismatchError-typeArityMismatchErrorWithTypeArguments original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.checking.TypeArityMismatchError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "type"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.checking.TypeArityMismatchError"),- Core.projectionFieldName = (Core.Name "type")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "expectedArity"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.checking.TypeArityMismatchError"),- Core.projectionFieldName = (Core.Name "expectedArity")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "actualArity"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.checking.TypeArityMismatchError"),- Core.projectionFieldName = (Core.Name "actualArity")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "typeArguments"),- Core.fieldTerm = (Typed.unTypedTerm newVal)}]}))---- | DSL constructor for hydra.error.checking.TypeMismatchError-typeMismatchError :: Typed.TypedTerm Core.Type -> Typed.TypedTerm Core.Type -> Typed.TypedTerm Checking.TypeMismatchError-typeMismatchError expectedType actualType =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.checking.TypeMismatchError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "expectedType"),- Core.fieldTerm = (Typed.unTypedTerm expectedType)},- Core.Field {- Core.fieldName = (Core.Name "actualType"),- Core.fieldTerm = (Typed.unTypedTerm actualType)}]}))---- | DSL accessor for the actualType field of hydra.error.checking.TypeMismatchError-typeMismatchErrorActualType :: Typed.TypedTerm Checking.TypeMismatchError -> Typed.TypedTerm Core.Type-typeMismatchErrorActualType x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.checking.TypeMismatchError"),- Core.projectionFieldName = (Core.Name "actualType")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL accessor for the expectedType field of hydra.error.checking.TypeMismatchError-typeMismatchErrorExpectedType :: Typed.TypedTerm Checking.TypeMismatchError -> Typed.TypedTerm Core.Type-typeMismatchErrorExpectedType x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.checking.TypeMismatchError"),- Core.projectionFieldName = (Core.Name "expectedType")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL name token for hydra.error.checking.TypeMismatchError-typeMismatchErrorTypeMismatchError :: Typed.TypedName Checking.TypeMismatchError-typeMismatchErrorTypeMismatchError = Typed.TypedName (Core.Name "hydra.error.checking.TypeMismatchError")---- | DSL updater for the actualType field of hydra.error.checking.TypeMismatchError-typeMismatchErrorWithActualType :: Typed.TypedTerm Checking.TypeMismatchError -> Typed.TypedTerm Core.Type -> Typed.TypedTerm Checking.TypeMismatchError-typeMismatchErrorWithActualType original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.checking.TypeMismatchError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "expectedType"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.checking.TypeMismatchError"),- Core.projectionFieldName = (Core.Name "expectedType")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "actualType"),- Core.fieldTerm = (Typed.unTypedTerm newVal)}]}))---- | DSL updater for the expectedType field of hydra.error.checking.TypeMismatchError-typeMismatchErrorWithExpectedType :: Typed.TypedTerm Checking.TypeMismatchError -> Typed.TypedTerm Core.Type -> Typed.TypedTerm Checking.TypeMismatchError-typeMismatchErrorWithExpectedType original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.checking.TypeMismatchError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "expectedType"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "actualType"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.checking.TypeMismatchError"),- Core.projectionFieldName = (Core.Name "actualType")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL constructor for hydra.error.checking.UnboundTypeVariablesError-unboundTypeVariablesError :: Typed.TypedTerm (S.Set Core.Name) -> Typed.TypedTerm Core.Type -> Typed.TypedTerm Checking.UnboundTypeVariablesError-unboundTypeVariablesError variables type_ =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.checking.UnboundTypeVariablesError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "variables"),- Core.fieldTerm = (Typed.unTypedTerm variables)},- Core.Field {- Core.fieldName = (Core.Name "type"),- Core.fieldTerm = (Typed.unTypedTerm type_)}]}))---- | DSL accessor for the type field of hydra.error.checking.UnboundTypeVariablesError-unboundTypeVariablesErrorType :: Typed.TypedTerm Checking.UnboundTypeVariablesError -> Typed.TypedTerm Core.Type-unboundTypeVariablesErrorType x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.checking.UnboundTypeVariablesError"),- Core.projectionFieldName = (Core.Name "type")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL name token for hydra.error.checking.UnboundTypeVariablesError-unboundTypeVariablesErrorUnboundTypeVariablesError :: Typed.TypedName Checking.UnboundTypeVariablesError-unboundTypeVariablesErrorUnboundTypeVariablesError =- Typed.TypedName (Core.Name "hydra.error.checking.UnboundTypeVariablesError")---- | DSL accessor for the variables field of hydra.error.checking.UnboundTypeVariablesError-unboundTypeVariablesErrorVariables :: Typed.TypedTerm Checking.UnboundTypeVariablesError -> Typed.TypedTerm (S.Set Core.Name)-unboundTypeVariablesErrorVariables x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.checking.UnboundTypeVariablesError"),- Core.projectionFieldName = (Core.Name "variables")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL updater for the type field of hydra.error.checking.UnboundTypeVariablesError-unboundTypeVariablesErrorWithType :: Typed.TypedTerm Checking.UnboundTypeVariablesError -> Typed.TypedTerm Core.Type -> Typed.TypedTerm Checking.UnboundTypeVariablesError-unboundTypeVariablesErrorWithType original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.checking.UnboundTypeVariablesError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "variables"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.checking.UnboundTypeVariablesError"),- Core.projectionFieldName = (Core.Name "variables")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "type"),- Core.fieldTerm = (Typed.unTypedTerm newVal)}]}))---- | DSL updater for the variables field of hydra.error.checking.UnboundTypeVariablesError-unboundTypeVariablesErrorWithVariables :: Typed.TypedTerm Checking.UnboundTypeVariablesError -> Typed.TypedTerm (S.Set Core.Name) -> Typed.TypedTerm Checking.UnboundTypeVariablesError-unboundTypeVariablesErrorWithVariables original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.checking.UnboundTypeVariablesError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "variables"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "type"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.checking.UnboundTypeVariablesError"),- Core.projectionFieldName = (Core.Name "type")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL constructor for hydra.error.checking.UndefinedTermVariableCheckingError-undefinedTermVariableCheckingError :: Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm Core.Name -> Typed.TypedTerm Checking.UndefinedTermVariableCheckingError-undefinedTermVariableCheckingError path name =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.checking.UndefinedTermVariableCheckingError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "path"),- Core.fieldTerm = (Typed.unTypedTerm path)},- Core.Field {- Core.fieldName = (Core.Name "name"),- Core.fieldTerm = (Typed.unTypedTerm name)}]}))---- | DSL accessor for the name field of hydra.error.checking.UndefinedTermVariableCheckingError-undefinedTermVariableCheckingErrorName :: Typed.TypedTerm Checking.UndefinedTermVariableCheckingError -> Typed.TypedTerm Core.Name-undefinedTermVariableCheckingErrorName x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.checking.UndefinedTermVariableCheckingError"),- Core.projectionFieldName = (Core.Name "name")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL accessor for the path field of hydra.error.checking.UndefinedTermVariableCheckingError-undefinedTermVariableCheckingErrorPath :: Typed.TypedTerm Checking.UndefinedTermVariableCheckingError -> Typed.TypedTerm Paths.SubtermPath-undefinedTermVariableCheckingErrorPath x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.checking.UndefinedTermVariableCheckingError"),- Core.projectionFieldName = (Core.Name "path")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL name token for hydra.error.checking.UndefinedTermVariableCheckingError-undefinedTermVariableCheckingErrorUndefinedTermVariableCheckingError :: Typed.TypedName Checking.UndefinedTermVariableCheckingError-undefinedTermVariableCheckingErrorUndefinedTermVariableCheckingError =- Typed.TypedName (Core.Name "hydra.error.checking.UndefinedTermVariableCheckingError")---- | DSL updater for the name field of hydra.error.checking.UndefinedTermVariableCheckingError-undefinedTermVariableCheckingErrorWithName :: Typed.TypedTerm Checking.UndefinedTermVariableCheckingError -> Typed.TypedTerm Core.Name -> Typed.TypedTerm Checking.UndefinedTermVariableCheckingError-undefinedTermVariableCheckingErrorWithName original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.checking.UndefinedTermVariableCheckingError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "path"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.checking.UndefinedTermVariableCheckingError"),- Core.projectionFieldName = (Core.Name "path")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "name"),- Core.fieldTerm = (Typed.unTypedTerm newVal)}]}))---- | DSL updater for the path field of hydra.error.checking.UndefinedTermVariableCheckingError-undefinedTermVariableCheckingErrorWithPath :: Typed.TypedTerm Checking.UndefinedTermVariableCheckingError -> Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm Checking.UndefinedTermVariableCheckingError-undefinedTermVariableCheckingErrorWithPath original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.checking.UndefinedTermVariableCheckingError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "path"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "name"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.checking.UndefinedTermVariableCheckingError"),- Core.projectionFieldName = (Core.Name "name")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL constructor for hydra.error.checking.UnequalTypesError-unequalTypesError :: Typed.TypedTerm [Core.Type] -> Typed.TypedTerm String -> Typed.TypedTerm Checking.UnequalTypesError-unequalTypesError types description =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.checking.UnequalTypesError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "types"),- Core.fieldTerm = (Typed.unTypedTerm types)},- Core.Field {- Core.fieldName = (Core.Name "description"),- Core.fieldTerm = (Typed.unTypedTerm description)}]}))---- | DSL accessor for the description field of hydra.error.checking.UnequalTypesError-unequalTypesErrorDescription :: Typed.TypedTerm Checking.UnequalTypesError -> Typed.TypedTerm String-unequalTypesErrorDescription x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.checking.UnequalTypesError"),- Core.projectionFieldName = (Core.Name "description")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL accessor for the types field of hydra.error.checking.UnequalTypesError-unequalTypesErrorTypes :: Typed.TypedTerm Checking.UnequalTypesError -> Typed.TypedTerm [Core.Type]-unequalTypesErrorTypes x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.checking.UnequalTypesError"),- Core.projectionFieldName = (Core.Name "types")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL name token for hydra.error.checking.UnequalTypesError-unequalTypesErrorUnequalTypesError :: Typed.TypedName Checking.UnequalTypesError-unequalTypesErrorUnequalTypesError = Typed.TypedName (Core.Name "hydra.error.checking.UnequalTypesError")---- | DSL updater for the description field of hydra.error.checking.UnequalTypesError-unequalTypesErrorWithDescription :: Typed.TypedTerm Checking.UnequalTypesError -> Typed.TypedTerm String -> Typed.TypedTerm Checking.UnequalTypesError-unequalTypesErrorWithDescription original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.checking.UnequalTypesError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "types"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.checking.UnequalTypesError"),- Core.projectionFieldName = (Core.Name "types")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "description"),- Core.fieldTerm = (Typed.unTypedTerm newVal)}]}))---- | DSL updater for the types field of hydra.error.checking.UnequalTypesError-unequalTypesErrorWithTypes :: Typed.TypedTerm Checking.UnequalTypesError -> Typed.TypedTerm [Core.Type] -> Typed.TypedTerm Checking.UnequalTypesError-unequalTypesErrorWithTypes original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.checking.UnequalTypesError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "types"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "description"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.checking.UnequalTypesError"),- Core.projectionFieldName = (Core.Name "description")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL constructor for hydra.error.checking.UnsupportedTermVariantError-unsupportedTermVariantError :: Typed.TypedTerm Variants.TermVariant -> Typed.TypedTerm Checking.UnsupportedTermVariantError-unsupportedTermVariantError termVariant =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.checking.UnsupportedTermVariantError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "termVariant"),- Core.fieldTerm = (Typed.unTypedTerm termVariant)}]}))---- | DSL accessor for the termVariant field of hydra.error.checking.UnsupportedTermVariantError-unsupportedTermVariantErrorTermVariant :: Typed.TypedTerm Checking.UnsupportedTermVariantError -> Typed.TypedTerm Variants.TermVariant-unsupportedTermVariantErrorTermVariant x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.checking.UnsupportedTermVariantError"),- Core.projectionFieldName = (Core.Name "termVariant")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL name token for hydra.error.checking.UnsupportedTermVariantError-unsupportedTermVariantErrorUnsupportedTermVariantError :: Typed.TypedName Checking.UnsupportedTermVariantError-unsupportedTermVariantErrorUnsupportedTermVariantError =- Typed.TypedName (Core.Name "hydra.error.checking.UnsupportedTermVariantError")---- | DSL updater for the termVariant field of hydra.error.checking.UnsupportedTermVariantError-unsupportedTermVariantErrorWithTermVariant :: Typed.TypedTerm Checking.UnsupportedTermVariantError -> Typed.TypedTerm Variants.TermVariant -> Typed.TypedTerm Checking.UnsupportedTermVariantError-unsupportedTermVariantErrorWithTermVariant original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.checking.UnsupportedTermVariantError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "termVariant"),- Core.fieldTerm = (Typed.unTypedTerm newVal)}]}))---- | DSL constructor for hydra.error.checking.UntypedLambdaError-untypedLambdaError :: Typed.TypedTerm Checking.UntypedLambdaError-untypedLambdaError =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.checking.UntypedLambdaError"),- Core.recordFields = []}))---- | DSL name token for hydra.error.checking.UntypedLambdaError-untypedLambdaErrorUntypedLambdaError :: Typed.TypedName Checking.UntypedLambdaError-untypedLambdaErrorUntypedLambdaError = Typed.TypedName (Core.Name "hydra.error.checking.UntypedLambdaError")---- | DSL constructor for hydra.error.checking.UntypedLetBindingError-untypedLetBindingError :: Typed.TypedTerm Core.Binding -> Typed.TypedTerm Checking.UntypedLetBindingError-untypedLetBindingError binding =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.checking.UntypedLetBindingError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "binding"),- Core.fieldTerm = (Typed.unTypedTerm binding)}]}))---- | DSL accessor for the binding field of hydra.error.checking.UntypedLetBindingError-untypedLetBindingErrorBinding :: Typed.TypedTerm Checking.UntypedLetBindingError -> Typed.TypedTerm Core.Binding-untypedLetBindingErrorBinding x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.checking.UntypedLetBindingError"),- Core.projectionFieldName = (Core.Name "binding")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL name token for hydra.error.checking.UntypedLetBindingError-untypedLetBindingErrorUntypedLetBindingError :: Typed.TypedName Checking.UntypedLetBindingError-untypedLetBindingErrorUntypedLetBindingError = Typed.TypedName (Core.Name "hydra.error.checking.UntypedLetBindingError")---- | DSL updater for the binding field of hydra.error.checking.UntypedLetBindingError-untypedLetBindingErrorWithBinding :: Typed.TypedTerm Checking.UntypedLetBindingError -> Typed.TypedTerm Core.Binding -> Typed.TypedTerm Checking.UntypedLetBindingError-untypedLetBindingErrorWithBinding original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.checking.UntypedLetBindingError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "binding"),- Core.fieldTerm = (Typed.unTypedTerm newVal)}]}))---- | DSL constructor for hydra.error.checking.UntypedTermVariableCheckingError-untypedTermVariableCheckingError :: Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm Core.Name -> Typed.TypedTerm Checking.UntypedTermVariableCheckingError-untypedTermVariableCheckingError path name =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.checking.UntypedTermVariableCheckingError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "path"),- Core.fieldTerm = (Typed.unTypedTerm path)},- Core.Field {- Core.fieldName = (Core.Name "name"),- Core.fieldTerm = (Typed.unTypedTerm name)}]}))---- | DSL accessor for the name field of hydra.error.checking.UntypedTermVariableCheckingError-untypedTermVariableCheckingErrorName :: Typed.TypedTerm Checking.UntypedTermVariableCheckingError -> Typed.TypedTerm Core.Name-untypedTermVariableCheckingErrorName x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.checking.UntypedTermVariableCheckingError"),- Core.projectionFieldName = (Core.Name "name")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL accessor for the path field of hydra.error.checking.UntypedTermVariableCheckingError-untypedTermVariableCheckingErrorPath :: Typed.TypedTerm Checking.UntypedTermVariableCheckingError -> Typed.TypedTerm Paths.SubtermPath-untypedTermVariableCheckingErrorPath x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.checking.UntypedTermVariableCheckingError"),- Core.projectionFieldName = (Core.Name "path")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL name token for hydra.error.checking.UntypedTermVariableCheckingError-untypedTermVariableCheckingErrorUntypedTermVariableCheckingError :: Typed.TypedName Checking.UntypedTermVariableCheckingError-untypedTermVariableCheckingErrorUntypedTermVariableCheckingError =- Typed.TypedName (Core.Name "hydra.error.checking.UntypedTermVariableCheckingError")---- | DSL updater for the name field of hydra.error.checking.UntypedTermVariableCheckingError-untypedTermVariableCheckingErrorWithName :: Typed.TypedTerm Checking.UntypedTermVariableCheckingError -> Typed.TypedTerm Core.Name -> Typed.TypedTerm Checking.UntypedTermVariableCheckingError-untypedTermVariableCheckingErrorWithName original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.checking.UntypedTermVariableCheckingError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "path"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.checking.UntypedTermVariableCheckingError"),- Core.projectionFieldName = (Core.Name "path")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "name"),- Core.fieldTerm = (Typed.unTypedTerm newVal)}]}))---- | DSL updater for the path field of hydra.error.checking.UntypedTermVariableCheckingError-untypedTermVariableCheckingErrorWithPath :: Typed.TypedTerm Checking.UntypedTermVariableCheckingError -> Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm Checking.UntypedTermVariableCheckingError-untypedTermVariableCheckingErrorWithPath original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.checking.UntypedTermVariableCheckingError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "path"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "name"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.checking.UntypedTermVariableCheckingError"),- Core.projectionFieldName = (Core.Name "name")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))
@@ -1,3830 +0,0 @@--- Note: this is an automatically generated file. Do not edit.---- | DSL functions for hydra.error.core--module Hydra.Dsl.Error.Core where--import qualified Hydra.Core as Core-import qualified Hydra.Decode.Error.Core as DecodeErrorCore-import qualified Hydra.Dsl.Core as DslCore-import qualified Hydra.Dsl.Paths as DslPaths-import qualified Hydra.Dsl.Variants as DslVariants-import qualified Hydra.Encode.Error.Core as EncodeErrorCore-import qualified Hydra.Error.Core as ErrorCore-import qualified Hydra.Paths as Paths-import qualified Hydra.Typed as Typed-import qualified Hydra.Variants as Variants-import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)-import qualified Data.Scientific as Sci-import Data.Void---- | DSL constructor for hydra.error.core.ConstantConditionError-constantConditionError :: Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm Bool -> Typed.TypedTerm ErrorCore.ConstantConditionError-constantConditionError location value =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.core.ConstantConditionError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "location"),- Core.fieldTerm = (Typed.unTypedTerm location)},- Core.Field {- Core.fieldName = (Core.Name "value"),- Core.fieldTerm = (Typed.unTypedTerm value)}]}))---- | DSL name token for hydra.error.core.ConstantConditionError-constantConditionErrorConstantConditionError :: Typed.TypedName ErrorCore.ConstantConditionError-constantConditionErrorConstantConditionError = Typed.TypedName (Core.Name "hydra.error.core.ConstantConditionError")---- | DSL accessor for the location field of hydra.error.core.ConstantConditionError-constantConditionErrorLocation :: Typed.TypedTerm ErrorCore.ConstantConditionError -> Typed.TypedTerm Paths.SubtermPath-constantConditionErrorLocation x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.ConstantConditionError"),- Core.projectionFieldName = (Core.Name "location")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL accessor for the value field of hydra.error.core.ConstantConditionError-constantConditionErrorValue :: Typed.TypedTerm ErrorCore.ConstantConditionError -> Typed.TypedTerm Bool-constantConditionErrorValue x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.ConstantConditionError"),- Core.projectionFieldName = (Core.Name "value")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL updater for the location field of hydra.error.core.ConstantConditionError-constantConditionErrorWithLocation :: Typed.TypedTerm ErrorCore.ConstantConditionError -> Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm ErrorCore.ConstantConditionError-constantConditionErrorWithLocation original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.core.ConstantConditionError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "location"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "value"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.ConstantConditionError"),- Core.projectionFieldName = (Core.Name "value")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL updater for the value field of hydra.error.core.ConstantConditionError-constantConditionErrorWithValue :: Typed.TypedTerm ErrorCore.ConstantConditionError -> Typed.TypedTerm Bool -> Typed.TypedTerm ErrorCore.ConstantConditionError-constantConditionErrorWithValue original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.core.ConstantConditionError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "location"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.ConstantConditionError"),- Core.projectionFieldName = (Core.Name "location")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "value"),- Core.fieldTerm = (Typed.unTypedTerm newVal)}]}))---- | DSL constructor for hydra.error.core.DuplicateBindingError-duplicateBindingError :: Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm Core.Name -> Typed.TypedTerm ErrorCore.DuplicateBindingError-duplicateBindingError location name =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.core.DuplicateBindingError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "location"),- Core.fieldTerm = (Typed.unTypedTerm location)},- Core.Field {- Core.fieldName = (Core.Name "name"),- Core.fieldTerm = (Typed.unTypedTerm name)}]}))---- | DSL name token for hydra.error.core.DuplicateBindingError-duplicateBindingErrorDuplicateBindingError :: Typed.TypedName ErrorCore.DuplicateBindingError-duplicateBindingErrorDuplicateBindingError = Typed.TypedName (Core.Name "hydra.error.core.DuplicateBindingError")---- | DSL accessor for the location field of hydra.error.core.DuplicateBindingError-duplicateBindingErrorLocation :: Typed.TypedTerm ErrorCore.DuplicateBindingError -> Typed.TypedTerm Paths.SubtermPath-duplicateBindingErrorLocation x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.DuplicateBindingError"),- Core.projectionFieldName = (Core.Name "location")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL accessor for the name field of hydra.error.core.DuplicateBindingError-duplicateBindingErrorName :: Typed.TypedTerm ErrorCore.DuplicateBindingError -> Typed.TypedTerm Core.Name-duplicateBindingErrorName x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.DuplicateBindingError"),- Core.projectionFieldName = (Core.Name "name")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL updater for the location field of hydra.error.core.DuplicateBindingError-duplicateBindingErrorWithLocation :: Typed.TypedTerm ErrorCore.DuplicateBindingError -> Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm ErrorCore.DuplicateBindingError-duplicateBindingErrorWithLocation original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.core.DuplicateBindingError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "location"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "name"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.DuplicateBindingError"),- Core.projectionFieldName = (Core.Name "name")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL updater for the name field of hydra.error.core.DuplicateBindingError-duplicateBindingErrorWithName :: Typed.TypedTerm ErrorCore.DuplicateBindingError -> Typed.TypedTerm Core.Name -> Typed.TypedTerm ErrorCore.DuplicateBindingError-duplicateBindingErrorWithName original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.core.DuplicateBindingError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "location"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.DuplicateBindingError"),- Core.projectionFieldName = (Core.Name "location")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "name"),- Core.fieldTerm = (Typed.unTypedTerm newVal)}]}))---- | DSL constructor for hydra.error.core.DuplicateFieldError-duplicateFieldError :: Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm Core.Name -> Typed.TypedTerm ErrorCore.DuplicateFieldError-duplicateFieldError location name =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.core.DuplicateFieldError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "location"),- Core.fieldTerm = (Typed.unTypedTerm location)},- Core.Field {- Core.fieldName = (Core.Name "name"),- Core.fieldTerm = (Typed.unTypedTerm name)}]}))---- | DSL name token for hydra.error.core.DuplicateFieldError-duplicateFieldErrorDuplicateFieldError :: Typed.TypedName ErrorCore.DuplicateFieldError-duplicateFieldErrorDuplicateFieldError = Typed.TypedName (Core.Name "hydra.error.core.DuplicateFieldError")---- | DSL accessor for the location field of hydra.error.core.DuplicateFieldError-duplicateFieldErrorLocation :: Typed.TypedTerm ErrorCore.DuplicateFieldError -> Typed.TypedTerm Paths.SubtermPath-duplicateFieldErrorLocation x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.DuplicateFieldError"),- Core.projectionFieldName = (Core.Name "location")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL accessor for the name field of hydra.error.core.DuplicateFieldError-duplicateFieldErrorName :: Typed.TypedTerm ErrorCore.DuplicateFieldError -> Typed.TypedTerm Core.Name-duplicateFieldErrorName x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.DuplicateFieldError"),- Core.projectionFieldName = (Core.Name "name")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL updater for the location field of hydra.error.core.DuplicateFieldError-duplicateFieldErrorWithLocation :: Typed.TypedTerm ErrorCore.DuplicateFieldError -> Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm ErrorCore.DuplicateFieldError-duplicateFieldErrorWithLocation original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.core.DuplicateFieldError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "location"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "name"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.DuplicateFieldError"),- Core.projectionFieldName = (Core.Name "name")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL updater for the name field of hydra.error.core.DuplicateFieldError-duplicateFieldErrorWithName :: Typed.TypedTerm ErrorCore.DuplicateFieldError -> Typed.TypedTerm Core.Name -> Typed.TypedTerm ErrorCore.DuplicateFieldError-duplicateFieldErrorWithName original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.core.DuplicateFieldError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "location"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.DuplicateFieldError"),- Core.projectionFieldName = (Core.Name "location")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "name"),- Core.fieldTerm = (Typed.unTypedTerm newVal)}]}))---- | DSL constructor for hydra.error.core.DuplicateRecordTypeFieldNamesError-duplicateRecordTypeFieldNamesError :: Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm Core.Name -> Typed.TypedTerm ErrorCore.DuplicateRecordTypeFieldNamesError-duplicateRecordTypeFieldNamesError location name =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.core.DuplicateRecordTypeFieldNamesError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "location"),- Core.fieldTerm = (Typed.unTypedTerm location)},- Core.Field {- Core.fieldName = (Core.Name "name"),- Core.fieldTerm = (Typed.unTypedTerm name)}]}))---- | DSL name token for hydra.error.core.DuplicateRecordTypeFieldNamesError-duplicateRecordTypeFieldNamesErrorDuplicateRecordTypeFieldNamesError :: Typed.TypedName ErrorCore.DuplicateRecordTypeFieldNamesError-duplicateRecordTypeFieldNamesErrorDuplicateRecordTypeFieldNamesError =- Typed.TypedName (Core.Name "hydra.error.core.DuplicateRecordTypeFieldNamesError")---- | DSL accessor for the location field of hydra.error.core.DuplicateRecordTypeFieldNamesError-duplicateRecordTypeFieldNamesErrorLocation :: Typed.TypedTerm ErrorCore.DuplicateRecordTypeFieldNamesError -> Typed.TypedTerm Paths.SubtermPath-duplicateRecordTypeFieldNamesErrorLocation x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.DuplicateRecordTypeFieldNamesError"),- Core.projectionFieldName = (Core.Name "location")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL accessor for the name field of hydra.error.core.DuplicateRecordTypeFieldNamesError-duplicateRecordTypeFieldNamesErrorName :: Typed.TypedTerm ErrorCore.DuplicateRecordTypeFieldNamesError -> Typed.TypedTerm Core.Name-duplicateRecordTypeFieldNamesErrorName x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.DuplicateRecordTypeFieldNamesError"),- Core.projectionFieldName = (Core.Name "name")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL updater for the location field of hydra.error.core.DuplicateRecordTypeFieldNamesError-duplicateRecordTypeFieldNamesErrorWithLocation :: Typed.TypedTerm ErrorCore.DuplicateRecordTypeFieldNamesError -> Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm ErrorCore.DuplicateRecordTypeFieldNamesError-duplicateRecordTypeFieldNamesErrorWithLocation original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.core.DuplicateRecordTypeFieldNamesError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "location"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "name"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.DuplicateRecordTypeFieldNamesError"),- Core.projectionFieldName = (Core.Name "name")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL updater for the name field of hydra.error.core.DuplicateRecordTypeFieldNamesError-duplicateRecordTypeFieldNamesErrorWithName :: Typed.TypedTerm ErrorCore.DuplicateRecordTypeFieldNamesError -> Typed.TypedTerm Core.Name -> Typed.TypedTerm ErrorCore.DuplicateRecordTypeFieldNamesError-duplicateRecordTypeFieldNamesErrorWithName original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.core.DuplicateRecordTypeFieldNamesError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "location"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.DuplicateRecordTypeFieldNamesError"),- Core.projectionFieldName = (Core.Name "location")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "name"),- Core.fieldTerm = (Typed.unTypedTerm newVal)}]}))---- | DSL constructor for hydra.error.core.DuplicateUnionTypeFieldNamesError-duplicateUnionTypeFieldNamesError :: Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm Core.Name -> Typed.TypedTerm ErrorCore.DuplicateUnionTypeFieldNamesError-duplicateUnionTypeFieldNamesError location name =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.core.DuplicateUnionTypeFieldNamesError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "location"),- Core.fieldTerm = (Typed.unTypedTerm location)},- Core.Field {- Core.fieldName = (Core.Name "name"),- Core.fieldTerm = (Typed.unTypedTerm name)}]}))---- | DSL name token for hydra.error.core.DuplicateUnionTypeFieldNamesError-duplicateUnionTypeFieldNamesErrorDuplicateUnionTypeFieldNamesError :: Typed.TypedName ErrorCore.DuplicateUnionTypeFieldNamesError-duplicateUnionTypeFieldNamesErrorDuplicateUnionTypeFieldNamesError =- Typed.TypedName (Core.Name "hydra.error.core.DuplicateUnionTypeFieldNamesError")---- | DSL accessor for the location field of hydra.error.core.DuplicateUnionTypeFieldNamesError-duplicateUnionTypeFieldNamesErrorLocation :: Typed.TypedTerm ErrorCore.DuplicateUnionTypeFieldNamesError -> Typed.TypedTerm Paths.SubtermPath-duplicateUnionTypeFieldNamesErrorLocation x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.DuplicateUnionTypeFieldNamesError"),- Core.projectionFieldName = (Core.Name "location")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL accessor for the name field of hydra.error.core.DuplicateUnionTypeFieldNamesError-duplicateUnionTypeFieldNamesErrorName :: Typed.TypedTerm ErrorCore.DuplicateUnionTypeFieldNamesError -> Typed.TypedTerm Core.Name-duplicateUnionTypeFieldNamesErrorName x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.DuplicateUnionTypeFieldNamesError"),- Core.projectionFieldName = (Core.Name "name")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL updater for the location field of hydra.error.core.DuplicateUnionTypeFieldNamesError-duplicateUnionTypeFieldNamesErrorWithLocation :: Typed.TypedTerm ErrorCore.DuplicateUnionTypeFieldNamesError -> Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm ErrorCore.DuplicateUnionTypeFieldNamesError-duplicateUnionTypeFieldNamesErrorWithLocation original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.core.DuplicateUnionTypeFieldNamesError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "location"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "name"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.DuplicateUnionTypeFieldNamesError"),- Core.projectionFieldName = (Core.Name "name")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL updater for the name field of hydra.error.core.DuplicateUnionTypeFieldNamesError-duplicateUnionTypeFieldNamesErrorWithName :: Typed.TypedTerm ErrorCore.DuplicateUnionTypeFieldNamesError -> Typed.TypedTerm Core.Name -> Typed.TypedTerm ErrorCore.DuplicateUnionTypeFieldNamesError-duplicateUnionTypeFieldNamesErrorWithName original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.core.DuplicateUnionTypeFieldNamesError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "location"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.DuplicateUnionTypeFieldNamesError"),- Core.projectionFieldName = (Core.Name "location")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "name"),- Core.fieldTerm = (Typed.unTypedTerm newVal)}]}))---- | DSL constructor for hydra.error.core.EmptyCaseStatementError-emptyCaseStatementError :: Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm Core.Name -> Typed.TypedTerm ErrorCore.EmptyCaseStatementError-emptyCaseStatementError location typeName =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.core.EmptyCaseStatementError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "location"),- Core.fieldTerm = (Typed.unTypedTerm location)},- Core.Field {- Core.fieldName = (Core.Name "typeName"),- Core.fieldTerm = (Typed.unTypedTerm typeName)}]}))---- | DSL name token for hydra.error.core.EmptyCaseStatementError-emptyCaseStatementErrorEmptyCaseStatementError :: Typed.TypedName ErrorCore.EmptyCaseStatementError-emptyCaseStatementErrorEmptyCaseStatementError = Typed.TypedName (Core.Name "hydra.error.core.EmptyCaseStatementError")---- | DSL accessor for the location field of hydra.error.core.EmptyCaseStatementError-emptyCaseStatementErrorLocation :: Typed.TypedTerm ErrorCore.EmptyCaseStatementError -> Typed.TypedTerm Paths.SubtermPath-emptyCaseStatementErrorLocation x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.EmptyCaseStatementError"),- Core.projectionFieldName = (Core.Name "location")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL accessor for the typeName field of hydra.error.core.EmptyCaseStatementError-emptyCaseStatementErrorTypeName :: Typed.TypedTerm ErrorCore.EmptyCaseStatementError -> Typed.TypedTerm Core.Name-emptyCaseStatementErrorTypeName x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.EmptyCaseStatementError"),- Core.projectionFieldName = (Core.Name "typeName")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL updater for the location field of hydra.error.core.EmptyCaseStatementError-emptyCaseStatementErrorWithLocation :: Typed.TypedTerm ErrorCore.EmptyCaseStatementError -> Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm ErrorCore.EmptyCaseStatementError-emptyCaseStatementErrorWithLocation original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.core.EmptyCaseStatementError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "location"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "typeName"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.EmptyCaseStatementError"),- Core.projectionFieldName = (Core.Name "typeName")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL updater for the typeName field of hydra.error.core.EmptyCaseStatementError-emptyCaseStatementErrorWithTypeName :: Typed.TypedTerm ErrorCore.EmptyCaseStatementError -> Typed.TypedTerm Core.Name -> Typed.TypedTerm ErrorCore.EmptyCaseStatementError-emptyCaseStatementErrorWithTypeName original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.core.EmptyCaseStatementError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "location"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.EmptyCaseStatementError"),- Core.projectionFieldName = (Core.Name "location")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "typeName"),- Core.fieldTerm = (Typed.unTypedTerm newVal)}]}))---- | DSL constructor for hydra.error.core.EmptyLetBindingsError-emptyLetBindingsError :: Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm ErrorCore.EmptyLetBindingsError-emptyLetBindingsError location =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.core.EmptyLetBindingsError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "location"),- Core.fieldTerm = (Typed.unTypedTerm location)}]}))---- | DSL name token for hydra.error.core.EmptyLetBindingsError-emptyLetBindingsErrorEmptyLetBindingsError :: Typed.TypedName ErrorCore.EmptyLetBindingsError-emptyLetBindingsErrorEmptyLetBindingsError = Typed.TypedName (Core.Name "hydra.error.core.EmptyLetBindingsError")---- | DSL accessor for the location field of hydra.error.core.EmptyLetBindingsError-emptyLetBindingsErrorLocation :: Typed.TypedTerm ErrorCore.EmptyLetBindingsError -> Typed.TypedTerm Paths.SubtermPath-emptyLetBindingsErrorLocation x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.EmptyLetBindingsError"),- Core.projectionFieldName = (Core.Name "location")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL updater for the location field of hydra.error.core.EmptyLetBindingsError-emptyLetBindingsErrorWithLocation :: Typed.TypedTerm ErrorCore.EmptyLetBindingsError -> Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm ErrorCore.EmptyLetBindingsError-emptyLetBindingsErrorWithLocation original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.core.EmptyLetBindingsError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "location"),- Core.fieldTerm = (Typed.unTypedTerm newVal)}]}))---- | DSL constructor for hydra.error.core.EmptyRecordTypeError-emptyRecordTypeError :: Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm ErrorCore.EmptyRecordTypeError-emptyRecordTypeError location =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.core.EmptyRecordTypeError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "location"),- Core.fieldTerm = (Typed.unTypedTerm location)}]}))---- | DSL name token for hydra.error.core.EmptyRecordTypeError-emptyRecordTypeErrorEmptyRecordTypeError :: Typed.TypedName ErrorCore.EmptyRecordTypeError-emptyRecordTypeErrorEmptyRecordTypeError = Typed.TypedName (Core.Name "hydra.error.core.EmptyRecordTypeError")---- | DSL accessor for the location field of hydra.error.core.EmptyRecordTypeError-emptyRecordTypeErrorLocation :: Typed.TypedTerm ErrorCore.EmptyRecordTypeError -> Typed.TypedTerm Paths.SubtermPath-emptyRecordTypeErrorLocation x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.EmptyRecordTypeError"),- Core.projectionFieldName = (Core.Name "location")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL updater for the location field of hydra.error.core.EmptyRecordTypeError-emptyRecordTypeErrorWithLocation :: Typed.TypedTerm ErrorCore.EmptyRecordTypeError -> Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm ErrorCore.EmptyRecordTypeError-emptyRecordTypeErrorWithLocation original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.core.EmptyRecordTypeError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "location"),- Core.fieldTerm = (Typed.unTypedTerm newVal)}]}))---- | DSL constructor for hydra.error.core.EmptyTermAnnotationError-emptyTermAnnotationError :: Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm ErrorCore.EmptyTermAnnotationError-emptyTermAnnotationError location =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.core.EmptyTermAnnotationError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "location"),- Core.fieldTerm = (Typed.unTypedTerm location)}]}))---- | DSL name token for hydra.error.core.EmptyTermAnnotationError-emptyTermAnnotationErrorEmptyTermAnnotationError :: Typed.TypedName ErrorCore.EmptyTermAnnotationError-emptyTermAnnotationErrorEmptyTermAnnotationError = Typed.TypedName (Core.Name "hydra.error.core.EmptyTermAnnotationError")---- | DSL accessor for the location field of hydra.error.core.EmptyTermAnnotationError-emptyTermAnnotationErrorLocation :: Typed.TypedTerm ErrorCore.EmptyTermAnnotationError -> Typed.TypedTerm Paths.SubtermPath-emptyTermAnnotationErrorLocation x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.EmptyTermAnnotationError"),- Core.projectionFieldName = (Core.Name "location")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL updater for the location field of hydra.error.core.EmptyTermAnnotationError-emptyTermAnnotationErrorWithLocation :: Typed.TypedTerm ErrorCore.EmptyTermAnnotationError -> Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm ErrorCore.EmptyTermAnnotationError-emptyTermAnnotationErrorWithLocation original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.core.EmptyTermAnnotationError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "location"),- Core.fieldTerm = (Typed.unTypedTerm newVal)}]}))---- | DSL constructor for hydra.error.core.EmptyTypeAnnotationError-emptyTypeAnnotationError :: Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm ErrorCore.EmptyTypeAnnotationError-emptyTypeAnnotationError location =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.core.EmptyTypeAnnotationError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "location"),- Core.fieldTerm = (Typed.unTypedTerm location)}]}))---- | DSL name token for hydra.error.core.EmptyTypeAnnotationError-emptyTypeAnnotationErrorEmptyTypeAnnotationError :: Typed.TypedName ErrorCore.EmptyTypeAnnotationError-emptyTypeAnnotationErrorEmptyTypeAnnotationError = Typed.TypedName (Core.Name "hydra.error.core.EmptyTypeAnnotationError")---- | DSL accessor for the location field of hydra.error.core.EmptyTypeAnnotationError-emptyTypeAnnotationErrorLocation :: Typed.TypedTerm ErrorCore.EmptyTypeAnnotationError -> Typed.TypedTerm Paths.SubtermPath-emptyTypeAnnotationErrorLocation x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.EmptyTypeAnnotationError"),- Core.projectionFieldName = (Core.Name "location")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL updater for the location field of hydra.error.core.EmptyTypeAnnotationError-emptyTypeAnnotationErrorWithLocation :: Typed.TypedTerm ErrorCore.EmptyTypeAnnotationError -> Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm ErrorCore.EmptyTypeAnnotationError-emptyTypeAnnotationErrorWithLocation original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.core.EmptyTypeAnnotationError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "location"),- Core.fieldTerm = (Typed.unTypedTerm newVal)}]}))---- | DSL constructor for hydra.error.core.EmptyTypeNameInTermError-emptyTypeNameInTermError :: Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm ErrorCore.EmptyTypeNameInTermError-emptyTypeNameInTermError location =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.core.EmptyTypeNameInTermError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "location"),- Core.fieldTerm = (Typed.unTypedTerm location)}]}))---- | DSL name token for hydra.error.core.EmptyTypeNameInTermError-emptyTypeNameInTermErrorEmptyTypeNameInTermError :: Typed.TypedName ErrorCore.EmptyTypeNameInTermError-emptyTypeNameInTermErrorEmptyTypeNameInTermError = Typed.TypedName (Core.Name "hydra.error.core.EmptyTypeNameInTermError")---- | DSL accessor for the location field of hydra.error.core.EmptyTypeNameInTermError-emptyTypeNameInTermErrorLocation :: Typed.TypedTerm ErrorCore.EmptyTypeNameInTermError -> Typed.TypedTerm Paths.SubtermPath-emptyTypeNameInTermErrorLocation x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.EmptyTypeNameInTermError"),- Core.projectionFieldName = (Core.Name "location")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL updater for the location field of hydra.error.core.EmptyTypeNameInTermError-emptyTypeNameInTermErrorWithLocation :: Typed.TypedTerm ErrorCore.EmptyTypeNameInTermError -> Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm ErrorCore.EmptyTypeNameInTermError-emptyTypeNameInTermErrorWithLocation original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.core.EmptyTypeNameInTermError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "location"),- Core.fieldTerm = (Typed.unTypedTerm newVal)}]}))---- | DSL constructor for hydra.error.core.EmptyUnionTypeError-emptyUnionTypeError :: Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm ErrorCore.EmptyUnionTypeError-emptyUnionTypeError location =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.core.EmptyUnionTypeError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "location"),- Core.fieldTerm = (Typed.unTypedTerm location)}]}))---- | DSL name token for hydra.error.core.EmptyUnionTypeError-emptyUnionTypeErrorEmptyUnionTypeError :: Typed.TypedName ErrorCore.EmptyUnionTypeError-emptyUnionTypeErrorEmptyUnionTypeError = Typed.TypedName (Core.Name "hydra.error.core.EmptyUnionTypeError")---- | DSL accessor for the location field of hydra.error.core.EmptyUnionTypeError-emptyUnionTypeErrorLocation :: Typed.TypedTerm ErrorCore.EmptyUnionTypeError -> Typed.TypedTerm Paths.SubtermPath-emptyUnionTypeErrorLocation x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.EmptyUnionTypeError"),- Core.projectionFieldName = (Core.Name "location")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL updater for the location field of hydra.error.core.EmptyUnionTypeError-emptyUnionTypeErrorWithLocation :: Typed.TypedTerm ErrorCore.EmptyUnionTypeError -> Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm ErrorCore.EmptyUnionTypeError-emptyUnionTypeErrorWithLocation original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.core.EmptyUnionTypeError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "location"),- Core.fieldTerm = (Typed.unTypedTerm newVal)}]}))---- | DSL constructor for hydra.error.core.ExtraRecordFieldsError-extraRecordFieldsError :: Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm Core.Name -> Typed.TypedTerm [Core.Name] -> Typed.TypedTerm ErrorCore.ExtraRecordFieldsError-extraRecordFieldsError location typeName fieldNames =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.core.ExtraRecordFieldsError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "location"),- Core.fieldTerm = (Typed.unTypedTerm location)},- Core.Field {- Core.fieldName = (Core.Name "typeName"),- Core.fieldTerm = (Typed.unTypedTerm typeName)},- Core.Field {- Core.fieldName = (Core.Name "fieldNames"),- Core.fieldTerm = (Typed.unTypedTerm fieldNames)}]}))---- | DSL name token for hydra.error.core.ExtraRecordFieldsError-extraRecordFieldsErrorExtraRecordFieldsError :: Typed.TypedName ErrorCore.ExtraRecordFieldsError-extraRecordFieldsErrorExtraRecordFieldsError = Typed.TypedName (Core.Name "hydra.error.core.ExtraRecordFieldsError")---- | DSL accessor for the fieldNames field of hydra.error.core.ExtraRecordFieldsError-extraRecordFieldsErrorFieldNames :: Typed.TypedTerm ErrorCore.ExtraRecordFieldsError -> Typed.TypedTerm [Core.Name]-extraRecordFieldsErrorFieldNames x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.ExtraRecordFieldsError"),- Core.projectionFieldName = (Core.Name "fieldNames")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL accessor for the location field of hydra.error.core.ExtraRecordFieldsError-extraRecordFieldsErrorLocation :: Typed.TypedTerm ErrorCore.ExtraRecordFieldsError -> Typed.TypedTerm Paths.SubtermPath-extraRecordFieldsErrorLocation x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.ExtraRecordFieldsError"),- Core.projectionFieldName = (Core.Name "location")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL accessor for the typeName field of hydra.error.core.ExtraRecordFieldsError-extraRecordFieldsErrorTypeName :: Typed.TypedTerm ErrorCore.ExtraRecordFieldsError -> Typed.TypedTerm Core.Name-extraRecordFieldsErrorTypeName x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.ExtraRecordFieldsError"),- Core.projectionFieldName = (Core.Name "typeName")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL updater for the fieldNames field of hydra.error.core.ExtraRecordFieldsError-extraRecordFieldsErrorWithFieldNames :: Typed.TypedTerm ErrorCore.ExtraRecordFieldsError -> Typed.TypedTerm [Core.Name] -> Typed.TypedTerm ErrorCore.ExtraRecordFieldsError-extraRecordFieldsErrorWithFieldNames original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.core.ExtraRecordFieldsError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "location"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.ExtraRecordFieldsError"),- Core.projectionFieldName = (Core.Name "location")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "typeName"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.ExtraRecordFieldsError"),- Core.projectionFieldName = (Core.Name "typeName")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "fieldNames"),- Core.fieldTerm = (Typed.unTypedTerm newVal)}]}))---- | DSL updater for the location field of hydra.error.core.ExtraRecordFieldsError-extraRecordFieldsErrorWithLocation :: Typed.TypedTerm ErrorCore.ExtraRecordFieldsError -> Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm ErrorCore.ExtraRecordFieldsError-extraRecordFieldsErrorWithLocation original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.core.ExtraRecordFieldsError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "location"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "typeName"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.ExtraRecordFieldsError"),- Core.projectionFieldName = (Core.Name "typeName")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "fieldNames"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.ExtraRecordFieldsError"),- Core.projectionFieldName = (Core.Name "fieldNames")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL updater for the typeName field of hydra.error.core.ExtraRecordFieldsError-extraRecordFieldsErrorWithTypeName :: Typed.TypedTerm ErrorCore.ExtraRecordFieldsError -> Typed.TypedTerm Core.Name -> Typed.TypedTerm ErrorCore.ExtraRecordFieldsError-extraRecordFieldsErrorWithTypeName original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.core.ExtraRecordFieldsError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "location"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.ExtraRecordFieldsError"),- Core.projectionFieldName = (Core.Name "location")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "typeName"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "fieldNames"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.ExtraRecordFieldsError"),- Core.projectionFieldName = (Core.Name "fieldNames")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL constructor for hydra.error.core.InvalidForallParameterNameError-invalidForallParameterNameError :: Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm Core.Name -> Typed.TypedTerm ErrorCore.InvalidForallParameterNameError-invalidForallParameterNameError location name =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.core.InvalidForallParameterNameError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "location"),- Core.fieldTerm = (Typed.unTypedTerm location)},- Core.Field {- Core.fieldName = (Core.Name "name"),- Core.fieldTerm = (Typed.unTypedTerm name)}]}))---- | DSL name token for hydra.error.core.InvalidForallParameterNameError-invalidForallParameterNameErrorInvalidForallParameterNameError :: Typed.TypedName ErrorCore.InvalidForallParameterNameError-invalidForallParameterNameErrorInvalidForallParameterNameError =- Typed.TypedName (Core.Name "hydra.error.core.InvalidForallParameterNameError")---- | DSL accessor for the location field of hydra.error.core.InvalidForallParameterNameError-invalidForallParameterNameErrorLocation :: Typed.TypedTerm ErrorCore.InvalidForallParameterNameError -> Typed.TypedTerm Paths.SubtermPath-invalidForallParameterNameErrorLocation x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.InvalidForallParameterNameError"),- Core.projectionFieldName = (Core.Name "location")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL accessor for the name field of hydra.error.core.InvalidForallParameterNameError-invalidForallParameterNameErrorName :: Typed.TypedTerm ErrorCore.InvalidForallParameterNameError -> Typed.TypedTerm Core.Name-invalidForallParameterNameErrorName x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.InvalidForallParameterNameError"),- Core.projectionFieldName = (Core.Name "name")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL updater for the location field of hydra.error.core.InvalidForallParameterNameError-invalidForallParameterNameErrorWithLocation :: Typed.TypedTerm ErrorCore.InvalidForallParameterNameError -> Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm ErrorCore.InvalidForallParameterNameError-invalidForallParameterNameErrorWithLocation original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.core.InvalidForallParameterNameError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "location"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "name"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.InvalidForallParameterNameError"),- Core.projectionFieldName = (Core.Name "name")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL updater for the name field of hydra.error.core.InvalidForallParameterNameError-invalidForallParameterNameErrorWithName :: Typed.TypedTerm ErrorCore.InvalidForallParameterNameError -> Typed.TypedTerm Core.Name -> Typed.TypedTerm ErrorCore.InvalidForallParameterNameError-invalidForallParameterNameErrorWithName original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.core.InvalidForallParameterNameError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "location"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.InvalidForallParameterNameError"),- Core.projectionFieldName = (Core.Name "location")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "name"),- Core.fieldTerm = (Typed.unTypedTerm newVal)}]}))---- | DSL constructor for hydra.error.core.InvalidLambdaParameterNameError-invalidLambdaParameterNameError :: Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm Core.Name -> Typed.TypedTerm ErrorCore.InvalidLambdaParameterNameError-invalidLambdaParameterNameError location name =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.core.InvalidLambdaParameterNameError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "location"),- Core.fieldTerm = (Typed.unTypedTerm location)},- Core.Field {- Core.fieldName = (Core.Name "name"),- Core.fieldTerm = (Typed.unTypedTerm name)}]}))---- | DSL name token for hydra.error.core.InvalidLambdaParameterNameError-invalidLambdaParameterNameErrorInvalidLambdaParameterNameError :: Typed.TypedName ErrorCore.InvalidLambdaParameterNameError-invalidLambdaParameterNameErrorInvalidLambdaParameterNameError =- Typed.TypedName (Core.Name "hydra.error.core.InvalidLambdaParameterNameError")---- | DSL accessor for the location field of hydra.error.core.InvalidLambdaParameterNameError-invalidLambdaParameterNameErrorLocation :: Typed.TypedTerm ErrorCore.InvalidLambdaParameterNameError -> Typed.TypedTerm Paths.SubtermPath-invalidLambdaParameterNameErrorLocation x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.InvalidLambdaParameterNameError"),- Core.projectionFieldName = (Core.Name "location")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL accessor for the name field of hydra.error.core.InvalidLambdaParameterNameError-invalidLambdaParameterNameErrorName :: Typed.TypedTerm ErrorCore.InvalidLambdaParameterNameError -> Typed.TypedTerm Core.Name-invalidLambdaParameterNameErrorName x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.InvalidLambdaParameterNameError"),- Core.projectionFieldName = (Core.Name "name")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL updater for the location field of hydra.error.core.InvalidLambdaParameterNameError-invalidLambdaParameterNameErrorWithLocation :: Typed.TypedTerm ErrorCore.InvalidLambdaParameterNameError -> Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm ErrorCore.InvalidLambdaParameterNameError-invalidLambdaParameterNameErrorWithLocation original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.core.InvalidLambdaParameterNameError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "location"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "name"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.InvalidLambdaParameterNameError"),- Core.projectionFieldName = (Core.Name "name")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL updater for the name field of hydra.error.core.InvalidLambdaParameterNameError-invalidLambdaParameterNameErrorWithName :: Typed.TypedTerm ErrorCore.InvalidLambdaParameterNameError -> Typed.TypedTerm Core.Name -> Typed.TypedTerm ErrorCore.InvalidLambdaParameterNameError-invalidLambdaParameterNameErrorWithName original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.core.InvalidLambdaParameterNameError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "location"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.InvalidLambdaParameterNameError"),- Core.projectionFieldName = (Core.Name "location")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "name"),- Core.fieldTerm = (Typed.unTypedTerm newVal)}]}))---- | DSL constructor for hydra.error.core.InvalidLetBindingNameError-invalidLetBindingNameError :: Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm Core.Name -> Typed.TypedTerm ErrorCore.InvalidLetBindingNameError-invalidLetBindingNameError location name =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.core.InvalidLetBindingNameError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "location"),- Core.fieldTerm = (Typed.unTypedTerm location)},- Core.Field {- Core.fieldName = (Core.Name "name"),- Core.fieldTerm = (Typed.unTypedTerm name)}]}))---- | DSL name token for hydra.error.core.InvalidLetBindingNameError-invalidLetBindingNameErrorInvalidLetBindingNameError :: Typed.TypedName ErrorCore.InvalidLetBindingNameError-invalidLetBindingNameErrorInvalidLetBindingNameError =- Typed.TypedName (Core.Name "hydra.error.core.InvalidLetBindingNameError")---- | DSL accessor for the location field of hydra.error.core.InvalidLetBindingNameError-invalidLetBindingNameErrorLocation :: Typed.TypedTerm ErrorCore.InvalidLetBindingNameError -> Typed.TypedTerm Paths.SubtermPath-invalidLetBindingNameErrorLocation x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.InvalidLetBindingNameError"),- Core.projectionFieldName = (Core.Name "location")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL accessor for the name field of hydra.error.core.InvalidLetBindingNameError-invalidLetBindingNameErrorName :: Typed.TypedTerm ErrorCore.InvalidLetBindingNameError -> Typed.TypedTerm Core.Name-invalidLetBindingNameErrorName x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.InvalidLetBindingNameError"),- Core.projectionFieldName = (Core.Name "name")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL updater for the location field of hydra.error.core.InvalidLetBindingNameError-invalidLetBindingNameErrorWithLocation :: Typed.TypedTerm ErrorCore.InvalidLetBindingNameError -> Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm ErrorCore.InvalidLetBindingNameError-invalidLetBindingNameErrorWithLocation original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.core.InvalidLetBindingNameError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "location"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "name"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.InvalidLetBindingNameError"),- Core.projectionFieldName = (Core.Name "name")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL updater for the name field of hydra.error.core.InvalidLetBindingNameError-invalidLetBindingNameErrorWithName :: Typed.TypedTerm ErrorCore.InvalidLetBindingNameError -> Typed.TypedTerm Core.Name -> Typed.TypedTerm ErrorCore.InvalidLetBindingNameError-invalidLetBindingNameErrorWithName original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.core.InvalidLetBindingNameError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "location"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.InvalidLetBindingNameError"),- Core.projectionFieldName = (Core.Name "location")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "name"),- Core.fieldTerm = (Typed.unTypedTerm newVal)}]}))---- | DSL name token for hydra.error.core.InvalidLiteralError-invalidLiteralErrorInvalidLiteralError :: Typed.TypedName ErrorCore.InvalidLiteralError-invalidLiteralErrorInvalidLiteralError = Typed.TypedName (Core.Name "hydra.error.core.InvalidLiteralError")---- | DSL injection for the typeMismatch variant of hydra.error.core.InvalidLiteralError-invalidLiteralErrorTypeMismatch :: Typed.TypedTerm ErrorCore.LiteralTypeMismatchError -> Typed.TypedTerm ErrorCore.InvalidLiteralError-invalidLiteralErrorTypeMismatch x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.error.core.InvalidLiteralError"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "typeMismatch"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the constantCondition variant of hydra.error.core.InvalidTermError-invalidTermErrorConstantCondition :: Typed.TypedTerm ErrorCore.ConstantConditionError -> Typed.TypedTerm ErrorCore.InvalidTermError-invalidTermErrorConstantCondition x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.error.core.InvalidTermError"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "constantCondition"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the duplicateBinding variant of hydra.error.core.InvalidTermError-invalidTermErrorDuplicateBinding :: Typed.TypedTerm ErrorCore.DuplicateBindingError -> Typed.TypedTerm ErrorCore.InvalidTermError-invalidTermErrorDuplicateBinding x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.error.core.InvalidTermError"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "duplicateBinding"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the duplicateField variant of hydra.error.core.InvalidTermError-invalidTermErrorDuplicateField :: Typed.TypedTerm ErrorCore.DuplicateFieldError -> Typed.TypedTerm ErrorCore.InvalidTermError-invalidTermErrorDuplicateField x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.error.core.InvalidTermError"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "duplicateField"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the emptyCaseStatement variant of hydra.error.core.InvalidTermError-invalidTermErrorEmptyCaseStatement :: Typed.TypedTerm ErrorCore.EmptyCaseStatementError -> Typed.TypedTerm ErrorCore.InvalidTermError-invalidTermErrorEmptyCaseStatement x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.error.core.InvalidTermError"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "emptyCaseStatement"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the emptyLetBindings variant of hydra.error.core.InvalidTermError-invalidTermErrorEmptyLetBindings :: Typed.TypedTerm ErrorCore.EmptyLetBindingsError -> Typed.TypedTerm ErrorCore.InvalidTermError-invalidTermErrorEmptyLetBindings x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.error.core.InvalidTermError"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "emptyLetBindings"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the emptyTermAnnotation variant of hydra.error.core.InvalidTermError-invalidTermErrorEmptyTermAnnotation :: Typed.TypedTerm ErrorCore.EmptyTermAnnotationError -> Typed.TypedTerm ErrorCore.InvalidTermError-invalidTermErrorEmptyTermAnnotation x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.error.core.InvalidTermError"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "emptyTermAnnotation"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the emptyTypeNameInTerm variant of hydra.error.core.InvalidTermError-invalidTermErrorEmptyTypeNameInTerm :: Typed.TypedTerm ErrorCore.EmptyTypeNameInTermError -> Typed.TypedTerm ErrorCore.InvalidTermError-invalidTermErrorEmptyTypeNameInTerm x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.error.core.InvalidTermError"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "emptyTypeNameInTerm"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the extraRecordFields variant of hydra.error.core.InvalidTermError-invalidTermErrorExtraRecordFields :: Typed.TypedTerm ErrorCore.ExtraRecordFieldsError -> Typed.TypedTerm ErrorCore.InvalidTermError-invalidTermErrorExtraRecordFields x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.error.core.InvalidTermError"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "extraRecordFields"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the invalidLambdaParameterName variant of hydra.error.core.InvalidTermError-invalidTermErrorInvalidLambdaParameterName :: Typed.TypedTerm ErrorCore.InvalidLambdaParameterNameError -> Typed.TypedTerm ErrorCore.InvalidTermError-invalidTermErrorInvalidLambdaParameterName x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.error.core.InvalidTermError"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "invalidLambdaParameterName"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the invalidLetBindingName variant of hydra.error.core.InvalidTermError-invalidTermErrorInvalidLetBindingName :: Typed.TypedTerm ErrorCore.InvalidLetBindingNameError -> Typed.TypedTerm ErrorCore.InvalidTermError-invalidTermErrorInvalidLetBindingName x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.error.core.InvalidTermError"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "invalidLetBindingName"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL name token for hydra.error.core.InvalidTermError-invalidTermErrorInvalidTermError :: Typed.TypedName ErrorCore.InvalidTermError-invalidTermErrorInvalidTermError = Typed.TypedName (Core.Name "hydra.error.core.InvalidTermError")---- | DSL injection for the invalidTypeLambdaParameterName variant of hydra.error.core.InvalidTermError-invalidTermErrorInvalidTypeLambdaParameterName :: Typed.TypedTerm ErrorCore.InvalidTypeLambdaParameterNameError -> Typed.TypedTerm ErrorCore.InvalidTermError-invalidTermErrorInvalidTypeLambdaParameterName x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.error.core.InvalidTermError"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "invalidTypeLambdaParameterName"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the missingCaseBranches variant of hydra.error.core.InvalidTermError-invalidTermErrorMissingCaseBranches :: Typed.TypedTerm ErrorCore.MissingCaseBranchesError -> Typed.TypedTerm ErrorCore.InvalidTermError-invalidTermErrorMissingCaseBranches x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.error.core.InvalidTermError"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "missingCaseBranches"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the missingRecordFields variant of hydra.error.core.InvalidTermError-invalidTermErrorMissingRecordFields :: Typed.TypedTerm ErrorCore.MissingRecordFieldsError -> Typed.TypedTerm ErrorCore.InvalidTermError-invalidTermErrorMissingRecordFields x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.error.core.InvalidTermError"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "missingRecordFields"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the nestedTermAnnotation variant of hydra.error.core.InvalidTermError-invalidTermErrorNestedTermAnnotation :: Typed.TypedTerm ErrorCore.NestedTermAnnotationError -> Typed.TypedTerm ErrorCore.InvalidTermError-invalidTermErrorNestedTermAnnotation x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.error.core.InvalidTermError"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "nestedTermAnnotation"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the nominalTypeKindMismatch variant of hydra.error.core.InvalidTermError-invalidTermErrorNominalTypeKindMismatch :: Typed.TypedTerm ErrorCore.NominalTypeKindMismatchError -> Typed.TypedTerm ErrorCore.InvalidTermError-invalidTermErrorNominalTypeKindMismatch x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.error.core.InvalidTermError"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "nominalTypeKindMismatch"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the redundantWrapUnwrap variant of hydra.error.core.InvalidTermError-invalidTermErrorRedundantWrapUnwrap :: Typed.TypedTerm ErrorCore.RedundantWrapUnwrapError -> Typed.TypedTerm ErrorCore.InvalidTermError-invalidTermErrorRedundantWrapUnwrap x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.error.core.InvalidTermError"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "redundantWrapUnwrap"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the selfApplication variant of hydra.error.core.InvalidTermError-invalidTermErrorSelfApplication :: Typed.TypedTerm ErrorCore.SelfApplicationError -> Typed.TypedTerm ErrorCore.InvalidTermError-invalidTermErrorSelfApplication x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.error.core.InvalidTermError"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "selfApplication"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the termVariableShadowing variant of hydra.error.core.InvalidTermError-invalidTermErrorTermVariableShadowing :: Typed.TypedTerm ErrorCore.TermVariableShadowingError -> Typed.TypedTerm ErrorCore.InvalidTermError-invalidTermErrorTermVariableShadowing x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.error.core.InvalidTermError"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "termVariableShadowing"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the typeVariableShadowingInTypeLambda variant of hydra.error.core.InvalidTermError-invalidTermErrorTypeVariableShadowingInTypeLambda :: Typed.TypedTerm ErrorCore.TypeVariableShadowingInTypeLambdaError -> Typed.TypedTerm ErrorCore.InvalidTermError-invalidTermErrorTypeVariableShadowingInTypeLambda x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.error.core.InvalidTermError"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "typeVariableShadowingInTypeLambda"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the undeclaredVariant variant of hydra.error.core.InvalidTermError-invalidTermErrorUndeclaredVariant :: Typed.TypedTerm ErrorCore.UndeclaredVariantError -> Typed.TypedTerm ErrorCore.InvalidTermError-invalidTermErrorUndeclaredVariant x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.error.core.InvalidTermError"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "undeclaredVariant"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the undefinedTermVariable variant of hydra.error.core.InvalidTermError-invalidTermErrorUndefinedTermVariable :: Typed.TypedTerm ErrorCore.UndefinedTermVariableError -> Typed.TypedTerm ErrorCore.InvalidTermError-invalidTermErrorUndefinedTermVariable x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.error.core.InvalidTermError"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "undefinedTermVariable"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the undefinedTypeVariableInBindingType variant of hydra.error.core.InvalidTermError-invalidTermErrorUndefinedTypeVariableInBindingType :: Typed.TypedTerm ErrorCore.UndefinedTypeVariableInBindingTypeError -> Typed.TypedTerm ErrorCore.InvalidTermError-invalidTermErrorUndefinedTypeVariableInBindingType x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.error.core.InvalidTermError"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "undefinedTypeVariableInBindingType"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the undefinedTypeVariableInLambdaDomain variant of hydra.error.core.InvalidTermError-invalidTermErrorUndefinedTypeVariableInLambdaDomain :: Typed.TypedTerm ErrorCore.UndefinedTypeVariableInLambdaDomainError -> Typed.TypedTerm ErrorCore.InvalidTermError-invalidTermErrorUndefinedTypeVariableInLambdaDomain x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.error.core.InvalidTermError"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "undefinedTypeVariableInLambdaDomain"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the undefinedTypeVariableInTypeApplication variant of hydra.error.core.InvalidTermError-invalidTermErrorUndefinedTypeVariableInTypeApplication :: Typed.TypedTerm ErrorCore.UndefinedTypeVariableInTypeApplicationError -> Typed.TypedTerm ErrorCore.InvalidTermError-invalidTermErrorUndefinedTypeVariableInTypeApplication x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.error.core.InvalidTermError"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "undefinedTypeVariableInTypeApplication"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the unknownCaseAlternative variant of hydra.error.core.InvalidTermError-invalidTermErrorUnknownCaseAlternative :: Typed.TypedTerm ErrorCore.UnknownCaseAlternativeError -> Typed.TypedTerm ErrorCore.InvalidTermError-invalidTermErrorUnknownCaseAlternative x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.error.core.InvalidTermError"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "unknownCaseAlternative"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the unknownPrimitiveName variant of hydra.error.core.InvalidTermError-invalidTermErrorUnknownPrimitiveName :: Typed.TypedTerm ErrorCore.UnknownPrimitiveNameError -> Typed.TypedTerm ErrorCore.InvalidTermError-invalidTermErrorUnknownPrimitiveName x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.error.core.InvalidTermError"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "unknownPrimitiveName"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the unknownProjectedField variant of hydra.error.core.InvalidTermError-invalidTermErrorUnknownProjectedField :: Typed.TypedTerm ErrorCore.UnknownProjectedFieldError -> Typed.TypedTerm ErrorCore.InvalidTermError-invalidTermErrorUnknownProjectedField x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.error.core.InvalidTermError"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "unknownProjectedField"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the unnecessaryIdentityApplication variant of hydra.error.core.InvalidTermError-invalidTermErrorUnnecessaryIdentityApplication :: Typed.TypedTerm ErrorCore.UnnecessaryIdentityApplicationError -> Typed.TypedTerm ErrorCore.InvalidTermError-invalidTermErrorUnnecessaryIdentityApplication x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.error.core.InvalidTermError"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "unnecessaryIdentityApplication"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the unresolvedNominalType variant of hydra.error.core.InvalidTermError-invalidTermErrorUnresolvedNominalType :: Typed.TypedTerm ErrorCore.UnresolvedNominalTypeError -> Typed.TypedTerm ErrorCore.InvalidTermError-invalidTermErrorUnresolvedNominalType x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.error.core.InvalidTermError"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "unresolvedNominalType"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the untypedTermVariable variant of hydra.error.core.InvalidTermError-invalidTermErrorUntypedTermVariable :: Typed.TypedTerm ErrorCore.UntypedTermVariableError -> Typed.TypedTerm ErrorCore.InvalidTermError-invalidTermErrorUntypedTermVariable x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.error.core.InvalidTermError"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "untypedTermVariable"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the duplicateRecordTypeFieldNames variant of hydra.error.core.InvalidTypeError-invalidTypeErrorDuplicateRecordTypeFieldNames :: Typed.TypedTerm ErrorCore.DuplicateRecordTypeFieldNamesError -> Typed.TypedTerm ErrorCore.InvalidTypeError-invalidTypeErrorDuplicateRecordTypeFieldNames x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.error.core.InvalidTypeError"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "duplicateRecordTypeFieldNames"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the duplicateUnionTypeFieldNames variant of hydra.error.core.InvalidTypeError-invalidTypeErrorDuplicateUnionTypeFieldNames :: Typed.TypedTerm ErrorCore.DuplicateUnionTypeFieldNamesError -> Typed.TypedTerm ErrorCore.InvalidTypeError-invalidTypeErrorDuplicateUnionTypeFieldNames x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.error.core.InvalidTypeError"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "duplicateUnionTypeFieldNames"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the emptyRecordType variant of hydra.error.core.InvalidTypeError-invalidTypeErrorEmptyRecordType :: Typed.TypedTerm ErrorCore.EmptyRecordTypeError -> Typed.TypedTerm ErrorCore.InvalidTypeError-invalidTypeErrorEmptyRecordType x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.error.core.InvalidTypeError"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "emptyRecordType"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the emptyTypeAnnotation variant of hydra.error.core.InvalidTypeError-invalidTypeErrorEmptyTypeAnnotation :: Typed.TypedTerm ErrorCore.EmptyTypeAnnotationError -> Typed.TypedTerm ErrorCore.InvalidTypeError-invalidTypeErrorEmptyTypeAnnotation x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.error.core.InvalidTypeError"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "emptyTypeAnnotation"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the emptyUnionType variant of hydra.error.core.InvalidTypeError-invalidTypeErrorEmptyUnionType :: Typed.TypedTerm ErrorCore.EmptyUnionTypeError -> Typed.TypedTerm ErrorCore.InvalidTypeError-invalidTypeErrorEmptyUnionType x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.error.core.InvalidTypeError"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "emptyUnionType"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the invalidForallParameterName variant of hydra.error.core.InvalidTypeError-invalidTypeErrorInvalidForallParameterName :: Typed.TypedTerm ErrorCore.InvalidForallParameterNameError -> Typed.TypedTerm ErrorCore.InvalidTypeError-invalidTypeErrorInvalidForallParameterName x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.error.core.InvalidTypeError"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "invalidForallParameterName"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL name token for hydra.error.core.InvalidTypeError-invalidTypeErrorInvalidTypeError :: Typed.TypedName ErrorCore.InvalidTypeError-invalidTypeErrorInvalidTypeError = Typed.TypedName (Core.Name "hydra.error.core.InvalidTypeError")---- | DSL injection for the invalidTypeSchemeVariableName variant of hydra.error.core.InvalidTypeError-invalidTypeErrorInvalidTypeSchemeVariableName :: Typed.TypedTerm ErrorCore.InvalidTypeSchemeVariableNameError -> Typed.TypedTerm ErrorCore.InvalidTypeError-invalidTypeErrorInvalidTypeSchemeVariableName x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.error.core.InvalidTypeError"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "invalidTypeSchemeVariableName"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the nestedTypeAnnotation variant of hydra.error.core.InvalidTypeError-invalidTypeErrorNestedTypeAnnotation :: Typed.TypedTerm ErrorCore.NestedTypeAnnotationError -> Typed.TypedTerm ErrorCore.InvalidTypeError-invalidTypeErrorNestedTypeAnnotation x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.error.core.InvalidTypeError"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "nestedTypeAnnotation"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the nonComparableMapKeyType variant of hydra.error.core.InvalidTypeError-invalidTypeErrorNonComparableMapKeyType :: Typed.TypedTerm ErrorCore.NonComparableMapKeyTypeError -> Typed.TypedTerm ErrorCore.InvalidTypeError-invalidTypeErrorNonComparableMapKeyType x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.error.core.InvalidTypeError"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "nonComparableMapKeyType"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the nonComparableSetElementType variant of hydra.error.core.InvalidTypeError-invalidTypeErrorNonComparableSetElementType :: Typed.TypedTerm ErrorCore.NonComparableSetElementTypeError -> Typed.TypedTerm ErrorCore.InvalidTypeError-invalidTypeErrorNonComparableSetElementType x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.error.core.InvalidTypeError"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "nonComparableSetElementType"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the singleVariantUnion variant of hydra.error.core.InvalidTypeError-invalidTypeErrorSingleVariantUnion :: Typed.TypedTerm ErrorCore.SingleVariantUnionError -> Typed.TypedTerm ErrorCore.InvalidTypeError-invalidTypeErrorSingleVariantUnion x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.error.core.InvalidTypeError"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "singleVariantUnion"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the typeVariableShadowingInForall variant of hydra.error.core.InvalidTypeError-invalidTypeErrorTypeVariableShadowingInForall :: Typed.TypedTerm ErrorCore.TypeVariableShadowingInForallError -> Typed.TypedTerm ErrorCore.InvalidTypeError-invalidTypeErrorTypeVariableShadowingInForall x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.error.core.InvalidTypeError"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "typeVariableShadowingInForall"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the undefinedTypeVariable variant of hydra.error.core.InvalidTypeError-invalidTypeErrorUndefinedTypeVariable :: Typed.TypedTerm ErrorCore.UndefinedTypeVariableError -> Typed.TypedTerm ErrorCore.InvalidTypeError-invalidTypeErrorUndefinedTypeVariable x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.error.core.InvalidTypeError"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "undefinedTypeVariable"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the voidInNonBottomPosition variant of hydra.error.core.InvalidTypeError-invalidTypeErrorVoidInNonBottomPosition :: Typed.TypedTerm ErrorCore.VoidInNonBottomPositionError -> Typed.TypedTerm ErrorCore.InvalidTypeError-invalidTypeErrorVoidInNonBottomPosition x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.error.core.InvalidTypeError"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "voidInNonBottomPosition"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL constructor for hydra.error.core.InvalidTypeLambdaParameterNameError-invalidTypeLambdaParameterNameError :: Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm Core.Name -> Typed.TypedTerm ErrorCore.InvalidTypeLambdaParameterNameError-invalidTypeLambdaParameterNameError location name =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.core.InvalidTypeLambdaParameterNameError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "location"),- Core.fieldTerm = (Typed.unTypedTerm location)},- Core.Field {- Core.fieldName = (Core.Name "name"),- Core.fieldTerm = (Typed.unTypedTerm name)}]}))---- | DSL name token for hydra.error.core.InvalidTypeLambdaParameterNameError-invalidTypeLambdaParameterNameErrorInvalidTypeLambdaParameterNameError :: Typed.TypedName ErrorCore.InvalidTypeLambdaParameterNameError-invalidTypeLambdaParameterNameErrorInvalidTypeLambdaParameterNameError =- Typed.TypedName (Core.Name "hydra.error.core.InvalidTypeLambdaParameterNameError")---- | DSL accessor for the location field of hydra.error.core.InvalidTypeLambdaParameterNameError-invalidTypeLambdaParameterNameErrorLocation :: Typed.TypedTerm ErrorCore.InvalidTypeLambdaParameterNameError -> Typed.TypedTerm Paths.SubtermPath-invalidTypeLambdaParameterNameErrorLocation x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.InvalidTypeLambdaParameterNameError"),- Core.projectionFieldName = (Core.Name "location")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL accessor for the name field of hydra.error.core.InvalidTypeLambdaParameterNameError-invalidTypeLambdaParameterNameErrorName :: Typed.TypedTerm ErrorCore.InvalidTypeLambdaParameterNameError -> Typed.TypedTerm Core.Name-invalidTypeLambdaParameterNameErrorName x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.InvalidTypeLambdaParameterNameError"),- Core.projectionFieldName = (Core.Name "name")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL updater for the location field of hydra.error.core.InvalidTypeLambdaParameterNameError-invalidTypeLambdaParameterNameErrorWithLocation :: Typed.TypedTerm ErrorCore.InvalidTypeLambdaParameterNameError -> Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm ErrorCore.InvalidTypeLambdaParameterNameError-invalidTypeLambdaParameterNameErrorWithLocation original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.core.InvalidTypeLambdaParameterNameError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "location"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "name"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.InvalidTypeLambdaParameterNameError"),- Core.projectionFieldName = (Core.Name "name")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL updater for the name field of hydra.error.core.InvalidTypeLambdaParameterNameError-invalidTypeLambdaParameterNameErrorWithName :: Typed.TypedTerm ErrorCore.InvalidTypeLambdaParameterNameError -> Typed.TypedTerm Core.Name -> Typed.TypedTerm ErrorCore.InvalidTypeLambdaParameterNameError-invalidTypeLambdaParameterNameErrorWithName original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.core.InvalidTypeLambdaParameterNameError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "location"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.InvalidTypeLambdaParameterNameError"),- Core.projectionFieldName = (Core.Name "location")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "name"),- Core.fieldTerm = (Typed.unTypedTerm newVal)}]}))---- | DSL constructor for hydra.error.core.InvalidTypeSchemeVariableNameError-invalidTypeSchemeVariableNameError :: Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm Core.Name -> Typed.TypedTerm ErrorCore.InvalidTypeSchemeVariableNameError-invalidTypeSchemeVariableNameError location name =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.core.InvalidTypeSchemeVariableNameError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "location"),- Core.fieldTerm = (Typed.unTypedTerm location)},- Core.Field {- Core.fieldName = (Core.Name "name"),- Core.fieldTerm = (Typed.unTypedTerm name)}]}))---- | DSL name token for hydra.error.core.InvalidTypeSchemeVariableNameError-invalidTypeSchemeVariableNameErrorInvalidTypeSchemeVariableNameError :: Typed.TypedName ErrorCore.InvalidTypeSchemeVariableNameError-invalidTypeSchemeVariableNameErrorInvalidTypeSchemeVariableNameError =- Typed.TypedName (Core.Name "hydra.error.core.InvalidTypeSchemeVariableNameError")---- | DSL accessor for the location field of hydra.error.core.InvalidTypeSchemeVariableNameError-invalidTypeSchemeVariableNameErrorLocation :: Typed.TypedTerm ErrorCore.InvalidTypeSchemeVariableNameError -> Typed.TypedTerm Paths.SubtermPath-invalidTypeSchemeVariableNameErrorLocation x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.InvalidTypeSchemeVariableNameError"),- Core.projectionFieldName = (Core.Name "location")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL accessor for the name field of hydra.error.core.InvalidTypeSchemeVariableNameError-invalidTypeSchemeVariableNameErrorName :: Typed.TypedTerm ErrorCore.InvalidTypeSchemeVariableNameError -> Typed.TypedTerm Core.Name-invalidTypeSchemeVariableNameErrorName x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.InvalidTypeSchemeVariableNameError"),- Core.projectionFieldName = (Core.Name "name")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL updater for the location field of hydra.error.core.InvalidTypeSchemeVariableNameError-invalidTypeSchemeVariableNameErrorWithLocation :: Typed.TypedTerm ErrorCore.InvalidTypeSchemeVariableNameError -> Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm ErrorCore.InvalidTypeSchemeVariableNameError-invalidTypeSchemeVariableNameErrorWithLocation original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.core.InvalidTypeSchemeVariableNameError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "location"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "name"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.InvalidTypeSchemeVariableNameError"),- Core.projectionFieldName = (Core.Name "name")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL updater for the name field of hydra.error.core.InvalidTypeSchemeVariableNameError-invalidTypeSchemeVariableNameErrorWithName :: Typed.TypedTerm ErrorCore.InvalidTypeSchemeVariableNameError -> Typed.TypedTerm Core.Name -> Typed.TypedTerm ErrorCore.InvalidTypeSchemeVariableNameError-invalidTypeSchemeVariableNameErrorWithName original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.core.InvalidTypeSchemeVariableNameError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "location"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.InvalidTypeSchemeVariableNameError"),- Core.projectionFieldName = (Core.Name "location")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "name"),- Core.fieldTerm = (Typed.unTypedTerm newVal)}]}))---- | DSL constructor for hydra.error.core.LiteralTypeMismatchError-literalTypeMismatchError :: Typed.TypedTerm Core.LiteralType -> Typed.TypedTerm Core.LiteralType -> Typed.TypedTerm ErrorCore.LiteralTypeMismatchError-literalTypeMismatchError expectedType actualType =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.core.LiteralTypeMismatchError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "expectedType"),- Core.fieldTerm = (Typed.unTypedTerm expectedType)},- Core.Field {- Core.fieldName = (Core.Name "actualType"),- Core.fieldTerm = (Typed.unTypedTerm actualType)}]}))---- | DSL accessor for the actualType field of hydra.error.core.LiteralTypeMismatchError-literalTypeMismatchErrorActualType :: Typed.TypedTerm ErrorCore.LiteralTypeMismatchError -> Typed.TypedTerm Core.LiteralType-literalTypeMismatchErrorActualType x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.LiteralTypeMismatchError"),- Core.projectionFieldName = (Core.Name "actualType")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL accessor for the expectedType field of hydra.error.core.LiteralTypeMismatchError-literalTypeMismatchErrorExpectedType :: Typed.TypedTerm ErrorCore.LiteralTypeMismatchError -> Typed.TypedTerm Core.LiteralType-literalTypeMismatchErrorExpectedType x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.LiteralTypeMismatchError"),- Core.projectionFieldName = (Core.Name "expectedType")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL name token for hydra.error.core.LiteralTypeMismatchError-literalTypeMismatchErrorLiteralTypeMismatchError :: Typed.TypedName ErrorCore.LiteralTypeMismatchError-literalTypeMismatchErrorLiteralTypeMismatchError = Typed.TypedName (Core.Name "hydra.error.core.LiteralTypeMismatchError")---- | DSL updater for the actualType field of hydra.error.core.LiteralTypeMismatchError-literalTypeMismatchErrorWithActualType :: Typed.TypedTerm ErrorCore.LiteralTypeMismatchError -> Typed.TypedTerm Core.LiteralType -> Typed.TypedTerm ErrorCore.LiteralTypeMismatchError-literalTypeMismatchErrorWithActualType original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.core.LiteralTypeMismatchError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "expectedType"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.LiteralTypeMismatchError"),- Core.projectionFieldName = (Core.Name "expectedType")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "actualType"),- Core.fieldTerm = (Typed.unTypedTerm newVal)}]}))---- | DSL updater for the expectedType field of hydra.error.core.LiteralTypeMismatchError-literalTypeMismatchErrorWithExpectedType :: Typed.TypedTerm ErrorCore.LiteralTypeMismatchError -> Typed.TypedTerm Core.LiteralType -> Typed.TypedTerm ErrorCore.LiteralTypeMismatchError-literalTypeMismatchErrorWithExpectedType original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.core.LiteralTypeMismatchError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "expectedType"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "actualType"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.LiteralTypeMismatchError"),- Core.projectionFieldName = (Core.Name "actualType")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL constructor for hydra.error.core.MissingCaseBranchesError-missingCaseBranchesError :: Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm Core.Name -> Typed.TypedTerm [Core.Name] -> Typed.TypedTerm ErrorCore.MissingCaseBranchesError-missingCaseBranchesError location typeName variantNames =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.core.MissingCaseBranchesError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "location"),- Core.fieldTerm = (Typed.unTypedTerm location)},- Core.Field {- Core.fieldName = (Core.Name "typeName"),- Core.fieldTerm = (Typed.unTypedTerm typeName)},- Core.Field {- Core.fieldName = (Core.Name "variantNames"),- Core.fieldTerm = (Typed.unTypedTerm variantNames)}]}))---- | DSL accessor for the location field of hydra.error.core.MissingCaseBranchesError-missingCaseBranchesErrorLocation :: Typed.TypedTerm ErrorCore.MissingCaseBranchesError -> Typed.TypedTerm Paths.SubtermPath-missingCaseBranchesErrorLocation x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.MissingCaseBranchesError"),- Core.projectionFieldName = (Core.Name "location")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL name token for hydra.error.core.MissingCaseBranchesError-missingCaseBranchesErrorMissingCaseBranchesError :: Typed.TypedName ErrorCore.MissingCaseBranchesError-missingCaseBranchesErrorMissingCaseBranchesError = Typed.TypedName (Core.Name "hydra.error.core.MissingCaseBranchesError")---- | DSL accessor for the typeName field of hydra.error.core.MissingCaseBranchesError-missingCaseBranchesErrorTypeName :: Typed.TypedTerm ErrorCore.MissingCaseBranchesError -> Typed.TypedTerm Core.Name-missingCaseBranchesErrorTypeName x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.MissingCaseBranchesError"),- Core.projectionFieldName = (Core.Name "typeName")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL accessor for the variantNames field of hydra.error.core.MissingCaseBranchesError-missingCaseBranchesErrorVariantNames :: Typed.TypedTerm ErrorCore.MissingCaseBranchesError -> Typed.TypedTerm [Core.Name]-missingCaseBranchesErrorVariantNames x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.MissingCaseBranchesError"),- Core.projectionFieldName = (Core.Name "variantNames")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL updater for the location field of hydra.error.core.MissingCaseBranchesError-missingCaseBranchesErrorWithLocation :: Typed.TypedTerm ErrorCore.MissingCaseBranchesError -> Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm ErrorCore.MissingCaseBranchesError-missingCaseBranchesErrorWithLocation original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.core.MissingCaseBranchesError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "location"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "typeName"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.MissingCaseBranchesError"),- Core.projectionFieldName = (Core.Name "typeName")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "variantNames"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.MissingCaseBranchesError"),- Core.projectionFieldName = (Core.Name "variantNames")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL updater for the typeName field of hydra.error.core.MissingCaseBranchesError-missingCaseBranchesErrorWithTypeName :: Typed.TypedTerm ErrorCore.MissingCaseBranchesError -> Typed.TypedTerm Core.Name -> Typed.TypedTerm ErrorCore.MissingCaseBranchesError-missingCaseBranchesErrorWithTypeName original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.core.MissingCaseBranchesError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "location"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.MissingCaseBranchesError"),- Core.projectionFieldName = (Core.Name "location")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "typeName"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "variantNames"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.MissingCaseBranchesError"),- Core.projectionFieldName = (Core.Name "variantNames")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL updater for the variantNames field of hydra.error.core.MissingCaseBranchesError-missingCaseBranchesErrorWithVariantNames :: Typed.TypedTerm ErrorCore.MissingCaseBranchesError -> Typed.TypedTerm [Core.Name] -> Typed.TypedTerm ErrorCore.MissingCaseBranchesError-missingCaseBranchesErrorWithVariantNames original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.core.MissingCaseBranchesError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "location"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.MissingCaseBranchesError"),- Core.projectionFieldName = (Core.Name "location")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "typeName"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.MissingCaseBranchesError"),- Core.projectionFieldName = (Core.Name "typeName")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "variantNames"),- Core.fieldTerm = (Typed.unTypedTerm newVal)}]}))---- | DSL constructor for hydra.error.core.MissingRecordFieldsError-missingRecordFieldsError :: Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm Core.Name -> Typed.TypedTerm [Core.Name] -> Typed.TypedTerm ErrorCore.MissingRecordFieldsError-missingRecordFieldsError location typeName fieldNames =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.core.MissingRecordFieldsError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "location"),- Core.fieldTerm = (Typed.unTypedTerm location)},- Core.Field {- Core.fieldName = (Core.Name "typeName"),- Core.fieldTerm = (Typed.unTypedTerm typeName)},- Core.Field {- Core.fieldName = (Core.Name "fieldNames"),- Core.fieldTerm = (Typed.unTypedTerm fieldNames)}]}))---- | DSL accessor for the fieldNames field of hydra.error.core.MissingRecordFieldsError-missingRecordFieldsErrorFieldNames :: Typed.TypedTerm ErrorCore.MissingRecordFieldsError -> Typed.TypedTerm [Core.Name]-missingRecordFieldsErrorFieldNames x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.MissingRecordFieldsError"),- Core.projectionFieldName = (Core.Name "fieldNames")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL accessor for the location field of hydra.error.core.MissingRecordFieldsError-missingRecordFieldsErrorLocation :: Typed.TypedTerm ErrorCore.MissingRecordFieldsError -> Typed.TypedTerm Paths.SubtermPath-missingRecordFieldsErrorLocation x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.MissingRecordFieldsError"),- Core.projectionFieldName = (Core.Name "location")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL name token for hydra.error.core.MissingRecordFieldsError-missingRecordFieldsErrorMissingRecordFieldsError :: Typed.TypedName ErrorCore.MissingRecordFieldsError-missingRecordFieldsErrorMissingRecordFieldsError = Typed.TypedName (Core.Name "hydra.error.core.MissingRecordFieldsError")---- | DSL accessor for the typeName field of hydra.error.core.MissingRecordFieldsError-missingRecordFieldsErrorTypeName :: Typed.TypedTerm ErrorCore.MissingRecordFieldsError -> Typed.TypedTerm Core.Name-missingRecordFieldsErrorTypeName x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.MissingRecordFieldsError"),- Core.projectionFieldName = (Core.Name "typeName")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL updater for the fieldNames field of hydra.error.core.MissingRecordFieldsError-missingRecordFieldsErrorWithFieldNames :: Typed.TypedTerm ErrorCore.MissingRecordFieldsError -> Typed.TypedTerm [Core.Name] -> Typed.TypedTerm ErrorCore.MissingRecordFieldsError-missingRecordFieldsErrorWithFieldNames original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.core.MissingRecordFieldsError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "location"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.MissingRecordFieldsError"),- Core.projectionFieldName = (Core.Name "location")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "typeName"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.MissingRecordFieldsError"),- Core.projectionFieldName = (Core.Name "typeName")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "fieldNames"),- Core.fieldTerm = (Typed.unTypedTerm newVal)}]}))---- | DSL updater for the location field of hydra.error.core.MissingRecordFieldsError-missingRecordFieldsErrorWithLocation :: Typed.TypedTerm ErrorCore.MissingRecordFieldsError -> Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm ErrorCore.MissingRecordFieldsError-missingRecordFieldsErrorWithLocation original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.core.MissingRecordFieldsError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "location"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "typeName"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.MissingRecordFieldsError"),- Core.projectionFieldName = (Core.Name "typeName")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "fieldNames"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.MissingRecordFieldsError"),- Core.projectionFieldName = (Core.Name "fieldNames")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL updater for the typeName field of hydra.error.core.MissingRecordFieldsError-missingRecordFieldsErrorWithTypeName :: Typed.TypedTerm ErrorCore.MissingRecordFieldsError -> Typed.TypedTerm Core.Name -> Typed.TypedTerm ErrorCore.MissingRecordFieldsError-missingRecordFieldsErrorWithTypeName original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.core.MissingRecordFieldsError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "location"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.MissingRecordFieldsError"),- Core.projectionFieldName = (Core.Name "location")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "typeName"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "fieldNames"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.MissingRecordFieldsError"),- Core.projectionFieldName = (Core.Name "fieldNames")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL constructor for hydra.error.core.NestedTermAnnotationError-nestedTermAnnotationError :: Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm ErrorCore.NestedTermAnnotationError-nestedTermAnnotationError location =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.core.NestedTermAnnotationError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "location"),- Core.fieldTerm = (Typed.unTypedTerm location)}]}))---- | DSL accessor for the location field of hydra.error.core.NestedTermAnnotationError-nestedTermAnnotationErrorLocation :: Typed.TypedTerm ErrorCore.NestedTermAnnotationError -> Typed.TypedTerm Paths.SubtermPath-nestedTermAnnotationErrorLocation x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.NestedTermAnnotationError"),- Core.projectionFieldName = (Core.Name "location")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL name token for hydra.error.core.NestedTermAnnotationError-nestedTermAnnotationErrorNestedTermAnnotationError :: Typed.TypedName ErrorCore.NestedTermAnnotationError-nestedTermAnnotationErrorNestedTermAnnotationError =- Typed.TypedName (Core.Name "hydra.error.core.NestedTermAnnotationError")---- | DSL updater for the location field of hydra.error.core.NestedTermAnnotationError-nestedTermAnnotationErrorWithLocation :: Typed.TypedTerm ErrorCore.NestedTermAnnotationError -> Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm ErrorCore.NestedTermAnnotationError-nestedTermAnnotationErrorWithLocation original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.core.NestedTermAnnotationError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "location"),- Core.fieldTerm = (Typed.unTypedTerm newVal)}]}))---- | DSL constructor for hydra.error.core.NestedTypeAnnotationError-nestedTypeAnnotationError :: Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm ErrorCore.NestedTypeAnnotationError-nestedTypeAnnotationError location =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.core.NestedTypeAnnotationError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "location"),- Core.fieldTerm = (Typed.unTypedTerm location)}]}))---- | DSL accessor for the location field of hydra.error.core.NestedTypeAnnotationError-nestedTypeAnnotationErrorLocation :: Typed.TypedTerm ErrorCore.NestedTypeAnnotationError -> Typed.TypedTerm Paths.SubtermPath-nestedTypeAnnotationErrorLocation x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.NestedTypeAnnotationError"),- Core.projectionFieldName = (Core.Name "location")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL name token for hydra.error.core.NestedTypeAnnotationError-nestedTypeAnnotationErrorNestedTypeAnnotationError :: Typed.TypedName ErrorCore.NestedTypeAnnotationError-nestedTypeAnnotationErrorNestedTypeAnnotationError =- Typed.TypedName (Core.Name "hydra.error.core.NestedTypeAnnotationError")---- | DSL updater for the location field of hydra.error.core.NestedTypeAnnotationError-nestedTypeAnnotationErrorWithLocation :: Typed.TypedTerm ErrorCore.NestedTypeAnnotationError -> Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm ErrorCore.NestedTypeAnnotationError-nestedTypeAnnotationErrorWithLocation original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.core.NestedTypeAnnotationError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "location"),- Core.fieldTerm = (Typed.unTypedTerm newVal)}]}))---- | DSL constructor for hydra.error.core.NominalTypeKindMismatchError-nominalTypeKindMismatchError :: Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm Core.Name -> Typed.TypedTerm Variants.TypeVariant -> Typed.TypedTerm Variants.TypeVariant -> Typed.TypedTerm ErrorCore.NominalTypeKindMismatchError-nominalTypeKindMismatchError location typeName expectedVariant actualVariant =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.core.NominalTypeKindMismatchError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "location"),- Core.fieldTerm = (Typed.unTypedTerm location)},- Core.Field {- Core.fieldName = (Core.Name "typeName"),- Core.fieldTerm = (Typed.unTypedTerm typeName)},- Core.Field {- Core.fieldName = (Core.Name "expectedVariant"),- Core.fieldTerm = (Typed.unTypedTerm expectedVariant)},- Core.Field {- Core.fieldName = (Core.Name "actualVariant"),- Core.fieldTerm = (Typed.unTypedTerm actualVariant)}]}))---- | DSL accessor for the actualVariant field of hydra.error.core.NominalTypeKindMismatchError-nominalTypeKindMismatchErrorActualVariant :: Typed.TypedTerm ErrorCore.NominalTypeKindMismatchError -> Typed.TypedTerm Variants.TypeVariant-nominalTypeKindMismatchErrorActualVariant x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.NominalTypeKindMismatchError"),- Core.projectionFieldName = (Core.Name "actualVariant")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL accessor for the expectedVariant field of hydra.error.core.NominalTypeKindMismatchError-nominalTypeKindMismatchErrorExpectedVariant :: Typed.TypedTerm ErrorCore.NominalTypeKindMismatchError -> Typed.TypedTerm Variants.TypeVariant-nominalTypeKindMismatchErrorExpectedVariant x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.NominalTypeKindMismatchError"),- Core.projectionFieldName = (Core.Name "expectedVariant")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL accessor for the location field of hydra.error.core.NominalTypeKindMismatchError-nominalTypeKindMismatchErrorLocation :: Typed.TypedTerm ErrorCore.NominalTypeKindMismatchError -> Typed.TypedTerm Paths.SubtermPath-nominalTypeKindMismatchErrorLocation x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.NominalTypeKindMismatchError"),- Core.projectionFieldName = (Core.Name "location")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL name token for hydra.error.core.NominalTypeKindMismatchError-nominalTypeKindMismatchErrorNominalTypeKindMismatchError :: Typed.TypedName ErrorCore.NominalTypeKindMismatchError-nominalTypeKindMismatchErrorNominalTypeKindMismatchError =- Typed.TypedName (Core.Name "hydra.error.core.NominalTypeKindMismatchError")---- | DSL accessor for the typeName field of hydra.error.core.NominalTypeKindMismatchError-nominalTypeKindMismatchErrorTypeName :: Typed.TypedTerm ErrorCore.NominalTypeKindMismatchError -> Typed.TypedTerm Core.Name-nominalTypeKindMismatchErrorTypeName x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.NominalTypeKindMismatchError"),- Core.projectionFieldName = (Core.Name "typeName")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL updater for the actualVariant field of hydra.error.core.NominalTypeKindMismatchError-nominalTypeKindMismatchErrorWithActualVariant :: Typed.TypedTerm ErrorCore.NominalTypeKindMismatchError -> Typed.TypedTerm Variants.TypeVariant -> Typed.TypedTerm ErrorCore.NominalTypeKindMismatchError-nominalTypeKindMismatchErrorWithActualVariant original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.core.NominalTypeKindMismatchError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "location"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.NominalTypeKindMismatchError"),- Core.projectionFieldName = (Core.Name "location")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "typeName"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.NominalTypeKindMismatchError"),- Core.projectionFieldName = (Core.Name "typeName")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "expectedVariant"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.NominalTypeKindMismatchError"),- Core.projectionFieldName = (Core.Name "expectedVariant")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "actualVariant"),- Core.fieldTerm = (Typed.unTypedTerm newVal)}]}))---- | DSL updater for the expectedVariant field of hydra.error.core.NominalTypeKindMismatchError-nominalTypeKindMismatchErrorWithExpectedVariant :: Typed.TypedTerm ErrorCore.NominalTypeKindMismatchError -> Typed.TypedTerm Variants.TypeVariant -> Typed.TypedTerm ErrorCore.NominalTypeKindMismatchError-nominalTypeKindMismatchErrorWithExpectedVariant original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.core.NominalTypeKindMismatchError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "location"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.NominalTypeKindMismatchError"),- Core.projectionFieldName = (Core.Name "location")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "typeName"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.NominalTypeKindMismatchError"),- Core.projectionFieldName = (Core.Name "typeName")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "expectedVariant"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "actualVariant"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.NominalTypeKindMismatchError"),- Core.projectionFieldName = (Core.Name "actualVariant")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL updater for the location field of hydra.error.core.NominalTypeKindMismatchError-nominalTypeKindMismatchErrorWithLocation :: Typed.TypedTerm ErrorCore.NominalTypeKindMismatchError -> Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm ErrorCore.NominalTypeKindMismatchError-nominalTypeKindMismatchErrorWithLocation original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.core.NominalTypeKindMismatchError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "location"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "typeName"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.NominalTypeKindMismatchError"),- Core.projectionFieldName = (Core.Name "typeName")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "expectedVariant"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.NominalTypeKindMismatchError"),- Core.projectionFieldName = (Core.Name "expectedVariant")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "actualVariant"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.NominalTypeKindMismatchError"),- Core.projectionFieldName = (Core.Name "actualVariant")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL updater for the typeName field of hydra.error.core.NominalTypeKindMismatchError-nominalTypeKindMismatchErrorWithTypeName :: Typed.TypedTerm ErrorCore.NominalTypeKindMismatchError -> Typed.TypedTerm Core.Name -> Typed.TypedTerm ErrorCore.NominalTypeKindMismatchError-nominalTypeKindMismatchErrorWithTypeName original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.core.NominalTypeKindMismatchError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "location"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.NominalTypeKindMismatchError"),- Core.projectionFieldName = (Core.Name "location")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "typeName"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "expectedVariant"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.NominalTypeKindMismatchError"),- Core.projectionFieldName = (Core.Name "expectedVariant")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "actualVariant"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.NominalTypeKindMismatchError"),- Core.projectionFieldName = (Core.Name "actualVariant")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL constructor for hydra.error.core.NonComparableMapKeyTypeError-nonComparableMapKeyTypeError :: Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm Core.Type -> Typed.TypedTerm ErrorCore.NonComparableMapKeyTypeError-nonComparableMapKeyTypeError location keyType =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.core.NonComparableMapKeyTypeError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "location"),- Core.fieldTerm = (Typed.unTypedTerm location)},- Core.Field {- Core.fieldName = (Core.Name "keyType"),- Core.fieldTerm = (Typed.unTypedTerm keyType)}]}))---- | DSL accessor for the keyType field of hydra.error.core.NonComparableMapKeyTypeError-nonComparableMapKeyTypeErrorKeyType :: Typed.TypedTerm ErrorCore.NonComparableMapKeyTypeError -> Typed.TypedTerm Core.Type-nonComparableMapKeyTypeErrorKeyType x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.NonComparableMapKeyTypeError"),- Core.projectionFieldName = (Core.Name "keyType")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL accessor for the location field of hydra.error.core.NonComparableMapKeyTypeError-nonComparableMapKeyTypeErrorLocation :: Typed.TypedTerm ErrorCore.NonComparableMapKeyTypeError -> Typed.TypedTerm Paths.SubtermPath-nonComparableMapKeyTypeErrorLocation x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.NonComparableMapKeyTypeError"),- Core.projectionFieldName = (Core.Name "location")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL name token for hydra.error.core.NonComparableMapKeyTypeError-nonComparableMapKeyTypeErrorNonComparableMapKeyTypeError :: Typed.TypedName ErrorCore.NonComparableMapKeyTypeError-nonComparableMapKeyTypeErrorNonComparableMapKeyTypeError =- Typed.TypedName (Core.Name "hydra.error.core.NonComparableMapKeyTypeError")---- | DSL updater for the keyType field of hydra.error.core.NonComparableMapKeyTypeError-nonComparableMapKeyTypeErrorWithKeyType :: Typed.TypedTerm ErrorCore.NonComparableMapKeyTypeError -> Typed.TypedTerm Core.Type -> Typed.TypedTerm ErrorCore.NonComparableMapKeyTypeError-nonComparableMapKeyTypeErrorWithKeyType original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.core.NonComparableMapKeyTypeError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "location"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.NonComparableMapKeyTypeError"),- Core.projectionFieldName = (Core.Name "location")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "keyType"),- Core.fieldTerm = (Typed.unTypedTerm newVal)}]}))---- | DSL updater for the location field of hydra.error.core.NonComparableMapKeyTypeError-nonComparableMapKeyTypeErrorWithLocation :: Typed.TypedTerm ErrorCore.NonComparableMapKeyTypeError -> Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm ErrorCore.NonComparableMapKeyTypeError-nonComparableMapKeyTypeErrorWithLocation original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.core.NonComparableMapKeyTypeError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "location"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "keyType"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.NonComparableMapKeyTypeError"),- Core.projectionFieldName = (Core.Name "keyType")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL constructor for hydra.error.core.NonComparableSetElementTypeError-nonComparableSetElementTypeError :: Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm Core.Type -> Typed.TypedTerm ErrorCore.NonComparableSetElementTypeError-nonComparableSetElementTypeError location elementType =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.core.NonComparableSetElementTypeError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "location"),- Core.fieldTerm = (Typed.unTypedTerm location)},- Core.Field {- Core.fieldName = (Core.Name "elementType"),- Core.fieldTerm = (Typed.unTypedTerm elementType)}]}))---- | DSL accessor for the elementType field of hydra.error.core.NonComparableSetElementTypeError-nonComparableSetElementTypeErrorElementType :: Typed.TypedTerm ErrorCore.NonComparableSetElementTypeError -> Typed.TypedTerm Core.Type-nonComparableSetElementTypeErrorElementType x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.NonComparableSetElementTypeError"),- Core.projectionFieldName = (Core.Name "elementType")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL accessor for the location field of hydra.error.core.NonComparableSetElementTypeError-nonComparableSetElementTypeErrorLocation :: Typed.TypedTerm ErrorCore.NonComparableSetElementTypeError -> Typed.TypedTerm Paths.SubtermPath-nonComparableSetElementTypeErrorLocation x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.NonComparableSetElementTypeError"),- Core.projectionFieldName = (Core.Name "location")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL name token for hydra.error.core.NonComparableSetElementTypeError-nonComparableSetElementTypeErrorNonComparableSetElementTypeError :: Typed.TypedName ErrorCore.NonComparableSetElementTypeError-nonComparableSetElementTypeErrorNonComparableSetElementTypeError =- Typed.TypedName (Core.Name "hydra.error.core.NonComparableSetElementTypeError")---- | DSL updater for the elementType field of hydra.error.core.NonComparableSetElementTypeError-nonComparableSetElementTypeErrorWithElementType :: Typed.TypedTerm ErrorCore.NonComparableSetElementTypeError -> Typed.TypedTerm Core.Type -> Typed.TypedTerm ErrorCore.NonComparableSetElementTypeError-nonComparableSetElementTypeErrorWithElementType original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.core.NonComparableSetElementTypeError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "location"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.NonComparableSetElementTypeError"),- Core.projectionFieldName = (Core.Name "location")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "elementType"),- Core.fieldTerm = (Typed.unTypedTerm newVal)}]}))---- | DSL updater for the location field of hydra.error.core.NonComparableSetElementTypeError-nonComparableSetElementTypeErrorWithLocation :: Typed.TypedTerm ErrorCore.NonComparableSetElementTypeError -> Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm ErrorCore.NonComparableSetElementTypeError-nonComparableSetElementTypeErrorWithLocation original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.core.NonComparableSetElementTypeError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "location"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "elementType"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.NonComparableSetElementTypeError"),- Core.projectionFieldName = (Core.Name "elementType")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL constructor for hydra.error.core.RedundantWrapUnwrapError-redundantWrapUnwrapError :: Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm Core.Name -> Typed.TypedTerm ErrorCore.RedundantWrapUnwrapError-redundantWrapUnwrapError location typeName =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.core.RedundantWrapUnwrapError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "location"),- Core.fieldTerm = (Typed.unTypedTerm location)},- Core.Field {- Core.fieldName = (Core.Name "typeName"),- Core.fieldTerm = (Typed.unTypedTerm typeName)}]}))---- | DSL accessor for the location field of hydra.error.core.RedundantWrapUnwrapError-redundantWrapUnwrapErrorLocation :: Typed.TypedTerm ErrorCore.RedundantWrapUnwrapError -> Typed.TypedTerm Paths.SubtermPath-redundantWrapUnwrapErrorLocation x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.RedundantWrapUnwrapError"),- Core.projectionFieldName = (Core.Name "location")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL name token for hydra.error.core.RedundantWrapUnwrapError-redundantWrapUnwrapErrorRedundantWrapUnwrapError :: Typed.TypedName ErrorCore.RedundantWrapUnwrapError-redundantWrapUnwrapErrorRedundantWrapUnwrapError = Typed.TypedName (Core.Name "hydra.error.core.RedundantWrapUnwrapError")---- | DSL accessor for the typeName field of hydra.error.core.RedundantWrapUnwrapError-redundantWrapUnwrapErrorTypeName :: Typed.TypedTerm ErrorCore.RedundantWrapUnwrapError -> Typed.TypedTerm Core.Name-redundantWrapUnwrapErrorTypeName x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.RedundantWrapUnwrapError"),- Core.projectionFieldName = (Core.Name "typeName")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL updater for the location field of hydra.error.core.RedundantWrapUnwrapError-redundantWrapUnwrapErrorWithLocation :: Typed.TypedTerm ErrorCore.RedundantWrapUnwrapError -> Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm ErrorCore.RedundantWrapUnwrapError-redundantWrapUnwrapErrorWithLocation original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.core.RedundantWrapUnwrapError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "location"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "typeName"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.RedundantWrapUnwrapError"),- Core.projectionFieldName = (Core.Name "typeName")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL updater for the typeName field of hydra.error.core.RedundantWrapUnwrapError-redundantWrapUnwrapErrorWithTypeName :: Typed.TypedTerm ErrorCore.RedundantWrapUnwrapError -> Typed.TypedTerm Core.Name -> Typed.TypedTerm ErrorCore.RedundantWrapUnwrapError-redundantWrapUnwrapErrorWithTypeName original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.core.RedundantWrapUnwrapError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "location"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.RedundantWrapUnwrapError"),- Core.projectionFieldName = (Core.Name "location")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "typeName"),- Core.fieldTerm = (Typed.unTypedTerm newVal)}]}))---- | DSL constructor for hydra.error.core.SelfApplicationError-selfApplicationError :: Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm Core.Name -> Typed.TypedTerm ErrorCore.SelfApplicationError-selfApplicationError location name =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.core.SelfApplicationError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "location"),- Core.fieldTerm = (Typed.unTypedTerm location)},- Core.Field {- Core.fieldName = (Core.Name "name"),- Core.fieldTerm = (Typed.unTypedTerm name)}]}))---- | DSL accessor for the location field of hydra.error.core.SelfApplicationError-selfApplicationErrorLocation :: Typed.TypedTerm ErrorCore.SelfApplicationError -> Typed.TypedTerm Paths.SubtermPath-selfApplicationErrorLocation x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.SelfApplicationError"),- Core.projectionFieldName = (Core.Name "location")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL accessor for the name field of hydra.error.core.SelfApplicationError-selfApplicationErrorName :: Typed.TypedTerm ErrorCore.SelfApplicationError -> Typed.TypedTerm Core.Name-selfApplicationErrorName x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.SelfApplicationError"),- Core.projectionFieldName = (Core.Name "name")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL name token for hydra.error.core.SelfApplicationError-selfApplicationErrorSelfApplicationError :: Typed.TypedName ErrorCore.SelfApplicationError-selfApplicationErrorSelfApplicationError = Typed.TypedName (Core.Name "hydra.error.core.SelfApplicationError")---- | DSL updater for the location field of hydra.error.core.SelfApplicationError-selfApplicationErrorWithLocation :: Typed.TypedTerm ErrorCore.SelfApplicationError -> Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm ErrorCore.SelfApplicationError-selfApplicationErrorWithLocation original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.core.SelfApplicationError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "location"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "name"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.SelfApplicationError"),- Core.projectionFieldName = (Core.Name "name")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL updater for the name field of hydra.error.core.SelfApplicationError-selfApplicationErrorWithName :: Typed.TypedTerm ErrorCore.SelfApplicationError -> Typed.TypedTerm Core.Name -> Typed.TypedTerm ErrorCore.SelfApplicationError-selfApplicationErrorWithName original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.core.SelfApplicationError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "location"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.SelfApplicationError"),- Core.projectionFieldName = (Core.Name "location")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "name"),- Core.fieldTerm = (Typed.unTypedTerm newVal)}]}))---- | DSL constructor for hydra.error.core.SingleVariantUnionError-singleVariantUnionError :: Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm Core.Name -> Typed.TypedTerm ErrorCore.SingleVariantUnionError-singleVariantUnionError location fieldName =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.core.SingleVariantUnionError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "location"),- Core.fieldTerm = (Typed.unTypedTerm location)},- Core.Field {- Core.fieldName = (Core.Name "fieldName"),- Core.fieldTerm = (Typed.unTypedTerm fieldName)}]}))---- | DSL accessor for the fieldName field of hydra.error.core.SingleVariantUnionError-singleVariantUnionErrorFieldName :: Typed.TypedTerm ErrorCore.SingleVariantUnionError -> Typed.TypedTerm Core.Name-singleVariantUnionErrorFieldName x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.SingleVariantUnionError"),- Core.projectionFieldName = (Core.Name "fieldName")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL accessor for the location field of hydra.error.core.SingleVariantUnionError-singleVariantUnionErrorLocation :: Typed.TypedTerm ErrorCore.SingleVariantUnionError -> Typed.TypedTerm Paths.SubtermPath-singleVariantUnionErrorLocation x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.SingleVariantUnionError"),- Core.projectionFieldName = (Core.Name "location")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL name token for hydra.error.core.SingleVariantUnionError-singleVariantUnionErrorSingleVariantUnionError :: Typed.TypedName ErrorCore.SingleVariantUnionError-singleVariantUnionErrorSingleVariantUnionError = Typed.TypedName (Core.Name "hydra.error.core.SingleVariantUnionError")---- | DSL updater for the fieldName field of hydra.error.core.SingleVariantUnionError-singleVariantUnionErrorWithFieldName :: Typed.TypedTerm ErrorCore.SingleVariantUnionError -> Typed.TypedTerm Core.Name -> Typed.TypedTerm ErrorCore.SingleVariantUnionError-singleVariantUnionErrorWithFieldName original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.core.SingleVariantUnionError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "location"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.SingleVariantUnionError"),- Core.projectionFieldName = (Core.Name "location")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "fieldName"),- Core.fieldTerm = (Typed.unTypedTerm newVal)}]}))---- | DSL updater for the location field of hydra.error.core.SingleVariantUnionError-singleVariantUnionErrorWithLocation :: Typed.TypedTerm ErrorCore.SingleVariantUnionError -> Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm ErrorCore.SingleVariantUnionError-singleVariantUnionErrorWithLocation original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.core.SingleVariantUnionError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "location"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "fieldName"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.SingleVariantUnionError"),- Core.projectionFieldName = (Core.Name "fieldName")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL constructor for hydra.error.core.TermVariableShadowingError-termVariableShadowingError :: Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm Core.Name -> Typed.TypedTerm ErrorCore.TermVariableShadowingError-termVariableShadowingError location name =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.core.TermVariableShadowingError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "location"),- Core.fieldTerm = (Typed.unTypedTerm location)},- Core.Field {- Core.fieldName = (Core.Name "name"),- Core.fieldTerm = (Typed.unTypedTerm name)}]}))---- | DSL accessor for the location field of hydra.error.core.TermVariableShadowingError-termVariableShadowingErrorLocation :: Typed.TypedTerm ErrorCore.TermVariableShadowingError -> Typed.TypedTerm Paths.SubtermPath-termVariableShadowingErrorLocation x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.TermVariableShadowingError"),- Core.projectionFieldName = (Core.Name "location")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL accessor for the name field of hydra.error.core.TermVariableShadowingError-termVariableShadowingErrorName :: Typed.TypedTerm ErrorCore.TermVariableShadowingError -> Typed.TypedTerm Core.Name-termVariableShadowingErrorName x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.TermVariableShadowingError"),- Core.projectionFieldName = (Core.Name "name")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL name token for hydra.error.core.TermVariableShadowingError-termVariableShadowingErrorTermVariableShadowingError :: Typed.TypedName ErrorCore.TermVariableShadowingError-termVariableShadowingErrorTermVariableShadowingError =- Typed.TypedName (Core.Name "hydra.error.core.TermVariableShadowingError")---- | DSL updater for the location field of hydra.error.core.TermVariableShadowingError-termVariableShadowingErrorWithLocation :: Typed.TypedTerm ErrorCore.TermVariableShadowingError -> Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm ErrorCore.TermVariableShadowingError-termVariableShadowingErrorWithLocation original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.core.TermVariableShadowingError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "location"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "name"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.TermVariableShadowingError"),- Core.projectionFieldName = (Core.Name "name")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL updater for the name field of hydra.error.core.TermVariableShadowingError-termVariableShadowingErrorWithName :: Typed.TypedTerm ErrorCore.TermVariableShadowingError -> Typed.TypedTerm Core.Name -> Typed.TypedTerm ErrorCore.TermVariableShadowingError-termVariableShadowingErrorWithName original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.core.TermVariableShadowingError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "location"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.TermVariableShadowingError"),- Core.projectionFieldName = (Core.Name "location")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "name"),- Core.fieldTerm = (Typed.unTypedTerm newVal)}]}))---- | DSL constructor for hydra.error.core.TypeVariableShadowingInForallError-typeVariableShadowingInForallError :: Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm Core.Name -> Typed.TypedTerm ErrorCore.TypeVariableShadowingInForallError-typeVariableShadowingInForallError location name =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.core.TypeVariableShadowingInForallError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "location"),- Core.fieldTerm = (Typed.unTypedTerm location)},- Core.Field {- Core.fieldName = (Core.Name "name"),- Core.fieldTerm = (Typed.unTypedTerm name)}]}))---- | DSL accessor for the location field of hydra.error.core.TypeVariableShadowingInForallError-typeVariableShadowingInForallErrorLocation :: Typed.TypedTerm ErrorCore.TypeVariableShadowingInForallError -> Typed.TypedTerm Paths.SubtermPath-typeVariableShadowingInForallErrorLocation x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.TypeVariableShadowingInForallError"),- Core.projectionFieldName = (Core.Name "location")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL accessor for the name field of hydra.error.core.TypeVariableShadowingInForallError-typeVariableShadowingInForallErrorName :: Typed.TypedTerm ErrorCore.TypeVariableShadowingInForallError -> Typed.TypedTerm Core.Name-typeVariableShadowingInForallErrorName x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.TypeVariableShadowingInForallError"),- Core.projectionFieldName = (Core.Name "name")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL name token for hydra.error.core.TypeVariableShadowingInForallError-typeVariableShadowingInForallErrorTypeVariableShadowingInForallError :: Typed.TypedName ErrorCore.TypeVariableShadowingInForallError-typeVariableShadowingInForallErrorTypeVariableShadowingInForallError =- Typed.TypedName (Core.Name "hydra.error.core.TypeVariableShadowingInForallError")---- | DSL updater for the location field of hydra.error.core.TypeVariableShadowingInForallError-typeVariableShadowingInForallErrorWithLocation :: Typed.TypedTerm ErrorCore.TypeVariableShadowingInForallError -> Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm ErrorCore.TypeVariableShadowingInForallError-typeVariableShadowingInForallErrorWithLocation original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.core.TypeVariableShadowingInForallError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "location"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "name"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.TypeVariableShadowingInForallError"),- Core.projectionFieldName = (Core.Name "name")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL updater for the name field of hydra.error.core.TypeVariableShadowingInForallError-typeVariableShadowingInForallErrorWithName :: Typed.TypedTerm ErrorCore.TypeVariableShadowingInForallError -> Typed.TypedTerm Core.Name -> Typed.TypedTerm ErrorCore.TypeVariableShadowingInForallError-typeVariableShadowingInForallErrorWithName original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.core.TypeVariableShadowingInForallError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "location"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.TypeVariableShadowingInForallError"),- Core.projectionFieldName = (Core.Name "location")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "name"),- Core.fieldTerm = (Typed.unTypedTerm newVal)}]}))---- | DSL constructor for hydra.error.core.TypeVariableShadowingInTypeLambdaError-typeVariableShadowingInTypeLambdaError :: Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm Core.Name -> Typed.TypedTerm ErrorCore.TypeVariableShadowingInTypeLambdaError-typeVariableShadowingInTypeLambdaError location name =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.core.TypeVariableShadowingInTypeLambdaError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "location"),- Core.fieldTerm = (Typed.unTypedTerm location)},- Core.Field {- Core.fieldName = (Core.Name "name"),- Core.fieldTerm = (Typed.unTypedTerm name)}]}))---- | DSL accessor for the location field of hydra.error.core.TypeVariableShadowingInTypeLambdaError-typeVariableShadowingInTypeLambdaErrorLocation :: Typed.TypedTerm ErrorCore.TypeVariableShadowingInTypeLambdaError -> Typed.TypedTerm Paths.SubtermPath-typeVariableShadowingInTypeLambdaErrorLocation x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.TypeVariableShadowingInTypeLambdaError"),- Core.projectionFieldName = (Core.Name "location")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL accessor for the name field of hydra.error.core.TypeVariableShadowingInTypeLambdaError-typeVariableShadowingInTypeLambdaErrorName :: Typed.TypedTerm ErrorCore.TypeVariableShadowingInTypeLambdaError -> Typed.TypedTerm Core.Name-typeVariableShadowingInTypeLambdaErrorName x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.TypeVariableShadowingInTypeLambdaError"),- Core.projectionFieldName = (Core.Name "name")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL name token for hydra.error.core.TypeVariableShadowingInTypeLambdaError-typeVariableShadowingInTypeLambdaErrorTypeVariableShadowingInTypeLambdaError :: Typed.TypedName ErrorCore.TypeVariableShadowingInTypeLambdaError-typeVariableShadowingInTypeLambdaErrorTypeVariableShadowingInTypeLambdaError =- Typed.TypedName (Core.Name "hydra.error.core.TypeVariableShadowingInTypeLambdaError")---- | DSL updater for the location field of hydra.error.core.TypeVariableShadowingInTypeLambdaError-typeVariableShadowingInTypeLambdaErrorWithLocation :: Typed.TypedTerm ErrorCore.TypeVariableShadowingInTypeLambdaError -> Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm ErrorCore.TypeVariableShadowingInTypeLambdaError-typeVariableShadowingInTypeLambdaErrorWithLocation original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.core.TypeVariableShadowingInTypeLambdaError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "location"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "name"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.TypeVariableShadowingInTypeLambdaError"),- Core.projectionFieldName = (Core.Name "name")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL updater for the name field of hydra.error.core.TypeVariableShadowingInTypeLambdaError-typeVariableShadowingInTypeLambdaErrorWithName :: Typed.TypedTerm ErrorCore.TypeVariableShadowingInTypeLambdaError -> Typed.TypedTerm Core.Name -> Typed.TypedTerm ErrorCore.TypeVariableShadowingInTypeLambdaError-typeVariableShadowingInTypeLambdaErrorWithName original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.core.TypeVariableShadowingInTypeLambdaError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "location"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.TypeVariableShadowingInTypeLambdaError"),- Core.projectionFieldName = (Core.Name "location")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "name"),- Core.fieldTerm = (Typed.unTypedTerm newVal)}]}))---- | DSL constructor for hydra.error.core.UndeclaredVariantError-undeclaredVariantError :: Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm Core.Name -> Typed.TypedTerm Core.Name -> Typed.TypedTerm ErrorCore.UndeclaredVariantError-undeclaredVariantError location typeName variantName =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.core.UndeclaredVariantError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "location"),- Core.fieldTerm = (Typed.unTypedTerm location)},- Core.Field {- Core.fieldName = (Core.Name "typeName"),- Core.fieldTerm = (Typed.unTypedTerm typeName)},- Core.Field {- Core.fieldName = (Core.Name "variantName"),- Core.fieldTerm = (Typed.unTypedTerm variantName)}]}))---- | DSL accessor for the location field of hydra.error.core.UndeclaredVariantError-undeclaredVariantErrorLocation :: Typed.TypedTerm ErrorCore.UndeclaredVariantError -> Typed.TypedTerm Paths.SubtermPath-undeclaredVariantErrorLocation x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.UndeclaredVariantError"),- Core.projectionFieldName = (Core.Name "location")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL accessor for the typeName field of hydra.error.core.UndeclaredVariantError-undeclaredVariantErrorTypeName :: Typed.TypedTerm ErrorCore.UndeclaredVariantError -> Typed.TypedTerm Core.Name-undeclaredVariantErrorTypeName x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.UndeclaredVariantError"),- Core.projectionFieldName = (Core.Name "typeName")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL name token for hydra.error.core.UndeclaredVariantError-undeclaredVariantErrorUndeclaredVariantError :: Typed.TypedName ErrorCore.UndeclaredVariantError-undeclaredVariantErrorUndeclaredVariantError = Typed.TypedName (Core.Name "hydra.error.core.UndeclaredVariantError")---- | DSL accessor for the variantName field of hydra.error.core.UndeclaredVariantError-undeclaredVariantErrorVariantName :: Typed.TypedTerm ErrorCore.UndeclaredVariantError -> Typed.TypedTerm Core.Name-undeclaredVariantErrorVariantName x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.UndeclaredVariantError"),- Core.projectionFieldName = (Core.Name "variantName")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL updater for the location field of hydra.error.core.UndeclaredVariantError-undeclaredVariantErrorWithLocation :: Typed.TypedTerm ErrorCore.UndeclaredVariantError -> Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm ErrorCore.UndeclaredVariantError-undeclaredVariantErrorWithLocation original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.core.UndeclaredVariantError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "location"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "typeName"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.UndeclaredVariantError"),- Core.projectionFieldName = (Core.Name "typeName")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "variantName"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.UndeclaredVariantError"),- Core.projectionFieldName = (Core.Name "variantName")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL updater for the typeName field of hydra.error.core.UndeclaredVariantError-undeclaredVariantErrorWithTypeName :: Typed.TypedTerm ErrorCore.UndeclaredVariantError -> Typed.TypedTerm Core.Name -> Typed.TypedTerm ErrorCore.UndeclaredVariantError-undeclaredVariantErrorWithTypeName original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.core.UndeclaredVariantError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "location"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.UndeclaredVariantError"),- Core.projectionFieldName = (Core.Name "location")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "typeName"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "variantName"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.UndeclaredVariantError"),- Core.projectionFieldName = (Core.Name "variantName")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL updater for the variantName field of hydra.error.core.UndeclaredVariantError-undeclaredVariantErrorWithVariantName :: Typed.TypedTerm ErrorCore.UndeclaredVariantError -> Typed.TypedTerm Core.Name -> Typed.TypedTerm ErrorCore.UndeclaredVariantError-undeclaredVariantErrorWithVariantName original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.core.UndeclaredVariantError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "location"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.UndeclaredVariantError"),- Core.projectionFieldName = (Core.Name "location")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "typeName"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.UndeclaredVariantError"),- Core.projectionFieldName = (Core.Name "typeName")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "variantName"),- Core.fieldTerm = (Typed.unTypedTerm newVal)}]}))---- | DSL constructor for hydra.error.core.UndefinedFieldError-undefinedFieldError :: Typed.TypedTerm Core.Name -> Typed.TypedTerm Core.Name -> Typed.TypedTerm ErrorCore.UndefinedFieldError-undefinedFieldError fieldName typeName =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.core.UndefinedFieldError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "fieldName"),- Core.fieldTerm = (Typed.unTypedTerm fieldName)},- Core.Field {- Core.fieldName = (Core.Name "typeName"),- Core.fieldTerm = (Typed.unTypedTerm typeName)}]}))---- | DSL accessor for the fieldName field of hydra.error.core.UndefinedFieldError-undefinedFieldErrorFieldName :: Typed.TypedTerm ErrorCore.UndefinedFieldError -> Typed.TypedTerm Core.Name-undefinedFieldErrorFieldName x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.UndefinedFieldError"),- Core.projectionFieldName = (Core.Name "fieldName")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL accessor for the typeName field of hydra.error.core.UndefinedFieldError-undefinedFieldErrorTypeName :: Typed.TypedTerm ErrorCore.UndefinedFieldError -> Typed.TypedTerm Core.Name-undefinedFieldErrorTypeName x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.UndefinedFieldError"),- Core.projectionFieldName = (Core.Name "typeName")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL name token for hydra.error.core.UndefinedFieldError-undefinedFieldErrorUndefinedFieldError :: Typed.TypedName ErrorCore.UndefinedFieldError-undefinedFieldErrorUndefinedFieldError = Typed.TypedName (Core.Name "hydra.error.core.UndefinedFieldError")---- | DSL updater for the fieldName field of hydra.error.core.UndefinedFieldError-undefinedFieldErrorWithFieldName :: Typed.TypedTerm ErrorCore.UndefinedFieldError -> Typed.TypedTerm Core.Name -> Typed.TypedTerm ErrorCore.UndefinedFieldError-undefinedFieldErrorWithFieldName original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.core.UndefinedFieldError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "fieldName"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "typeName"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.UndefinedFieldError"),- Core.projectionFieldName = (Core.Name "typeName")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL updater for the typeName field of hydra.error.core.UndefinedFieldError-undefinedFieldErrorWithTypeName :: Typed.TypedTerm ErrorCore.UndefinedFieldError -> Typed.TypedTerm Core.Name -> Typed.TypedTerm ErrorCore.UndefinedFieldError-undefinedFieldErrorWithTypeName original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.core.UndefinedFieldError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "fieldName"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.UndefinedFieldError"),- Core.projectionFieldName = (Core.Name "fieldName")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "typeName"),- Core.fieldTerm = (Typed.unTypedTerm newVal)}]}))---- | DSL constructor for hydra.error.core.UndefinedTermVariableError-undefinedTermVariableError :: Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm Core.Name -> Typed.TypedTerm ErrorCore.UndefinedTermVariableError-undefinedTermVariableError location name =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.core.UndefinedTermVariableError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "location"),- Core.fieldTerm = (Typed.unTypedTerm location)},- Core.Field {- Core.fieldName = (Core.Name "name"),- Core.fieldTerm = (Typed.unTypedTerm name)}]}))---- | DSL accessor for the location field of hydra.error.core.UndefinedTermVariableError-undefinedTermVariableErrorLocation :: Typed.TypedTerm ErrorCore.UndefinedTermVariableError -> Typed.TypedTerm Paths.SubtermPath-undefinedTermVariableErrorLocation x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.UndefinedTermVariableError"),- Core.projectionFieldName = (Core.Name "location")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL accessor for the name field of hydra.error.core.UndefinedTermVariableError-undefinedTermVariableErrorName :: Typed.TypedTerm ErrorCore.UndefinedTermVariableError -> Typed.TypedTerm Core.Name-undefinedTermVariableErrorName x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.UndefinedTermVariableError"),- Core.projectionFieldName = (Core.Name "name")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL name token for hydra.error.core.UndefinedTermVariableError-undefinedTermVariableErrorUndefinedTermVariableError :: Typed.TypedName ErrorCore.UndefinedTermVariableError-undefinedTermVariableErrorUndefinedTermVariableError =- Typed.TypedName (Core.Name "hydra.error.core.UndefinedTermVariableError")---- | DSL updater for the location field of hydra.error.core.UndefinedTermVariableError-undefinedTermVariableErrorWithLocation :: Typed.TypedTerm ErrorCore.UndefinedTermVariableError -> Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm ErrorCore.UndefinedTermVariableError-undefinedTermVariableErrorWithLocation original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.core.UndefinedTermVariableError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "location"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "name"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.UndefinedTermVariableError"),- Core.projectionFieldName = (Core.Name "name")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL updater for the name field of hydra.error.core.UndefinedTermVariableError-undefinedTermVariableErrorWithName :: Typed.TypedTerm ErrorCore.UndefinedTermVariableError -> Typed.TypedTerm Core.Name -> Typed.TypedTerm ErrorCore.UndefinedTermVariableError-undefinedTermVariableErrorWithName original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.core.UndefinedTermVariableError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "location"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.UndefinedTermVariableError"),- Core.projectionFieldName = (Core.Name "location")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "name"),- Core.fieldTerm = (Typed.unTypedTerm newVal)}]}))---- | DSL constructor for hydra.error.core.UndefinedTypeVariableError-undefinedTypeVariableError :: Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm Core.Name -> Typed.TypedTerm ErrorCore.UndefinedTypeVariableError-undefinedTypeVariableError location name =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.core.UndefinedTypeVariableError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "location"),- Core.fieldTerm = (Typed.unTypedTerm location)},- Core.Field {- Core.fieldName = (Core.Name "name"),- Core.fieldTerm = (Typed.unTypedTerm name)}]}))---- | DSL accessor for the location field of hydra.error.core.UndefinedTypeVariableError-undefinedTypeVariableErrorLocation :: Typed.TypedTerm ErrorCore.UndefinedTypeVariableError -> Typed.TypedTerm Paths.SubtermPath-undefinedTypeVariableErrorLocation x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.UndefinedTypeVariableError"),- Core.projectionFieldName = (Core.Name "location")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL accessor for the name field of hydra.error.core.UndefinedTypeVariableError-undefinedTypeVariableErrorName :: Typed.TypedTerm ErrorCore.UndefinedTypeVariableError -> Typed.TypedTerm Core.Name-undefinedTypeVariableErrorName x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.UndefinedTypeVariableError"),- Core.projectionFieldName = (Core.Name "name")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL name token for hydra.error.core.UndefinedTypeVariableError-undefinedTypeVariableErrorUndefinedTypeVariableError :: Typed.TypedName ErrorCore.UndefinedTypeVariableError-undefinedTypeVariableErrorUndefinedTypeVariableError =- Typed.TypedName (Core.Name "hydra.error.core.UndefinedTypeVariableError")---- | DSL updater for the location field of hydra.error.core.UndefinedTypeVariableError-undefinedTypeVariableErrorWithLocation :: Typed.TypedTerm ErrorCore.UndefinedTypeVariableError -> Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm ErrorCore.UndefinedTypeVariableError-undefinedTypeVariableErrorWithLocation original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.core.UndefinedTypeVariableError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "location"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "name"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.UndefinedTypeVariableError"),- Core.projectionFieldName = (Core.Name "name")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL updater for the name field of hydra.error.core.UndefinedTypeVariableError-undefinedTypeVariableErrorWithName :: Typed.TypedTerm ErrorCore.UndefinedTypeVariableError -> Typed.TypedTerm Core.Name -> Typed.TypedTerm ErrorCore.UndefinedTypeVariableError-undefinedTypeVariableErrorWithName original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.core.UndefinedTypeVariableError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "location"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.UndefinedTypeVariableError"),- Core.projectionFieldName = (Core.Name "location")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "name"),- Core.fieldTerm = (Typed.unTypedTerm newVal)}]}))---- | DSL constructor for hydra.error.core.UndefinedTypeVariableInBindingTypeError-undefinedTypeVariableInBindingTypeError :: Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm Core.Name -> Typed.TypedTerm ErrorCore.UndefinedTypeVariableInBindingTypeError-undefinedTypeVariableInBindingTypeError location name =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.core.UndefinedTypeVariableInBindingTypeError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "location"),- Core.fieldTerm = (Typed.unTypedTerm location)},- Core.Field {- Core.fieldName = (Core.Name "name"),- Core.fieldTerm = (Typed.unTypedTerm name)}]}))---- | DSL accessor for the location field of hydra.error.core.UndefinedTypeVariableInBindingTypeError-undefinedTypeVariableInBindingTypeErrorLocation :: Typed.TypedTerm ErrorCore.UndefinedTypeVariableInBindingTypeError -> Typed.TypedTerm Paths.SubtermPath-undefinedTypeVariableInBindingTypeErrorLocation x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.UndefinedTypeVariableInBindingTypeError"),- Core.projectionFieldName = (Core.Name "location")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL accessor for the name field of hydra.error.core.UndefinedTypeVariableInBindingTypeError-undefinedTypeVariableInBindingTypeErrorName :: Typed.TypedTerm ErrorCore.UndefinedTypeVariableInBindingTypeError -> Typed.TypedTerm Core.Name-undefinedTypeVariableInBindingTypeErrorName x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.UndefinedTypeVariableInBindingTypeError"),- Core.projectionFieldName = (Core.Name "name")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL name token for hydra.error.core.UndefinedTypeVariableInBindingTypeError-undefinedTypeVariableInBindingTypeErrorUndefinedTypeVariableInBindingTypeError :: Typed.TypedName ErrorCore.UndefinedTypeVariableInBindingTypeError-undefinedTypeVariableInBindingTypeErrorUndefinedTypeVariableInBindingTypeError =- Typed.TypedName (Core.Name "hydra.error.core.UndefinedTypeVariableInBindingTypeError")---- | DSL updater for the location field of hydra.error.core.UndefinedTypeVariableInBindingTypeError-undefinedTypeVariableInBindingTypeErrorWithLocation :: Typed.TypedTerm ErrorCore.UndefinedTypeVariableInBindingTypeError -> Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm ErrorCore.UndefinedTypeVariableInBindingTypeError-undefinedTypeVariableInBindingTypeErrorWithLocation original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.core.UndefinedTypeVariableInBindingTypeError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "location"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "name"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.UndefinedTypeVariableInBindingTypeError"),- Core.projectionFieldName = (Core.Name "name")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL updater for the name field of hydra.error.core.UndefinedTypeVariableInBindingTypeError-undefinedTypeVariableInBindingTypeErrorWithName :: Typed.TypedTerm ErrorCore.UndefinedTypeVariableInBindingTypeError -> Typed.TypedTerm Core.Name -> Typed.TypedTerm ErrorCore.UndefinedTypeVariableInBindingTypeError-undefinedTypeVariableInBindingTypeErrorWithName original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.core.UndefinedTypeVariableInBindingTypeError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "location"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.UndefinedTypeVariableInBindingTypeError"),- Core.projectionFieldName = (Core.Name "location")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "name"),- Core.fieldTerm = (Typed.unTypedTerm newVal)}]}))---- | DSL constructor for hydra.error.core.UndefinedTypeVariableInLambdaDomainError-undefinedTypeVariableInLambdaDomainError :: Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm Core.Name -> Typed.TypedTerm ErrorCore.UndefinedTypeVariableInLambdaDomainError-undefinedTypeVariableInLambdaDomainError location name =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.core.UndefinedTypeVariableInLambdaDomainError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "location"),- Core.fieldTerm = (Typed.unTypedTerm location)},- Core.Field {- Core.fieldName = (Core.Name "name"),- Core.fieldTerm = (Typed.unTypedTerm name)}]}))---- | DSL accessor for the location field of hydra.error.core.UndefinedTypeVariableInLambdaDomainError-undefinedTypeVariableInLambdaDomainErrorLocation :: Typed.TypedTerm ErrorCore.UndefinedTypeVariableInLambdaDomainError -> Typed.TypedTerm Paths.SubtermPath-undefinedTypeVariableInLambdaDomainErrorLocation x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.UndefinedTypeVariableInLambdaDomainError"),- Core.projectionFieldName = (Core.Name "location")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL accessor for the name field of hydra.error.core.UndefinedTypeVariableInLambdaDomainError-undefinedTypeVariableInLambdaDomainErrorName :: Typed.TypedTerm ErrorCore.UndefinedTypeVariableInLambdaDomainError -> Typed.TypedTerm Core.Name-undefinedTypeVariableInLambdaDomainErrorName x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.UndefinedTypeVariableInLambdaDomainError"),- Core.projectionFieldName = (Core.Name "name")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL name token for hydra.error.core.UndefinedTypeVariableInLambdaDomainError-undefinedTypeVariableInLambdaDomainErrorUndefinedTypeVariableInLambdaDomainError :: Typed.TypedName ErrorCore.UndefinedTypeVariableInLambdaDomainError-undefinedTypeVariableInLambdaDomainErrorUndefinedTypeVariableInLambdaDomainError =- Typed.TypedName (Core.Name "hydra.error.core.UndefinedTypeVariableInLambdaDomainError")---- | DSL updater for the location field of hydra.error.core.UndefinedTypeVariableInLambdaDomainError-undefinedTypeVariableInLambdaDomainErrorWithLocation :: Typed.TypedTerm ErrorCore.UndefinedTypeVariableInLambdaDomainError -> Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm ErrorCore.UndefinedTypeVariableInLambdaDomainError-undefinedTypeVariableInLambdaDomainErrorWithLocation original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.core.UndefinedTypeVariableInLambdaDomainError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "location"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "name"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.UndefinedTypeVariableInLambdaDomainError"),- Core.projectionFieldName = (Core.Name "name")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL updater for the name field of hydra.error.core.UndefinedTypeVariableInLambdaDomainError-undefinedTypeVariableInLambdaDomainErrorWithName :: Typed.TypedTerm ErrorCore.UndefinedTypeVariableInLambdaDomainError -> Typed.TypedTerm Core.Name -> Typed.TypedTerm ErrorCore.UndefinedTypeVariableInLambdaDomainError-undefinedTypeVariableInLambdaDomainErrorWithName original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.core.UndefinedTypeVariableInLambdaDomainError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "location"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.UndefinedTypeVariableInLambdaDomainError"),- Core.projectionFieldName = (Core.Name "location")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "name"),- Core.fieldTerm = (Typed.unTypedTerm newVal)}]}))---- | DSL constructor for hydra.error.core.UndefinedTypeVariableInTypeApplicationError-undefinedTypeVariableInTypeApplicationError :: Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm Core.Name -> Typed.TypedTerm ErrorCore.UndefinedTypeVariableInTypeApplicationError-undefinedTypeVariableInTypeApplicationError location name =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.core.UndefinedTypeVariableInTypeApplicationError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "location"),- Core.fieldTerm = (Typed.unTypedTerm location)},- Core.Field {- Core.fieldName = (Core.Name "name"),- Core.fieldTerm = (Typed.unTypedTerm name)}]}))---- | DSL accessor for the location field of hydra.error.core.UndefinedTypeVariableInTypeApplicationError-undefinedTypeVariableInTypeApplicationErrorLocation :: Typed.TypedTerm ErrorCore.UndefinedTypeVariableInTypeApplicationError -> Typed.TypedTerm Paths.SubtermPath-undefinedTypeVariableInTypeApplicationErrorLocation x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.UndefinedTypeVariableInTypeApplicationError"),- Core.projectionFieldName = (Core.Name "location")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL accessor for the name field of hydra.error.core.UndefinedTypeVariableInTypeApplicationError-undefinedTypeVariableInTypeApplicationErrorName :: Typed.TypedTerm ErrorCore.UndefinedTypeVariableInTypeApplicationError -> Typed.TypedTerm Core.Name-undefinedTypeVariableInTypeApplicationErrorName x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.UndefinedTypeVariableInTypeApplicationError"),- Core.projectionFieldName = (Core.Name "name")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL name token for hydra.error.core.UndefinedTypeVariableInTypeApplicationError-undefinedTypeVariableInTypeApplicationErrorUndefinedTypeVariableInTypeApplicationError :: Typed.TypedName ErrorCore.UndefinedTypeVariableInTypeApplicationError-undefinedTypeVariableInTypeApplicationErrorUndefinedTypeVariableInTypeApplicationError =- Typed.TypedName (Core.Name "hydra.error.core.UndefinedTypeVariableInTypeApplicationError")---- | DSL updater for the location field of hydra.error.core.UndefinedTypeVariableInTypeApplicationError-undefinedTypeVariableInTypeApplicationErrorWithLocation :: Typed.TypedTerm ErrorCore.UndefinedTypeVariableInTypeApplicationError -> Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm ErrorCore.UndefinedTypeVariableInTypeApplicationError-undefinedTypeVariableInTypeApplicationErrorWithLocation original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.core.UndefinedTypeVariableInTypeApplicationError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "location"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "name"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.UndefinedTypeVariableInTypeApplicationError"),- Core.projectionFieldName = (Core.Name "name")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL updater for the name field of hydra.error.core.UndefinedTypeVariableInTypeApplicationError-undefinedTypeVariableInTypeApplicationErrorWithName :: Typed.TypedTerm ErrorCore.UndefinedTypeVariableInTypeApplicationError -> Typed.TypedTerm Core.Name -> Typed.TypedTerm ErrorCore.UndefinedTypeVariableInTypeApplicationError-undefinedTypeVariableInTypeApplicationErrorWithName original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.core.UndefinedTypeVariableInTypeApplicationError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "location"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.UndefinedTypeVariableInTypeApplicationError"),- Core.projectionFieldName = (Core.Name "location")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "name"),- Core.fieldTerm = (Typed.unTypedTerm newVal)}]}))---- | DSL constructor for hydra.error.core.UnexpectedTermVariantError-unexpectedTermVariantError :: Typed.TypedTerm Variants.TermVariant -> Typed.TypedTerm Core.Term -> Typed.TypedTerm ErrorCore.UnexpectedTermVariantError-unexpectedTermVariantError expectedVariant actualTerm =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.core.UnexpectedTermVariantError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "expectedVariant"),- Core.fieldTerm = (Typed.unTypedTerm expectedVariant)},- Core.Field {- Core.fieldName = (Core.Name "actualTerm"),- Core.fieldTerm = (Typed.unTypedTerm actualTerm)}]}))---- | DSL accessor for the actualTerm field of hydra.error.core.UnexpectedTermVariantError-unexpectedTermVariantErrorActualTerm :: Typed.TypedTerm ErrorCore.UnexpectedTermVariantError -> Typed.TypedTerm Core.Term-unexpectedTermVariantErrorActualTerm x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.UnexpectedTermVariantError"),- Core.projectionFieldName = (Core.Name "actualTerm")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL accessor for the expectedVariant field of hydra.error.core.UnexpectedTermVariantError-unexpectedTermVariantErrorExpectedVariant :: Typed.TypedTerm ErrorCore.UnexpectedTermVariantError -> Typed.TypedTerm Variants.TermVariant-unexpectedTermVariantErrorExpectedVariant x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.UnexpectedTermVariantError"),- Core.projectionFieldName = (Core.Name "expectedVariant")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL name token for hydra.error.core.UnexpectedTermVariantError-unexpectedTermVariantErrorUnexpectedTermVariantError :: Typed.TypedName ErrorCore.UnexpectedTermVariantError-unexpectedTermVariantErrorUnexpectedTermVariantError =- Typed.TypedName (Core.Name "hydra.error.core.UnexpectedTermVariantError")---- | DSL updater for the actualTerm field of hydra.error.core.UnexpectedTermVariantError-unexpectedTermVariantErrorWithActualTerm :: Typed.TypedTerm ErrorCore.UnexpectedTermVariantError -> Typed.TypedTerm Core.Term -> Typed.TypedTerm ErrorCore.UnexpectedTermVariantError-unexpectedTermVariantErrorWithActualTerm original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.core.UnexpectedTermVariantError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "expectedVariant"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.UnexpectedTermVariantError"),- Core.projectionFieldName = (Core.Name "expectedVariant")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "actualTerm"),- Core.fieldTerm = (Typed.unTypedTerm newVal)}]}))---- | DSL updater for the expectedVariant field of hydra.error.core.UnexpectedTermVariantError-unexpectedTermVariantErrorWithExpectedVariant :: Typed.TypedTerm ErrorCore.UnexpectedTermVariantError -> Typed.TypedTerm Variants.TermVariant -> Typed.TypedTerm ErrorCore.UnexpectedTermVariantError-unexpectedTermVariantErrorWithExpectedVariant original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.core.UnexpectedTermVariantError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "expectedVariant"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "actualTerm"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.UnexpectedTermVariantError"),- Core.projectionFieldName = (Core.Name "actualTerm")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL constructor for hydra.error.core.UnexpectedTypeVariantError-unexpectedTypeVariantError :: Typed.TypedTerm Variants.TypeVariant -> Typed.TypedTerm Core.Type -> Typed.TypedTerm ErrorCore.UnexpectedTypeVariantError-unexpectedTypeVariantError expectedVariant actualType =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.core.UnexpectedTypeVariantError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "expectedVariant"),- Core.fieldTerm = (Typed.unTypedTerm expectedVariant)},- Core.Field {- Core.fieldName = (Core.Name "actualType"),- Core.fieldTerm = (Typed.unTypedTerm actualType)}]}))---- | DSL accessor for the actualType field of hydra.error.core.UnexpectedTypeVariantError-unexpectedTypeVariantErrorActualType :: Typed.TypedTerm ErrorCore.UnexpectedTypeVariantError -> Typed.TypedTerm Core.Type-unexpectedTypeVariantErrorActualType x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.UnexpectedTypeVariantError"),- Core.projectionFieldName = (Core.Name "actualType")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL accessor for the expectedVariant field of hydra.error.core.UnexpectedTypeVariantError-unexpectedTypeVariantErrorExpectedVariant :: Typed.TypedTerm ErrorCore.UnexpectedTypeVariantError -> Typed.TypedTerm Variants.TypeVariant-unexpectedTypeVariantErrorExpectedVariant x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.UnexpectedTypeVariantError"),- Core.projectionFieldName = (Core.Name "expectedVariant")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL name token for hydra.error.core.UnexpectedTypeVariantError-unexpectedTypeVariantErrorUnexpectedTypeVariantError :: Typed.TypedName ErrorCore.UnexpectedTypeVariantError-unexpectedTypeVariantErrorUnexpectedTypeVariantError =- Typed.TypedName (Core.Name "hydra.error.core.UnexpectedTypeVariantError")---- | DSL updater for the actualType field of hydra.error.core.UnexpectedTypeVariantError-unexpectedTypeVariantErrorWithActualType :: Typed.TypedTerm ErrorCore.UnexpectedTypeVariantError -> Typed.TypedTerm Core.Type -> Typed.TypedTerm ErrorCore.UnexpectedTypeVariantError-unexpectedTypeVariantErrorWithActualType original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.core.UnexpectedTypeVariantError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "expectedVariant"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.UnexpectedTypeVariantError"),- Core.projectionFieldName = (Core.Name "expectedVariant")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "actualType"),- Core.fieldTerm = (Typed.unTypedTerm newVal)}]}))---- | DSL updater for the expectedVariant field of hydra.error.core.UnexpectedTypeVariantError-unexpectedTypeVariantErrorWithExpectedVariant :: Typed.TypedTerm ErrorCore.UnexpectedTypeVariantError -> Typed.TypedTerm Variants.TypeVariant -> Typed.TypedTerm ErrorCore.UnexpectedTypeVariantError-unexpectedTypeVariantErrorWithExpectedVariant original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.core.UnexpectedTypeVariantError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "expectedVariant"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "actualType"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.UnexpectedTypeVariantError"),- Core.projectionFieldName = (Core.Name "actualType")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL constructor for hydra.error.core.UnknownCaseAlternativeError-unknownCaseAlternativeError :: Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm Core.Name -> Typed.TypedTerm Core.Name -> Typed.TypedTerm ErrorCore.UnknownCaseAlternativeError-unknownCaseAlternativeError location typeName name =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.core.UnknownCaseAlternativeError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "location"),- Core.fieldTerm = (Typed.unTypedTerm location)},- Core.Field {- Core.fieldName = (Core.Name "typeName"),- Core.fieldTerm = (Typed.unTypedTerm typeName)},- Core.Field {- Core.fieldName = (Core.Name "name"),- Core.fieldTerm = (Typed.unTypedTerm name)}]}))---- | DSL accessor for the location field of hydra.error.core.UnknownCaseAlternativeError-unknownCaseAlternativeErrorLocation :: Typed.TypedTerm ErrorCore.UnknownCaseAlternativeError -> Typed.TypedTerm Paths.SubtermPath-unknownCaseAlternativeErrorLocation x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.UnknownCaseAlternativeError"),- Core.projectionFieldName = (Core.Name "location")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL accessor for the name field of hydra.error.core.UnknownCaseAlternativeError-unknownCaseAlternativeErrorName :: Typed.TypedTerm ErrorCore.UnknownCaseAlternativeError -> Typed.TypedTerm Core.Name-unknownCaseAlternativeErrorName x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.UnknownCaseAlternativeError"),- Core.projectionFieldName = (Core.Name "name")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL accessor for the typeName field of hydra.error.core.UnknownCaseAlternativeError-unknownCaseAlternativeErrorTypeName :: Typed.TypedTerm ErrorCore.UnknownCaseAlternativeError -> Typed.TypedTerm Core.Name-unknownCaseAlternativeErrorTypeName x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.UnknownCaseAlternativeError"),- Core.projectionFieldName = (Core.Name "typeName")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL name token for hydra.error.core.UnknownCaseAlternativeError-unknownCaseAlternativeErrorUnknownCaseAlternativeError :: Typed.TypedName ErrorCore.UnknownCaseAlternativeError-unknownCaseAlternativeErrorUnknownCaseAlternativeError =- Typed.TypedName (Core.Name "hydra.error.core.UnknownCaseAlternativeError")---- | DSL updater for the location field of hydra.error.core.UnknownCaseAlternativeError-unknownCaseAlternativeErrorWithLocation :: Typed.TypedTerm ErrorCore.UnknownCaseAlternativeError -> Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm ErrorCore.UnknownCaseAlternativeError-unknownCaseAlternativeErrorWithLocation original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.core.UnknownCaseAlternativeError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "location"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "typeName"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.UnknownCaseAlternativeError"),- Core.projectionFieldName = (Core.Name "typeName")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "name"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.UnknownCaseAlternativeError"),- Core.projectionFieldName = (Core.Name "name")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL updater for the name field of hydra.error.core.UnknownCaseAlternativeError-unknownCaseAlternativeErrorWithName :: Typed.TypedTerm ErrorCore.UnknownCaseAlternativeError -> Typed.TypedTerm Core.Name -> Typed.TypedTerm ErrorCore.UnknownCaseAlternativeError-unknownCaseAlternativeErrorWithName original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.core.UnknownCaseAlternativeError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "location"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.UnknownCaseAlternativeError"),- Core.projectionFieldName = (Core.Name "location")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "typeName"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.UnknownCaseAlternativeError"),- Core.projectionFieldName = (Core.Name "typeName")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "name"),- Core.fieldTerm = (Typed.unTypedTerm newVal)}]}))---- | DSL updater for the typeName field of hydra.error.core.UnknownCaseAlternativeError-unknownCaseAlternativeErrorWithTypeName :: Typed.TypedTerm ErrorCore.UnknownCaseAlternativeError -> Typed.TypedTerm Core.Name -> Typed.TypedTerm ErrorCore.UnknownCaseAlternativeError-unknownCaseAlternativeErrorWithTypeName original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.core.UnknownCaseAlternativeError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "location"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.UnknownCaseAlternativeError"),- Core.projectionFieldName = (Core.Name "location")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "typeName"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "name"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.UnknownCaseAlternativeError"),- Core.projectionFieldName = (Core.Name "name")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL constructor for hydra.error.core.UnknownPrimitiveNameError-unknownPrimitiveNameError :: Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm Core.Name -> Typed.TypedTerm ErrorCore.UnknownPrimitiveNameError-unknownPrimitiveNameError location name =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.core.UnknownPrimitiveNameError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "location"),- Core.fieldTerm = (Typed.unTypedTerm location)},- Core.Field {- Core.fieldName = (Core.Name "name"),- Core.fieldTerm = (Typed.unTypedTerm name)}]}))---- | DSL accessor for the location field of hydra.error.core.UnknownPrimitiveNameError-unknownPrimitiveNameErrorLocation :: Typed.TypedTerm ErrorCore.UnknownPrimitiveNameError -> Typed.TypedTerm Paths.SubtermPath-unknownPrimitiveNameErrorLocation x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.UnknownPrimitiveNameError"),- Core.projectionFieldName = (Core.Name "location")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL accessor for the name field of hydra.error.core.UnknownPrimitiveNameError-unknownPrimitiveNameErrorName :: Typed.TypedTerm ErrorCore.UnknownPrimitiveNameError -> Typed.TypedTerm Core.Name-unknownPrimitiveNameErrorName x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.UnknownPrimitiveNameError"),- Core.projectionFieldName = (Core.Name "name")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL name token for hydra.error.core.UnknownPrimitiveNameError-unknownPrimitiveNameErrorUnknownPrimitiveNameError :: Typed.TypedName ErrorCore.UnknownPrimitiveNameError-unknownPrimitiveNameErrorUnknownPrimitiveNameError =- Typed.TypedName (Core.Name "hydra.error.core.UnknownPrimitiveNameError")---- | DSL updater for the location field of hydra.error.core.UnknownPrimitiveNameError-unknownPrimitiveNameErrorWithLocation :: Typed.TypedTerm ErrorCore.UnknownPrimitiveNameError -> Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm ErrorCore.UnknownPrimitiveNameError-unknownPrimitiveNameErrorWithLocation original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.core.UnknownPrimitiveNameError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "location"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "name"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.UnknownPrimitiveNameError"),- Core.projectionFieldName = (Core.Name "name")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL updater for the name field of hydra.error.core.UnknownPrimitiveNameError-unknownPrimitiveNameErrorWithName :: Typed.TypedTerm ErrorCore.UnknownPrimitiveNameError -> Typed.TypedTerm Core.Name -> Typed.TypedTerm ErrorCore.UnknownPrimitiveNameError-unknownPrimitiveNameErrorWithName original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.core.UnknownPrimitiveNameError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "location"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.UnknownPrimitiveNameError"),- Core.projectionFieldName = (Core.Name "location")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "name"),- Core.fieldTerm = (Typed.unTypedTerm newVal)}]}))---- | DSL constructor for hydra.error.core.UnknownProjectedFieldError-unknownProjectedFieldError :: Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm Core.Name -> Typed.TypedTerm Core.Name -> Typed.TypedTerm ErrorCore.UnknownProjectedFieldError-unknownProjectedFieldError location typeName fieldName =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.core.UnknownProjectedFieldError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "location"),- Core.fieldTerm = (Typed.unTypedTerm location)},- Core.Field {- Core.fieldName = (Core.Name "typeName"),- Core.fieldTerm = (Typed.unTypedTerm typeName)},- Core.Field {- Core.fieldName = (Core.Name "fieldName"),- Core.fieldTerm = (Typed.unTypedTerm fieldName)}]}))---- | DSL accessor for the fieldName field of hydra.error.core.UnknownProjectedFieldError-unknownProjectedFieldErrorFieldName :: Typed.TypedTerm ErrorCore.UnknownProjectedFieldError -> Typed.TypedTerm Core.Name-unknownProjectedFieldErrorFieldName x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.UnknownProjectedFieldError"),- Core.projectionFieldName = (Core.Name "fieldName")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL accessor for the location field of hydra.error.core.UnknownProjectedFieldError-unknownProjectedFieldErrorLocation :: Typed.TypedTerm ErrorCore.UnknownProjectedFieldError -> Typed.TypedTerm Paths.SubtermPath-unknownProjectedFieldErrorLocation x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.UnknownProjectedFieldError"),- Core.projectionFieldName = (Core.Name "location")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL accessor for the typeName field of hydra.error.core.UnknownProjectedFieldError-unknownProjectedFieldErrorTypeName :: Typed.TypedTerm ErrorCore.UnknownProjectedFieldError -> Typed.TypedTerm Core.Name-unknownProjectedFieldErrorTypeName x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.UnknownProjectedFieldError"),- Core.projectionFieldName = (Core.Name "typeName")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL name token for hydra.error.core.UnknownProjectedFieldError-unknownProjectedFieldErrorUnknownProjectedFieldError :: Typed.TypedName ErrorCore.UnknownProjectedFieldError-unknownProjectedFieldErrorUnknownProjectedFieldError =- Typed.TypedName (Core.Name "hydra.error.core.UnknownProjectedFieldError")---- | DSL updater for the fieldName field of hydra.error.core.UnknownProjectedFieldError-unknownProjectedFieldErrorWithFieldName :: Typed.TypedTerm ErrorCore.UnknownProjectedFieldError -> Typed.TypedTerm Core.Name -> Typed.TypedTerm ErrorCore.UnknownProjectedFieldError-unknownProjectedFieldErrorWithFieldName original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.core.UnknownProjectedFieldError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "location"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.UnknownProjectedFieldError"),- Core.projectionFieldName = (Core.Name "location")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "typeName"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.UnknownProjectedFieldError"),- Core.projectionFieldName = (Core.Name "typeName")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "fieldName"),- Core.fieldTerm = (Typed.unTypedTerm newVal)}]}))---- | DSL updater for the location field of hydra.error.core.UnknownProjectedFieldError-unknownProjectedFieldErrorWithLocation :: Typed.TypedTerm ErrorCore.UnknownProjectedFieldError -> Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm ErrorCore.UnknownProjectedFieldError-unknownProjectedFieldErrorWithLocation original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.core.UnknownProjectedFieldError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "location"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "typeName"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.UnknownProjectedFieldError"),- Core.projectionFieldName = (Core.Name "typeName")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "fieldName"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.UnknownProjectedFieldError"),- Core.projectionFieldName = (Core.Name "fieldName")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL updater for the typeName field of hydra.error.core.UnknownProjectedFieldError-unknownProjectedFieldErrorWithTypeName :: Typed.TypedTerm ErrorCore.UnknownProjectedFieldError -> Typed.TypedTerm Core.Name -> Typed.TypedTerm ErrorCore.UnknownProjectedFieldError-unknownProjectedFieldErrorWithTypeName original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.core.UnknownProjectedFieldError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "location"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.UnknownProjectedFieldError"),- Core.projectionFieldName = (Core.Name "location")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "typeName"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "fieldName"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.UnknownProjectedFieldError"),- Core.projectionFieldName = (Core.Name "fieldName")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL constructor for hydra.error.core.UnnecessaryIdentityApplicationError-unnecessaryIdentityApplicationError :: Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm ErrorCore.UnnecessaryIdentityApplicationError-unnecessaryIdentityApplicationError location =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.core.UnnecessaryIdentityApplicationError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "location"),- Core.fieldTerm = (Typed.unTypedTerm location)}]}))---- | DSL accessor for the location field of hydra.error.core.UnnecessaryIdentityApplicationError-unnecessaryIdentityApplicationErrorLocation :: Typed.TypedTerm ErrorCore.UnnecessaryIdentityApplicationError -> Typed.TypedTerm Paths.SubtermPath-unnecessaryIdentityApplicationErrorLocation x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.UnnecessaryIdentityApplicationError"),- Core.projectionFieldName = (Core.Name "location")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL name token for hydra.error.core.UnnecessaryIdentityApplicationError-unnecessaryIdentityApplicationErrorUnnecessaryIdentityApplicationError :: Typed.TypedName ErrorCore.UnnecessaryIdentityApplicationError-unnecessaryIdentityApplicationErrorUnnecessaryIdentityApplicationError =- Typed.TypedName (Core.Name "hydra.error.core.UnnecessaryIdentityApplicationError")---- | DSL updater for the location field of hydra.error.core.UnnecessaryIdentityApplicationError-unnecessaryIdentityApplicationErrorWithLocation :: Typed.TypedTerm ErrorCore.UnnecessaryIdentityApplicationError -> Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm ErrorCore.UnnecessaryIdentityApplicationError-unnecessaryIdentityApplicationErrorWithLocation original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.core.UnnecessaryIdentityApplicationError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "location"),- Core.fieldTerm = (Typed.unTypedTerm newVal)}]}))---- | DSL constructor for hydra.error.core.UnresolvedNominalTypeError-unresolvedNominalTypeError :: Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm Core.Name -> Typed.TypedTerm ErrorCore.UnresolvedNominalTypeError-unresolvedNominalTypeError location typeName =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.core.UnresolvedNominalTypeError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "location"),- Core.fieldTerm = (Typed.unTypedTerm location)},- Core.Field {- Core.fieldName = (Core.Name "typeName"),- Core.fieldTerm = (Typed.unTypedTerm typeName)}]}))---- | DSL accessor for the location field of hydra.error.core.UnresolvedNominalTypeError-unresolvedNominalTypeErrorLocation :: Typed.TypedTerm ErrorCore.UnresolvedNominalTypeError -> Typed.TypedTerm Paths.SubtermPath-unresolvedNominalTypeErrorLocation x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.UnresolvedNominalTypeError"),- Core.projectionFieldName = (Core.Name "location")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL accessor for the typeName field of hydra.error.core.UnresolvedNominalTypeError-unresolvedNominalTypeErrorTypeName :: Typed.TypedTerm ErrorCore.UnresolvedNominalTypeError -> Typed.TypedTerm Core.Name-unresolvedNominalTypeErrorTypeName x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.UnresolvedNominalTypeError"),- Core.projectionFieldName = (Core.Name "typeName")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL name token for hydra.error.core.UnresolvedNominalTypeError-unresolvedNominalTypeErrorUnresolvedNominalTypeError :: Typed.TypedName ErrorCore.UnresolvedNominalTypeError-unresolvedNominalTypeErrorUnresolvedNominalTypeError =- Typed.TypedName (Core.Name "hydra.error.core.UnresolvedNominalTypeError")---- | DSL updater for the location field of hydra.error.core.UnresolvedNominalTypeError-unresolvedNominalTypeErrorWithLocation :: Typed.TypedTerm ErrorCore.UnresolvedNominalTypeError -> Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm ErrorCore.UnresolvedNominalTypeError-unresolvedNominalTypeErrorWithLocation original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.core.UnresolvedNominalTypeError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "location"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "typeName"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.UnresolvedNominalTypeError"),- Core.projectionFieldName = (Core.Name "typeName")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL updater for the typeName field of hydra.error.core.UnresolvedNominalTypeError-unresolvedNominalTypeErrorWithTypeName :: Typed.TypedTerm ErrorCore.UnresolvedNominalTypeError -> Typed.TypedTerm Core.Name -> Typed.TypedTerm ErrorCore.UnresolvedNominalTypeError-unresolvedNominalTypeErrorWithTypeName original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.core.UnresolvedNominalTypeError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "location"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.UnresolvedNominalTypeError"),- Core.projectionFieldName = (Core.Name "location")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "typeName"),- Core.fieldTerm = (Typed.unTypedTerm newVal)}]}))---- | DSL constructor for hydra.error.core.UntypedTermVariableError-untypedTermVariableError :: Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm Core.Name -> Typed.TypedTerm ErrorCore.UntypedTermVariableError-untypedTermVariableError location name =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.core.UntypedTermVariableError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "location"),- Core.fieldTerm = (Typed.unTypedTerm location)},- Core.Field {- Core.fieldName = (Core.Name "name"),- Core.fieldTerm = (Typed.unTypedTerm name)}]}))---- | DSL accessor for the location field of hydra.error.core.UntypedTermVariableError-untypedTermVariableErrorLocation :: Typed.TypedTerm ErrorCore.UntypedTermVariableError -> Typed.TypedTerm Paths.SubtermPath-untypedTermVariableErrorLocation x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.UntypedTermVariableError"),- Core.projectionFieldName = (Core.Name "location")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL accessor for the name field of hydra.error.core.UntypedTermVariableError-untypedTermVariableErrorName :: Typed.TypedTerm ErrorCore.UntypedTermVariableError -> Typed.TypedTerm Core.Name-untypedTermVariableErrorName x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.UntypedTermVariableError"),- Core.projectionFieldName = (Core.Name "name")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL name token for hydra.error.core.UntypedTermVariableError-untypedTermVariableErrorUntypedTermVariableError :: Typed.TypedName ErrorCore.UntypedTermVariableError-untypedTermVariableErrorUntypedTermVariableError = Typed.TypedName (Core.Name "hydra.error.core.UntypedTermVariableError")---- | DSL updater for the location field of hydra.error.core.UntypedTermVariableError-untypedTermVariableErrorWithLocation :: Typed.TypedTerm ErrorCore.UntypedTermVariableError -> Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm ErrorCore.UntypedTermVariableError-untypedTermVariableErrorWithLocation original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.core.UntypedTermVariableError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "location"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "name"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.UntypedTermVariableError"),- Core.projectionFieldName = (Core.Name "name")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL updater for the name field of hydra.error.core.UntypedTermVariableError-untypedTermVariableErrorWithName :: Typed.TypedTerm ErrorCore.UntypedTermVariableError -> Typed.TypedTerm Core.Name -> Typed.TypedTerm ErrorCore.UntypedTermVariableError-untypedTermVariableErrorWithName original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.core.UntypedTermVariableError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "location"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.UntypedTermVariableError"),- Core.projectionFieldName = (Core.Name "location")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "name"),- Core.fieldTerm = (Typed.unTypedTerm newVal)}]}))---- | DSL constructor for hydra.error.core.VoidInNonBottomPositionError-voidInNonBottomPositionError :: Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm ErrorCore.VoidInNonBottomPositionError-voidInNonBottomPositionError location =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.core.VoidInNonBottomPositionError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "location"),- Core.fieldTerm = (Typed.unTypedTerm location)}]}))---- | DSL accessor for the location field of hydra.error.core.VoidInNonBottomPositionError-voidInNonBottomPositionErrorLocation :: Typed.TypedTerm ErrorCore.VoidInNonBottomPositionError -> Typed.TypedTerm Paths.SubtermPath-voidInNonBottomPositionErrorLocation x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.core.VoidInNonBottomPositionError"),- Core.projectionFieldName = (Core.Name "location")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL name token for hydra.error.core.VoidInNonBottomPositionError-voidInNonBottomPositionErrorVoidInNonBottomPositionError :: Typed.TypedName ErrorCore.VoidInNonBottomPositionError-voidInNonBottomPositionErrorVoidInNonBottomPositionError =- Typed.TypedName (Core.Name "hydra.error.core.VoidInNonBottomPositionError")---- | DSL updater for the location field of hydra.error.core.VoidInNonBottomPositionError-voidInNonBottomPositionErrorWithLocation :: Typed.TypedTerm ErrorCore.VoidInNonBottomPositionError -> Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm ErrorCore.VoidInNonBottomPositionError-voidInNonBottomPositionErrorWithLocation original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.core.VoidInNonBottomPositionError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "location"),- Core.fieldTerm = (Typed.unTypedTerm newVal)}]}))
@@ -1,65 +0,0 @@--- Note: this is an automatically generated file. Do not edit.---- | DSL functions for hydra.error.file--module Hydra.Dsl.Error.File where--import qualified Hydra.Core as Core-import qualified Hydra.Decode.Error.File as DecodeErrorFile-import qualified Hydra.Dsl.File as DslFile-import qualified Hydra.Encode.Error.File as EncodeErrorFile-import qualified Hydra.Error.File as ErrorFile-import qualified Hydra.File as File-import qualified Hydra.Typed as Typed-import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)-import qualified Data.Scientific as Sci-import Data.Void---- | DSL injection for the alreadyExists variant of hydra.error.file.FileError-fileErrorAlreadyExists :: Typed.TypedTerm File.FilePath -> Typed.TypedTerm ErrorFile.FileError-fileErrorAlreadyExists x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.error.file.FileError"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "alreadyExists"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL name token for hydra.error.file.FileError-fileErrorFileError :: Typed.TypedName ErrorFile.FileError-fileErrorFileError = Typed.TypedName (Core.Name "hydra.error.file.FileError")---- | DSL injection for the invalidPath variant of hydra.error.file.FileError-fileErrorInvalidPath :: Typed.TypedTerm String -> Typed.TypedTerm ErrorFile.FileError-fileErrorInvalidPath x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.error.file.FileError"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "invalidPath"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the notFound variant of hydra.error.file.FileError-fileErrorNotFound :: Typed.TypedTerm File.FilePath -> Typed.TypedTerm ErrorFile.FileError-fileErrorNotFound x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.error.file.FileError"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "notFound"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the other variant of hydra.error.file.FileError-fileErrorOther :: Typed.TypedTerm String -> Typed.TypedTerm ErrorFile.FileError-fileErrorOther x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.error.file.FileError"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "other"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the permissionDenied variant of hydra.error.file.FileError-fileErrorPermissionDenied :: Typed.TypedTerm File.FilePath -> Typed.TypedTerm ErrorFile.FileError-fileErrorPermissionDenied x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.error.file.FileError"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "permissionDenied"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))
@@ -1,1268 +0,0 @@--- Note: this is an automatically generated file. Do not edit.---- | DSL functions for hydra.error.packaging--module Hydra.Dsl.Error.Packaging where--import qualified Hydra.Core as Core-import qualified Hydra.Decode.Error.Packaging as DecodeErrorPackaging-import qualified Hydra.Dsl.Core as DslCore-import qualified Hydra.Dsl.Packaging as DslPackaging-import qualified Hydra.Dsl.Util as DslUtil-import qualified Hydra.Encode.Error.Packaging as EncodeErrorPackaging-import qualified Hydra.Error.Packaging as ErrorPackaging-import qualified Hydra.Packaging as Packaging-import qualified Hydra.Typed as Typed-import qualified Hydra.Util as Util-import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)-import qualified Data.Scientific as Sci-import Data.Void---- | DSL constructor for hydra.error.packaging.ConflictingModuleNameError-conflictingModuleNameError :: Typed.TypedTerm Packaging.ModuleName -> Typed.TypedTerm Packaging.ModuleName -> Typed.TypedTerm ErrorPackaging.ConflictingModuleNameError-conflictingModuleNameError first second =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.packaging.ConflictingModuleNameError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "first"),- Core.fieldTerm = (Typed.unTypedTerm first)},- Core.Field {- Core.fieldName = (Core.Name "second"),- Core.fieldTerm = (Typed.unTypedTerm second)}]}))---- | DSL name token for hydra.error.packaging.ConflictingModuleNameError-conflictingModuleNameErrorConflictingModuleNameError :: Typed.TypedName ErrorPackaging.ConflictingModuleNameError-conflictingModuleNameErrorConflictingModuleNameError =- Typed.TypedName (Core.Name "hydra.error.packaging.ConflictingModuleNameError")---- | DSL accessor for the first field of hydra.error.packaging.ConflictingModuleNameError-conflictingModuleNameErrorFirst :: Typed.TypedTerm ErrorPackaging.ConflictingModuleNameError -> Typed.TypedTerm Packaging.ModuleName-conflictingModuleNameErrorFirst x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.packaging.ConflictingModuleNameError"),- Core.projectionFieldName = (Core.Name "first")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL accessor for the second field of hydra.error.packaging.ConflictingModuleNameError-conflictingModuleNameErrorSecond :: Typed.TypedTerm ErrorPackaging.ConflictingModuleNameError -> Typed.TypedTerm Packaging.ModuleName-conflictingModuleNameErrorSecond x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.packaging.ConflictingModuleNameError"),- Core.projectionFieldName = (Core.Name "second")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL updater for the first field of hydra.error.packaging.ConflictingModuleNameError-conflictingModuleNameErrorWithFirst :: Typed.TypedTerm ErrorPackaging.ConflictingModuleNameError -> Typed.TypedTerm Packaging.ModuleName -> Typed.TypedTerm ErrorPackaging.ConflictingModuleNameError-conflictingModuleNameErrorWithFirst original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.packaging.ConflictingModuleNameError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "first"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "second"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.packaging.ConflictingModuleNameError"),- Core.projectionFieldName = (Core.Name "second")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL updater for the second field of hydra.error.packaging.ConflictingModuleNameError-conflictingModuleNameErrorWithSecond :: Typed.TypedTerm ErrorPackaging.ConflictingModuleNameError -> Typed.TypedTerm Packaging.ModuleName -> Typed.TypedTerm ErrorPackaging.ConflictingModuleNameError-conflictingModuleNameErrorWithSecond original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.packaging.ConflictingModuleNameError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "first"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.packaging.ConflictingModuleNameError"),- Core.projectionFieldName = (Core.Name "first")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "second"),- Core.fieldTerm = (Typed.unTypedTerm newVal)}]}))---- | DSL constructor for hydra.error.packaging.ConflictingVariantNameError-conflictingVariantNameError :: Typed.TypedTerm Packaging.ModuleName -> Typed.TypedTerm Core.Name -> Typed.TypedTerm Core.Name -> Typed.TypedTerm Core.Name -> Typed.TypedTerm ErrorPackaging.ConflictingVariantNameError-conflictingVariantNameError moduleName typeName variantName conflictingName =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.packaging.ConflictingVariantNameError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "moduleName"),- Core.fieldTerm = (Typed.unTypedTerm moduleName)},- Core.Field {- Core.fieldName = (Core.Name "typeName"),- Core.fieldTerm = (Typed.unTypedTerm typeName)},- Core.Field {- Core.fieldName = (Core.Name "variantName"),- Core.fieldTerm = (Typed.unTypedTerm variantName)},- Core.Field {- Core.fieldName = (Core.Name "conflictingName"),- Core.fieldTerm = (Typed.unTypedTerm conflictingName)}]}))---- | DSL accessor for the conflictingName field of hydra.error.packaging.ConflictingVariantNameError-conflictingVariantNameErrorConflictingName :: Typed.TypedTerm ErrorPackaging.ConflictingVariantNameError -> Typed.TypedTerm Core.Name-conflictingVariantNameErrorConflictingName x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.packaging.ConflictingVariantNameError"),- Core.projectionFieldName = (Core.Name "conflictingName")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL name token for hydra.error.packaging.ConflictingVariantNameError-conflictingVariantNameErrorConflictingVariantNameError :: Typed.TypedName ErrorPackaging.ConflictingVariantNameError-conflictingVariantNameErrorConflictingVariantNameError =- Typed.TypedName (Core.Name "hydra.error.packaging.ConflictingVariantNameError")---- | DSL accessor for the moduleName field of hydra.error.packaging.ConflictingVariantNameError-conflictingVariantNameErrorModuleName :: Typed.TypedTerm ErrorPackaging.ConflictingVariantNameError -> Typed.TypedTerm Packaging.ModuleName-conflictingVariantNameErrorModuleName x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.packaging.ConflictingVariantNameError"),- Core.projectionFieldName = (Core.Name "moduleName")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL accessor for the typeName field of hydra.error.packaging.ConflictingVariantNameError-conflictingVariantNameErrorTypeName :: Typed.TypedTerm ErrorPackaging.ConflictingVariantNameError -> Typed.TypedTerm Core.Name-conflictingVariantNameErrorTypeName x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.packaging.ConflictingVariantNameError"),- Core.projectionFieldName = (Core.Name "typeName")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL accessor for the variantName field of hydra.error.packaging.ConflictingVariantNameError-conflictingVariantNameErrorVariantName :: Typed.TypedTerm ErrorPackaging.ConflictingVariantNameError -> Typed.TypedTerm Core.Name-conflictingVariantNameErrorVariantName x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.packaging.ConflictingVariantNameError"),- Core.projectionFieldName = (Core.Name "variantName")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL updater for the conflictingName field of hydra.error.packaging.ConflictingVariantNameError-conflictingVariantNameErrorWithConflictingName :: Typed.TypedTerm ErrorPackaging.ConflictingVariantNameError -> Typed.TypedTerm Core.Name -> Typed.TypedTerm ErrorPackaging.ConflictingVariantNameError-conflictingVariantNameErrorWithConflictingName original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.packaging.ConflictingVariantNameError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "moduleName"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.packaging.ConflictingVariantNameError"),- Core.projectionFieldName = (Core.Name "moduleName")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "typeName"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.packaging.ConflictingVariantNameError"),- Core.projectionFieldName = (Core.Name "typeName")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "variantName"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.packaging.ConflictingVariantNameError"),- Core.projectionFieldName = (Core.Name "variantName")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "conflictingName"),- Core.fieldTerm = (Typed.unTypedTerm newVal)}]}))---- | DSL updater for the moduleName field of hydra.error.packaging.ConflictingVariantNameError-conflictingVariantNameErrorWithModuleName :: Typed.TypedTerm ErrorPackaging.ConflictingVariantNameError -> Typed.TypedTerm Packaging.ModuleName -> Typed.TypedTerm ErrorPackaging.ConflictingVariantNameError-conflictingVariantNameErrorWithModuleName original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.packaging.ConflictingVariantNameError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "moduleName"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "typeName"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.packaging.ConflictingVariantNameError"),- Core.projectionFieldName = (Core.Name "typeName")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "variantName"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.packaging.ConflictingVariantNameError"),- Core.projectionFieldName = (Core.Name "variantName")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "conflictingName"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.packaging.ConflictingVariantNameError"),- Core.projectionFieldName = (Core.Name "conflictingName")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL updater for the typeName field of hydra.error.packaging.ConflictingVariantNameError-conflictingVariantNameErrorWithTypeName :: Typed.TypedTerm ErrorPackaging.ConflictingVariantNameError -> Typed.TypedTerm Core.Name -> Typed.TypedTerm ErrorPackaging.ConflictingVariantNameError-conflictingVariantNameErrorWithTypeName original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.packaging.ConflictingVariantNameError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "moduleName"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.packaging.ConflictingVariantNameError"),- Core.projectionFieldName = (Core.Name "moduleName")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "typeName"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "variantName"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.packaging.ConflictingVariantNameError"),- Core.projectionFieldName = (Core.Name "variantName")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "conflictingName"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.packaging.ConflictingVariantNameError"),- Core.projectionFieldName = (Core.Name "conflictingName")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL updater for the variantName field of hydra.error.packaging.ConflictingVariantNameError-conflictingVariantNameErrorWithVariantName :: Typed.TypedTerm ErrorPackaging.ConflictingVariantNameError -> Typed.TypedTerm Core.Name -> Typed.TypedTerm ErrorPackaging.ConflictingVariantNameError-conflictingVariantNameErrorWithVariantName original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.packaging.ConflictingVariantNameError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "moduleName"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.packaging.ConflictingVariantNameError"),- Core.projectionFieldName = (Core.Name "moduleName")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "typeName"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.packaging.ConflictingVariantNameError"),- Core.projectionFieldName = (Core.Name "typeName")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "variantName"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "conflictingName"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.packaging.ConflictingVariantNameError"),- Core.projectionFieldName = (Core.Name "conflictingName")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL constructor for hydra.error.packaging.DefinitionNotInModuleNameError-definitionNotInModuleNameError :: Typed.TypedTerm Packaging.ModuleName -> Typed.TypedTerm Core.Name -> Typed.TypedTerm ErrorPackaging.DefinitionNotInModuleNameError-definitionNotInModuleNameError moduleName name =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.packaging.DefinitionNotInModuleNameError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "moduleName"),- Core.fieldTerm = (Typed.unTypedTerm moduleName)},- Core.Field {- Core.fieldName = (Core.Name "name"),- Core.fieldTerm = (Typed.unTypedTerm name)}]}))---- | DSL name token for hydra.error.packaging.DefinitionNotInModuleNameError-definitionNotInModuleNameErrorDefinitionNotInModuleNameError :: Typed.TypedName ErrorPackaging.DefinitionNotInModuleNameError-definitionNotInModuleNameErrorDefinitionNotInModuleNameError =- Typed.TypedName (Core.Name "hydra.error.packaging.DefinitionNotInModuleNameError")---- | DSL accessor for the moduleName field of hydra.error.packaging.DefinitionNotInModuleNameError-definitionNotInModuleNameErrorModuleName :: Typed.TypedTerm ErrorPackaging.DefinitionNotInModuleNameError -> Typed.TypedTerm Packaging.ModuleName-definitionNotInModuleNameErrorModuleName x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.packaging.DefinitionNotInModuleNameError"),- Core.projectionFieldName = (Core.Name "moduleName")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL accessor for the name field of hydra.error.packaging.DefinitionNotInModuleNameError-definitionNotInModuleNameErrorName :: Typed.TypedTerm ErrorPackaging.DefinitionNotInModuleNameError -> Typed.TypedTerm Core.Name-definitionNotInModuleNameErrorName x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.packaging.DefinitionNotInModuleNameError"),- Core.projectionFieldName = (Core.Name "name")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL updater for the moduleName field of hydra.error.packaging.DefinitionNotInModuleNameError-definitionNotInModuleNameErrorWithModuleName :: Typed.TypedTerm ErrorPackaging.DefinitionNotInModuleNameError -> Typed.TypedTerm Packaging.ModuleName -> Typed.TypedTerm ErrorPackaging.DefinitionNotInModuleNameError-definitionNotInModuleNameErrorWithModuleName original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.packaging.DefinitionNotInModuleNameError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "moduleName"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "name"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.packaging.DefinitionNotInModuleNameError"),- Core.projectionFieldName = (Core.Name "name")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL updater for the name field of hydra.error.packaging.DefinitionNotInModuleNameError-definitionNotInModuleNameErrorWithName :: Typed.TypedTerm ErrorPackaging.DefinitionNotInModuleNameError -> Typed.TypedTerm Core.Name -> Typed.TypedTerm ErrorPackaging.DefinitionNotInModuleNameError-definitionNotInModuleNameErrorWithName original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.packaging.DefinitionNotInModuleNameError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "moduleName"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.packaging.DefinitionNotInModuleNameError"),- Core.projectionFieldName = (Core.Name "moduleName")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "name"),- Core.fieldTerm = (Typed.unTypedTerm newVal)}]}))---- | DSL constructor for hydra.error.packaging.DefinitionsOutOfOrderError-definitionsOutOfOrderError :: Typed.TypedTerm Packaging.ModuleName -> Typed.TypedTerm Core.Name -> Typed.TypedTerm Core.Name -> Typed.TypedTerm ErrorPackaging.DefinitionsOutOfOrderError-definitionsOutOfOrderError moduleName precedingName followingName =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.packaging.DefinitionsOutOfOrderError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "moduleName"),- Core.fieldTerm = (Typed.unTypedTerm moduleName)},- Core.Field {- Core.fieldName = (Core.Name "precedingName"),- Core.fieldTerm = (Typed.unTypedTerm precedingName)},- Core.Field {- Core.fieldName = (Core.Name "followingName"),- Core.fieldTerm = (Typed.unTypedTerm followingName)}]}))---- | DSL name token for hydra.error.packaging.DefinitionsOutOfOrderError-definitionsOutOfOrderErrorDefinitionsOutOfOrderError :: Typed.TypedName ErrorPackaging.DefinitionsOutOfOrderError-definitionsOutOfOrderErrorDefinitionsOutOfOrderError =- Typed.TypedName (Core.Name "hydra.error.packaging.DefinitionsOutOfOrderError")---- | DSL accessor for the followingName field of hydra.error.packaging.DefinitionsOutOfOrderError-definitionsOutOfOrderErrorFollowingName :: Typed.TypedTerm ErrorPackaging.DefinitionsOutOfOrderError -> Typed.TypedTerm Core.Name-definitionsOutOfOrderErrorFollowingName x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.packaging.DefinitionsOutOfOrderError"),- Core.projectionFieldName = (Core.Name "followingName")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL accessor for the moduleName field of hydra.error.packaging.DefinitionsOutOfOrderError-definitionsOutOfOrderErrorModuleName :: Typed.TypedTerm ErrorPackaging.DefinitionsOutOfOrderError -> Typed.TypedTerm Packaging.ModuleName-definitionsOutOfOrderErrorModuleName x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.packaging.DefinitionsOutOfOrderError"),- Core.projectionFieldName = (Core.Name "moduleName")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL accessor for the precedingName field of hydra.error.packaging.DefinitionsOutOfOrderError-definitionsOutOfOrderErrorPrecedingName :: Typed.TypedTerm ErrorPackaging.DefinitionsOutOfOrderError -> Typed.TypedTerm Core.Name-definitionsOutOfOrderErrorPrecedingName x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.packaging.DefinitionsOutOfOrderError"),- Core.projectionFieldName = (Core.Name "precedingName")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL updater for the followingName field of hydra.error.packaging.DefinitionsOutOfOrderError-definitionsOutOfOrderErrorWithFollowingName :: Typed.TypedTerm ErrorPackaging.DefinitionsOutOfOrderError -> Typed.TypedTerm Core.Name -> Typed.TypedTerm ErrorPackaging.DefinitionsOutOfOrderError-definitionsOutOfOrderErrorWithFollowingName original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.packaging.DefinitionsOutOfOrderError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "moduleName"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.packaging.DefinitionsOutOfOrderError"),- Core.projectionFieldName = (Core.Name "moduleName")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "precedingName"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.packaging.DefinitionsOutOfOrderError"),- Core.projectionFieldName = (Core.Name "precedingName")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "followingName"),- Core.fieldTerm = (Typed.unTypedTerm newVal)}]}))---- | DSL updater for the moduleName field of hydra.error.packaging.DefinitionsOutOfOrderError-definitionsOutOfOrderErrorWithModuleName :: Typed.TypedTerm ErrorPackaging.DefinitionsOutOfOrderError -> Typed.TypedTerm Packaging.ModuleName -> Typed.TypedTerm ErrorPackaging.DefinitionsOutOfOrderError-definitionsOutOfOrderErrorWithModuleName original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.packaging.DefinitionsOutOfOrderError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "moduleName"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "precedingName"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.packaging.DefinitionsOutOfOrderError"),- Core.projectionFieldName = (Core.Name "precedingName")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "followingName"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.packaging.DefinitionsOutOfOrderError"),- Core.projectionFieldName = (Core.Name "followingName")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL updater for the precedingName field of hydra.error.packaging.DefinitionsOutOfOrderError-definitionsOutOfOrderErrorWithPrecedingName :: Typed.TypedTerm ErrorPackaging.DefinitionsOutOfOrderError -> Typed.TypedTerm Core.Name -> Typed.TypedTerm ErrorPackaging.DefinitionsOutOfOrderError-definitionsOutOfOrderErrorWithPrecedingName original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.packaging.DefinitionsOutOfOrderError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "moduleName"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.packaging.DefinitionsOutOfOrderError"),- Core.projectionFieldName = (Core.Name "moduleName")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "precedingName"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "followingName"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.packaging.DefinitionsOutOfOrderError"),- Core.projectionFieldName = (Core.Name "followingName")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL constructor for hydra.error.packaging.DuplicateDefinitionNameError-duplicateDefinitionNameError :: Typed.TypedTerm Packaging.ModuleName -> Typed.TypedTerm Core.Name -> Typed.TypedTerm ErrorPackaging.DuplicateDefinitionNameError-duplicateDefinitionNameError moduleName name =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.packaging.DuplicateDefinitionNameError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "moduleName"),- Core.fieldTerm = (Typed.unTypedTerm moduleName)},- Core.Field {- Core.fieldName = (Core.Name "name"),- Core.fieldTerm = (Typed.unTypedTerm name)}]}))---- | DSL name token for hydra.error.packaging.DuplicateDefinitionNameError-duplicateDefinitionNameErrorDuplicateDefinitionNameError :: Typed.TypedName ErrorPackaging.DuplicateDefinitionNameError-duplicateDefinitionNameErrorDuplicateDefinitionNameError =- Typed.TypedName (Core.Name "hydra.error.packaging.DuplicateDefinitionNameError")---- | DSL accessor for the moduleName field of hydra.error.packaging.DuplicateDefinitionNameError-duplicateDefinitionNameErrorModuleName :: Typed.TypedTerm ErrorPackaging.DuplicateDefinitionNameError -> Typed.TypedTerm Packaging.ModuleName-duplicateDefinitionNameErrorModuleName x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.packaging.DuplicateDefinitionNameError"),- Core.projectionFieldName = (Core.Name "moduleName")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL accessor for the name field of hydra.error.packaging.DuplicateDefinitionNameError-duplicateDefinitionNameErrorName :: Typed.TypedTerm ErrorPackaging.DuplicateDefinitionNameError -> Typed.TypedTerm Core.Name-duplicateDefinitionNameErrorName x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.packaging.DuplicateDefinitionNameError"),- Core.projectionFieldName = (Core.Name "name")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL updater for the moduleName field of hydra.error.packaging.DuplicateDefinitionNameError-duplicateDefinitionNameErrorWithModuleName :: Typed.TypedTerm ErrorPackaging.DuplicateDefinitionNameError -> Typed.TypedTerm Packaging.ModuleName -> Typed.TypedTerm ErrorPackaging.DuplicateDefinitionNameError-duplicateDefinitionNameErrorWithModuleName original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.packaging.DuplicateDefinitionNameError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "moduleName"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "name"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.packaging.DuplicateDefinitionNameError"),- Core.projectionFieldName = (Core.Name "name")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL updater for the name field of hydra.error.packaging.DuplicateDefinitionNameError-duplicateDefinitionNameErrorWithName :: Typed.TypedTerm ErrorPackaging.DuplicateDefinitionNameError -> Typed.TypedTerm Core.Name -> Typed.TypedTerm ErrorPackaging.DuplicateDefinitionNameError-duplicateDefinitionNameErrorWithName original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.packaging.DuplicateDefinitionNameError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "moduleName"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.packaging.DuplicateDefinitionNameError"),- Core.projectionFieldName = (Core.Name "moduleName")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "name"),- Core.fieldTerm = (Typed.unTypedTerm newVal)}]}))---- | DSL constructor for hydra.error.packaging.DuplicateModuleNameError-duplicateModuleNameError :: Typed.TypedTerm Packaging.ModuleName -> Typed.TypedTerm ErrorPackaging.DuplicateModuleNameError-duplicateModuleNameError moduleName =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.packaging.DuplicateModuleNameError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "moduleName"),- Core.fieldTerm = (Typed.unTypedTerm moduleName)}]}))---- | DSL name token for hydra.error.packaging.DuplicateModuleNameError-duplicateModuleNameErrorDuplicateModuleNameError :: Typed.TypedName ErrorPackaging.DuplicateModuleNameError-duplicateModuleNameErrorDuplicateModuleNameError =- Typed.TypedName (Core.Name "hydra.error.packaging.DuplicateModuleNameError")---- | DSL accessor for the moduleName field of hydra.error.packaging.DuplicateModuleNameError-duplicateModuleNameErrorModuleName :: Typed.TypedTerm ErrorPackaging.DuplicateModuleNameError -> Typed.TypedTerm Packaging.ModuleName-duplicateModuleNameErrorModuleName x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.packaging.DuplicateModuleNameError"),- Core.projectionFieldName = (Core.Name "moduleName")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL updater for the moduleName field of hydra.error.packaging.DuplicateModuleNameError-duplicateModuleNameErrorWithModuleName :: Typed.TypedTerm ErrorPackaging.DuplicateModuleNameError -> Typed.TypedTerm Packaging.ModuleName -> Typed.TypedTerm ErrorPackaging.DuplicateModuleNameError-duplicateModuleNameErrorWithModuleName original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.packaging.DuplicateModuleNameError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "moduleName"),- Core.fieldTerm = (Typed.unTypedTerm newVal)}]}))---- | DSL constructor for hydra.error.packaging.InvalidDefinitionNameError-invalidDefinitionNameError :: Typed.TypedTerm Packaging.ModuleName -> Typed.TypedTerm Core.Name -> Typed.TypedTerm Util.CaseConvention -> Typed.TypedTerm ErrorPackaging.InvalidDefinitionNameError-invalidDefinitionNameError moduleName name expectedConvention =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.packaging.InvalidDefinitionNameError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "moduleName"),- Core.fieldTerm = (Typed.unTypedTerm moduleName)},- Core.Field {- Core.fieldName = (Core.Name "name"),- Core.fieldTerm = (Typed.unTypedTerm name)},- Core.Field {- Core.fieldName = (Core.Name "expectedConvention"),- Core.fieldTerm = (Typed.unTypedTerm expectedConvention)}]}))---- | DSL accessor for the expectedConvention field of hydra.error.packaging.InvalidDefinitionNameError-invalidDefinitionNameErrorExpectedConvention :: Typed.TypedTerm ErrorPackaging.InvalidDefinitionNameError -> Typed.TypedTerm Util.CaseConvention-invalidDefinitionNameErrorExpectedConvention x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.packaging.InvalidDefinitionNameError"),- Core.projectionFieldName = (Core.Name "expectedConvention")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL name token for hydra.error.packaging.InvalidDefinitionNameError-invalidDefinitionNameErrorInvalidDefinitionNameError :: Typed.TypedName ErrorPackaging.InvalidDefinitionNameError-invalidDefinitionNameErrorInvalidDefinitionNameError =- Typed.TypedName (Core.Name "hydra.error.packaging.InvalidDefinitionNameError")---- | DSL accessor for the moduleName field of hydra.error.packaging.InvalidDefinitionNameError-invalidDefinitionNameErrorModuleName :: Typed.TypedTerm ErrorPackaging.InvalidDefinitionNameError -> Typed.TypedTerm Packaging.ModuleName-invalidDefinitionNameErrorModuleName x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.packaging.InvalidDefinitionNameError"),- Core.projectionFieldName = (Core.Name "moduleName")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL accessor for the name field of hydra.error.packaging.InvalidDefinitionNameError-invalidDefinitionNameErrorName :: Typed.TypedTerm ErrorPackaging.InvalidDefinitionNameError -> Typed.TypedTerm Core.Name-invalidDefinitionNameErrorName x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.packaging.InvalidDefinitionNameError"),- Core.projectionFieldName = (Core.Name "name")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL updater for the expectedConvention field of hydra.error.packaging.InvalidDefinitionNameError-invalidDefinitionNameErrorWithExpectedConvention :: Typed.TypedTerm ErrorPackaging.InvalidDefinitionNameError -> Typed.TypedTerm Util.CaseConvention -> Typed.TypedTerm ErrorPackaging.InvalidDefinitionNameError-invalidDefinitionNameErrorWithExpectedConvention original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.packaging.InvalidDefinitionNameError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "moduleName"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.packaging.InvalidDefinitionNameError"),- Core.projectionFieldName = (Core.Name "moduleName")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "name"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.packaging.InvalidDefinitionNameError"),- Core.projectionFieldName = (Core.Name "name")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "expectedConvention"),- Core.fieldTerm = (Typed.unTypedTerm newVal)}]}))---- | DSL updater for the moduleName field of hydra.error.packaging.InvalidDefinitionNameError-invalidDefinitionNameErrorWithModuleName :: Typed.TypedTerm ErrorPackaging.InvalidDefinitionNameError -> Typed.TypedTerm Packaging.ModuleName -> Typed.TypedTerm ErrorPackaging.InvalidDefinitionNameError-invalidDefinitionNameErrorWithModuleName original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.packaging.InvalidDefinitionNameError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "moduleName"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "name"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.packaging.InvalidDefinitionNameError"),- Core.projectionFieldName = (Core.Name "name")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "expectedConvention"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.packaging.InvalidDefinitionNameError"),- Core.projectionFieldName = (Core.Name "expectedConvention")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL updater for the name field of hydra.error.packaging.InvalidDefinitionNameError-invalidDefinitionNameErrorWithName :: Typed.TypedTerm ErrorPackaging.InvalidDefinitionNameError -> Typed.TypedTerm Core.Name -> Typed.TypedTerm ErrorPackaging.InvalidDefinitionNameError-invalidDefinitionNameErrorWithName original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.packaging.InvalidDefinitionNameError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "moduleName"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.packaging.InvalidDefinitionNameError"),- Core.projectionFieldName = (Core.Name "moduleName")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "name"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "expectedConvention"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.packaging.InvalidDefinitionNameError"),- Core.projectionFieldName = (Core.Name "expectedConvention")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL injection for the conflictingVariantName variant of hydra.error.packaging.InvalidModuleError-invalidModuleErrorConflictingVariantName :: Typed.TypedTerm ErrorPackaging.ConflictingVariantNameError -> Typed.TypedTerm ErrorPackaging.InvalidModuleError-invalidModuleErrorConflictingVariantName x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.error.packaging.InvalidModuleError"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "conflictingVariantName"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the definitionNotInModuleName variant of hydra.error.packaging.InvalidModuleError-invalidModuleErrorDefinitionNotInModuleName :: Typed.TypedTerm ErrorPackaging.DefinitionNotInModuleNameError -> Typed.TypedTerm ErrorPackaging.InvalidModuleError-invalidModuleErrorDefinitionNotInModuleName x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.error.packaging.InvalidModuleError"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "definitionNotInModuleName"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the definitionsOutOfOrder variant of hydra.error.packaging.InvalidModuleError-invalidModuleErrorDefinitionsOutOfOrder :: Typed.TypedTerm ErrorPackaging.DefinitionsOutOfOrderError -> Typed.TypedTerm ErrorPackaging.InvalidModuleError-invalidModuleErrorDefinitionsOutOfOrder x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.error.packaging.InvalidModuleError"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "definitionsOutOfOrder"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the duplicateDefinitionName variant of hydra.error.packaging.InvalidModuleError-invalidModuleErrorDuplicateDefinitionName :: Typed.TypedTerm ErrorPackaging.DuplicateDefinitionNameError -> Typed.TypedTerm ErrorPackaging.InvalidModuleError-invalidModuleErrorDuplicateDefinitionName x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.error.packaging.InvalidModuleError"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "duplicateDefinitionName"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the invalidDefinitionName variant of hydra.error.packaging.InvalidModuleError-invalidModuleErrorInvalidDefinitionName :: Typed.TypedTerm ErrorPackaging.InvalidDefinitionNameError -> Typed.TypedTerm ErrorPackaging.InvalidModuleError-invalidModuleErrorInvalidDefinitionName x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.error.packaging.InvalidModuleError"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "invalidDefinitionName"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL name token for hydra.error.packaging.InvalidModuleError-invalidModuleErrorInvalidModuleError :: Typed.TypedName ErrorPackaging.InvalidModuleError-invalidModuleErrorInvalidModuleError = Typed.TypedName (Core.Name "hydra.error.packaging.InvalidModuleError")---- | DSL injection for the invalidModuleNameConvention variant of hydra.error.packaging.InvalidModuleError-invalidModuleErrorInvalidModuleNameConvention :: Typed.TypedTerm ErrorPackaging.InvalidModuleNameConventionError -> Typed.TypedTerm ErrorPackaging.InvalidModuleError-invalidModuleErrorInvalidModuleNameConvention x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.error.packaging.InvalidModuleError"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "invalidModuleNameConvention"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the missingDocumentation variant of hydra.error.packaging.InvalidModuleError-invalidModuleErrorMissingDocumentation :: Typed.TypedTerm ErrorPackaging.MissingDocumentationError -> Typed.TypedTerm ErrorPackaging.InvalidModuleError-invalidModuleErrorMissingDocumentation x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.error.packaging.InvalidModuleError"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "missingDocumentation"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL constructor for hydra.error.packaging.InvalidModuleNameConventionError-invalidModuleNameConventionError :: Typed.TypedTerm Packaging.ModuleName -> Typed.TypedTerm ErrorPackaging.InvalidModuleNameConventionError-invalidModuleNameConventionError moduleName =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.packaging.InvalidModuleNameConventionError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "moduleName"),- Core.fieldTerm = (Typed.unTypedTerm moduleName)}]}))---- | DSL name token for hydra.error.packaging.InvalidModuleNameConventionError-invalidModuleNameConventionErrorInvalidModuleNameConventionError :: Typed.TypedName ErrorPackaging.InvalidModuleNameConventionError-invalidModuleNameConventionErrorInvalidModuleNameConventionError =- Typed.TypedName (Core.Name "hydra.error.packaging.InvalidModuleNameConventionError")---- | DSL accessor for the moduleName field of hydra.error.packaging.InvalidModuleNameConventionError-invalidModuleNameConventionErrorModuleName :: Typed.TypedTerm ErrorPackaging.InvalidModuleNameConventionError -> Typed.TypedTerm Packaging.ModuleName-invalidModuleNameConventionErrorModuleName x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.packaging.InvalidModuleNameConventionError"),- Core.projectionFieldName = (Core.Name "moduleName")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL updater for the moduleName field of hydra.error.packaging.InvalidModuleNameConventionError-invalidModuleNameConventionErrorWithModuleName :: Typed.TypedTerm ErrorPackaging.InvalidModuleNameConventionError -> Typed.TypedTerm Packaging.ModuleName -> Typed.TypedTerm ErrorPackaging.InvalidModuleNameConventionError-invalidModuleNameConventionErrorWithModuleName original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.packaging.InvalidModuleNameConventionError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "moduleName"),- Core.fieldTerm = (Typed.unTypedTerm newVal)}]}))---- | DSL injection for the conflictingModuleName variant of hydra.error.packaging.InvalidPackageError-invalidPackageErrorConflictingModuleName :: Typed.TypedTerm ErrorPackaging.ConflictingModuleNameError -> Typed.TypedTerm ErrorPackaging.InvalidPackageError-invalidPackageErrorConflictingModuleName x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.error.packaging.InvalidPackageError"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "conflictingModuleName"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the duplicateModuleName variant of hydra.error.packaging.InvalidPackageError-invalidPackageErrorDuplicateModuleName :: Typed.TypedTerm ErrorPackaging.DuplicateModuleNameError -> Typed.TypedTerm ErrorPackaging.InvalidPackageError-invalidPackageErrorDuplicateModuleName x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.error.packaging.InvalidPackageError"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "duplicateModuleName"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the invalidModule variant of hydra.error.packaging.InvalidPackageError-invalidPackageErrorInvalidModule :: Typed.TypedTerm ErrorPackaging.InvalidModuleError -> Typed.TypedTerm ErrorPackaging.InvalidPackageError-invalidPackageErrorInvalidModule x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.error.packaging.InvalidPackageError"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "invalidModule"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL name token for hydra.error.packaging.InvalidPackageError-invalidPackageErrorInvalidPackageError :: Typed.TypedName ErrorPackaging.InvalidPackageError-invalidPackageErrorInvalidPackageError = Typed.TypedName (Core.Name "hydra.error.packaging.InvalidPackageError")---- | DSL injection for the invalidPackageName variant of hydra.error.packaging.InvalidPackageError-invalidPackageErrorInvalidPackageName :: Typed.TypedTerm ErrorPackaging.InvalidPackageNameError -> Typed.TypedTerm ErrorPackaging.InvalidPackageError-invalidPackageErrorInvalidPackageName x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.error.packaging.InvalidPackageError"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "invalidPackageName"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the moduleInMultiplePackages variant of hydra.error.packaging.InvalidPackageError-invalidPackageErrorModuleInMultiplePackages :: Typed.TypedTerm ErrorPackaging.ModuleInMultiplePackagesError -> Typed.TypedTerm ErrorPackaging.InvalidPackageError-invalidPackageErrorModuleInMultiplePackages x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.error.packaging.InvalidPackageError"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "moduleInMultiplePackages"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the nestedModuleName variant of hydra.error.packaging.InvalidPackageError-invalidPackageErrorNestedModuleName :: Typed.TypedTerm ErrorPackaging.NestedModuleNameError -> Typed.TypedTerm ErrorPackaging.InvalidPackageError-invalidPackageErrorNestedModuleName x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.error.packaging.InvalidPackageError"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "nestedModuleName"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the undeclaredDependency variant of hydra.error.packaging.InvalidPackageError-invalidPackageErrorUndeclaredDependency :: Typed.TypedTerm ErrorPackaging.UndeclaredDependencyError -> Typed.TypedTerm ErrorPackaging.InvalidPackageError-invalidPackageErrorUndeclaredDependency x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.error.packaging.InvalidPackageError"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "undeclaredDependency"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL constructor for hydra.error.packaging.InvalidPackageNameError-invalidPackageNameError :: Typed.TypedTerm Packaging.PackageName -> Typed.TypedTerm ErrorPackaging.InvalidPackageNameError-invalidPackageNameError packageName =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.packaging.InvalidPackageNameError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "packageName"),- Core.fieldTerm = (Typed.unTypedTerm packageName)}]}))---- | DSL name token for hydra.error.packaging.InvalidPackageNameError-invalidPackageNameErrorInvalidPackageNameError :: Typed.TypedName ErrorPackaging.InvalidPackageNameError-invalidPackageNameErrorInvalidPackageNameError =- Typed.TypedName (Core.Name "hydra.error.packaging.InvalidPackageNameError")---- | DSL accessor for the packageName field of hydra.error.packaging.InvalidPackageNameError-invalidPackageNameErrorPackageName :: Typed.TypedTerm ErrorPackaging.InvalidPackageNameError -> Typed.TypedTerm Packaging.PackageName-invalidPackageNameErrorPackageName x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.packaging.InvalidPackageNameError"),- Core.projectionFieldName = (Core.Name "packageName")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL updater for the packageName field of hydra.error.packaging.InvalidPackageNameError-invalidPackageNameErrorWithPackageName :: Typed.TypedTerm ErrorPackaging.InvalidPackageNameError -> Typed.TypedTerm Packaging.PackageName -> Typed.TypedTerm ErrorPackaging.InvalidPackageNameError-invalidPackageNameErrorWithPackageName original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.packaging.InvalidPackageNameError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "packageName"),- Core.fieldTerm = (Typed.unTypedTerm newVal)}]}))---- | DSL constructor for hydra.error.packaging.MissingDocumentationError-missingDocumentationError :: Typed.TypedTerm Packaging.ModuleName -> Typed.TypedTerm Core.Name -> Typed.TypedTerm ErrorPackaging.MissingDocumentationError-missingDocumentationError moduleName name =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.packaging.MissingDocumentationError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "moduleName"),- Core.fieldTerm = (Typed.unTypedTerm moduleName)},- Core.Field {- Core.fieldName = (Core.Name "name"),- Core.fieldTerm = (Typed.unTypedTerm name)}]}))---- | DSL name token for hydra.error.packaging.MissingDocumentationError-missingDocumentationErrorMissingDocumentationError :: Typed.TypedName ErrorPackaging.MissingDocumentationError-missingDocumentationErrorMissingDocumentationError =- Typed.TypedName (Core.Name "hydra.error.packaging.MissingDocumentationError")---- | DSL accessor for the moduleName field of hydra.error.packaging.MissingDocumentationError-missingDocumentationErrorModuleName :: Typed.TypedTerm ErrorPackaging.MissingDocumentationError -> Typed.TypedTerm Packaging.ModuleName-missingDocumentationErrorModuleName x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.packaging.MissingDocumentationError"),- Core.projectionFieldName = (Core.Name "moduleName")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL accessor for the name field of hydra.error.packaging.MissingDocumentationError-missingDocumentationErrorName :: Typed.TypedTerm ErrorPackaging.MissingDocumentationError -> Typed.TypedTerm Core.Name-missingDocumentationErrorName x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.packaging.MissingDocumentationError"),- Core.projectionFieldName = (Core.Name "name")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL updater for the moduleName field of hydra.error.packaging.MissingDocumentationError-missingDocumentationErrorWithModuleName :: Typed.TypedTerm ErrorPackaging.MissingDocumentationError -> Typed.TypedTerm Packaging.ModuleName -> Typed.TypedTerm ErrorPackaging.MissingDocumentationError-missingDocumentationErrorWithModuleName original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.packaging.MissingDocumentationError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "moduleName"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "name"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.packaging.MissingDocumentationError"),- Core.projectionFieldName = (Core.Name "name")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL updater for the name field of hydra.error.packaging.MissingDocumentationError-missingDocumentationErrorWithName :: Typed.TypedTerm ErrorPackaging.MissingDocumentationError -> Typed.TypedTerm Core.Name -> Typed.TypedTerm ErrorPackaging.MissingDocumentationError-missingDocumentationErrorWithName original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.packaging.MissingDocumentationError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "moduleName"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.packaging.MissingDocumentationError"),- Core.projectionFieldName = (Core.Name "moduleName")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "name"),- Core.fieldTerm = (Typed.unTypedTerm newVal)}]}))---- | DSL constructor for hydra.error.packaging.ModuleInMultiplePackagesError-moduleInMultiplePackagesError :: Typed.TypedTerm Packaging.ModuleName -> Typed.TypedTerm Packaging.PackageName -> Typed.TypedTerm Packaging.PackageName -> Typed.TypedTerm ErrorPackaging.ModuleInMultiplePackagesError-moduleInMultiplePackagesError moduleName firstPackage secondPackage =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.packaging.ModuleInMultiplePackagesError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "moduleName"),- Core.fieldTerm = (Typed.unTypedTerm moduleName)},- Core.Field {- Core.fieldName = (Core.Name "firstPackage"),- Core.fieldTerm = (Typed.unTypedTerm firstPackage)},- Core.Field {- Core.fieldName = (Core.Name "secondPackage"),- Core.fieldTerm = (Typed.unTypedTerm secondPackage)}]}))---- | DSL accessor for the firstPackage field of hydra.error.packaging.ModuleInMultiplePackagesError-moduleInMultiplePackagesErrorFirstPackage :: Typed.TypedTerm ErrorPackaging.ModuleInMultiplePackagesError -> Typed.TypedTerm Packaging.PackageName-moduleInMultiplePackagesErrorFirstPackage x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.packaging.ModuleInMultiplePackagesError"),- Core.projectionFieldName = (Core.Name "firstPackage")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL name token for hydra.error.packaging.ModuleInMultiplePackagesError-moduleInMultiplePackagesErrorModuleInMultiplePackagesError :: Typed.TypedName ErrorPackaging.ModuleInMultiplePackagesError-moduleInMultiplePackagesErrorModuleInMultiplePackagesError =- Typed.TypedName (Core.Name "hydra.error.packaging.ModuleInMultiplePackagesError")---- | DSL accessor for the moduleName field of hydra.error.packaging.ModuleInMultiplePackagesError-moduleInMultiplePackagesErrorModuleName :: Typed.TypedTerm ErrorPackaging.ModuleInMultiplePackagesError -> Typed.TypedTerm Packaging.ModuleName-moduleInMultiplePackagesErrorModuleName x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.packaging.ModuleInMultiplePackagesError"),- Core.projectionFieldName = (Core.Name "moduleName")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL accessor for the secondPackage field of hydra.error.packaging.ModuleInMultiplePackagesError-moduleInMultiplePackagesErrorSecondPackage :: Typed.TypedTerm ErrorPackaging.ModuleInMultiplePackagesError -> Typed.TypedTerm Packaging.PackageName-moduleInMultiplePackagesErrorSecondPackage x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.packaging.ModuleInMultiplePackagesError"),- Core.projectionFieldName = (Core.Name "secondPackage")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL updater for the firstPackage field of hydra.error.packaging.ModuleInMultiplePackagesError-moduleInMultiplePackagesErrorWithFirstPackage :: Typed.TypedTerm ErrorPackaging.ModuleInMultiplePackagesError -> Typed.TypedTerm Packaging.PackageName -> Typed.TypedTerm ErrorPackaging.ModuleInMultiplePackagesError-moduleInMultiplePackagesErrorWithFirstPackage original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.packaging.ModuleInMultiplePackagesError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "moduleName"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.packaging.ModuleInMultiplePackagesError"),- Core.projectionFieldName = (Core.Name "moduleName")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "firstPackage"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "secondPackage"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.packaging.ModuleInMultiplePackagesError"),- Core.projectionFieldName = (Core.Name "secondPackage")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL updater for the moduleName field of hydra.error.packaging.ModuleInMultiplePackagesError-moduleInMultiplePackagesErrorWithModuleName :: Typed.TypedTerm ErrorPackaging.ModuleInMultiplePackagesError -> Typed.TypedTerm Packaging.ModuleName -> Typed.TypedTerm ErrorPackaging.ModuleInMultiplePackagesError-moduleInMultiplePackagesErrorWithModuleName original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.packaging.ModuleInMultiplePackagesError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "moduleName"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "firstPackage"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.packaging.ModuleInMultiplePackagesError"),- Core.projectionFieldName = (Core.Name "firstPackage")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "secondPackage"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.packaging.ModuleInMultiplePackagesError"),- Core.projectionFieldName = (Core.Name "secondPackage")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL updater for the secondPackage field of hydra.error.packaging.ModuleInMultiplePackagesError-moduleInMultiplePackagesErrorWithSecondPackage :: Typed.TypedTerm ErrorPackaging.ModuleInMultiplePackagesError -> Typed.TypedTerm Packaging.PackageName -> Typed.TypedTerm ErrorPackaging.ModuleInMultiplePackagesError-moduleInMultiplePackagesErrorWithSecondPackage original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.packaging.ModuleInMultiplePackagesError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "moduleName"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.packaging.ModuleInMultiplePackagesError"),- Core.projectionFieldName = (Core.Name "moduleName")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "firstPackage"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.packaging.ModuleInMultiplePackagesError"),- Core.projectionFieldName = (Core.Name "firstPackage")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "secondPackage"),- Core.fieldTerm = (Typed.unTypedTerm newVal)}]}))---- | DSL constructor for hydra.error.packaging.NestedModuleNameError-nestedModuleNameError :: Typed.TypedTerm Packaging.ModuleName -> Typed.TypedTerm Packaging.ModuleName -> Typed.TypedTerm ErrorPackaging.NestedModuleNameError-nestedModuleNameError outer inner =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.packaging.NestedModuleNameError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "outer"),- Core.fieldTerm = (Typed.unTypedTerm outer)},- Core.Field {- Core.fieldName = (Core.Name "inner"),- Core.fieldTerm = (Typed.unTypedTerm inner)}]}))---- | DSL accessor for the inner field of hydra.error.packaging.NestedModuleNameError-nestedModuleNameErrorInner :: Typed.TypedTerm ErrorPackaging.NestedModuleNameError -> Typed.TypedTerm Packaging.ModuleName-nestedModuleNameErrorInner x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.packaging.NestedModuleNameError"),- Core.projectionFieldName = (Core.Name "inner")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL name token for hydra.error.packaging.NestedModuleNameError-nestedModuleNameErrorNestedModuleNameError :: Typed.TypedName ErrorPackaging.NestedModuleNameError-nestedModuleNameErrorNestedModuleNameError = Typed.TypedName (Core.Name "hydra.error.packaging.NestedModuleNameError")---- | DSL accessor for the outer field of hydra.error.packaging.NestedModuleNameError-nestedModuleNameErrorOuter :: Typed.TypedTerm ErrorPackaging.NestedModuleNameError -> Typed.TypedTerm Packaging.ModuleName-nestedModuleNameErrorOuter x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.packaging.NestedModuleNameError"),- Core.projectionFieldName = (Core.Name "outer")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL updater for the inner field of hydra.error.packaging.NestedModuleNameError-nestedModuleNameErrorWithInner :: Typed.TypedTerm ErrorPackaging.NestedModuleNameError -> Typed.TypedTerm Packaging.ModuleName -> Typed.TypedTerm ErrorPackaging.NestedModuleNameError-nestedModuleNameErrorWithInner original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.packaging.NestedModuleNameError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "outer"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.packaging.NestedModuleNameError"),- Core.projectionFieldName = (Core.Name "outer")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "inner"),- Core.fieldTerm = (Typed.unTypedTerm newVal)}]}))---- | DSL updater for the outer field of hydra.error.packaging.NestedModuleNameError-nestedModuleNameErrorWithOuter :: Typed.TypedTerm ErrorPackaging.NestedModuleNameError -> Typed.TypedTerm Packaging.ModuleName -> Typed.TypedTerm ErrorPackaging.NestedModuleNameError-nestedModuleNameErrorWithOuter original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.packaging.NestedModuleNameError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "outer"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "inner"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.packaging.NestedModuleNameError"),- Core.projectionFieldName = (Core.Name "inner")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL constructor for hydra.error.packaging.UndeclaredDependencyError-undeclaredDependencyError :: Typed.TypedTerm Packaging.ModuleName -> Typed.TypedTerm Core.Name -> Typed.TypedTerm Packaging.ModuleName -> Typed.TypedTerm ErrorPackaging.UndeclaredDependencyError-undeclaredDependencyError moduleName referencedName owningModuleName =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.packaging.UndeclaredDependencyError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "moduleName"),- Core.fieldTerm = (Typed.unTypedTerm moduleName)},- Core.Field {- Core.fieldName = (Core.Name "referencedName"),- Core.fieldTerm = (Typed.unTypedTerm referencedName)},- Core.Field {- Core.fieldName = (Core.Name "owningModuleName"),- Core.fieldTerm = (Typed.unTypedTerm owningModuleName)}]}))---- | DSL accessor for the moduleName field of hydra.error.packaging.UndeclaredDependencyError-undeclaredDependencyErrorModuleName :: Typed.TypedTerm ErrorPackaging.UndeclaredDependencyError -> Typed.TypedTerm Packaging.ModuleName-undeclaredDependencyErrorModuleName x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.packaging.UndeclaredDependencyError"),- Core.projectionFieldName = (Core.Name "moduleName")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL accessor for the owningModuleName field of hydra.error.packaging.UndeclaredDependencyError-undeclaredDependencyErrorOwningModuleName :: Typed.TypedTerm ErrorPackaging.UndeclaredDependencyError -> Typed.TypedTerm Packaging.ModuleName-undeclaredDependencyErrorOwningModuleName x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.packaging.UndeclaredDependencyError"),- Core.projectionFieldName = (Core.Name "owningModuleName")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL accessor for the referencedName field of hydra.error.packaging.UndeclaredDependencyError-undeclaredDependencyErrorReferencedName :: Typed.TypedTerm ErrorPackaging.UndeclaredDependencyError -> Typed.TypedTerm Core.Name-undeclaredDependencyErrorReferencedName x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.packaging.UndeclaredDependencyError"),- Core.projectionFieldName = (Core.Name "referencedName")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL name token for hydra.error.packaging.UndeclaredDependencyError-undeclaredDependencyErrorUndeclaredDependencyError :: Typed.TypedName ErrorPackaging.UndeclaredDependencyError-undeclaredDependencyErrorUndeclaredDependencyError =- Typed.TypedName (Core.Name "hydra.error.packaging.UndeclaredDependencyError")---- | DSL updater for the moduleName field of hydra.error.packaging.UndeclaredDependencyError-undeclaredDependencyErrorWithModuleName :: Typed.TypedTerm ErrorPackaging.UndeclaredDependencyError -> Typed.TypedTerm Packaging.ModuleName -> Typed.TypedTerm ErrorPackaging.UndeclaredDependencyError-undeclaredDependencyErrorWithModuleName original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.packaging.UndeclaredDependencyError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "moduleName"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "referencedName"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.packaging.UndeclaredDependencyError"),- Core.projectionFieldName = (Core.Name "referencedName")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "owningModuleName"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.packaging.UndeclaredDependencyError"),- Core.projectionFieldName = (Core.Name "owningModuleName")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL updater for the owningModuleName field of hydra.error.packaging.UndeclaredDependencyError-undeclaredDependencyErrorWithOwningModuleName :: Typed.TypedTerm ErrorPackaging.UndeclaredDependencyError -> Typed.TypedTerm Packaging.ModuleName -> Typed.TypedTerm ErrorPackaging.UndeclaredDependencyError-undeclaredDependencyErrorWithOwningModuleName original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.packaging.UndeclaredDependencyError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "moduleName"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.packaging.UndeclaredDependencyError"),- Core.projectionFieldName = (Core.Name "moduleName")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "referencedName"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.packaging.UndeclaredDependencyError"),- Core.projectionFieldName = (Core.Name "referencedName")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "owningModuleName"),- Core.fieldTerm = (Typed.unTypedTerm newVal)}]}))---- | DSL updater for the referencedName field of hydra.error.packaging.UndeclaredDependencyError-undeclaredDependencyErrorWithReferencedName :: Typed.TypedTerm ErrorPackaging.UndeclaredDependencyError -> Typed.TypedTerm Core.Name -> Typed.TypedTerm ErrorPackaging.UndeclaredDependencyError-undeclaredDependencyErrorWithReferencedName original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.error.packaging.UndeclaredDependencyError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "moduleName"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.packaging.UndeclaredDependencyError"),- Core.projectionFieldName = (Core.Name "moduleName")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "referencedName"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "owningModuleName"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.error.packaging.UndeclaredDependencyError"),- Core.projectionFieldName = (Core.Name "owningModuleName")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))
@@ -1,65 +0,0 @@--- Note: this is an automatically generated file. Do not edit.---- | DSL functions for hydra.error.system--module Hydra.Dsl.Error.System where--import qualified Hydra.Core as Core-import qualified Hydra.Decode.Error.System as DecodeErrorSystem-import qualified Hydra.Dsl.File as DslFile-import qualified Hydra.Encode.Error.System as EncodeErrorSystem-import qualified Hydra.Error.System as System-import qualified Hydra.File as File-import qualified Hydra.Typed as Typed-import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)-import qualified Data.Scientific as Sci-import Data.Void---- | DSL injection for the commandNotFound variant of hydra.error.system.SystemError-systemErrorCommandNotFound :: Typed.TypedTerm File.FilePath -> Typed.TypedTerm System.SystemError-systemErrorCommandNotFound x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.error.system.SystemError"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "commandNotFound"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the interrupted variant of hydra.error.system.SystemError-systemErrorInterrupted :: Typed.TypedTerm System.SystemError-systemErrorInterrupted =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.error.system.SystemError"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "interrupted"),- Core.fieldTerm = Core.TermUnit}}))---- | DSL injection for the invalidWorkingDirectory variant of hydra.error.system.SystemError-systemErrorInvalidWorkingDirectory :: Typed.TypedTerm File.FilePath -> Typed.TypedTerm System.SystemError-systemErrorInvalidWorkingDirectory x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.error.system.SystemError"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "invalidWorkingDirectory"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the other variant of hydra.error.system.SystemError-systemErrorOther :: Typed.TypedTerm String -> Typed.TypedTerm System.SystemError-systemErrorOther x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.error.system.SystemError"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "other"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the permissionDenied variant of hydra.error.system.SystemError-systemErrorPermissionDenied :: Typed.TypedTerm File.FilePath -> Typed.TypedTerm System.SystemError-systemErrorPermissionDenied x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.error.system.SystemError"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "permissionDenied"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL name token for hydra.error.system.SystemError-systemErrorSystemError :: Typed.TypedName System.SystemError-systemErrorSystemError = Typed.TypedName (Core.Name "hydra.error.system.SystemError")
@@ -1,856 +0,0 @@--- Note: this is an automatically generated file. Do not edit.---- | DSL functions for hydra.errors--module Hydra.Dsl.Errors where--import qualified Hydra.Core as Core-import qualified Hydra.Decode.Errors as DecodeErrors-import qualified Hydra.Dsl.Core as DslCore-import qualified Hydra.Dsl.Error.Checking as ErrorChecking-import qualified Hydra.Dsl.Error.Core as DslErrorCore-import qualified Hydra.Dsl.Paths as DslPaths-import qualified Hydra.Dsl.Typing as DslTyping-import qualified Hydra.Dsl.Variants as DslVariants-import qualified Hydra.Encode.Errors as EncodeErrors-import qualified Hydra.Error.Checking as Checking-import qualified Hydra.Error.Core as ErrorCore-import qualified Hydra.Errors as Errors-import qualified Hydra.Paths as Paths-import qualified Hydra.Typed as Typed-import qualified Hydra.Typing as Typing-import qualified Hydra.Variants as Variants-import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)-import qualified Data.Scientific as Sci-import Data.Void---- | DSL constructor for the hydra.errors.DecodingError wrapper-decodingError :: Typed.TypedTerm String -> Typed.TypedTerm Errors.DecodingError-decodingError x =- Typed.TypedTerm (Core.TermWrap (Core.WrappedTerm {- Core.wrappedTermTypeName = (Core.Name "hydra.errors.DecodingError"),- Core.wrappedTermBody = (Typed.unTypedTerm x)}))---- | DSL name token for hydra.errors.DecodingError-decodingErrorDecodingError :: Typed.TypedName Errors.DecodingError-decodingErrorDecodingError = Typed.TypedName (Core.Name "hydra.errors.DecodingError")---- | DSL injection for the checking variant of hydra.errors.Error-errorChecking :: Typed.TypedTerm Checking.CheckingError -> Typed.TypedTerm Errors.Error-errorChecking x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.errors.Error"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "checking"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the decoding variant of hydra.errors.Error-errorDecoding :: Typed.TypedTerm Errors.DecodingError -> Typed.TypedTerm Errors.Error-errorDecoding x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.errors.Error"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "decoding"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the duplicateBinding variant of hydra.errors.Error-errorDuplicateBinding :: Typed.TypedTerm ErrorCore.DuplicateBindingError -> Typed.TypedTerm Errors.Error-errorDuplicateBinding x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.errors.Error"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "duplicateBinding"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the duplicateField variant of hydra.errors.Error-errorDuplicateField :: Typed.TypedTerm ErrorCore.DuplicateFieldError -> Typed.TypedTerm Errors.Error-errorDuplicateField x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.errors.Error"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "duplicateField"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL name token for hydra.errors.Error-errorError :: Typed.TypedName Errors.Error-errorError = Typed.TypedName (Core.Name "hydra.errors.Error")---- | DSL injection for the extraction variant of hydra.errors.Error-errorExtraction :: Typed.TypedTerm Errors.ExtractionError -> Typed.TypedTerm Errors.Error-errorExtraction x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.errors.Error"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "extraction"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the inference variant of hydra.errors.Error-errorInference :: Typed.TypedTerm Errors.InferenceError -> Typed.TypedTerm Errors.Error-errorInference x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.errors.Error"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "inference"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the invalidLiteral variant of hydra.errors.Error-errorInvalidLiteral :: Typed.TypedTerm ErrorCore.InvalidLiteralError -> Typed.TypedTerm Errors.Error-errorInvalidLiteral x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.errors.Error"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "invalidLiteral"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the other variant of hydra.errors.Error-errorOther :: Typed.TypedTerm Errors.OtherError -> Typed.TypedTerm Errors.Error-errorOther x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.errors.Error"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "other"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the resolution variant of hydra.errors.Error-errorResolution :: Typed.TypedTerm Errors.ResolutionError -> Typed.TypedTerm Errors.Error-errorResolution x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.errors.Error"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "resolution"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the undefinedField variant of hydra.errors.Error-errorUndefinedField :: Typed.TypedTerm ErrorCore.UndefinedFieldError -> Typed.TypedTerm Errors.Error-errorUndefinedField x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.errors.Error"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "undefinedField"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the undefinedTermVariable variant of hydra.errors.Error-errorUndefinedTermVariable :: Typed.TypedTerm ErrorCore.UndefinedTermVariableError -> Typed.TypedTerm Errors.Error-errorUndefinedTermVariable x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.errors.Error"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "undefinedTermVariable"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the unexpectedTermVariant variant of hydra.errors.Error-errorUnexpectedTermVariant :: Typed.TypedTerm ErrorCore.UnexpectedTermVariantError -> Typed.TypedTerm Errors.Error-errorUnexpectedTermVariant x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.errors.Error"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "unexpectedTermVariant"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the unexpectedTypeVariant variant of hydra.errors.Error-errorUnexpectedTypeVariant :: Typed.TypedTerm ErrorCore.UnexpectedTypeVariantError -> Typed.TypedTerm Errors.Error-errorUnexpectedTypeVariant x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.errors.Error"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "unexpectedTypeVariant"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the unification variant of hydra.errors.Error-errorUnification :: Typed.TypedTerm Errors.UnificationError -> Typed.TypedTerm Errors.Error-errorUnification x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.errors.Error"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "unification"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the untypedTermVariable variant of hydra.errors.Error-errorUntypedTermVariable :: Typed.TypedTerm ErrorCore.UntypedTermVariableError -> Typed.TypedTerm Errors.Error-errorUntypedTermVariable x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.errors.Error"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "untypedTermVariable"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the emptyList variant of hydra.errors.ExtractionError-extractionErrorEmptyList :: Typed.TypedTerm Errors.EmptyListError -> Typed.TypedTerm Errors.ExtractionError-extractionErrorEmptyList x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.errors.ExtractionError"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "emptyList"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL name token for hydra.errors.ExtractionError-extractionErrorExtractionError :: Typed.TypedName Errors.ExtractionError-extractionErrorExtractionError = Typed.TypedName (Core.Name "hydra.errors.ExtractionError")---- | DSL injection for the multipleBindings variant of hydra.errors.ExtractionError-extractionErrorMultipleBindings :: Typed.TypedTerm Errors.MultipleBindingsError -> Typed.TypedTerm Errors.ExtractionError-extractionErrorMultipleBindings x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.errors.ExtractionError"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "multipleBindings"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the multipleFields variant of hydra.errors.ExtractionError-extractionErrorMultipleFields :: Typed.TypedTerm Errors.MultipleFieldsError -> Typed.TypedTerm Errors.ExtractionError-extractionErrorMultipleFields x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.errors.ExtractionError"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "multipleFields"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the noMatchingField variant of hydra.errors.ExtractionError-extractionErrorNoMatchingField :: Typed.TypedTerm Errors.NoMatchingFieldError -> Typed.TypedTerm Errors.ExtractionError-extractionErrorNoMatchingField x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.errors.ExtractionError"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "noMatchingField"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the noSuchBinding variant of hydra.errors.ExtractionError-extractionErrorNoSuchBinding :: Typed.TypedTerm Errors.NoSuchBindingError -> Typed.TypedTerm Errors.ExtractionError-extractionErrorNoSuchBinding x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.errors.ExtractionError"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "noSuchBinding"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the notEnoughCases variant of hydra.errors.ExtractionError-extractionErrorNotEnoughCases :: Typed.TypedTerm Errors.NotEnoughCasesError -> Typed.TypedTerm Errors.ExtractionError-extractionErrorNotEnoughCases x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.errors.ExtractionError"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "notEnoughCases"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the unexpectedShape variant of hydra.errors.ExtractionError-extractionErrorUnexpectedShape :: Typed.TypedTerm Errors.UnexpectedShapeError -> Typed.TypedTerm Errors.ExtractionError-extractionErrorUnexpectedShape x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.errors.ExtractionError"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "unexpectedShape"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the checking variant of hydra.errors.InferenceError-inferenceErrorChecking :: Typed.TypedTerm Checking.CheckingError -> Typed.TypedTerm Errors.InferenceError-inferenceErrorChecking x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.errors.InferenceError"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "checking"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL name token for hydra.errors.InferenceError-inferenceErrorInferenceError :: Typed.TypedName Errors.InferenceError-inferenceErrorInferenceError = Typed.TypedName (Core.Name "hydra.errors.InferenceError")---- | DSL injection for the other variant of hydra.errors.InferenceError-inferenceErrorOther :: Typed.TypedTerm Errors.OtherInferenceError -> Typed.TypedTerm Errors.InferenceError-inferenceErrorOther x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.errors.InferenceError"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "other"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the unification variant of hydra.errors.InferenceError-inferenceErrorUnification :: Typed.TypedTerm Errors.UnificationInferenceError -> Typed.TypedTerm Errors.InferenceError-inferenceErrorUnification x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.errors.InferenceError"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "unification"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL constructor for hydra.errors.MultipleBindingsError-multipleBindingsError :: Typed.TypedTerm Core.Name -> Typed.TypedTerm Errors.MultipleBindingsError-multipleBindingsError name =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.errors.MultipleBindingsError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "name"),- Core.fieldTerm = (Typed.unTypedTerm name)}]}))---- | DSL name token for hydra.errors.MultipleBindingsError-multipleBindingsErrorMultipleBindingsError :: Typed.TypedName Errors.MultipleBindingsError-multipleBindingsErrorMultipleBindingsError = Typed.TypedName (Core.Name "hydra.errors.MultipleBindingsError")---- | DSL accessor for the name field of hydra.errors.MultipleBindingsError-multipleBindingsErrorName :: Typed.TypedTerm Errors.MultipleBindingsError -> Typed.TypedTerm Core.Name-multipleBindingsErrorName x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.errors.MultipleBindingsError"),- Core.projectionFieldName = (Core.Name "name")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL updater for the name field of hydra.errors.MultipleBindingsError-multipleBindingsErrorWithName :: Typed.TypedTerm Errors.MultipleBindingsError -> Typed.TypedTerm Core.Name -> Typed.TypedTerm Errors.MultipleBindingsError-multipleBindingsErrorWithName original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.errors.MultipleBindingsError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "name"),- Core.fieldTerm = (Typed.unTypedTerm newVal)}]}))---- | DSL constructor for hydra.errors.MultipleFieldsError-multipleFieldsError :: Typed.TypedTerm Core.Name -> Typed.TypedTerm Errors.MultipleFieldsError-multipleFieldsError fieldName =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.errors.MultipleFieldsError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "fieldName"),- Core.fieldTerm = (Typed.unTypedTerm fieldName)}]}))---- | DSL accessor for the fieldName field of hydra.errors.MultipleFieldsError-multipleFieldsErrorFieldName :: Typed.TypedTerm Errors.MultipleFieldsError -> Typed.TypedTerm Core.Name-multipleFieldsErrorFieldName x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.errors.MultipleFieldsError"),- Core.projectionFieldName = (Core.Name "fieldName")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL name token for hydra.errors.MultipleFieldsError-multipleFieldsErrorMultipleFieldsError :: Typed.TypedName Errors.MultipleFieldsError-multipleFieldsErrorMultipleFieldsError = Typed.TypedName (Core.Name "hydra.errors.MultipleFieldsError")---- | DSL updater for the fieldName field of hydra.errors.MultipleFieldsError-multipleFieldsErrorWithFieldName :: Typed.TypedTerm Errors.MultipleFieldsError -> Typed.TypedTerm Core.Name -> Typed.TypedTerm Errors.MultipleFieldsError-multipleFieldsErrorWithFieldName original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.errors.MultipleFieldsError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "fieldName"),- Core.fieldTerm = (Typed.unTypedTerm newVal)}]}))---- | DSL constructor for hydra.errors.NoMatchingFieldError-noMatchingFieldError :: Typed.TypedTerm Core.Name -> Typed.TypedTerm Errors.NoMatchingFieldError-noMatchingFieldError fieldName =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.errors.NoMatchingFieldError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "fieldName"),- Core.fieldTerm = (Typed.unTypedTerm fieldName)}]}))---- | DSL accessor for the fieldName field of hydra.errors.NoMatchingFieldError-noMatchingFieldErrorFieldName :: Typed.TypedTerm Errors.NoMatchingFieldError -> Typed.TypedTerm Core.Name-noMatchingFieldErrorFieldName x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.errors.NoMatchingFieldError"),- Core.projectionFieldName = (Core.Name "fieldName")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL name token for hydra.errors.NoMatchingFieldError-noMatchingFieldErrorNoMatchingFieldError :: Typed.TypedName Errors.NoMatchingFieldError-noMatchingFieldErrorNoMatchingFieldError = Typed.TypedName (Core.Name "hydra.errors.NoMatchingFieldError")---- | DSL updater for the fieldName field of hydra.errors.NoMatchingFieldError-noMatchingFieldErrorWithFieldName :: Typed.TypedTerm Errors.NoMatchingFieldError -> Typed.TypedTerm Core.Name -> Typed.TypedTerm Errors.NoMatchingFieldError-noMatchingFieldErrorWithFieldName original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.errors.NoMatchingFieldError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "fieldName"),- Core.fieldTerm = (Typed.unTypedTerm newVal)}]}))---- | DSL constructor for hydra.errors.NoSuchBindingError-noSuchBindingError :: Typed.TypedTerm Core.Name -> Typed.TypedTerm Errors.NoSuchBindingError-noSuchBindingError name =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.errors.NoSuchBindingError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "name"),- Core.fieldTerm = (Typed.unTypedTerm name)}]}))---- | DSL accessor for the name field of hydra.errors.NoSuchBindingError-noSuchBindingErrorName :: Typed.TypedTerm Errors.NoSuchBindingError -> Typed.TypedTerm Core.Name-noSuchBindingErrorName x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.errors.NoSuchBindingError"),- Core.projectionFieldName = (Core.Name "name")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL name token for hydra.errors.NoSuchBindingError-noSuchBindingErrorNoSuchBindingError :: Typed.TypedName Errors.NoSuchBindingError-noSuchBindingErrorNoSuchBindingError = Typed.TypedName (Core.Name "hydra.errors.NoSuchBindingError")---- | DSL updater for the name field of hydra.errors.NoSuchBindingError-noSuchBindingErrorWithName :: Typed.TypedTerm Errors.NoSuchBindingError -> Typed.TypedTerm Core.Name -> Typed.TypedTerm Errors.NoSuchBindingError-noSuchBindingErrorWithName original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.errors.NoSuchBindingError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "name"),- Core.fieldTerm = (Typed.unTypedTerm newVal)}]}))---- | DSL constructor for hydra.errors.NoSuchPrimitiveError-noSuchPrimitiveError :: Typed.TypedTerm Core.Name -> Typed.TypedTerm Errors.NoSuchPrimitiveError-noSuchPrimitiveError name =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.errors.NoSuchPrimitiveError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "name"),- Core.fieldTerm = (Typed.unTypedTerm name)}]}))---- | DSL accessor for the name field of hydra.errors.NoSuchPrimitiveError-noSuchPrimitiveErrorName :: Typed.TypedTerm Errors.NoSuchPrimitiveError -> Typed.TypedTerm Core.Name-noSuchPrimitiveErrorName x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.errors.NoSuchPrimitiveError"),- Core.projectionFieldName = (Core.Name "name")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL name token for hydra.errors.NoSuchPrimitiveError-noSuchPrimitiveErrorNoSuchPrimitiveError :: Typed.TypedName Errors.NoSuchPrimitiveError-noSuchPrimitiveErrorNoSuchPrimitiveError = Typed.TypedName (Core.Name "hydra.errors.NoSuchPrimitiveError")---- | DSL updater for the name field of hydra.errors.NoSuchPrimitiveError-noSuchPrimitiveErrorWithName :: Typed.TypedTerm Errors.NoSuchPrimitiveError -> Typed.TypedTerm Core.Name -> Typed.TypedTerm Errors.NoSuchPrimitiveError-noSuchPrimitiveErrorWithName original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.errors.NoSuchPrimitiveError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "name"),- Core.fieldTerm = (Typed.unTypedTerm newVal)}]}))---- | DSL constructor for the hydra.errors.OtherError wrapper-otherError :: Typed.TypedTerm String -> Typed.TypedTerm Errors.OtherError-otherError x =- Typed.TypedTerm (Core.TermWrap (Core.WrappedTerm {- Core.wrappedTermTypeName = (Core.Name "hydra.errors.OtherError"),- Core.wrappedTermBody = (Typed.unTypedTerm x)}))---- | DSL name token for hydra.errors.OtherError-otherErrorOtherError :: Typed.TypedName Errors.OtherError-otherErrorOtherError = Typed.TypedName (Core.Name "hydra.errors.OtherError")---- | DSL constructor for hydra.errors.OtherInferenceError-otherInferenceError :: Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm String -> Typed.TypedTerm Errors.OtherInferenceError-otherInferenceError path message =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.errors.OtherInferenceError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "path"),- Core.fieldTerm = (Typed.unTypedTerm path)},- Core.Field {- Core.fieldName = (Core.Name "message"),- Core.fieldTerm = (Typed.unTypedTerm message)}]}))---- | DSL accessor for the message field of hydra.errors.OtherInferenceError-otherInferenceErrorMessage :: Typed.TypedTerm Errors.OtherInferenceError -> Typed.TypedTerm String-otherInferenceErrorMessage x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.errors.OtherInferenceError"),- Core.projectionFieldName = (Core.Name "message")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL name token for hydra.errors.OtherInferenceError-otherInferenceErrorOtherInferenceError :: Typed.TypedName Errors.OtherInferenceError-otherInferenceErrorOtherInferenceError = Typed.TypedName (Core.Name "hydra.errors.OtherInferenceError")---- | DSL accessor for the path field of hydra.errors.OtherInferenceError-otherInferenceErrorPath :: Typed.TypedTerm Errors.OtherInferenceError -> Typed.TypedTerm Paths.SubtermPath-otherInferenceErrorPath x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.errors.OtherInferenceError"),- Core.projectionFieldName = (Core.Name "path")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL updater for the message field of hydra.errors.OtherInferenceError-otherInferenceErrorWithMessage :: Typed.TypedTerm Errors.OtherInferenceError -> Typed.TypedTerm String -> Typed.TypedTerm Errors.OtherInferenceError-otherInferenceErrorWithMessage original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.errors.OtherInferenceError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "path"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.errors.OtherInferenceError"),- Core.projectionFieldName = (Core.Name "path")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "message"),- Core.fieldTerm = (Typed.unTypedTerm newVal)}]}))---- | DSL updater for the path field of hydra.errors.OtherInferenceError-otherInferenceErrorWithPath :: Typed.TypedTerm Errors.OtherInferenceError -> Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm Errors.OtherInferenceError-otherInferenceErrorWithPath original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.errors.OtherInferenceError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "path"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "message"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.errors.OtherInferenceError"),- Core.projectionFieldName = (Core.Name "message")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL constructor for the hydra.errors.OtherResolutionError wrapper-otherResolutionError :: Typed.TypedTerm String -> Typed.TypedTerm Errors.OtherResolutionError-otherResolutionError x =- Typed.TypedTerm (Core.TermWrap (Core.WrappedTerm {- Core.wrappedTermTypeName = (Core.Name "hydra.errors.OtherResolutionError"),- Core.wrappedTermBody = (Typed.unTypedTerm x)}))---- | DSL name token for hydra.errors.OtherResolutionError-otherResolutionErrorOtherResolutionError :: Typed.TypedName Errors.OtherResolutionError-otherResolutionErrorOtherResolutionError = Typed.TypedName (Core.Name "hydra.errors.OtherResolutionError")---- | DSL injection for the noMatchingField variant of hydra.errors.ResolutionError-resolutionErrorNoMatchingField :: Typed.TypedTerm Errors.NoMatchingFieldError -> Typed.TypedTerm Errors.ResolutionError-resolutionErrorNoMatchingField x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.errors.ResolutionError"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "noMatchingField"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the noSuchBinding variant of hydra.errors.ResolutionError-resolutionErrorNoSuchBinding :: Typed.TypedTerm Errors.NoSuchBindingError -> Typed.TypedTerm Errors.ResolutionError-resolutionErrorNoSuchBinding x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.errors.ResolutionError"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "noSuchBinding"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the noSuchPrimitive variant of hydra.errors.ResolutionError-resolutionErrorNoSuchPrimitive :: Typed.TypedTerm Errors.NoSuchPrimitiveError -> Typed.TypedTerm Errors.ResolutionError-resolutionErrorNoSuchPrimitive x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.errors.ResolutionError"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "noSuchPrimitive"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the other variant of hydra.errors.ResolutionError-resolutionErrorOther :: Typed.TypedTerm Errors.OtherResolutionError -> Typed.TypedTerm Errors.ResolutionError-resolutionErrorOther x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.errors.ResolutionError"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "other"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL name token for hydra.errors.ResolutionError-resolutionErrorResolutionError :: Typed.TypedName Errors.ResolutionError-resolutionErrorResolutionError = Typed.TypedName (Core.Name "hydra.errors.ResolutionError")---- | DSL injection for the unexpectedShape variant of hydra.errors.ResolutionError-resolutionErrorUnexpectedShape :: Typed.TypedTerm Errors.UnexpectedShapeError -> Typed.TypedTerm Errors.ResolutionError-resolutionErrorUnexpectedShape x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.errors.ResolutionError"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "unexpectedShape"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL accessor for the body of hydra.errors.DecodingError-unDecodingError :: Typed.TypedTerm Errors.DecodingError -> Typed.TypedTerm String-unDecodingError x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermUnwrap (Core.Name "hydra.errors.DecodingError")),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL accessor for the body of hydra.errors.OtherError-unOtherError :: Typed.TypedTerm Errors.OtherError -> Typed.TypedTerm String-unOtherError x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermUnwrap (Core.Name "hydra.errors.OtherError")),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL accessor for the body of hydra.errors.OtherResolutionError-unOtherResolutionError :: Typed.TypedTerm Errors.OtherResolutionError -> Typed.TypedTerm String-unOtherResolutionError x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermUnwrap (Core.Name "hydra.errors.OtherResolutionError")),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL constructor for hydra.errors.UnexpectedShapeError-unexpectedShapeError :: Typed.TypedTerm String -> Typed.TypedTerm String -> Typed.TypedTerm Errors.UnexpectedShapeError-unexpectedShapeError expected actual =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.errors.UnexpectedShapeError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "expected"),- Core.fieldTerm = (Typed.unTypedTerm expected)},- Core.Field {- Core.fieldName = (Core.Name "actual"),- Core.fieldTerm = (Typed.unTypedTerm actual)}]}))---- | DSL accessor for the actual field of hydra.errors.UnexpectedShapeError-unexpectedShapeErrorActual :: Typed.TypedTerm Errors.UnexpectedShapeError -> Typed.TypedTerm String-unexpectedShapeErrorActual x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.errors.UnexpectedShapeError"),- Core.projectionFieldName = (Core.Name "actual")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL accessor for the expected field of hydra.errors.UnexpectedShapeError-unexpectedShapeErrorExpected :: Typed.TypedTerm Errors.UnexpectedShapeError -> Typed.TypedTerm String-unexpectedShapeErrorExpected x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.errors.UnexpectedShapeError"),- Core.projectionFieldName = (Core.Name "expected")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL name token for hydra.errors.UnexpectedShapeError-unexpectedShapeErrorUnexpectedShapeError :: Typed.TypedName Errors.UnexpectedShapeError-unexpectedShapeErrorUnexpectedShapeError = Typed.TypedName (Core.Name "hydra.errors.UnexpectedShapeError")---- | DSL updater for the actual field of hydra.errors.UnexpectedShapeError-unexpectedShapeErrorWithActual :: Typed.TypedTerm Errors.UnexpectedShapeError -> Typed.TypedTerm String -> Typed.TypedTerm Errors.UnexpectedShapeError-unexpectedShapeErrorWithActual original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.errors.UnexpectedShapeError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "expected"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.errors.UnexpectedShapeError"),- Core.projectionFieldName = (Core.Name "expected")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "actual"),- Core.fieldTerm = (Typed.unTypedTerm newVal)}]}))---- | DSL updater for the expected field of hydra.errors.UnexpectedShapeError-unexpectedShapeErrorWithExpected :: Typed.TypedTerm Errors.UnexpectedShapeError -> Typed.TypedTerm String -> Typed.TypedTerm Errors.UnexpectedShapeError-unexpectedShapeErrorWithExpected original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.errors.UnexpectedShapeError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "expected"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "actual"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.errors.UnexpectedShapeError"),- Core.projectionFieldName = (Core.Name "actual")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL constructor for hydra.errors.UnificationError-unificationError :: Typed.TypedTerm Core.Type -> Typed.TypedTerm Core.Type -> Typed.TypedTerm String -> Typed.TypedTerm Errors.UnificationError-unificationError leftType rightType message =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.errors.UnificationError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "leftType"),- Core.fieldTerm = (Typed.unTypedTerm leftType)},- Core.Field {- Core.fieldName = (Core.Name "rightType"),- Core.fieldTerm = (Typed.unTypedTerm rightType)},- Core.Field {- Core.fieldName = (Core.Name "message"),- Core.fieldTerm = (Typed.unTypedTerm message)}]}))---- | DSL accessor for the leftType field of hydra.errors.UnificationError-unificationErrorLeftType :: Typed.TypedTerm Errors.UnificationError -> Typed.TypedTerm Core.Type-unificationErrorLeftType x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.errors.UnificationError"),- Core.projectionFieldName = (Core.Name "leftType")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL accessor for the message field of hydra.errors.UnificationError-unificationErrorMessage :: Typed.TypedTerm Errors.UnificationError -> Typed.TypedTerm String-unificationErrorMessage x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.errors.UnificationError"),- Core.projectionFieldName = (Core.Name "message")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL accessor for the rightType field of hydra.errors.UnificationError-unificationErrorRightType :: Typed.TypedTerm Errors.UnificationError -> Typed.TypedTerm Core.Type-unificationErrorRightType x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.errors.UnificationError"),- Core.projectionFieldName = (Core.Name "rightType")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL name token for hydra.errors.UnificationError-unificationErrorUnificationError :: Typed.TypedName Errors.UnificationError-unificationErrorUnificationError = Typed.TypedName (Core.Name "hydra.errors.UnificationError")---- | DSL updater for the leftType field of hydra.errors.UnificationError-unificationErrorWithLeftType :: Typed.TypedTerm Errors.UnificationError -> Typed.TypedTerm Core.Type -> Typed.TypedTerm Errors.UnificationError-unificationErrorWithLeftType original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.errors.UnificationError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "leftType"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "rightType"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.errors.UnificationError"),- Core.projectionFieldName = (Core.Name "rightType")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "message"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.errors.UnificationError"),- Core.projectionFieldName = (Core.Name "message")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL updater for the message field of hydra.errors.UnificationError-unificationErrorWithMessage :: Typed.TypedTerm Errors.UnificationError -> Typed.TypedTerm String -> Typed.TypedTerm Errors.UnificationError-unificationErrorWithMessage original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.errors.UnificationError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "leftType"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.errors.UnificationError"),- Core.projectionFieldName = (Core.Name "leftType")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "rightType"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.errors.UnificationError"),- Core.projectionFieldName = (Core.Name "rightType")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "message"),- Core.fieldTerm = (Typed.unTypedTerm newVal)}]}))---- | DSL updater for the rightType field of hydra.errors.UnificationError-unificationErrorWithRightType :: Typed.TypedTerm Errors.UnificationError -> Typed.TypedTerm Core.Type -> Typed.TypedTerm Errors.UnificationError-unificationErrorWithRightType original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.errors.UnificationError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "leftType"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.errors.UnificationError"),- Core.projectionFieldName = (Core.Name "leftType")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "rightType"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "message"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.errors.UnificationError"),- Core.projectionFieldName = (Core.Name "message")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL constructor for hydra.errors.UnificationInferenceError-unificationInferenceError :: Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm Errors.UnificationError -> Typed.TypedTerm Errors.UnificationInferenceError-unificationInferenceError path cause =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.errors.UnificationInferenceError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "path"),- Core.fieldTerm = (Typed.unTypedTerm path)},- Core.Field {- Core.fieldName = (Core.Name "cause"),- Core.fieldTerm = (Typed.unTypedTerm cause)}]}))---- | DSL accessor for the cause field of hydra.errors.UnificationInferenceError-unificationInferenceErrorCause :: Typed.TypedTerm Errors.UnificationInferenceError -> Typed.TypedTerm Errors.UnificationError-unificationInferenceErrorCause x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.errors.UnificationInferenceError"),- Core.projectionFieldName = (Core.Name "cause")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL accessor for the path field of hydra.errors.UnificationInferenceError-unificationInferenceErrorPath :: Typed.TypedTerm Errors.UnificationInferenceError -> Typed.TypedTerm Paths.SubtermPath-unificationInferenceErrorPath x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.errors.UnificationInferenceError"),- Core.projectionFieldName = (Core.Name "path")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL name token for hydra.errors.UnificationInferenceError-unificationInferenceErrorUnificationInferenceError :: Typed.TypedName Errors.UnificationInferenceError-unificationInferenceErrorUnificationInferenceError = Typed.TypedName (Core.Name "hydra.errors.UnificationInferenceError")---- | DSL updater for the cause field of hydra.errors.UnificationInferenceError-unificationInferenceErrorWithCause :: Typed.TypedTerm Errors.UnificationInferenceError -> Typed.TypedTerm Errors.UnificationError -> Typed.TypedTerm Errors.UnificationInferenceError-unificationInferenceErrorWithCause original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.errors.UnificationInferenceError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "path"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.errors.UnificationInferenceError"),- Core.projectionFieldName = (Core.Name "path")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "cause"),- Core.fieldTerm = (Typed.unTypedTerm newVal)}]}))---- | DSL updater for the path field of hydra.errors.UnificationInferenceError-unificationInferenceErrorWithPath :: Typed.TypedTerm Errors.UnificationInferenceError -> Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm Errors.UnificationInferenceError-unificationInferenceErrorWithPath original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.errors.UnificationInferenceError"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "path"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "cause"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.errors.UnificationInferenceError"),- Core.projectionFieldName = (Core.Name "cause")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))
@@ -1,168 +0,0 @@--- Note: this is an automatically generated file. Do not edit.---- | DSL functions for hydra.extract.json--module Hydra.Dsl.Extract.Json where--import qualified Hydra.Ast as Ast-import qualified Hydra.Coders as Coders-import qualified Hydra.Core as Core-import qualified Hydra.Docs as Docs-import qualified Hydra.Dsl.Ast as DslAst-import qualified Hydra.Dsl.Coders as DslCoders-import qualified Hydra.Dsl.Core as DslCore-import qualified Hydra.Dsl.Docs as DslDocs-import qualified Hydra.Dsl.Error.Checking as ErrorChecking-import qualified Hydra.Dsl.Error.Core as DslErrorCore-import qualified Hydra.Dsl.Error.File as DslErrorFile-import qualified Hydra.Dsl.Error.Packaging as DslErrorPackaging-import qualified Hydra.Dsl.Error.System as DslErrorSystem-import qualified Hydra.Dsl.Errors as DslErrors-import qualified Hydra.Dsl.File as DslFile-import qualified Hydra.Dsl.Graph as DslGraph-import qualified Hydra.Dsl.Json.Model as JsonModel-import qualified Hydra.Dsl.Json.Writer as JsonWriter-import qualified Hydra.Dsl.Packaging as DslPackaging-import qualified Hydra.Dsl.Parsing as DslParsing-import qualified Hydra.Dsl.Paths as DslPaths-import qualified Hydra.Dsl.Query as DslQuery-import qualified Hydra.Dsl.Regex as DslRegex-import qualified Hydra.Dsl.Relational as DslRelational-import qualified Hydra.Dsl.System as DslSystem-import qualified Hydra.Dsl.Tabular as DslTabular-import qualified Hydra.Dsl.Testing as DslTesting-import qualified Hydra.Dsl.Time as DslTime-import qualified Hydra.Dsl.Topology as DslTopology-import qualified Hydra.Dsl.Typing as DslTyping-import qualified Hydra.Dsl.Util as DslUtil-import qualified Hydra.Dsl.Validation as DslValidation-import qualified Hydra.Dsl.Variants as DslVariants-import qualified Hydra.Error.Checking as Checking-import qualified Hydra.Error.Core as ErrorCore-import qualified Hydra.Error.File as ErrorFile-import qualified Hydra.Error.Packaging as ErrorPackaging-import qualified Hydra.Error.System as ErrorSystem-import qualified Hydra.Errors as Errors-import qualified Hydra.Extract.Json as Json-import qualified Hydra.File as File-import qualified Hydra.Graph as Graph-import qualified Hydra.Json.Model as Model-import qualified Hydra.Json.Writer as Writer-import qualified Hydra.Packaging as Packaging-import qualified Hydra.Parsing as Parsing-import qualified Hydra.Paths as Paths-import qualified Hydra.Query as Query-import qualified Hydra.Regex as Regex-import qualified Hydra.Relational as Relational-import qualified Hydra.System as System-import qualified Hydra.Tabular as Tabular-import qualified Hydra.Testing as Testing-import qualified Hydra.Time as Time-import qualified Hydra.Topology as Topology-import qualified Hydra.Typed as Typed-import qualified Hydra.Typing as Typing-import qualified Hydra.Util as Util-import qualified Hydra.Validation as Validation-import qualified Hydra.Variants as Variants-import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)-import qualified Data.Scientific as Sci-import Data.Void-import qualified Data.Map as M---- | DSL reference to hydra.extract.json.expectArray-expectArray :: Typed.TypedTerm Model.Value -> Typed.TypedTerm (Either String [Model.Value])-expectArray arg0 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.extract.json.expectArray")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))---- | DSL reference to hydra.extract.json.expectNumber-expectNumber :: Typed.TypedTerm Model.Value -> Typed.TypedTerm (Either String Sci.Scientific)-expectNumber arg0 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.extract.json.expectNumber")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))---- | DSL reference to hydra.extract.json.expectObject-expectObject :: Typed.TypedTerm Model.Value -> Typed.TypedTerm (Either String (M.Map String Model.Value))-expectObject arg0 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.extract.json.expectObject")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))---- | DSL reference to hydra.extract.json.expectString-expectString :: Typed.TypedTerm Model.Value -> Typed.TypedTerm (Either String String)-expectString arg0 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.extract.json.expectString")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))---- | DSL reference to hydra.extract.json.opt-opt :: Typed.TypedTerm t0 -> Typed.TypedTerm (M.Map t0 t1) -> Typed.TypedTerm (Maybe t1)-opt arg0 arg1 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.extract.json.opt")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))---- | DSL reference to hydra.extract.json.optArray-optArray :: Typed.TypedTerm t0 -> Typed.TypedTerm (M.Map t0 Model.Value) -> Typed.TypedTerm (Either String (Maybe [Model.Value]))-optArray arg0 arg1 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.extract.json.optArray")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))---- | DSL reference to hydra.extract.json.optString-optString :: Typed.TypedTerm t0 -> Typed.TypedTerm (M.Map t0 Model.Value) -> Typed.TypedTerm (Either String (Maybe String))-optString arg0 arg1 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.extract.json.optString")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))---- | DSL reference to hydra.extract.json.require-require :: Typed.TypedTerm String -> Typed.TypedTerm (M.Map String t0) -> Typed.TypedTerm (Either String t0)-require arg0 arg1 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.extract.json.require")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))---- | DSL reference to hydra.extract.json.requireArray-requireArray :: Typed.TypedTerm String -> Typed.TypedTerm (M.Map String Model.Value) -> Typed.TypedTerm (Either String [Model.Value])-requireArray arg0 arg1 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.extract.json.requireArray")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))---- | DSL reference to hydra.extract.json.requireNumber-requireNumber :: Typed.TypedTerm String -> Typed.TypedTerm (M.Map String Model.Value) -> Typed.TypedTerm (Either String Sci.Scientific)-requireNumber arg0 arg1 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.extract.json.requireNumber")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))---- | DSL reference to hydra.extract.json.requireString-requireString :: Typed.TypedTerm String -> Typed.TypedTerm (M.Map String Model.Value) -> Typed.TypedTerm (Either String String)-requireString arg0 arg1 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.extract.json.requireString")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))---- | DSL reference to hydra.extract.json.showValue-showValue :: Typed.TypedTerm Model.Value -> Typed.TypedTerm String-showValue arg0 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.extract.json.showValue")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))
@@ -1,382 +0,0 @@--- Note: this is an automatically generated file. Do not edit.---- | DSL functions for hydra.file--module Hydra.Dsl.File where--import qualified Hydra.Core as Core-import qualified Hydra.Decode.File as DecodeFile-import qualified Hydra.Dsl.Core as DslCore-import qualified Hydra.Dsl.Time as DslTime-import qualified Hydra.Encode.File as EncodeFile-import qualified Hydra.File as File-import qualified Hydra.Time as Time-import qualified Hydra.Typed as Typed-import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)-import qualified Data.Scientific as Sci-import Data.Void-import qualified Data.Int as I---- | DSL constructor for the hydra.file.FileExtension wrapper-fileExtension :: Typed.TypedTerm String -> Typed.TypedTerm File.FileExtension-fileExtension x =- Typed.TypedTerm (Core.TermWrap (Core.WrappedTerm {- Core.wrappedTermTypeName = (Core.Name "hydra.file.FileExtension"),- Core.wrappedTermBody = (Typed.unTypedTerm x)}))---- | DSL name token for hydra.file.FileExtension-fileExtensionFileExtension :: Typed.TypedName File.FileExtension-fileExtensionFileExtension = Typed.TypedName (Core.Name "hydra.file.FileExtension")---- | DSL constructor for the hydra.file.FilePath wrapper-filePath :: Typed.TypedTerm String -> Typed.TypedTerm File.FilePath-filePath x =- Typed.TypedTerm (Core.TermWrap (Core.WrappedTerm {- Core.wrappedTermTypeName = (Core.Name "hydra.file.FilePath"),- Core.wrappedTermBody = (Typed.unTypedTerm x)}))---- | DSL name token for hydra.file.FilePath-filePathFilePath :: Typed.TypedName File.FilePath-filePathFilePath = Typed.TypedName (Core.Name "hydra.file.FilePath")---- | DSL constructor for hydra.file.FileStatus-fileStatus :: Typed.TypedTerm File.FileType -> Typed.TypedTerm I.Int64 -> Typed.TypedTerm Time.Timespec -> Typed.TypedTerm (Maybe Time.Timespec) -> Typed.TypedTerm (Maybe Time.Timespec) -> Typed.TypedTerm File.FileStatus-fileStatus fileType size modificationTime accessTime statusChangeTime =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.file.FileStatus"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "fileType"),- Core.fieldTerm = (Typed.unTypedTerm fileType)},- Core.Field {- Core.fieldName = (Core.Name "size"),- Core.fieldTerm = (Typed.unTypedTerm size)},- Core.Field {- Core.fieldName = (Core.Name "modificationTime"),- Core.fieldTerm = (Typed.unTypedTerm modificationTime)},- Core.Field {- Core.fieldName = (Core.Name "accessTime"),- Core.fieldTerm = (Typed.unTypedTerm accessTime)},- Core.Field {- Core.fieldName = (Core.Name "statusChangeTime"),- Core.fieldTerm = (Typed.unTypedTerm statusChangeTime)}]}))---- | DSL accessor for the accessTime field of hydra.file.FileStatus-fileStatusAccessTime :: Typed.TypedTerm File.FileStatus -> Typed.TypedTerm (Maybe Time.Timespec)-fileStatusAccessTime x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.file.FileStatus"),- Core.projectionFieldName = (Core.Name "accessTime")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL name token for hydra.file.FileStatus-fileStatusFileStatus :: Typed.TypedName File.FileStatus-fileStatusFileStatus = Typed.TypedName (Core.Name "hydra.file.FileStatus")---- | DSL accessor for the fileType field of hydra.file.FileStatus-fileStatusFileType :: Typed.TypedTerm File.FileStatus -> Typed.TypedTerm File.FileType-fileStatusFileType x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.file.FileStatus"),- Core.projectionFieldName = (Core.Name "fileType")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL accessor for the modificationTime field of hydra.file.FileStatus-fileStatusModificationTime :: Typed.TypedTerm File.FileStatus -> Typed.TypedTerm Time.Timespec-fileStatusModificationTime x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.file.FileStatus"),- Core.projectionFieldName = (Core.Name "modificationTime")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL accessor for the size field of hydra.file.FileStatus-fileStatusSize :: Typed.TypedTerm File.FileStatus -> Typed.TypedTerm I.Int64-fileStatusSize x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.file.FileStatus"),- Core.projectionFieldName = (Core.Name "size")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL accessor for the statusChangeTime field of hydra.file.FileStatus-fileStatusStatusChangeTime :: Typed.TypedTerm File.FileStatus -> Typed.TypedTerm (Maybe Time.Timespec)-fileStatusStatusChangeTime x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.file.FileStatus"),- Core.projectionFieldName = (Core.Name "statusChangeTime")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL updater for the accessTime field of hydra.file.FileStatus-fileStatusWithAccessTime :: Typed.TypedTerm File.FileStatus -> Typed.TypedTerm (Maybe Time.Timespec) -> Typed.TypedTerm File.FileStatus-fileStatusWithAccessTime original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.file.FileStatus"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "fileType"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.file.FileStatus"),- Core.projectionFieldName = (Core.Name "fileType")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "size"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.file.FileStatus"),- Core.projectionFieldName = (Core.Name "size")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "modificationTime"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.file.FileStatus"),- Core.projectionFieldName = (Core.Name "modificationTime")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "accessTime"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "statusChangeTime"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.file.FileStatus"),- Core.projectionFieldName = (Core.Name "statusChangeTime")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL updater for the fileType field of hydra.file.FileStatus-fileStatusWithFileType :: Typed.TypedTerm File.FileStatus -> Typed.TypedTerm File.FileType -> Typed.TypedTerm File.FileStatus-fileStatusWithFileType original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.file.FileStatus"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "fileType"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "size"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.file.FileStatus"),- Core.projectionFieldName = (Core.Name "size")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "modificationTime"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.file.FileStatus"),- Core.projectionFieldName = (Core.Name "modificationTime")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "accessTime"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.file.FileStatus"),- Core.projectionFieldName = (Core.Name "accessTime")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "statusChangeTime"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.file.FileStatus"),- Core.projectionFieldName = (Core.Name "statusChangeTime")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL updater for the modificationTime field of hydra.file.FileStatus-fileStatusWithModificationTime :: Typed.TypedTerm File.FileStatus -> Typed.TypedTerm Time.Timespec -> Typed.TypedTerm File.FileStatus-fileStatusWithModificationTime original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.file.FileStatus"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "fileType"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.file.FileStatus"),- Core.projectionFieldName = (Core.Name "fileType")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "size"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.file.FileStatus"),- Core.projectionFieldName = (Core.Name "size")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "modificationTime"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "accessTime"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.file.FileStatus"),- Core.projectionFieldName = (Core.Name "accessTime")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "statusChangeTime"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.file.FileStatus"),- Core.projectionFieldName = (Core.Name "statusChangeTime")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL updater for the size field of hydra.file.FileStatus-fileStatusWithSize :: Typed.TypedTerm File.FileStatus -> Typed.TypedTerm I.Int64 -> Typed.TypedTerm File.FileStatus-fileStatusWithSize original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.file.FileStatus"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "fileType"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.file.FileStatus"),- Core.projectionFieldName = (Core.Name "fileType")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "size"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "modificationTime"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.file.FileStatus"),- Core.projectionFieldName = (Core.Name "modificationTime")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "accessTime"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.file.FileStatus"),- Core.projectionFieldName = (Core.Name "accessTime")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "statusChangeTime"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.file.FileStatus"),- Core.projectionFieldName = (Core.Name "statusChangeTime")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL updater for the statusChangeTime field of hydra.file.FileStatus-fileStatusWithStatusChangeTime :: Typed.TypedTerm File.FileStatus -> Typed.TypedTerm (Maybe Time.Timespec) -> Typed.TypedTerm File.FileStatus-fileStatusWithStatusChangeTime original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.file.FileStatus"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "fileType"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.file.FileStatus"),- Core.projectionFieldName = (Core.Name "fileType")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "size"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.file.FileStatus"),- Core.projectionFieldName = (Core.Name "size")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "modificationTime"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.file.FileStatus"),- Core.projectionFieldName = (Core.Name "modificationTime")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "accessTime"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.file.FileStatus"),- Core.projectionFieldName = (Core.Name "accessTime")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "statusChangeTime"),- Core.fieldTerm = (Typed.unTypedTerm newVal)}]}))---- | DSL injection for the block variant of hydra.file.FileType-fileTypeBlock :: Typed.TypedTerm File.FileType-fileTypeBlock =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.file.FileType"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "block"),- Core.fieldTerm = Core.TermUnit}}))---- | DSL injection for the character variant of hydra.file.FileType-fileTypeCharacter :: Typed.TypedTerm File.FileType-fileTypeCharacter =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.file.FileType"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "character"),- Core.fieldTerm = Core.TermUnit}}))---- | DSL injection for the directory variant of hydra.file.FileType-fileTypeDirectory :: Typed.TypedTerm File.FileType-fileTypeDirectory =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.file.FileType"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "directory"),- Core.fieldTerm = Core.TermUnit}}))---- | DSL injection for the fifo variant of hydra.file.FileType-fileTypeFifo :: Typed.TypedTerm File.FileType-fileTypeFifo =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.file.FileType"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "fifo"),- Core.fieldTerm = Core.TermUnit}}))---- | DSL name token for hydra.file.FileType-fileTypeFileType :: Typed.TypedName File.FileType-fileTypeFileType = Typed.TypedName (Core.Name "hydra.file.FileType")---- | DSL injection for the link variant of hydra.file.FileType-fileTypeLink :: Typed.TypedTerm File.FileType-fileTypeLink =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.file.FileType"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "link"),- Core.fieldTerm = Core.TermUnit}}))---- | DSL injection for the regular variant of hydra.file.FileType-fileTypeRegular :: Typed.TypedTerm File.FileType-fileTypeRegular =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.file.FileType"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "regular"),- Core.fieldTerm = Core.TermUnit}}))---- | DSL injection for the socket variant of hydra.file.FileType-fileTypeSocket :: Typed.TypedTerm File.FileType-fileTypeSocket =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.file.FileType"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "socket"),- Core.fieldTerm = Core.TermUnit}}))---- | DSL accessor for the body of hydra.file.FileExtension-unFileExtension :: Typed.TypedTerm File.FileExtension -> Typed.TypedTerm String-unFileExtension x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermUnwrap (Core.Name "hydra.file.FileExtension")),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL accessor for the body of hydra.file.FilePath-unFilePath :: Typed.TypedTerm File.FilePath -> Typed.TypedTerm String-unFilePath x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermUnwrap (Core.Name "hydra.file.FilePath")),- Core.applicationArgument = (Typed.unTypedTerm x)}))
@@ -1,222 +0,0 @@--- Note: this is an automatically generated file. Do not edit.---- | DSL functions for hydra.formatting--module Hydra.Dsl.Formatting where--import qualified Hydra.Ast as Ast-import qualified Hydra.Coders as Coders-import qualified Hydra.Core as Core-import qualified Hydra.Docs as Docs-import qualified Hydra.Dsl.Ast as DslAst-import qualified Hydra.Dsl.Coders as DslCoders-import qualified Hydra.Dsl.Core as DslCore-import qualified Hydra.Dsl.Docs as DslDocs-import qualified Hydra.Dsl.Error.Checking as ErrorChecking-import qualified Hydra.Dsl.Error.Core as DslErrorCore-import qualified Hydra.Dsl.Error.File as DslErrorFile-import qualified Hydra.Dsl.Error.Packaging as DslErrorPackaging-import qualified Hydra.Dsl.Error.System as DslErrorSystem-import qualified Hydra.Dsl.Errors as DslErrors-import qualified Hydra.Dsl.File as DslFile-import qualified Hydra.Dsl.Graph as DslGraph-import qualified Hydra.Dsl.Json.Model as JsonModel-import qualified Hydra.Dsl.Packaging as DslPackaging-import qualified Hydra.Dsl.Parsing as DslParsing-import qualified Hydra.Dsl.Paths as DslPaths-import qualified Hydra.Dsl.Query as DslQuery-import qualified Hydra.Dsl.Regex as DslRegex-import qualified Hydra.Dsl.Relational as DslRelational-import qualified Hydra.Dsl.System as DslSystem-import qualified Hydra.Dsl.Tabular as DslTabular-import qualified Hydra.Dsl.Testing as DslTesting-import qualified Hydra.Dsl.Time as DslTime-import qualified Hydra.Dsl.Topology as DslTopology-import qualified Hydra.Dsl.Typing as DslTyping-import qualified Hydra.Dsl.Util as DslUtil-import qualified Hydra.Dsl.Validation as DslValidation-import qualified Hydra.Dsl.Variants as DslVariants-import qualified Hydra.Error.Checking as Checking-import qualified Hydra.Error.Core as ErrorCore-import qualified Hydra.Error.File as ErrorFile-import qualified Hydra.Error.Packaging as ErrorPackaging-import qualified Hydra.Error.System as ErrorSystem-import qualified Hydra.Errors as Errors-import qualified Hydra.File as File-import qualified Hydra.Formatting as Formatting-import qualified Hydra.Graph as Graph-import qualified Hydra.Json.Model as Model-import qualified Hydra.Packaging as Packaging-import qualified Hydra.Parsing as Parsing-import qualified Hydra.Paths as Paths-import qualified Hydra.Query as Query-import qualified Hydra.Regex as Regex-import qualified Hydra.Relational as Relational-import qualified Hydra.System as System-import qualified Hydra.Tabular as Tabular-import qualified Hydra.Testing as Testing-import qualified Hydra.Time as Time-import qualified Hydra.Topology as Topology-import qualified Hydra.Typed as Typed-import qualified Hydra.Typing as Typing-import qualified Hydra.Util as Util-import qualified Hydra.Validation as Validation-import qualified Hydra.Variants as Variants-import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)-import qualified Data.Scientific as Sci-import Data.Void-import qualified Data.Set as S---- | DSL reference to hydra.formatting.capitalize-capitalize :: Typed.TypedTerm String -> Typed.TypedTerm String-capitalize arg0 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.formatting.capitalize")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))---- | DSL reference to hydra.formatting.convertCase-convertCase :: Typed.TypedTerm Util.CaseConvention -> Typed.TypedTerm Util.CaseConvention -> Typed.TypedTerm String -> Typed.TypedTerm String-convertCase arg0 arg1 arg2 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.formatting.convertCase")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)})),- Core.applicationArgument = (Typed.unTypedTerm arg2)}))---- | DSL reference to hydra.formatting.convertCaseCamelOrUnderscoreToLowerSnake-convertCaseCamelOrUnderscoreToLowerSnake :: Typed.TypedTerm String -> Typed.TypedTerm String-convertCaseCamelOrUnderscoreToLowerSnake arg0 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.formatting.convertCaseCamelOrUnderscoreToLowerSnake")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))---- | DSL reference to hydra.formatting.convertCaseCamelToLowerSnake-convertCaseCamelToLowerSnake :: Typed.TypedTerm String -> Typed.TypedTerm String-convertCaseCamelToLowerSnake arg0 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.formatting.convertCaseCamelToLowerSnake")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))---- | DSL reference to hydra.formatting.convertCaseCamelToUpperSnake-convertCaseCamelToUpperSnake :: Typed.TypedTerm String -> Typed.TypedTerm String-convertCaseCamelToUpperSnake arg0 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.formatting.convertCaseCamelToUpperSnake")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))---- | DSL reference to hydra.formatting.convertCasePascalToUpperSnake-convertCasePascalToUpperSnake :: Typed.TypedTerm String -> Typed.TypedTerm String-convertCasePascalToUpperSnake arg0 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.formatting.convertCasePascalToUpperSnake")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))---- | DSL reference to hydra.formatting.decapitalize-decapitalize :: Typed.TypedTerm String -> Typed.TypedTerm String-decapitalize arg0 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.formatting.decapitalize")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))---- | DSL reference to hydra.formatting.escapeWithUnderscore-escapeWithUnderscore :: Typed.TypedTerm (S.Set String) -> Typed.TypedTerm String -> Typed.TypedTerm String-escapeWithUnderscore arg0 arg1 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.formatting.escapeWithUnderscore")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))---- | DSL reference to hydra.formatting.indentLines-indentLines :: Typed.TypedTerm String -> Typed.TypedTerm String-indentLines arg0 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.formatting.indentLines")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))---- | DSL reference to hydra.formatting.javaStyleComment-javaStyleComment :: Typed.TypedTerm String -> Typed.TypedTerm String-javaStyleComment arg0 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.formatting.javaStyleComment")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))---- | DSL reference to hydra.formatting.lines-lines :: Typed.TypedTerm String -> Typed.TypedTerm [String]-lines arg0 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.formatting.lines")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))---- | DSL reference to hydra.formatting.mapFirstLetter-mapFirstLetter :: Typed.TypedTerm (String -> String) -> Typed.TypedTerm String -> Typed.TypedTerm String-mapFirstLetter arg0 arg1 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.formatting.mapFirstLetter")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))---- | DSL reference to hydra.formatting.nonAlnumToUnderscores-nonAlnumToUnderscores :: Typed.TypedTerm String -> Typed.TypedTerm String-nonAlnumToUnderscores arg0 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.formatting.nonAlnumToUnderscores")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))---- | DSL reference to hydra.formatting.normalizeComment-normalizeComment :: Typed.TypedTerm String -> Typed.TypedTerm String-normalizeComment arg0 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.formatting.normalizeComment")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))---- | DSL reference to hydra.formatting.sanitizeWithUnderscores-sanitizeWithUnderscores :: Typed.TypedTerm (S.Set String) -> Typed.TypedTerm String -> Typed.TypedTerm String-sanitizeWithUnderscores arg0 arg1 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.formatting.sanitizeWithUnderscores")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))---- | DSL reference to hydra.formatting.showList-showList :: Typed.TypedTerm (t0 -> String) -> Typed.TypedTerm [t0] -> Typed.TypedTerm String-showList arg0 arg1 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.formatting.showList")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))---- | DSL reference to hydra.formatting.stripLeadingAndTrailingWhitespace-stripLeadingAndTrailingWhitespace :: Typed.TypedTerm String -> Typed.TypedTerm String-stripLeadingAndTrailingWhitespace arg0 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.formatting.stripLeadingAndTrailingWhitespace")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))---- | DSL reference to hydra.formatting.unlines-unlines :: Typed.TypedTerm [String] -> Typed.TypedTerm String-unlines arg0 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.formatting.unlines")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))---- | DSL reference to hydra.formatting.withCharacterAliases-withCharacterAliases :: Typed.TypedTerm String -> Typed.TypedTerm String-withCharacterAliases arg0 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.formatting.withCharacterAliases")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))---- | DSL reference to hydra.formatting.wrapLine-wrapLine :: Typed.TypedTerm Int -> Typed.TypedTerm String -> Typed.TypedTerm String-wrapLine arg0 arg1 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.formatting.wrapLine")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))
@@ -1,921 +0,0 @@--- Note: this is an automatically generated file. Do not edit.---- | DSL functions for hydra.graph--module Hydra.Dsl.Graph where--import qualified Hydra.Core as Core-import qualified Hydra.Dsl.Core as DslCore-import qualified Hydra.Dsl.Errors as DslErrors-import qualified Hydra.Dsl.Packaging as DslPackaging-import qualified Hydra.Dsl.Typing as DslTyping-import qualified Hydra.Errors as Errors-import qualified Hydra.Graph as Graph-import qualified Hydra.Packaging as Packaging-import qualified Hydra.Typed as Typed-import qualified Hydra.Typing as Typing-import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)-import qualified Data.Scientific as Sci-import Data.Void-import qualified Data.Map as M-import qualified Data.Set as S---- | DSL composition builder for the decoder of hydra.graph.TermCoder-decodeTermCoder :: Typed.TypedTerm (Graph.Graph -> Core.Term -> Either Errors.DecodingError a) -> Typed.TypedTerm (Graph.Graph -> Core.Term -> Either Errors.DecodingError (Graph.TermCoder a))-decodeTermCoder a =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.decode.graph.termCoder")),- Core.applicationArgument = (Typed.unTypedTerm a)}))---- | DSL composition builder for the encoder of hydra.graph.TermCoder-encodeTermCoder :: Typed.TypedTerm (a -> Core.Term) -> Typed.TypedTerm (Graph.TermCoder a -> Core.Term)-encodeTermCoder a =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.encode.graph.termCoder")),- Core.applicationArgument = (Typed.unTypedTerm a)}))---- | DSL constructor for hydra.graph.Graph-graph :: Typed.TypedTerm (M.Map Core.Name Core.Term) -> Typed.TypedTerm (M.Map Core.Name Core.TypeScheme) -> Typed.TypedTerm (M.Map Core.Name Core.TypeVariableConstraints) -> Typed.TypedTerm (S.Set Core.Name) -> Typed.TypedTerm (M.Map Core.Name Core.Term) -> Typed.TypedTerm (M.Map Core.Name Graph.Primitive) -> Typed.TypedTerm (M.Map Core.Name Core.TypeScheme) -> Typed.TypedTerm (S.Set Core.Name) -> Typed.TypedTerm Graph.Graph-graph boundTerms boundTypes classConstraints lambdaVariables metadata primitives schemaTypes typeVariables =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.graph.Graph"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "boundTerms"),- Core.fieldTerm = (Typed.unTypedTerm boundTerms)},- Core.Field {- Core.fieldName = (Core.Name "boundTypes"),- Core.fieldTerm = (Typed.unTypedTerm boundTypes)},- Core.Field {- Core.fieldName = (Core.Name "classConstraints"),- Core.fieldTerm = (Typed.unTypedTerm classConstraints)},- Core.Field {- Core.fieldName = (Core.Name "lambdaVariables"),- Core.fieldTerm = (Typed.unTypedTerm lambdaVariables)},- Core.Field {- Core.fieldName = (Core.Name "metadata"),- Core.fieldTerm = (Typed.unTypedTerm metadata)},- Core.Field {- Core.fieldName = (Core.Name "primitives"),- Core.fieldTerm = (Typed.unTypedTerm primitives)},- Core.Field {- Core.fieldName = (Core.Name "schemaTypes"),- Core.fieldTerm = (Typed.unTypedTerm schemaTypes)},- Core.Field {- Core.fieldName = (Core.Name "typeVariables"),- Core.fieldTerm = (Typed.unTypedTerm typeVariables)}]}))---- | DSL accessor for the boundTerms field of hydra.graph.Graph-graphBoundTerms :: Typed.TypedTerm Graph.Graph -> Typed.TypedTerm (M.Map Core.Name Core.Term)-graphBoundTerms x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.graph.Graph"),- Core.projectionFieldName = (Core.Name "boundTerms")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL accessor for the boundTypes field of hydra.graph.Graph-graphBoundTypes :: Typed.TypedTerm Graph.Graph -> Typed.TypedTerm (M.Map Core.Name Core.TypeScheme)-graphBoundTypes x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.graph.Graph"),- Core.projectionFieldName = (Core.Name "boundTypes")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL accessor for the classConstraints field of hydra.graph.Graph-graphClassConstraints :: Typed.TypedTerm Graph.Graph -> Typed.TypedTerm (M.Map Core.Name Core.TypeVariableConstraints)-graphClassConstraints x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.graph.Graph"),- Core.projectionFieldName = (Core.Name "classConstraints")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL name token for hydra.graph.Graph-graphGraph :: Typed.TypedName Graph.Graph-graphGraph = Typed.TypedName (Core.Name "hydra.graph.Graph")---- | DSL accessor for the lambdaVariables field of hydra.graph.Graph-graphLambdaVariables :: Typed.TypedTerm Graph.Graph -> Typed.TypedTerm (S.Set Core.Name)-graphLambdaVariables x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.graph.Graph"),- Core.projectionFieldName = (Core.Name "lambdaVariables")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL accessor for the metadata field of hydra.graph.Graph-graphMetadata :: Typed.TypedTerm Graph.Graph -> Typed.TypedTerm (M.Map Core.Name Core.Term)-graphMetadata x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.graph.Graph"),- Core.projectionFieldName = (Core.Name "metadata")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL accessor for the primitives field of hydra.graph.Graph-graphPrimitives :: Typed.TypedTerm Graph.Graph -> Typed.TypedTerm (M.Map Core.Name Graph.Primitive)-graphPrimitives x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.graph.Graph"),- Core.projectionFieldName = (Core.Name "primitives")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL accessor for the schemaTypes field of hydra.graph.Graph-graphSchemaTypes :: Typed.TypedTerm Graph.Graph -> Typed.TypedTerm (M.Map Core.Name Core.TypeScheme)-graphSchemaTypes x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.graph.Graph"),- Core.projectionFieldName = (Core.Name "schemaTypes")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL accessor for the typeVariables field of hydra.graph.Graph-graphTypeVariables :: Typed.TypedTerm Graph.Graph -> Typed.TypedTerm (S.Set Core.Name)-graphTypeVariables x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.graph.Graph"),- Core.projectionFieldName = (Core.Name "typeVariables")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL updater for the boundTerms field of hydra.graph.Graph-graphWithBoundTerms :: Typed.TypedTerm Graph.Graph -> Typed.TypedTerm (M.Map Core.Name Core.Term) -> Typed.TypedTerm Graph.Graph-graphWithBoundTerms original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.graph.Graph"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "boundTerms"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "boundTypes"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.graph.Graph"),- Core.projectionFieldName = (Core.Name "boundTypes")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "classConstraints"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.graph.Graph"),- Core.projectionFieldName = (Core.Name "classConstraints")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "lambdaVariables"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.graph.Graph"),- Core.projectionFieldName = (Core.Name "lambdaVariables")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "metadata"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.graph.Graph"),- Core.projectionFieldName = (Core.Name "metadata")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "primitives"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.graph.Graph"),- Core.projectionFieldName = (Core.Name "primitives")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "schemaTypes"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.graph.Graph"),- Core.projectionFieldName = (Core.Name "schemaTypes")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "typeVariables"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.graph.Graph"),- Core.projectionFieldName = (Core.Name "typeVariables")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL updater for the boundTypes field of hydra.graph.Graph-graphWithBoundTypes :: Typed.TypedTerm Graph.Graph -> Typed.TypedTerm (M.Map Core.Name Core.TypeScheme) -> Typed.TypedTerm Graph.Graph-graphWithBoundTypes original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.graph.Graph"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "boundTerms"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.graph.Graph"),- Core.projectionFieldName = (Core.Name "boundTerms")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "boundTypes"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "classConstraints"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.graph.Graph"),- Core.projectionFieldName = (Core.Name "classConstraints")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "lambdaVariables"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.graph.Graph"),- Core.projectionFieldName = (Core.Name "lambdaVariables")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "metadata"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.graph.Graph"),- Core.projectionFieldName = (Core.Name "metadata")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "primitives"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.graph.Graph"),- Core.projectionFieldName = (Core.Name "primitives")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "schemaTypes"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.graph.Graph"),- Core.projectionFieldName = (Core.Name "schemaTypes")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "typeVariables"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.graph.Graph"),- Core.projectionFieldName = (Core.Name "typeVariables")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL updater for the classConstraints field of hydra.graph.Graph-graphWithClassConstraints :: Typed.TypedTerm Graph.Graph -> Typed.TypedTerm (M.Map Core.Name Core.TypeVariableConstraints) -> Typed.TypedTerm Graph.Graph-graphWithClassConstraints original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.graph.Graph"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "boundTerms"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.graph.Graph"),- Core.projectionFieldName = (Core.Name "boundTerms")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "boundTypes"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.graph.Graph"),- Core.projectionFieldName = (Core.Name "boundTypes")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "classConstraints"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "lambdaVariables"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.graph.Graph"),- Core.projectionFieldName = (Core.Name "lambdaVariables")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "metadata"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.graph.Graph"),- Core.projectionFieldName = (Core.Name "metadata")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "primitives"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.graph.Graph"),- Core.projectionFieldName = (Core.Name "primitives")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "schemaTypes"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.graph.Graph"),- Core.projectionFieldName = (Core.Name "schemaTypes")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "typeVariables"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.graph.Graph"),- Core.projectionFieldName = (Core.Name "typeVariables")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL updater for the lambdaVariables field of hydra.graph.Graph-graphWithLambdaVariables :: Typed.TypedTerm Graph.Graph -> Typed.TypedTerm (S.Set Core.Name) -> Typed.TypedTerm Graph.Graph-graphWithLambdaVariables original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.graph.Graph"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "boundTerms"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.graph.Graph"),- Core.projectionFieldName = (Core.Name "boundTerms")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "boundTypes"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.graph.Graph"),- Core.projectionFieldName = (Core.Name "boundTypes")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "classConstraints"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.graph.Graph"),- Core.projectionFieldName = (Core.Name "classConstraints")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "lambdaVariables"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "metadata"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.graph.Graph"),- Core.projectionFieldName = (Core.Name "metadata")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "primitives"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.graph.Graph"),- Core.projectionFieldName = (Core.Name "primitives")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "schemaTypes"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.graph.Graph"),- Core.projectionFieldName = (Core.Name "schemaTypes")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "typeVariables"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.graph.Graph"),- Core.projectionFieldName = (Core.Name "typeVariables")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL updater for the metadata field of hydra.graph.Graph-graphWithMetadata :: Typed.TypedTerm Graph.Graph -> Typed.TypedTerm (M.Map Core.Name Core.Term) -> Typed.TypedTerm Graph.Graph-graphWithMetadata original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.graph.Graph"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "boundTerms"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.graph.Graph"),- Core.projectionFieldName = (Core.Name "boundTerms")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "boundTypes"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.graph.Graph"),- Core.projectionFieldName = (Core.Name "boundTypes")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "classConstraints"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.graph.Graph"),- Core.projectionFieldName = (Core.Name "classConstraints")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "lambdaVariables"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.graph.Graph"),- Core.projectionFieldName = (Core.Name "lambdaVariables")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "metadata"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "primitives"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.graph.Graph"),- Core.projectionFieldName = (Core.Name "primitives")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "schemaTypes"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.graph.Graph"),- Core.projectionFieldName = (Core.Name "schemaTypes")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "typeVariables"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.graph.Graph"),- Core.projectionFieldName = (Core.Name "typeVariables")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL updater for the primitives field of hydra.graph.Graph-graphWithPrimitives :: Typed.TypedTerm Graph.Graph -> Typed.TypedTerm (M.Map Core.Name Graph.Primitive) -> Typed.TypedTerm Graph.Graph-graphWithPrimitives original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.graph.Graph"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "boundTerms"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.graph.Graph"),- Core.projectionFieldName = (Core.Name "boundTerms")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "boundTypes"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.graph.Graph"),- Core.projectionFieldName = (Core.Name "boundTypes")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "classConstraints"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.graph.Graph"),- Core.projectionFieldName = (Core.Name "classConstraints")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "lambdaVariables"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.graph.Graph"),- Core.projectionFieldName = (Core.Name "lambdaVariables")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "metadata"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.graph.Graph"),- Core.projectionFieldName = (Core.Name "metadata")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "primitives"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "schemaTypes"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.graph.Graph"),- Core.projectionFieldName = (Core.Name "schemaTypes")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "typeVariables"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.graph.Graph"),- Core.projectionFieldName = (Core.Name "typeVariables")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL updater for the schemaTypes field of hydra.graph.Graph-graphWithSchemaTypes :: Typed.TypedTerm Graph.Graph -> Typed.TypedTerm (M.Map Core.Name Core.TypeScheme) -> Typed.TypedTerm Graph.Graph-graphWithSchemaTypes original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.graph.Graph"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "boundTerms"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.graph.Graph"),- Core.projectionFieldName = (Core.Name "boundTerms")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "boundTypes"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.graph.Graph"),- Core.projectionFieldName = (Core.Name "boundTypes")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "classConstraints"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.graph.Graph"),- Core.projectionFieldName = (Core.Name "classConstraints")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "lambdaVariables"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.graph.Graph"),- Core.projectionFieldName = (Core.Name "lambdaVariables")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "metadata"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.graph.Graph"),- Core.projectionFieldName = (Core.Name "metadata")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "primitives"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.graph.Graph"),- Core.projectionFieldName = (Core.Name "primitives")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "schemaTypes"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "typeVariables"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.graph.Graph"),- Core.projectionFieldName = (Core.Name "typeVariables")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL updater for the typeVariables field of hydra.graph.Graph-graphWithTypeVariables :: Typed.TypedTerm Graph.Graph -> Typed.TypedTerm (S.Set Core.Name) -> Typed.TypedTerm Graph.Graph-graphWithTypeVariables original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.graph.Graph"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "boundTerms"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.graph.Graph"),- Core.projectionFieldName = (Core.Name "boundTerms")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "boundTypes"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.graph.Graph"),- Core.projectionFieldName = (Core.Name "boundTypes")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "classConstraints"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.graph.Graph"),- Core.projectionFieldName = (Core.Name "classConstraints")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "lambdaVariables"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.graph.Graph"),- Core.projectionFieldName = (Core.Name "lambdaVariables")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "metadata"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.graph.Graph"),- Core.projectionFieldName = (Core.Name "metadata")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "primitives"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.graph.Graph"),- Core.projectionFieldName = (Core.Name "primitives")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "schemaTypes"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.graph.Graph"),- Core.projectionFieldName = (Core.Name "schemaTypes")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "typeVariables"),- Core.fieldTerm = (Typed.unTypedTerm newVal)}]}))---- | DSL constructor for hydra.graph.Library-library :: Typed.TypedTerm Packaging.ModuleName -> Typed.TypedTerm String -> Typed.TypedTerm [Graph.Primitive] -> Typed.TypedTerm Graph.Library-library name prefix primitives =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.graph.Library"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "name"),- Core.fieldTerm = (Typed.unTypedTerm name)},- Core.Field {- Core.fieldName = (Core.Name "prefix"),- Core.fieldTerm = (Typed.unTypedTerm prefix)},- Core.Field {- Core.fieldName = (Core.Name "primitives"),- Core.fieldTerm = (Typed.unTypedTerm primitives)}]}))---- | DSL name token for hydra.graph.Library-libraryLibrary :: Typed.TypedName Graph.Library-libraryLibrary = Typed.TypedName (Core.Name "hydra.graph.Library")---- | DSL accessor for the name field of hydra.graph.Library-libraryName :: Typed.TypedTerm Graph.Library -> Typed.TypedTerm Packaging.ModuleName-libraryName x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.graph.Library"),- Core.projectionFieldName = (Core.Name "name")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL accessor for the prefix field of hydra.graph.Library-libraryPrefix :: Typed.TypedTerm Graph.Library -> Typed.TypedTerm String-libraryPrefix x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.graph.Library"),- Core.projectionFieldName = (Core.Name "prefix")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL accessor for the primitives field of hydra.graph.Library-libraryPrimitives :: Typed.TypedTerm Graph.Library -> Typed.TypedTerm [Graph.Primitive]-libraryPrimitives x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.graph.Library"),- Core.projectionFieldName = (Core.Name "primitives")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL updater for the name field of hydra.graph.Library-libraryWithName :: Typed.TypedTerm Graph.Library -> Typed.TypedTerm Packaging.ModuleName -> Typed.TypedTerm Graph.Library-libraryWithName original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.graph.Library"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "name"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "prefix"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.graph.Library"),- Core.projectionFieldName = (Core.Name "prefix")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "primitives"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.graph.Library"),- Core.projectionFieldName = (Core.Name "primitives")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL updater for the prefix field of hydra.graph.Library-libraryWithPrefix :: Typed.TypedTerm Graph.Library -> Typed.TypedTerm String -> Typed.TypedTerm Graph.Library-libraryWithPrefix original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.graph.Library"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "name"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.graph.Library"),- Core.projectionFieldName = (Core.Name "name")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "prefix"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "primitives"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.graph.Library"),- Core.projectionFieldName = (Core.Name "primitives")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL updater for the primitives field of hydra.graph.Library-libraryWithPrimitives :: Typed.TypedTerm Graph.Library -> Typed.TypedTerm [Graph.Primitive] -> Typed.TypedTerm Graph.Library-libraryWithPrimitives original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.graph.Library"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "name"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.graph.Library"),- Core.projectionFieldName = (Core.Name "name")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "prefix"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.graph.Library"),- Core.projectionFieldName = (Core.Name "prefix")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "primitives"),- Core.fieldTerm = (Typed.unTypedTerm newVal)}]}))---- | DSL constructor for hydra.graph.Primitive-primitive :: Typed.TypedTerm Packaging.PrimitiveDefinition -> Typed.TypedTerm (Graph.Graph -> [Core.Term] -> Either Errors.Error Core.Term) -> Typed.TypedTerm Graph.Primitive-primitive definition implementation =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.graph.Primitive"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "definition"),- Core.fieldTerm = (Typed.unTypedTerm definition)},- Core.Field {- Core.fieldName = (Core.Name "implementation"),- Core.fieldTerm = (Typed.unTypedTerm implementation)}]}))---- | DSL accessor for the definition field of hydra.graph.Primitive-primitiveDefinition :: Typed.TypedTerm Graph.Primitive -> Typed.TypedTerm Packaging.PrimitiveDefinition-primitiveDefinition x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.graph.Primitive"),- Core.projectionFieldName = (Core.Name "definition")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL accessor for the implementation field of hydra.graph.Primitive-primitiveImplementation :: Typed.TypedTerm Graph.Primitive -> Typed.TypedTerm (Graph.Graph -> [Core.Term] -> Either Errors.Error Core.Term)-primitiveImplementation x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.graph.Primitive"),- Core.projectionFieldName = (Core.Name "implementation")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL name token for hydra.graph.Primitive-primitivePrimitive :: Typed.TypedName Graph.Primitive-primitivePrimitive = Typed.TypedName (Core.Name "hydra.graph.Primitive")---- | DSL updater for the definition field of hydra.graph.Primitive-primitiveWithDefinition :: Typed.TypedTerm Graph.Primitive -> Typed.TypedTerm Packaging.PrimitiveDefinition -> Typed.TypedTerm Graph.Primitive-primitiveWithDefinition original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.graph.Primitive"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "definition"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "implementation"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.graph.Primitive"),- Core.projectionFieldName = (Core.Name "implementation")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL updater for the implementation field of hydra.graph.Primitive-primitiveWithImplementation :: Typed.TypedTerm Graph.Primitive -> Typed.TypedTerm (Graph.Graph -> [Core.Term] -> Either Errors.Error Core.Term) -> Typed.TypedTerm Graph.Primitive-primitiveWithImplementation original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.graph.Primitive"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "definition"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.graph.Primitive"),- Core.projectionFieldName = (Core.Name "definition")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "implementation"),- Core.fieldTerm = (Typed.unTypedTerm newVal)}]}))---- | DSL constructor for hydra.graph.TermCoder-termCoder :: Typed.TypedTerm Core.Type -> Typed.TypedTerm (Typing.InferenceContext -> Graph.Graph -> Core.Term -> Either Errors.Error a) -> Typed.TypedTerm (Typing.InferenceContext -> a -> Either Errors.Error Core.Term) -> Typed.TypedTerm (Graph.TermCoder a)-termCoder type_ encode decode =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.graph.TermCoder"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "type"),- Core.fieldTerm = (Typed.unTypedTerm type_)},- Core.Field {- Core.fieldName = (Core.Name "encode"),- Core.fieldTerm = (Typed.unTypedTerm encode)},- Core.Field {- Core.fieldName = (Core.Name "decode"),- Core.fieldTerm = (Typed.unTypedTerm decode)}]}))---- | DSL accessor for the decode field of hydra.graph.TermCoder-termCoderDecode :: Typed.TypedTerm (Graph.TermCoder a) -> Typed.TypedTerm (Typing.InferenceContext -> a -> Either Errors.Error Core.Term)-termCoderDecode x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.graph.TermCoder"),- Core.projectionFieldName = (Core.Name "decode")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL accessor for the encode field of hydra.graph.TermCoder-termCoderEncode :: Typed.TypedTerm (Graph.TermCoder a) -> Typed.TypedTerm (Typing.InferenceContext -> Graph.Graph -> Core.Term -> Either Errors.Error a)-termCoderEncode x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.graph.TermCoder"),- Core.projectionFieldName = (Core.Name "encode")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL name token for hydra.graph.TermCoder-termCoderTermCoder :: Typed.TypedName (Graph.TermCoder a)-termCoderTermCoder = Typed.TypedName (Core.Name "hydra.graph.TermCoder")---- | DSL accessor for the type field of hydra.graph.TermCoder-termCoderType :: Typed.TypedTerm (Graph.TermCoder a) -> Typed.TypedTerm Core.Type-termCoderType x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.graph.TermCoder"),- Core.projectionFieldName = (Core.Name "type")})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL updater for the decode field of hydra.graph.TermCoder-termCoderWithDecode :: Typed.TypedTerm (Graph.TermCoder a) -> Typed.TypedTerm (Typing.InferenceContext -> a -> Either Errors.Error Core.Term) -> Typed.TypedTerm (Graph.TermCoder a)-termCoderWithDecode original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.graph.TermCoder"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "type"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.graph.TermCoder"),- Core.projectionFieldName = (Core.Name "type")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "encode"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.graph.TermCoder"),- Core.projectionFieldName = (Core.Name "encode")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "decode"),- Core.fieldTerm = (Typed.unTypedTerm newVal)}]}))---- | DSL updater for the encode field of hydra.graph.TermCoder-termCoderWithEncode :: Typed.TypedTerm (Graph.TermCoder a) -> Typed.TypedTerm (Typing.InferenceContext -> Graph.Graph -> Core.Term -> Either Errors.Error a) -> Typed.TypedTerm (Graph.TermCoder a)-termCoderWithEncode original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.graph.TermCoder"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "type"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.graph.TermCoder"),- Core.projectionFieldName = (Core.Name "type")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "encode"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "decode"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.graph.TermCoder"),- Core.projectionFieldName = (Core.Name "decode")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))---- | DSL updater for the type field of hydra.graph.TermCoder-termCoderWithType :: Typed.TypedTerm (Graph.TermCoder a) -> Typed.TypedTerm Core.Type -> Typed.TypedTerm (Graph.TermCoder a)-termCoderWithType original newVal =- Typed.TypedTerm (Core.TermRecord (Core.Record {- Core.recordTypeName = (Core.Name "hydra.graph.TermCoder"),- Core.recordFields = [- Core.Field {- Core.fieldName = (Core.Name "type"),- Core.fieldTerm = (Typed.unTypedTerm newVal)},- Core.Field {- Core.fieldName = (Core.Name "encode"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.graph.TermCoder"),- Core.projectionFieldName = (Core.Name "encode")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))},- Core.Field {- Core.fieldName = (Core.Name "decode"),- Core.fieldTerm = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermProject (Core.Projection {- Core.projectionTypeName = (Core.Name "hydra.graph.TermCoder"),- Core.projectionFieldName = (Core.Name "decode")})),- Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))
@@ -1,38 +0,0 @@--- Note: this is an automatically generated file. Do not edit.---- | DSL functions for hydra.json.bootstrap--module Hydra.Dsl.Json.Bootstrap where--import qualified Hydra.Coders as Coders-import qualified Hydra.Core as Core-import qualified Hydra.Dsl.Coders as DslCoders-import qualified Hydra.Dsl.Core as DslCore-import qualified Hydra.Dsl.Error.Checking as ErrorChecking-import qualified Hydra.Dsl.Error.Core as DslErrorCore-import qualified Hydra.Dsl.Errors as DslErrors-import qualified Hydra.Dsl.Graph as DslGraph-import qualified Hydra.Dsl.Packaging as DslPackaging-import qualified Hydra.Dsl.Paths as DslPaths-import qualified Hydra.Dsl.Typing as DslTyping-import qualified Hydra.Dsl.Util as DslUtil-import qualified Hydra.Dsl.Variants as DslVariants-import qualified Hydra.Error.Checking as Checking-import qualified Hydra.Error.Core as ErrorCore-import qualified Hydra.Errors as Errors-import qualified Hydra.Graph as Graph-import qualified Hydra.Json.Bootstrap as Bootstrap-import qualified Hydra.Packaging as Packaging-import qualified Hydra.Paths as Paths-import qualified Hydra.Typed as Typed-import qualified Hydra.Typing as Typing-import qualified Hydra.Util as Util-import qualified Hydra.Variants as Variants-import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)-import qualified Data.Scientific as Sci-import Data.Void-import qualified Data.Map as M---- | DSL reference to hydra.json.bootstrap.typesByName-typesByName :: Typed.TypedTerm (M.Map Core.Name Core.Type)-typesByName = Typed.TypedTerm (Core.TermVariable (Core.Name "hydra.json.bootstrap.typesByName"))
@@ -1,160 +0,0 @@--- Note: this is an automatically generated file. Do not edit.---- | DSL functions for hydra.json.decode--module Hydra.Dsl.Json.Decode where--import qualified Hydra.Ast as Ast-import qualified Hydra.Coders as Coders-import qualified Hydra.Core as Core-import qualified Hydra.Docs as Docs-import qualified Hydra.Dsl.Ast as DslAst-import qualified Hydra.Dsl.Coders as DslCoders-import qualified Hydra.Dsl.Core as DslCore-import qualified Hydra.Dsl.Docs as DslDocs-import qualified Hydra.Dsl.Error.Checking as ErrorChecking-import qualified Hydra.Dsl.Error.Core as DslErrorCore-import qualified Hydra.Dsl.Error.File as DslErrorFile-import qualified Hydra.Dsl.Error.Packaging as DslErrorPackaging-import qualified Hydra.Dsl.Error.System as DslErrorSystem-import qualified Hydra.Dsl.Errors as DslErrors-import qualified Hydra.Dsl.File as DslFile-import qualified Hydra.Dsl.Graph as DslGraph-import qualified Hydra.Dsl.Json.Model as JsonModel-import qualified Hydra.Dsl.Packaging as DslPackaging-import qualified Hydra.Dsl.Parsing as DslParsing-import qualified Hydra.Dsl.Paths as DslPaths-import qualified Hydra.Dsl.Query as DslQuery-import qualified Hydra.Dsl.Regex as DslRegex-import qualified Hydra.Dsl.Relational as DslRelational-import qualified Hydra.Dsl.Resolution as DslResolution-import qualified Hydra.Dsl.Strip as DslStrip-import qualified Hydra.Dsl.System as DslSystem-import qualified Hydra.Dsl.Tabular as DslTabular-import qualified Hydra.Dsl.Testing as DslTesting-import qualified Hydra.Dsl.Time as DslTime-import qualified Hydra.Dsl.Topology as DslTopology-import qualified Hydra.Dsl.Typing as DslTyping-import qualified Hydra.Dsl.Util as DslUtil-import qualified Hydra.Dsl.Validation as DslValidation-import qualified Hydra.Dsl.Variants as DslVariants-import qualified Hydra.Error.Checking as Checking-import qualified Hydra.Error.Core as ErrorCore-import qualified Hydra.Error.File as ErrorFile-import qualified Hydra.Error.Packaging as ErrorPackaging-import qualified Hydra.Error.System as ErrorSystem-import qualified Hydra.Errors as Errors-import qualified Hydra.Extract.Core as ExtractCore-import qualified Hydra.File as File-import qualified Hydra.Graph as Graph-import qualified Hydra.Json.Decode as Decode-import qualified Hydra.Json.Model as Model-import qualified Hydra.Literals as Literals-import qualified Hydra.Packaging as Packaging-import qualified Hydra.Parsing as Parsing-import qualified Hydra.Paths as Paths-import qualified Hydra.Print.Core as PrintCore-import qualified Hydra.Query as Query-import qualified Hydra.Regex as Regex-import qualified Hydra.Relational as Relational-import qualified Hydra.Resolution as Resolution-import qualified Hydra.Strip as Strip-import qualified Hydra.Substitution as Substitution-import qualified Hydra.System as System-import qualified Hydra.Tabular as Tabular-import qualified Hydra.Testing as Testing-import qualified Hydra.Time as Time-import qualified Hydra.Topology as Topology-import qualified Hydra.Typed as Typed-import qualified Hydra.Typing as Typing-import qualified Hydra.Util as Util-import qualified Hydra.Validation as Validation-import qualified Hydra.Variants as Variants-import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)-import qualified Data.Scientific as Sci-import Data.Void-import qualified Data.Map as M---- | DSL reference to hydra.json.decode.decodeFloat-decodeFloat :: Typed.TypedTerm Core.FloatType -> Typed.TypedTerm Model.Value -> Typed.TypedTerm (Either String Core.Term)-decodeFloat arg0 arg1 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.json.decode.decodeFloat")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))---- | DSL reference to hydra.json.decode.decodeInteger-decodeInteger :: Typed.TypedTerm Core.IntegerType -> Typed.TypedTerm Model.Value -> Typed.TypedTerm (Either String Core.Term)-decodeInteger arg0 arg1 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.json.decode.decodeInteger")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))---- | DSL reference to hydra.json.decode.decodeLiteral-decodeLiteral :: Typed.TypedTerm Core.LiteralType -> Typed.TypedTerm Model.Value -> Typed.TypedTerm (Either String Core.Term)-decodeLiteral arg0 arg1 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.json.decode.decodeLiteral")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))---- | DSL reference to hydra.json.decode.expectArray-expectArray :: Typed.TypedTerm Model.Value -> Typed.TypedTerm (Either String [Model.Value])-expectArray arg0 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.json.decode.expectArray")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))---- | DSL reference to hydra.json.decode.expectNumber-expectNumber :: Typed.TypedTerm Model.Value -> Typed.TypedTerm (Either String Sci.Scientific)-expectNumber arg0 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.json.decode.expectNumber")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))---- | DSL reference to hydra.json.decode.expectObject-expectObject :: Typed.TypedTerm Model.Value -> Typed.TypedTerm (Either String (M.Map String Model.Value))-expectObject arg0 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.json.decode.expectObject")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))---- | DSL reference to hydra.json.decode.expectString-expectString :: Typed.TypedTerm Model.Value -> Typed.TypedTerm (Either String String)-expectString arg0 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.json.decode.expectString")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))---- | DSL reference to hydra.json.decode.fromJson-fromJson :: Typed.TypedTerm (M.Map Core.Name Core.Type) -> Typed.TypedTerm Bool -> Typed.TypedTerm Core.Name -> Typed.TypedTerm Core.Type -> Typed.TypedTerm Model.Value -> Typed.TypedTerm (Either String Core.Term)-fromJson arg0 arg1 arg2 arg3 arg4 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.json.decode.fromJson")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)})),- Core.applicationArgument = (Typed.unTypedTerm arg2)})),- Core.applicationArgument = (Typed.unTypedTerm arg3)})),- Core.applicationArgument = (Typed.unTypedTerm arg4)}))---- | DSL reference to hydra.json.decode.parseSpecialFloat-parseSpecialFloat :: Typed.TypedTerm String -> Typed.TypedTerm (Maybe Double)-parseSpecialFloat arg0 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.json.decode.parseSpecialFloat")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))---- | DSL reference to hydra.json.decode.parseSpecialFloat32-parseSpecialFloat32 :: Typed.TypedTerm String -> Typed.TypedTerm (Maybe Float)-parseSpecialFloat32 arg0 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.json.decode.parseSpecialFloat32")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))
@@ -1,120 +0,0 @@--- Note: this is an automatically generated file. Do not edit.---- | DSL functions for hydra.json.decoding--module Hydra.Dsl.Json.Decoding where--import qualified Hydra.Ast as Ast-import qualified Hydra.Coders as Coders-import qualified Hydra.Core as Core-import qualified Hydra.Docs as Docs-import qualified Hydra.Dsl.Ast as DslAst-import qualified Hydra.Dsl.Coders as DslCoders-import qualified Hydra.Dsl.Core as DslCore-import qualified Hydra.Dsl.Docs as DslDocs-import qualified Hydra.Dsl.Error.Checking as ErrorChecking-import qualified Hydra.Dsl.Error.Core as DslErrorCore-import qualified Hydra.Dsl.Error.File as DslErrorFile-import qualified Hydra.Dsl.Error.Packaging as DslErrorPackaging-import qualified Hydra.Dsl.Error.System as DslErrorSystem-import qualified Hydra.Dsl.Errors as DslErrors-import qualified Hydra.Dsl.File as DslFile-import qualified Hydra.Dsl.Graph as DslGraph-import qualified Hydra.Dsl.Json.Model as JsonModel-import qualified Hydra.Dsl.Packaging as DslPackaging-import qualified Hydra.Dsl.Parsing as DslParsing-import qualified Hydra.Dsl.Paths as DslPaths-import qualified Hydra.Dsl.Query as DslQuery-import qualified Hydra.Dsl.Regex as DslRegex-import qualified Hydra.Dsl.Relational as DslRelational-import qualified Hydra.Dsl.System as DslSystem-import qualified Hydra.Dsl.Tabular as DslTabular-import qualified Hydra.Dsl.Testing as DslTesting-import qualified Hydra.Dsl.Time as DslTime-import qualified Hydra.Dsl.Topology as DslTopology-import qualified Hydra.Dsl.Typing as DslTyping-import qualified Hydra.Dsl.Util as DslUtil-import qualified Hydra.Dsl.Validation as DslValidation-import qualified Hydra.Dsl.Variants as DslVariants-import qualified Hydra.Error.Checking as Checking-import qualified Hydra.Error.Core as ErrorCore-import qualified Hydra.Error.File as ErrorFile-import qualified Hydra.Error.Packaging as ErrorPackaging-import qualified Hydra.Error.System as ErrorSystem-import qualified Hydra.Errors as Errors-import qualified Hydra.File as File-import qualified Hydra.Graph as Graph-import qualified Hydra.Json.Decoding as Decoding-import qualified Hydra.Json.Model as Model-import qualified Hydra.Packaging as Packaging-import qualified Hydra.Parsing as Parsing-import qualified Hydra.Paths as Paths-import qualified Hydra.Query as Query-import qualified Hydra.Regex as Regex-import qualified Hydra.Relational as Relational-import qualified Hydra.System as System-import qualified Hydra.Tabular as Tabular-import qualified Hydra.Testing as Testing-import qualified Hydra.Time as Time-import qualified Hydra.Topology as Topology-import qualified Hydra.Typed as Typed-import qualified Hydra.Typing as Typing-import qualified Hydra.Util as Util-import qualified Hydra.Validation as Validation-import qualified Hydra.Variants as Variants-import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)-import qualified Data.Scientific as Sci-import Data.Void-import qualified Data.Map as M---- | DSL reference to hydra.json.decoding.decodeArray-decodeArray :: Typed.TypedTerm (Model.Value -> Either String t0) -> Typed.TypedTerm Model.Value -> Typed.TypedTerm (Either String [t0])-decodeArray arg0 arg1 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.json.decoding.decodeArray")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))---- | DSL reference to hydra.json.decoding.decodeBoolean-decodeBoolean :: Typed.TypedTerm Model.Value -> Typed.TypedTerm (Either String Bool)-decodeBoolean arg0 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.json.decoding.decodeBoolean")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))---- | DSL reference to hydra.json.decoding.decodeField-decodeField :: Typed.TypedTerm (t0 -> Either String t1) -> Typed.TypedTerm String -> Typed.TypedTerm (M.Map String t0) -> Typed.TypedTerm (Either String t1)-decodeField arg0 arg1 arg2 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.json.decoding.decodeField")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)})),- Core.applicationArgument = (Typed.unTypedTerm arg2)}))---- | DSL reference to hydra.json.decoding.decodeObject-decodeObject :: Typed.TypedTerm Model.Value -> Typed.TypedTerm (Either String (M.Map String Model.Value))-decodeObject arg0 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.json.decoding.decodeObject")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))---- | DSL reference to hydra.json.decoding.decodeOptionalField-decodeOptionalField :: Typed.TypedTerm (t0 -> Either t1 t2) -> Typed.TypedTerm t3 -> Typed.TypedTerm (M.Map t3 t0) -> Typed.TypedTerm (Either t1 (Maybe t2))-decodeOptionalField arg0 arg1 arg2 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.json.decoding.decodeOptionalField")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)})),- Core.applicationArgument = (Typed.unTypedTerm arg2)}))---- | DSL reference to hydra.json.decoding.decodeString-decodeString :: Typed.TypedTerm Model.Value -> Typed.TypedTerm (Either String String)-decodeString arg0 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.json.decoding.decodeString")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))
@@ -1,126 +0,0 @@--- Note: this is an automatically generated file. Do not edit.---- | DSL functions for hydra.json.encode--module Hydra.Dsl.Json.Encode where--import qualified Hydra.Ast as Ast-import qualified Hydra.Coders as Coders-import qualified Hydra.Core as Core-import qualified Hydra.Docs as Docs-import qualified Hydra.Dsl.Ast as DslAst-import qualified Hydra.Dsl.Coders as DslCoders-import qualified Hydra.Dsl.Core as DslCore-import qualified Hydra.Dsl.Docs as DslDocs-import qualified Hydra.Dsl.Error.Checking as ErrorChecking-import qualified Hydra.Dsl.Error.Core as DslErrorCore-import qualified Hydra.Dsl.Error.File as DslErrorFile-import qualified Hydra.Dsl.Error.Packaging as DslErrorPackaging-import qualified Hydra.Dsl.Error.System as DslErrorSystem-import qualified Hydra.Dsl.Errors as DslErrors-import qualified Hydra.Dsl.File as DslFile-import qualified Hydra.Dsl.Graph as DslGraph-import qualified Hydra.Dsl.Json.Model as JsonModel-import qualified Hydra.Dsl.Packaging as DslPackaging-import qualified Hydra.Dsl.Parsing as DslParsing-import qualified Hydra.Dsl.Paths as DslPaths-import qualified Hydra.Dsl.Query as DslQuery-import qualified Hydra.Dsl.Regex as DslRegex-import qualified Hydra.Dsl.Relational as DslRelational-import qualified Hydra.Dsl.Resolution as DslResolution-import qualified Hydra.Dsl.Strip as DslStrip-import qualified Hydra.Dsl.System as DslSystem-import qualified Hydra.Dsl.Tabular as DslTabular-import qualified Hydra.Dsl.Testing as DslTesting-import qualified Hydra.Dsl.Time as DslTime-import qualified Hydra.Dsl.Topology as DslTopology-import qualified Hydra.Dsl.Typing as DslTyping-import qualified Hydra.Dsl.Util as DslUtil-import qualified Hydra.Dsl.Validation as DslValidation-import qualified Hydra.Dsl.Variants as DslVariants-import qualified Hydra.Error.Checking as Checking-import qualified Hydra.Error.Core as ErrorCore-import qualified Hydra.Error.File as ErrorFile-import qualified Hydra.Error.Packaging as ErrorPackaging-import qualified Hydra.Error.System as ErrorSystem-import qualified Hydra.Errors as Errors-import qualified Hydra.Extract.Core as ExtractCore-import qualified Hydra.File as File-import qualified Hydra.Graph as Graph-import qualified Hydra.Json.Encode as Encode-import qualified Hydra.Json.Model as Model-import qualified Hydra.Literals as Literals-import qualified Hydra.Packaging as Packaging-import qualified Hydra.Parsing as Parsing-import qualified Hydra.Paths as Paths-import qualified Hydra.Print.Core as PrintCore-import qualified Hydra.Query as Query-import qualified Hydra.Regex as Regex-import qualified Hydra.Relational as Relational-import qualified Hydra.Resolution as Resolution-import qualified Hydra.Strip as Strip-import qualified Hydra.Substitution as Substitution-import qualified Hydra.System as System-import qualified Hydra.Tabular as Tabular-import qualified Hydra.Testing as Testing-import qualified Hydra.Time as Time-import qualified Hydra.Topology as Topology-import qualified Hydra.Typed as Typed-import qualified Hydra.Typing as Typing-import qualified Hydra.Util as Util-import qualified Hydra.Validation as Validation-import qualified Hydra.Variants as Variants-import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)-import qualified Data.Scientific as Sci-import Data.Void-import qualified Data.Map as M---- | DSL reference to hydra.json.encode.encodeFloat-encodeFloat :: Typed.TypedTerm Core.FloatValue -> Typed.TypedTerm (Either t0 Model.Value)-encodeFloat arg0 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.json.encode.encodeFloat")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))---- | DSL reference to hydra.json.encode.encodeInteger-encodeInteger :: Typed.TypedTerm Core.IntegerValue -> Typed.TypedTerm (Either t0 Model.Value)-encodeInteger arg0 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.json.encode.encodeInteger")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))---- | DSL reference to hydra.json.encode.encodeLiteral-encodeLiteral :: Typed.TypedTerm Core.Literal -> Typed.TypedTerm (Either t0 Model.Value)-encodeLiteral arg0 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.json.encode.encodeLiteral")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))---- | DSL reference to hydra.json.encode.requiresJsonStringSentinel-requiresJsonStringSentinel :: Typed.TypedTerm String -> Typed.TypedTerm Bool-requiresJsonStringSentinel arg0 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.json.encode.requiresJsonStringSentinel")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))---- | DSL reference to hydra.json.encode.toJson-toJson :: Typed.TypedTerm (M.Map Core.Name Core.Type) -> Typed.TypedTerm Bool -> Typed.TypedTerm Core.Name -> Typed.TypedTerm Core.Type -> Typed.TypedTerm Core.Term -> Typed.TypedTerm (Either String Model.Value)-toJson arg0 arg1 arg2 arg3 arg4 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.json.encode.toJson")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)})),- Core.applicationArgument = (Typed.unTypedTerm arg2)})),- Core.applicationArgument = (Typed.unTypedTerm arg3)})),- Core.applicationArgument = (Typed.unTypedTerm arg4)}))---- | DSL reference to hydra.json.encode.toJsonUntyped-toJsonUntyped :: Typed.TypedTerm Core.Term -> Typed.TypedTerm (Either String Model.Value)-toJsonUntyped arg0 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.json.encode.toJsonUntyped")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))
@@ -1,73 +0,0 @@--- Note: this is an automatically generated file. Do not edit.---- | DSL functions for hydra.json.model--module Hydra.Dsl.Json.Model where--import qualified Hydra.Core as Core-import qualified Hydra.Decode.Json.Model as DecodeJsonModel-import qualified Hydra.Dsl.Core as DslCore-import qualified Hydra.Encode.Json.Model as EncodeJsonModel-import qualified Hydra.Json.Model as Model-import qualified Hydra.Typed as Typed-import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)-import qualified Data.Scientific as Sci-import Data.Void---- | DSL injection for the array variant of hydra.json.model.Value-valueArray :: Typed.TypedTerm [Model.Value] -> Typed.TypedTerm Model.Value-valueArray x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.json.model.Value"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "array"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the boolean variant of hydra.json.model.Value-valueBoolean :: Typed.TypedTerm Bool -> Typed.TypedTerm Model.Value-valueBoolean x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.json.model.Value"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "boolean"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the null variant of hydra.json.model.Value-valueNull :: Typed.TypedTerm Model.Value-valueNull =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.json.model.Value"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "null"),- Core.fieldTerm = Core.TermUnit}}))---- | DSL injection for the number variant of hydra.json.model.Value-valueNumber :: Typed.TypedTerm Sci.Scientific -> Typed.TypedTerm Model.Value-valueNumber x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.json.model.Value"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "number"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the object variant of hydra.json.model.Value-valueObject :: Typed.TypedTerm [(String, Model.Value)] -> Typed.TypedTerm Model.Value-valueObject x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.json.model.Value"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "object"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the string variant of hydra.json.model.Value-valueString :: Typed.TypedTerm String -> Typed.TypedTerm Model.Value-valueString x =- Typed.TypedTerm (Core.TermInject (Core.Injection {- Core.injectionTypeName = (Core.Name "hydra.json.model.Value"),- Core.injectionField = Core.Field {- Core.fieldName = (Core.Name "string"),- Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL name token for hydra.json.model.Value-valueValue :: Typed.TypedName Model.Value-valueValue = Typed.TypedName (Core.Name "hydra.json.model.Value")
@@ -1,146 +0,0 @@--- Note: this is an automatically generated file. Do not edit.---- | DSL functions for hydra.json.parser--module Hydra.Dsl.Json.Parser where--import qualified Hydra.Ast as Ast-import qualified Hydra.Coders as Coders-import qualified Hydra.Core as Core-import qualified Hydra.Docs as Docs-import qualified Hydra.Dsl.Ast as DslAst-import qualified Hydra.Dsl.Coders as DslCoders-import qualified Hydra.Dsl.Core as DslCore-import qualified Hydra.Dsl.Docs as DslDocs-import qualified Hydra.Dsl.Error.Checking as ErrorChecking-import qualified Hydra.Dsl.Error.Core as DslErrorCore-import qualified Hydra.Dsl.Error.File as DslErrorFile-import qualified Hydra.Dsl.Error.Packaging as DslErrorPackaging-import qualified Hydra.Dsl.Error.System as DslErrorSystem-import qualified Hydra.Dsl.Errors as DslErrors-import qualified Hydra.Dsl.File as DslFile-import qualified Hydra.Dsl.Graph as DslGraph-import qualified Hydra.Dsl.Json.Model as JsonModel-import qualified Hydra.Dsl.Packaging as DslPackaging-import qualified Hydra.Dsl.Parsing as DslParsing-import qualified Hydra.Dsl.Paths as DslPaths-import qualified Hydra.Dsl.Query as DslQuery-import qualified Hydra.Dsl.Regex as DslRegex-import qualified Hydra.Dsl.Relational as DslRelational-import qualified Hydra.Dsl.System as DslSystem-import qualified Hydra.Dsl.Tabular as DslTabular-import qualified Hydra.Dsl.Testing as DslTesting-import qualified Hydra.Dsl.Time as DslTime-import qualified Hydra.Dsl.Topology as DslTopology-import qualified Hydra.Dsl.Typing as DslTyping-import qualified Hydra.Dsl.Util as DslUtil-import qualified Hydra.Dsl.Validation as DslValidation-import qualified Hydra.Dsl.Variants as DslVariants-import qualified Hydra.Error.Checking as Checking-import qualified Hydra.Error.Core as ErrorCore-import qualified Hydra.Error.File as ErrorFile-import qualified Hydra.Error.Packaging as ErrorPackaging-import qualified Hydra.Error.System as ErrorSystem-import qualified Hydra.Errors as Errors-import qualified Hydra.File as File-import qualified Hydra.Graph as Graph-import qualified Hydra.Json.Model as Model-import qualified Hydra.Json.Parser as Parser-import qualified Hydra.Packaging as Packaging-import qualified Hydra.Parsers as Parsers-import qualified Hydra.Parsing as Parsing-import qualified Hydra.Paths as Paths-import qualified Hydra.Query as Query-import qualified Hydra.Regex as Regex-import qualified Hydra.Relational as Relational-import qualified Hydra.System as System-import qualified Hydra.Tabular as Tabular-import qualified Hydra.Testing as Testing-import qualified Hydra.Time as Time-import qualified Hydra.Topology as Topology-import qualified Hydra.Typed as Typed-import qualified Hydra.Typing as Typing-import qualified Hydra.Util as Util-import qualified Hydra.Validation as Validation-import qualified Hydra.Variants as Variants-import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)-import qualified Data.Scientific as Sci-import Data.Void---- | DSL reference to hydra.json.parser.digit-digit :: Typed.TypedTerm (Parsing.Parser Int)-digit = Typed.TypedTerm (Core.TermVariable (Core.Name "hydra.json.parser.digit"))---- | DSL reference to hydra.json.parser.digits-digits :: Typed.TypedTerm (Parsing.Parser String)-digits = Typed.TypedTerm (Core.TermVariable (Core.Name "hydra.json.parser.digits"))---- | DSL reference to hydra.json.parser.jsonArray-jsonArray :: Typed.TypedTerm (Parsing.Parser Model.Value)-jsonArray = Typed.TypedTerm (Core.TermVariable (Core.Name "hydra.json.parser.jsonArray"))---- | DSL reference to hydra.json.parser.jsonBool-jsonBool :: Typed.TypedTerm (Parsing.Parser Model.Value)-jsonBool = Typed.TypedTerm (Core.TermVariable (Core.Name "hydra.json.parser.jsonBool"))---- | DSL reference to hydra.json.parser.jsonEscapeChar-jsonEscapeChar :: Typed.TypedTerm (Parsing.Parser Int)-jsonEscapeChar = Typed.TypedTerm (Core.TermVariable (Core.Name "hydra.json.parser.jsonEscapeChar"))---- | DSL reference to hydra.json.parser.jsonExponentPart-jsonExponentPart :: Typed.TypedTerm (Parsing.Parser (Maybe String))-jsonExponentPart = Typed.TypedTerm (Core.TermVariable (Core.Name "hydra.json.parser.jsonExponentPart"))---- | DSL reference to hydra.json.parser.jsonFractionPart-jsonFractionPart :: Typed.TypedTerm (Parsing.Parser (Maybe String))-jsonFractionPart = Typed.TypedTerm (Core.TermVariable (Core.Name "hydra.json.parser.jsonFractionPart"))---- | DSL reference to hydra.json.parser.jsonIntegerPart-jsonIntegerPart :: Typed.TypedTerm (Parsing.Parser String)-jsonIntegerPart = Typed.TypedTerm (Core.TermVariable (Core.Name "hydra.json.parser.jsonIntegerPart"))---- | DSL reference to hydra.json.parser.jsonKeyValue-jsonKeyValue :: Typed.TypedTerm (Parsing.Parser (String, Model.Value))-jsonKeyValue = Typed.TypedTerm (Core.TermVariable (Core.Name "hydra.json.parser.jsonKeyValue"))---- | DSL reference to hydra.json.parser.jsonNull-jsonNull :: Typed.TypedTerm (Parsing.Parser Model.Value)-jsonNull = Typed.TypedTerm (Core.TermVariable (Core.Name "hydra.json.parser.jsonNull"))---- | DSL reference to hydra.json.parser.jsonNumber-jsonNumber :: Typed.TypedTerm (Parsing.Parser Model.Value)-jsonNumber = Typed.TypedTerm (Core.TermVariable (Core.Name "hydra.json.parser.jsonNumber"))---- | DSL reference to hydra.json.parser.jsonObject-jsonObject :: Typed.TypedTerm (Parsing.Parser Model.Value)-jsonObject = Typed.TypedTerm (Core.TermVariable (Core.Name "hydra.json.parser.jsonObject"))---- | DSL reference to hydra.json.parser.jsonString-jsonString :: Typed.TypedTerm (Parsing.Parser Model.Value)-jsonString = Typed.TypedTerm (Core.TermVariable (Core.Name "hydra.json.parser.jsonString"))---- | DSL reference to hydra.json.parser.jsonStringChar-jsonStringChar :: Typed.TypedTerm (Parsing.Parser Int)-jsonStringChar = Typed.TypedTerm (Core.TermVariable (Core.Name "hydra.json.parser.jsonStringChar"))---- | DSL reference to hydra.json.parser.jsonValue-jsonValue :: Typed.TypedTerm (Parsing.Parser Model.Value)-jsonValue = Typed.TypedTerm (Core.TermVariable (Core.Name "hydra.json.parser.jsonValue"))---- | DSL reference to hydra.json.parser.parseJson-parseJson :: Typed.TypedTerm String -> Typed.TypedTerm (Parsing.ParseResult Model.Value)-parseJson arg0 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.json.parser.parseJson")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))---- | DSL reference to hydra.json.parser.token-token :: Typed.TypedTerm (Parsing.Parser t0) -> Typed.TypedTerm (Parsing.Parser t0)-token arg0 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.json.parser.token")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))---- | DSL reference to hydra.json.parser.whitespace-whitespace :: Typed.TypedTerm (Parsing.Parser ())-whitespace = Typed.TypedTerm (Core.TermVariable (Core.Name "hydra.json.parser.whitespace"))
@@ -1,108 +0,0 @@--- Note: this is an automatically generated file. Do not edit.---- | DSL functions for hydra.json.writer--module Hydra.Dsl.Json.Writer where--import qualified Hydra.Ast as Ast-import qualified Hydra.Coders as Coders-import qualified Hydra.Core as Core-import qualified Hydra.Docs as Docs-import qualified Hydra.Dsl.Ast as DslAst-import qualified Hydra.Dsl.Coders as DslCoders-import qualified Hydra.Dsl.Core as DslCore-import qualified Hydra.Dsl.Docs as DslDocs-import qualified Hydra.Dsl.Error.Checking as ErrorChecking-import qualified Hydra.Dsl.Error.Core as DslErrorCore-import qualified Hydra.Dsl.Error.File as DslErrorFile-import qualified Hydra.Dsl.Error.Packaging as DslErrorPackaging-import qualified Hydra.Dsl.Error.System as DslErrorSystem-import qualified Hydra.Dsl.Errors as DslErrors-import qualified Hydra.Dsl.File as DslFile-import qualified Hydra.Dsl.Graph as DslGraph-import qualified Hydra.Dsl.Json.Model as JsonModel-import qualified Hydra.Dsl.Packaging as DslPackaging-import qualified Hydra.Dsl.Parsing as DslParsing-import qualified Hydra.Dsl.Paths as DslPaths-import qualified Hydra.Dsl.Query as DslQuery-import qualified Hydra.Dsl.Regex as DslRegex-import qualified Hydra.Dsl.Relational as DslRelational-import qualified Hydra.Dsl.Serialization as DslSerialization-import qualified Hydra.Dsl.System as DslSystem-import qualified Hydra.Dsl.Tabular as DslTabular-import qualified Hydra.Dsl.Testing as DslTesting-import qualified Hydra.Dsl.Time as DslTime-import qualified Hydra.Dsl.Topology as DslTopology-import qualified Hydra.Dsl.Typing as DslTyping-import qualified Hydra.Dsl.Util as DslUtil-import qualified Hydra.Dsl.Validation as DslValidation-import qualified Hydra.Dsl.Variants as DslVariants-import qualified Hydra.Error.Checking as Checking-import qualified Hydra.Error.Core as ErrorCore-import qualified Hydra.Error.File as ErrorFile-import qualified Hydra.Error.Packaging as ErrorPackaging-import qualified Hydra.Error.System as ErrorSystem-import qualified Hydra.Errors as Errors-import qualified Hydra.File as File-import qualified Hydra.Graph as Graph-import qualified Hydra.Json.Model as Model-import qualified Hydra.Json.Writer as Writer-import qualified Hydra.Packaging as Packaging-import qualified Hydra.Parsing as Parsing-import qualified Hydra.Paths as Paths-import qualified Hydra.Query as Query-import qualified Hydra.Regex as Regex-import qualified Hydra.Relational as Relational-import qualified Hydra.Serialization as Serialization-import qualified Hydra.System as System-import qualified Hydra.Tabular as Tabular-import qualified Hydra.Testing as Testing-import qualified Hydra.Time as Time-import qualified Hydra.Topology as Topology-import qualified Hydra.Typed as Typed-import qualified Hydra.Typing as Typing-import qualified Hydra.Util as Util-import qualified Hydra.Validation as Validation-import qualified Hydra.Variants as Variants-import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)-import qualified Data.Scientific as Sci-import Data.Void---- | DSL reference to hydra.json.writer.colonOp-colonOp :: Typed.TypedTerm Ast.Op-colonOp = Typed.TypedTerm (Core.TermVariable (Core.Name "hydra.json.writer.colonOp"))---- | DSL reference to hydra.json.writer.hexByte-hexByte :: Typed.TypedTerm Int -> Typed.TypedTerm String-hexByte arg0 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.json.writer.hexByte")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))---- | DSL reference to hydra.json.writer.jsonString-jsonString :: Typed.TypedTerm String -> Typed.TypedTerm String-jsonString arg0 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.json.writer.jsonString")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))---- | DSL reference to hydra.json.writer.keyValueToExpr-keyValueToExpr :: Typed.TypedTerm (String, Model.Value) -> Typed.TypedTerm Ast.Expr-keyValueToExpr arg0 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.json.writer.keyValueToExpr")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))---- | DSL reference to hydra.json.writer.printJson-printJson :: Typed.TypedTerm Model.Value -> Typed.TypedTerm String-printJson arg0 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.json.writer.printJson")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))---- | DSL reference to hydra.json.writer.valueToExpr-valueToExpr :: Typed.TypedTerm Model.Value -> Typed.TypedTerm Ast.Expr-valueToExpr arg0 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.json.writer.valueToExpr")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))
@@ -1,92 +0,0 @@--- Note: this is an automatically generated file. Do not edit.---- | DSL functions for hydra.json.yaml.decode--module Hydra.Dsl.Json.Yaml.Decode where--import qualified Hydra.Ast as Ast-import qualified Hydra.Coders as Coders-import qualified Hydra.Core as Core-import qualified Hydra.Docs as Docs-import qualified Hydra.Dsl.Ast as DslAst-import qualified Hydra.Dsl.Coders as DslCoders-import qualified Hydra.Dsl.Core as DslCore-import qualified Hydra.Dsl.Docs as DslDocs-import qualified Hydra.Dsl.Error.Checking as ErrorChecking-import qualified Hydra.Dsl.Error.Core as DslErrorCore-import qualified Hydra.Dsl.Error.File as DslErrorFile-import qualified Hydra.Dsl.Error.Packaging as DslErrorPackaging-import qualified Hydra.Dsl.Error.System as DslErrorSystem-import qualified Hydra.Dsl.Errors as DslErrors-import qualified Hydra.Dsl.File as DslFile-import qualified Hydra.Dsl.Graph as DslGraph-import qualified Hydra.Dsl.Json.Decode as JsonDecode-import qualified Hydra.Dsl.Json.Model as DslJsonModel-import qualified Hydra.Dsl.Packaging as DslPackaging-import qualified Hydra.Dsl.Parsing as DslParsing-import qualified Hydra.Dsl.Paths as DslPaths-import qualified Hydra.Dsl.Query as DslQuery-import qualified Hydra.Dsl.Regex as DslRegex-import qualified Hydra.Dsl.Relational as DslRelational-import qualified Hydra.Dsl.System as DslSystem-import qualified Hydra.Dsl.Tabular as DslTabular-import qualified Hydra.Dsl.Testing as DslTesting-import qualified Hydra.Dsl.Time as DslTime-import qualified Hydra.Dsl.Topology as DslTopology-import qualified Hydra.Dsl.Typing as DslTyping-import qualified Hydra.Dsl.Util as DslUtil-import qualified Hydra.Dsl.Validation as DslValidation-import qualified Hydra.Dsl.Variants as DslVariants-import qualified Hydra.Dsl.Yaml.Model as DslYamlModel-import qualified Hydra.Error.Checking as Checking-import qualified Hydra.Error.Core as ErrorCore-import qualified Hydra.Error.File as ErrorFile-import qualified Hydra.Error.Packaging as ErrorPackaging-import qualified Hydra.Error.System as ErrorSystem-import qualified Hydra.Errors as Errors-import qualified Hydra.File as File-import qualified Hydra.Graph as Graph-import qualified Hydra.Json.Decode as Decode-import qualified Hydra.Json.Model as JsonModel-import qualified Hydra.Json.Yaml.Decode as YamlDecode-import qualified Hydra.Packaging as Packaging-import qualified Hydra.Parsing as Parsing-import qualified Hydra.Paths as Paths-import qualified Hydra.Query as Query-import qualified Hydra.Regex as Regex-import qualified Hydra.Relational as Relational-import qualified Hydra.System as System-import qualified Hydra.Tabular as Tabular-import qualified Hydra.Testing as Testing-import qualified Hydra.Time as Time-import qualified Hydra.Topology as Topology-import qualified Hydra.Typed as Typed-import qualified Hydra.Typing as Typing-import qualified Hydra.Util as Util-import qualified Hydra.Validation as Validation-import qualified Hydra.Variants as Variants-import qualified Hydra.Yaml.Model as YamlModel-import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)-import qualified Data.Scientific as Sci-import Data.Void-import qualified Data.Map as M---- | DSL reference to hydra.json.yaml.decode.fromYaml-fromYaml :: Typed.TypedTerm (M.Map Core.Name Core.Type) -> Typed.TypedTerm Core.Name -> Typed.TypedTerm Core.Type -> Typed.TypedTerm YamlModel.Node -> Typed.TypedTerm (Either String Core.Term)-fromYaml arg0 arg1 arg2 arg3 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.json.yaml.decode.fromYaml")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)})),- Core.applicationArgument = (Typed.unTypedTerm arg2)})),- Core.applicationArgument = (Typed.unTypedTerm arg3)}))---- | DSL reference to hydra.json.yaml.decode.yamlToJson-yamlToJson :: Typed.TypedTerm YamlModel.Node -> Typed.TypedTerm (Either String JsonModel.Value)-yamlToJson arg0 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.json.yaml.decode.yamlToJson")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))
@@ -1,92 +0,0 @@--- Note: this is an automatically generated file. Do not edit.---- | DSL functions for hydra.json.yaml.encode--module Hydra.Dsl.Json.Yaml.Encode where--import qualified Hydra.Ast as Ast-import qualified Hydra.Coders as Coders-import qualified Hydra.Core as Core-import qualified Hydra.Docs as Docs-import qualified Hydra.Dsl.Ast as DslAst-import qualified Hydra.Dsl.Coders as DslCoders-import qualified Hydra.Dsl.Core as DslCore-import qualified Hydra.Dsl.Docs as DslDocs-import qualified Hydra.Dsl.Error.Checking as ErrorChecking-import qualified Hydra.Dsl.Error.Core as DslErrorCore-import qualified Hydra.Dsl.Error.File as DslErrorFile-import qualified Hydra.Dsl.Error.Packaging as DslErrorPackaging-import qualified Hydra.Dsl.Error.System as DslErrorSystem-import qualified Hydra.Dsl.Errors as DslErrors-import qualified Hydra.Dsl.File as DslFile-import qualified Hydra.Dsl.Graph as DslGraph-import qualified Hydra.Dsl.Json.Encode as JsonEncode-import qualified Hydra.Dsl.Json.Model as DslJsonModel-import qualified Hydra.Dsl.Packaging as DslPackaging-import qualified Hydra.Dsl.Parsing as DslParsing-import qualified Hydra.Dsl.Paths as DslPaths-import qualified Hydra.Dsl.Query as DslQuery-import qualified Hydra.Dsl.Regex as DslRegex-import qualified Hydra.Dsl.Relational as DslRelational-import qualified Hydra.Dsl.System as DslSystem-import qualified Hydra.Dsl.Tabular as DslTabular-import qualified Hydra.Dsl.Testing as DslTesting-import qualified Hydra.Dsl.Time as DslTime-import qualified Hydra.Dsl.Topology as DslTopology-import qualified Hydra.Dsl.Typing as DslTyping-import qualified Hydra.Dsl.Util as DslUtil-import qualified Hydra.Dsl.Validation as DslValidation-import qualified Hydra.Dsl.Variants as DslVariants-import qualified Hydra.Dsl.Yaml.Model as DslYamlModel-import qualified Hydra.Error.Checking as Checking-import qualified Hydra.Error.Core as ErrorCore-import qualified Hydra.Error.File as ErrorFile-import qualified Hydra.Error.Packaging as ErrorPackaging-import qualified Hydra.Error.System as ErrorSystem-import qualified Hydra.Errors as Errors-import qualified Hydra.File as File-import qualified Hydra.Graph as Graph-import qualified Hydra.Json.Encode as Encode-import qualified Hydra.Json.Model as JsonModel-import qualified Hydra.Json.Yaml.Encode as YamlEncode-import qualified Hydra.Packaging as Packaging-import qualified Hydra.Parsing as Parsing-import qualified Hydra.Paths as Paths-import qualified Hydra.Query as Query-import qualified Hydra.Regex as Regex-import qualified Hydra.Relational as Relational-import qualified Hydra.System as System-import qualified Hydra.Tabular as Tabular-import qualified Hydra.Testing as Testing-import qualified Hydra.Time as Time-import qualified Hydra.Topology as Topology-import qualified Hydra.Typed as Typed-import qualified Hydra.Typing as Typing-import qualified Hydra.Util as Util-import qualified Hydra.Validation as Validation-import qualified Hydra.Variants as Variants-import qualified Hydra.Yaml.Model as YamlModel-import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)-import qualified Data.Scientific as Sci-import Data.Void-import qualified Data.Map as M---- | DSL reference to hydra.json.yaml.encode.jsonToYaml-jsonToYaml :: Typed.TypedTerm JsonModel.Value -> Typed.TypedTerm YamlModel.Node-jsonToYaml arg0 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.json.yaml.encode.jsonToYaml")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))---- | DSL reference to hydra.json.yaml.encode.toYaml-toYaml :: Typed.TypedTerm (M.Map Core.Name Core.Type) -> Typed.TypedTerm Core.Name -> Typed.TypedTerm Core.Type -> Typed.TypedTerm Core.Term -> Typed.TypedTerm (Either String YamlModel.Node)-toYaml arg0 arg1 arg2 arg3 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.json.yaml.encode.toYaml")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)})),- Core.applicationArgument = (Typed.unTypedTerm arg2)})),- Core.applicationArgument = (Typed.unTypedTerm arg3)}))
@@ -1,302 +0,0 @@--- Note: this is an automatically generated file. Do not edit.---- | DSL functions for hydra.lexical--module Hydra.Dsl.Lexical where--import qualified Hydra.Ast as Ast-import qualified Hydra.Coders as Coders-import qualified Hydra.Core as Core-import qualified Hydra.Docs as Docs-import qualified Hydra.Dsl.Ast as DslAst-import qualified Hydra.Dsl.Coders as DslCoders-import qualified Hydra.Dsl.Core as DslCore-import qualified Hydra.Dsl.Docs as DslDocs-import qualified Hydra.Dsl.Error.Checking as ErrorChecking-import qualified Hydra.Dsl.Error.Core as DslErrorCore-import qualified Hydra.Dsl.Error.File as DslErrorFile-import qualified Hydra.Dsl.Error.Packaging as DslErrorPackaging-import qualified Hydra.Dsl.Error.System as DslErrorSystem-import qualified Hydra.Dsl.Errors as DslErrors-import qualified Hydra.Dsl.File as DslFile-import qualified Hydra.Dsl.Graph as DslGraph-import qualified Hydra.Dsl.Json.Model as JsonModel-import qualified Hydra.Dsl.Packaging as DslPackaging-import qualified Hydra.Dsl.Parsing as DslParsing-import qualified Hydra.Dsl.Paths as DslPaths-import qualified Hydra.Dsl.Query as DslQuery-import qualified Hydra.Dsl.Regex as DslRegex-import qualified Hydra.Dsl.Relational as DslRelational-import qualified Hydra.Dsl.Scoping as DslScoping-import qualified Hydra.Dsl.Strip as DslStrip-import qualified Hydra.Dsl.System as DslSystem-import qualified Hydra.Dsl.Tabular as DslTabular-import qualified Hydra.Dsl.Testing as DslTesting-import qualified Hydra.Dsl.Time as DslTime-import qualified Hydra.Dsl.Topology as DslTopology-import qualified Hydra.Dsl.Typing as DslTyping-import qualified Hydra.Dsl.Util as DslUtil-import qualified Hydra.Dsl.Validation as DslValidation-import qualified Hydra.Dsl.Variants as DslVariants-import qualified Hydra.Error.Checking as Checking-import qualified Hydra.Error.Core as ErrorCore-import qualified Hydra.Error.File as ErrorFile-import qualified Hydra.Error.Packaging as ErrorPackaging-import qualified Hydra.Error.System as ErrorSystem-import qualified Hydra.Errors as Errors-import qualified Hydra.File as File-import qualified Hydra.Graph as Graph-import qualified Hydra.Json.Model as Model-import qualified Hydra.Lexical as Lexical-import qualified Hydra.Packaging as Packaging-import qualified Hydra.Parsing as Parsing-import qualified Hydra.Paths as Paths-import qualified Hydra.Print.Core as PrintCore-import qualified Hydra.Print.Errors as PrintErrors-import qualified Hydra.Query as Query-import qualified Hydra.Regex as Regex-import qualified Hydra.Relational as Relational-import qualified Hydra.Scoping as Scoping-import qualified Hydra.Strip as Strip-import qualified Hydra.System as System-import qualified Hydra.Tabular as Tabular-import qualified Hydra.Testing as Testing-import qualified Hydra.Time as Time-import qualified Hydra.Topology as Topology-import qualified Hydra.Typed as Typed-import qualified Hydra.Typing as Typing-import qualified Hydra.Util as Util-import qualified Hydra.Validation as Validation-import qualified Hydra.Variants as Variants-import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)-import qualified Data.Scientific as Sci-import Data.Void-import qualified Data.Map as M-import qualified Data.Set as S---- | DSL reference to hydra.lexical.buildGraph-buildGraph :: Typed.TypedTerm [Core.Binding] -> Typed.TypedTerm (M.Map Core.Name (Maybe Core.Term)) -> Typed.TypedTerm (M.Map Core.Name Graph.Primitive) -> Typed.TypedTerm Graph.Graph-buildGraph arg0 arg1 arg2 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lexical.buildGraph")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)})),- Core.applicationArgument = (Typed.unTypedTerm arg2)}))---- | DSL reference to hydra.lexical.chooseUniqueName-chooseUniqueName :: Typed.TypedTerm (S.Set Core.Name) -> Typed.TypedTerm Core.Name -> Typed.TypedTerm Core.Name-chooseUniqueName arg0 arg1 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lexical.chooseUniqueName")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))---- | DSL reference to hydra.lexical.dereferenceSchemaType-dereferenceSchemaType :: Typed.TypedTerm Core.Name -> Typed.TypedTerm (M.Map Core.Name Core.TypeScheme) -> Typed.TypedTerm (Maybe Core.TypeScheme)-dereferenceSchemaType arg0 arg1 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lexical.dereferenceSchemaType")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))---- | DSL reference to hydra.lexical.dereferenceVariable-dereferenceVariable :: Typed.TypedTerm Graph.Graph -> Typed.TypedTerm Core.Name -> Typed.TypedTerm (Either Errors.Error Core.Binding)-dereferenceVariable arg0 arg1 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lexical.dereferenceVariable")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))---- | DSL reference to hydra.lexical.elementsToGraph-elementsToGraph :: Typed.TypedTerm Graph.Graph -> Typed.TypedTerm (M.Map Core.Name Core.TypeScheme) -> Typed.TypedTerm [Core.Binding] -> Typed.TypedTerm Graph.Graph-elementsToGraph arg0 arg1 arg2 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lexical.elementsToGraph")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)})),- Core.applicationArgument = (Typed.unTypedTerm arg2)}))---- | DSL reference to hydra.lexical.emptyGraph-emptyGraph :: Typed.TypedTerm Graph.Graph-emptyGraph = Typed.TypedTerm (Core.TermVariable (Core.Name "hydra.lexical.emptyGraph"))---- | DSL reference to hydra.lexical.emptyInferenceContext-emptyInferenceContext :: Typed.TypedTerm Typing.InferenceContext-emptyInferenceContext = Typed.TypedTerm (Core.TermVariable (Core.Name "hydra.lexical.emptyInferenceContext"))---- | DSL reference to hydra.lexical.fieldsOf-fieldsOf :: Typed.TypedTerm Core.Type -> Typed.TypedTerm [Core.FieldType]-fieldsOf arg0 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lexical.fieldsOf")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))---- | DSL reference to hydra.lexical.getField-getField :: Typed.TypedTerm (M.Map Core.Name t0) -> Typed.TypedTerm Core.Name -> Typed.TypedTerm (t0 -> Either Errors.Error t1) -> Typed.TypedTerm (Either Errors.Error t1)-getField arg0 arg1 arg2 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lexical.getField")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)})),- Core.applicationArgument = (Typed.unTypedTerm arg2)}))---- | DSL reference to hydra.lexical.graphToBindings-graphToBindings :: Typed.TypedTerm Graph.Graph -> Typed.TypedTerm [Core.Binding]-graphToBindings arg0 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lexical.graphToBindings")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))---- | DSL reference to hydra.lexical.graphWithPrimitives-graphWithPrimitives :: Typed.TypedTerm [Graph.Primitive] -> Typed.TypedTerm [Graph.Primitive] -> Typed.TypedTerm Graph.Graph-graphWithPrimitives arg0 arg1 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lexical.graphWithPrimitives")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))---- | DSL reference to hydra.lexical.lookupBinding-lookupBinding :: Typed.TypedTerm Graph.Graph -> Typed.TypedTerm Core.Name -> Typed.TypedTerm (Maybe Core.Binding)-lookupBinding arg0 arg1 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lexical.lookupBinding")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))---- | DSL reference to hydra.lexical.lookupPrimitive-lookupPrimitive :: Typed.TypedTerm Graph.Graph -> Typed.TypedTerm Core.Name -> Typed.TypedTerm (Maybe Graph.Primitive)-lookupPrimitive arg0 arg1 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lexical.lookupPrimitive")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))---- | DSL reference to hydra.lexical.lookupTerm-lookupTerm :: Typed.TypedTerm Graph.Graph -> Typed.TypedTerm Core.Name -> Typed.TypedTerm (Maybe Core.Term)-lookupTerm arg0 arg1 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lexical.lookupTerm")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))---- | DSL reference to hydra.lexical.matchEnum-matchEnum :: Typed.TypedTerm Graph.Graph -> Typed.TypedTerm Core.Name -> Typed.TypedTerm [(Core.Name, t0)] -> Typed.TypedTerm Core.Term -> Typed.TypedTerm (Either Errors.Error t0)-matchEnum arg0 arg1 arg2 arg3 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lexical.matchEnum")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)})),- Core.applicationArgument = (Typed.unTypedTerm arg2)})),- Core.applicationArgument = (Typed.unTypedTerm arg3)}))---- | DSL reference to hydra.lexical.matchRecord-matchRecord :: Typed.TypedTerm t0 -> Typed.TypedTerm (M.Map Core.Name Core.Term -> Either Errors.Error t1) -> Typed.TypedTerm Core.Term -> Typed.TypedTerm (Either Errors.Error t1)-matchRecord arg0 arg1 arg2 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lexical.matchRecord")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)})),- Core.applicationArgument = (Typed.unTypedTerm arg2)}))---- | DSL reference to hydra.lexical.matchUnion-matchUnion :: Typed.TypedTerm Graph.Graph -> Typed.TypedTerm Core.Name -> Typed.TypedTerm [(Core.Name, (Core.Term -> Either Errors.Error t0))] -> Typed.TypedTerm Core.Term -> Typed.TypedTerm (Either Errors.Error t0)-matchUnion arg0 arg1 arg2 arg3 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lexical.matchUnion")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)})),- Core.applicationArgument = (Typed.unTypedTerm arg2)})),- Core.applicationArgument = (Typed.unTypedTerm arg3)}))---- | DSL reference to hydra.lexical.matchUnitField-matchUnitField :: Typed.TypedTerm t0 -> Typed.TypedTerm t1 -> Typed.TypedTerm (t0, (t2 -> Either t3 t1))-matchUnitField arg0 arg1 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lexical.matchUnitField")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))---- | DSL reference to hydra.lexical.requireBinding-requireBinding :: Typed.TypedTerm Graph.Graph -> Typed.TypedTerm Core.Name -> Typed.TypedTerm (Either Errors.Error Core.Binding)-requireBinding arg0 arg1 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lexical.requireBinding")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))---- | DSL reference to hydra.lexical.requirePrimitive-requirePrimitive :: Typed.TypedTerm Graph.Graph -> Typed.TypedTerm Core.Name -> Typed.TypedTerm (Either Errors.Error Graph.Primitive)-requirePrimitive arg0 arg1 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lexical.requirePrimitive")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))---- | DSL reference to hydra.lexical.requirePrimitiveType-requirePrimitiveType :: Typed.TypedTerm Graph.Graph -> Typed.TypedTerm Core.Name -> Typed.TypedTerm (Either Errors.Error Core.TypeScheme)-requirePrimitiveType arg0 arg1 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lexical.requirePrimitiveType")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))---- | DSL reference to hydra.lexical.requireTerm-requireTerm :: Typed.TypedTerm Graph.Graph -> Typed.TypedTerm Core.Name -> Typed.TypedTerm (Either Errors.Error Core.Term)-requireTerm arg0 arg1 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lexical.requireTerm")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))---- | DSL reference to hydra.lexical.resolveTerm-resolveTerm :: Typed.TypedTerm Graph.Graph -> Typed.TypedTerm Core.Name -> Typed.TypedTerm (Maybe Core.Term)-resolveTerm arg0 arg1 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lexical.resolveTerm")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))---- | DSL reference to hydra.lexical.stripAndDereferenceTerm-stripAndDereferenceTerm :: Typed.TypedTerm Graph.Graph -> Typed.TypedTerm Core.Term -> Typed.TypedTerm (Either Errors.Error Core.Term)-stripAndDereferenceTerm arg0 arg1 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lexical.stripAndDereferenceTerm")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))---- | DSL reference to hydra.lexical.stripAndDereferenceTermEither-stripAndDereferenceTermEither :: Typed.TypedTerm Graph.Graph -> Typed.TypedTerm Core.Term -> Typed.TypedTerm (Either Errors.Error Core.Term)-stripAndDereferenceTermEither arg0 arg1 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lexical.stripAndDereferenceTermEither")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))
@@ -1,122 +0,0 @@--- Note: this is an automatically generated file. Do not edit.---- | DSL functions for hydra.lib.chars--module Hydra.Dsl.Lib.Chars where--import qualified Hydra.Ast as Ast-import qualified Hydra.Coders as Coders-import qualified Hydra.Core as Core-import qualified Hydra.Docs as Docs-import qualified Hydra.Dsl.Ast as DslAst-import qualified Hydra.Dsl.Coders as DslCoders-import qualified Hydra.Dsl.Core as DslCore-import qualified Hydra.Dsl.Docs as DslDocs-import qualified Hydra.Dsl.Error.Checking as ErrorChecking-import qualified Hydra.Dsl.Error.Core as DslErrorCore-import qualified Hydra.Dsl.Error.File as DslErrorFile-import qualified Hydra.Dsl.Error.Packaging as DslErrorPackaging-import qualified Hydra.Dsl.Error.System as DslErrorSystem-import qualified Hydra.Dsl.Errors as DslErrors-import qualified Hydra.Dsl.File as DslFile-import qualified Hydra.Dsl.Graph as DslGraph-import qualified Hydra.Dsl.Json.Model as JsonModel-import qualified Hydra.Dsl.Packaging as DslPackaging-import qualified Hydra.Dsl.Parsing as DslParsing-import qualified Hydra.Dsl.Paths as DslPaths-import qualified Hydra.Dsl.Query as DslQuery-import qualified Hydra.Dsl.Regex as DslRegex-import qualified Hydra.Dsl.Relational as DslRelational-import qualified Hydra.Dsl.System as DslSystem-import qualified Hydra.Dsl.Tabular as DslTabular-import qualified Hydra.Dsl.Testing as DslTesting-import qualified Hydra.Dsl.Time as DslTime-import qualified Hydra.Dsl.Topology as DslTopology-import qualified Hydra.Dsl.Typing as DslTyping-import qualified Hydra.Dsl.Util as DslUtil-import qualified Hydra.Dsl.Validation as DslValidation-import qualified Hydra.Dsl.Variants as DslVariants-import qualified Hydra.Error.Checking as Checking-import qualified Hydra.Error.Core as ErrorCore-import qualified Hydra.Error.File as ErrorFile-import qualified Hydra.Error.Packaging as ErrorPackaging-import qualified Hydra.Error.System as ErrorSystem-import qualified Hydra.Errors as Errors-import qualified Hydra.File as File-import qualified Hydra.Graph as Graph-import qualified Hydra.Json.Model as Model-import qualified Hydra.Packaging as Packaging-import qualified Hydra.Parsing as Parsing-import qualified Hydra.Paths as Paths-import qualified Hydra.Query as Query-import qualified Hydra.Regex as Regex-import qualified Hydra.Relational as Relational-import qualified Hydra.System as System-import qualified Hydra.Tabular as Tabular-import qualified Hydra.Testing as Testing-import qualified Hydra.Time as Time-import qualified Hydra.Topology as Topology-import qualified Hydra.Typed as Typed-import qualified Hydra.Typing as Typing-import qualified Hydra.Util as Util-import qualified Hydra.Validation as Validation-import qualified Hydra.Variants as Variants-import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)-import qualified Data.Scientific as Sci-import Data.Void---- | DSL reference to hydra.lib.chars.isAlpha-isAlpha :: Typed.TypedTerm Int -> Typed.TypedTerm Bool-isAlpha char =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.chars.isAlpha")),- Core.applicationArgument = (Typed.unTypedTerm char)}))---- | DSL reference to hydra.lib.chars.isAlphaNum-isAlphaNum :: Typed.TypedTerm Int -> Typed.TypedTerm Bool-isAlphaNum char =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.chars.isAlphaNum")),- Core.applicationArgument = (Typed.unTypedTerm char)}))---- | DSL reference to hydra.lib.chars.isDigit-isDigit :: Typed.TypedTerm Int -> Typed.TypedTerm Bool-isDigit char =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.chars.isDigit")),- Core.applicationArgument = (Typed.unTypedTerm char)}))---- | DSL reference to hydra.lib.chars.isLower-isLower :: Typed.TypedTerm Int -> Typed.TypedTerm Bool-isLower char =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.chars.isLower")),- Core.applicationArgument = (Typed.unTypedTerm char)}))---- | DSL reference to hydra.lib.chars.isSpace-isSpace :: Typed.TypedTerm Int -> Typed.TypedTerm Bool-isSpace char =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.chars.isSpace")),- Core.applicationArgument = (Typed.unTypedTerm char)}))---- | DSL reference to hydra.lib.chars.isUpper-isUpper :: Typed.TypedTerm Int -> Typed.TypedTerm Bool-isUpper char =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.chars.isUpper")),- Core.applicationArgument = (Typed.unTypedTerm char)}))---- | DSL reference to hydra.lib.chars.toLower-toLower :: Typed.TypedTerm Int -> Typed.TypedTerm Int-toLower char =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.chars.toLower")),- Core.applicationArgument = (Typed.unTypedTerm char)}))---- | DSL reference to hydra.lib.chars.toUpper-toUpper :: Typed.TypedTerm Int -> Typed.TypedTerm Int-toUpper char =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.chars.toUpper")),- Core.applicationArgument = (Typed.unTypedTerm char)}))
@@ -1,28 +0,0 @@--- Note: this is an automatically generated file. Do not edit.---- | DSL functions for hydra.lib.defaults--module Hydra.Dsl.Lib.Defaults where--import qualified Hydra.Core as Core-import qualified Hydra.Dsl.Core as DslCore-import qualified Hydra.Dsl.Lib.Eithers as Eithers-import qualified Hydra.Dsl.Lib.Equality as Equality-import qualified Hydra.Dsl.Lib.Functions as Functions-import qualified Hydra.Dsl.Lib.Lists as Lists-import qualified Hydra.Dsl.Lib.Logic as Logic-import qualified Hydra.Dsl.Lib.Maps as Maps-import qualified Hydra.Dsl.Lib.Math as Math-import qualified Hydra.Dsl.Lib.Optionals as Optionals-import qualified Hydra.Dsl.Lib.Pairs as Pairs-import qualified Hydra.Dsl.Lib.Sets as Sets-import qualified Hydra.Lib.Defaults as Defaults-import qualified Hydra.Typed as Typed-import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)-import qualified Data.Scientific as Sci-import Data.Void-import qualified Data.Map as M---- | DSL reference to hydra.lib.defaults.defaultImplementations-defaultImplementations :: Typed.TypedTerm (M.Map Core.Name Core.Term)-defaultImplementations = Typed.TypedTerm (Core.TermVariable (Core.Name "hydra.lib.defaults.defaultImplementations"))
@@ -1,150 +0,0 @@--- Note: this is an automatically generated file. Do not edit.---- | DSL functions for hydra.lib.effects--module Hydra.Dsl.Lib.Effects where--import qualified Hydra.Ast as Ast-import qualified Hydra.Coders as Coders-import qualified Hydra.Core as Core-import qualified Hydra.Docs as Docs-import qualified Hydra.Dsl.Ast as DslAst-import qualified Hydra.Dsl.Coders as DslCoders-import qualified Hydra.Dsl.Core as DslCore-import qualified Hydra.Dsl.Docs as DslDocs-import qualified Hydra.Dsl.Error.Checking as ErrorChecking-import qualified Hydra.Dsl.Error.Core as DslErrorCore-import qualified Hydra.Dsl.Error.File as DslErrorFile-import qualified Hydra.Dsl.Error.Packaging as DslErrorPackaging-import qualified Hydra.Dsl.Error.System as DslErrorSystem-import qualified Hydra.Dsl.Errors as DslErrors-import qualified Hydra.Dsl.File as DslFile-import qualified Hydra.Dsl.Graph as DslGraph-import qualified Hydra.Dsl.Json.Model as JsonModel-import qualified Hydra.Dsl.Packaging as DslPackaging-import qualified Hydra.Dsl.Parsing as DslParsing-import qualified Hydra.Dsl.Paths as DslPaths-import qualified Hydra.Dsl.Query as DslQuery-import qualified Hydra.Dsl.Regex as DslRegex-import qualified Hydra.Dsl.Relational as DslRelational-import qualified Hydra.Dsl.System as DslSystem-import qualified Hydra.Dsl.Tabular as DslTabular-import qualified Hydra.Dsl.Testing as DslTesting-import qualified Hydra.Dsl.Time as DslTime-import qualified Hydra.Dsl.Topology as DslTopology-import qualified Hydra.Dsl.Typing as DslTyping-import qualified Hydra.Dsl.Util as DslUtil-import qualified Hydra.Dsl.Validation as DslValidation-import qualified Hydra.Dsl.Variants as DslVariants-import qualified Hydra.Error.Checking as Checking-import qualified Hydra.Error.Core as ErrorCore-import qualified Hydra.Error.File as ErrorFile-import qualified Hydra.Error.Packaging as ErrorPackaging-import qualified Hydra.Error.System as ErrorSystem-import qualified Hydra.Errors as Errors-import qualified Hydra.File as File-import qualified Hydra.Graph as Graph-import qualified Hydra.Json.Model as Model-import qualified Hydra.Packaging as Packaging-import qualified Hydra.Parsing as Parsing-import qualified Hydra.Paths as Paths-import qualified Hydra.Query as Query-import qualified Hydra.Regex as Regex-import qualified Hydra.Relational as Relational-import qualified Hydra.System as System-import qualified Hydra.Tabular as Tabular-import qualified Hydra.Testing as Testing-import qualified Hydra.Time as Time-import qualified Hydra.Topology as Topology-import qualified Hydra.Typed as Typed-import qualified Hydra.Typing as Typing-import qualified Hydra.Util as Util-import qualified Hydra.Validation as Validation-import qualified Hydra.Variants as Variants-import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)-import qualified Data.Scientific as Sci-import Data.Void-import qualified Data.Set as S---- | DSL reference to hydra.lib.effects.apply-apply :: Typed.TypedTerm (IO (x -> y)) -> Typed.TypedTerm (IO x) -> Typed.TypedTerm (IO y)-apply ef ex =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.effects.apply")),- Core.applicationArgument = (Typed.unTypedTerm ef)})),- Core.applicationArgument = (Typed.unTypedTerm ex)}))---- | DSL reference to hydra.lib.effects.bind-bind :: Typed.TypedTerm (IO x) -> Typed.TypedTerm (x -> IO y) -> Typed.TypedTerm (IO y)-bind e f =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.effects.bind")),- Core.applicationArgument = (Typed.unTypedTerm e)})),- Core.applicationArgument = (Typed.unTypedTerm f)}))---- | DSL reference to hydra.lib.effects.compose-compose :: Typed.TypedTerm (x -> IO y) -> Typed.TypedTerm (y -> IO z) -> Typed.TypedTerm x -> Typed.TypedTerm (IO z)-compose f g x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.effects.compose")),- Core.applicationArgument = (Typed.unTypedTerm f)})),- Core.applicationArgument = (Typed.unTypedTerm g)})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL reference to hydra.lib.effects.foldList-foldList :: Typed.TypedTerm (x -> y -> IO x) -> Typed.TypedTerm x -> Typed.TypedTerm [y] -> Typed.TypedTerm (IO x)-foldList f acc0 xs =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.effects.foldList")),- Core.applicationArgument = (Typed.unTypedTerm f)})),- Core.applicationArgument = (Typed.unTypedTerm acc0)})),- Core.applicationArgument = (Typed.unTypedTerm xs)}))---- | DSL reference to hydra.lib.effects.map-map :: Typed.TypedTerm (x -> y) -> Typed.TypedTerm (IO x) -> Typed.TypedTerm (IO y)-map f e =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.effects.map")),- Core.applicationArgument = (Typed.unTypedTerm f)})),- Core.applicationArgument = (Typed.unTypedTerm e)}))---- | DSL reference to hydra.lib.effects.mapList-mapList :: Typed.TypedTerm (x -> IO y) -> Typed.TypedTerm [x] -> Typed.TypedTerm (IO [y])-mapList f xs =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.effects.mapList")),- Core.applicationArgument = (Typed.unTypedTerm f)})),- Core.applicationArgument = (Typed.unTypedTerm xs)}))---- | DSL reference to hydra.lib.effects.mapOptional-mapOptional :: Typed.TypedTerm (x -> IO y) -> Typed.TypedTerm (Maybe x) -> Typed.TypedTerm (IO (Maybe y))-mapOptional f m =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.effects.mapOptional")),- Core.applicationArgument = (Typed.unTypedTerm f)})),- Core.applicationArgument = (Typed.unTypedTerm m)}))---- | DSL reference to hydra.lib.effects.mapSet-mapSet :: Typed.TypedTerm (x -> IO y) -> Typed.TypedTerm (S.Set x) -> Typed.TypedTerm (IO (S.Set y))-mapSet f s =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.effects.mapSet")),- Core.applicationArgument = (Typed.unTypedTerm f)})),- Core.applicationArgument = (Typed.unTypedTerm s)}))---- | DSL reference to hydra.lib.effects.pure-pure :: Typed.TypedTerm x -> Typed.TypedTerm (IO x)-pure x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.effects.pure")),- Core.applicationArgument = (Typed.unTypedTerm x)}))
@@ -1,214 +0,0 @@--- Note: this is an automatically generated file. Do not edit.---- | DSL functions for hydra.lib.eithers--module Hydra.Dsl.Lib.Eithers where--import qualified Hydra.Ast as Ast-import qualified Hydra.Coders as Coders-import qualified Hydra.Core as Core-import qualified Hydra.Docs as Docs-import qualified Hydra.Dsl.Ast as DslAst-import qualified Hydra.Dsl.Coders as DslCoders-import qualified Hydra.Dsl.Core as DslCore-import qualified Hydra.Dsl.Docs as DslDocs-import qualified Hydra.Dsl.Error.Checking as ErrorChecking-import qualified Hydra.Dsl.Error.Core as DslErrorCore-import qualified Hydra.Dsl.Error.File as DslErrorFile-import qualified Hydra.Dsl.Error.Packaging as DslErrorPackaging-import qualified Hydra.Dsl.Error.System as DslErrorSystem-import qualified Hydra.Dsl.Errors as DslErrors-import qualified Hydra.Dsl.File as DslFile-import qualified Hydra.Dsl.Graph as DslGraph-import qualified Hydra.Dsl.Json.Model as JsonModel-import qualified Hydra.Dsl.Packaging as DslPackaging-import qualified Hydra.Dsl.Parsing as DslParsing-import qualified Hydra.Dsl.Paths as DslPaths-import qualified Hydra.Dsl.Query as DslQuery-import qualified Hydra.Dsl.Regex as DslRegex-import qualified Hydra.Dsl.Relational as DslRelational-import qualified Hydra.Dsl.System as DslSystem-import qualified Hydra.Dsl.Tabular as DslTabular-import qualified Hydra.Dsl.Testing as DslTesting-import qualified Hydra.Dsl.Time as DslTime-import qualified Hydra.Dsl.Topology as DslTopology-import qualified Hydra.Dsl.Typing as DslTyping-import qualified Hydra.Dsl.Util as DslUtil-import qualified Hydra.Dsl.Validation as DslValidation-import qualified Hydra.Dsl.Variants as DslVariants-import qualified Hydra.Error.Checking as Checking-import qualified Hydra.Error.Core as ErrorCore-import qualified Hydra.Error.File as ErrorFile-import qualified Hydra.Error.Packaging as ErrorPackaging-import qualified Hydra.Error.System as ErrorSystem-import qualified Hydra.Errors as Errors-import qualified Hydra.File as File-import qualified Hydra.Graph as Graph-import qualified Hydra.Json.Model as Model-import qualified Hydra.Packaging as Packaging-import qualified Hydra.Parsing as Parsing-import qualified Hydra.Paths as Paths-import qualified Hydra.Query as Query-import qualified Hydra.Regex as Regex-import qualified Hydra.Relational as Relational-import qualified Hydra.System as System-import qualified Hydra.Tabular as Tabular-import qualified Hydra.Testing as Testing-import qualified Hydra.Time as Time-import qualified Hydra.Topology as Topology-import qualified Hydra.Typed as Typed-import qualified Hydra.Typing as Typing-import qualified Hydra.Util as Util-import qualified Hydra.Validation as Validation-import qualified Hydra.Variants as Variants-import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)-import qualified Data.Scientific as Sci-import Data.Void-import qualified Data.Set as S---- | DSL reference to hydra.lib.eithers.apply-apply :: Typed.TypedTerm (Either x (y -> z)) -> Typed.TypedTerm (Either x y) -> Typed.TypedTerm (Either x z)-apply ef ex =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.eithers.apply")),- Core.applicationArgument = (Typed.unTypedTerm ef)})),- Core.applicationArgument = (Typed.unTypedTerm ex)}))---- | DSL reference to hydra.lib.eithers.bimap-bimap :: Typed.TypedTerm (x -> z) -> Typed.TypedTerm (y -> w) -> Typed.TypedTerm (Either x y) -> Typed.TypedTerm (Either z w)-bimap f g e =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.eithers.bimap")),- Core.applicationArgument = (Typed.unTypedTerm f)})),- Core.applicationArgument = (Typed.unTypedTerm g)})),- Core.applicationArgument = (Typed.unTypedTerm e)}))---- | DSL reference to hydra.lib.eithers.bind-bind :: Typed.TypedTerm (Either x y) -> Typed.TypedTerm (y -> Either x z) -> Typed.TypedTerm (Either x z)-bind e f =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.eithers.bind")),- Core.applicationArgument = (Typed.unTypedTerm e)})),- Core.applicationArgument = (Typed.unTypedTerm f)}))---- | DSL reference to hydra.lib.eithers.compose-compose :: Typed.TypedTerm (x -> Either w y) -> Typed.TypedTerm (y -> Either w z) -> Typed.TypedTerm x -> Typed.TypedTerm (Either w z)-compose f g x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.eithers.compose")),- Core.applicationArgument = (Typed.unTypedTerm f)})),- Core.applicationArgument = (Typed.unTypedTerm g)})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL reference to hydra.lib.eithers.either-either :: Typed.TypedTerm (x -> z) -> Typed.TypedTerm (y -> z) -> Typed.TypedTerm (Either x y) -> Typed.TypedTerm z-either f g e =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.eithers.either")),- Core.applicationArgument = (Typed.unTypedTerm f)})),- Core.applicationArgument = (Typed.unTypedTerm g)})),- Core.applicationArgument = (Typed.unTypedTerm e)}))---- | DSL reference to hydra.lib.eithers.foldList-foldList :: Typed.TypedTerm (x -> y -> Either z x) -> Typed.TypedTerm x -> Typed.TypedTerm [y] -> Typed.TypedTerm (Either z x)-foldList f acc0 xs =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.eithers.foldList")),- Core.applicationArgument = (Typed.unTypedTerm f)})),- Core.applicationArgument = (Typed.unTypedTerm acc0)})),- Core.applicationArgument = (Typed.unTypedTerm xs)}))---- | DSL reference to hydra.lib.eithers.isLeft-isLeft :: Typed.TypedTerm (Either x y) -> Typed.TypedTerm Bool-isLeft e =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.eithers.isLeft")),- Core.applicationArgument = (Typed.unTypedTerm e)}))---- | DSL reference to hydra.lib.eithers.isRight-isRight :: Typed.TypedTerm (Either x y) -> Typed.TypedTerm Bool-isRight e =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.eithers.isRight")),- Core.applicationArgument = (Typed.unTypedTerm e)}))---- | DSL reference to hydra.lib.eithers.left-left :: Typed.TypedTerm x -> Typed.TypedTerm (Either x y)-left x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.eithers.left")),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL reference to hydra.lib.eithers.lefts-lefts :: Typed.TypedTerm [Either x y] -> Typed.TypedTerm [x]-lefts xs =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.eithers.lefts")),- Core.applicationArgument = (Typed.unTypedTerm xs)}))---- | DSL reference to hydra.lib.eithers.map-map :: Typed.TypedTerm (x -> y) -> Typed.TypedTerm (Either z x) -> Typed.TypedTerm (Either z y)-map f e =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.eithers.map")),- Core.applicationArgument = (Typed.unTypedTerm f)})),- Core.applicationArgument = (Typed.unTypedTerm e)}))---- | DSL reference to hydra.lib.eithers.mapList-mapList :: Typed.TypedTerm (x -> Either z y) -> Typed.TypedTerm [x] -> Typed.TypedTerm (Either z [y])-mapList f xs =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.eithers.mapList")),- Core.applicationArgument = (Typed.unTypedTerm f)})),- Core.applicationArgument = (Typed.unTypedTerm xs)}))---- | DSL reference to hydra.lib.eithers.mapOptional-mapOptional :: Typed.TypedTerm (x -> Either z y) -> Typed.TypedTerm (Maybe x) -> Typed.TypedTerm (Either z (Maybe y))-mapOptional f m =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.eithers.mapOptional")),- Core.applicationArgument = (Typed.unTypedTerm f)})),- Core.applicationArgument = (Typed.unTypedTerm m)}))---- | DSL reference to hydra.lib.eithers.mapSet-mapSet :: Typed.TypedTerm (x -> Either z y) -> Typed.TypedTerm (S.Set x) -> Typed.TypedTerm (Either z (S.Set y))-mapSet f s =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.eithers.mapSet")),- Core.applicationArgument = (Typed.unTypedTerm f)})),- Core.applicationArgument = (Typed.unTypedTerm s)}))---- | DSL reference to hydra.lib.eithers.partition-partition :: Typed.TypedTerm [Either x y] -> Typed.TypedTerm ([x], [y])-partition xs =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.eithers.partition")),- Core.applicationArgument = (Typed.unTypedTerm xs)}))---- | DSL reference to hydra.lib.eithers.right-right :: Typed.TypedTerm y -> Typed.TypedTerm (Either x y)-right x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.eithers.right")),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL reference to hydra.lib.eithers.rights-rights :: Typed.TypedTerm [Either x y] -> Typed.TypedTerm [y]-rights xs =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.eithers.rights")),- Core.applicationArgument = (Typed.unTypedTerm xs)}))
@@ -1,84 +0,0 @@--- Note: this is an automatically generated file. Do not edit.---- | DSL functions for hydra.lib.equality--module Hydra.Dsl.Lib.Equality where--import qualified Hydra.Ast as Ast-import qualified Hydra.Coders as Coders-import qualified Hydra.Core as Core-import qualified Hydra.Docs as Docs-import qualified Hydra.Dsl.Ast as DslAst-import qualified Hydra.Dsl.Coders as DslCoders-import qualified Hydra.Dsl.Core as DslCore-import qualified Hydra.Dsl.Docs as DslDocs-import qualified Hydra.Dsl.Error.Checking as ErrorChecking-import qualified Hydra.Dsl.Error.Core as DslErrorCore-import qualified Hydra.Dsl.Error.File as DslErrorFile-import qualified Hydra.Dsl.Error.Packaging as DslErrorPackaging-import qualified Hydra.Dsl.Error.System as DslErrorSystem-import qualified Hydra.Dsl.Errors as DslErrors-import qualified Hydra.Dsl.File as DslFile-import qualified Hydra.Dsl.Graph as DslGraph-import qualified Hydra.Dsl.Json.Model as JsonModel-import qualified Hydra.Dsl.Packaging as DslPackaging-import qualified Hydra.Dsl.Parsing as DslParsing-import qualified Hydra.Dsl.Paths as DslPaths-import qualified Hydra.Dsl.Query as DslQuery-import qualified Hydra.Dsl.Regex as DslRegex-import qualified Hydra.Dsl.Relational as DslRelational-import qualified Hydra.Dsl.System as DslSystem-import qualified Hydra.Dsl.Tabular as DslTabular-import qualified Hydra.Dsl.Testing as DslTesting-import qualified Hydra.Dsl.Time as DslTime-import qualified Hydra.Dsl.Topology as DslTopology-import qualified Hydra.Dsl.Typing as DslTyping-import qualified Hydra.Dsl.Util as DslUtil-import qualified Hydra.Dsl.Validation as DslValidation-import qualified Hydra.Dsl.Variants as DslVariants-import qualified Hydra.Error.Checking as Checking-import qualified Hydra.Error.Core as ErrorCore-import qualified Hydra.Error.File as ErrorFile-import qualified Hydra.Error.Packaging as ErrorPackaging-import qualified Hydra.Error.System as ErrorSystem-import qualified Hydra.Errors as Errors-import qualified Hydra.File as File-import qualified Hydra.Graph as Graph-import qualified Hydra.Json.Model as Model-import qualified Hydra.Packaging as Packaging-import qualified Hydra.Parsing as Parsing-import qualified Hydra.Paths as Paths-import qualified Hydra.Query as Query-import qualified Hydra.Regex as Regex-import qualified Hydra.Relational as Relational-import qualified Hydra.System as System-import qualified Hydra.Tabular as Tabular-import qualified Hydra.Testing as Testing-import qualified Hydra.Time as Time-import qualified Hydra.Topology as Topology-import qualified Hydra.Typed as Typed-import qualified Hydra.Typing as Typing-import qualified Hydra.Util as Util-import qualified Hydra.Validation as Validation-import qualified Hydra.Variants as Variants-import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)-import qualified Data.Scientific as Sci-import Data.Void---- | DSL reference to hydra.lib.equality.equal-equal :: Typed.TypedTerm x -> Typed.TypedTerm x -> Typed.TypedTerm Bool-equal x y =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.equality.equal")),- Core.applicationArgument = (Typed.unTypedTerm x)})),- Core.applicationArgument = (Typed.unTypedTerm y)}))---- | DSL reference to hydra.lib.equality.notEqual-notEqual :: Typed.TypedTerm x -> Typed.TypedTerm x -> Typed.TypedTerm Bool-notEqual x y =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.equality.notEqual")),- Core.applicationArgument = (Typed.unTypedTerm x)})),- Core.applicationArgument = (Typed.unTypedTerm y)}))
@@ -1,176 +0,0 @@--- Note: this is an automatically generated file. Do not edit.---- | DSL functions for hydra.lib.files--module Hydra.Dsl.Lib.Files where--import qualified Hydra.Ast as Ast-import qualified Hydra.Coders as Coders-import qualified Hydra.Core as Core-import qualified Hydra.Docs as Docs-import qualified Hydra.Dsl.Ast as DslAst-import qualified Hydra.Dsl.Coders as DslCoders-import qualified Hydra.Dsl.Core as DslCore-import qualified Hydra.Dsl.Docs as DslDocs-import qualified Hydra.Dsl.Error.Checking as ErrorChecking-import qualified Hydra.Dsl.Error.Core as DslErrorCore-import qualified Hydra.Dsl.Error.File as DslErrorFile-import qualified Hydra.Dsl.Error.Packaging as DslErrorPackaging-import qualified Hydra.Dsl.Error.System as DslErrorSystem-import qualified Hydra.Dsl.Errors as DslErrors-import qualified Hydra.Dsl.File as DslFile-import qualified Hydra.Dsl.Graph as DslGraph-import qualified Hydra.Dsl.Json.Model as JsonModel-import qualified Hydra.Dsl.Packaging as DslPackaging-import qualified Hydra.Dsl.Parsing as DslParsing-import qualified Hydra.Dsl.Paths as DslPaths-import qualified Hydra.Dsl.Query as DslQuery-import qualified Hydra.Dsl.Regex as DslRegex-import qualified Hydra.Dsl.Relational as DslRelational-import qualified Hydra.Dsl.System as DslSystem-import qualified Hydra.Dsl.Tabular as DslTabular-import qualified Hydra.Dsl.Testing as DslTesting-import qualified Hydra.Dsl.Time as DslTime-import qualified Hydra.Dsl.Topology as DslTopology-import qualified Hydra.Dsl.Typing as DslTyping-import qualified Hydra.Dsl.Util as DslUtil-import qualified Hydra.Dsl.Validation as DslValidation-import qualified Hydra.Dsl.Variants as DslVariants-import qualified Hydra.Error.Checking as Checking-import qualified Hydra.Error.Core as ErrorCore-import qualified Hydra.Error.File as ErrorFile-import qualified Hydra.Error.Packaging as ErrorPackaging-import qualified Hydra.Error.System as ErrorSystem-import qualified Hydra.Errors as Errors-import qualified Hydra.File as File-import qualified Hydra.Graph as Graph-import qualified Hydra.Json.Model as Model-import qualified Hydra.Packaging as Packaging-import qualified Hydra.Parsing as Parsing-import qualified Hydra.Paths as Paths-import qualified Hydra.Query as Query-import qualified Hydra.Regex as Regex-import qualified Hydra.Relational as Relational-import qualified Hydra.System as System-import qualified Hydra.Tabular as Tabular-import qualified Hydra.Testing as Testing-import qualified Hydra.Time as Time-import qualified Hydra.Topology as Topology-import qualified Hydra.Typed as Typed-import qualified Hydra.Typing as Typing-import qualified Hydra.Util as Util-import qualified Hydra.Validation as Validation-import qualified Hydra.Variants as Variants-import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)-import qualified Data.Scientific as Sci-import Data.Void-import qualified Data.ByteString as B---- | DSL reference to hydra.lib.files.appendFile-appendFile :: Typed.TypedTerm File.FilePath -> Typed.TypedTerm B.ByteString -> Typed.TypedTerm (IO (Either ErrorFile.FileError ()))-appendFile path contents =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.files.appendFile")),- Core.applicationArgument = (Typed.unTypedTerm path)})),- Core.applicationArgument = (Typed.unTypedTerm contents)}))---- | DSL reference to hydra.lib.files.copy-copy :: Typed.TypedTerm Bool -> Typed.TypedTerm File.FilePath -> Typed.TypedTerm File.FilePath -> Typed.TypedTerm (IO (Either ErrorFile.FileError ()))-copy recursive source destination =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.files.copy")),- Core.applicationArgument = (Typed.unTypedTerm recursive)})),- Core.applicationArgument = (Typed.unTypedTerm source)})),- Core.applicationArgument = (Typed.unTypedTerm destination)}))---- | DSL reference to hydra.lib.files.createDirectory-createDirectory :: Typed.TypedTerm Bool -> Typed.TypedTerm File.FilePath -> Typed.TypedTerm (IO (Either ErrorFile.FileError ()))-createDirectory recursive path =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.files.createDirectory")),- Core.applicationArgument = (Typed.unTypedTerm recursive)})),- Core.applicationArgument = (Typed.unTypedTerm path)}))---- | DSL reference to hydra.lib.files.createSymlink-createSymlink :: Typed.TypedTerm File.FilePath -> Typed.TypedTerm File.FilePath -> Typed.TypedTerm (IO (Either ErrorFile.FileError ()))-createSymlink target link =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.files.createSymlink")),- Core.applicationArgument = (Typed.unTypedTerm target)})),- Core.applicationArgument = (Typed.unTypedTerm link)}))---- | DSL reference to hydra.lib.files.exists-exists :: Typed.TypedTerm File.FilePath -> Typed.TypedTerm (IO (Either ErrorFile.FileError Bool))-exists path =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.files.exists")),- Core.applicationArgument = (Typed.unTypedTerm path)}))---- | DSL reference to hydra.lib.files.listDirectory-listDirectory :: Typed.TypedTerm File.FilePath -> Typed.TypedTerm (IO (Either ErrorFile.FileError [File.FilePath]))-listDirectory path =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.files.listDirectory")),- Core.applicationArgument = (Typed.unTypedTerm path)}))---- | DSL reference to hydra.lib.files.readFile-readFile :: Typed.TypedTerm File.FilePath -> Typed.TypedTerm (IO (Either ErrorFile.FileError B.ByteString))-readFile path =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.files.readFile")),- Core.applicationArgument = (Typed.unTypedTerm path)}))---- | DSL reference to hydra.lib.files.readSymlink-readSymlink :: Typed.TypedTerm File.FilePath -> Typed.TypedTerm (IO (Either ErrorFile.FileError File.FilePath))-readSymlink path =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.files.readSymlink")),- Core.applicationArgument = (Typed.unTypedTerm path)}))---- | DSL reference to hydra.lib.files.removeDirectory-removeDirectory :: Typed.TypedTerm Bool -> Typed.TypedTerm File.FilePath -> Typed.TypedTerm (IO (Either ErrorFile.FileError ()))-removeDirectory recursive path =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.files.removeDirectory")),- Core.applicationArgument = (Typed.unTypedTerm recursive)})),- Core.applicationArgument = (Typed.unTypedTerm path)}))---- | DSL reference to hydra.lib.files.removeFile-removeFile :: Typed.TypedTerm File.FilePath -> Typed.TypedTerm (IO (Either ErrorFile.FileError ()))-removeFile path =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.files.removeFile")),- Core.applicationArgument = (Typed.unTypedTerm path)}))---- | DSL reference to hydra.lib.files.rename-rename :: Typed.TypedTerm File.FilePath -> Typed.TypedTerm File.FilePath -> Typed.TypedTerm (IO (Either ErrorFile.FileError ()))-rename source destination =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.files.rename")),- Core.applicationArgument = (Typed.unTypedTerm source)})),- Core.applicationArgument = (Typed.unTypedTerm destination)}))---- | DSL reference to hydra.lib.files.status-status :: Typed.TypedTerm Bool -> Typed.TypedTerm File.FilePath -> Typed.TypedTerm (IO (Either ErrorFile.FileError File.FileStatus))-status followLinks path =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.files.status")),- Core.applicationArgument = (Typed.unTypedTerm followLinks)})),- Core.applicationArgument = (Typed.unTypedTerm path)}))---- | DSL reference to hydra.lib.files.writeFile-writeFile :: Typed.TypedTerm File.FilePath -> Typed.TypedTerm B.ByteString -> Typed.TypedTerm (IO (Either ErrorFile.FileError ()))-writeFile path contents =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.files.writeFile")),- Core.applicationArgument = (Typed.unTypedTerm path)})),- Core.applicationArgument = (Typed.unTypedTerm contents)}))
@@ -1,104 +0,0 @@--- Note: this is an automatically generated file. Do not edit.---- | DSL functions for hydra.lib.functions--module Hydra.Dsl.Lib.Functions where--import qualified Hydra.Ast as Ast-import qualified Hydra.Coders as Coders-import qualified Hydra.Core as Core-import qualified Hydra.Docs as Docs-import qualified Hydra.Dsl.Ast as DslAst-import qualified Hydra.Dsl.Coders as DslCoders-import qualified Hydra.Dsl.Core as DslCore-import qualified Hydra.Dsl.Docs as DslDocs-import qualified Hydra.Dsl.Error.Checking as ErrorChecking-import qualified Hydra.Dsl.Error.Core as DslErrorCore-import qualified Hydra.Dsl.Error.File as DslErrorFile-import qualified Hydra.Dsl.Error.Packaging as DslErrorPackaging-import qualified Hydra.Dsl.Error.System as DslErrorSystem-import qualified Hydra.Dsl.Errors as DslErrors-import qualified Hydra.Dsl.File as DslFile-import qualified Hydra.Dsl.Graph as DslGraph-import qualified Hydra.Dsl.Json.Model as JsonModel-import qualified Hydra.Dsl.Packaging as DslPackaging-import qualified Hydra.Dsl.Parsing as DslParsing-import qualified Hydra.Dsl.Paths as DslPaths-import qualified Hydra.Dsl.Query as DslQuery-import qualified Hydra.Dsl.Regex as DslRegex-import qualified Hydra.Dsl.Relational as DslRelational-import qualified Hydra.Dsl.System as DslSystem-import qualified Hydra.Dsl.Tabular as DslTabular-import qualified Hydra.Dsl.Testing as DslTesting-import qualified Hydra.Dsl.Time as DslTime-import qualified Hydra.Dsl.Topology as DslTopology-import qualified Hydra.Dsl.Typing as DslTyping-import qualified Hydra.Dsl.Util as DslUtil-import qualified Hydra.Dsl.Validation as DslValidation-import qualified Hydra.Dsl.Variants as DslVariants-import qualified Hydra.Error.Checking as Checking-import qualified Hydra.Error.Core as ErrorCore-import qualified Hydra.Error.File as ErrorFile-import qualified Hydra.Error.Packaging as ErrorPackaging-import qualified Hydra.Error.System as ErrorSystem-import qualified Hydra.Errors as Errors-import qualified Hydra.File as File-import qualified Hydra.Graph as Graph-import qualified Hydra.Json.Model as Model-import qualified Hydra.Packaging as Packaging-import qualified Hydra.Parsing as Parsing-import qualified Hydra.Paths as Paths-import qualified Hydra.Query as Query-import qualified Hydra.Regex as Regex-import qualified Hydra.Relational as Relational-import qualified Hydra.System as System-import qualified Hydra.Tabular as Tabular-import qualified Hydra.Testing as Testing-import qualified Hydra.Time as Time-import qualified Hydra.Topology as Topology-import qualified Hydra.Typed as Typed-import qualified Hydra.Typing as Typing-import qualified Hydra.Util as Util-import qualified Hydra.Validation as Validation-import qualified Hydra.Variants as Variants-import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)-import qualified Data.Scientific as Sci-import Data.Void---- | DSL reference to hydra.lib.functions.compose-compose :: Typed.TypedTerm (t2 -> t3) -> Typed.TypedTerm (t1 -> t2) -> Typed.TypedTerm t1 -> Typed.TypedTerm t3-compose g f x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.functions.compose")),- Core.applicationArgument = (Typed.unTypedTerm g)})),- Core.applicationArgument = (Typed.unTypedTerm f)})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL reference to hydra.lib.functions.const-const :: Typed.TypedTerm t1 -> Typed.TypedTerm t2 -> Typed.TypedTerm t1-const x y =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.functions.const")),- Core.applicationArgument = (Typed.unTypedTerm x)})),- Core.applicationArgument = (Typed.unTypedTerm y)}))---- | DSL reference to hydra.lib.functions.flip-flip :: Typed.TypedTerm (t1 -> t2 -> t3) -> Typed.TypedTerm t2 -> Typed.TypedTerm t1 -> Typed.TypedTerm t3-flip f x y =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.functions.flip")),- Core.applicationArgument = (Typed.unTypedTerm f)})),- Core.applicationArgument = (Typed.unTypedTerm x)})),- Core.applicationArgument = (Typed.unTypedTerm y)}))---- | DSL reference to hydra.lib.functions.identity-identity :: Typed.TypedTerm t1 -> Typed.TypedTerm t1-identity x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.functions.identity")),- Core.applicationArgument = (Typed.unTypedTerm x)}))
@@ -1,427 +0,0 @@--- Note: this is an automatically generated file. Do not edit.---- | DSL functions for hydra.lib.lists--module Hydra.Dsl.Lib.Lists where--import qualified Hydra.Ast as Ast-import qualified Hydra.Coders as Coders-import qualified Hydra.Core as Core-import qualified Hydra.Docs as Docs-import qualified Hydra.Dsl.Ast as DslAst-import qualified Hydra.Dsl.Coders as DslCoders-import qualified Hydra.Dsl.Core as DslCore-import qualified Hydra.Dsl.Docs as DslDocs-import qualified Hydra.Dsl.Error.Checking as ErrorChecking-import qualified Hydra.Dsl.Error.Core as DslErrorCore-import qualified Hydra.Dsl.Error.File as DslErrorFile-import qualified Hydra.Dsl.Error.Packaging as DslErrorPackaging-import qualified Hydra.Dsl.Error.System as DslErrorSystem-import qualified Hydra.Dsl.Errors as DslErrors-import qualified Hydra.Dsl.File as DslFile-import qualified Hydra.Dsl.Graph as DslGraph-import qualified Hydra.Dsl.Json.Model as JsonModel-import qualified Hydra.Dsl.Packaging as DslPackaging-import qualified Hydra.Dsl.Parsing as DslParsing-import qualified Hydra.Dsl.Paths as DslPaths-import qualified Hydra.Dsl.Query as DslQuery-import qualified Hydra.Dsl.Regex as DslRegex-import qualified Hydra.Dsl.Relational as DslRelational-import qualified Hydra.Dsl.System as DslSystem-import qualified Hydra.Dsl.Tabular as DslTabular-import qualified Hydra.Dsl.Testing as DslTesting-import qualified Hydra.Dsl.Time as DslTime-import qualified Hydra.Dsl.Topology as DslTopology-import qualified Hydra.Dsl.Typing as DslTyping-import qualified Hydra.Dsl.Util as DslUtil-import qualified Hydra.Dsl.Validation as DslValidation-import qualified Hydra.Dsl.Variants as DslVariants-import qualified Hydra.Error.Checking as Checking-import qualified Hydra.Error.Core as ErrorCore-import qualified Hydra.Error.File as ErrorFile-import qualified Hydra.Error.Packaging as ErrorPackaging-import qualified Hydra.Error.System as ErrorSystem-import qualified Hydra.Errors as Errors-import qualified Hydra.File as File-import qualified Hydra.Graph as Graph-import qualified Hydra.Json.Model as Model-import qualified Hydra.Packaging as Packaging-import qualified Hydra.Parsing as Parsing-import qualified Hydra.Paths as Paths-import qualified Hydra.Query as Query-import qualified Hydra.Regex as Regex-import qualified Hydra.Relational as Relational-import qualified Hydra.System as System-import qualified Hydra.Tabular as Tabular-import qualified Hydra.Testing as Testing-import qualified Hydra.Time as Time-import qualified Hydra.Topology as Topology-import qualified Hydra.Typed as Typed-import qualified Hydra.Typing as Typing-import qualified Hydra.Util as Util-import qualified Hydra.Validation as Validation-import qualified Hydra.Variants as Variants-import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)-import qualified Data.Scientific as Sci-import Data.Void-import qualified Data.Set as S---- | DSL reference to hydra.lib.lists.apply-apply :: Typed.TypedTerm [x -> y] -> Typed.TypedTerm [x] -> Typed.TypedTerm [y]-apply fs xs =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.lists.apply")),- Core.applicationArgument = (Typed.unTypedTerm fs)})),- Core.applicationArgument = (Typed.unTypedTerm xs)}))---- | DSL reference to hydra.lib.lists.at-at :: Typed.TypedTerm Int -> Typed.TypedTerm [x] -> Typed.TypedTerm (Maybe x)-at i xs =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.lists.at")),- Core.applicationArgument = (Typed.unTypedTerm i)})),- Core.applicationArgument = (Typed.unTypedTerm xs)}))---- | DSL reference to hydra.lib.lists.bind-bind :: Typed.TypedTerm [x] -> Typed.TypedTerm (x -> [y]) -> Typed.TypedTerm [y]-bind xs f =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.lists.bind")),- Core.applicationArgument = (Typed.unTypedTerm xs)})),- Core.applicationArgument = (Typed.unTypedTerm f)}))---- | DSL reference to hydra.lib.lists.compose-compose :: Typed.TypedTerm (x -> [y]) -> Typed.TypedTerm (y -> [z]) -> Typed.TypedTerm x -> Typed.TypedTerm [z]-compose f g x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.lists.compose")),- Core.applicationArgument = (Typed.unTypedTerm f)})),- Core.applicationArgument = (Typed.unTypedTerm g)})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL reference to hydra.lib.lists.concat-concat :: Typed.TypedTerm [[x]] -> Typed.TypedTerm [x]-concat xss =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.lists.concat")),- Core.applicationArgument = (Typed.unTypedTerm xss)}))---- | DSL reference to hydra.lib.lists.concat2-concat2 :: Typed.TypedTerm [x] -> Typed.TypedTerm [x] -> Typed.TypedTerm [x]-concat2 xs ys =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.lists.concat2")),- Core.applicationArgument = (Typed.unTypedTerm xs)})),- Core.applicationArgument = (Typed.unTypedTerm ys)}))---- | DSL reference to hydra.lib.lists.cons-cons :: Typed.TypedTerm x -> Typed.TypedTerm [x] -> Typed.TypedTerm [x]-cons x xs =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.lists.cons")),- Core.applicationArgument = (Typed.unTypedTerm x)})),- Core.applicationArgument = (Typed.unTypedTerm xs)}))---- | DSL reference to hydra.lib.lists.distinct-distinct :: Typed.TypedTerm [x] -> Typed.TypedTerm [x]-distinct xs =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.lists.distinct")),- Core.applicationArgument = (Typed.unTypedTerm xs)}))---- | DSL reference to hydra.lib.lists.drop-drop :: Typed.TypedTerm Int -> Typed.TypedTerm [x] -> Typed.TypedTerm [x]-drop n xs =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.lists.drop")),- Core.applicationArgument = (Typed.unTypedTerm n)})),- Core.applicationArgument = (Typed.unTypedTerm xs)}))---- | DSL reference to hydra.lib.lists.dropWhile-dropWhile :: Typed.TypedTerm (x -> Bool) -> Typed.TypedTerm [x] -> Typed.TypedTerm [x]-dropWhile p xs =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.lists.dropWhile")),- Core.applicationArgument = (Typed.unTypedTerm p)})),- Core.applicationArgument = (Typed.unTypedTerm xs)}))---- | DSL reference to hydra.lib.lists.filter-filter :: Typed.TypedTerm (x -> Bool) -> Typed.TypedTerm [x] -> Typed.TypedTerm [x]-filter p xs =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.lists.filter")),- Core.applicationArgument = (Typed.unTypedTerm p)})),- Core.applicationArgument = (Typed.unTypedTerm xs)}))---- | DSL reference to hydra.lib.lists.find-find :: Typed.TypedTerm (x -> Bool) -> Typed.TypedTerm [x] -> Typed.TypedTerm (Maybe x)-find p xs =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.lists.find")),- Core.applicationArgument = (Typed.unTypedTerm p)})),- Core.applicationArgument = (Typed.unTypedTerm xs)}))---- | DSL reference to hydra.lib.lists.foldList-foldList :: Typed.TypedTerm (x -> y -> [x]) -> Typed.TypedTerm x -> Typed.TypedTerm [y] -> Typed.TypedTerm [x]-foldList f acc0 xs =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.lists.foldList")),- Core.applicationArgument = (Typed.unTypedTerm f)})),- Core.applicationArgument = (Typed.unTypedTerm acc0)})),- Core.applicationArgument = (Typed.unTypedTerm xs)}))---- | DSL reference to hydra.lib.lists.foldl-foldl :: Typed.TypedTerm (y -> x -> y) -> Typed.TypedTerm y -> Typed.TypedTerm [x] -> Typed.TypedTerm y-foldl f acc0 xs =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.lists.foldl")),- Core.applicationArgument = (Typed.unTypedTerm f)})),- Core.applicationArgument = (Typed.unTypedTerm acc0)})),- Core.applicationArgument = (Typed.unTypedTerm xs)}))---- | DSL reference to hydra.lib.lists.foldr-foldr :: Typed.TypedTerm (x -> y -> y) -> Typed.TypedTerm y -> Typed.TypedTerm [x] -> Typed.TypedTerm y-foldr f acc0 xs =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.lists.foldr")),- Core.applicationArgument = (Typed.unTypedTerm f)})),- Core.applicationArgument = (Typed.unTypedTerm acc0)})),- Core.applicationArgument = (Typed.unTypedTerm xs)}))---- | DSL reference to hydra.lib.lists.group-group :: Typed.TypedTerm [x] -> Typed.TypedTerm [[x]]-group xs =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.lists.group")),- Core.applicationArgument = (Typed.unTypedTerm xs)}))---- | DSL reference to hydra.lib.lists.head-head :: Typed.TypedTerm [x] -> Typed.TypedTerm (Maybe x)-head xs =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.lists.head")),- Core.applicationArgument = (Typed.unTypedTerm xs)}))---- | DSL reference to hydra.lib.lists.init-init :: Typed.TypedTerm [x] -> Typed.TypedTerm (Maybe [x])-init xs =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.lists.init")),- Core.applicationArgument = (Typed.unTypedTerm xs)}))---- | DSL reference to hydra.lib.lists.intersperse-intersperse :: Typed.TypedTerm x -> Typed.TypedTerm [x] -> Typed.TypedTerm [x]-intersperse sep xs =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.lists.intersperse")),- Core.applicationArgument = (Typed.unTypedTerm sep)})),- Core.applicationArgument = (Typed.unTypedTerm xs)}))---- | DSL reference to hydra.lib.lists.isEmpty-isEmpty :: Typed.TypedTerm [x] -> Typed.TypedTerm Bool-isEmpty xs =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.lists.isEmpty")),- Core.applicationArgument = (Typed.unTypedTerm xs)}))---- | DSL reference to hydra.lib.lists.join-join :: Typed.TypedTerm [x] -> Typed.TypedTerm [[x]] -> Typed.TypedTerm [x]-join sep xss =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.lists.join")),- Core.applicationArgument = (Typed.unTypedTerm sep)})),- Core.applicationArgument = (Typed.unTypedTerm xss)}))---- | DSL reference to hydra.lib.lists.last-last :: Typed.TypedTerm [x] -> Typed.TypedTerm (Maybe x)-last xs =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.lists.last")),- Core.applicationArgument = (Typed.unTypedTerm xs)}))---- | DSL reference to hydra.lib.lists.length-length :: Typed.TypedTerm [x] -> Typed.TypedTerm Int-length xs =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.lists.length")),- Core.applicationArgument = (Typed.unTypedTerm xs)}))---- | DSL reference to hydra.lib.lists.map-map :: Typed.TypedTerm (x -> y) -> Typed.TypedTerm [x] -> Typed.TypedTerm [y]-map f xs =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.lists.map")),- Core.applicationArgument = (Typed.unTypedTerm f)})),- Core.applicationArgument = (Typed.unTypedTerm xs)}))---- | DSL reference to hydra.lib.lists.mapList-mapList :: Typed.TypedTerm (x -> [y]) -> Typed.TypedTerm [x] -> Typed.TypedTerm [[y]]-mapList f xs =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.lists.mapList")),- Core.applicationArgument = (Typed.unTypedTerm f)})),- Core.applicationArgument = (Typed.unTypedTerm xs)}))---- | DSL reference to hydra.lib.lists.mapOptional-mapOptional :: Typed.TypedTerm (x -> [y]) -> Typed.TypedTerm (Maybe x) -> Typed.TypedTerm [Maybe y]-mapOptional f m =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.lists.mapOptional")),- Core.applicationArgument = (Typed.unTypedTerm f)})),- Core.applicationArgument = (Typed.unTypedTerm m)}))---- | DSL reference to hydra.lib.lists.mapSet-mapSet :: Typed.TypedTerm (x -> [y]) -> Typed.TypedTerm (S.Set x) -> Typed.TypedTerm [S.Set y]-mapSet f s =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.lists.mapSet")),- Core.applicationArgument = (Typed.unTypedTerm f)})),- Core.applicationArgument = (Typed.unTypedTerm s)}))---- | DSL reference to hydra.lib.lists.member-member :: Typed.TypedTerm x -> Typed.TypedTerm [x] -> Typed.TypedTerm Bool-member x xs =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.lists.member")),- Core.applicationArgument = (Typed.unTypedTerm x)})),- Core.applicationArgument = (Typed.unTypedTerm xs)}))---- | DSL reference to hydra.lib.lists.partition-partition :: Typed.TypedTerm (x -> Bool) -> Typed.TypedTerm [x] -> Typed.TypedTerm ([x], [x])-partition p xs =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.lists.partition")),- Core.applicationArgument = (Typed.unTypedTerm p)})),- Core.applicationArgument = (Typed.unTypedTerm xs)}))---- | DSL reference to hydra.lib.lists.replicate-replicate :: Typed.TypedTerm Int -> Typed.TypedTerm x -> Typed.TypedTerm [x]-replicate n x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.lists.replicate")),- Core.applicationArgument = (Typed.unTypedTerm n)})),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL reference to hydra.lib.lists.reverse-reverse :: Typed.TypedTerm [x] -> Typed.TypedTerm [x]-reverse xs =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.lists.reverse")),- Core.applicationArgument = (Typed.unTypedTerm xs)}))---- | DSL reference to hydra.lib.lists.singleton-singleton :: Typed.TypedTerm x -> Typed.TypedTerm [x]-singleton x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.lists.singleton")),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL reference to hydra.lib.lists.sort-sort :: Typed.TypedTerm [x] -> Typed.TypedTerm [x]-sort xs =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.lists.sort")),- Core.applicationArgument = (Typed.unTypedTerm xs)}))---- | DSL reference to hydra.lib.lists.sortBy-sortBy :: Typed.TypedTerm (x -> y) -> Typed.TypedTerm [x] -> Typed.TypedTerm [x]-sortBy f xs =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.lists.sortBy")),- Core.applicationArgument = (Typed.unTypedTerm f)})),- Core.applicationArgument = (Typed.unTypedTerm xs)}))---- | DSL reference to hydra.lib.lists.span-span :: Typed.TypedTerm (x -> Bool) -> Typed.TypedTerm [x] -> Typed.TypedTerm ([x], [x])-span p xs =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.lists.span")),- Core.applicationArgument = (Typed.unTypedTerm p)})),- Core.applicationArgument = (Typed.unTypedTerm xs)}))---- | DSL reference to hydra.lib.lists.tail-tail :: Typed.TypedTerm [x] -> Typed.TypedTerm (Maybe [x])-tail xs =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.lists.tail")),- Core.applicationArgument = (Typed.unTypedTerm xs)}))---- | DSL reference to hydra.lib.lists.take-take :: Typed.TypedTerm Int -> Typed.TypedTerm [x] -> Typed.TypedTerm [x]-take n xs =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.lists.take")),- Core.applicationArgument = (Typed.unTypedTerm n)})),- Core.applicationArgument = (Typed.unTypedTerm xs)}))---- | DSL reference to hydra.lib.lists.takeWhile-takeWhile :: Typed.TypedTerm (x -> Bool) -> Typed.TypedTerm [x] -> Typed.TypedTerm [x]-takeWhile p xs =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.lists.takeWhile")),- Core.applicationArgument = (Typed.unTypedTerm p)})),- Core.applicationArgument = (Typed.unTypedTerm xs)}))---- | DSL reference to hydra.lib.lists.transpose-transpose :: Typed.TypedTerm [[x]] -> Typed.TypedTerm [[x]]-transpose xss =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.lists.transpose")),- Core.applicationArgument = (Typed.unTypedTerm xss)}))---- | DSL reference to hydra.lib.lists.uncons-uncons :: Typed.TypedTerm [x] -> Typed.TypedTerm (Maybe (x, [x]))-uncons xs =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.lists.uncons")),- Core.applicationArgument = (Typed.unTypedTerm xs)}))---- | DSL reference to hydra.lib.lists.zip-zip :: Typed.TypedTerm [x] -> Typed.TypedTerm [y] -> Typed.TypedTerm [(x, y)]-zip xs ys =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.lists.zip")),- Core.applicationArgument = (Typed.unTypedTerm xs)})),- Core.applicationArgument = (Typed.unTypedTerm ys)}))---- | DSL reference to hydra.lib.lists.zipWith-zipWith :: Typed.TypedTerm (x -> y -> z) -> Typed.TypedTerm [x] -> Typed.TypedTerm [y] -> Typed.TypedTerm [z]-zipWith f xs ys =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.lists.zipWith")),- Core.applicationArgument = (Typed.unTypedTerm f)})),- Core.applicationArgument = (Typed.unTypedTerm xs)})),- Core.applicationArgument = (Typed.unTypedTerm ys)}))
@@ -1,453 +0,0 @@--- Note: this is an automatically generated file. Do not edit.---- | DSL functions for hydra.lib.literals--module Hydra.Dsl.Lib.Literals where--import qualified Hydra.Ast as Ast-import qualified Hydra.Coders as Coders-import qualified Hydra.Core as Core-import qualified Hydra.Docs as Docs-import qualified Hydra.Dsl.Ast as DslAst-import qualified Hydra.Dsl.Coders as DslCoders-import qualified Hydra.Dsl.Core as DslCore-import qualified Hydra.Dsl.Docs as DslDocs-import qualified Hydra.Dsl.Error.Checking as ErrorChecking-import qualified Hydra.Dsl.Error.Core as DslErrorCore-import qualified Hydra.Dsl.Error.File as DslErrorFile-import qualified Hydra.Dsl.Error.Packaging as DslErrorPackaging-import qualified Hydra.Dsl.Error.System as DslErrorSystem-import qualified Hydra.Dsl.Errors as DslErrors-import qualified Hydra.Dsl.File as DslFile-import qualified Hydra.Dsl.Graph as DslGraph-import qualified Hydra.Dsl.Json.Model as JsonModel-import qualified Hydra.Dsl.Packaging as DslPackaging-import qualified Hydra.Dsl.Parsing as DslParsing-import qualified Hydra.Dsl.Paths as DslPaths-import qualified Hydra.Dsl.Query as DslQuery-import qualified Hydra.Dsl.Regex as DslRegex-import qualified Hydra.Dsl.Relational as DslRelational-import qualified Hydra.Dsl.System as DslSystem-import qualified Hydra.Dsl.Tabular as DslTabular-import qualified Hydra.Dsl.Testing as DslTesting-import qualified Hydra.Dsl.Time as DslTime-import qualified Hydra.Dsl.Topology as DslTopology-import qualified Hydra.Dsl.Typing as DslTyping-import qualified Hydra.Dsl.Util as DslUtil-import qualified Hydra.Dsl.Validation as DslValidation-import qualified Hydra.Dsl.Variants as DslVariants-import qualified Hydra.Error.Checking as Checking-import qualified Hydra.Error.Core as ErrorCore-import qualified Hydra.Error.File as ErrorFile-import qualified Hydra.Error.Packaging as ErrorPackaging-import qualified Hydra.Error.System as ErrorSystem-import qualified Hydra.Errors as Errors-import qualified Hydra.File as File-import qualified Hydra.Graph as Graph-import qualified Hydra.Json.Model as Model-import qualified Hydra.Packaging as Packaging-import qualified Hydra.Parsing as Parsing-import qualified Hydra.Paths as Paths-import qualified Hydra.Query as Query-import qualified Hydra.Regex as Regex-import qualified Hydra.Relational as Relational-import qualified Hydra.System as System-import qualified Hydra.Tabular as Tabular-import qualified Hydra.Testing as Testing-import qualified Hydra.Time as Time-import qualified Hydra.Topology as Topology-import qualified Hydra.Typed as Typed-import qualified Hydra.Typing as Typing-import qualified Hydra.Util as Util-import qualified Hydra.Validation as Validation-import qualified Hydra.Variants as Variants-import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)-import qualified Data.Scientific as Sci-import Data.Void-import qualified Data.ByteString as B-import qualified Data.Int as I---- | DSL reference to hydra.lib.literals.base64ToBinary-base64ToBinary :: Typed.TypedTerm String -> Typed.TypedTerm B.ByteString-base64ToBinary s =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.base64ToBinary")),- Core.applicationArgument = (Typed.unTypedTerm s)}))---- | DSL reference to hydra.lib.literals.bigintToDecimal-bigintToDecimal :: Typed.TypedTerm Integer -> Typed.TypedTerm Sci.Scientific-bigintToDecimal x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.bigintToDecimal")),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL reference to hydra.lib.literals.bigintToInt16-bigintToInt16 :: Typed.TypedTerm Integer -> Typed.TypedTerm I.Int16-bigintToInt16 x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.bigintToInt16")),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL reference to hydra.lib.literals.bigintToInt32-bigintToInt32 :: Typed.TypedTerm Integer -> Typed.TypedTerm Int-bigintToInt32 x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.bigintToInt32")),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL reference to hydra.lib.literals.bigintToInt64-bigintToInt64 :: Typed.TypedTerm Integer -> Typed.TypedTerm I.Int64-bigintToInt64 x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.bigintToInt64")),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL reference to hydra.lib.literals.bigintToInt8-bigintToInt8 :: Typed.TypedTerm Integer -> Typed.TypedTerm I.Int8-bigintToInt8 x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.bigintToInt8")),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL reference to hydra.lib.literals.bigintToUint16-bigintToUint16 :: Typed.TypedTerm Integer -> Typed.TypedTerm Int-bigintToUint16 x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.bigintToUint16")),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL reference to hydra.lib.literals.bigintToUint32-bigintToUint32 :: Typed.TypedTerm Integer -> Typed.TypedTerm I.Int64-bigintToUint32 x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.bigintToUint32")),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL reference to hydra.lib.literals.bigintToUint64-bigintToUint64 :: Typed.TypedTerm Integer -> Typed.TypedTerm Integer-bigintToUint64 x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.bigintToUint64")),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL reference to hydra.lib.literals.bigintToUint8-bigintToUint8 :: Typed.TypedTerm Integer -> Typed.TypedTerm I.Int16-bigintToUint8 x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.bigintToUint8")),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL reference to hydra.lib.literals.binaryToBase64-binaryToBase64 :: Typed.TypedTerm B.ByteString -> Typed.TypedTerm String-binaryToBase64 b =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.binaryToBase64")),- Core.applicationArgument = (Typed.unTypedTerm b)}))---- | DSL reference to hydra.lib.literals.binaryToBytes-binaryToBytes :: Typed.TypedTerm B.ByteString -> Typed.TypedTerm [Int]-binaryToBytes b =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.binaryToBytes")),- Core.applicationArgument = (Typed.unTypedTerm b)}))---- | DSL reference to hydra.lib.literals.decimalToBigint-decimalToBigint :: Typed.TypedTerm Sci.Scientific -> Typed.TypedTerm Integer-decimalToBigint x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.decimalToBigint")),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL reference to hydra.lib.literals.decimalToFloat32-decimalToFloat32 :: Typed.TypedTerm Sci.Scientific -> Typed.TypedTerm Float-decimalToFloat32 x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.decimalToFloat32")),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL reference to hydra.lib.literals.decimalToFloat64-decimalToFloat64 :: Typed.TypedTerm Sci.Scientific -> Typed.TypedTerm Double-decimalToFloat64 x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.decimalToFloat64")),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL reference to hydra.lib.literals.float32ToDecimal-float32ToDecimal :: Typed.TypedTerm Float -> Typed.TypedTerm Sci.Scientific-float32ToDecimal x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.float32ToDecimal")),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL reference to hydra.lib.literals.float32ToFloat64-float32ToFloat64 :: Typed.TypedTerm Float -> Typed.TypedTerm Double-float32ToFloat64 x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.float32ToFloat64")),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL reference to hydra.lib.literals.float64ToDecimal-float64ToDecimal :: Typed.TypedTerm Double -> Typed.TypedTerm Sci.Scientific-float64ToDecimal x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.float64ToDecimal")),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL reference to hydra.lib.literals.float64ToFloat32-float64ToFloat32 :: Typed.TypedTerm Double -> Typed.TypedTerm Float-float64ToFloat32 x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.float64ToFloat32")),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL reference to hydra.lib.literals.int16ToBigint-int16ToBigint :: Typed.TypedTerm I.Int16 -> Typed.TypedTerm Integer-int16ToBigint x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.int16ToBigint")),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL reference to hydra.lib.literals.int32ToBigint-int32ToBigint :: Typed.TypedTerm Int -> Typed.TypedTerm Integer-int32ToBigint x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.int32ToBigint")),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL reference to hydra.lib.literals.int64ToBigint-int64ToBigint :: Typed.TypedTerm I.Int64 -> Typed.TypedTerm Integer-int64ToBigint x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.int64ToBigint")),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL reference to hydra.lib.literals.int8ToBigint-int8ToBigint :: Typed.TypedTerm I.Int8 -> Typed.TypedTerm Integer-int8ToBigint x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.int8ToBigint")),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL reference to hydra.lib.literals.parseBigint-parseBigint :: Typed.TypedTerm String -> Typed.TypedTerm (Maybe Integer)-parseBigint s =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.parseBigint")),- Core.applicationArgument = (Typed.unTypedTerm s)}))---- | DSL reference to hydra.lib.literals.parseBoolean-parseBoolean :: Typed.TypedTerm String -> Typed.TypedTerm (Maybe Bool)-parseBoolean s =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.parseBoolean")),- Core.applicationArgument = (Typed.unTypedTerm s)}))---- | DSL reference to hydra.lib.literals.parseDecimal-parseDecimal :: Typed.TypedTerm String -> Typed.TypedTerm (Maybe Sci.Scientific)-parseDecimal s =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.parseDecimal")),- Core.applicationArgument = (Typed.unTypedTerm s)}))---- | DSL reference to hydra.lib.literals.parseFloat32-parseFloat32 :: Typed.TypedTerm String -> Typed.TypedTerm (Maybe Float)-parseFloat32 s =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.parseFloat32")),- Core.applicationArgument = (Typed.unTypedTerm s)}))---- | DSL reference to hydra.lib.literals.parseFloat64-parseFloat64 :: Typed.TypedTerm String -> Typed.TypedTerm (Maybe Double)-parseFloat64 s =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.parseFloat64")),- Core.applicationArgument = (Typed.unTypedTerm s)}))---- | DSL reference to hydra.lib.literals.parseInt16-parseInt16 :: Typed.TypedTerm String -> Typed.TypedTerm (Maybe I.Int16)-parseInt16 s =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.parseInt16")),- Core.applicationArgument = (Typed.unTypedTerm s)}))---- | DSL reference to hydra.lib.literals.parseInt32-parseInt32 :: Typed.TypedTerm String -> Typed.TypedTerm (Maybe Int)-parseInt32 s =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.parseInt32")),- Core.applicationArgument = (Typed.unTypedTerm s)}))---- | DSL reference to hydra.lib.literals.parseInt64-parseInt64 :: Typed.TypedTerm String -> Typed.TypedTerm (Maybe I.Int64)-parseInt64 s =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.parseInt64")),- Core.applicationArgument = (Typed.unTypedTerm s)}))---- | DSL reference to hydra.lib.literals.parseInt8-parseInt8 :: Typed.TypedTerm String -> Typed.TypedTerm (Maybe I.Int8)-parseInt8 s =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.parseInt8")),- Core.applicationArgument = (Typed.unTypedTerm s)}))---- | DSL reference to hydra.lib.literals.parseString-parseString :: Typed.TypedTerm String -> Typed.TypedTerm (Maybe String)-parseString s =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.parseString")),- Core.applicationArgument = (Typed.unTypedTerm s)}))---- | DSL reference to hydra.lib.literals.parseUint16-parseUint16 :: Typed.TypedTerm String -> Typed.TypedTerm (Maybe Int)-parseUint16 s =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.parseUint16")),- Core.applicationArgument = (Typed.unTypedTerm s)}))---- | DSL reference to hydra.lib.literals.parseUint32-parseUint32 :: Typed.TypedTerm String -> Typed.TypedTerm (Maybe I.Int64)-parseUint32 s =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.parseUint32")),- Core.applicationArgument = (Typed.unTypedTerm s)}))---- | DSL reference to hydra.lib.literals.parseUint64-parseUint64 :: Typed.TypedTerm String -> Typed.TypedTerm (Maybe Integer)-parseUint64 s =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.parseUint64")),- Core.applicationArgument = (Typed.unTypedTerm s)}))---- | DSL reference to hydra.lib.literals.parseUint8-parseUint8 :: Typed.TypedTerm String -> Typed.TypedTerm (Maybe I.Int16)-parseUint8 s =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.parseUint8")),- Core.applicationArgument = (Typed.unTypedTerm s)}))---- | DSL reference to hydra.lib.literals.printBigint-printBigint :: Typed.TypedTerm Integer -> Typed.TypedTerm String-printBigint x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.printBigint")),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL reference to hydra.lib.literals.printBoolean-printBoolean :: Typed.TypedTerm Bool -> Typed.TypedTerm String-printBoolean b =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.printBoolean")),- Core.applicationArgument = (Typed.unTypedTerm b)}))---- | DSL reference to hydra.lib.literals.printDecimal-printDecimal :: Typed.TypedTerm Sci.Scientific -> Typed.TypedTerm String-printDecimal x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.printDecimal")),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL reference to hydra.lib.literals.printFloat32-printFloat32 :: Typed.TypedTerm Float -> Typed.TypedTerm String-printFloat32 x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.printFloat32")),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL reference to hydra.lib.literals.printFloat64-printFloat64 :: Typed.TypedTerm Double -> Typed.TypedTerm String-printFloat64 x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.printFloat64")),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL reference to hydra.lib.literals.printInt16-printInt16 :: Typed.TypedTerm I.Int16 -> Typed.TypedTerm String-printInt16 x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.printInt16")),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL reference to hydra.lib.literals.printInt32-printInt32 :: Typed.TypedTerm Int -> Typed.TypedTerm String-printInt32 x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.printInt32")),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL reference to hydra.lib.literals.printInt64-printInt64 :: Typed.TypedTerm I.Int64 -> Typed.TypedTerm String-printInt64 x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.printInt64")),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL reference to hydra.lib.literals.printInt8-printInt8 :: Typed.TypedTerm I.Int8 -> Typed.TypedTerm String-printInt8 x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.printInt8")),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL reference to hydra.lib.literals.printString-printString :: Typed.TypedTerm String -> Typed.TypedTerm String-printString s =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.printString")),- Core.applicationArgument = (Typed.unTypedTerm s)}))---- | DSL reference to hydra.lib.literals.printUint16-printUint16 :: Typed.TypedTerm Int -> Typed.TypedTerm String-printUint16 x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.printUint16")),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL reference to hydra.lib.literals.printUint32-printUint32 :: Typed.TypedTerm I.Int64 -> Typed.TypedTerm String-printUint32 x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.printUint32")),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL reference to hydra.lib.literals.printUint64-printUint64 :: Typed.TypedTerm Integer -> Typed.TypedTerm String-printUint64 x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.printUint64")),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL reference to hydra.lib.literals.printUint8-printUint8 :: Typed.TypedTerm I.Int16 -> Typed.TypedTerm String-printUint8 x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.printUint8")),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL reference to hydra.lib.literals.uint16ToBigint-uint16ToBigint :: Typed.TypedTerm Int -> Typed.TypedTerm Integer-uint16ToBigint x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.uint16ToBigint")),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL reference to hydra.lib.literals.uint32ToBigint-uint32ToBigint :: Typed.TypedTerm I.Int64 -> Typed.TypedTerm Integer-uint32ToBigint x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.uint32ToBigint")),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL reference to hydra.lib.literals.uint64ToBigint-uint64ToBigint :: Typed.TypedTerm Integer -> Typed.TypedTerm Integer-uint64ToBigint x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.uint64ToBigint")),- Core.applicationArgument = (Typed.unTypedTerm x)}))---- | DSL reference to hydra.lib.literals.uint8ToBigint-uint8ToBigint :: Typed.TypedTerm I.Int16 -> Typed.TypedTerm Integer-uint8ToBigint x =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.uint8ToBigint")),- Core.applicationArgument = (Typed.unTypedTerm x)}))
@@ -1,102 +0,0 @@--- Note: this is an automatically generated file. Do not edit.---- | DSL functions for hydra.lib.logic--module Hydra.Dsl.Lib.Logic where--import qualified Hydra.Ast as Ast-import qualified Hydra.Coders as Coders-import qualified Hydra.Core as Core-import qualified Hydra.Docs as Docs-import qualified Hydra.Dsl.Ast as DslAst-import qualified Hydra.Dsl.Coders as DslCoders-import qualified Hydra.Dsl.Core as DslCore-import qualified Hydra.Dsl.Docs as DslDocs-import qualified Hydra.Dsl.Error.Checking as ErrorChecking-import qualified Hydra.Dsl.Error.Core as DslErrorCore-import qualified Hydra.Dsl.Error.File as DslErrorFile-import qualified Hydra.Dsl.Error.Packaging as DslErrorPackaging-import qualified Hydra.Dsl.Error.System as DslErrorSystem-import qualified Hydra.Dsl.Errors as DslErrors-import qualified Hydra.Dsl.File as DslFile-import qualified Hydra.Dsl.Graph as DslGraph-import qualified Hydra.Dsl.Json.Model as JsonModel-import qualified Hydra.Dsl.Packaging as DslPackaging-import qualified Hydra.Dsl.Parsing as DslParsing-import qualified Hydra.Dsl.Paths as DslPaths-import qualified Hydra.Dsl.Query as DslQuery-import qualified Hydra.Dsl.Regex as DslRegex-import qualified Hydra.Dsl.Relational as DslRelational-import qualified Hydra.Dsl.System as DslSystem-import qualified Hydra.Dsl.Tabular as DslTabular-import qualified Hydra.Dsl.Testing as DslTesting-import qualified Hydra.Dsl.Time as DslTime-import qualified Hydra.Dsl.Topology as DslTopology-import qualified Hydra.Dsl.Typing as DslTyping-import qualified Hydra.Dsl.Util as DslUtil-import qualified Hydra.Dsl.Validation as DslValidation-import qualified Hydra.Dsl.Variants as DslVariants-import qualified Hydra.Error.Checking as Checking-import qualified Hydra.Error.Core as ErrorCore-import qualified Hydra.Error.File as ErrorFile-import qualified Hydra.Error.Packaging as ErrorPackaging-import qualified Hydra.Error.System as ErrorSystem-import qualified Hydra.Errors as Errors-import qualified Hydra.File as File-import qualified Hydra.Graph as Graph-import qualified Hydra.Json.Model as Model-import qualified Hydra.Packaging as Packaging-import qualified Hydra.Parsing as Parsing-import qualified Hydra.Paths as Paths-import qualified Hydra.Query as Query-import qualified Hydra.Regex as Regex-import qualified Hydra.Relational as Relational-import qualified Hydra.System as System-import qualified Hydra.Tabular as Tabular-import qualified Hydra.Testing as Testing-import qualified Hydra.Time as Time-import qualified Hydra.Topology as Topology-import qualified Hydra.Typed as Typed-import qualified Hydra.Typing as Typing-import qualified Hydra.Util as Util-import qualified Hydra.Validation as Validation-import qualified Hydra.Variants as Variants-import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)-import qualified Data.Scientific as Sci-import Data.Void---- | DSL reference to hydra.lib.logic.and-and :: Typed.TypedTerm Bool -> Typed.TypedTerm Bool -> Typed.TypedTerm Bool-and p q =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.logic.and")),- Core.applicationArgument = (Typed.unTypedTerm p)})),- Core.applicationArgument = (Typed.unTypedTerm q)}))---- | DSL reference to hydra.lib.logic.ifElse-ifElse :: Typed.TypedTerm Bool -> Typed.TypedTerm x -> Typed.TypedTerm x -> Typed.TypedTerm x-ifElse p t f =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.logic.ifElse")),- Core.applicationArgument = (Typed.unTypedTerm p)})),- Core.applicationArgument = (Typed.unTypedTerm t)})),- Core.applicationArgument = (Typed.unTypedTerm f)}))---- | DSL reference to hydra.lib.logic.not-not :: Typed.TypedTerm Bool -> Typed.TypedTerm Bool-not p =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.logic.not")),- Core.applicationArgument = (Typed.unTypedTerm p)}))---- | DSL reference to hydra.lib.logic.or-or :: Typed.TypedTerm Bool -> Typed.TypedTerm Bool -> Typed.TypedTerm Bool-or p q =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.logic.or")),- Core.applicationArgument = (Typed.unTypedTerm p)})),- Core.applicationArgument = (Typed.unTypedTerm q)}))
@@ -1,263 +0,0 @@--- Note: this is an automatically generated file. Do not edit.---- | DSL functions for hydra.lib.maps--module Hydra.Dsl.Lib.Maps where--import qualified Hydra.Ast as Ast-import qualified Hydra.Coders as Coders-import qualified Hydra.Core as Core-import qualified Hydra.Docs as Docs-import qualified Hydra.Dsl.Ast as DslAst-import qualified Hydra.Dsl.Coders as DslCoders-import qualified Hydra.Dsl.Core as DslCore-import qualified Hydra.Dsl.Docs as DslDocs-import qualified Hydra.Dsl.Error.Checking as ErrorChecking-import qualified Hydra.Dsl.Error.Core as DslErrorCore-import qualified Hydra.Dsl.Error.File as DslErrorFile-import qualified Hydra.Dsl.Error.Packaging as DslErrorPackaging-import qualified Hydra.Dsl.Error.System as DslErrorSystem-import qualified Hydra.Dsl.Errors as DslErrors-import qualified Hydra.Dsl.File as DslFile-import qualified Hydra.Dsl.Graph as DslGraph-import qualified Hydra.Dsl.Json.Model as JsonModel-import qualified Hydra.Dsl.Packaging as DslPackaging-import qualified Hydra.Dsl.Parsing as DslParsing-import qualified Hydra.Dsl.Paths as DslPaths-import qualified Hydra.Dsl.Query as DslQuery-import qualified Hydra.Dsl.Regex as DslRegex-import qualified Hydra.Dsl.Relational as DslRelational-import qualified Hydra.Dsl.System as DslSystem-import qualified Hydra.Dsl.Tabular as DslTabular-import qualified Hydra.Dsl.Testing as DslTesting-import qualified Hydra.Dsl.Time as DslTime-import qualified Hydra.Dsl.Topology as DslTopology-import qualified Hydra.Dsl.Typing as DslTyping-import qualified Hydra.Dsl.Util as DslUtil-import qualified Hydra.Dsl.Validation as DslValidation-import qualified Hydra.Dsl.Variants as DslVariants-import qualified Hydra.Error.Checking as Checking-import qualified Hydra.Error.Core as ErrorCore-import qualified Hydra.Error.File as ErrorFile-import qualified Hydra.Error.Packaging as ErrorPackaging-import qualified Hydra.Error.System as ErrorSystem-import qualified Hydra.Errors as Errors-import qualified Hydra.File as File-import qualified Hydra.Graph as Graph-import qualified Hydra.Json.Model as Model-import qualified Hydra.Packaging as Packaging-import qualified Hydra.Parsing as Parsing-import qualified Hydra.Paths as Paths-import qualified Hydra.Query as Query-import qualified Hydra.Regex as Regex-import qualified Hydra.Relational as Relational-import qualified Hydra.System as System-import qualified Hydra.Tabular as Tabular-import qualified Hydra.Testing as Testing-import qualified Hydra.Time as Time-import qualified Hydra.Topology as Topology-import qualified Hydra.Typed as Typed-import qualified Hydra.Typing as Typing-import qualified Hydra.Util as Util-import qualified Hydra.Validation as Validation-import qualified Hydra.Variants as Variants-import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)-import qualified Data.Scientific as Sci-import Data.Void-import qualified Data.Map as M---- | DSL reference to hydra.lib.maps.alter-alter :: Typed.TypedTerm (Maybe v -> Maybe v) -> Typed.TypedTerm k -> Typed.TypedTerm (M.Map k v) -> Typed.TypedTerm (M.Map k v)-alter f k m =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.maps.alter")),- Core.applicationArgument = (Typed.unTypedTerm f)})),- Core.applicationArgument = (Typed.unTypedTerm k)})),- Core.applicationArgument = (Typed.unTypedTerm m)}))---- | DSL reference to hydra.lib.maps.bimap-bimap :: Typed.TypedTerm (k1 -> k2) -> Typed.TypedTerm (v1 -> v2) -> Typed.TypedTerm (M.Map k1 v1) -> Typed.TypedTerm (M.Map k2 v2)-bimap fk fv m =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.maps.bimap")),- Core.applicationArgument = (Typed.unTypedTerm fk)})),- Core.applicationArgument = (Typed.unTypedTerm fv)})),- Core.applicationArgument = (Typed.unTypedTerm m)}))---- | DSL reference to hydra.lib.maps.delete-delete :: Typed.TypedTerm k -> Typed.TypedTerm (M.Map k v) -> Typed.TypedTerm (M.Map k v)-delete k m =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.maps.delete")),- Core.applicationArgument = (Typed.unTypedTerm k)})),- Core.applicationArgument = (Typed.unTypedTerm m)}))---- | DSL reference to hydra.lib.maps.difference-difference :: Typed.TypedTerm (M.Map k v) -> Typed.TypedTerm (M.Map k v) -> Typed.TypedTerm (M.Map k v)-difference m1 m2 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.maps.difference")),- Core.applicationArgument = (Typed.unTypedTerm m1)})),- Core.applicationArgument = (Typed.unTypedTerm m2)}))---- | DSL reference to hydra.lib.maps.elems-elems :: Typed.TypedTerm (M.Map k v) -> Typed.TypedTerm [v]-elems m =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.maps.elems")),- Core.applicationArgument = (Typed.unTypedTerm m)}))---- | DSL reference to hydra.lib.maps.empty-empty :: Typed.TypedTerm (M.Map k v)-empty = Typed.TypedTerm (Core.TermVariable (Core.Name "hydra.lib.maps.empty"))---- | DSL reference to hydra.lib.maps.filter-filter :: Typed.TypedTerm (v -> Bool) -> Typed.TypedTerm (M.Map k v) -> Typed.TypedTerm (M.Map k v)-filter p m =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.maps.filter")),- Core.applicationArgument = (Typed.unTypedTerm p)})),- Core.applicationArgument = (Typed.unTypedTerm m)}))---- | DSL reference to hydra.lib.maps.filterWithKey-filterWithKey :: Typed.TypedTerm (k -> v -> Bool) -> Typed.TypedTerm (M.Map k v) -> Typed.TypedTerm (M.Map k v)-filterWithKey p m =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.maps.filterWithKey")),- Core.applicationArgument = (Typed.unTypedTerm p)})),- Core.applicationArgument = (Typed.unTypedTerm m)}))---- | DSL reference to hydra.lib.maps.findWithDefault-findWithDefault :: Typed.TypedTerm v -> Typed.TypedTerm k -> Typed.TypedTerm (M.Map k v) -> Typed.TypedTerm v-findWithDefault def k m =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.maps.findWithDefault")),- Core.applicationArgument = (Typed.unTypedTerm def)})),- Core.applicationArgument = (Typed.unTypedTerm k)})),- Core.applicationArgument = (Typed.unTypedTerm m)}))---- | DSL reference to hydra.lib.maps.fromList-fromList :: Typed.TypedTerm [(k, v)] -> Typed.TypedTerm (M.Map k v)-fromList xs =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.maps.fromList")),- Core.applicationArgument = (Typed.unTypedTerm xs)}))---- | DSL reference to hydra.lib.maps.insert-insert :: Typed.TypedTerm k -> Typed.TypedTerm v -> Typed.TypedTerm (M.Map k v) -> Typed.TypedTerm (M.Map k v)-insert k v m =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.maps.insert")),- Core.applicationArgument = (Typed.unTypedTerm k)})),- Core.applicationArgument = (Typed.unTypedTerm v)})),- Core.applicationArgument = (Typed.unTypedTerm m)}))---- | DSL reference to hydra.lib.maps.intersection-intersection :: Typed.TypedTerm (M.Map k v) -> Typed.TypedTerm (M.Map k v) -> Typed.TypedTerm (M.Map k v)-intersection m1 m2 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.maps.intersection")),- Core.applicationArgument = (Typed.unTypedTerm m1)})),- Core.applicationArgument = (Typed.unTypedTerm m2)}))---- | DSL reference to hydra.lib.maps.isEmpty-isEmpty :: Typed.TypedTerm (M.Map k v) -> Typed.TypedTerm Bool-isEmpty m =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.maps.isEmpty")),- Core.applicationArgument = (Typed.unTypedTerm m)}))---- | DSL reference to hydra.lib.maps.keys-keys :: Typed.TypedTerm (M.Map k v) -> Typed.TypedTerm [k]-keys m =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.maps.keys")),- Core.applicationArgument = (Typed.unTypedTerm m)}))---- | DSL reference to hydra.lib.maps.lookup-lookup :: Typed.TypedTerm k -> Typed.TypedTerm (M.Map k v) -> Typed.TypedTerm (Maybe v)-lookup k m =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.maps.lookup")),- Core.applicationArgument = (Typed.unTypedTerm k)})),- Core.applicationArgument = (Typed.unTypedTerm m)}))---- | DSL reference to hydra.lib.maps.map-map :: Typed.TypedTerm (v1 -> v2) -> Typed.TypedTerm (M.Map k v1) -> Typed.TypedTerm (M.Map k v2)-map f m =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.maps.map")),- Core.applicationArgument = (Typed.unTypedTerm f)})),- Core.applicationArgument = (Typed.unTypedTerm m)}))---- | DSL reference to hydra.lib.maps.mapKeys-mapKeys :: Typed.TypedTerm (k1 -> k2) -> Typed.TypedTerm (M.Map k1 v) -> Typed.TypedTerm (M.Map k2 v)-mapKeys f m =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.maps.mapKeys")),- Core.applicationArgument = (Typed.unTypedTerm f)})),- Core.applicationArgument = (Typed.unTypedTerm m)}))---- | DSL reference to hydra.lib.maps.member-member :: Typed.TypedTerm k -> Typed.TypedTerm (M.Map k v) -> Typed.TypedTerm Bool-member k m =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.maps.member")),- Core.applicationArgument = (Typed.unTypedTerm k)})),- Core.applicationArgument = (Typed.unTypedTerm m)}))---- | DSL reference to hydra.lib.maps.singleton-singleton :: Typed.TypedTerm k -> Typed.TypedTerm v -> Typed.TypedTerm (M.Map k v)-singleton k v =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.maps.singleton")),- Core.applicationArgument = (Typed.unTypedTerm k)})),- Core.applicationArgument = (Typed.unTypedTerm v)}))---- | DSL reference to hydra.lib.maps.size-size :: Typed.TypedTerm (M.Map k v) -> Typed.TypedTerm Int-size m =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.maps.size")),- Core.applicationArgument = (Typed.unTypedTerm m)}))---- | DSL reference to hydra.lib.maps.toList-toList :: Typed.TypedTerm (M.Map k v) -> Typed.TypedTerm [(k, v)]-toList m =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.maps.toList")),- Core.applicationArgument = (Typed.unTypedTerm m)}))---- | DSL reference to hydra.lib.maps.union-union :: Typed.TypedTerm (M.Map k v) -> Typed.TypedTerm (M.Map k v) -> Typed.TypedTerm (M.Map k v)-union m1 m2 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.maps.union")),- Core.applicationArgument = (Typed.unTypedTerm m1)})),- Core.applicationArgument = (Typed.unTypedTerm m2)}))---- | DSL reference to hydra.lib.maps.unions-unions :: Typed.TypedTerm [M.Map k v] -> Typed.TypedTerm (M.Map k v)-unions ms =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.maps.unions")),- Core.applicationArgument = (Typed.unTypedTerm ms)}))
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff