Arrfunc type pattern matching

This fixes a bug in the arrfunc type parsing, along with some small tweaks and improvements to make the matching work.