You can hoist everything into type space, as in
vrr(::Val{(0,0)}) = :ss
vrr(::Val{(0,1)}) = :sp
vrr(::Val{(1,0)}) = :ps
const KEYS = (Val((0,0)), Val((0,1)), Val((1,0)))
map(vrr, KEYS)
but it may be very taxing on the compiler, so it would be a solution of last resort for me.
I am still not sure I understand the context, but
- if you can decide this based on the type of
a
andc
, just use the built-in dispatch of the language, - if not, use branches (
if
).