ekmett / ersatz

A monad for interfacing with external SAT solvers
Other
63 stars 15 forks source link

The `forall` function triggers `-Wforall-identifier` on GHC 9.4+ #73

Closed RyanGlScott closed 1 year ago

RyanGlScott commented 1 year ago

Building ersatz with GHC 9.4 or later triggers a -Wforall-identifier warning:

[13 of 24] Compiling Ersatz.Variable  ( src/Ersatz/Variable.hs, interpreted )

src/Ersatz/Variable.hs:36:1: warning: [-Wforall-identifier]
    The use of ‘forall’ as an identifier
    will become an error in a future GHC release.
    Suggested fix:
      Consider using another name, such as
      ‘forAll’, ‘for_all’, or ‘forall_’.
   |
36 | forall = literally literalForall
   | ^^^^^^

We should rename forall to something else to avoid this warning. I propose forall_, which mirrors a similar change that occurred recently in the constraints library (see https://github.com/ekmett/constraints/issues/112). Note that forall is part of the public Ersatz.Variable API, so this would entail a breaking change.