Use `Enum.to_list/1`, it does exactly this.

El sáb, 9 dic 2023, 13:41, Daniel Kukula <daniel.k...@gmail.com> escribió:

> We currently use infinity in multiple places in the standard library, it
> become a defacto standard in the ecosystem. I think that when passing
> :infinity to enumerable.take this should make it a noop.
> Example: list |> Enum.take(:infinity) would return the same list.
> I'm working on a custom inspect function and I see that limit is either an
> integer or :infinity. I'm currently using Stream module to process the
> inspected value to pretty print it and I need conditionally add logic to
> handle infinity.
>
> --
> You received this message because you are subscribed to the Google Groups
> "elixir-lang-core" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to elixir-lang-core+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/elixir-lang-core/73ee72bf-3c7e-489d-a98c-a1b22fa7cd5an%40googlegroups.com
> <https://groups.google.com/d/msgid/elixir-lang-core/73ee72bf-3c7e-489d-a98c-a1b22fa7cd5an%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to elixir-lang-core+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elixir-lang-core/CAGF5_6cWPBh1TrB_P%2BExJz-4XXxQSN_VU_S_TbQ_WsVsYxn61Q%40mail.gmail.com.

Reply via email to