{"action":"created","issue":{"url":"https://api.github.com/repos/lampepfl/dotty/issues/4108","repository_url":"https://api.github.com/repos/lampepfl/dotty","labels_url":"https://api.github.com/repos/lampepfl/dotty/issues/4108/labels{/name}","comments_url":"https://api.github.com/repos/lampepfl/dotty/issues/4108/comments","events_url":"https://api.github.com/repos/lampepfl/dotty/issues/4108/events","html_url":"https://github.com/lampepfl/dotty/pull/4108","id":304492923,"number":4108,"title":"Add kind polymorphism","user":{"login":"odersky","id":795990,"avatar_url":"https://avatars2.githubusercontent.com/u/795990?v=4","gravatar_id":"","url":"https://api.github.com/users/odersky","html_url":"https://github.com/odersky","followers_url":"https://api.github.com/users/odersky/followers","following_url":"https://api.github.com/users/odersky/following{/other_user}","gists_url":"https://api.github.com/users/odersky/gists{/gist_id}","starred_url":"https://api.github.com/users/odersky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/odersky/subscriptions","organizations_url":"https://api.github.com/users/odersky/orgs","repos_url":"https://api.github.com/users/odersky/repos","events_url":"https://api.github.com/users/odersky/events{/privacy}","received_events_url":"https://api.github.com/users/odersky/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"smarter","id":63430,"avatar_url":"https://avatars2.githubusercontent.com/u/63430?v=4","gravatar_id":"","url":"https://api.github.com/users/smarter","html_url":"https://github.com/smarter","followers_url":"https://api.github.com/users/smarter/followers","following_url":"https://api.github.com/users/smarter/following{/other_user}","gists_url":"https://api.github.com/users/smarter/gists{/gist_id}","starred_url":"https://api.github.com/users/smarter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smarter/subscriptions","organizations_url":"https://api.github.com/users/smarter/orgs","repos_url":"https://api.github.com/users/smarter/repos","events_url":"https://api.github.com/users/smarter/events{/privacy}","received_events_url":"https://api.github.com/users/smarter/received_events","type":"User","site_admin":false},"assignees":[{"login":"smarter","id":63430,"avatar_url":"https://avatars2.githubusercontent.com/u/63430?v=4","gravatar_id":"","url":"https://api.github.com/users/smarter","html_url":"https://github.com/smarter","followers_url":"https://api.github.com/users/smarter/followers","following_url":"https://api.github.com/users/smarter/following{/other_user}","gists_url":"https://api.github.com/users/smarter/gists{/gist_id}","starred_url":"https://api.github.com/users/smarter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smarter/subscriptions","organizations_url":"https://api.github.com/users/smarter/orgs","repos_url":"https://api.github.com/users/smarter/repos","events_url":"https://api.github.com/users/smarter/events{/privacy}","received_events_url":"https://api.github.com/users/smarter/received_events","type":"User","site_admin":false}],"milestone":null,"comments":62,"created_at":"2018-03-12T18:39:19Z","updated_at":"2018-03-23T15:11:34Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/lampepfl/dotty/pulls/4108","html_url":"https://github.com/lampepfl/dotty/pull/4108","diff_url":"https://github.com/lampepfl/dotty/pull/4108.diff","patch_url":"https://github.com/lampepfl/dotty/pull/4108.patch"},"body":"This is an attempt to develop a minimal type safe form of (subtype-) kind polymorphism.  At present, it's intended as a basis for discussion. @milessabin @adriaanm, others: It would be great to get your opinion.\r\n\r\nAn overview of the proposed scheme is in kind-polymorphism.md\r\n"},"comment":{"url":"https://api.github.com/repos/lampepfl/dotty/issues/comments/375697268","html_url":"https://github.com/lampepfl/dotty/pull/4108#issuecomment-375697268","issue_url":"https://api.github.com/repos/lampepfl/dotty/issues/4108","id":375697268,"user":{"login":"Blaisorblade","id":289960,"avatar_url":"https://avatars3.githubusercontent.com/u/289960?v=4","gravatar_id":"","url":"https://api.github.com/users/Blaisorblade","html_url":"https://github.com/Blaisorblade","followers_url":"https://api.github.com/users/Blaisorblade/followers","following_url":"https://api.github.com/users/Blaisorblade/following{/other_user}","gists_url":"https://api.github.com/users/Blaisorblade/gists{/gist_id}","starred_url":"https://api.github.com/users/Blaisorblade/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Blaisorblade/subscriptions","organizations_url":"https://api.github.com/users/Blaisorblade/orgs","repos_url":"https://api.github.com/users/Blaisorblade/repos","events_url":"https://api.github.com/users/Blaisorblade/events{/privacy}","received_events_url":"https://api.github.com/users/Blaisorblade/received_events","type":"User","site_admin":false},"created_at":"2018-03-23T15:11:34Z","updated_at":"2018-03-23T15:11:34Z","author_association":"CONTRIBUTOR","body":"> I'd prefer to see the flag only cover the impredicative version rather both that and the predicative version. If we're agreed that the the restriction is safe then it'd be good to be able to move it forward in Scala.\r\n\r\nMakes sense to me, but somebody would have to implement the restriction (and I don't have the needed skills yet). In fact one should spec the semantics — if you need to allow subtyping between `AnyKind`-polymorphic types, you end up with a separate subtyping lattice... I can try to think about the second part.\r\n\r\nThe best-known example of predicative polymorphism is type polymorphism in ML/Haskell98, where type arguments of polymorphic functions cannot be polymorphic types but must be monomorphic types.\r\n\r\n> if we decided that any type with an AnyKind-bounded type variable (or member) is not <: AnyKind would mean F[_ <: AnyKind] <: AnyKind can't be written, right?\r\n\r\nCorrect.\r\n\r\n> is impredicative case something like [...]\r\n\r\nThe example is simpler: consider `trait F[X <: AnyKind]; trait G[X <: AnyKind]`. Right now `F <: AnyKind` and `G <: AnyKind`, and that would be forbidden by predicative kind-polymorphism.\r\nSo, right now you can construct `F[F]` and also `G[F]`, and those applications would be forbidden as well.\r\n\r\n> in current implementation, would imprecative case be possible or not?\r\n\r\nIt'd be possible: This PR implements (under `-Ykind-polymorphism`) impredicative kind-polymorphism."}}
{"actor":{"display_login":"Blaisorblade"}}