Unused type variables with non-linear patterns

Jan Stolarek jan.stolarek at p.lodz.pl
Thu Dec 10 14:48:59 UTC 2015


An intersting thing came up when implementing warnings for unused type variables in type family 
patterns (#10982 / D1576):

type family X a b where
  X a a = Int 

Should we emit a warning that `a` is unused? It does not appear in the RHS but it is actually used 
because of non-linear pattern. We can fix this by prefixing both appearances of `a` with an 
underscore - this silences the warning and maintains semantics. Nevertheless, if a variable is 
unused it should be perfectly valid to replace it with an underscore - that is not the case in 
this example. Thoughts?

Janek

---
Politechnika Łódzka
Lodz University of Technology

Treść tej wiadomości zawiera informacje przeznaczone tylko dla adresata.
Jeżeli nie jesteście Państwo jej adresatem, bądź otrzymaliście ją przez pomyłkę
prosimy o powiadomienie o tym nadawcy oraz trwałe jej usunięcie.

This email contains information intended solely for the use of the individual to whom it is addressed.
If you are not the intended recipient or if you have received this message in error,
please notify the sender and delete it from your system.


More information about the ghc-devs mailing list