Re:Disadvantages of purely functional programming
by dottedmag on Sunday June 05, 2016 @02:27PM
(#11842315)
Flagged like "State T" in function type, which Haskell has had since ~1995?
Re:Disadvantages of purely functional programming
by tome on Sunday June 05, 2016 @04:13PM
(#11842880)
Or IO, or ST, or STM, or any other number of Haskell features that Roboprog has correctly predicted to exist.
Re:Disadvantages of purely functional programming
by dllthomas on Sunday June 05, 2016 @06:32PM
(#11843491)
Performance-wise, StateT is not an escape-hatch. It can be great for removing boilerplate, but it's simply another way of writing (s -> (a, s)).
IO, ST, and STM mentioned by tome better match the description of "escape hatch" - though for ST and STM they are very carefully shaped escape hatches.
It would be nice if the language required such functions, and the modules in which they reside, to be flagged. (I don't know if Haskell does something like this with mutation, or not)
It also seems that an "actor model" would be a good way to encapsulate the updates in an otherwise FP program by having a loop/reduce/fold wrapped around the mutable data responding to request-events and generating responses. This allows the other pure/immutable/idempotent type of code to remain isolated from it.