Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- val xs = for {word <- List("There", "is", "no", "spoon")} yield {
- for {char <- word} yield (word -> word)
- }
- 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