Skip to content

Latest commit

 

History

History
13 lines (10 loc) · 361 Bytes

range-into-list-using-comprehensions.md

File metadata and controls

13 lines (10 loc) · 361 Bytes

Range Into List Using Comprehensions

Using an identity comprehension and the :into option, we can easily convert a range into a list.

> for x <- 1..10, into: [], do: x
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]

Check out the docs for the :into option for more details.