def bind(self, fn: Callable[[Any], 'State']) -> 'State':
        r"""m >>= k = State $ \s -> let (a, s') = runState m s
                         in runState (k a) s'
        """

        def _(result: Any, state: Any) -> Tuple[Any, Any]:
            return fn(result).run(state)

        return State(lambda state: _(*self.run(state)))
def bind ( self , fn : Callable [ [ Any ] , 'State' ] ) -> 'State' : def _ ( result : Any , state : Any ) -> Tuple [ Any , Any ] : return fn ( result ) . run ( state ) return State ( lambda state : _ ( * self . run ( state ) ) )
r"""m >>= k = State $ \s -> let (a, s') = runState m s
                         in runState (k a) s'