I have a scala List[List[Person]]
with the following elements:
Person(Antonio)
Person(Maria)
Person(Joao)
Person(Antonio)
Person(Susana)
Person(Laura)
Person(Maria)
Person(Manuel)
Person(Joao)
Person(Laura)
How can I get a list with the first element of each list not repeated? Like this:
Person(Antonio)
Person(Susana)
Person(Maria)
It would be easy to do with var's
, but I want to do it functionally.