Hacker News new | ask | show | jobs
by losvedir 1861 days ago
Hm, this works and is about as terse as `pattern_tap`:

    :erlang.localtime()
    |> case do; {_, {h,m,_}} -> {h, m}; end
    |> do_something
Not that I'd want to do that in production code, but I felt a bit nerd-sniped here, to see the shortest way I could find without dependencies.
1 comments

That's actually what pattern_tap's tap macro expands into :) See: https://github.com/mgwidmann/elixir-pattern_tap/blob/master/...