It is specified to be a static error, and the solution is either
- define your own, consistent default rules for C and D in the current module, OR
- ascribe types to the ambiguous use-sites and bypass default resolution entirely.
Since the Prelude is implicitly imported without an import list, both A and C would let you avoid an extra import. Same goes for Prelude replacements.