1
1
mirror of https://github.com/github/semantic.git synced 2024-12-26 16:33:03 +03:00

ana is static.

This commit is contained in:
Rob Rix 2015-10-22 13:11:00 -04:00
parent 4cc87bc0cf
commit f36651660b

View File

@ -121,8 +121,8 @@ extension Free {
/// Anamorphism over `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 func ana<Seed>(transform: Seed -> Syntax<Seed, A>)(_ seed: Seed) -> Free {
return (Roll <<< { $0.map(self.ana(transform)) } <<< transform)(seed)
public static func ana<Seed>(transform: Seed -> Syntax<Seed, A>)(_ seed: Seed) -> Free {
return (Roll <<< { $0.map(ana(transform)) } <<< transform)(seed)
}
}