 		if n == 0 {
 			return s
 		}
-		return drop(n - 1)(tail(s.st().tail))
+		return drop(n - 1)(tail(s.step().tail))
 	}
 }
 

public func unfold<A, B>(f : A -> (B, A)) -> A -> Stream<B> {
	return { z in  
		let (x, d) = f(z)
		return Stream(st: (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(st: (s1.st().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(st: (s.st().head, Stream(st: (x, intersperse(x)(s.st().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(st: (z, scanl(f)(f(z)(s.st().head))(s.st().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.st().head)(s.st().tail) }
}

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

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

/// Returns the longest suffix remaining after a predicate holds.
public func dropWhile<T>(p : T -> Bool) -> Stream<T> -> Stream<T> {
	return { s in 
		if p(s.step().head) {
			return dropWhile(p)(s.step().tail)
		}
		return s
	}
