May be that’s the most crucial part of functional programming, and haskell has just designed/added other features too based on their purity principle, while python has followed the “Practicality beats purity**” principle.
And am beginning to see, nay grok the meaning of asynchronous call back/event-driven design. Still convinced, it’s over-hyped, but am barely beginning to imagine why it has created excitement among programmers. Kinda like monads(i.e isolating I/O)***, this design enables the programmer to focus on a single sequence of events, while letting the side-effects happen, whenever they do. What i don’t like though is the uncertainty involved.
And the functions are referentially transparent.(atleast AFAIK).And variable scoping is different from that of python. i.e. variable declared outside a function are not automatically available inside it. or for that variables from a caller in a callee(Well, neither does so in python).
But the http module objects response and request are available to the callback functions to a http module function.
Looking through the node.js, http module indicates that they have a exports special keyword and assign the objects they want exported as exports. = object. Interesting…….
*-Essentially like any other variable in the language.
**- Mentioned in import this.
*** – looks like i need to learn monad concepts better. I can see the analogy is either incomplete/wrong.