Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is &+/2 in elixir?

Tags:

elixir

Saw this in elixir guide:

Enum.reduce([1, 2, 3], 0, &+/2)

What the heck is &+/2 ? I can't seem to google it for the life of me.

like image 445
Terence Chow Avatar asked Aug 25 '16 23:08

Terence Chow


People also ask

What is Live Twice?

inspired by Mid-century japanThe newest brand in the Jigger & Pony family, Live Twice welcomes guests from all walks of life, united by their love of cocktails. Whether you're a salaryman or a creative, Live Twice welcomes your most authentic self at the end of the day.

Who is in love what is twice?

Nayeon is Mia from The Princess Diaries, Jeongyeon and Sana are Molly and Sam from Ghost, Mina and Dahyun are Vic and Matthieu from La Boum, Sana and Tzuyu are Mia and Vincent from Pulp Fiction, Jeongyeon and Tzuyu are Romeo and Juliet from Romeo + Juliet, Jihyo and Jeongyeon are Itsuki/Hiroko and male Itsuki from Love ...

Who wrote love twice?

It includes the title track of the same name produced by Park Jin-young. Twice members Jeongyeon, Chaeyoung, and Jihyo also took part in writing lyrics for two songs on the EP. What Is Love?


1 Answers

In this example you capture the module function +/2. Capture operator & turns module function into anonymous one. Here it captures the +/2, which is actually Kernel.+/2. Read more here.

like image 188
PatNowak Avatar answered Sep 21 '22 21:09

PatNowak