@@ -0,0 +1,674 @@
+import abc%0Afrom typing import Generic, Callable, Any, TypeVar%0A%0AA = TypeVar('A')%0A%0A%0Aclass Transformer(Generic%5BA%5D, metaclass=abc.ABCMeta):%0A%0A    def __init__(self, val: A) -%3E None:%0A        self.val = val%0A%0A    @abc.abstractmethod%0A    def flat_map(self, f: Callable%5B%5BA%5D, Any%5D) -%3E 'Transformer':%0A        ...%0A%0A    def __floordiv__(self, f):%0A        return self.flat_map(f)%0A%0A    def effect(self, f: Callable%5B%5BA%5D, Any%5D):%0A        f(self.val)%0A        return self%0A%0A    def __matmul__(self, f):%0A        return self.effect(f)%0A%0A    def effect0(self, f: Callable%5B%5B%5D, Any%5D):%0A        f()%0A        return self%0A%0A    def __mod__(self, f):%0A        return self.effect0(f)%0A%0A__all__ = ('Transformer')%0A

add Transformer base class