# What's the best way to dispatch on an \_iterable\_ trait?

**URL:** https://discourse.julialang.org/t/whats-the-best-way-to-dispatch-on-an-iterable-trait/42084
**Category:** New to Julia
**Tags:** traits
**Created:** [June 26, 2020, 12:51am UTC](https://discourse.julialang.org/t/whats-the-best-way-to-dispatch-on-an-iterable-trait/42084 "2020-06-26T00:51:45Z")
**Posts on this page:** 1
**Showing post:** 12

<div class="post-metadata">

### Author: ![xiaodai](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/xiaodai/32/15937_2.png) [@xiaodai](https://discourse.julialang.org/u/xiaodai)
#### Post date: [June 27, 2020, 10:13pm UTC](https://discourse.julialang.org/t/whats-the-best-way-to-dispatch-on-an-iterable-trait/42084/12 "2020-06-27T22:13:23Z")

</div>

The use-case I had in mind was simply so that `fn` when applied to a non-iterable will not run and just generate an error. That’s all.

---

_[View the full topic](https://discourse.julialang.org/t/whats-the-best-way-to-dispatch-on-an-iterable-trait/42084)._
