 public func index<T>(s : Stream<T>) -> UInt -> T {
 	return { n in
 		if n == 0 {
-			return s.st().head
-		}
-		return index(s.st().tail)(n - 1)
+			return s.step().head
+		}
+		return index(s.step().tail)(n - 1)
 	}
 }
 
 /// Returns the first element of a Stream.
 public func head<T>(s : Stream<T>) -> T {
-	return s.st().head
+	return s.step().head
 }
 
 /// Returns the remaining elements of a Stream.
 public func tail<T>(s : Stream<T>) -> Stream<T> {
-	return s.st().tail
+	return s.step().tail
 }
 
 /// Returns a Stream of all initial segments of a Stream.
 public func inits<T>(s : Stream<T>) -> Stream<[T]> {
-	return Stream(st: ([], map({ s.st().head <| $0 })(inits(s.st().tail))))
+	return Stream(([], map({ s.step().head <| $0 })(inits(s.step().tail))))
 }
 
 /// Returns a Stream of all final segments of a Stream.
 public func tails<T>(s : Stream<T>) -> Stream<Stream<T>> {
-	return Stream(st: (s, tails(s.st().tail)))
+	return Stream((s, tails(s.step().tail)))
 }
 
 /// Repeats a value into a constant stream of that same value.
 public func repeat<T>(x : T) -> Stream<T> {
-	return Stream(st: (x, repeat(x)))
+	return Stream((x, repeat(x)))
 }
 
 /// Returns a Stream of an infinite number of iteratations of applications of a function to a value.
 public func iterate<T>(f : T -> T) -> T -> Stream<T> {
-	return { x in Stream(st: (x, iterate(f)(f(x)))) }
+	return { x in Stream((x, iterate(f)(f(x)))) }
 }
 
 /// Cycles a non-empty list into an infinite Stream of repeating values.

/// If there are no elements that satisfy this predicate this function will diverge.
public func filter<T>(p : T -> Bool) -> Stream<T> -> Stream<T> {
	return { s in 
		if p(s.st().head) {
			return Stream(st: (s.st().head, filter(p)(s.st().tail)))
		}
		return filter(p)(s.st().tail)
	}
}

/// Zips two Streams into a Stream of pairs.
public func zip<A, B>(s1 : Stream<A>) -> Stream<B> -> Stream<(A, B)> {
	return { s2 in Stream(st: ((s1.st().head, s2.st().head), zip(s1.st().tail)(s2.st().tail))) }
}

/// Zips two Streams into a third Stream using a combining function.
public func zipWith<A, B, C>(f : A -> B -> C) -> Stream<A> -> Stream<B> -> Stream<C> {
	return { s1 in { s2 in Stream(st: (f(s1.st().head)(s2.st().head), zipWith(f)(s1.st().tail)(s2.st().tail))) } }
}

/// Unzips a Stream of pairs into a pair of Streams.

public func unfold<A, B>(f : A -> (B, A)) -> A -> Stream<B> {
	return { z in  
		let (x, d) = f(z)
		return Stream((x, unfold(f)(d)))
	}
}

/// Returns a Stream of alternating elements from each Stream.
public func interleave<T>(s1 : Stream<T>) -> Stream<T> -> Stream<T> {
	return { s2 in Stream((s1.step().head, interleave(s2)(s1))) }
}

/// Creates a Stream alternating an element in between the values of another Stream.
public func intersperse<T>(x : T) -> Stream<T> -> Stream<T> {
	return { s in Stream((s.step().head, Stream((x, intersperse(x)(s.step().tail))))) }
}

/// Returns a Stream of successive reduced values.
public func scanl<A, B>(f : A -> B -> A) -> A -> Stream<B> -> Stream<A> {
	return { z in { s in Stream((z, scanl(f)(f(z)(s.step().head))(s.step().tail))) } }
}

/// Returns a Stream of successive reduced values.
public func scanl1<A>(f : A -> A -> A) -> Stream<A> -> Stream<A> {
	return { s in scanl(f)(s.step().head)(s.step().tail) }
}

/// Transposes the "Rows and Columns" of an infinite Stream.
public func transpose<T>(ss : Stream<Stream<T>>) -> Stream<Stream<T>> {
	let xs = ss.step().head
	let yss = ss.step().tail
	return Stream((Stream((xs.step().head, map(head)(yss))), transpose(Stream((xs.step().tail, map(tail)(yss)))))) 
}

/// Returns the first n elements of a Stream.
