# Adding firstAs() to Sequence

**URL:** <https://forums.swift.org/t/adding-firstas-to-sequence/36665>\
**Category:** Pitches\
**Created:** [May 20, 2020, 3:13am UTC](https://forums.swift.org/t/adding-firstas-to-sequence/36665 "2020-05-20T03:13:36Z")\
**Posts on this page:** 1\
**Showing post:** 10

<div class="post-metadata">

**Author:** ![davedelong](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/davedelong/32/38708_2.png) [@davedelong](https://forums.swift.org/u/davedelong)\
**Post date:** [May 20, 2020, 3:17pm UTC](https://forums.swift.org/t/adding-firstas-to-sequence/36665/10 "2020-05-20T15:17:42Z")

</div>

Yeah, seeing those two side-by-side indicates that perhaps `firstMap` isn't the best name. I picked it because of its symmetry with `first(where:)` and `compactMap(_:)`.

I believe this is worth adding to the Standard Library, because it meets [The Law of Soroush](https://forums.swift.org/t/se-0225-adding-iseven-isodd-ismultiple-to-binaryinteger/15382/48):

> If an extension meets any one of the following four criteria, it deserves to exist:
> 
> 1. Does it increase expressivity?
> 2. Does it decrease noise?
> 3. Does it include a performance optimization?
> 4. Does it belong on every instance of the type?

---

_[View the full topic](https://forums.swift.org/t/adding-firstas-to-sequence/36665)._
