A useless test?
yurug opened this issue · comments
@lthms, can you tell me why you are checking the type of request here:
?
Well, before this test, the type of the instruction is unknown. Currently, the Console.i
is the sole and only instruction that we support, so if the type of the instruction is different, we can raise an exception accordingly. In the future, we will hopefully change that state of things, and probably have some kind of map to associate type of interfaces with collection of effects semantics.
I guess we could only look at the constructor, but it felt more natural to start from the type first.
I slept on this question, and I think it might be less surprising if the code was presented slightly differently, something like (in pseudo-code)
match instr_type with
| Console_I_constant => console_i_handlers instr_term
| _ => raise NotYetSupported
Would that make it more straightforward for you?
This will be solved by modifying FreeSpec.Exec
in order to be more extensible.