Created
June 9, 2015 12:59
-
-
Save xuwei-k/45616dddc87131c22aa0 to your computer and use it in GitHub Desktop.
functional java F1 Arbitrary
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
Welcome to Scala version 2.11.6 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_45). | |
Type in expressions to have them evaluated. | |
Type :help for more information. | |
scala> import fj._, test._ | |
import fj._ | |
import test._ | |
scala> Arbitrary.arbArray(Arbitrary.arbF(Coarbitrary.coarbInteger, Arbitrary.arbInteger)).gen.gen(100, Rand.standard).array.map(_.asInstanceOf[fj.F[Integer, Integer]]).map{f => (1 to 5).map{a => f.f(a)}} foreach println | |
Vector(36, -68, -33, 63, 98) | |
Vector(36, -68, -33, 63, 98) | |
Vector(36, -68, -33, 63, 98) | |
Vector(36, -68, -33, 63, 98) | |
Vector(36, -68, -33, 63, 98) | |
Vector(36, -68, -33, 63, 98) | |
Vector(36, -68, -33, 63, 98) | |
Vector(36, -68, -33, 63, 98) | |
Vector(36, -68, -33, 63, 98) | |
Vector(36, -68, -33, 63, 98) | |
Vector(36, -68, -33, 63, 98) | |
Vector(36, -68, -33, 63, 98) | |
Vector(36, -68, -33, 63, 98) | |
Vector(36, -68, -33, 63, 98) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment