Beispiel #1
0
        public IsNumberConstraint()
        {
            Inner = new Port(nameof(Inner),
                             @in => GraphOp.Lift(Domains.Any));

            Result = new Port(nameof(Result),
                              @in => GraphOp.Lift(Domains.Any));
        }
Beispiel #2
0
        public GreaterThanConstraint()
        {
            Left = new Port(nameof(Left),
                            @in => GraphOp.Lift(Domains.Any));

            Right = new Port(nameof(Right),
                             @in => GraphOp.Lift(Domains.Any));

            Result = new Port(nameof(Result),
                              @in => GraphOp.Lift(Domains.Any));
        }
Beispiel #3
0
 public Var(string name)
 {
     Port = new Port($"Var({name})",
                     @in => GraphOp.Lift(Domains.Any));
 }
Beispiel #4
0
 public static GraphOp <TResult> Select <TSource, TResult>(this GraphOp <TSource> source, Func <TSource, TResult> select)
 => env =>
 {
     var(env2, v) = source(env);
     return(env2, select(v));
 };
Beispiel #5
0
 public static GraphOp <TOut> From <TOut>(GraphOp <TOut> graphOp)
 => graphOp;
Beispiel #6
0
 public static GraphOp <Nil> EffectOnly <T>(this GraphOp <T> op)
 => op.Select(_ => default(Nil));
Beispiel #7
0
 public static GraphOp <Nil> Assert(GraphOp <Port> graphOp)
 => from port in graphOp
 from _ in Assert(port)
 select _;