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

Add GenMap support in the compiler. #3437

Merged
merged 2 commits into from
Nov 13, 2019
Merged

Add GenMap support in the compiler. #3437

merged 2 commits into from
Nov 13, 2019

Conversation

ghost
Copy link

@ghost ghost commented Nov 12, 2019

This PR advances the implementation of #2256.

This PR adds all the GenMap support that should be necessary in the compiler. That includes:

  • adding a new genmap feature for LF 1.dev with the flag DAML_GENMAP
  • adding BTGenMap and BEGenMap_* to the LF AST
  • updating daml-lf-proto to encode/decode the above
  • updating the typechecker, serializability check, and simplifier
  • updating the list of primitives available during LF conversion
  • updating daml migrate to deal with the new builtin type (but still need to confirm what the type name will be in the daml-stdlib)

This PR does not update the stdlib.

@ghost ghost requested review from cocreature, hurryabit, a user and remyhaemmerle-da November 12, 2019 16:27
Copy link
Contributor

@hurryabit hurryabit left a comment

Choose a reason for hiding this comment

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

Looks very good. Thank you.

Copy link
Collaborator

@remyhaemmerle-da remyhaemmerle-da left a comment

Choose a reason for hiding this comment

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

Nice. Thank you.

Copy link
Contributor

@cocreature cocreature left a comment

Choose a reason for hiding this comment

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

Nice work, thanks a lot!

@@ -211,6 +212,14 @@ typeOfBuiltin = \case
BEMapDelete -> pure $ TForall (alpha, KStar) $ TText :-> TMap tAlpha :-> TMap tAlpha
BEMapToList -> pure $ TForall (alpha, KStar) $ TMap tAlpha :-> TList (TMapEntry tAlpha)
BEMapSize -> pure $ TForall (alpha, KStar) $ TMap tAlpha :-> TInt64
BEGenMapEmpty -> pure $ TForall (alpha, KStar) $ TForall (beta, KStar) $ TGenMap tAlpha tBeta
Copy link
Contributor

Choose a reason for hiding this comment

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

Perhaps that is nitpicking but I would find this easier to read if we called the type variables k and v or key and value.

@ghost ghost added the automerge label Nov 13, 2019
@mergify mergify bot merged commit 87de36a into master Nov 13, 2019
@mergify mergify bot deleted the genmap branch November 13, 2019 13:05
bame-da pushed a commit that referenced this pull request Nov 19, 2019
* Add GenMap support in the compiler.

* Add GenMap ticket number in Upgrade.hs
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.

3 participants