This repository was archived by the owner on Jan 11, 2023. It is now read-only.
This repository was archived by the owner on Jan 11, 2023. It is now read-only.
Can lazy-list (and/or Elm) support tail call recursion? #5
Open
Description
Hey!
I've been using lazy-list a bunch and it's been great so far, thanks for the hard work!
I'm running into some stack overflow issues:
overflow : Int -> List Int
overflow n =
Lazy.List.numbers
|> Lazy.List.takeWhile (\number -> number < n)
|> Lazy.List.toList
Calling it in a view for example:
((overflow 100000)
|> toString
|> Html.text
)
I've read online that Elm actually does tail call optimizations. I can see from my stack traces that my program dies in the LazyList code. Is it possible for the LazyList library to take advantage of tail call optimizations if Elm does in fact support it?
Metadata
Metadata
Assignees
Labels
No labels