Make it centered around type patternFunction = path -> type -> nullOr bool instead of path -> type -> [(bool, bool)] of which only the last match (fst?) was used (snd?).