mirror of
https://github.com/github/semantic.git
synced 2024-11-25 21:43:07 +03:00
Implement coiteration.
This commit is contained in:
parent
fa2bfcd367
commit
961e9ae7d7
@ -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)))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user