Timeline for what can go wrong in context of functional programming if my object is mutable?
Current License: CC BY-SA 3.0
25 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Nov 14, 2021 at 7:59 | answer | added | mightycode Newton | timeline score: 1 | |
| May 1, 2018 at 10:49 | vote | accept | rahulaga-msft | ||
| May 1, 2018 at 10:48 | vote | accept | rahulaga-msft | ||
| May 1, 2018 at 10:49 | |||||
| May 1, 2018 at 6:27 | history | edited | rahulaga-msft | edited tags | |
| May 1, 2018 at 1:19 | comment | added | Frank Hileman | Not sure anyone addressed this, but for most people, one huge advantage is ease of reasoning. Since pure functions and immutable data types map directly to mathematical concepts, it is easier to prove the correctness of code. | |
| Apr 30, 2018 at 18:25 | comment | added | Maja Piechotka | In addition to answers information about immutability is important for compiler. In Haskell compiler is allowed to rearrange fold and map into simple loop as it knows that this is legal operation. On the other handin imperative languages the folding function might use the state changed by map function making such transformation unsound. | |
| Apr 30, 2018 at 18:12 | review | Close votes | |||
| May 5, 2018 at 3:05 | |||||
| Apr 30, 2018 at 16:13 | answer | added | supercat | timeline score: 3 | |
| Apr 30, 2018 at 13:21 | history | tweeted | twitter.com/StackSoftEng/status/990944124479025154 | ||
| Apr 30, 2018 at 13:11 | answer | added | Aaron M. Eshbach | timeline score: 1 | |
| Apr 30, 2018 at 12:39 | answer | added | Karl Bielefeldt | timeline score: 4 | |
| Apr 30, 2018 at 11:24 | answer | added | Doc Brown | timeline score: 8 | |
| Apr 30, 2018 at 11:07 | answer | added | Ewan | timeline score: 7 | |
| Apr 30, 2018 at 9:29 | comment | added | jk. | @Ruben no specifically I was thinking of Mvars in haskell hackage.haskell.org/package/base-4.9.1.0/docs/… different languages have different solutions of course or IORefs hackage.haskell.org/package/base-4.11.1.0/docs/Data-IORef.html though of course you would use both from within monads | |
| Apr 30, 2018 at 9:21 | answer | added | David Arno | timeline score: 14 | |
| Apr 30, 2018 at 9:19 | history | edited | rahulaga-msft | CC BY-SA 3.0 | updated |
| Apr 30, 2018 at 9:12 | comment | added | Christophe | @Ruben Functional programming is a paradigm. As such it doesn't require a functional programming language. And some fp languages such as F# have this feature. | |
| Apr 30, 2018 at 9:05 | history | edited | rahulaga-msft | CC BY-SA 3.0 | updated |
| Apr 30, 2018 at 8:59 | comment | added | Ruben | @jk I guess you're thinking of monads? For me, the most characteristic thing of functional programming was having immutable variables. Wikipedia also notes that functional programming languages typically avoid state mutations. | |
| Apr 30, 2018 at 8:56 | comment | added | rahulaga-msft | @DavidArno : I just realized mistake, thanks for correcting it. | |
| Apr 30, 2018 at 8:50 | comment | added | David Arno | @jk., he certainly did. Edited to correct that. | |
| Apr 30, 2018 at 8:50 | history | edited | David Arno | CC BY-SA 3.0 | added 6 characters in body |
| Apr 30, 2018 at 8:24 | comment | added | jk. | I think you may ve mixed immutable and mutable in your first paragraph? | |
| Apr 30, 2018 at 8:22 | comment | added | jk. | @Ruben i'd say most functional languages do allow mutable variable, but make it different to use them e.g. mutable variables have a different type | |
| Apr 30, 2018 at 8:02 | history | asked | rahulaga-msft | CC BY-SA 3.0 |