https://github.com/imteekay/functional-programming-learning-path
https://github.com/danieljharvey/functional-programming-is-boring
https://github.com/hemanth/functional-programming-jargon
WHY U SHOULD CARE ABOUT FP:
it is useless to try to model your program as objects (as if they were real life concepts) - because programming is not real life
Functional programming is simply a more advanced solution for programming in a way where you separate the Data and the Functions that will be performed on them.
By using FP, you aren’t trying to force a failed modeling onto your program, and your also allowing a much higher degree of maintainability and trustabiltiy of your own code by dealing with common pitfalls (lack of testability, mutability, nulls, exceptions, inheritance), and also you have an easier time creating and extending your application thanks to greater function composition and code reusability, and overall less boilerplate that comes from classes
- Code as data: Code can be treated as data, and it can be created, passed into, and returned from functions.
- Pure functions have no side effects—that is, there is no global data.
- Data is immutable.
https://spectrum.ieee.org/functional-programming
How FP Languages outperform traditional imperative languages?
Functional programming languages can achieve high performance in a number of ways, including:
- Lazy evaluation: Functional programming languages often use lazy evaluation, which means that expressions are only evaluated when they are needed. This can lead to more efficient memory usage and faster program execution, as unused computations are not performed.
- Pure functions: Functional programming languages encourage the use of pure functions, which have no side effects and always return the same output given the same input. This allows for more efficient function composition and optimization, as functions can be safely reordered or parallelized without affecting the outcome.
- Type inference: Many functional programming languages use type inference, which allows the compiler to deduce the types of variables and expressions without the need for explicit type annotations. This can lead to more efficient code, as the compiler can make better optimizations based on the inferred types.
- Strong typing: Functional programming languages often have strong typing, which helps catch errors early and ensure that data is used in the correct way. This can lead to more efficient code, as errors are caught at compile-time rather than at runtime.
- Concurrency and parallelism: Functional programming languages have strong support for concurrency and parallelism, which allows for more efficient use of hardware resources.
Some specific examples of functional programming languages and their approaches to achieving high performance are:
- Haskell achieves high performance through lazy evaluation, pure functions, and efficient garbage collection. Haskell also has a highly optimized runtime system and supports parallelism through its lightweight threads.
- OCaml achieves high performance through efficient memory management, type inference, and support for mutable data structures. OCaml also has good support for concurrency through its lightweight threads.
- Elixir achieves high performance through its actor-based concurrency model, which allows for efficient and scalable parallelism. Elixir also uses the Erlang virtual machine, which is designed for high concurrency and fault tolerance.
- F# achieves high performance through its strong typing, which allows for efficient use of hardware resources. F# also has good support for parallelism through its asynchronous workflows and parallel sequence computation.
In summary, functional programming languages achieve high performance through a combination of lazy evaluation, pure functions, type inference, strong typing, concurrency and parallelism, and efficient memory management. Each language may emphasize different approaches depending on its specific design goals and target use cases.
https://www.youtube.com/watch?v=vzfy4EKwG_Y
![[Untitled 385.png|https://jrsinclair.com/articles/2018/how-to-deal-with-dirty-side-effects-in-your-pure-functional-javascript/]]


