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

Document FreeAlgorithm.init.

This commit is contained in:
Rob Rix 2015-10-06 12:24:58 -04:00
parent 511ef4d1a1
commit cce1ed61aa

View File

@ -188,6 +188,7 @@ extension Free: FreeConvertible {
}
extension FreeAlgorithm where B: FreeConvertible, B.RollType == A, B.PureType == Patch<A> {
/// `FreeAlgorithm<A, Diff>`s can be constructed from a pair of `Term`s using `ByKey` when `Keyed`, `ByIndex` when `Indexed`, and `Recursive` otherwise.
public init(_ a: Fix<A>, _ b: Fix<A>) {
switch (a.out, b.out) {
case let (.Keyed(a), .Keyed(b)):