from typing import Sequence
from typing import Callable
from typing import List
from typing import Any


def join(processors: Sequence[Callable[[List[Any]], List[Any]]])-> Callable[[List[Any]], List[Any]]:
    """
    Creates a processor from a list of processor.
    The processor created is equivalent to applying each of the passed processor
    in sequence over the result of the previous processor (after the result is
    flattened)

    * **processors**: a list of processors
    * **return** : a join processor

    >>> def double( elms):
    ...     result = []
    ...     for elm in elms:
    ...         result += [elm, elm]
    ...     return result
    ...
    >>> def add_one( elms):
    ...     result = []
    ...     for elm in elms:
    ...         result.append(elm + 1)
    ...     return result
    ...
    >>> pr = join([add_one, double])
    >>> pr( [1,100])
    [2, 2, 101, 101]
    >>> pr = join([double, add_one])
    >>> pr([1, 100])
    [2, 2, 101, 101]
    >>> pr = join([double, add_one, double])
    >>> pr([1, 100])
    [2, 2, 2, 2, 101, 101, 101, 101]
    """
    def inner(elms):
        result = elms
        for processor in processors:
            result = processor(result)
        return result
    return inner