First of a big thanks (literally, heh) I hope you enjoyed the first meeting of our little group. Very happy to see so many interested in FP, and glad to see the turnout for the “post-meeting” at the Kings Head.
Video
Links
Some of the links I mentioned in my talk:
- Monads are Elephants Parts 1, 2, 3, 4
- Extreme Cleverness: Functional Data Structures in Scala
- Brian Beckman (Microsoft) – Don’t fear the Monad
Followup for Pure Functions w.r.t. Setters/Getters
I did some further digging, posting a question on Stack Exchange about Setters/Getters in Functional Programming. Daniel Sobral (very learned in the Scala community) answered with what Amir had brought up, you essentially get a new copy of the object on which you invoked the setter. The new object has the modified property value. Further to that, he pointed out the “copy” method of Case classes in Scala. Essentially you can use it like this:
val modEmployee = origEmployee.copy(salary = 50000)
Now modEmployee contains a copy of origEmployee with the modified salary property. Referential transparency of the getter for the salary property is maintained because the origEmployee’s salary remains the same and anyone with a reference to it doesn’t see the change at all.
IRC
I think I understand now that referential transparency doesn’t mean the thing can’t modify the database, because database is not part of the program, so there are no side effect within the program.
Pingback: The Basement Coders Developer Podcast » Introduction to Functional Programming
I liked your article is an interesting technology
thanks to google I found you