mirror of
https://github.com/github/semantic.git
synced 2024-11-25 21:43:07 +03:00
18 lines
247 B
Swift
18 lines
247 B
Swift
// Copyright © 2015 GitHub. All rights reserved.
|
|
|
|
public enum Cofree<A, B> {
|
|
indirect case Unroll(B, Syntax<Cofree, A>)
|
|
}
|
|
|
|
|
|
// MARK: - Comonad
|
|
|
|
extension Cofree {
|
|
var extract: B {
|
|
switch self {
|
|
case let .Unroll(b, _):
|
|
return b
|
|
}
|
|
}
|
|
}
|