/functional-javascript

Collecting stuff on how to write decent code in JS

Primary LanguageJavaScript

functional-javascript

Overcoming OO adiction through JS, and opening the doors of perceptions for new languages, as Scala, Elixir, Erlang, Haskell, Lisp and JS frameworks like Redux. The course will follow the mini-book on functional javascript programming: https://drboolean.gitbooks.io/mostly-adequate-guide/content/

why

  1. Modularity - A software is modular to the extend that its parts can be separated and recombined. -> [Reusable, Testable, Parallelizable].
  2. Compositionality - Software is compositional to the extent that the meaning of the whole is constructed from the meaning of its parts -> [Scalable, Reasonable]
  3. Think about how powerful numbers are, you use them for billions of different cases, they are a super reusable model. But if you had to multiply 3 chairs vs 3 cars, the power of numbers would be completely limitated.

opinions

  1. https://www.reddit.com/r/programming/comments/3zey0z/after_decades_of_neglect_functional_programming/

javascript becoming functional

  1. purescript
  2. ramda
  3. elm

new abstractions

  1. Pure functions
  2. Currying
  3. First Class Functions
  4. Composing
  5. Functors
  6. Aplicatives
  7. Monads
  1. Recursion
  2. Lifting
  3. Destructuring Assignment

let's analyse a monad implementation

  1. https://github.com/santoshrajan/monadjs

what can you do with func. languages

  1. Spark
  2. Massive connections (erlang/whatsapp)
  3. Real Time Communications

references

https://www.youtube.com/watch?v=dkZFtimgAcM https://www.amberbit.com/blog/2015/6/14/closures-elixir-vs-ruby-vs-javascript/ http://fr.umio.us/favoring-curry/ https://andreypopp.com/posts/2014-07-21-fighting-node-callbacks-with-purescript.html https://drboolean.gitbooks.io/mostly-adequate-guide/content/ https://www.sitepoint.com/recursion-functional-javascript/ http://es6-features.org/#ArrayMatching http://adit.io/posts/2013-06-10-three-useful-monads.html https://www.youtube.com/watch?v=m3svKOdZijA&app=desktop http://randycoulman.com/blog/categories/thinking-in-ramda/ http://www.aaronhsmith.com/2015/09/08/introduction-monads-javascript/ -> good!
http://jrsinclair.com/articles/2016/marvellously-mysterious-javascript-maybe-monad/ https://james-forbes.com/?/posts/the-perfect-api https://github.com/fantasyland/fantasy-land