 		}
 	}
 
-	public var index: I {
+	public var sourcePos: SourcePos<I> {
 		switch self {
-		case let .Branch(_, i, _):
-			return i
+		case let .Branch(_, sourcePos, _):
+			return sourcePos
 		}
 	}
 

	}

	private func describe(n: Int) -> String {
		let description = String(count: n, repeatedValue: "\t" as Character) + "\(index): \(reason)"
		if children.count > 0 {
			return description + "\n" + children.lazy.map { $0.describe(n + 1) }.joinWithSeparator("\n")
		}

public func describeAs<C: CollectionType, T>(name: String)(_ parser: Parser<C, T>.Function) -> Parser<C, T>.Function {
	return { input, index in
		parser(input, index).either(
			ifLeft: { Either.left(Error(reason: "\(name): \($0.reason)", sourcePos: $0.sourcePos, children: $0.children)) },
			ifRight: Either.right)
	}
}
