-
-
Save dimitris-papadimitriou-chr/e21e16e8c48212c6956f10ba1a1e8563 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static partial class FunctionalExt | |
{ | |
public static Tree<T> Reverse<T>(this Tree<T> @this) => | |
@this switch | |
{ | |
Leaf<T> { Value: var v } => {...}, | |
Node<T> { Left: var l, Value: var v, Right: var r } => {...}, | |
_ => throw new NotImplementedException() | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment