# Should Generators finally be given eltype

**URL:** <https://discourse.julialang.org/t/should-generators-finally-be-given-eltype/20507>\
**Category:** Internals & Design\
**Created:** [February 6, 2019, 2:44pm UTC](https://discourse.julialang.org/t/should-generators-finally-be-given-eltype/20507 "2019-02-06T14:44:43Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![ndinsmore](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ndinsmore/32/7433_2.png) [@ndinsmore](https://discourse.julialang.org/u/ndinsmore)\
**Post date:** [February 6, 2019, 5:53pm UTC](https://discourse.julialang.org/t/should-generators-finally-be-given-eltype/20507/4 "2019-02-06T17:53:38Z")

</div>

@yuyichao & @nalimilan thank you for your explanations both of which make sense to me… I think.  
That said with the limitation/flexibility of the current system could you help me understand how to solve the problem that drove me to ask this:

> [@How can you dispatch on Iterator eltype including generators?](https://discourse.julialang.org/t/how-can-you-dispatch-on-iterator-eltype-including-generators/20511):
>
> Ho can you dispatch on Iterator eltype including generators? I ask in an attempt to fix the following interface problem. Right now I am working on the get function of an interface that has many different types to dispatch, and potentially a lot of over head for each get initially. Something like: struct InterfaceIndirect index::Int64 end struct ApplicationIndirect ref::InterfaceIndirect end function interface\_get(indirect::InterfaceIndirect) #lots of prework which makes it imprac…

---

_[View the full topic](https://discourse.julialang.org/t/should-generators-finally-be-given-eltype/20507)._
