This is an excerpt from the Scala Cookbook (partially modified for the internet). This is Recipe 11.5, “How to Merge (Concatenate) Lists in Scala”
Problem
You want to merge/concatenate the contents of two lists.
Solution
Merge two lists using the ++
, concat
, or :::
methods. Given these two lists: