I have a List[Message]
and a List[Author]
which have the same number of items, and should be ordered so that at each index, the Message
is from the Author
.
I also have class that we'll call here SmartMessage
, with a constructor taking 2 arguments: a Message
and the corresponding Author
.
What I want to do, is to create a List[SmartMessage]
, combining the data of the 2 simple lists.
Extra question: does List
preserve insertion order in Scala? Just to make sure I create List[Message]
and a List[Author]
with same ordering.