diff --git a/prototype/Doubt/Stream.swift b/prototype/Doubt/Stream.swift index 00787d520..a4599933d 100644 --- a/prototype/Doubt/Stream.swift +++ b/prototype/Doubt/Stream.swift @@ -31,8 +31,8 @@ public enum Stream: NilLiteralConvertible, SequenceType { return uncons?.first } - public var rest: Stream { - return uncons?.rest.value ?? .Nil + public var rest: Memo { + return analysis(ifCons: { $1 }, ifNil: { Memo(evaluated: .Nil) }) } public var isEmpty: Bool {