Reduction stack overflow

It compiles with GHC 9.8.2? Hmm:

  • # ghc -V
    The Glorious Glasgow Haskell Compilation System, version 9.8.2
    
  • # ghc -c Foo.hs
    
    Foo.hs:10:7: error: [GHC-40404]
        • Reduction stack overflow; size = 201
          When simplifying the following type: Monoid [Foo]
        • In the expression: pure 1
          In an equation for ‘foo’: foo = pure 1
        Suggested fix:
          Use -freduction-depth=0 to disable this check
          (any upper bound you could choose might fail unpredictably with
           minor updates to GHC, so disabling the check is recommended if
           you're sure that type checking should terminate)
       |
    10 | foo = pure 1
       |       ^^^^
    
  • # ghc -c -XUndecidableInstances Foo.hs
    
    Foo.hs:10:7: error: [GHC-40404]
        • Reduction stack overflow; size = 201
          When simplifying the following type: Monoid [Foo]
        • In the expression: pure 1
          In an equation for ‘foo’: foo = pure 1
        Suggested fix:
          Use -freduction-depth=0 to disable this check
          (any upper bound you could choose might fail unpredictably with
           minor updates to GHC, so disabling the check is recommended if
           you're sure that type checking should terminate)
       |
    10 | foo = pure 1
       |       ^^^^
    
  • # ghc -c -freduction-depth=0 Foo.hs
    
    ^C
    #
    
  • # ghc -c -XUndecidableInstances -freduction-depth=0 Foo.hs
    
    ^C
    #
    

Regression or not, it’s certainly something that needs careful monitoring; principle of least surprise and all…