from typing import Callable


def constant(value: int) -> Callable[[], int]:
    """Returns a function that always returns the same ``value``."""

    def next() -> int:
        return value

    return next