示例#1
0
        /// <summary>
        /// Converts a list of applicative groups into a Haxl monad.
        /// </summary>
        public static Haxl ToFetch(List<ApplicativeGroup> split, string parentBind, Scope parentScope)
        {
            if (parentScope == null) parentScope = Scope.New();
            Haxl finalFetch = null;
            Action<Func<Scope, Haxl>> bindToFinal = f =>
            {
                finalFetch = finalFetch == null ? f(parentScope) : finalFetch.Bind(f);
            };

            foreach (var applicative in split)
            {
                bindToFinal(ApplicativeToHaxl(applicative, parentBind));
            }
            return finalFetch;
        }
示例#2
0
 public SelectScope(object selectValue, Scope scope) : base(scope)
 {
     _selectValue = selectValue;
 }
示例#3
0
 public Scope(Scope scope)
 {
     boundVariables = new Dictionary<string, object>();
     parentScope = scope;
 }
示例#4
0
 public Scope()
 {
     boundVariables = new Dictionary<string, object>();
     parentScope = null;
 }