1
1
mirror of https://github.com/github/semantic.git synced 2024-11-25 21:43:07 +03:00

Implement coiteration.

This commit is contained in:
Rob Rix 2015-10-14 10:39:01 -04:00
parent fa2bfcd367
commit 961e9ae7d7

View File

@ -14,6 +14,11 @@ public enum Cofree<A, B> {
return rest
}
}
public static func coiterate(annotate: B -> Syntax<B, A>)(_ seed: B) -> Cofree {
return .Unroll(seed, annotate(seed).map(coiterate(annotate)))
}
}