def is_bool_type(typ):
    """
    Check if the given type is a bool.
    """
    if hasattr(typ, '__supertype__'):
        typ = typ.__supertype__
    return isinstance(typ, type) and issubclass(typ, bool)