Latest #anonymous-functions Threads 
Hello,
I am testing below code
fibonaci = fn
0 -> 0
1 -> 1
n -> fibonaci.(n-1) + fibonaic.(n-2)
end
IO.puts fibonaci.(...
New
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
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
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
Consider the following code:
iex> fn1 = fn x -> x end
#Function<42.3316493/1 in :erl_eval.expr/6>
iex> fn2 = fn x -> ...
New
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(&...
New
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
While exploring with Oban I was made aware of some of the risks involved with serialization, in particular with serializing anonymous fun...
New
Because it was anonymous.
It’s a dumb joke. I know. Please bear with me.
I’ve had this joke in mind for almost a year. Since COVID case...
New
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
This Week's Trending
This Month's Trending
This Year's Trending
Last Three Year's Trending
I can’t seem to pass an anonymous function as an option to a Plug. I am using plug_hmouse which from the documentation takes an option di...
New
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
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
Hello,
I am testing below code
fibonaci = fn
0 -> 0
1 -> 1
n -> fibonaci.(n-1) + fibonaic.(n-2)
end
IO.puts fibonaci.(...
New
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
(fn ->
{:ok, naive_date_time} =
NaiveDateTime.new(Date.utc_today(), (fn -> {:ok, time} = Time.new(3, 2, 00); time end)....
New
What’s the state of recursive anonymous functions now? It was mentioned a while ago, when this feature was being introduced in OTP 17. Wh...
New
Completely new to Elixir, but have an issue I am trying to figure out:
When interviewing candidates for Javascript roles I usually have ...
New
Today I realized that it would be possible to implement currying-capability in Elixir, using some clever anonymous function creation. (‘c...
New
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
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
Capture operator & ampersand - can always I thing about it as fn x?
Hi Everybody,
Could you please help me understand how does capt...
New
So something like this fails to compile:
def streamfun_from_string(str) do
fn(skip_headers \\ true) ->
..
end
end
I am wonde...
New
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 hav...
New
In an anonymous function you can pattern match on same argument multiple times
color_of = fn
"fire" ->
IO.puts "red"
"water...
New
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
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
Hello,
You may be already using the Capture Operator & for capturing functions or quickly creating anonymous function.
For this lat...
New
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
Hi, Im having a bit of trouble with anon. functions using the Vex validator.
defmodule Test do
@enforce_keys [:wallet_id, :withdrawal,...
New
- Follow
- Join
- Shape
the conversation
Latest on Elixir Forum
Get money off!
The Pragmatic Bookshelf
35% off any eBook
Manning Publications
45% off any item
ElixirCasts
10% off for life
The Pragmatic Studio
20% off any course
AppSignal
10% off for 12 months
Honeybadger
10% off for 12 months
Simply use coupon code "devtalk.com" or "elixirforum" at checkout!
Filter by Type:
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #advent-of-code
- #elixirconf-us
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #performance









