1
import Bow
2
import SwiftCheck
3

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

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

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

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

Read our documentation on viewing source code .

Loading