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 th-desugar 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.
GHC 9.8 adds the
-Wx-partial
warning to-Wall
, which is triggered upon any use of the partialhead
ortail
functions fromPrelude
. This patch rewrites some code inth-desugar
to avoidhead
/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.