Skip to content

Commit

Permalink
FAQ. Close #244. Close #219. Close #213. Close #205. Close #198. Close
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
KtorZ committed Feb 20, 2016
2 parents 4631c31 + 978f5f2 commit ab1353b
Show file tree
Hide file tree
Showing 3 changed files with 134 additions and 0 deletions.
6 changes: 6 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ By opening a pull request to this repository, you agree to provide your work und

Errata and basic clarifications will be accepted if we agree that they improve the content. You can also open an issue so we can figure out how or if it needs to be addressed. If you've never done this before, the [flow guide](https://guides.github.com/introduction/flow/) might be useful.

## Questions or Clarifications

Please, have a look at the [FAQ](FAQ.md) before you open an issue. Your question may already
have been answered. Should you still need to ask something? Feel free to open an issue and to
explain yourself.

## Translations

Translations to other languages are highly encouraged. Each official translation will be held as a separate repository in the [MostlyAdequate organization](https://github.com/MostlyAdequate) and linked from the English version book.
Expand Down
123 changes: 123 additions & 0 deletions FAQ.md
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
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ See [CONTRIBUTING.md](CONTRIBUTING.md)

See [TRANSLATIONS.md](TRANSLATIONS.md)

### FAQ

See [FAQ.md](FAQ.md)



# Plans for the future

Expand Down

2 comments on commit ab1353b

@Soreine
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👏 👍

@longrunningprocess
Copy link

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 :-)

Please sign in to comment.