# Add function application to Swift's standard library

**URL:** <https://forums.swift.org/t/add-function-application-to-swifts-standard-library/12361>\
**Category:** Pitches\
**Created:** [May 3, 2018, 11:08am UTC](https://forums.swift.org/t/add-function-application-to-swifts-standard-library/12361 "2018-05-03T11:08:56Z")\
**Posts on this page:** 1\
**Showing post:** 23

<div class="post-metadata">

**Author:** ![orobio](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/orobio/32/5512_2.png) [@orobio](https://forums.swift.org/u/orobio)\
**Post date:** [June 13, 2020, 12:53pm UTC](https://forums.swift.org/t/add-function-application-to-swifts-standard-library/12361/23 "2020-06-13T12:53:17Z")

</div>

> [@gwendal.roue](#):
>
> Now there again I can foresee people feeling nervous about reusing the dot for invoking something which is not a method.

Personally, I see it as a method without a name. The OPs example of an 'apply' method on `Collection` can be rewritten to:

- Be an extension on all types
- Use no method name instead of 'apply'

This is not possible in Swift, and we probably don't want to make this possible in general, but if you look at it this way, it's equivalent to the following:

```swift
// Pseudo Swift
extension<T> {
    func _<U>(_ transform: (Self) -> U) -> U {
        transform(self)
    }
}

```

This works for the base syntax: `value.(function)`, as well as the `value.{doStuff}` variant, which just uses trailing closure syntax. Another valid way to write this would be `value.() {doStuff}`.

---

_[View the full topic](https://forums.swift.org/t/add-function-application-to-swifts-standard-library/12361)._
