Is it possible to express arithmetic progression in a list without listing them all?
In Haskell, you can do this with a range function.
[2,4..10] == [2,4,6,8,10]
Is there a similar way to do this with Elixir?
Stream.iterate / 2 does what you want:
Stream.iterate(2, &(&1+2))
You can use the Erlang lists:seq function, from Elixir:
lists:seq
:lists.seq(2,10,2)
As I can see, there is a Stream.seq () stream added a month ago:
Source: https://habr.com/ru/post/1497444/More articles:Spring - download file and redirect - redirectHow to Update a WPF MainWindow Control - multithreadingSystem.Windows.Controls.WebBrowser, System.Windows.Threading.Dispatcher and Windows Service - wpfVarious stored procedure execution results using exec sp_executesql versus EXEC - sqlHow to dynamically create an anonymous class that extends an abstract class in PHP? - phpOpenCV Face Detection with Overlap - opencvNoob Guide for OPC: How to Write a C # Hello World Client? - .netWhat is the best way to get closer to checking the rules? - logicHow to manually launch Paypal error 10486 in a sandbox? - paypalHow to determine that the switch has changed its output? - c #All Articles