from typing import Callable
from typing import Any
from typing import Optional


def maybe_map(f: Callable[[Any], Any], value: Optional[Any]) -> Optional[Any]:
    """
    Return `f(value)` if `value` is not `None` else `None`.
    """
    if value is not None:
        return f(value)
    return None