Hi. Maybe the answer is that you, er, just don't (try to think about them functionally), because it won't get you anywhere. That is to say, it's really only the other[1] main idea of functional programming which may be brought to bear when modelling stateful entities.
1 namely, functions as first-class values, according to p49 of the Scala book (v4) On Aug 29, 9:39 pm, Scoot <[EMAIL PROTECTED]> wrote: > Apologies if this is somewhat off topic, but I think (hope) the posse > audience have some useful insights on this. > > I'm trying to get my head into functional thinking. I'm sold on the > principles of immutability and all the attendant advantages; I've > looked at examples in various languages (erlang, haskell, scala) and > admired the elegant simplicity of recursion. > > What I'm struggling with is how to model real-world domains using > these principles. Someone (Dijkstra?) once jested stacks were > invented solely to demonstrate Abstract Data Types; it kind of feels > like the Fibonacci series is the functional programming equivalent. > > What I'm missing are examples from real world domains; like customers > holding accounts or purchasing products. I want to think about these > as stateful entities; e.g. the account moving from in credit to > overdrawn and back. > > So: how does one "think" about these things functionally? > > I know in scala I can represent them as stateful objects but that's > sidestepping the issue; how do I think about state - and persistence - > functionally? Any thoughts/pointers gratefully accepted. > > tia, > Scott. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "The Java Posse" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/javaposse?hl=en -~----------~----~----~----~------~----~------~--~---
