Пример #1
0
        public static void Execute <TEnvironment, TValue>(this IReaderMonad <TEnvironment, TValue> self, TEnvironment environment, Action <TValue> onValue)
        {
            TValue result = self.Run(environment);

            onValue(result);
        }
Пример #2
0
 public ShareCore(IReaderMonad <TEnvironment, TValue> self, TEnvironment environmen)
 {
     _self        = self;
     _environment = environmen;
     _lazy        = Lazy.Create <TValue>(RunSelf);
 }
Пример #3
0
 public static IIdentityMonad <TValue> Share <TEnvironment, TValue>(this IReaderMonad <TEnvironment, TValue> self, TEnvironment environment)
 {
     return(new ShareCore <TEnvironment, TValue>(self, environment));
 }
Пример #4
0
 public IfCore(IReaderMonad <TEnvironment, TValue> self, IReaderMonad <TEnvironment, TValue> elseSource, Func <TValue, bool> selector)
 {
     _self       = self;
     _elseSource = elseSource;
     _selector   = selector;
 }
Пример #5
0
 public static IReaderMonad <TEnvironment, TValue> If <TEnvironment, TValue>(this IReaderMonad <TEnvironment, TValue> self, IReaderMonad <TEnvironment, TValue> elseSource, Func <TValue, bool> selector)
 {
     return(new IfCore <TEnvironment, TValue>(self, elseSource, selector));
 }
Пример #6
0
 public static IReaderMonad <TEnvironment, TValue> If <TEnvironment, TValue>(IReaderMonad <TEnvironment, TValue> thenSource, IReaderMonad <TEnvironment, TValue> elseSource, Func <bool> selector)
 {
     return(new IfStaticCore <TEnvironment, TValue>(thenSource, elseSource, selector));
 }
Пример #7
0
 public static IReaderMonad <TEnvironment, TEnvironment> Ask <TEnvironment, TValue>(this IReaderMonad <TEnvironment, TValue> self, Func <TEnvironment, TEnvironment> selector)
 {
     return(new AskSelectCore <TEnvironment, TValue>(self, selector));
 }
Пример #8
0
 public AskCore(IReaderMonad <TEnvironment, TValue> self)
 {
 }
Пример #9
0
 public static IReaderMonad <TEnvironment, TEnvironment> Ask <TEnvironment, TValue>(this IReaderMonad <TEnvironment, TValue> self)
 {
     return(new AskCore <TEnvironment, TValue>(self));
 }
Пример #10
0
 public static IReaderMonad <TEnvironment, TResult> Select <TEnvironment, TValue, TResult>(this IReaderMonad <TEnvironment, TValue> self, Func <TValue, TResult> selector)
 {
     return(new SelectCore <TEnvironment, TValue, TResult>(self, selector));
 }
Пример #11
0
 public SelectCore(IReaderMonad <TEnvironment, TValue> self, Func <TValue, TResult> selector)
 {
     _self     = self;
     _selector = selector;
 }
Пример #12
0
 public DoCore(IReaderMonad <TEnvironment, TValue> self, Action <TValue> action)
 {
     _self   = self;
     _action = action;
 }
Пример #13
0
 public static IReaderMonad <TEnvironment, TValue> Do <TEnvironment, TValue>(this IReaderMonad <TEnvironment, TValue> self, Action <TValue> action)
 {
     return(new DoCore <TEnvironment, TValue>(self, action));
 }
Пример #14
0
 public static IReaderMonad <TEnvironment, TResult> SelectMany <TEnvironment, TFirst, TSecond, TResult>(this IReaderMonad <TEnvironment, TFirst> self, Func <TFirst, IReaderMonad <TEnvironment, TSecond> > selector, Func <TFirst, TSecond, TResult> projector)
 {
     return(new SelectManyCore <TEnvironment, TFirst, TSecond, TResult>(self, selector, projector));
 }
Пример #15
0
 public static void Execute <TEnvironment, TValue>(this IReaderMonad <TEnvironment, TValue> self, TEnvironment environment)
 {
     self.Run(environment);
 }
Пример #16
0
 public AskSelectCore(IReaderMonad <TEnvironment, TValue> self, Func <TEnvironment, TEnvironment> selector)
 {
     _selector = selector;
 }
 public static IIdentityMonad <TValue> ToIdentity <TEnvironment, TValue>(this IReaderMonad <TEnvironment, TValue> self, TEnvironment environment)
 {
     return(self.Share(environment));
 }
Пример #18
0
 public IfStaticCore(IReaderMonad <TEnvironment, TValue> thenSource, IReaderMonad <TEnvironment, TValue> elseSource, Func <bool> selector)
 {
     _thenSource = thenSource;
     _elseSource = elseSource;
     _selector   = selector;
 }