mkCoreApps re-implemented mkCoreApp in a recursive function,
rather than using a simple foldl' in order to avoid repeatingly
computing the type of the function argument. I've factored the two
logic into a new (internal) function mkCoreType which assumes that
the type is known. mkCoreApp and mkCoreApps are thin wrappers
- The assertion failure message of mkCoreApps has more information in it.
- mkCoreApps now special-cases coercion argument like mkCoreApp (previously they were given to mk_val_app instead)