|
Scala example source code file (ZipTest.scala)
The ZipTest.scala Scala example source code
package scalaz
import std.list._, std.tuple._, std.anyVal._
object ZipTest extends SpecLite {
"Zip.ap laziness" ! {
val F = Zip[List].ap
def undefined[A]: List[A] = sys.error("")
F.apply2(nil[Int], undefined[Int])(Tuple2.apply) must_=== Nil
F.apply3(nil[Int], undefined[Int], List(1))(Tuple3.apply) must_=== Nil
F.apply3(List(1), nil[Int], undefined[Int])(Tuple3.apply) must_=== Nil
F.tuple2(nil[Int], undefined[Int]) must_=== Nil
F.tuple3(nil[Int], undefined[Int], undefined[Int]) must_=== Nil
F.tuple3(List(1), nil[Int], undefined[Int]) must_=== Nil
}
}
Other Scala examples (source code examples)Here is a short list of links related to this Scala ZipTest.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.