3 ms·
I usually avoided comprehensions because they felt like an odd part of Elixir syntax. But more complex nested data transformations can get verbose and the the
by pawelduda 3y ago
I usually avoided comprehensions because they felt like an odd part of Elixir syntax. But more complex nested data transformations can get verbose and the the article shows the difference in favor of comprehensions that makes me wanna try them more often. I could think of cases where it would make my code leaner and more readable, but not before it clicked for me.
Most important part is they're expressions so you can mix and match them with function calls
Anyway, bookmarking the article because it's the best explainer of this feature I recall and will gladly pass it to others :)
- throwawaymaths 3y agoIt works well in templated text, though.
- tru1ock 3y agoI have been using elixir for my own projects for a while and I also have not leaned into comprehensions enough. This article has helped me see that blind spot. Bookmarked