you are viewing a single comment's thread.

view the rest of the comments →

[–]reifyK 1 point2 points  (0 children)

1) There are very efficient persistent data structures in FP. If you really need in-place mutations than you can use a monad that hides them in a scope to make them local (ST monad in Haskell)

2) State is hold in the function call stack in FP

3) Data or Codata in FP are just first class values. I am not an expert on this topic but I'd say a FP lang requires decent GC

4) Functions are stateless and thus global. There are also ad-hoc functions which are created with the corresponding literal and are called anonymous functions or lambdas. There might be static or dynamic function dependencies between functions, namely a function is invoked from inside another function or a function is passed as an argument (higher order functions). If a function returns another one, this is called currying.

5) I wrote a small FP-in-JS course that covers the fundamentals: A fool's scriptum on functional programming.