Bunch.Struct (Bunch v1.6.3)

View Source

A bunch of functions for easier manipulation on structs.

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.

Functions

delete_in(struct, keys)

@spec 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.

get_and_update_in(struct, keys, f)

@spec 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.

get_in(struct, keys)

@spec get_in(
  struct(),
  Access.key() | [Access.key()]
) :: Access.value()

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

pop_in(struct, keys)

@spec 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.

put_in(struct, keys, v)

@spec put_in(struct(), Access.key() | [Access.key()], Access.value()) ::
  Access.value()

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

update_in(struct, keys, f)

@spec 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.