Bunch v0.1.2 Bunch.Struct View Source

A bunch of functions for easier manipulation on structs.

Link to this section Summary

Functions

Wraps Bunch.Access.delete_in/2 to make it work with structs that do not implement Access behaviour

Wraps Bunch.Access.get_and_update_in/3 to make it work with structs that do not implement Access behaviour

Wraps Bunch.Access.get_in/2 to make it work with structs that do not implement Access behaviour

Wraps Bunch.Access.pop_in/2 to make it work with structs that do not implement Access behaviour

Wraps Bunch.Access.put_in/3 to make it work with structs that do not implement Access behaviour

Wraps Bunch.Access.update_in/3 to make it work with structs that do not implement Access behaviour

Link to this section Functions

Link to this function delete_in(struct, keys) View Source
delete_in(struct(), Access.key() | [Access.key()]) :: struct()

Wraps Bunch.Access.delete_in/2 to make it work with structs that do not implement Access behaviour.

Link to this function get_and_update_in(struct, keys, f) View Source
get_and_update_in(struct(), Access.key() | [Access.key()], (a -> {b, a})) ::
  {b, struct()}
when a: Access.value(), b: any()

Wraps Bunch.Access.get_and_update_in/3 to make it work with structs that do not implement Access behaviour.

Wraps Bunch.Access.get_in/2 to make it work with structs that do not implement Access behaviour.

Link to this function pop_in(struct, keys) View Source
pop_in(struct(), Access.key() | [Access.key()]) :: {Access.value(), struct()}

Wraps Bunch.Access.pop_in/2 to make it work with structs that do not implement Access behaviour.

Wraps Bunch.Access.put_in/3 to make it work with structs that do not implement Access behaviour.

Link to this function update_in(struct, keys, f) View Source
update_in(
  struct(),
  Access.key() | [Access.key()],
  (Access.value() -> Access.value())
) :: struct()

Wraps Bunch.Access.update_in/3 to make it work with structs that do not implement Access behaviour.