Created
January 11, 2023 06:42
-
-
Save eshleebien/b5d9cc1d4e4ed37c7d8a4a2bb2c578c7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require Logger | |
limit = 100 | |
Stream.unfold(limit, fn | |
nil -> | |
nil | |
n -> | |
Logger.info("n: #{n}") | |
skip = n - limit | |
Logger.info("skip: #{skip}") | |
{:ok, value} = {:ok, Enum.to_list((skip..(n-1)))} | |
case n do | |
x when x <= 20 -> {value, n + limit} | |
_ -> {value, nil} | |
end | |
# case Kernel.length(value) do | |
# x when x <= 10 -> {value, n + limit} | |
# # x when x > 10 -> {value, nil} | |
# _ -> {value, nil} | |
# end | |
end) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment