ekmett / ersatz

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

Avoid `-Wx-partial` warnings with GHC 9.8+ #75

Closed RyanGlScott closed 10 months ago

RyanGlScott commented 10 months ago

GHC 9.8 adds the -Wx-partial warning to -Wall, which is triggered upon any use of the partial head or tail functions from Prelude. This patch rewrites some code in ersatz to avoid head/tail, and thereby avoid new warnings with GHC 9.8. Sometimes, this can be achieved by some mild refactoring, but in other cases, we simply have to accept the partiality inherent in some code and make the error cases more explicit.