[Experimental] Minimal support for universally quantified values.#44
Closed
TomasMikula wants to merge 1 commit intotypelevel:masterfrom
Closed
[Experimental] Minimal support for universally quantified values.#44TomasMikula wants to merge 1 commit intotypelevel:masterfrom
TomasMikula wants to merge 1 commit intotypelevel:masterfrom
Conversation
Contributor
|
Forall1, Forall2, etc is better than structural types. I think structural types are a non-starter. |
Collaborator
Author
|
Closing in favor of #54. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In type position,
is rewritten to structural type
{ def apply[A](): F[A] }In term position,
is rewritten to
Example
See more examples in tests.
Shortcomings / TODOs
Reflection (structural types)
Invocation of a method on a structural type uses reflection.
Defining a supertype like
would restrict the type constructors to the kind
* -> *, so I went with structural types. Ideas on how to both support arbitrary kinds and avoid reflection are welcome.Nested
∀sNested
∀s don't work yet:gives
not found: type ∀for the inner∀.Syntax
It would be nice if instead of
one could write
It is unlikely this will be made possible, since information about
List's type parameters is absent in this syntax tree.I can imagine this to be supported instead: