1
1
mirror of https://github.com/github/semantic.git synced 2024-11-29 11:02:26 +03:00

Unroll does not need to be indirect.

This commit is contained in:
Rob Rix 2015-10-14 10:49:05 -04:00
parent 8f3ae52d29
commit 84ea5248e3

View File

@ -6,7 +6,7 @@
/// ///
/// This type is dual to `Free`. Where `Free` is inhabited by syntax trees where some terms are replaced with `B`s, `Cofree` is inhabited by syntax trees where all terms are annotated with `B`s. In Doubt, this allows us to e.g. annotate terms with source range information, categorization, etc. /// This type is dual to `Free`. Where `Free` is inhabited by syntax trees where some terms are replaced with `B`s, `Cofree` is inhabited by syntax trees where all terms are annotated with `B`s. In Doubt, this allows us to e.g. annotate terms with source range information, categorization, etc.
public enum Cofree<A, B> { public enum Cofree<A, B> {
indirect case Unroll(B, () -> Syntax<Cofree, A>) case Unroll(B, () -> Syntax<Cofree, A>)
public var unwrap: Syntax<Cofree, A> { public var unwrap: Syntax<Cofree, A> {
switch self { switch self {