Set of nifty functions I missed in Elixir core.
Helpers provided so far:
tapan analogue of ruby’stapmethod. It’s useful for more concise logging/external calls without intermediate local variables:
use Sweetener
tap Supervisor.start_link(children, opts) do
IO.inspect Supervisor.count_children(_())
#=> %{active: 1, specs: 1, supervisors: 0, workers: 1}
end #=> returning {:ok, pid} tupleAdd sweetener to your list of dependencies in mix.exs:
def deps do
[
{:sweetener, "~> 0.1.0"}
]
endDocumentation can be found at https://hexdocs.pm/sweetener.