Ejemplo n.º 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);
 }
Ejemplo n.º 2
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));
        }
Ejemplo n.º 3
0
 /**
  * Produces a <i>bind</i> (<code>&gt;&gt;=</code>) computation with the
  * given initial computation and function to produce the subsequent
  * computation.
  *
  * @param c the initial computation.
  * @param f the function to produce the subsequent computation.
  * @return a bind computation.
  */
 public abstract Computation Bind(Computation c, IComputationFactory f);
Ejemplo n.º 4
0
 public override Computation Bind(Computation m, IComputationFactory f) {
     return new Bind(m, f);
 }
Ejemplo n.º 5
0
 /**
  * Produces a <i>bind</i> (<code>&gt;&gt;=</code>) computation with the
  * given initial computation and function to produce the subsequent
  * computation.
  *
  * @param c the initial computation.
  * @param f the function to produce the subsequent computation.
  * @return a bind computation.
  */
 public abstract Computation Bind(Computation c, IComputationFactory f);
Ejemplo n.º 6
0
 /**
  * Constructs a bind computation with the given sub-computation and
  * function to produce the next sub-computation.
  *
  * @param m the first sub-computation.
  * @param f the function to produce the second sub-computation.
  */
 public Bind(Computation c, IComputationFactory f)
 {
     this.c = c;
     this.f = f;
 }
Ejemplo n.º 7
0
 /**
  * Constructs a bind computation with the given sub-computation and
  * function to produce the next sub-computation.
  *
  * @param m the first sub-computation.
  * @param f the function to produce the second sub-computation.
  */
 public Bind(Computation c, IComputationFactory f)
 {
     this.c = c;
     this.f = f;
 }
Ejemplo n.º 8
0
 public override Computation Bind(Computation c, IComputationFactory f)
 {
     return(new Bind <T>(c, f));
 }
Ejemplo n.º 9
0
 public override Computation Bind(Computation m, IComputationFactory f)
 {
     return(new Bind(m, f));
 }