Improved TH generation#2513
Open
mmhat wants to merge 7 commits intodhall-lang:mainfrom
Open
Conversation
Collaborator
Author
|
The documentation is not yet as good as it could be; Please have a look at the tests that exemplify the intended use cases until the documentation improves. |
9a3bd92 to
45c7d88
Compare
fdba865 to
4d3ffe0
Compare
4d3ffe0 to
d3a9d13
Compare
d3a9d13 to
dfa4bf5
Compare
dfa4bf5 to
ddb940e
Compare
Collaborator
|
Looks like Hydra builds are getting stuck again? Another PR also currently fails its Hydra build but succeeds in other tests. |
Collaborator
|
All tests pass but Hydra build fails. The same thing is happening in another PR: #2611 I'm not sure what needs to be done; perhaps Hydra is caching a stale failed build? |
5c02e66 to
bc0732d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds four new data constructors to
Dhall.TH.HaskellType:SingleConstructorWithandMultipleConstructorsWithare similar to their counterparts without the "With" suffix. They take an addionalGenerateOptionsvalue that is used instead of the global one. They are suitable if you have some weird Dhall types which do not translate to Haskell easily and you don't want to apply the modifiers to all other generated types.Predefined: Use an existing Haskell type for a Dhall type. Suitable if you want to useData.Sequence.Seq SomeTypeinstead of[SomeType]or if you want to translate Dhall maps to Haskell maps.Scoped: Limit the scope of the lookup of other Haskell types used in the translation process. Together withPredefinedthis allows you to use e.g.Data.Sequence.Seqfor some particular types while all the others use the usual Haskell lists. It also allows you to generate two distinct Haskell types that use the same Dhall type as input.