nbt v0.2.0 NBT.Util

Utility functions for NBT parsing

Link to this section Summary

Functions

Unfold a value into a list.

Link to this section Functions

Link to this function

partial_unfold(data, step, finish)

Specs

partial_unfold(any(), (any() -> nil | {any(), any()}), (any() -> any())) ::
  {list(), any()}

Unfold a value into a list.

Returns a tuple containing the list and the remaining tail after an early return. A wrapup function is accepted to clean up the accumulator to make early returns easier. Ends the partial_unfold if step returns nil.