1
import Bow
2
import SwiftCheck
3

4
// MARK: Generator for Property-based Testing
5

6
extension EitherT: Arbitrary where F: ArbitraryK, A: Arbitrary, B: Arbitrary {
7 0
    public static var arbitrary: Gen<EitherT<F, A, B>> {
8 0
        return Gen.from(EitherTPartial.generate >>> EitherT.fix)
9
    }
10
}
11

12
// MARK: Instance of `ArbitraryK` for `EitherT`
13

14
extension EitherTPartial: ArbitraryK where F: ArbitraryK, L: Arbitrary {
15 1
    public static func generate<A: Arbitrary>() -> Kind<EitherTPartial<F, L>, A> {
16 1
        return EitherT(F.generate())
17
    }
18
}

Read our documentation on viewing source code .

Loading