<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://en.formulasearchengine.com/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=163.1.211.0%2F24</id>
	<title>formulasearchengine - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://en.formulasearchengine.com/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=163.1.211.0%2F24"/>
	<link rel="alternate" type="text/html" href="https://en.formulasearchengine.com/wiki/Special:Contributions/163.1.211.0/24"/>
	<updated>2026-08-01T17:03:22Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.47.0-wmf.7</generator>
	<entry>
		<id>https://en.formulasearchengine.com/w/index.php?title=Mills_ratio&amp;diff=25102</id>
		<title>Mills ratio</title>
		<link rel="alternate" type="text/html" href="https://en.formulasearchengine.com/w/index.php?title=Mills_ratio&amp;diff=25102"/>
		<updated>2013-02-28T16:57:22Z</updated>

		<summary type="html">&lt;p&gt;163.1.211.98: Fixed the definition of the hazard rate&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;: &#039;&#039;Not to be confused with [[partial evaluation]]&#039;&#039;.&lt;br /&gt;
In [[computer science]], &#039;&#039;&#039;partial application&#039;&#039;&#039; (or &#039;&#039;&#039;partial function application&#039;&#039;&#039;) refers to the process of fixing a number of arguments to a function, producing another function of smaller [[arity]].  Given a function &amp;lt;math&amp;gt;\scriptstyle f \colon (X \times Y \times Z) \to N &amp;lt;/math&amp;gt;, we might fix (or &#039;bind&#039;) the first argument, producing a function of type &amp;lt;math&amp;gt; \scriptstyle\text{partial}(f) \colon (Y \times Z) \to N &amp;lt;/math&amp;gt;.  Evaluation of this function might be represented as &amp;lt;math&amp;gt;f_{partial}(2, 3)&amp;lt;/math&amp;gt;.  Note that the result of partial function application in this case is a function that takes two arguments.&lt;br /&gt;
&lt;br /&gt;
== Motivation ==&lt;br /&gt;
Intuitively, partial function application says &amp;quot;if you fix the first [[parameter (computer science)|argument]]s of the function, you get a function of the remaining arguments&amp;quot;. For example, if function &#039;&#039;div&#039;&#039; stands for the division operation &#039;&#039;x&#039;&#039; /  &#039;&#039;y&#039;&#039;, then &#039;&#039;div&#039;&#039; with the parameter &#039;&#039;x&#039;&#039; fixed at 1 (i.e. &#039;&#039;div&#039;&#039; 1) is another function: the same as the function &#039;&#039;inv&#039;&#039; that returns the multiplicative inverse of its argument, defined by &#039;&#039;inv&#039;&#039;(&#039;&#039;y&#039;&#039;) = 1 / &#039;&#039;y&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The practical motivation for partial application is that very often the functions obtained by supplying some but not all of the arguments to a function are useful; for example, many languages have a function or operator similar to &amp;lt;code&amp;gt;plus_one&amp;lt;/code&amp;gt;. Partial application makes it easy to define these functions, for example by creating a function that represents the addition operator with 1 bound as its first argument.&lt;br /&gt;
&lt;br /&gt;
== Implementations ==&lt;br /&gt;
&lt;br /&gt;
In languages such as [[ML (programming language)|ML]] and [[Haskell (programming language)|Haskell]] functions are defined in [[currying|curried]] form by default. Supplying fewer than the total number of arguments is referred to as partial application.&lt;br /&gt;
&lt;br /&gt;
In languages with [[first-class functions]] one can define &amp;lt;code&amp;gt;curry&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;uncurry&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;papply&amp;lt;/code&amp;gt; to perform currying and partial application explicitly. This might incur a greater run-time overhead due to the creation of additional [[closure (computer science)|closure]]s, while Haskell can use more efficient techniques.&amp;lt;ref&amp;gt;{{harvnb|Marlow|Peyton Jones|2004}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Scala (programming language)|Scala]] implements optional partial application with multiple parameter lists, e.g. def add(x)(y) { x+y};  add(1) returns an incrementing function.&lt;br /&gt;
&lt;br /&gt;
The [[C++]] standard library provides bind(function, args..) to return a [[functor]] that is the result of partial application of the given arguments to the given function.&lt;br /&gt;
&lt;br /&gt;
== Definitions ==&lt;br /&gt;
In the [[simply-typed lambda calculus]] with [[function type|function]] and [[product type]]s (λ&amp;lt;sup&amp;gt;→,&amp;amp;times;&amp;lt;/sup&amp;gt;) partial application, currying and uncurrying can be defined as:&lt;br /&gt;
* &amp;lt;code&amp;gt;papply&amp;amp;nbsp;&amp;lt;/code&amp;gt; : (((&#039;&#039;a&#039;&#039; &amp;amp;times; &#039;&#039;b&#039;&#039;) → &#039;&#039;c&#039;&#039;) &amp;amp;times; &#039;&#039;a&#039;&#039;) → (&#039;&#039;b&#039;&#039; → &#039;&#039;c&#039;&#039;) = λ(&#039;&#039;f&#039;&#039;, x). λy. f (x, y)&lt;br /&gt;
* &amp;lt;code&amp;gt;curry&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;/code&amp;gt; : ((&#039;&#039;a&#039;&#039; &amp;amp;times; &#039;&#039;b&#039;&#039;) → &#039;&#039;c&#039;&#039;) → (&#039;&#039;a&#039;&#039; → (&#039;&#039;b&#039;&#039; → &#039;&#039;c&#039;&#039;)) = λf. λx. λy. f (x, y)&lt;br /&gt;
* &amp;lt;code&amp;gt;uncurry&amp;lt;/code&amp;gt; : (&#039;&#039;a&#039;&#039; → (&#039;&#039;b&#039;&#039; → &#039;&#039;c&#039;&#039;)) → ((&#039;&#039;a&#039;&#039; &amp;amp;times; &#039;&#039;b&#039;&#039;) → &#039;&#039;c&#039;&#039;) = λf. λ(x, y). f x y&lt;br /&gt;
&lt;br /&gt;
Note that &amp;lt;code&amp;gt;curry&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;papply&amp;lt;/code&amp;gt; = &amp;lt;code&amp;gt;curry&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[Currying]]&lt;br /&gt;
* [[η-conversion]]&lt;br /&gt;
* [[POP-2]]&lt;br /&gt;
&lt;br /&gt;
== Notes ==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Further reading ==&lt;br /&gt;
* [[Simon Marlow]] and [[Simon Peyton Jones]] (2004, 2006). [http://research.microsoft.com/en-us/um/people/simonpj/papers/eval-apply/eval-apply-icfp.ps &amp;quot;Making a Fast Curry: Push/Enter vs. Eval/Apply for Higher-order Languages&amp;quot;]. &#039;&#039;ICFP &#039;04 Proceedings of the ninth ACM SIGPLAN international conference on Functional programming&#039;&#039;.&lt;br /&gt;
* [[Benjamin C. Pierce]] et al. [http://www.cis.upenn.edu/~bcpierce/sf/Poly.html#lab97 &amp;quot;Partial Application&amp;quot;], [http://www.cis.upenn.edu/~bcpierce/sf/Poly.html#lab98 &amp;quot;Digression: Currying&amp;quot;]. &#039;&#039;Software Foundations&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== External links ==&lt;br /&gt;
* [http://rosettacode.org/wiki/Partial_function_application Partial function application] on Rosetta code.&lt;br /&gt;
* [http://www.haskell.org/haskellwiki/Partial_application Partial application] at Haskell Wiki&lt;br /&gt;
&lt;br /&gt;
* [http://www.haskell.org/haskellwiki/Constant_applicative_form Constant applicative form] at Haskell Wiki&lt;br /&gt;
* [http://ocaml.janestreet.com/?q=node/30 The dangers of being too partial]&lt;br /&gt;
&lt;br /&gt;
[[Category:Functional programming]]&lt;br /&gt;
[[Category:Implementation of functional programming languages]]&lt;/div&gt;</summary>
		<author><name>163.1.211.98</name></author>
	</entry>
</feed>