Let me illustrate (+) as well (:)
Prelude> 4+5 9 Prelude> let z = 5 Prelude> z 5 Prelude> 4+z 9 Prelude> z 5 Prelude> let y = 4+z Prelude> y 9 Prelude> z 5
against
Prelude> let a = [1,2,3] Prelude> a [1,2,3] Prelude> 5:a [5,1,2,3] Prelude> a [1,2,3] Prelude> let b = 5:a Prelude> b [5,1,2,3] Prelude> a [1,2,3]
The bindings made with "let" never change, but new ones can be made. If the new binding has the same name as the old binding, then the old binding is “shadowed”, not mutated.
Chris kuklewicz
source share