lambda,functional-programming,category-theory,type-theory

Yes! It's called Curry–Howard–Lambek - it maps Category objects to types and morphisms to terms. So, typed lambda (function without name) or even function may be represented as cartesian-closed category, where Unite-type becomes a terminal object, set of types (or more complex structure) is product, and apply+currying is exponential.

computer-science,type-theory,computer-science-theory

Technically, it would be associative, but it depends a bit on how you are using it and how much you want (or need) to adhere to its definition. In many type systems, you only have two-type tuples, and every product type that contains more than two types is just two-type...

Solved with usage of ReflectionFunction: $add = function($x, $y) { return $x + $y; }; $x = new ReflectionFunction($add); $args = $x->getParameters(); var_dump(count($args)); // 2 ...