Bohtvaroh

Blogger - Scalaz Motivation - 15

Jun 1st, 2012
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Scala 0.43 KB | None | 0 0
  1. val tree: Tree[String] =
  2.   Node("c",
  3.     Node("b",
  4.       Node("a", Empty(), Empty()),
  5.       Node("a",
  6.         Node("r", Empty(), Empty()),
  7.         Empty()
  8.       )
  9.     ),
  10.     Node("d",
  11.       Node("a", Empty(), Empty()),
  12.       Node("b",
  13.         Node("a", Empty(), Empty()),
  14.         Node("r",
  15.           Empty(),
  16.           Node("a", Empty(), Empty())
  17.         )
  18.       )
  19.     )
  20.   )
  21.  
  22. p(sum(tree)) // prints ###> abracadabra
Advertisement
Add Comment
Please, Sign In to add comment