ElixirWeekly: The Elixir Community Newsletter, covering community news you easily miss, shared on ElixirStatus and the web, in one email every Thursday.
Morphix is a small library of convenience methods for manipulating Enums, including flattening lists and tuples, converting strings to atoms, and odder things.
partiphify method divides a list into k balanced sublists, such that:
> Morphix.partiphify!([:a,:b,:c,:d,:e,:f,:g,:h,:i,:j], 4) [[:e, :f], [:g, :h], [:i, :a, :b], [:j, :c, :d]]
The difference between
Enum.chunk is twofold: first, you always get k sublists, even if one or more are empty, and second, the output list sizes are balanced. The use case it was designed for was dividing a list of inputs across a fixed number of workers.