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; })); }
public static ILendable <A> MakeLazy <A>(this ILendable <A> lendable) { return(new Deferred <A>(() => new Lazy <A>(() => lendable.GetLease()))); }
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)))); }
public static ILendable <B> SelectMany <A, B>(this ILendable <A> lendable, Func <A, ILendable <B> > f) { return(lendable.Bind(f)); }
public static ILendable <B> Select <A, B>(this ILendable <A> lendable, Func <A, B> f) { return(lendable.Map(f)); }
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)); }
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)))); }
public Result(TDescription description, ILendable <TValue> value) { m_Description = description; m_Value = value; }
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)); }
public static B Extract <A, B>(this ILendable <A> lendable, Func <A, B> callback) { return(lendable.GetLease().Extract(callback)); }
public static void Extract <A>(this ILendable <A> lendable, Action <A> callback) { lendable.GetLease().Extract(callback); }
public Bound(ILendable <TInput> lendable, Func <ILease <TInput>, ILease <ILendable <TOutput> > > func) : base(lendable, lease => func(lease).Bind(x => x.GetLease())) { }
public Mapped(ILendable <TInput> lendable, Func <ILease <TInput>, ILease <TOutput> > func) : base(() => func(lendable.GetLease())) { }
public CheckedFilterOutput(TCheck description, ILendable <IFilterBase <IFilterOutput <TDescription, TValue> > > compiler) : base(compiler.GetLease) { m_Description = description; }
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))); }
public static void Extract <A>(this ILendable <A> output, Action <A> callback) { LendableHelper.Extract(output, callback); }
public static ILendable <B> MapLease <A, B>(this ILendable <A> lendable, Func <ILease <A>, ILease <B> > f) { return(new Mapped <A, B>(lendable, f)); }
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))); }
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))); }
public static IFilterOutput <A, X> Return <A, X>(A description, ILendable <X> value) { return(new Result <A, X>(description, value)); }
public CompiledFilter(TCheck description, ILendable <IFilterBase <IFilterOutput <TDescription, TValue> > > compiler) : base(description, compiler) { }