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
| import scala.language.higherKinds | |
| package object tag { | |
| private def cast[T, U](v: U): T = v.asInstanceOf[T] | |
| type Tag[T, +U] = {type Raw = T ; type Gag <: U } | |
| type @@[T, +U] = T with Tag[T, U] | |
| type Tagged[T, +U] = T with Tag[T, U] | |
| def tag[T, U](value:T):T @@ U = cast(value) |
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
| import scala.language.higherKinds | |
| object tag3 { | |
| private def cast[T, U](v:U):T = v.asInstanceOf[T] | |
| type Tag[T, +U] = { type Raw = T ; type Gag <: U } | |
| type @@[T, +U] = T with Tag[T, U] | |
| type Tagged[T, +U] = T with Tag[T, U] |
NewerOlder