Hello.
I'm interested in learning Functional Programming and to add it to my tool set. I'm having problems, however, in approaching problem solving in a functional way rather then an object oriented way.
I can spend time (working through SICP at the moment) learning more about the algorithms and tools like currying, memoization, lazy evaluation (that we dont have in js land) etcetera, but most of the articles I read are written in an ideal situation where I would want the circumference or area of a circle... and not my situation where I want to make a program that does something actually useful to ME (Node.js servers). I don't understand well enough where to keep the larger pieces of data in functional programming.
The thing I want to make at the moment is a 'platform' of 10 or so HTTP/TCP servers that talk to eachother. I want to pull as much functionality out of a website into a stateless server on the network that I can call from any site.
In object oriented terms I would solve it somewhat like this:
class Service extends EventEmitter
(options) ->
@version = options.version
@registry = seaport.connect 'localhost', 9000
@server = net.create-server!
@port = null
start: ->
stop: ->
And then I'd subclass Service for different kinds of services I want and have a commandline / admin interface tool to spawn and start instances of these classes on a host/port on the network somewhere. Libraries already take care of most of the work so I'm just talking about where to keep and group the data in your program.