 		if n == 0 {
 			return []
 		}
-		return s.st().head <| take(n - 1)(s.st().tail)
+		return s.step().head <| take(n - 1)(s.step().tail)
 	}
 }
 

extension Stream : Monad {
	public func bind<B>(f : A -> Stream<B>) -> Stream<B> {
		return unfold({ ss in 
			let bs = ss.st().head
			let bss = ss.st().tail
			return (head(bs), map(tail)(bss))
		})(map(f)(self))
	}

		case .Empty:
			return error("Cannot cycle an empty list.")
		case .Cons(let x, let xs):
			return Stream((x, cycle(xs + [x])))
	}
}

/// Maps a function over a Stream and returns a new Stream of those values.
public func map<A, B>(f : A -> B) -> Stream<A> -> Stream<B> {
	return { s in Stream((f(s.step().head), map(f)(s.step().tail))) }
}

/// Uses function to construct a Stream.
