def bind(self, func: Callable[[Any], 'Writer']) -> 'Writer':
        """Flat is better than nested.

        Haskell:
        (Writer (x, v)) >>= f = let
            (Writer (y, v')) = f x in Writer (y, v `append` v')
        """
        a, w = self.run()
        b, w_ = func(a).run()

        if isinstance(w_, Monoid):
            w__ = cast(Monoid, w).append(w_)
        else:
            w__ = w + w_

        return Writer(b, w__)
Flat is better than nested.

        Haskell:
        (Writer (x, v)) >>= f = let
            (Writer (y, v')) = f x in Writer (y, v `append` v')