Skip to content

PartialTypeSignatures suggests a redundant constraint with constraint families

When I say

{-# LANGUAGE ConstraintKinds, TypeFamilies #-}

module Bug where

type family ShowSyn a where ShowSyn a = Show a

foo :: (ShowSyn a, _) => a -> String
foo x = show x

I get

Bug.hs:7:20: error:
    Found constraint wildcard ‘_’ standing for ‘Show a’
    To use the inferred type, enable PartialTypeSignatures
    In the type signature:
      foo :: (ShowSyn a, _) => a -> String

But if I fill in my wildcard with Show a, I'll rightly get a redundant constraint. Just a vanilla type synonym works there, but the type family causes trouble.

Trac metadata
Trac field Value
Version 8.1
Type Bug
TypeOfFailure OtherFailure
Priority normal
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