diff --git a/prototype/Doubt/Cofree.swift b/prototype/Doubt/Cofree.swift index e875dfad9..e774e8a46 100644 --- a/prototype/Doubt/Cofree.swift +++ b/prototype/Doubt/Cofree.swift @@ -14,6 +14,11 @@ public enum Cofree { return rest } } + + + public static func coiterate(annotate: B -> Syntax)(_ seed: B) -> Cofree { + return .Unroll(seed, annotate(seed).map(coiterate(annotate))) + } }