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

SOAS package and better TH support for complex types #28

Merged
merged 31 commits into from
Oct 27, 2024
Merged

SOAS package and better TH support for complex types #28

merged 31 commits into from
Oct 27, 2024

Conversation

fizruk
Copy link
Owner

@fizruk fizruk commented Oct 23, 2024

This PR builds on top of #27.

Here SOAS package serves merely as an example of a more complex grammar/types to generate Free Foil for. Later, it should also have proper library definitions.

This PR is a reimplementation of TH generation for Free Foil, providing simultaneous definition for many types:

  • Signatures (e.g. terms and parts of terms)
  • Pattern synonyms
  • Scope wrappers
  • Bindings (e.g. patterns)
  • Quantifiers (e.g. metavar substitutions, constraints)
  • Conversion functions

What is NOT supported (and is not planned in this PR):

  • separate scope namespaces (e.g. if you put a type annotation in a term (or term pattern), it will be "dependent" in the sense that its scope will be shared/related to the term's scope); supporting separate namespaces would require more substantial change to the AST type, e.g. something like hypertypes

  • CoSinkable instances are not generated here, instead I plan to implement a generic version based on kind-generics, similarly to ZipMatchK

Note that this PR contains 1k+ LoC of Template Haskell, which means there are probably some bugs 🐞

@fizruk fizruk merged commit 97ee040 into main Oct 27, 2024
4 checks passed
@fizruk fizruk deleted the soas branch October 27, 2024 08:06
@fizruk fizruk mentioned this pull request Oct 27, 2024
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.

1 participant