> This module is useful when integrating with JavaScript libraries which use arrays, but immutable arrays are not a practical data structure for many use cases due to their poor asymptotics. > Depending on your use-case, you may prefer to use Data.List or Data.Sequence instead
> This module is useful when integrating with JavaScript libraries which use arrays, but immutable arrays are not a practical data structure for many use cases due to their poor asymptotics. > Depending on your use-case, you may prefer to use Data.List or Data.Sequence instead
изредка индексы всё же бывают нужны и тогда это осознанное решение, фолдить с индексом и потом каждый раз бегать по списку — медленнее, чем просто использовать массив, он же всё равно типа иммутабельный
там дело не в пурскрипте, а в библиотеках, которые используют не оптимальные решения (вроде втыкания везде массивов вместо lists или sequences) https://github.com/purescript/purescript-arrays/issues/13 https://groups.google.com/forum/#!topic/purescript/uF-SqphMeEg Фил из 2015: > I don't like the idea of reserving [] syntax for lists. [] is only supported now because Array is defined in the Prim module, which is baked into the compiler. I would rather we write Array for array, and List for list, explicitly in code.