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

duplicate() is just extend(id).

This commit is contained in:
Rob Rix 2015-10-14 10:24:16 -04:00
parent 5015238546
commit fa2bfcd367

View File

@ -44,6 +44,9 @@ extension Cofree {
/// Returns a new `Cofree` constructed by recursively annotating each subtree with itself.
public var duplicate: Cofree<A, Cofree<A, B>> {
return .Unroll(self, unwrap.map { $0.duplicate })
return extend(id)
}
}
import Prelude