Prism: An Impure Functional Language With Typed Effects (opens in new tab)
Prism: An Impure Functional Language With Typed Effects This is going to be a very nerdy post so bear with me. Here is a function. Read it the way you would read any other function, and then tell me its type. fn fib(n) = var a := 0 var b := 1 repeat(n) fn let t = a + b a := b b := t a That is a mutable loop. There is a var, there is assignment, there is a temporary so the swap does not eat itself. It is, line for line, the fib you would write in Python after deciding that recursion was a youn...
Read the original article