Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Oh wow, TIL about `Kernel.then/2`. That definitely works around the syntax problem.

An aside, the implementation is kind of amusing. It almost seems unnecessary for this to be a macro but maybe the compiler can optimize this a bit more? I would expect TCO to simplify of my "simple" implementation of

  def then(value, fun) do
    fun.(value)
  end
https://github.com/elixir-lang/elixir/blob/a64d42f5d3cb6c327...


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: