Add Higher-Kinded Types section to Scala 2 Tour#3270
Open
Dev-CodeBox wants to merge 3 commits into
Open
Conversation
Member
|
Note that in scala/scala#5916 I've added some help message to repl scala> :k -v Option[Int]
Option[Int]'s kind is A
*
This is a proper type.
scala> :k -v Option
Option's kind is F[+A]
* -(+)-> *
This is a type constructor: a 1st-order-kinded type.
scala> trait ~>[-F1[_], +F2[_]] {}
trait $tilde$greater
scala> :kind -v ~>
~>'s kind is X[-F1[A1],+F2[A2]]
(* -> *) -(-)-> (* -> *) -(+)-> *
This is a type constructor that takes type constructor(s): a higher-kinded type. |
bishabosha
reviewed
Jan 22, 2026
| --- | ||
| layout: multipage-overview | ||
| title: Advanced Type Features | ||
| partof: scaladoc |
Member
There was a problem hiding this comment.
why is this in the Scaladoc guide and not Tour of Scala?
Contributor
Author
There was a problem hiding this comment.
Good catch, thanks! You're right, this should be part of the Tour of Scala, not Scaladoc.
I’ll move the content under _tour and update the layout accordingly.
Contributor
|
The unrelated CI failures, would be fixed in #3269, please rebase onto latest main when it's merged |
19078bd to
cf89591
Compare
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.
This PR adds a new section
Higher-Kinded Typesto the Scala 2 Tour documentation.It includes:
This addresses issue #1269 and provides simple explanations and examples for learners.