Function Repository Resource:

JoinMap

Source Notebook

Map a function over a list and join the result

Contributed by: Taliesin Beynon (Wolfram Research)

ResourceFunction["JoinMap"][f,{list1,list2,}]

returns Join[f[list1],f[list2],].

ResourceFunction["JoinMap"][f]

represents an operator form of ResourceFunction["JoinMap"] that can be applied to lists.

Details and Options

The listi do not need to have head List, but must all have the same head.
ResourceFunction["JoinMap"] works on associations.

Examples

Basic Examples (3) 

Reverse the rows of an array, then flatten it:

In[1]:=
ResourceFunction["JoinMap"][Reverse, {{1, 2, 3}, {4, 5, 6}}]
Out[1]=

Create a concatenation sequence:

In[2]:=
ResourceFunction["JoinMap"][IntegerDigits[#, 2] &, Range[10]]
Out[2]=
In[3]:=
FromDigits[%, 2]
Out[3]=

Create a JoinMap operator:

In[4]:=
keytaker = ResourceFunction["JoinMap"][Keys]
Out[4]=
In[5]:=
keytaker[{<|"a" -> 1, "b" -> 2|>, <|"c" -> 3, "d" -> 4|>}]
Out[5]=

Publisher

Enrique Zeleny

Version History

  • 1.0.0 – 23 June 2020

Related Resources

License Information