Skip to content

GHC Warning: Non-exhaustive Pattern Match for List Despite Explicit Match on Empty List

Summary

I’m trying to write a simple Haskell function that distinguishes between an empty list and a non-empty list. However, when I compile the code with -Werror=incomplete-patterns enabled, I get an error. It looks like OverloadedLists, and RebindableSyntax no longer work together.

Also posted on stackoverflow

Steps to reproduce

Please see: this github repo

Expected behavior

it should not be an incomplete-pattern

Environment

  • GHC version used: ghc-9.8.2

Optional:

  • Operating System: ubuntu
  • System Architecture: aarch64
Edited by Vanson Samuel
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information