mirror of
https://github.com/github/semantic.git
synced 2024-11-25 11:04:00 +03:00
Add a static unwrap
function over TermType
.
This commit is contained in:
parent
6bcbccfe08
commit
89adf2cc86
@ -7,6 +7,10 @@ public protocol TermType {
|
||||
|
||||
|
||||
extension TermType {
|
||||
public static func unwrap(term: Self) -> Syntax<Self, LeafType> {
|
||||
return term.unwrap
|
||||
}
|
||||
|
||||
/// Catamorphism over `TermType`s.
|
||||
///
|
||||
/// Folds the tree encoded by the receiver into a single value by recurring top-down through the tree, applying `transform` to leaves, then to branches, and so forth.
|
||||
|
Loading…
Reference in New Issue
Block a user