This file contains 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
def main() = { | |
val lv: Int = 0 | |
def ld : Int = 0 | |
trait A { | |
val v: Int | |
def d : Int | |
def d0() : Int | |
val vf : () => Int | |
def df : () => Int | |
} |
This file contains 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
// This code attempts to show one way asynchronous requests can be batched in a type safe manner. | |
object BatchableRequests { | |
sealed trait Request[A] { | |
def serialize(): String | |
def deserialize(s: String): Option[(A, String)] | |
def pair[B](b: Request[B]): Request[(A, B)] = RequestPair(this, b) | |
} | |
case class RequestPair[A, B](a: Request[A], b: Request[B]) extends Request[(A, B)] { |
NewerOlder