//  Copyright © 2015 Rob Rix. All rights reserved.

extension Module {
	public static var churchPair: Module {
		let Pair = Declaration("Pair",
			type: Recur.lambda(.Type, .Type, const(.Type)),
			value: Recur.lambda(.Type, .Type, .Type) { A, B, Result in Recur.lambda(A, B, Recur.FunctionType(A, B, Result), const(Result)) })

		let pair = Declaration("pair",
			type: Recur.lambda(.Type, .Type, .Type) { A, B, Result in Recur.lambda(A, B, Recur.FunctionType(A, B, Result), const(Result)) },
			value: Recur.lambda(.Type, .Type, .Type) { A, B, Result in Recur.lambda(A, B, .FunctionType(A, B, Result)) { a, b, f in f[a, b] } })

		return Module([ churchBoolean ], [ Pair, pair ])
	}
}


import Prelude

//  Copyright © 2015 Rob Rix. All rights reserved.

extension Module {
	public static var churchPair: Module {
		let pair = Declaration("pair",
			type: Recur.lambda(.Type, .Type, .Type) { A, B, Result in Recur.lambda(A, B, Recur.FunctionType(A, B, Result), const(Result)) },
			value: Recur.lambda(.Type, .Type, .Type) { A, B, Result in Recur.lambda(A, B, .FunctionType(A, B, Result)) { a, b, f in f[a, b] } })

		return Module([ churchBoolean ], [ pair ])
	}
}


import Prelude

--- 
+++ 
@@ -2,11 +2,15 @@
 
 extension Module {
 	public static var churchPair: Module {
+		let Pair = Declaration("Pair",
+			type: Recur.lambda(.Type, .Type, const(.Type)),
+			value: Recur.lambda(.Type, .Type, .Type) { A, B, Result in Recur.lambda(A, B, Recur.FunctionType(A, B, Result), const(Result)) })
+
 		let pair = Declaration("pair",
 			type: Recur.lambda(.Type, .Type, .Type) { A, B, Result in Recur.lambda(A, B, Recur.FunctionType(A, B, Result), const(Result)) },
 			value: Recur.lambda(.Type, .Type, .Type) { A, B, Result in Recur.lambda(A, B, .FunctionType(A, B, Result)) { a, b, f in f[a, b] } })
 
-		return Module([ churchBoolean ], [ pair ])
+		return Module([ churchBoolean ], [ Pair, pair ])
 	}
 }
 
Define the type of church-encoded pairs.
