1
import Bow
2
import SwiftCheck
3

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

6
extension Id: Arbitrary where A: Arbitrary {
7 1
    public static var arbitrary: Gen<Id<A>> {
8 1
        return A.arbitrary.map(Id.init)
9
    }
10
}
11

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

14
extension ForId: ArbitraryK {
15 1
    public static func generate<A: Arbitrary>() -> Kind<ForId, A> {
16 1
        return Id.arbitrary.generate
17
    }
18
}

Read our documentation on viewing source code .

Loading