# \[Pitch N+1\] Typed Throws

**URL:** <https://forums.swift.org/t/pitch-n-1-typed-throws/67496>\
**Category:** Pitches\
**Created:** [September 25, 2023, 4:25am UTC](https://forums.swift.org/t/pitch-n-1-typed-throws/67496 "2023-09-25T04:25:05Z")\
**Posts on this page:** 1\
**Showing post:** 173

<div class="post-metadata">

**Author:** ![tcldr](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/tcldr/32/24405_2.png) [@tcldr](https://forums.swift.org/u/tcldr)\
**Post date:** [October 2, 2023, 2:41pm UTC](https://forums.swift.org/t/pitch-n-1-typed-throws/67496/173 "2023-10-02T14:41:18Z")

</div>

At risk of derailing the thread, one further benefit of reducing `rethrows` to syntactic sugar is the precedent it sets for enhancing other effects clauses:

For example, the idea of a `reasync` clause has [already](https://forums.swift.org/t/a-case-study-for-reasync/64590/2) been [raised](https://forums.swift.org/t/the-latest-information-on-reasync/61801) as a counterpart to `rethrows`, but with the ideas surrounding typed throws it sheds some new light on what could potentially be achieved.

One of the big things that seems to be coming out of this proposal is just how useful having a generic 'handle' for an effect is when creating composable types like `Sequence` or `AsyncSequence`.

It crossed my mind that this might be useful for the `async` clause, too. Beyond whether something is just asynchronous or not, I've found myself occasionally frustrated that I haven't been able to 'thread through' the asynchronous execution context into third party modules.

However, if the `async` effects clause offered a generic handle, this becomes possible.

```swift
func a1()
// is equivalent to
func a2() async(Never)

func b1() async
// is equivalent to
func b2() async(any Actor)

@MainActor func c1() async
// is equivalent to
func c2() async(MainActor)

```

---

_[View the full topic](https://forums.swift.org/t/pitch-n-1-typed-throws/67496)._
