1
import Bow
2
import SwiftCheck
3

4
extension ForEval: ArbitraryK {
5 1
    public static func generate<A: Arbitrary>() -> Kind<ForEval, A> {
6 1
        let nowGen = A.arbitrary.map(Eval.now)
7 1
        let laterGen = A.arbitrary.map { x in Eval.later { x } }
8 1
        let alwaysGen = A.arbitrary.map { x in Eval.always { x } }
9 1
        let deferGen = A.arbitrary.map { x in Eval.defer { Eval.now(x) } }
10 1
        let generated = Gen.one(of: [nowGen, laterGen, alwaysGen, deferGen]).generate
11 1
        return generated
12
    }
13
}

Read our documentation on viewing source code .

Loading