from typing import Callable
from typing import List


def bool_map(
        items: list, true_fn: Callable, false_fn: Callable, bool_arr: List[bool]
    ) -> list:
    """ 
        Iterates over items and applies either true_fn or false_fn depending 
            on wether bool_arr ir true or false respectiely.

        Both true_fn and false_fn take 2 arguments:
            item , index
    """
    return [
        true_fn(items[i], i) if bool_arr[i] else false_fn(items[i], i) 
        for i in range(len(items))
    ]