 	return pick(n - k)(lst: tl)
 }
 
-public func frequency<A>(xs: [(Int, Gen<A>)]) -> Gen<A> {
-	assert(xs.count != 0, "frequency used with empty list")
-	
-	return choose((1, sum(xs.map() { $0.0 }))) >>- { l in
-		return pick(l)(lst: xs)
-	}
-}
-
-public func elements<A>(xs: [A]) -> Gen<A> {
-	assert(xs.count != 0, "elements used with empty list")
-
-	return Gen.fmap({ i in
-		return xs[i]
-	})(choose((0, xs.count - 1)))
-}
-
-func size(k : Double)(m : Int) -> Int {
+private func size(k : Double)(m : Int) -> Int {
 	let n = Double(m)
 	return Int((log(n + 1)) * k / log(100))
 }
 
-public func growingElements<A>(xs: [A]) -> Gen<A> {
-	assert(xs.count != 0, "growingElements used with empty list")
-
-	let k = Double(xs.count)
-	return sized({ n in
-		return elements(take(max(1, size(k)(m: n)))(xs))
-	})
-}
-
-public func listOf<A>(gen: Gen<A>) -> Gen<[A]> {
-	return sized({ n in
-		return choose((0, n)) >>- { k in
-			return vectorOf(k)(gen: gen)
-		}
-	})
-}
-
-public func listOf1<A>(gen: Gen<A>) -> Gen<[A]> {
-	return sized({ n in
-		return choose((1, max(1, n))) >>- { k in
-			return vectorOf(k)(gen: gen)
-		}
-	})
-}
-
-public func vectorOf<A>(k: Int)(gen : Gen<A>) -> Gen<[A]> {
-	return sequence(Array<Gen<A>>(count: k, repeatedValue: gen))
-}

import Foundation
import Basis

private func vary<S : IntegerType>(k : S)(r: StdGen) -> StdGen {
	let s = r.split()
	var gen = ((k % 2) == 0) ? s.0 : s.1
	return (k == (k / 2)) ? gen : vary(k / 2)(r: r)
}

public func variant<A, S : IntegerType>(seed: S)(m: Gen<A>) -> Gen<A> {
	return Gen(unGen: { r in
		return { n in

	})
}

/// Constructs a Generator that only returns values that satisfy a predicate.
public func suchThat<A>(gen: Gen<A>)(p: (A -> Bool)) -> Gen<A> {
	return suchThatOptional(gen)(p) >>- ({ mx in
		switch mx {
