DEV Community

Discussion on: De-throning the List: Part Deux

Collapse
 
robinheghan profile image
Robin Heggelund Hansen • Edited

My intent is that [1,2,3] creates an Array instead of List, and that pattern matching is removed. x :: rest would translate into (Array.get 0 array, Array.slice 1 length array), which isn't the fastest way to do things. This is the topic of my next post.

Collapse
 
rupertlssmith profile image
Rupert Smith

Is this for 0.19? It would be helpful to know if all code that uses List constructor pattern matching is going to be broken.

It would also be possible to keep the pattern matching, but have a compiler intrinsic for handling it in the case of Lists.

Thread Thread
 
robinheghan profile image
Robin Heggelund Hansen

I doubt i’ll get this done before 0.19 but even if I was, i’m not a core developer so it wouldn’t be certain that this stuff made it in anyway.

Thread Thread
 
rupertlssmith profile image
Rupert Smith

Ok helpful to know, you are currently just experimenting with stuff but no particular version where it will be introduced.

I don't have much code that uses List constructor pattern matching, so it is perhaps not such a big deal if that went away. It might be worth grepping all published Elm repositories too to get a feel for how much they are used.

I come from a Java background so choosing data structure implementations is natural to me. I do remember during your talk at Elm Europe last year, a Python developer asking why Elm has so many data structure types and how to choose between them. So I do think this List/Array merge is a positive direction to go in.