# AUTOGENERATED! DO NOT EDIT! File to edit: ../nbs/100_itrs.ipynb.

# %% auto 0
__all__ = ['allmap', 'alltype', 'allint', 'alldig']

# %% ../nbs/100_itrs.ipynb 4
import inspect
from numbers import Number
from typing import Any, Type, Callable, Iterable, TypeGuard

# %% ../nbs/100_itrs.ipynb 5
from .core import isiter, isint, isstr
from .strs import isdig
from .wrap import vanilla, isguard

# %% ../nbs/100_itrs.ipynb 7
def allmap(x, f: Callable[[Any], TypeGuard[Type]]) -> bool:
    return isiter(x) and all(map(f, x))

def alltype(x, t: type) -> bool:
    return isiter(x) and all([vanilla(t)(y) for y in x])

def allint(x): return allmap(x, isint)

def alldig(x): return isiter(x) and allmap(x, isdig)
