1
1
mirror of https://github.com/github/semantic.git synced 2024-12-24 23:42:31 +03:00

Stream.rest does not force.

This commit is contained in:
Rob Rix 2015-09-17 14:26:25 -04:00
parent d62d4a33bb
commit ab6cb6c67b

View File

@ -31,8 +31,8 @@ public enum Stream<A>: NilLiteralConvertible, SequenceType {
return uncons?.first
}
public var rest: Stream {
return uncons?.rest.value ?? .Nil
public var rest: Memo<Stream> {
return analysis(ifCons: { $1 }, ifNil: { Memo(evaluated: .Nil) })
}
public var isEmpty: Bool {