jeroenbourgois
Syntactic sugar map idea
Just a random idea that keeps popping up in my head whenever I am pattern matching on maps. In Javascript es6 notation, there is this concept of a shorthand format to create objects, which I find very concise:
// pre es6
const someObject = {cat: cat, dog: dog, bird: bird}
// es6
const someObject = {cat, dog, bird}
Whenever I am pattern matching in Elixir I wonder how handy this would be to have, say:
def decorate_name(%{id, firstname, lastname}) do
"Hi, #{firstname} #{lastname}"
end
As opposed to
def decorate_name(%{id: id, firstname: firstname, lastname: lastname}) do
"Hi, #{firstname} #{lastname}"
end
Any thoughts?
Most Liked
wojtekmach
Hex Core Team
It’s been proposed many times, there’s a couple libraries on Hex for it. This is a good read about it: A story of regret and retiring a library from Hex – Andrea Leopardi.
9
rvirding
Creator of Erlang
TANSTAAFL I’m afraid.
2
NobbZ
I got a result… A German Wikipediapage, which linked to this: No such thing as a free lunch - Wikipedia
1
Popular in Discussions
I wanted to capitalize a string, and tried using String.capitalize().
That generally works well, until you try to capitalize a word like...
New
Elixir appears to be a superior language to Python. I don’t see any advantage of Python over Elixir. Are there any?
New
Just saw that dhh announced https://hotwire.dev/
Is it just me or is this essentially live view? :smiley:
Although I like the “iFrame-e...
New
Hello everyone :wave:
Today I am very excited to announce a project that I have been working on for almost 3 months now.
The project is...
New
Hey everone!
I created a prototype for my app using Nodejs for the api. But the framework I chose wasnt great (in general theresnt any g...
New
I’ve been working on an Elixir project that has required a lot of scripting. I usually reach for Elixir because I like it more (and in th...
New
Hey everyone,
this has been brewing in my head some time and it came up again while reading Adopting Elixir.
GenServers, supervisors et...
New
Seen any cool LiveView demos, sample apps or examples? Please post them here! :003:
New
I like Umbrella projects and pretty much always use them for personal Elixir stuff, especially Nerves things.
But I don’t think this is ...
New
Phoenix Live View is now publicly available on GitHub.
Here’s Chris McCord’s tweet announcing making it public.
New
Other popular topics
This release brings a number of exciting features, including integration with the new Phoenix LiveDashboard and Phoenix LiveView. There h...
New
When I run the Plug and I recompile I wind up having to use Ctrl C to quit iex and start again. Witht the help of rlwrap I can use the cu...
New
I am trying to run a deploy with docker and I successfully runned with this command:
docker build -t romenigld/blog-prod .
but when I t...
New
What is the proper way to load a module from a file in to IEX?
In the python world, doing something like this pretty standard:
from ....
New
We’ve put together this wiki for Phoenix LiveView - please feel free to add any info you feel is worth including.
What is Phoenix LiveV...
New
I would like to know what is the best IDE for elixir development?
New
I had some trouble figuring out how to make many-to-many associations work. Once I got it working, I wrote a blog post. Because I’m a nov...
New
Hello!
Sorry for this astonishing simple question, but I’m really stuck. I try to set up the intellij-elixir plugin, but I don’t know ho...
New
There are pre-rolled solutions for other frameworks that do work. However, Phoenix does not seem to have these. Have people had good expe...
New
I wrote this comment on r/haskell, and it’s not popular there. :wink: But I think I’m on to something…
Haskell reminds me of Java, and e...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #advent-of-code
- #elixirconf-us
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #performance








