Advertisement
Guest User

Untitled

a guest
Mar 24th, 2015
232
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Scala 0.30 KB | None | 0 0
  1. val xs = for {word <- List("There", "is", "no", "spoon")} yield {
  2.     for {char <- word} yield (word -> word)
  3. }
  4.  
  5. println(xs) // List(Vector((There,T), (There,h), (There,e), (There,r), (There,e)), Vector((is,i), (is,s)), Vector((no,n), (no,o)), Vector((spoon,s), (spoon,p), (spoon,o), (spoon,o), (spoon,n)))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement