Array vs List in Elm

后端 未结 3 1719
感情败类
感情败类 2021-02-12 12:32

I was suprised to learn that Array and List were two different types in Elm:

  • Array

  • List

In my case,

3条回答
  •  [愿得一人]
    2021-02-12 12:49

    Only use Array if you need to use Array.get.

    In most cases you should use List because usually you can do everything you need with foldl, map, etc. without having to get items from an index, and List has better performance with these functions.

提交回复
热议问题