News for hackers. Stuff that matters.
Re:Functional programming is not popular because it is weird... by zeugmasyllepsis on Monday September 13, 2021 @04:07PM (#28516137)
This might work out well in practice when tracking a single effect with a monad (e.g. with Haskell's `do` notation) but I think it quickly falls apart when working with multiple effects. Monads don't have a general form of composition - at the very least the order that they're composed matters to the outcome of the program. Procedural code is generally flexible enough to allow you to mix-and-match how effects gets handled, which I think would be difficult and impractical to work out in monadic contexts.
Re:Functional programming is not popular because it is weird... by zozbot234 on Monday September 13, 2021 @05:12PM (#28516941)
If you want to mix and match effects without regard to order of composition, that's what Lawvere theories are for (commonly known as 'algebraic effects'). You're right that monads don't give you this, but there are ways of describing these patterns without resorting to "procedural" idioms.