mirror of
https://github.com/github/semantic.git
synced 2024-12-26 16:33:03 +03:00
Define the recursive TermType → Free constructor over CofreeType instead.
This commit is contained in:
parent
c9b33f826c
commit
ad05308ab6
@ -14,7 +14,7 @@ public enum Free<Leaf, Annotation, Value>: CustomDebugStringConvertible, SyntaxC
|
||||
|
||||
|
||||
/// Recursively copies a `Term: TermType where Term.Leaf == Leaf` into a `Free<Leaf, Value>`, essentially mapping `Term.unwrap` onto `Free.Roll`.
|
||||
public init<Term: TermType where Term.Leaf == Leaf>(_ term: Term) {
|
||||
public init<Term: CofreeType where Term.Leaf == Leaf>(_ term: Term) {
|
||||
self = .Roll(term.unwrap.map(Free.init))
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user