let rec get_arity (arities: arities) (arity: int) : symbol list =
match arities with
| [] ->
[]
| (arity', symbols) :: tail ->
if arity' == arity then
symbols
else if arity' > arity then
[]
else
get_arity tail arity