1
1
mirror of https://github.com/github/semantic.git synced 2024-11-25 11:04:00 +03:00
semantic/prototype/Doubt/Cofree.swift

18 lines
213 B
Swift
Raw Normal View History

2015-10-14 16:34:18 +03:00
// Copyright © 2015 GitHub. All rights reserved.
2015-10-14 16:42:21 +03:00
public enum Cofree<B> {
case Unroll(B)
2015-10-14 16:34:18 +03:00
}
2015-10-14 16:43:23 +03:00
// MARK: - Comonad
extension Cofree {
var extract: B {
switch self {
case let .Unroll(b):
return b
}
}
}