-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
…#194. Close #193. Close #192. Close #176. Close #175. Close #169. Close #168. Close #161. Close #139. Close #129. Close #121. Close #109. Close #108. Close #105. Close #83. Close #82. Close #77. Close #76. Close #62. Close #50. Close #6.
- Loading branch information
Showing
3 changed files
with
134 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,123 @@ | ||
## FAQ | ||
|
||
- [Why are snippets written sometimes with semicolons and sometimes | ||
without?](#why-are-snippets-written-sometimes-with-semicolons-and-sometimes-without) | ||
- [Aren't external libraries like _ (ramda) or $ (jquery) making calls impure?](#arent-external-libraries-like-ramda-or-jquery-making-calls-impure) | ||
- [What is the meaning of `f a` in signature?](#what-is-the-meaning-of-f-a-in-signature) | ||
- [Is there any "real world" examples available?](#is-there-any-real-world-examples-available) | ||
- [Why does the book uses ES5? Is any ES6 version available?](#why-does-the-book-uses-es5-is-any-es6-version-available) | ||
- [What the heck is that reduce function about?](#what-the-heck-is-that-reduce-function-about) | ||
- [Wouldn't you use a simplified English rather than the current style?](#wouldnt-you-use-a-simplified-english-rather-than-the-current-style) | ||
- [What is Either? What is Future? What is Task?](#what-is-either-what-is-future-what-is-task) | ||
- [Where do map, filter, compose ... methods come from?](#where-do-map-filter-compose-methods-come-from) | ||
|
||
### Why are snippets written sometimes with semicolons and sometimes without? | ||
|
||
> see [#6] | ||
There are two schools in JavaScript, people who use them, and people who don't. We've made the | ||
choice here to use them, and now, we strive to be consistent with that choice. If some are | ||
missing, please let us know and will take care of the oversight. | ||
|
||
### Aren't external libraries like _ (ramda) or $ (jquery) making calls impure? | ||
|
||
> see [#50] | ||
Those dependencies are available as if they were in the global context, part of the language. | ||
So, no, calls can still be considered as pure. | ||
For further reading, have a look at [this article about | ||
CoEffects](http://tomasp.net/blog/2014/why-coeffects-matter/) | ||
|
||
### What is the meaning of `f a` in signature? | ||
|
||
> see [#62] | ||
In a signature, like: | ||
|
||
`map :: Functor f => (a -> b) -> f a -> f b` | ||
|
||
`f` refers to a `functor` that could be for instance Maybe or IO. Thus, the signature abstracts | ||
the choice of that functor by using a type variable which basically means that any functor | ||
might be used where `f` stands as long as all `f` are of the same type (if the first `f a` in | ||
the signature represents a `Maybe a`, then the second one **cannot refer to** an `IO b` but | ||
should be a `Maybe b`. For instance: | ||
|
||
```javascript | ||
let maybeString = Maybe.of("Patate") | ||
let f = function (x) { return x.length } | ||
let maybeNumber = map(f, maybeString) // Maybe(6) | ||
|
||
// With the following 'refined' signature: | ||
// map :: (string -> number) -> Maybe string -> Maybe number | ||
``` | ||
|
||
### Is there any "real world" examples available? | ||
|
||
> see [#77], [#192] | ||
Should you haven't reached it yet, you may have a look at the [Chapter | ||
6](https://github.com/MostlyAdequate/mostly-adequate-guide/blob/master/ch6.md) which present a | ||
simple flickr application. | ||
Other examples are likely to come later on. By the way, feel free to share with us your | ||
experience! | ||
|
||
### Why does the book uses ES5? Is any ES6 version available? | ||
|
||
> see [#83], [#235] | ||
The book aims at being widely accessible. It started before ES6 went out, and now, as the new | ||
standard is being more and more accepted, we are considering making two separated editions with | ||
ES5 and ES6. Members of the community are already working on the ES6 version (have a look to | ||
[#235] for more informations). | ||
|
||
### What the heck is that reduce function about? | ||
|
||
> see [#109] | ||
Reduce, accumulate, fold, inject are all usual functions in functional programming used to | ||
combine the elements of a data structure successively. You might have a look at [this | ||
talk](https://www.youtube.com/watch?v=JZSoPZUoR58&ab_channel=NewCircleTraining) to get some | ||
more insights about the reduce function. | ||
|
||
### Wouldn't you use a simplified English rather than the current style? | ||
|
||
> see [#176] | ||
The book is written in its own style which contributes to make it consistent as a whole. If | ||
you're not familiar with English, see it as a good training. Nevertheless, should you need help | ||
to understand the meaning sometimes, there are now [several | ||
translations](https://github.com/MostlyAdequate/mostly-adequate-guide/blob/master/TRANSLATIONS.md) | ||
available that could probably help you. | ||
|
||
### What is Either? What is Future? What is Task? | ||
|
||
> see [#194] | ||
We introduce all of those structure throughout the book. Therefore, you won't find any use of a | ||
structure that hasn't previously be defined. Do not hesitate to read again some old parts if | ||
you ever feel uncomfortable with those types. | ||
A glossary/vade mecum will come at the end to synthesize all these notions. | ||
|
||
### Where do map, filter, compose ... methods come from? | ||
|
||
> see [#198] | ||
Most of the time, those methods are defined in specific vendor libraries such as `ramda` or | ||
`underscore`. You should also have a look to | ||
[support.js](https://github.com/MostlyAdequate/mostly-adequate-guide/blob/master/code%2Fpart1_exercises%2Fsupport.js) | ||
in which we define several implementations used for the exercises. Those functions are really | ||
common in functional programming and even though their implementations may vary a bit, their | ||
meanings remain fairly consistent between libraries. | ||
|
||
|
||
[#6]: https://github.com/MostlyAdequate/mostly-adequate-guide/issues/6 | ||
[#50]: https://github.com/MostlyAdequate/mostly-adequate-guide/issues/50 | ||
[#62]: https://github.com/MostlyAdequate/mostly-adequate-guide/issues/62 | ||
[#77]: https://github.com/MostlyAdequate/mostly-adequate-guide/issues/77 | ||
[#83]: https://github.com/MostlyAdequate/mostly-adequate-guide/issues/83 | ||
[#109]: https://github.com/MostlyAdequate/mostly-adequate-guide/issues/109 | ||
[#176]: https://github.com/MostlyAdequate/mostly-adequate-guide/issues/176 | ||
[#192]: https://github.com/MostlyAdequate/mostly-adequate-guide/issues/192 | ||
[#194]: https://github.com/MostlyAdequate/mostly-adequate-guide/issues/194 | ||
[#198]: https://github.com/MostlyAdequate/mostly-adequate-guide/issues/198 | ||
[#235]: https://github.com/MostlyAdequate/mostly-adequate-guide/pull/235 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ab1353b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👏 👍
ab1353b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Much clearer for me :-)