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:
parent
a83f77116d
commit
0d662ade08
@ -3,3 +3,15 @@
|
||||
public enum Cofree<B> {
|
||||
case Unroll(B)
|
||||
}
|
||||
|
||||
|
||||
// MARK: - Comonad
|
||||
|
||||
extension Cofree {
|
||||
var extract: B {
|
||||
switch self {
|
||||
case let .Unroll(b):
|
||||
return b
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user