示例#1
0
文件: FuncyList.cs 项目: forki/Funcy
        public static FuncyList <T> Construct(params T[] args)
        {
            FuncyList <T> result = FuncyList <T> .Nil();

            for (int i = args.Length - 1; i >= 0; i--)
            {
                result = FuncyList <T> .Cons(args[i], result);
            }

            return(result);
        }
示例#2
0
文件: FuncyList.cs 项目: forki/Funcy
 public override FuncyList <TReturn> FMap <TReturn>(Func <T, TReturn> f)
 {
     return(FuncyList <TReturn> .Cons(f(this.head), this.tail.FMap(f)));
 }