DEV Community

Discussion on: Getting started with fp-ts: Monad

Collapse
 
hath995 profile image
Aaron Elligsen • Edited

It was a bit meandering but this was a question asking if is it worth it to refactor an imperative style program into a functional monadic style program.

I would appreciate feedback. I'm on the fence regarding this. Has anyone done so? What was the experience like and how was the outcome?

Collapse
 
hath995 profile image
Aaron Elligsen

Since no one has answered, I guess I'll answer my own question. Monads, the concept, don't really add anything to a program per se. It is the particular instances of monads themselves which add value. The monadic pattern allows you to compose many instances of monads which add features. Thus the only value in the monadic pattern is acting as the glue with which to compose all the separate features.

Monads are the plumbing which deliver value from the things they are connecting.