from typing import List
from typing import Tuple
from typing import Callable


def _include_details(details: List[Tuple], lambda_for_field: Callable) -> List[Tuple]:
    """Details for logging one type within another.

    Args:
        details (List[Tuple]): details for logging the included type.
        lambda_for_field (Callable): lambda for extracting the included value from the type.

    Returns:
        Details for logging the inner type.
    """

    # To understand the bound variable voodoo, see: https://stackoverflow.com/questions/19837486/lambda-in-a-loop
    return [(d[0], d[1], lambda xx, bound_d2=d[2]: bound_d2(lambda_for_field(xx))) for d in details]