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

Sean/mandatory kinds #35

Merged
merged 104 commits into from
Sep 4, 2024
Merged

Sean/mandatory kinds #35

merged 104 commits into from
Sep 4, 2024

Conversation

gnumonik
Copy link
Collaborator

@gnumonik gnumonik commented May 22, 2024

This PR contains changes to the ASTs (everything after the CST) and CST->AST conversion functions which ensure that all type variables are explicitly kinded. That is: Type variables used to be

data Type a = 
 (...)
| TypeVar a Text 
(...)

And now they are:

data Type a = 
 (...)
| TypeVar a Text (Type a)
(...)

This also includes Vladimir's changes to the parser that make kind annotations mandatory at binding sites and change the syntax for Rows, such that Rows are now written with brackets:

type ARow :: Row Type 
type ARow  = [fieldA :: Int, fieldB :: String]

(This was needed to disambiguate singleton rows from type variables with kind annotations. E.g. (a :: Int) was ambiguous before the change.)


Checklist:

  • Added a file to CHANGELOG.d for this PR (see CHANGELOG.d/README.md) (Are we doing this?)
  • Added myself to CONTRIBUTORS.md (if this is my first contribution)
  • Linked any existing issues or proposals that this pull request should close
  • Updated or added relevant documentation (source comments)
  • Added a test for the contribution or a justification for the absence of tests (rewrote old tests using new syntax, added new tests for new row syntax)

gnumonik and others added 30 commits November 28, 2023 19:00
…HaP, added basic nix shell with build deps & locale config, placeholder UPLC codegen module & functions. You almost certainly need the hie.yaml and .envrc to work on this so I committed those intentionally.
…n the annotation) + reworked pretty printer to... print prettily
…e expressions, necessary for fully typing the desugared typeclass declarations
…s-wip

Sean/typed core fn.typeclasses wip
…g dictionary types, (sort of) fixed let-generalization, ported over more tests
…inery. (We're now properly *reconstructing* the types)
gnumonik and others added 24 commits May 14, 2024 21:08
…eed to distinguish between free and bound tyvars and only require annotations only in tyvar binders & free tyvars
… & small mistakes in the CST conversion rewrite
@gnumonik gnumonik requested review from klntsky and t4ccer May 28, 2024 22:20
@gnumonik gnumonik marked this pull request as ready for review May 28, 2024 22:21
C.Function -> Left $ "function types should be caught in apps"
C.Array -> pure $ TyBuiltin () (PLC.SomeTypeIn PLC.DefaultUniProtoList) -- is this wrong? do we want a SOP list? too tired to know
C.String -> pure $ TyBuiltin () (PLC.SomeTypeIn PLC.DefaultUniString)
C.Char -> pure $ TyBuiltin () (PLC.SomeTypeIn PLC.DefaultUniInteger)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does UPLC have primitives for working with Char? unicode codepoint <-> symbol stuff? It might be a good idea to remove Char completely

C.String -> pure $ TyBuiltin () (PLC.SomeTypeIn PLC.DefaultUniString)
C.Char -> pure $ TyBuiltin () (PLC.SomeTypeIn PLC.DefaultUniInteger)
C.Int -> pure $ TyBuiltin () (PLC.SomeTypeIn PLC.DefaultUniInteger)
C.Boolean -> pure $ TyBuiltin () (PLC.SomeTypeIn PLC.DefaultUniBool)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's remove Boolean

@kozross kozross merged commit 5777b4e into master Sep 4, 2024
3 of 9 checks passed
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.

None yet

4 participants