Skip to content

Surprising mention of unboxed integers in pattern exhaustiveness warning

The attached code produces this alarming warning:

~/waste$ ghc -Wall --make AlarmingPattern.hs -fforce-recomp
[1 of 1] Compiling Main             ( AlarmingPattern.hs, AlarmingPattern.o )

AlarmingPattern.hs:6:7: Warning:
    Pattern match(es) are non-exhaustive
    In an equation for ‘takeFromInv’:
        Patterns not matched:
            (GHC.Types.I# _) (GHC.Types.I# (#x)) with #x `notElem` [0#]
Linking AlarmingPattern ...

The error message is alarming because it refers to unboxed integers, but the source code does not.

Edited by Thomas Miedema
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information