コード例 #1
0
 public IfDotted() : base("if_then_else_dotted", true,
                          new[]
 {
     Curry.ConstructFrom(a,
                         new Curry(b, Typs.Bool),
                         new Curry(b, a),
                         b),
     Curry.ConstructFrom(a,
                         new Curry(b, Typs.String),
                         new Curry(b, a),
                         b),
     Curry.ConstructFrom(a,
                         new Curry(b, Typs.Bool),
                         new Curry(b, a),
                         new Curry(b, a),
                         b),
     Curry.ConstructFrom(a,
                         new Curry(b, Typs.String),
                         new Curry(b, a),
                         new Curry(b, a),
                         b)
 }
                          )
 {
     Funcs.AddBuiltin(this, "ifdotted");
     Funcs.AddBuiltin(this, "ifDotted");
 }
コード例 #2
0
ファイル: Const.cs プロジェクト: pietervdvn/AspectedRouting
 public Const() : base("firstArg", true,
                       new[]
 {
     Curry.ConstructFrom(new Var("a"), new Var("a"), new Var("b"))
 }
                       )
 {
     Funcs.AddBuiltin(this, "const");
 }
コード例 #3
0
ファイル: NotEq.cs プロジェクト: pietervdvn/AspectedRouting
 public NotEq() : base("notEq", true,
                       new[]
 {
     Curry.ConstructFrom(Typs.Bool, new Var("a"), new Var("a")),
     Curry.ConstructFrom(Typs.String, new Var("a"), new Var("a")),
     new Curry(Typs.Bool, Typs.Bool),
 })
 {
     Funcs.AddBuiltin(this, "not");
 }
コード例 #4
0
        protected Function(string name, bool isBuiltin, IEnumerable <Curry> types)
        {
            Name = name;
            if (isBuiltin)
            {
                Funcs.AddBuiltin(this);
            }

            Types = types;
        }
コード例 #5
0
ファイル: If.cs プロジェクト: pietervdvn/AspectedRouting
 public If() : base("if_then_else", true,
                    new[]
 {
     Curry.ConstructFrom(a, Typs.Bool, a, a),
     Curry.ConstructFrom(a, Typs.Bool, a),
     Curry.ConstructFrom(a, Typs.String, a, a),
     Curry.ConstructFrom(a, Typs.String, a)
 }
                    )
 {
     Funcs.AddBuiltin(this, "if");
 }
コード例 #6
0
 public Min() : base("min", true,
                     new[]
 {
     new Curry(new ListType(Typs.Nat), Typs.Nat),
     new Curry(new ListType(Typs.Int), Typs.Int),
     new Curry(new ListType(Typs.PDouble), Typs.PDouble),
     new Curry(new ListType(Typs.Double), Typs.Double),
     new Curry(new ListType(Typs.Bool), Typs.Bool),
 })
 {
     Funcs.AddBuiltin(this, "and");
 }
コード例 #7
0
 public MustMatch() : base("must_match", true,
                           new[] {
     // [String] -> (Tags -> [string]) -> Tags -> bool
     Curry.ConstructFrom(Typs.Bool,                                       // Result type on top!
                         new ListType(Typs.String),                       // List of keys to check for
                         new Curry(Typs.Tags, new ListType(Typs.String)), // The function to execute on every key
                         Typs.Tags                                        // The tags to apply this on
                         )
 })
 {
     Funcs.AddBuiltin(this, "mustMatch");
 }
コード例 #8
0
 public Sum() : base("sum", true,
                     new[]
 {
     new Curry(new ListType(Typs.Nat), Typs.Nat),
     new Curry(new ListType(Typs.Int), Typs.Int),
     new Curry(new ListType(Typs.PDouble), Typs.PDouble),
     new Curry(new ListType(Typs.Double), Typs.Double),
     new Curry(new ListType(Typs.Bool), Typs.Int),
 })
 {
     Funcs.AddBuiltin(this, "plus");
     Funcs.AddBuiltin(this, "add");
 }
コード例 #9
0
 public FirstMatchOf() : base("first_match_of", true,
                              new[]
 {
     // [String] -> (Tags -> [a]) -> Tags -> a
     Curry.ConstructFrom(new Var("a"),     // Result type on top!
                         new ListType(Typs.String),
                         new Curry(Typs.Tags, new ListType(new Var("a"))),
                         Typs.Tags
                         )
 })
 {
     Funcs.AddBuiltin(this, "firstMatchOf");
 }