GHC also introduces a default type, at least whenever you export a module, it will monomorphize any ambiguous numeric types for types in default types for the module, which defaults to:
default (Integer, Double)
See "4.3.4 Ambiguous Types and Default Values ββfor Overloaded Numeric Operations" in the Haskell Specification .
You can disable this with pragma {-# LANGUAGE NoMonomorphismRestriction #-} in the module you want to export, with toplevel numeric polymorphic types left untouched.
source share