 }
 
 /// Generates a Swift function from T to U.
-public struct ArrowOf<T : CoArbitrary, U : Arbitrary> : Arbitrary, Printable {
+public struct ArrowOf<T : protocol<Arbitrary, CoArbitrary>, U : Arbitrary> : Arbitrary, Printable {
 	public let getArrow : T -> U
+	private let getFun : (Fun<T, U>, U)
 
-	public init(_ arr : (T -> U)) {
+	private init(_ p : Fun<T, U>, _ d : U) {
+		self.init((p, d), abstract(p, d))
+	}
+
+	private init(_ fun : (Fun<T, U>, U), _ arr : (T -> U)) {
 		self.getArrow = arr
+		self.getFun = fun
 	}
 
 	public var description : String {
 		return "\(self.getArrow)"
 	}
 
-	private static func create(arr : (T -> U)) -> ArrowOf<T, U> {
-		return ArrowOf(arr)
-	}
-
 	public static func arbitrary() -> Gen<ArrowOf<T, U>> {
-		return promote({ T.coarbitrary($0)(U.arbitrary()) }).fmap { ArrowOf($0) }
+		return Fun<T, U>.arbitrary().bind { p in
+			return U.arbitrary().bind { d in
+				return ArrowOf(p, d)
+			}
+		}
 	}
 
 	public static func shrink(bl : ArrowOf<T, U>) -> [ArrowOf<T, U>] {

//  Copyright (c) 2015 Robert Widmann. All rights reserved.
//

internal class FunProxy<A, B, C> { }

internal class Pair<A, B, C> : FunProxy<A, B, C> {
	typealias FunType = Fun<(A, B), C>

	}
}

struct Fun<A : protocol<Arbitrary, CoArbitrary>, C : Arbitrary> {
	let p : FunProxy<A, Any, C>


