# Map over product

**URL:** https://discourse.julialang.org/t/map-over-product/90839
**Category:** General Usage
**Created:** [November 26, 2022, 7:19am UTC](https://discourse.julialang.org/t/map-over-product/90839 "2022-11-26T07:19:24Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![jar1](https://avatars.discourse-cdn.com/v4/letter/j/c0e974/32.png) [@jar1](https://discourse.julialang.org/u/jar1)
#### Post date: [November 26, 2022, 7:19am UTC](https://discourse.julialang.org/t/map-over-product/90839/1 "2022-11-26T07:19:24Z")

</div>

Is there a shorter way to write `[f(a,b) for a in A, b in B]` or `map(Base.splat(f), Iterators.product(A,B))` ? I’m looking for something like `prodmap(f, A, B)`.

---

<div class="post-metadata">

### Author: ![aplavin](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/aplavin/32/222056_2.png) [@aplavin](https://discourse.julialang.org/u/aplavin)
#### Post date: [November 26, 2022, 12:39pm UTC](https://discourse.julialang.org/t/map-over-product/90839/2 "2022-11-26T12:39:25Z")

</div>

A couple of alternatives:

```julia
f.(A, B')

f.(A', B)

using SplitApplyCombine
product(f, A, B)

```

Also, if you do this regularly, it can be cleaner and more convenient to write `f` that accepts the whole object instead of two separate arguments, and apply it then directly without splatting.
