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"); }
public Const() : base("firstArg", true, new[] { Curry.ConstructFrom(new Var("a"), new Var("a"), new Var("b")) } ) { Funcs.AddBuiltin(this, "const"); }
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"); }
protected Function(string name, bool isBuiltin, IEnumerable <Curry> types) { Name = name; if (isBuiltin) { Funcs.AddBuiltin(this); } Types = types; }
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"); }
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"); }
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"); }
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"); }
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"); }