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

Nested signatures #177

Merged
merged 4 commits into from
Feb 8, 2020
Merged

Nested signatures #177

merged 4 commits into from
Feb 8, 2020

Conversation

folkertdev
Copy link
Contributor

Various fixes for type signatures

  • instantiate rigid type variables into nested signatures. That makes sure the a is actually the same rigid variable in bar as in foo.
foo : List a 
foo =
    bar : List a
    bar = Nil

    bar
  • add all symbols from patterns to var_by_symbol. Previously this only happened for identifiers, now we look into records and tags to discover all symbols.

  • optimize the pattern state headers by adding the annotation of a variable when available. So where previously we'd add x => <4> (symbol points to type variable) we could now add x => Int directly if there is an annotation x : Int.

Copy link
Sponsor Contributor

@rtfeldman rtfeldman left a comment

Choose a reason for hiding this comment

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

Looks awesome! Thanks for including a commented-out test for capitalized annotations vs aliases on this too. 👍

);
}

// #[test]
Copy link
Sponsor Contributor

Choose a reason for hiding this comment

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

Opened #178 to track this for later.


toEmpty : List a -> List a
toEmpty = \_ ->
result : List a
Copy link
Sponsor Contributor

Choose a reason for hiding this comment

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

It is SO COOL seeing this work! 😻

@rtfeldman rtfeldman merged commit 1f064d2 into trunk Feb 8, 2020
@rtfeldman rtfeldman deleted the nested-signatures branch February 8, 2020 22:17
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

2 participants