RE: suppress warning "Defined but not used: type variable ‘x’" in GHC-8.0

2016-01-18 Thread Simon Peyton Jones
: suppress warning "Defined but not used: type variable ‘x’" in GHC-8.0 No, the type instance must match the class heading. I can use instance Foo [_a] where type Bar [_a] = Int whatever = ... where bar :: _a -> Int bar = ... but that is a needlessly messy thing to req

Re: suppress warning "Defined but not used: type variable ‘x’" in GHC-8.0

2016-01-17 Thread Oliver Charles
Inferred types and errors too, I would imagine. On Sun, 17 Jan 2016 2:45 pm Edward Kmett wrote: > Moreover those _'d type variables would infect all of our haddocks. > ___ > Glasgow-haskell-users mailing list > Glasgow-haskell-users@haskell.org > http:

Re: suppress warning "Defined but not used: type variable ‘x’" in GHC-8.0

2016-01-17 Thread Edward Kmett
Moreover those _'d type variables would infect all of our haddocks. ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/glasgow-haskell-users

Re: suppress warning "Defined but not used: type variable ‘x’" in GHC-8.0

2016-01-17 Thread Edward Kmett
No, the type instance must match the class heading. I *can* use instance Foo [_a] where type Bar [_a] = Int whatever = ... where bar :: _a -> Int bar = ... but that is a needlessly messy thing to request of every package everywhere. The arguments being pattern matched in a class ass

Re: suppress warning "Defined but not used: type variable ‘x’" in GHC-8.0

2016-01-17 Thread Andrew Farmer
Can't you just: instance Foo [a] where type Bar [_a] = Int (At least I think I did that somewhere...) On Jan 16, 2016 9:24 PM, "Edward Kmett" wrote: > As a data point I now get thousands of occurrences of this warning across > my packages. > > It is quite annoying. > > class Foo a where > t

Re: suppress warning "Defined but not used: type variable ‘x’" in GHC-8.0

2016-01-16 Thread Edward Kmett
As a data point I now get thousands of occurrences of this warning across my packages. It is quite annoying. class Foo a where type Bar a instance Foo [a] where type Bar [a] = Int is enough to trigger it. And you can't turn it off by using _ as instance Foo [_] where type Bar [_] = Int

Re: suppress warning "Defined but not used: type variable ‘x’" in GHC-8.0

2016-01-11 Thread Henning Thielemann
On Mon, 11 Jan 2016, Richard Eisenberg wrote: On Jan 9, 2016, at 6:44 PM, Henning Thielemann wrote: instance (Natural n) => Num.Integer (Un n) where type Repr (Un _n) = Unary GHC-7.6.3 and GHC-7.4.2 complain: Type indexes must match class instance head Found `Un _n' but expected

Re: suppress warning "Defined but not used: type variable ‘x’" in GHC-8.0

2016-01-11 Thread Richard Eisenberg
On Jan 9, 2016, at 6:44 PM, Henning Thielemann wrote: > > instance (Natural n) => Num.Integer (Un n) where >type Repr (Un _n) = Unary > > > GHC-7.6.3 and GHC-7.4.2 complain: >Type indexes must match class instance head >Found `Un _n' but expected `Un n' >In the type synonym in

Re: suppress warning "Defined but not used: type variable ‘x’" in GHC-8.0

2016-01-09 Thread Henning Thielemann
On Sat, 9 Jan 2016, Carter Schonwald wrote: Have you tried _x instead? Ah, this solves the problem! Almost. I have an instance like this one: instance (Natural n) => Num.Integer (Un n) where type Repr (Un _n) = Unary GHC-7.6.3 and GHC-7.4.2 complain: Type indexes must match class

Re: suppress warning "Defined but not used: type variable ‘x’" in GHC-8.0

2016-01-09 Thread Carter Schonwald
Have you tried _x instead? On Saturday, January 9, 2016, Henning Thielemann < lemm...@henning-thielemann.de> wrote: > > GHC-8.0 emits several new warnings of this kind: > >Defined but not used: type variable ‘x’ > > for declarations like > >type instance Snd x y = y > > Enthusiastically,