# Boolean short circuit "fusion"

**URL:** <https://discourse.julialang.org/t/boolean-short-circuit-fusion/19641>\
**Category:** General Usage\
**Created:** [January 14, 2019, 10:33pm UTC](https://discourse.julialang.org/t/boolean-short-circuit-fusion/19641 "2019-01-14T22:33:10Z")\
**Posts on this page:** 1\
**Showing post:** 21

<div class="post-metadata">

**Author:** ![tkf](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tkf/32/17635_2.png) [@tkf](https://discourse.julialang.org/u/tkf)\
**Post date:** [January 15, 2019, 11:40pm UTC](https://discourse.julialang.org/t/boolean-short-circuit-fusion/19641/21 "2019-01-15T23:40:59Z")

</div>

This is clever! I was thinking I had to look at `CodeInfo` to implement `@lazy`. I didn’t realize it can be done elegantly by overloading `Broadcast.broadcasted`.

Regarding the performance, I think reduction via iterators is not the right direction to get a “zero-cost abstraction”. If fusing map and reduction becomes a thing in Julia, I think the right abstraction for the backend is the [transducer](https://discourse.julialang.org/t/ann-transducers-jl-efficient-and-composable-algorithms-for-map-and-reduce-like-operations/19159) (a shameless plug).

---

_[View the full topic](https://discourse.julialang.org/t/boolean-short-circuit-fusion/19641)._
