DEV Community

Discussion on: De-throning the List: Summary

Collapse
 
robinheghan profile image
Robin Heggelund Hansen

Mostly because it’s inefficient, but that might be fixed in the future

Collapse
 
herteby profile image
Simon Herteby

Ah I see. Surely it'll be more efficient than people writing their own though. Here's mine 😅

remove : Int -> List a -> List a
remove index list =
    list
        |> List.indexedMap Tuple.pair
        |> List.filter (\( i, _ ) -> i /= index)
        |> List.map Tuple.second