Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved TH generation #2513

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open

Conversation

mmhat
Copy link
Collaborator

@mmhat mmhat commented Apr 19, 2023

This PR adds four new data constructors to Dhall.TH.HaskellType:

  • SingleConstructorWith and MultipleConstructorsWith are similar to their counterparts without the "With" suffix. They take an addional GenerateOptions value 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 use Data.Sequence.Seq SomeType instead 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 with Predefined this allows you to use e.g. Data.Sequence.Seq for 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.

@mmhat mmhat requested a review from Gabriella439 April 19, 2023 15:38
@mmhat
Copy link
Collaborator Author

mmhat commented Apr 19, 2023

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.

@mmhat mmhat force-pushed the improved-th-generation branch from 9a3bd92 to 45c7d88 Compare September 23, 2023 22:10
@mmhat mmhat force-pushed the improved-th-generation branch from fdba865 to 4d3ffe0 Compare November 19, 2023 15:17
@mmhat mmhat force-pushed the improved-th-generation branch from 4d3ffe0 to d3a9d13 Compare December 23, 2023 16:54
@mmhat mmhat force-pushed the improved-th-generation branch from d3a9d13 to dfa4bf5 Compare June 11, 2024 12:44
@mmhat mmhat force-pushed the improved-th-generation branch from dfa4bf5 to ddb940e Compare October 21, 2024 15:29
@winitzki
Copy link
Collaborator

Looks like Hydra builds are getting stuck again? Another PR also currently fails its Hydra build but succeeds in other tests.

@winitzki
Copy link
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?

@mmhat mmhat force-pushed the improved-th-generation branch from 5c02e66 to bc0732d Compare November 19, 2024 16:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants