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
| /** A typeclass giving the values of an enumeration */ | |
| @implicitNotFound("Unable to find values of ${A}. Make sure it is a sealed trait and is only extended by case objects.") | |
| class Values[A](val values: Set[A]) | |
| /** | |
| * The companion object contains the machinery to automatically derive the values of a sealed trait | |
| * extended by case objects only. | |
| * | |
| * Basically, the derivation process is the following: | |
| * - we are given a sort of list containing the types of the case objects that extend a sealed trait `A` ; |
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
| object OK { | |
| trait `*`[A] | |
| trait Bar { | |
| type Qux | |
| implicit val `*`: `*`[Qux] | |
| } | |
| def foo(bar: Bar): `*`[bar.Qux] = { | |
| import bar._ |
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
| trait Iterable[A] { | |
| // https://github.com/scala/collection-strawman/issues/221 | |
| /** | |
| * Returns a collection formed by the result of applying a function to each pair of corresponding elements | |
| * from this collection and another collection. It is semantically equivalent to `(xs zip ys) map f`. | |
| * If one of the two collections is longer than the other, its remaining elements are ignored. | |
| */ | |
| def zipWith[B, C](that: Iterable[B])(f: (A, B) => C): Iterable[C] |
OlderNewer