コード例 #1
0
ファイル: GraphOps.cs プロジェクト: jasonholloway/hoodie
 public static DisjunctOp <Domain> Zap(params Port[] ports)
 => BaseOps.Bind(Enumerable
                 .Repeat((Bindable)Domains.Never, 1)
                 .Concat(ports.Select(p => (Bindable)p)));
コード例 #2
0
ファイル: GraphOps.cs プロジェクト: jasonholloway/hoodie
        //and so bind creates a fresh env fragment
        //which then gets merged in to the whole
        //but the fundamental operation here is the merge
        //so binding is really about forming a small env and merging it in

        //
        //so firtly we need to create atoms of envs: what does the smallest graph have?
        //simple - a binding; and to have a binding, it must have a port;
        //we could have a graph with a port with an empty binding
        //
        //but every graph has bindings for every possible port - this is the graph's, and the ports', original state
        //the graph by itself says for every port: you are unconstrained!
        //the first, smallest atom of information is a narrowing of the smallest possible thing, which would be one port
        //
        //so, smallest graph: a single port domain, like a splinter
        //what is this smallest unit? an atom! no, something negative - peccadillo, flaw, sin, narrowing, atom again
        //a binding - which is already a negative term; a Bind
        //
        //Binds are as always monoidal
        //are they commutative too? I think so, yes: they should always sit in their proper order
        //
        //

        public static DisjunctOp <Domain> Bind(params Bindable[] bindables)
        => BaseOps.Bind(bindables.AsEnumerable());