public static FuncyList <T> Take <T>(this FuncyList <T> source, int count) { if (source.IsNil || count <= 0) { return(FuncyList <T> .Nil()); } return(FuncyList <T> .Construct(((IEnumerable <T>)source).Take <T>(count).ToArray())); }
public FuncyList <TReturn> Apply <TReturn>(FuncyList <Func <T, TReturn> > f) { if (f.IsCons) { return(FuncyList <TReturn> .Construct(f.ToList().SelectMany(fCons => this.FMap(fCons)).ToArray())); } else { return(FuncyList <TReturn> .Nil()); } }
public static FuncyList <T> ToFuncyList <T>(this NonEmptyList <T> self) { return(FuncyList <T> .Construct(self.ToArray())); }
public override FuncyList <TReturn> ComputeWith <TReturn>(Func <T, FuncyList <TReturn> > f) { return(FuncyList <TReturn> .Construct(this.SelectMany(h => f(h)).ToArray())); }
public FuncyList <T> Point(T value) { return(FuncyList <T> .Construct(value)); }