refactor: introduce isType reducing redundancy (trivial change)
improve wording:

has bad type could be missleading. Eg if you want "a" or "b" "c" often
is considered having the same (good) type: String.
Thus replace it by the wording "does not pass the check function" -
which also indicates where to look at.

I also think that adding the name makes the error easier to read.

Same about ensureDefaultType: It runs the check function, so
checkDefault is much easier to understand
always merge functions "merge" and "check" if type defines them
improve module code

update zip to zipAttrsWith
replace fold by "all" because its more readable and shorter

add documentation

drop inferred, because "it was supposed to be used at every location
which has no type" according to pierron - but isn't used in
nixos/nixpkgs

list should be an alias of listOf, and it should no longer be used (see patch against nixos)