De-throning the List: Summary
Robin Heggelund Hansen
May 8
I've written a total of five posts (or six, including this one) about why I would like to replace the List with Array. If you'd missed one, here they all are:
- Introduction - the grand plan
- Part Deux - Improving the
Array - Part π - stoppable fold operations
- Part SC4K - API changes
- Part Boron - literal representation
These posts lists a ton of work. First we need to alter the Array implementation to improve performance in even more cases. Then we need to make it more extensible by introducing stoppable fold operations. Then we need to add functions that currently exists for List, but not for Array. Finally, we can make the Elm compiler output a literal representation of Array directly in the javascript code.
But why do all this work? Because I honestly believe Elm becomes easier to learn if the default collection type not only works similarly to the default collection type in other languages, but also provides decent performance for most cases you wish to use it with. I also believe Elm will become faster in the general case, if Array is used in all the places List is used today.
I might not be right. But I do think it will be an undertaking worth taking. Or... Uh... You know what I mean.
The next and first step of this journey will be to upgrade the Array implementation from being a HAMT to an RRB-Tree. This process will probably take a while, but expect a new blog post with benchmark results when it happens.
Thank you for reading!
Elm 0.19 brings better collections
The case for replacing Array.slice
Trending on dev.to
I think I will leave my job, give me a advice.
Elm 0.19 Broke Us 💔
How to find partner for startup?
Which browsers should I try to support when creating a portfolio?
What are you learning right now?
I am a developer. How can I make money?
Who is developer?
Share your team-building stories
125
45