vault backup: 2025-02-19 10:36:45
This commit is contained in:
parent
cdfc61adf7
commit
d1d94b3d81
@ -7,8 +7,12 @@ If I want to compute a factorial, I'd probably say take this value, and multiply
|
||||
|
||||
- [?] What is a 'state' for a computer really? #Follow-Up #Haskell
|
||||
|
||||
Functional programming languages do not do this. Instead of using iteratives like that or having the possiblity of functions changing variable states, everything is instead immutable. If I define a function for a factorial, I define *what a factorial is*, rather than explicit steps to compute one. Then, when I apply the 'function' to an input, the output is something new: the function applied to that variable that is fundamentally not an execution of the function or a malation of the original input. This is *maybe* what a monad is.
|
||||
Functional programming languages do not do this. Instead of using iteratives like that or having the possiblity of functions changing variable states, everything is instead immutable. If I define a function for a factorial, I define *what a factorial is*, rather than explicit steps to compute one. Then, when I apply the 'function' to an input, the output is something new: the function applied to that variable that is fundamentally not an execution of the function or a wrought product of the original input. This is *maybe* what a monad is.
|
||||
|
||||
- [?] What is a 'monad' really? #Follow-Up #Haskell
|
||||
|
||||
There's a special property about functions that can be called multiple times with the same parameters being guaranteed to return the same result: **Referential Transparency**. This property allows us to deduce and then even proved that a function does exactly what it is supposed to, every time.
|
||||
|
||||
|
||||
|
||||
^1 not really Rust, because I believe Rust has functional programming support.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user