0

I am trying to get the textual representation of a callback function. That maybe sounds weird :/ but what i want to do is:

defmodule Sample do 
 def sample_fn(callback) do 
  # Do something here
  callback.()
 end
end

since sample_fn is called from a lot of different places with different args I just want to see textual representation of the passed callback function, is that even possible ?

Tano
  • 1,285
  • 1
  • 18
  • 38
  • 1
    https://stackoverflow.com/questions/5250587/erlang-how-to-convert-a-fun-object-to-a-string (that's for Erlang, but Elixir funs are Erlang funs, so I expect it would work the same) – Alexey Romanov Feb 04 '20 at 08:35
  • @AlexeyRomanov thanks, thats exactly i was looking for – Tano Feb 04 '20 at 08:36

0 Answers0