ciren / cilib

Typesafe, purely functional Computational Intelligence
https://cilib.net
Apache License 2.0
124 stars 101 forks source link

Prefer the use of a NonEmptyVector #323

Closed gpampara closed 3 years ago

gpampara commented 3 years ago

This PR translates the use of NonEmptyList for a more specialised NonEmptyVector that wraps the Chunk from zio.

The result is a large performance increase with lower memory usage because Chunks do not box primitives and are array-based. The zio.NonEmptyChunk is not used because it exposes some unsafe operations for the context of cilib and we therefore replicate the type internally without allowing the implicit conversion to Chunk from NonEmptyChunk.