 }
 
 /// Generates pointers of varying size of random values of type T.
-public final class PointerOf<T : Arbitrary> : Arbitrary {
-	private var ptr : UnsafeMutablePointer<T>
-	public let size : Int
+public struct PointerOf<T : Arbitrary> : Arbitrary, CustomStringConvertible {
+	private let _impl : PointerOfImpl<T>
 
 	public var getPointer : UnsafePointer<T> {
-		return UnsafePointer(self.ptr)
-	}
-
-	public var description : String {
-		return "\(self.ptr)"
-	}
-
-	private init(_ ptr : UnsafeMutablePointer<T>, _ size : Int) {
-		self.ptr = ptr
-		self.size = size
-	}
-
-	deinit {
-		if self.size > 0 && self.ptr != nil {
-			self.ptr.dealloc(self.size)
-			self.ptr = nil
-		}
+		return UnsafePointer(self._impl.ptr)
+	}
+
+	public var size : Int {
+		return self._impl.size
+	}
+
+	public var description : String {
+		return self._impl.description
 	}
 
 	public static var arbitrary : Gen<PointerOf<T>> {
-		return Gen.sized { n in
-			if n <= 0 {
-				return Gen.pure(PointerOf(nil, 0))
-			}
-			let pt = UnsafeMutablePointer<T>.alloc(n)
-			let gt = pt.initializeFrom <^> sequence(Array((0..<n)).map { _ in T.arbitrary })
-			return gt.fmap { _ in PointerOf(pt, n) }
-		}
+		return PointerOfImpl.arbitrary.fmap(PointerOf.init)
 	}
 }
 

	}
}

/// Generates two isomorphic Swift function from T to U and back again.
public struct IsoOf<T : protocol<Hashable, CoArbitrary, Arbitrary>, U : protocol<Equatable, CoArbitrary, Arbitrary>> : Arbitrary, CustomStringConvertible {
	private let _impl : IsoOfImpl<T, U>

	}
}

private final class PointerOfImpl<T : Arbitrary> : Arbitrary {
	var ptr : UnsafeMutablePointer<T>
	let size : Int

	var description : String {
		return "\(self.ptr)"
	}

	init(_ ptr : UnsafeMutablePointer<T>, _ size : Int) {
		self.ptr = ptr
		self.size = size
	}

	deinit {
		if self.size > 0 && self.ptr != nil {
			self.ptr.dealloc(self.size)
			self.ptr = nil
		}
	}

	static var arbitrary : Gen<PointerOfImpl<T>> {
		return Gen.sized { n in
			if n <= 0 {
				return Gen.pure(PointerOfImpl(nil, 0))
			}
			let pt = UnsafeMutablePointer<T>.alloc(n)
			let gt = pt.initializeFrom <^> sequence(Array((0..<n)).map { _ in T.arbitrary })
			return gt.fmap { _ in PointerOfImpl(pt, n) }
		}
	}
}

