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

Implement extract on Cofree.

This commit is contained in:
Rob Rix 2015-10-14 09:43:23 -04:00
parent a83f77116d
commit 0d662ade08

View File

@ -3,3 +3,15 @@
public enum Cofree<B> { public enum Cofree<B> {
case Unroll(B) case Unroll(B)
} }
// MARK: - Comonad
extension Cofree {
var extract: B {
switch self {
case let .Unroll(b):
return b
}
}
}