@@ -55,6 +55,7 @@ public struct Blind<A : Arbitrary> : Arbitrary, CustomStringConvertible {
5555 /// Retrieves the underlying value.
5656 public let getBlind : A
5757
58+ /// Creates a new `Blind` modifier from an underlying value.
5859 public init ( _ blind : A ) {
5960 self . getBlind = blind
6061 }
@@ -78,8 +79,9 @@ public struct Blind<A : Arbitrary> : Arbitrary, CustomStringConvertible {
7879}
7980
8081extension Blind : CoArbitrary {
81- // Take the lazy way out .
82+ /// Uses the underlying value to perturb a generator .
8283 public static func coarbitrary< C> ( _ x : Blind ) -> ( ( Gen < C > ) -> Gen < C > ) {
84+ // Take the lazy way out.
8385 return coarbitraryPrintable ( x)
8486 }
8587}
@@ -89,6 +91,7 @@ public struct Static<A : Arbitrary> : Arbitrary, CustomStringConvertible {
8991 /// Retrieves the underlying value.
9092 public let getStatic : A
9193
94+ /// Creates a new `Static` modifier from an underlying value.
9295 public init ( _ fixed : A ) {
9396 self . getStatic = fixed
9497 }
@@ -105,8 +108,9 @@ public struct Static<A : Arbitrary> : Arbitrary, CustomStringConvertible {
105108}
106109
107110extension Static : CoArbitrary {
108- // Take the lazy way out .
111+ /// Uses the underlying value to perturb a generator .
109112 public static func coarbitrary< C> ( _ x : Static ) -> ( ( Gen < C > ) -> Gen < C > ) {
113+ // Take the lazy way out.
110114 return coarbitraryPrintable ( x)
111115 }
112116}
@@ -121,6 +125,7 @@ public struct ArrayOf<A : Arbitrary> : Arbitrary, CustomStringConvertible {
121125 return ContiguousArray ( self . getArray)
122126 }
123127
128+ /// Creates a new `ArrayOf` modifier from an underlying array of values.
124129 public init ( _ array : [ A ] ) {
125130 self . getArray = array
126131 }
@@ -142,6 +147,7 @@ public struct ArrayOf<A : Arbitrary> : Arbitrary, CustomStringConvertible {
142147}
143148
144149extension ArrayOf : CoArbitrary {
150+ /// Uses the underlying array of values to perturb a generator.
145151 public static func coarbitrary< C> ( _ x : ArrayOf ) -> ( ( Gen < C > ) -> Gen < C > ) {
146152 let a = x. getArray
147153 if a. isEmpty {
@@ -162,6 +168,11 @@ public struct OrderedArrayOf<A : Arbitrary & Comparable> : Arbitrary, CustomStri
162168 return ContiguousArray ( self . getOrderedArray)
163169 }
164170
171+ /// Creates a new `OrderedArrayOf` modifier from an underlying array of
172+ /// values.
173+ ///
174+ /// The values in the array are not required to be sorted, they will
175+ /// be sorted by the initializer.
165176 public init ( _ array : [ A ] ) {
166177 self . getOrderedArray = array. sorted ( )
167178 }
@@ -188,6 +199,8 @@ public struct DictionaryOf<K : Hashable & Arbitrary, V : Arbitrary> : Arbitrary,
188199 /// Retrieves the underlying dictionary of values.
189200 public let getDictionary : Dictionary < K , V >
190201
202+ /// Creates a new `DictionaryOf` modifier from an underlying dictionary of
203+ /// key-value pairs.
191204 public init ( _ dict : Dictionary < K , V > ) {
192205 self . getDictionary = dict
193206 }
@@ -209,6 +222,7 @@ public struct DictionaryOf<K : Hashable & Arbitrary, V : Arbitrary> : Arbitrary,
209222}
210223
211224extension DictionaryOf : CoArbitrary {
225+ /// Uses the underlying array of values to perturb a generator.
212226 public static func coarbitrary< C> ( _ x : DictionaryOf ) -> ( ( Gen < C > ) -> Gen < C > ) {
213227 return Dictionary . coarbitrary ( x. getDictionary)
214228 }
@@ -219,13 +233,14 @@ public struct OptionalOf<A : Arbitrary> : Arbitrary, CustomStringConvertible {
219233 /// Retrieves the underlying optional value.
220234 public let getOptional : A ?
221235
236+ /// Creates a new `OptionalOf` modifier from an underlying `Optional` value.
222237 public init ( _ opt : A ? ) {
223238 self . getOptional = opt
224239 }
225240
226241 /// A textual representation of `self`.
227242 public var description : String {
228- return " \( self . getOptional) "
243+ return " \( String ( describing : self . getOptional) ) "
229244 }
230245
231246 /// Returns a generator for `OptionalOf` values.
@@ -240,6 +255,7 @@ public struct OptionalOf<A : Arbitrary> : Arbitrary, CustomStringConvertible {
240255}
241256
242257extension OptionalOf : CoArbitrary {
258+ /// Uses the underlying presence or lack of a value to perturb a generator.
243259 public static func coarbitrary< C> ( _ x : OptionalOf ) -> ( ( Gen < C > ) -> Gen < C > ) {
244260 if let _ = x. getOptional {
245261 return { $0. variant ( 0 ) }
@@ -253,6 +269,7 @@ public struct SetOf<A : Hashable & Arbitrary> : Arbitrary, CustomStringConvertib
253269 /// Retrieves the underlying set of values.
254270 public let getSet : Set < A >
255271
272+ /// Creates a new `SetOf` modifier from an underlying set of values.
256273 public init ( _ set : Set < A > ) {
257274 self . getSet = set
258275 }
@@ -282,6 +299,7 @@ public struct SetOf<A : Hashable & Arbitrary> : Arbitrary, CustomStringConvertib
282299}
283300
284301extension SetOf : CoArbitrary {
302+ /// Uses the underlying set of values to perturb a generator.
285303 public static func coarbitrary< C> ( _ x : SetOf ) -> ( ( Gen < C > ) -> Gen < C > ) {
286304 if x. getSet. isEmpty {
287305 return { $0. variant ( 0 ) }
@@ -384,6 +402,7 @@ public struct Large<A : RandomType & LatticeType & Integer> : Arbitrary {
384402 /// Retrieves the underlying large value.
385403 public let getLarge : A
386404
405+ /// Creates a new `Large` modifier from a given bounded integral value.
387406 public init ( _ lrg : A ) {
388407 self . getLarge = lrg
389408 }
@@ -409,6 +428,7 @@ public struct Positive<A : Arbitrary & SignedNumber> : Arbitrary, CustomStringCo
409428 /// Retrieves the underlying positive value.
410429 public let getPositive : A
411430
431+ /// Creates a new `Positive` modifier from a given signed integral value.
412432 public init ( _ pos : A ) {
413433 self . getPositive = pos
414434 }
@@ -430,8 +450,9 @@ public struct Positive<A : Arbitrary & SignedNumber> : Arbitrary, CustomStringCo
430450}
431451
432452extension Positive : CoArbitrary {
433- // Take the lazy way out .
453+ /// Uses the underlying positive integral value to perturb a generator .
434454 public static func coarbitrary< C> ( _ x : Positive ) -> ( ( Gen < C > ) -> Gen < C > ) {
455+ // Take the lazy way out.
435456 return coarbitraryPrintable ( x)
436457 }
437458}
@@ -441,6 +462,7 @@ public struct NonZero<A : Arbitrary & Integer> : Arbitrary, CustomStringConverti
441462 /// Retrieves the underlying non-zero value.
442463 public let getNonZero : A
443464
465+ /// Creates a new `NonZero` modifier from a given integral value.
444466 public init ( _ non : A ) {
445467 self . getNonZero = non
446468 }
@@ -462,6 +484,7 @@ public struct NonZero<A : Arbitrary & Integer> : Arbitrary, CustomStringConverti
462484}
463485
464486extension NonZero : CoArbitrary {
487+ /// Uses the underlying non-zero integral value to perturb a generator.
465488 public static func coarbitrary< C> ( _ x : NonZero ) -> ( ( Gen < C > ) -> Gen < C > ) {
466489 return x. getNonZero. coarbitraryIntegral ( )
467490 }
@@ -472,6 +495,7 @@ public struct NonNegative<A : Arbitrary & Integer> : Arbitrary, CustomStringConv
472495 /// Retrieves the underlying non-negative value.
473496 public let getNonNegative : A
474497
498+ /// Creates a new `NonNegative` modifier from a given integral value.
475499 public init ( _ non : A ) {
476500 self . getNonNegative = non
477501 }
@@ -493,6 +517,7 @@ public struct NonNegative<A : Arbitrary & Integer> : Arbitrary, CustomStringConv
493517}
494518
495519extension NonNegative : CoArbitrary {
520+ /// Uses the underlying non-negative integral value to perturb a generator.
496521 public static func coarbitrary< C> ( _ x : NonNegative ) -> ( ( Gen < C > ) -> Gen < C > ) {
497522 return x. getNonNegative. coarbitraryIntegral ( )
498523 }
@@ -626,7 +651,7 @@ private final class PointerOfImpl<T : Arbitrary> : Arbitrary {
626651 let size : Int
627652
628653 var description : String {
629- return " \( self . ptr) "
654+ return " \( String ( describing : self . ptr) ) "
630655 }
631656
632657 init ( _ ptr : UnsafeMutablePointer < T > , _ size : Int ) {
0 commit comments