tag:blogger.com,1999:blog-6454006.post4343838484020950586..comments2024-01-16T14:32:49.175+00:00Comments on Arcane Sentiment: Effects vs. side effectsArcane Sentimenthttp://www.blogger.com/profile/04144052171693893368noreply@blogger.comBlogger1125tag:blogger.com,1999:blog-6454006.post-68728818361979247232015-04-15T19:52:06.124+00:002015-04-15T19:52:06.124+00:00Pure FP advocates often do believe that observable...Pure FP advocates often do believe that observable effects outside of returning a value are an 'indistinguishable evil'. I'm certainly of this opinion. We're not against effects. But we'll model effects, including state updates, via the return value. E.g. a simple purely functional model suitable for actors/machines is: (InMessage, State) → (List of OutMessage, State). Usefully, it is possible to model entire networks of these machines in a purely functional manner. We could capture this behavior via writer-state monad, but an explicit function might be easier for newcomers to grok. <br /><br />The main difficulty with FP advocacy, as I understand it, is that imperative programmers simply aren't prepared to grok a pure approach to modeling effects. They're too used to `public static void main()` as the signature for an application, which certainly admits no effects via the return value.dmbarbourhttps://www.blogger.com/profile/12370605342201490009noreply@blogger.com