xianrusso
Enum.to_list/1 vs Enum.into/2
Just curious, but could someone explain the difference between Enum.to_list 1..5 and Enum.into 1..5, []? I understand that the latter is converting that range into a collectable, but if I’m not mistaken, the former is also transforming the range into a collectable since lists are collectables(?).
This isn’t really super important or integral to any projects I’m currently working on, I’m just curious if there is something else going on under the hood that differentiates those two specific lines of code. Also, I’m talking about Enum.into/2, not Enum.into/3.
Thanks!
Most Liked
al2o3cr
The source is highly informative here
:
https://github.com/elixir-lang/elixir/blob/v1.11.2/lib/elixir/lib/enum.ex#L1262-L1264
6
Popular in Discussions
Hello everyone,
I know we had quite some threads (read through lots of them) about background job processing but it remains a hotly deba...
New
I have a sample string
sentence = "Hello, world ... 123 *** ^%&*())^% %%:>"
From this string, I want to only keep the integers, ...
New
Hello Elixir and Nerves community,
I have been working for a while on an open-source embedded key-value database for Elixir, that I call...
New
I would like to spark a discussion about the static access operator: ..
For whom does not know: it is used in Elixir to access fields of...
New
A couple of days ago I was discussing with a friend about different approaches to write microservices.
He said that if he was going to w...
New
Here are the list of HTTP client libraries/wrappers, and some thoughts on HTTP client in general. I’d like to hear from others how they w...
New
Hey guys!
I want to create a toy project that shows a chart of temperature over time and updates every 5 seconds. I feel LiveView is per...
New
How does the two languages compare when it comes to server side application development? Any experiences or ideas? Thank you.
New
Can you believe the first professionally published Elixir book was published just 8 years ago? Since then I think we’ve seen more books f...
New
Phoenix Live View is now publicly available on GitHub.
Here’s Chris McCord’s tweet announcing making it public.
New
Other popular topics
None of the current solutions worked well for me, so I went ahead and built a user management system from scratch.
This project took far...
New
We have an ECS cluster with 4 services, where each task joins a single cluster, via discovery ECS discovery service.
Currently when I de...
New
This post is an instruction guide to help you setup your Neovim for Elixir development from scratch. It includes general information on h...
New
To my knowledge, put_in, Map.update etc. all have the one limitation of not automatically creating intermediate keys when needed (for exa...
New
As promised, the first release candidate of Phoenix 1.3.0 is out! This release focuses on code generators with improved project structure...
New
This release brings a number of exciting features, including integration with the new Phoenix LiveDashboard and Phoenix LiveView. There h...
New
I’ve got an issue with an app and I’ve no idea of how to troubleshoot it. I’m hoping someone here might have seen something similar.
I p...
New
Hi,
I need to transform a list of numbers into a map where the keys are the indexes and the values are the original values of the list. ...
New
Hi there,
I am working with Ecto-Postgresql and I need to call all of the records from a specific table but the table has 40,000 records...
New
I would like to know what is the best IDE for elixir development?
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









