 
 	public func analysis<T>(
 		@noescape #ifKind: () -> T,
+		@noescape ifType: () -> T,
 		@noescape ifVariable: Int -> T,
 		@noescape ifApplication: (Recur, Recur) -> T,
 		@noescape ifAbstraction: (Int, Recur, Recur) -> T) -> T {
 		switch self {
 		case .Kind:
 			return ifKind()
+		case .Type:
+			return ifType()
 		case let .Variable(x):
 			return ifVariable(x)
 		case let .Application(a, b):

	private static func lambdaHelper(t: DTerm) -> (Int, Int -> DTerm) {
		return t.expression.analysis(
			ifKind: const(0, const(t)),
			ifVariable: { i in (0, { i == -1 ? self.variable($0) : t }) },
			ifApplication: { a, b in
				let (ma, builda) = lambdaHelper(a)


	public func analysis<T>(
		ifKind: (() -> T)? = nil,
		ifType: (() -> T)? = nil,
		ifVariable: (Int -> T)? = nil,
		ifApplication: ((Recur, Recur) -> T)? = nil,
		ifAbstraction: ((Int, Recur, Recur) -> T)? = nil,
		otherwise: () -> T) -> T {
		return analysis(
			ifKind: { ifKind?() ?? otherwise() },
			ifType: { ifType?() ?? otherwise() },
			ifVariable: { ifVariable?($0) ?? otherwise() },
			ifApplication: { ifApplication?($0) ?? otherwise() },
			ifAbstraction: { ifAbstraction?($0) ?? otherwise() })
