q2K BHP
Black History Portal
THE BHP WIRE —
HIDDEN TRUTHS
What's New!
THE JOURNEY THROUGH TIME

Explore Black History

Explore the people, places, events, achievements, struggles and stories that shaped our journey.

✊🏾

Civil Rights

Movements, leaders, victories and the continuing fight for equality.

⚙️

Black Inventors

Innovation, patents, science, technology and world-changing contributions.

🏆

Sports

Pioneers, champions, Negro Leagues, records, activism and excellence.

♟️

People

Meet the people whose lives, choices and achievements shaped the journey.

📍

Places

Black towns, communities, institutions and places where history happened.

📜

Events

Moments that changed communities, movements, institutions and the nation.

Enter a person, place, event, or topic.
MY'STORY

The MOVE Fire

This is a personal recollection on the Move fire on May 13, 1985 Philadelphia police fired thousands of rounds at the MOVE house, city officials approved dropping an explosive device on the roof, the resulting fire was allowed to burn, 11 people—including five children—died, and 61 homes were destroyed. Philadelphia City Council later called it a “brutal attack carried out by the City of Philadelphia on its own citizens” and acknowledged that no individual faced criminal consequences for the bombing. One timeline correction worth preserving for the BHP record: the major previous MOVE-police confrontation was August 8, 1978, about seven years before the bombing, not a year or two earlier. Officer James Ramp was killed, other police and firefighters were wounded, nine MOVE members were later convicted, and television cameras recorded police beating Delbert Africa during his arrest. The 1985 MOVE Commission later specifically criticized city planners for failing to adequately use lessons from that 1978 confrontation. And that actually strengthens the point you’re making: 1985 did not happen without precedent or institutional memory. There had already been a deadly confrontation with MOVE, years of conflict, negotiations and police involvement before Osage Avenue.

MORE →
BLACK FACTS
The Truths They Never Taught You...

Katherine Johnson — Mathematics to the Moon

Katherine Johnson’s mathematical calculations helped guide some of America’s most important early space missions while she confronted the racial and gender barriers faced by Black women in twentieth-century America.

MORE →
BHP gathered finds from its connected research sources. Showing the 4 strongest Black History matches.
← BACK TO RESULTS
Wikipedia

Function application

In mathematics, function application (or evaluation) is the act of taking a function and an input from its domain to obtain the corresponding value from its range. In this sense, function application can be thought of as the opposite of function abstraction.[1]

It is central to programming languages derived from lambda calculus, such as LISP and Scheme, and also in functional languages. It has a role in the study of the denotational semantics of computer programs, because it is a continuous function on complete partial orders. Function application is also a continuous function in homotopy theory, and, indeed underpins the entire theory: it allows a homotopy deformation to be viewed as a continuous path in the space of functions. Likewise, valid mutations (refactorings) of computer programs can be seen as those that are "continuous" in the Scott topology.

Representation

[edit]

Function application is usually depicted by juxtaposing the variable representing the function with its argument encompassed in parentheses. For example, the following expression represents the application of the function ƒ to its argument x.

In some instances, a different notation is used where the parentheses aren't required, and function application can be expressed just by juxtaposition. For example, the following expression can be considered the same as the previous one:

The latter notation is especially useful in combination with the currying isomorphism. Given a function , its application is represented as by the former notation and (or with the argument written with the less common angle brackets) by the latter. However, functions in curried form can be represented by juxtaposing their arguments: , rather than . This relies on function application being left-associative.

When mathematical notation is represented in a digital document, the invisible zero-width Unicode characters U+2061 FUNCTION APPLICATION and U+2062 INVISIBLE TIMES can be used to distinguish concatenation meaning function application from concatenation meaning multiplication.

As an operator

[edit]

Function application can be defined as an operator, called apply or , by the following definition:

The operator may also be denoted by a backtick (`).

If the operator is understood to be of low precedence and right-associative, the application operator can be used to cut down on the number of parentheses needed in an expression. For example;

can be rewritten as:

This can be equivalently expressed using function composition as:

or even:

if one considers to be a constant function returning .

Set theory

[edit]

In axiomatic set theory, especially Zermelo–Fraenkel set theory, a function is often defined as a relation () having the property that, for any there is a unique such that .

One is usually not content to write "" to specify that , and usually wishes for the more common function notation "" . Function application, or more specifically, the notation "", is not present in the usual signature of set theory, but may be added to the theory as a binary function symbol if desired without any loss of expressiveness by defining:[2]

Or, more formally:[3][4]

where denotes set exponentiation: the set of all functions from to .

In prose: if there exists a domain and range such that is a function from to and ; or (the negation of former) and The choice of using the empty set when is undefined is arbitrary to ensure that the notation defined for the entire domain of discourse.[5]

If denotes the formula on the right side of the biconditional above, for any two sets, the formula associates a unique object : . Therefore the language of set theory can use an extension by definition to include the function application operation conservatively.

Programming

[edit]

In computer programming, function application often refers to calling or executing a procedure, rather than a true mathematical function (see functions in computer programing), with similar rules for its behavior.

Function application corresponds to beta reduction in lambda calculus.

Apply function

[edit]

Related to the apply operator, the function apply applies a function to a variable list of arguments. Eval and apply are the two interdependent components of the eval-apply cycle in Lisp, described in SICP.[6] This is supported in languages with variadic functions, because this is the only way to call a function with an indeterminate (at compile time) number of arguments.

Common Lisp and Scheme

[edit]

In Common Lisp apply is a function that applies a function to a list of arguments (note here that "+" is a variadic function that takes any number of arguments):

(apply #'+ (list 1 2))

Similarly in Scheme:

(apply + (list 1 2))

C++

[edit]

In C++, Bind [7] is used either via the std namespace or via the boost namespace.

C# and Java

[edit]

In C# and Java, variadic arguments are simply collected in an array. Caller can explicitly pass in an array in place of the variadic arguments. This can only be done for a variadic parameter. It is not possible to apply an array of arguments to non-variadic parameter without using reflection. An ambiguous case arises should the caller want to pass an array itself as one of the arguments rather than using the array as a list of arguments. In this case, the caller should cast the array to Object to prevent the compiler from using the apply interpretation.

variadicFunc(arrayOfArgs);

With version 8 lambda expressions were introduced. Functions are implemented as objects with a functional interface, an interface with only one non-static method. The standard interface

Function<T,R>

consist of the method (plus some static utility functions):

R apply(T para)

Go

[edit]

In Go, typed variadic arguments are simply collected in a slice. The caller can explicitly pass in a slice in place of the variadic arguments, by appending a ... to the slice argument. This can only be done for a variadic parameter. The caller can not apply an array of arguments to non-variadic parameters, without using reflection..

s := []string{"foo", "bar"}
variadicFunc(s...)

JavaScript

[edit]

In JavaScript, function objects have an apply method, the first argument is the value of the this keyword inside the function; the second is the list of arguments:

func.apply(null, args);

ES6 adds the spread operator func(...args)[8] which may be used instead of apply.

Lua

[edit]

In Lua, apply can be written this way:

function apply(f,...)
  return f(...)
end

Perl

[edit]

In Perl, arrays, hashes and expressions are automatically "flattened" into a single list when evaluated in a list context, such as in the argument list of a function

# Equivalent subroutine calls:
@args = (@some_args, @more_args);
func(@args);

func(@some_args, @more_args);

PHP

[edit]

In PHP, apply is called call_user_func_array:

call_user_func_array('func_name', $args);

Python and Ruby

[edit]

In Python and Ruby, the same asterisk notation used in defining variadic functions is used for calling a function on a sequence and array respectively:

func(*args)

Python originally had an apply function, but this was deprecated in favour of the asterisk in 2.3 and removed in 3.0.[9]

R

[edit]

In R, do.call constructs and executes a function call from a name or a function and a list of arguments to be passed to it:

f(x1, x2)
# can also be performed via
do.call(what = f, args = list(x1, x2))

Smalltalk

[edit]

In Smalltalk, block (function) objects have a valueWithArguments: method which takes an array of arguments:

aBlock valueWithArguments: args

Tcl

[edit]

Since Tcl 8.5,[10] a function can be applied to arguments with the apply command

apply func ?arg1 arg2 ...?

where the function is a two element list {args body} or a three element list {args body namespace}.

Universal property

[edit]

Consider a function , that is, where the bracket notation denotes the space of functions from A to B. By means of currying, there is a unique function . Then Apply provides the universal morphism

,

so that

or, equivalently one has the commuting diagram

More precisely, curry and apply are adjoint functors.

The notation for the space of functions from A to B occurs more commonly in computer science. In category theory, however, is known as the exponential object, and is written as . There are other common notational differences as well; for example Apply is often called Eval,[11] even though in computer science, these are not the same thing, with eval distinguished from Apply, as being the evaluation of the quoted string form of a function with its arguments, rather than the application of a function to some arguments.

Also, in category theory, curry is commonly denoted by , so that is written for curry(g). This notation is in conflict with the use of in lambda calculus, where lambda is used to denote bound variables. With all of these notational changes accounted for, the adjointness of Apply and curry is then expressed in the commuting diagram

Universal property of the exponential object
Universal property of the exponential object

The articles on exponential object and Cartesian closed category provide a more precise discussion of the category-theoretic formulation of this idea. Thus the use of lambda here is not accidental; the internal language of Cartesian closed categories is simply typed lambda calculus. The most general possible setting for Apply are the closed monoidal categories, of which the cartesian closed categories are an example. In homological algebra, the adjointness of curry and apply is known as tensor-hom adjunction.

Topological properties

[edit]

In order theory, in the category of complete partial orders endowed with the Scott topology, both curry and apply are continuous functions (that is, they are Scott continuous).[12] This property helps establish the foundational validity of the study of the denotational semantics of computer programs.

In algebraic geometry and homotopy theory, curry and apply are both continuous functions when the space of continuous functions from to is given the compact open topology, and is locally compact Hausdorff. This result is very important, in that it underpins homotopy theory, allowing homotopic deformations to be understood as continuous paths in the space of functions.

Other instances

[edit]

The Curry–Howard correspondence relates function application to the logical rule of modus ponens.

See also

[edit]

References

[edit]
  1. ↑ Alama, Jesse; Korbmacher, Johannes (2023), "The Lambda Calculus", in Zalta, Edward N.; Nodelman, Uri (eds.), The Stanford Encyclopedia of Philosophy (Winter 2023 ed.), Metaphysics Research Lab, Stanford University, retrieved 2024-02-29
  2. ↑ Mendelson, Elliott (2015). Introduction to Mathematical Logic (6th ed.). CRC Press. pp. 102–103, 231, 235, 245–246. ISBN 978-1-4822-3778-8.
  3. ↑ Suppes, Patrick (1972). Axiomatic set theory. Internet Archive. New York, Dover Publications. p. 87. ISBN 978-0-486-61630-8.
  4. ↑ Lévy, Azriel (1979). Basic set theory. Berlin; New York: Springer-Verlag. p. 27. ISBN 978-0-387-08417-6.
  5. ↑ Lévy, Azriel (1979). Basic set theory. Berlin; New York: Springer-Verlag. p. 15. ISBN 978-0-387-08417-6.
  6. ↑ Harold Abelson, Gerald Jay Sussman, Julie Sussman, Structure and Interpretation of Computer Programs, (1996) MIT Press, ISBN 0-262-01153-0. See Section 4.1, The Metacircular Evaluator
  7. ↑ "Boost: Bind.HPP documentation - 1.49.0".
  8. ↑ "Spread syntax - JavaScript | MDN". Retrieved 2017-04-20.
  9. ↑ "Non-essential built-in functions". Python Library Reference. 8 February 2005. Retrieved 19 May 2013.
  10. ↑ "apply". Tcl documentation. 2006. Retrieved 23 June 2014.
  11. ↑ Saunders Mac Lane, Category Theory
  12. ↑ H.P. Barendregt, The Lambda Calculus, (1984) North-Holland ISBN 0-444-87508-5

Source: Wikipedia. Article content is retrieved live through the MediaWiki API.

No preview image
Wikipedia

Function application

In mathematics, function application (or evaluation) is the act of taking a function and an input from its domain to obtain the corresponding value from its range. In this sense, function application can be thought of as the opposite of function abstraction. It is central to programming languages derived from lambda calculus, such as LISP and Scheme, and also in functional languages. It has a role in the study of the denotational semantics of computer programs, because it is a continuous function on complete partial orders. Function application is also a continuous function in homotopy theory, and, indeed underpins the entire theory: it allows a homotopy deformation to be viewed as a continuous path in the space of functions. Likewise, valid mutations (refactorings) of computer programs can be seen as those that are "continuous" in the Scott topology.

MORE →
No preview image
Wikipedia

Partial application

In computer science, partial application (or partial function application) refers to the process of fixing a number of arguments of a function, producing another function of smaller arity. Given a function f : ( X × Y × Z ) → N {\displaystyle f\colon (X\times Y\times Z)\to N} , we might fix (or 'bind') the first argument, producing a function of type partial ( f ) : ( Y × Z ) → N {\displaystyle {\text{partial}}(f)\colon (Y\times Z)\to N} . Evaluation of this function might be represented as f partial ( 2 , 3 ) {\displaystyle f_{\text{partial}}(2,3)} . Note that the result of partial function application in this case is a function that takes two arguments. Partial application is sometimes incorrectly called currying, which is a related, but distinct concept.

MORE →
Wikipedia

Equality (mathematics)

In mathematics, equality is a relationship between two quantities or expressions, stating that they have the same value, or represent the same mathematical object. Equality between A and B is denoted with an equals sign as A = B, and read "A equals B". A written expression of equality is called an equation or identity depending on the context. Two objects that are not equal are said to be distinct. Equality is often considered a primitive notion, meaning it is not formally defined, but rather informally said to be "a relation each thing bears to itself and nothing else". This characterization is notably circular ("nothing else"), reflecting a general conceptual difficulty in fully characterizing the concept. Basic properties about equality like reflexivity, symmetry, and transitivity have been understood intuitively since at least the ancient Greeks, but were not symbolically stated as general properties of relations until the late 19th century by Giuseppe Peano. Other properties like substitution and function application weren't formally stated until the development of symbolic logic. There are generally two ways that equality is formalized in mathematics: through logic or through set theory. In logic, equality is a primitive predicate (a statement that may have free variables) with the reflexive property (called the law of identity), and the substitution property. From those, one can derive the rest of the properties usually needed for equality. After the foundational crisis in mathematics at the turn of the 20th century, set theory (specifically Zermelo–Fraenkel set theory) became the most common foundation of mathematics. In set theory, any two sets are defined to be equal if they have all the same members. This is called the axiom of extensionality.

MORE →
No preview image
Wikipedia

Combinatory logic

Combinatory logic is a notation to eliminate the need for quantified variables in mathematical logic. It was introduced by Moses Schönfinkel and Haskell Curry, and has more recently been used in computer science as a theoretical model of computation and also as a basis for the design of functional programming languages. It is based on combinators, which were introduced by Schönfinkel in 1920 with the idea of providing an analogous way to build up functions — and to remove any mention of variables — particularly in predicate logic. A combinator is a higher-order function that uses only function application and earlier defined combinators to define a result from its arguments.

MORE →
TOPIC OF THE DAY

Greenwood / Black Wall Street

Before the 1921 destruction of Tulsa’s Greenwood District, Black residents had created a remarkable center of business and community life. The district included stores, professional offices, entertainment venues and homes owned by Black citizens. Understanding Greenwood means learning what was built—not only what was burned.

MORE →
TRIVIA QUESTION OF THE DAY

What prosperous Tulsa district became widely known as “Black Wall Street”?

The Greenwood District.