One of main differences of Synex and ShortMaps is that Synex supports
nested stractures:
iex> params(%{a => %{b, c}}) = %{"a" => %{"b" => 2, "c" => 3}} iex> {b, c} {
2, 3} iex> a %{"b" => 2, "c" => 3}

It supports map update syntax:
iex> person = %{"name" => "Jack", "age" => 26} iex> name = "John" iex>
params(%{person | name, "age" => 28})
%{"name" => "John", "age" => 28}

iex> map = %{a: 1, b: 2, c: 3, d: 4} iex> {a, b} = {10, 20} iex> keys(%{map
| a, b, c: 100, d: 200})
%{a: 10, b: 20, c: 100, d: 200}

For more info you can find docs for keys
<https://hexdocs.pm/synex/Synex.Keys.html> and params
<https://hexdocs.pm/synex/Synex.Params.html> on hexdocs.pm

On Mon, Aug 29, 2016 at 9:18 PM OvermindDL1 <[email protected]> wrote:

> If it were included I would want it to be a bit more useful (and could
> perhaps be rolled into the map syntax itself with sigil, but I'm fine with
> it as a library):  https://github.com/whatyouhide/short_maps/issues/13
>
>
> On Monday, August 29, 2016 at 10:40:48 AM UTC-6, Wiebe-Marten Wijnja wrote:
>>
>> Hmm... this is the kind of feature that I would've used a lot, had I
>> known that a package that provided this shorthand syntax existed.
>> I will definitely do so in the future. I really like the sigil idea.
>>
>> Are we still opposed to including the `~m` sigil in the base language?
>>
>> On Sunday, May 31, 2015 at 12:19:46 PM UTC+2, Devin Torres wrote:
>>>
>>> Taking a pretty cool page out of ES6:
>>>
>>> # If `method`, `url`, `headers`, and `payload` are already bound
>>> %Request{method, url, headers, payload}
>>>
>>> # If e.g. `payload` hasn't been bound yet
>>> %Request{method, url, headers, payload: get_payload()}
>>>
>> --
> You received this message because you are subscribed to a topic in the
> Google Groups "elixir-lang-core" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/elixir-lang-core/NoUo2gqQR3I/unsubscribe
> .
> To unsubscribe from this group and all its topics, send an email to
> [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/elixir-lang-core/8f231010-c673-487b-b7fa-a3d488838921%40googlegroups.com
> <https://groups.google.com/d/msgid/elixir-lang-core/8f231010-c673-487b-b7fa-a3d488838921%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elixir-lang-core/CALEByXaAU1g1UPXQHam5164QT3OKm5pkbHRD0Q0sv%3D0WXddZ%2Bw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to