# Ridiculous idea: types from the future

**URL:** <https://discourse.julialang.org/t/ridiculous-idea-types-from-the-future/5457>\
**Category:** Internals & Design\
**Tags:** inference\
**Created:** [August 18, 2017, 9:29pm UTC](https://discourse.julialang.org/t/ridiculous-idea-types-from-the-future/5457 "2017-08-18T21:29:03Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)\
**Post date:** [August 18, 2017, 10:24pm UTC](https://discourse.julialang.org/t/ridiculous-idea-types-from-the-future/5457/2 "2017-08-18T22:24:50Z")

</div>

> [@rdeits](#):
>
> which is perfect for loops with short bodies but less convenient if the loop body is complex.

You can always use `map` with a `do` block:

```julia
results = map(1:10) do i
   ....
end

```

The `map` function already implements the type-narrowing deduction you want. It uses Julia’s type inference as an optimization, but works even when type-inference fails.

---

_[View the full topic](https://discourse.julialang.org/t/ridiculous-idea-types-from-the-future/5457)._
