[Haskell-cafe] type error when specializing lens zooms in ghc >= 9.0

Viktor Dukhovni ietf-dane at dukhovni.org
Fri Jun 2 00:32:23 UTC 2023


On Thu, Jun 01, 2023 at 11:58:47PM +0200, Olaf Klinke wrote:

> The thing is, the error message is rather general, which was my
> original complaint. I haven't got a GHC-9.6.1 installation, so what is
> the error code when compiling the following minimal example?

Essentially the same error text with GHC 9.2.7:

    foo.hs:13:10: error:
        • Couldn't match type ‘()’ with ‘forall t. t’
          Expected: Void -> ()
            Actual: () -> ()
        • In the expression: id :: () -> ()
          In an equation for ‘final’: final = (id :: () -> ())
       |
    13 | final = (id :: () -> ())
       |          ^^^^^^^^^^^^^^

and GHC 9.6.2:

    foo.hs:13:10: error: [GHC-83865]
        • Couldn't match type ‘()’ with ‘forall t. t’
          Expected: Void -> ()
            Actual: () -> ()
        • In the expression: id :: () -> ()
          In an equation for ‘final’: final = (id :: () -> ())
       |
    13 | final = (id :: () -> ())
       |          ^^^^^^^^^^^^^^

-- 
    Viktor.


More information about the Haskell-Cafe mailing list