Skip to content

Closed type families: Warn if it doesn't handle all cases

Right now, I can do the following:

data Foo = A | B
type family Bar (n :: 'Foo) where
  Bar 'A = Int

I would like to be warned if I write a partial type function like this because partial functions are almost always a mistake.

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