|
Scala example source code file (LiskovTest.scala)
The LiskovTest.scala Scala example source code
package scalaz
object LiskovTest extends SpecLite {
trait Co1[+ _]
trait Contra1[- _]
trait Co1_2[+A, B]
trait Co2_2[A, +B]
trait Contra1_2[-A, B]
trait Contra2_2[A, -B]
import Liskov._
"apply" in {
implicitly[String <:< AnyRef].apply(""): AnyRef
()
}
"lift" in {
def foo[A, B](implicit ev: A <~< B) {
Liskov.co[Co1, A, B](ev)
Liskov.contra[Contra1, A, B](ev)
Liskov.co2[Co1_2, B, A, Unit](ev)
Liskov.co2_2[Co2_2, B, Unit, A](ev)
Liskov.contra1_2[Contra1_2, B, A, Unit](ev)
Liskov.contra2_2[Contra2_2, B, Unit, A](ev)
}
foo[String, AnyRef]
}
}
Other Scala examples (source code examples)Here is a short list of links related to this Scala LiskovTest.scala source code file: |
| ... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2024 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.