Lint types in derivations, and fix a related bug in foldIdSeq