Skip to content

Wrong warning by -Wincomplete-patterns

Wrong warning occur where I use -Wincomplete-patterns with OverloadedLists and TypeFamilies.

{-# LANGUAGE OverloadedLists #-}
{-# LANGUAGE TypeFamilies #-}
{-# OPTIONS_GHC -Wall -fno-warn-tabs #-}

class Foo f where
	type It f
	foo :: [It f] -> f

data List a = Empty | a :! List a deriving Show

instance Foo (List a) where
	type It (List a) = a
	foo [] = Empty
	foo (x : xs) = x :! foo xs

Pattern match(es) are non-exhaustive In an equation for `foo': Patterns not matched: []

Trac metadata
Trac field Value
Version 8.2.1
Type Bug
TypeOfFailure OtherFailure
Priority low
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information