Skip to content

Instantly share code, notes, and snippets.

@koolquark
Last active June 21, 2019 16:25
Show Gist options
  • Save koolquark/62bf7edc9b9c7ec280062b7030587dbc to your computer and use it in GitHub Desktop.
Save koolquark/62bf7edc9b9c7ec280062b7030587dbc to your computer and use it in GitHub Desktop.
Elixir - Calling anonymous function at definition itself
(fn true -> IO.puts("yes its true") end).(true)
# Example
"hello" |> ( fn msg -> IO.puts(msg) end ).()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment