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

FreeAlgorithm doesn’t need recur when B: FreeConvertible.

This commit is contained in:
Rob Rix 2015-10-06 12:15:08 -04:00
parent 1fcba3fca0
commit 36c8fa03c9

View File

@ -201,4 +201,8 @@ extension FreeAlgorithm where B: FreeConvertible, B.RollType == A, B.PureType ==
self = .Roll(.Recursive(a, b, B.init >>> FreeAlgorithm.Pure))
}
}
public func evaluate(equals: (A, A) -> Bool) -> B {
return evaluate(equals, recur: { FreeAlgorithm($0, $1).evaluate(equals).free })
}
}