Skip to content

Instantly share code, notes, and snippets.

@devboy
Created November 27, 2011 14:04
Show Gist options
  • Save devboy/1397601 to your computer and use it in GitHub Desktop.
Save devboy/1397601 to your computer and use it in GitHub Desktop.
function multiply( x: Float, y: Float ): Float
{
return x * y;
}
// now we create a partial function, with a preset parameters
var multiplyByTen = Funk.partial( multiply, 10 );
// now we can call multiplyByTen to multiply a number by ten
var num = multiplyByTen(5); // num = 50
// the created function multiplyByThen does actually look like this:
function multiplyByTen(p0:Float):Float
{
return multiply( 10, p0 );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment