Collections
Lists, maps and keyword lists are transformed with Enum and Stream.
What you will be able to do
- Use Enum.map and Enum.filter.
- Use Map.get for maps.
- Streams are lazy.
In plain English
Lists, maps and keyword lists are transformed with Enum and Stream.
- Use Enum.map and Enum.filter.
- Use Map.get for maps.
- Streams are lazy.
lessons = [%{title: "HTML", minutes: 12}, %{title: "CSS", minutes: 18}]
long = Enum.filter(lessons, fn l -> l.minutes >= 15 end)
IO.inspect(Enum.map(long, & &1.title))Your turn
EasyExplain it back
Answer from memory: Which module provides eager collection functions?
TEXT · starter
Your answer…Check your understanding before moving on.
Knowledge checkQuestion 1
Which module provides eager collection functions?
Select an answer to continue
Study tools
Make it yours.
Keep a private note for this lesson, then turn the key ideas into flashcards you can revisit.
Sign in to save notes and flashcards.Both are private to your account and stay with your progress.
Sign inFinished reading?
Lock in what you just learned.
0%
Mark this lesson complete to save your place and move one step closer to the certificate.