I should have tried this before sending! It turns out NoMonomorphismRestriction is not really a usable workaround. First it seems to trigger a bug: Derive/JScore/T.hs:76:11: error: [GHC-39999] • Ambiguous type variable ‘a0’ GHC Bug #20076 https://gitlab.haskell.org/ghc/ghc/-/issues/20076 Assuming you have a partial type signature, you can avoid this error by either adding an extra-constraints wildcard (like `(..., _) => ...`, with the underscore at the end of the constraint), or by avoiding the use of a simplifiable constraint in your partial type signature. prevents the constraint ‘(Bounded a0)’ from being solved. Probable fix: use a type annotation to specify what ‘a0’ should be. Potentially matching instances: instance Bounded Ordering -- Defined in ‘GHC.Enum’ instance Bounded Instrument -- Defined at Derive/JScore/T.hs:132:30 ...plus 23 others ...plus four instances involving out-of-scope types (use -fprint-potential-instances to see them all) This is in a context where all the types are fully specified, and no partial type signatures: ``` data PitchClass = P1 | P2 | P3 | P4 | P5 | P6 | P7 deriving (Eq, Ord, Show, Bounded, Enum) data Pitch = Pitch { pitch_octave :: Int, pitch_pc :: PitchClass } deriving (Eq, Ord, Show) toEnumBounded :: forall a. (Bounded a, Enum a) => Int -> (Int, a) toEnumBounded n = (i, toEnum r) where (i, r) = n `divMod` (fromEnum (maxBound :: a) + 1) add_pc_abs :: Int -> Pitch -> Pitch add_pc_abs steps (Pitch octave pc) = Pitch (octave + oct) pc2 where (oct, pc2) = toEnumBounded $ fromEnum pc + steps ``` `toEnumBounded` is considered ambiguous even though `pc2` should be clear. `pc2 :: PitchClass` works around. But more seriously, practically every numeric literal in tests is now ambiguous, e.g. ``` equalf :: (HasCallStack, Show a, ApproxEq.ApproxEq a) => Double -> a -> a -> Test ... test_thing :: Test test_thing = do let trip = id -- to_sec . f rate equalf 0.1 (trip 601) 601 ``` Now equalf can't find Show for equalf or Num for 601. So I guess the restriction is also causing a lot of defaulting, without which life gets very tedious! So it's not just about avoiding some efficiency corner cases, but also helping a lot in ergonomics.