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:
parent
9f60616f8b
commit
abab6f3c7b
@ -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: +)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user