コード例 #1
0
        public Stream <TIn, TIn> Fold <TIn> (Func <TOut, TIn, TIn> fn, TIn initAccValue)
        {
            var(Stream, Pusher) = FolderStream <TOut, TIn> .GetAccumulableStream(fn, initAccValue, this);

            _streamer = Pusher;
            return(Stream);
        }
コード例 #2
0
        public Stream <double, double> Min(Func <TOut, double> fn)
        {
            Func <TOut, double, double> folder = ((x, acc) => { var nx = fn(x); return(nx < acc ? nx : acc); });

            var(Stream, Pusher) = FolderStream <TOut, double> .GetAccumulableStream(folder, double.MaxValue, this);

            _streamer = Pusher;
            return(Stream);
        }