示例#1
0
 /**
  * Maps the given function across the list of results and returns a list
  * consisting of the flattened contents of all the generated lists of
  * results.
  *
  * @param f the function to map across the list of results.
  */
 internal List MapAppend(IComputationFactory f)
 {
     var result = new ArrayList();
     foreach (var o in list)
     {
         var ri = (List)f.Make(o).Apply();
         result.AddRange(ri.list);
     }
     return new List(result);
 }
示例#2
0
文件: List.cs 项目: maxisam/csharp
        /**
         * Maps the given function across the list of results and returns a list
         * consisting of the flattened contents of all the generated lists of
         * results.
         *
         * @param f the function to map across the list of results.
         */
        internal List MapAppend(IComputationFactory f)
        {
            var result = new ArrayList();

            foreach (var o in list)
            {
                var ri = (List)f.Make(o).Apply();
                result.AddRange(ri.list);
            }
            return(new List(result));
        }
示例#3
0
文件: Bind.cs 项目: maxisam/csharp
        /**
         * Applies the bind computation to the given state.
         *
         * @param state the current contents of the state.
         * @return the result of applying the bind computation.
         */
        public override IResut Apply(Object state)
        {
            var a1 = (Pair)this.c.Apply(state);

            return(f.Make(a1.Value()).Apply(a1.State()));
        }