 //  Copyright (c) 2015 TypeLift. All rights reserved.
 //
 
-/// A generator for values of type A.
+/// `Gen` represents a generator for random arbitrary values of type `A`.
 ///
 /// `Gen` wraps a function that, when given a random number generator and a size, can be used to
 /// control the distribution of resultant values.  A generator relies on its size to help control
 /// aspects like the length of generated arrays and the magnitude of integral values.
 public struct Gen<A> {
+	/// The function underlying the receiver.
+	///
+	///         +--- An RNG
+	///         |         +--- The size of generated values.
+	///         |         |
+	///         v         v
 	let unGen : StdGen -> Int -> A
 
 	/// Generates a value.

	/// uses a Generator wrapping one of the values.
	public static func weighted<S : SequenceType where S.Generator.Element == (Int, A)>(xs : S) -> Gen<A> {
		return frequency(xs.map { ($0, Gen.pure($1)) })
	}
}


	public var generate : A {
		let r = newStdGen()
		return unGen(r)(30)
	}

	/// Constructs a Generator that selects a random value from the given collection and produces only
