private IEnumerator _Do(IMonad <T> m) { yield return(m.Do()); if (m.Error != null) { Error = m.Error; } }
// create a coroutine and resume it until the monad is finished static void _Wait <T>(IMonad <T> monad) { var co = new Coroutine(monad.Do()); while (!co.Finished) { co.Resume(0.03f); } }
private IEnumerator _Do(IMonad <T> m) { yield return(m.Do()); if (m.Error != null && _onlyCompleted) { yield break; } _any = m; }