Skip to content
Discussion options

You must be logged in to vote

This works with type inference:

  fun log(value, show)
    value.show.println

or with explicit some annotations.

  fun log(value: some<a> a, show: some<a> a -> string)
    value.show.println

However, I would expect to be able to do

  fun log(value: forall<a> a, show: a -> string)
    value.show.println

And have the forall be lifted (promoted) to quantify over the full function signature instead of the single parameter (like it does for regular function definitions). This doesn't work currently. It seems like promotion is not happening for these signatures, while it does for all other signatures. I believe this is the problem with the simple annotation in the original post as well. This is…

Replies: 1 comment 6 replies

Comment options

You must be logged in to vote
6 replies
@schuelermine
Comment options

@schuelermine
Comment options

@TimWhiting
Comment options

@TimWhiting
Comment options

@schuelermine
Comment options

Answer selected by schuelermine
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants