Typecheck Map and add an extra helper for functions