1
1
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:
Rob Rix 2015-10-22 10:33:25 -04:00
parent c9b33f826c
commit ad05308ab6

View File

@ -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))
}