Skip to content

Prelude.head: empty list in GHCi

Summary

Just another evidence that head is unsafe and brittle, cf. #22185 (closed). I'll send a patch soon.

Steps to reproduce

$ ghci
GHCi, version 9.2.5: https://www.haskell.org/ghc/  :? for help
ghci> :set prompt "%call( )"
ghc-9.2.5: panic! (the 'impossible' happened)
  (GHC version 9.2.5:
	Prelude.head: empty list

Please report this as a GHC bug:  https://www.haskell.org/ghc/reportabug

Expected behavior

I'd expect GHCi to answer

Incorrect %call syntax. Should be %call(a command and arguments).

Environment

  • GHC version used: 9.2.5
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information