Generalize failing instructions in Indigo
Clarification and motivation
Indigo has failUsing_ :: IsError x => x -> IndigoM s s ()
statement. As you can see, it returns ()
. However, normally an exception has any type. In Haskell throw
functions return any type, in imperative languages you can use throw
to exit a function regardless of its return type. Also the limitation that input and output stack must be the same looks unnecessary, because FAILWITH
returns essentially "any" stack.
I suppose we should add FAILWITH
expression to begin with.
Acceptance criteria
- All Indigo statements/expressions that end with
FAILWITH
return value of any type, not()
. - All Indigo statements/expressions that end with
FAILWITH
can do not impose limitations on input and output stack types ofIndigoM
.
Edited by Ivan Gromakovskii