1
1
mirror of https://github.com/github/semantic.git synced 2024-11-29 02:44:36 +03:00

Add a static unwrap function over TermType.

This commit is contained in:
Rob Rix 2015-10-22 13:05:08 -04:00
parent 6bcbccfe08
commit 89adf2cc86

View File

@ -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.