mirror of
https://github.com/github/semantic.git
synced 2024-11-29 11:02:26 +03:00
Unwrap Cofrees.
This commit is contained in:
parent
3985ef0fea
commit
ab554c52a0
@ -2,6 +2,13 @@
|
||||
|
||||
public enum Cofree<A, B> {
|
||||
indirect case Unroll(B, Syntax<Cofree, A>)
|
||||
|
||||
public var unwrap: Syntax<Cofree, A> {
|
||||
switch self {
|
||||
case let .Unroll(_, rest):
|
||||
return rest
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user