I think distinctBy should be like sortBy, and not return the U, we are uniquing on. If you need that, do:
```scala
pipe.map { t => (fn(t), t) }.distinct
```