Esempio n. 1
0
 private static ILease <Y> Do <X, Y>(this ILendable <Y> output, Action <X, Y> render, ILease <X> lease)
 {
     return(lease.Extract(value =>
     {
         var target = output.GetLease();
         render(value, target.Value);
         return target;
     }));
 }
Esempio n. 2
0
 public static ILendable <A> MakeLazy <A>(this ILendable <A> lendable)
 {
     return(new Deferred <A>(() => new Lazy <A>(() => lendable.GetLease())));
 }
Esempio n. 3
0
 public static ILendable <C> SelectMany <A, B, C>(this ILendable <A> lendable, Func <A, ILendable <B> > bind, Func <A, B, C> select)
 {
     return(lendable
            .Bind((a) => bind(a)
                  .Map((b) => select(a, b))));
 }
Esempio n. 4
0
 public static ILendable <B> SelectMany <A, B>(this ILendable <A> lendable, Func <A, ILendable <B> > f)
 {
     return(lendable.Bind(f));
 }
Esempio n. 5
0
 public static ILendable <B> Select <A, B>(this ILendable <A> lendable, Func <A, B> f)
 {
     return(lendable.Map(f));
 }
Esempio n. 6
0
 public static IFilter <B, Y> Compile <A, B, Y>(A description, ILendable <IFilterBase <IFilterOutput <B, Y> > > compiler)
     where A : B, IEquatable <B>
 {
     return(new CompiledFilter <A, B, Y>(description, compiler));
 }
Esempio n. 7
0
 private static ILendable <Y> Do <X, Y>(this ILendable <Y> output, Action <X, Y> render, ILendable <X> input)
 {
     return(input.MapLease(lease => new Lazy <Y>(() => output.Do(render, lease))));
 }
Esempio n. 8
0
 public Result(TDescription description, ILendable <TValue> value)
 {
     m_Description = description;
     m_Value       = value;
 }
Esempio n. 9
0
 public static ILendable <B> BindLease <A, B>(this ILendable <A> lendable, Func <ILease <A>, ILease <ILendable <B> > > f)
 {
     return(new Bound <A, B>(lendable, f));
 }
Esempio n. 10
0
 public static B Extract <A, B>(this ILendable <A> lendable, Func <A, B> callback)
 {
     return(lendable.GetLease().Extract(callback));
 }
Esempio n. 11
0
 public static void Extract <A>(this ILendable <A> lendable, Action <A> callback)
 {
     lendable.GetLease().Extract(callback);
 }
Esempio n. 12
0
 public Bound(ILendable <TInput> lendable, Func <ILease <TInput>, ILease <ILendable <TOutput> > > func)
     : base(lendable, lease => func(lease).Bind(x => x.GetLease()))
 {
 }
Esempio n. 13
0
 public Mapped(ILendable <TInput> lendable, Func <ILease <TInput>, ILease <TOutput> > func)
     : base(() => func(lendable.GetLease()))
 {
 }
Esempio n. 14
0
 public CheckedFilterOutput(TCheck description, ILendable <IFilterBase <IFilterOutput <TDescription, TValue> > > compiler)
     : base(compiler.GetLease)
 {
     m_Description = description;
 }
Esempio n. 15
0
 public static IFilterOutput <B, Y> Do <B, X, Y>(this IFilterOutput <B, Y> output, Action <X, Y> render, ILendable <X> input)
 {
     return(Return(output.Description, output.Do <X, Y>(render, input)));
 }
Esempio n. 16
0
 public static void Extract <A>(this ILendable <A> output, Action <A> callback)
 {
     LendableHelper.Extract(output, callback);
 }
Esempio n. 17
0
 public static ILendable <B> MapLease <A, B>(this ILendable <A> lendable, Func <ILease <A>, ILease <B> > f)
 {
     return(new Mapped <A, B>(lendable, f));
 }
Esempio n. 18
0
 public static ILendable <B> Bind <A, B>(this ILendable <A> lendable, Func <A, ILendable <B> > f)
 {
     return(new Bound <A, B>(lendable, x => x.Map(f)));
 }
Esempio n. 19
0
 public static ILendable <B> Map <A, B>(this ILendable <A> lendable, Func <A, B> f)
 {
     return(new Mapped <A, B>(lendable, x => x.Map(f)));
 }
Esempio n. 20
0
 public static IFilterOutput <A, X> Return <A, X>(A description, ILendable <X> value)
 {
     return(new Result <A, X>(description, value));
 }
Esempio n. 21
0
 public CompiledFilter(TCheck description, ILendable <IFilterBase <IFilterOutput <TDescription, TValue> > > compiler)
     : base(description, compiler)
 {
 }