I hereby claim:
- I am artisin on github.
- I am artisin (https://keybase.io/artisin) on keybase.
- I have a public key whose fingerprint is F120 4AB0 1E07 4C0B 470C 631B 84EC DBCA 1509 0620
To claim this, I am signing this object:
{ | |
"name": "module-name", | |
"version": "0.0.1", | |
"description": "An example module to illustrate the usage of a package.json", | |
"author": "Your Name <[email protected]>", | |
"license": "MIT", | |
"contributors": [{ | |
"name": "Foo Bar", | |
"email": "[email protected]" | |
}], |
I hereby claim:
To claim this, I am signing this object:
<snippet> | |
<content><![CDATA[ | |
<div class="codemirror-fixture" data-example="${1:name}"></div>]]></content> | |
<tabTrigger>-fx</tabTrigger> | |
<scope>text.html.markdown.multimarkdown, text.html.markdown</scope> | |
<description>data-example</description> | |
</snippet> | |
<snippet> |
// Lost Grid v5.1.6 - https://github.com/corysimmons/lost | |
$gutter = 30px | |
$rtl = false | |
$flexbox = true | |
/** | |
* Sets a translucent background color to all elements it affects. Helpful while setting up, or debugging, the structure of your site to make sure all items are cleared correctly. | |
* |
Function: a bunch of code you can call. It can take any number of parameters, and it can have a name.
Closure: The context, or variables and their values around the function when it was defined.
Generator: a special function that can yield more than one result when called in a loop. Generator functions also have closures.
So to shortly answer to your question: functions can't do anything a generator cannot do; or, generators can do more. And they all have closures.
Here's a simple example to understand closures:
var safeHead = function(xs) {
return S.ifElse(() => R.isNil(xs[0]), S.Nothing, S.Just, xs[0]);
};
const streetName = S.pipe([R.prop('addresses'), safeHead, R.map(R.prop('street'))]);
streetName({
addresses: []
});