parametric-list.svg" alt="Generic list" style="width:600px;"/>
]

---
# How to avoid duplication?


.thirty-seven-left[
<br>
<br>
<br>
<br>
```scala
def size(list: List[Int]   ): Int

def size(list: List[String]): Int

def size(list: List[User]  ): Int
```
]

.fifty-seven-right[
<img src="../img/foundation/parametric-list.svg" alt="Parametric list" style="width:600px;"/>
]

---
# Generic function


.thirty-seven-left[
<br>
<br>
```scala mdoc:reset:invisible
def size[A](list: List[A]): Int = list.size
```

`