When loading a file in emacs, every occurrence of the functions head and tail trigger a question in the command buffer to add {-# LANGUAGE Data #-} to the top of the source file. This is triggered by the warning [-Wx-partial]
module Tmp where
test :: [Int] -> String
test [] = "empty"
test xs = show $ head xs
/src/Tmp.hs:5:18-21: 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."
|
src/Tmp.hs:5:18-21: 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."
|
ghc --version
The Glorious Glasgow Haskell Compilation System, version 9.8.2
$ cabal --version
cabal-install version 3.16.1.0
compiled using version 3.16.1.0 of the Cabal library (in-tree)
$ emacs --version
GNU Emacs 28.2
Copyright (C) 2022 Free Software Foundation, Inc.
GNU Emacs comes with ABSOLUTELY NO WARRANTY.
You may redistribute copies of GNU Emacs
under the terms of the GNU General Public License.
For more information about these matters, see the file named COPYING.
haskell-mode version is latest stable from melpa
When loading a file in emacs, every occurrence of the functions
headandtailtrigger a question in the command buffer to add{-# LANGUAGE Data #-}to the top of the source file. This is triggered by the warning[-Wx-partial]|
ghc --version
The Glorious Glasgow Haskell Compilation System, version 9.8.2
$ cabal --version
cabal-install version 3.16.1.0
compiled using version 3.16.1.0 of the Cabal library (in-tree)
$ emacs --version
GNU Emacs 28.2
Copyright (C) 2022 Free Software Foundation, Inc.
GNU Emacs comes with ABSOLUTELY NO WARRANTY.
You may redistribute copies of GNU Emacs
under the terms of the GNU General Public License.
For more information about these matters, see the file named COPYING.
haskell-mode version is latest stable from melpa