docs: def apply_log(a: tuple, func: Callable[[Any], Tuple[Any, Log]]) -> Tuple[Any, Log]:
          """Apply a function to a value with a log.
  
          Helper function to apply a function to a value with a log tuple.
          """
          value, log = a
          new, entry = func(value)
          return new, log + entry