Type-based exception analysis for non-strict higher-order functional languages with imprecise exception semantics