mirror of
https://github.com/github/semantic.git
synced 2024-12-26 16:33:03 +03:00
Implement a paramorphism over TermType.
This commit is contained in:
parent
8bd00f2414
commit
d9823f144e
@ -14,6 +14,10 @@ extension TermType {
|
||||
return self |> ({ $0.unwrap } >>> { $0.map { $0.cata(transform) } } >>> transform)
|
||||
}
|
||||
|
||||
public func para<Result>(transform: (Syntax<(Self, Result), LeafType>) -> Result) -> Result {
|
||||
return self |> ({ $0.unwrap } >>> { $0.map { ($0, $0.para(transform)) } } >>> transform)
|
||||
}
|
||||
|
||||
|
||||
/// The count of nodes in the receiver.
|
||||
///
|
||||
|
Loading…
Reference in New Issue
Block a user