def create(cls, class_name: str, monoid_type=Union[Monoid, str]):
        """Create Writer subclass using specified monoid type.

        lets us create a Writer that uses a different monoid than str for
        the log.
        """

        def unit(cls, value):
            if hasattr(monoid_type, "empty"):
                log = monoid_type.empty()
            else:
                log = monoid_type()

            return cls(value, log)

        return type(class_name, (Writer, ), dict(unit=classmethod(unit)))
def create ( cls , class_name : str , monoid_type = Union [ Monoid , str ] ) : def unit ( cls , value ) : if hasattr ( monoid_type , "empty" ) : log = monoid_type . empty ( ) else : log = monoid_type ( ) return cls ( value , log ) return type ( class_name , ( Writer , ) , dict ( unit = classmethod ( unit ) ) )
Create Writer subclass using specified monoid type.

        lets us create a Writer that uses a different monoid than str for
        the log.