xmonad/xmonad

ghc 9.8 `-Wx-partial` warnings

Closed this issue · 1 comments

Problem Description

ghc 9.8 issues a -Wx-partial warning on xmonad compile.

Steps to Reproduce

Build xmonad with ghc 9.8.

Configuration File

Please include the smallest full configuration file that reproduces
the problem you are experiencing:

module Main (main) where

import XMonad

main :: IO ()
main = xmonad def

Checklist

  • I've read CONTRIBUTING.md

  • I tested my configuration

    • With xmonad version 0.17.2

Looks like there's only one, actually; the others are actually from contrib.

src/XMonad/ManageHook.hs:80:59: warning: [GHC-63394] [-Wx-partial]
    In the use of ‘head’
    (imported from Prelude, but defined in GHC.List):
    "This is a partial function, it throws an error on empty lists. Use pattern matching or Data.List.uncons instead. Consider refactoring to use Data.List.NonEmpty."
   |
80 |                           return $ if null l then "" else head l
   |                                                           ^^^^