public static IIdentityMonad <T> Share <T>(this IIdentityMonad <T> self) { return(new ShareCore <T>(self)); }
public ShareCore(IIdentityMonad <T> self) { _self = self; _lazy = Lazy.Create <T>(RunSelf); }
public static void Execute <T>(this IIdentityMonad <T> self) { self.RunIdentity(); }
public static void Execute <T>(this IIdentityMonad <T> self, Action <T> onValue) { T result = self.RunIdentity(); onValue(result); }
public static IIdentityMonad <T> If <T>(IIdentityMonad <T> thenSource, IIdentityMonad <T> elseSource, Func <bool> selector) { return(new IfStaticCore <T>(thenSource, elseSource, selector)); }
public IfStaticCore(IIdentityMonad <T> thenSource, IIdentityMonad <T> elseSource, Func <bool> selector) { _thenSource = thenSource; _elseSource = elseSource; _selector = selector; }
public static IIdentityMonad <TResult> SelectMany <TFirst, TSecond, TResult>(this IIdentityMonad <TFirst> self, Func <TFirst, IIdentityMonad <TSecond> > selector, Func <TFirst, TSecond, TResult> projector) { return(new SelectManyCore <TFirst, TSecond, TResult>(self, selector, projector)); }