I have a genuine interest in the answers to this as it is one of the things putting me off learning an otherwise very interesting paradigm.
I have a genuine interest in the answers to this as it is one of the things putting me off learning an otherwise very interesting paradigm.
For a clean answer to function + event-driven, see Erlang, which will blow pretty much any other attempt to solve the problems Erlang solves out of the water. Functional doesn't have a problem with event-based, functional blows imperative and OO out of the water at event-based. (Partially because it's a lot easier to write sophisticated runtime like Haskell's or Erlang's that can transparently deal with sync issues that drive imperative programs crazy.) Not enough people are good enough at both OO and functional for this to be commonly understood.
You'll know functional languages have entered the mainstream to stay when someone writes a useful functional GUI.
> programming a GUI or other heavily event-driven environment
Nitrogen is a nice event-based GUI library written in erlang. Have a look at the demos here: http://nitrogenproject.com/demos
Indeed. Haskell for example, just `tags' all side-effecting code in the type system. You are free to use lots of side-effects in Haskell. (Even though that would miss the point of the language.)
But check out node.js for the rest of your pain. It is very event driven and can easily be coded completely side-effect free due to closures.