Make it more convenient to use newVar in functions
Clarification and motivation
Imagine that I have a function in Indigo with type Var Int -> IndigoM s s ()
. If I want to create a local variable inside that function, I have to use newVar
. It will put an item onto output stack. However, since this variable is local we don't want it to be visible outside, hence we want our function to return IndigoM s s ()
, not IndigoM s (t ': s) ()
for some t
. So apparently we need some way to drop local variables from stack. Ideally it should be somehow done automatically, but at least it should be possible to it manually (but safely, i. e. ensuring that dropped won't be used anywhere else).
Acceptance criteria
It should be easy and convenient to create a local variable and not leak it in function type (output stack of IndigoM
).