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
| type Negate[X] = X match | |
| case String => String | |
| case Int => Int | |
| case Boolean => Boolean | |
| def negate[A](a: A): Negate[A] = a match | |
| case x: String => s"no-$x" | |
| case x: Int => -x | |
| case x: Boolean => !x | |
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
| package polyMap | |
| type Id[T] = T | |
| trait Negation[A]: | |
| def neg(a: A): A | |
| object Negation: | |
| def apply[A](using ev: Negation[A]): Negation[A] = ev |
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
| // Regular class | |
| final case class Field0[L <: String & Singleton, V](label: L, value: V) |
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
| package polycol | |
| object Displays { | |
| import PolyCol.* | |
| opaque type Display = String | |
| object Display { | |
| def apply[A: Printer](a: A): Display = a.print | |
| } |
OlderNewer