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

Define ana using the backwards application operator to clarify dataflow.

This commit is contained in:
Rob Rix 2015-10-22 17:08:17 -04:00
parent d6a9be0794
commit f0379f421b

View File

@ -115,7 +115,7 @@ extension Free {
///
/// Unfolds a tree bottom-up by recursively applying `transform` to a series of values starting with `seed`. Since `Syntax.Leaf` does not recur, this will halt when it has produced leaves for every branch.
public static func ana<Seed>(transform: Seed -> Syntax<Seed, Leaf>)(_ seed: Seed) -> Free {
return (Roll <<< { $0.map(ana(transform)) } <<< transform)(seed)
return (Roll <<< { $0.map(ana(transform)) } <<< transform) <| seed
}
}