1
import Bow
2
import SwiftCheck
3

4
// MARK: Instance of `ArbitraryK` for `Day`
5

6
extension DayPartial: ArbitraryK where F: ArbitraryK, G: ArbitraryK {
7 1
    public static func generate<A: Arbitrary>() -> Kind<DayPartial<F, G>, A> {
8 1
        let left: Kind<F, A> = F.generate()
9 1
        let right: Kind<G, A> = G.generate()
10 1
        let f = (Int.arbitrary.generate % 2 == 0) ? { (x: A, _: A) in x } : { (_: A, x: A) in x }
11 1
        return Day.from(left: left, right: right, f: f)
12
    }
13
}

Read our documentation on viewing source code .

Loading