1
1
mirror of https://github.com/github/semantic.git synced 2024-11-24 17:04:47 +03:00

Free.sum’s cost function does not escape.

This commit is contained in:
Rob Rix 2015-10-28 11:55:38 -04:00
parent 9f60616f8b
commit abab6f3c7b

View File

@ -80,7 +80,7 @@ public enum Free<Leaf, Annotation, Value>: CustomDebugStringConvertible {
}
/// Returns a function which sums `Free`s by first `transform`ing `Pure` values into integers, and then summing these.
public static func sum(transform: Value -> Int)(_ free: Free) -> Int {
public static func sum(@noescape transform: Value -> Int)(_ free: Free) -> Int {
return free.map(transform).reduce(0, combine: +)
}