# Syntactically nicer way of handling errors in Swift

**URL:** <https://forums.swift.org/t/syntactically-nicer-way-of-handling-errors-in-swift/19175>\
**Category:** Pitches\
**Created:** [December 31, 2018, 10:16am UTC](https://forums.swift.org/t/syntactically-nicer-way-of-handling-errors-in-swift/19175 "2018-12-31T10:16:31Z")\
**Posts on this page:** 1\
**Showing post:** 9

<div class="post-metadata">

**Author:** ![DevAndArtist](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/devandartist/32/287_2.png) [@DevAndArtist](https://forums.swift.org/u/DevAndArtist)\
**Post date:** [December 31, 2018, 3:19pm UTC](https://forums.swift.org/t/syntactically-nicer-way-of-handling-errors-in-swift/19175/9 "2018-12-31T15:19:22Z")

</div>

Refer to this idea and comments bellow:

> [@Polymorphic methods in enums](https://forums.swift.org/t/polymorphic-methods-in-enums/15093/16):
>
> Agreed about none of the alternatives seeming like improvements. Haskell's syntax for this is elegant, but it works because (1) the type signature is written separately and (2) the switched-on parameters are all explicit and so can be easily pattern-ized. In other words, it works because there's already some verbosity that people take for granted. I wonder how much of the clunkiness here is just the extra level of bracing required. Like if you had: func canAdvance() -\> Int = switch { // imp…

---

_[View the full topic](https://forums.swift.org/t/syntactically-nicer-way-of-handling-errors-in-swift/19175)._
