Skip to content

Suppress redundant-constraint warnings in case of empty classes

The technique described in

http://www.well-typed.com/blog/2015/07/checked-exceptions/

makes use of a class without any methods, i.e.

class Throws e

However, this by definition results in redundant constraints, e.g.

readFoo :: Throws IOError => FilePath -> IO Foo
readFoo fn = {- ...  -}

which GHC 8.0 warns about.

I propose to suppress warnings in case a class which has no methods is used as seemingly redundant constraint.

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