Latest #anonymous-functions Threads Top

rajagennu
Hello, I am testing below code fibonaci = fn 0 -> 0 1 -> 1 n -> fibonaci.(n-1) + fibonaic.(n-2) end IO.puts fibonaci.(...
New
a-maze-d
Hi, I’m trying to create some syntactic sugar through a macro. The basic function should look like the following: f :name do data.som...
New
Djordjenp
Hello, I am new to elixir and I am trying to call my anonymous function defined in my “ex” file like so: package_data = fn (x, [y]) -&...
New
Djordjenp
I am new to elixir and I am trying to make a recursive anonymous function, but for some reason my anynymous function that works on it’s o...
New
bartblast
Consider the following code: iex> fn1 = fn x -> x end #Function<42.3316493/1 in :erl_eval.expr/6> iex> fn2 = fn x -> ...
New
chrisdel101
Is there anyway to print this &1? I usually don’t know what the value is since was written by a generator, and doing IO.inspect(&amp...
New
dubesoftware
Hi all, I’m learning Elixir/OTP and am stumped by a certain behaviour. I’m declaring an anonymous function in a module, then when I atte...
New
cevado
I’m curious to know if there is any reason for not allowing named anonymous functions in elixir as it’s possible in erlang. I’ve looked u...
New
chemist
Hi, Im having a bit of trouble with anon. functions using the Vex validator. defmodule Test do @enforce_keys [:wallet_id, :withdrawal,...
New
Fl4m3Ph03n1x
Background While playing around with dialyzer, typespecs and currying, I was able to create an example of a false positive in dialyzer. A...
New

This Week's Trending Top

This Month's Trending Top

This Year's Trending Top

Last Three Year's Trending Top

a-maze-d
Hi, I’m trying to create some syntactic sugar through a macro. The basic function should look like the following: f :name do data.som...
New
Djordjenp
I am new to elixir and I am trying to make a recursive anonymous function, but for some reason my anynymous function that works on it’s o...
New
rajagennu
Hello, I am testing below code fibonaci = fn 0 -> 0 1 -> 1 n -> fibonaci.(n-1) + fibonaic.(n-2) end IO.puts fibonaci.(...
New
Djordjenp
Hello, I am new to elixir and I am trying to call my anonymous function defined in my “ex” file like so: package_data = fn (x, [y]) -&...
New

Trending Over Three Years Top

dokuzbir
(fn -> {:ok, naive_date_time} = NaiveDateTime.new(Date.utc_today(), (fn -> {:ok, time} = Time.new(3, 2, 00); time end)....
New
Travis
Completely new to Elixir, but have an issue I am trying to figure out: When interviewing candidates for Javascript roles I usually have ...
New
Qqwy
Today I realized that it would be possible to implement currying-capability in Elixir, using some clever anonymous function creation. ('c...
New
Fl4m3Ph03n1x
Background I have a filter to where I am passing an anonymous function. In this function I want to check that the key of the tuple I am e...
New
tme_317
I’ve been struggling with this for a few hours now and there must be an easy answer despite my inability to search and find answers. So ...
New
benhoven
Capture operator & ampersand - can always I thing about it as fn x? Hi Everybody, Could you please help me understand how does capt...
New
ashneyderman
So something like this fails to compile: def streamfun_from_string(str) do fn(skip_headers \\ true) -> .. end end I am wonde...
New
PragTob
Hey everyone! This is a multi-layered question and I'll try my best to try and phrase it cleanly. As an abstract use case I want to h...
New
WestKeys
In an anonymous function you can pattern match on same argument multiple times color_of = fn "fire" -> IO.puts "red" "water...
New
purplesquirrel
I was trying to write this Enum.reduce([1,2,3], &Kernel.+(&1, &2)) more succinctly and I discovered I could do Enum.reduce([1...
New
kouluelixir
I am a beginner trying to make an anonymous function that takes two parameters. It needs to use guards to check if the two values are bot...
New
sf8193
Hello, I’m trying to create a new list from a map I’m given like so Enum.map(params, fn {k,v} -> if String.contains?(k, "checklist")...
New
chemist
Hi, Im having a bit of trouble with anon. functions using the Vex validator. defmodule Test do @enforce_keys [:wallet_id, :withdrawal,...
New
arnomi
Hi all, for the identity function we have &(&1) as a shortcut, but &(true) does cause a compiler error. Understandably, sinc...
New
oliveiragahenrique
I’m current learning Elixir by the book Elixir in Action 2nd Edition. On chapter 3 at Stream functions exercises i’ve solved them a bit d...
New
  • Follow
  • Join
  • Shape
the conversation

Latest on Elixir Forum

Elixir Forum

Similar Portals

    None added yet

We're in Beta

About us Mission Statement