Collection of Elixir syntactic sugars.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
test
.gitignore
README.md
mix.exs
mix.lock

README.md

Synex

Collection of Elixir syntactic sugars.

keys/1

Something like ES6 property shorthand, or Clojure's destructuring. It expands keywords, maps and structs, and supports variable pinning and map update syntax.

For examples look at Synex.Keys.keys/1.

params/1

Like keys/1 but only for maps and uses string keys instead of atoms. params/1 also expands nested maps.

iex> params(%{a => %{b, c}}) = %{"a" => %{"b" => 2, "c" => 3}}
iex> {b, c}
{2, 3}
iex> a
%{"b" => 2, "c" => 3}

For more examples look at Synex.Params.params/1.

Installation

  1. Add synex to your list of dependencies in mix.exs:
def deps do
  [{:synex, "~> 1.0"}]
end
  1. Add use Synex to your module.