public static Pair <TreeForest <A>, TreeForest <B> > Unzip <A, B>(this TreeForest <Pair <A, B> > p) { return(Pair <TreeForest <A>, TreeForest <B> > .pair(p.Select(a => a._1.Get), p.Select(a => a._2.Get))); }
public static TreeForest <B> Apply <A, B>(this TreeForest <Func <A, B> > f, TreeForest <A> o) { return(f.SelectMany(g => o.Select(p => g(p)))); }