1
import Bow
2
import SwiftCheck
3

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

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

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

14
extension WriterTPartial: ArbitraryK where F: ArbitraryK & Applicative, W: Arbitrary {
15 1
    public static func generate<A: Arbitrary>() -> Kind<WriterTPartial<F, W>, A> {
16 1
        return WriterT(F.pure((W.arbitrary.generate, A.arbitrary.generate)))
17
    }
18
}

Read our documentation on viewing source code .

Loading