Re: Unused type variables with non-linear patterns

2015-12-15 Thread Jan Stolarek
> Is there a ticket? #10982 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

RE: Unused type variables with non-linear patterns

2015-12-15 Thread Simon Peyton Jones
I agree too. Is there a ticket? Does it emit a warning right now? Simon From: ghc-devs [mailto:ghc-devs-boun...@haskell.org] On Behalf Of Richard Eisenberg Sent: 11 December 2015 16:02 To: Michael Sloan <mgsl...@gmail.com> Cc: ghc-devs@haskell.org Subject: Re: Unused type variables wi

Re: Unused type variables with non-linear patterns

2015-12-11 Thread Richard Eisenberg
I agree with Michael. This should not emit a warning. While you're in this area, make sure that > type instance F _ _ = Int indeed matches `F Char Bool`. It's easy to imagine both underscores being treated as the same variable, which is not what the user intends. Thanks, Richard On Dec 10,

Re: Unused type variables with non-linear patterns

2015-12-10 Thread Michael Sloan
I definitely think this should be considered a usage. Ideally, you should always be able to resolve warnings, but there'd be no straightforward way to do so if LHS-only usages cause warnings. Also, It's quite useful to use type variables only on the LHS. Usage example:

Unused type variables with non-linear patterns

2015-12-10 Thread Jan Stolarek
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.