mirror of
https://github.com/github/semantic.git
synced 2024-11-25 02:58:36 +03:00
Implement Free.ana
without application or composition operators.
Swift can’t trace `noescape` or `rethrows` transitively through them.
This commit is contained in:
parent
8ca7cf7599
commit
f469b4f691
@ -123,7 +123,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.
|
/// 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(unfold: Annotation -> Syntax<Annotation, Leaf>)(_ seed: Annotation) -> Free {
|
public static func ana(unfold: Annotation -> Syntax<Annotation, Leaf>)(_ seed: Annotation) -> Free {
|
||||||
return (Introduce(seed) <<< { $0.map(ana(unfold)) } <<< unfold) <| seed
|
return Roll(seed, unfold(seed).map(ana(unfold)))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user