Exemplo n.º 1
0
        public S Compute <S>(
            Func <Node, IEnumerable <Node> > unfold,
            Func <Node, IEnumerable <S>, S> fold,
            CancellationToken cancel = default(CancellationToken))
        {
            var ctok = cancel == default(CancellationToken) ? null : ASTComputationBase.MkControlToken(cancel, Nodes.Node.CancelCheckFreq);

            return(new ASTComputation <S>(this.node, unfold, fold, ctok).Compute());
        }
Exemplo n.º 2
0
        public S Compute <S>(
            AST <Node> otherTree,
            Func <Node, Node, Tuple <IEnumerable <Node>, IEnumerable <Node> > > unfold,
            Func <Node, Node, IEnumerable <S>, S> fold,
            CancellationToken cancel = default(CancellationToken))
        {
            var ctok = cancel == default(CancellationToken) ? null : ASTComputationBase.MkControlToken(cancel, Nodes.Node.CancelCheckFreq);

            return(new ASTComputation2 <S>(node, otherTree.Node, unfold, fold, ctok).Compute());
        }