My question came up while following the tutorial Functors, Applicatives, And Monads In Pictures and its JavaScript version.
When the text says that functor unwraps value from the context, I understand that a Just 5
-> 5
transformation is happening. As per What does the "Just" syntax mean in Haskell? , Just is "defined in scope" of the Maybe
monad.
My question is what is so magical about the whole unwrapping thing? I mean, what is the problem of having some language rule which automatically unwraps the "scoped" variables? It looks to me that this action is merely a lookup in some kind of a table where the symbol Just 5
corresponds to the integer 5
.
My question is inspired by the JavaScript version, where Just 5
is prototype array instance. So unwrapping is, indeed, not rocket science at all.
Is this a "for-computation" type of reason or a "for-programmer" one? Why do we distinguish Just 5
from 5
on the programming language level?