Re: Strange kind error when using Lens.traverseOf

Tom Ellis <[email protected]>
Newsgroups gmane.comp.lang.haskell.cafe
Message-ID <Zp/ZKDKNzvxfCvkc@cloudinit-builder>
On Tue, Jul 23, 2024 at 04:51:34PM +0200, Henning Thielemann wrote:
> I have this simplified module:
[...]
> src/Ganeti/LensPlain.hs:8:32: error: [GHC-25897]
>     • Couldn't match kind ‘k2’ with ‘*’
>
> GHC-9.0 accepts the code. Also GHC-9.2 accepts it when the module is
> compiled as part of a larger Cabal project!
[...]
> I compiled with:
> 
> $ ghc-9.6.6 -package lens -c src/Ganeti/LensPlain.hs

A major difference between 9.0 and 9.2 is that GHC2021 is enabled by
default in 9.2.  GHC2021 enables PolyKinds, and presumably what used
to be assumed to be * (Type) is now generalized to k2.

The simplest solution is probably just to put

    {-# LANGUAGE NoPolyKinds #-}

at the top of LensPlain.hs.  The reason it works as part of a Cabal
project is that Cabal does not turn on GHC2021 by default.

Tom
_______________________________________________
Haskell-Cafe mailing list
To (un)subscribe, modify options or view archives go to:
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Only members subscribed via the mailman list are allowed to post.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.