コード例 #1
0
ファイル: Tree.java プロジェクト: jbgi/functionaljava
 /**
  * Provides a show instance that draws a 2-dimensional representation of a tree.
  *
  * @param s A show instance for the elements of the tree.
  * @return a show instance that draws a 2-dimensional representation of a tree.
  */
 public static <A> Show<Tree<A>> show2D(final Show<A> s) {
   return Show.showS(tree -> tree.draw(s));
 }
コード例 #2
0
ファイル: Tree.java プロジェクト: jbgi/functionaljava
 private Stream<String> drawTree(final Show<A> s) {
   return drawSubTrees(s, subForest._1()).cons(s.showS(root));
 }