 
 let theStdGen : StdGen = StdGen(time(nil))
 
-public struct StdGen : RandonGen {
+public struct StdGen : RandomGen {
 	let seed: Int
 	
 	init(_ seed : Int) {


import Swiftz

public protocol RandonGen {
	func next() -> (Int, Self)
	
	func genRange() -> (Int, Int)

private func mkStdRNG(seed : Int) -> StdGen {
	return StdGen(seed)
}

public protocol RandomType {
	class func randomInRange<G : RandomGen>(range : (Self, Self), gen : G) -> (Self, G)
}

extension Int : RandomType {
	public static func randomInRange<G : RandomGen>(range : (Int, Int), gen : G) -> (Int, G) {
		let (min, max) = range
		let (r, g) = gen.next()
		let result = (r % ((max + 1) - min)) + min;
		
		return (result, g);
	}
}
