Skip to content

Difference between HKT and type lambda #3128

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

Closed
OlivierBlanvillain opened this issue Sep 15, 2017 · 3 comments
Closed

Difference between HKT and type lambda #3128

OlivierBlanvillain opened this issue Sep 15, 2017 · 3 comments

Comments

@OlivierBlanvillain
Copy link
Contributor

Dotty sees a difference between Option and [A] => Option[A], I think there shoudn't be:

trait Functor[F[_]]

object Functor {
  val a: Functor[Option] = ???
  val b: Functor[[A] => Option[A]] = a

  // Same result with scalac style type lambda:
  // val c: Functor[({ type l[A] = Option[A] })#l] = a
}
23 |  val b: Functor[[A] => Option[A]] = a
   |                                     ^
   |                                   found:    Functor[Option](Functor''.a)
   |                                   required: Functor[Option]
   |
   |                                   where:    Functor  is a trait
   |                                             Functor'' is a object

one error found
@smarter
Copy link
Member

smarter commented Sep 15, 2017

Duplicate of #2989

@smarter smarter marked this as a duplicate of #2989 Sep 15, 2017
@smarter smarter closed this as completed Sep 15, 2017
@smarter
Copy link
Member

smarter commented Sep 15, 2017

I'm working on a fix, but waiting for the native applied type stuff to be done before finishing it :).

@odersky
Copy link
Contributor

odersky commented Sep 17, 2017

I believe it has to do with variances. Option is [+A] => Option[A] not [A] => Option[A]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants