whatyouhide / short_maps

⚠️Retired⚠️ library that provided a ~m sigil for ES6-like map destructuring in Elixir.
https://andrealeopardi.com/posts/a-story-of-regret-and-retiring-a-library-from-hex/
77 stars 5 forks source link

make default_modifier configurable #10

Closed zaboco closed 8 years ago

zaboco commented 8 years ago

I know that the default modifier is ?s for consistency with ~w sigil. However, for maps the most common use-case is to have atoms as keys.

So, I think that this option could be extracted in config.exs and be accessible as Application.get_env(:short_maps, :default_modifier).

What do you think? If that's ok, I can do it myself and send a PR.

whatyouhide commented 8 years ago

I vastly prefer simplicity here, and making this configurable would add complexity (especially for the readers, who would have to check the config every time they see ~m because they don't know whether you're using atom or string keys). Also, I disagree that the most common use case is for maps to have atom keys: just think of the params passed to Phoenix controllers.

Thanks a lot anyways! :heart_decoration:

zaboco commented 8 years ago

Yes, I can see your point on simplicity, I totally agree. After all, it's not that hard to add an 'a' at the end. Thanks.