Skip to content

v2.0.0 - Reworked Arrays.Protocol

Latest
Compare
Choose a tag to compare
@Qqwy Qqwy released this 07 Sep 09:26
· 21 commits to master since this release

Improves the Arrays.Protocol to be more friendly to implement. Specifically:

  • Remove implementations for Access.pop. Instead, throw an error when people try to use it.
  • Similarly, throw an error when :pop is used inside Access.get_and_update
  • Move empty from Access.Behaviour to Access.Protocol.
  • Alter handling of :default. It is no longer a required setting, and all arrays are able to work with a default passed to resize.
  • Related to above: Replace Arrays.Protocol.resize/2 with Arrays.Protocol.resize/3. (Arrays.resize/2 will call it with nil as third parameter).
  • size is no longer a required setting. Arrays.new/2 and Arrays.empty/1 have been edited to reflect this.

Improved tests, documentation, code examples.
Also, there now is some comprehensive benchmarking code that compares the various array implementations.