Exemplo n.º 1
0
 public static IIdentityMonad <T> Share <T>(this IIdentityMonad <T> self)
 {
     return(new ShareCore <T>(self));
 }
Exemplo n.º 2
0
 public ShareCore(IIdentityMonad <T> self)
 {
     _self = self;
     _lazy = Lazy.Create <T>(RunSelf);
 }
Exemplo n.º 3
0
 public static void Execute <T>(this IIdentityMonad <T> self)
 {
     self.RunIdentity();
 }
Exemplo n.º 4
0
        public static void Execute <T>(this IIdentityMonad <T> self, Action <T> onValue)
        {
            T result = self.RunIdentity();

            onValue(result);
        }
Exemplo n.º 5
0
 public static IIdentityMonad <T> If <T>(IIdentityMonad <T> thenSource, IIdentityMonad <T> elseSource, Func <bool> selector)
 {
     return(new IfStaticCore <T>(thenSource, elseSource, selector));
 }
Exemplo n.º 6
0
 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));
 }