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

Implement extend on Cofree.

This commit is contained in:
Rob Rix 2015-10-14 10:00:16 -04:00
parent ab554c52a0
commit 26f0ea419d

View File

@ -21,4 +21,8 @@ extension Cofree {
return b
}
}
func extend<Other>(transform: Cofree -> Other) -> Cofree<A, Other> {
return .Unroll(transform(self), unwrap.map { $0.extend(transform) })
}
}