RE: Redundant constraints

2015-01-10 Thread Simon Peyton Jones
in 'containers'; we don't need an actual release. Over to you, Austin Simon | -Original Message- | From: Milan Straka [mailto:f...@ucw.cz] | Sent: 10 January 2015 13:45 | To: Simon Peyton Jones | Cc: ghc-devs@haskell.org; Johan Tibell | Subject: Re: Redundant constraints | | Hi Simon

RE: Redundant constraints

2015-01-09 Thread Simon Peyton Jones
| I've fixed some of the warnings in transformers, but there are still | 14 of them, triggered by Applicative becoming a superclass of Monad. In GHC's own source code I did this #if __GLASGOW_HASKELL__ 710 -- Pre-AMP change runGhcT :: (ExceptionMonad m, Functor m) = #else runGhcT ::

RE: Redundant constraints

2015-01-08 Thread Simon Peyton Jones
: Re: Redundant constraints 2015-01-07 18:19 GMT+03:00 Simon Peyton Jones simo...@microsoft.commailto:simo...@microsoft.com: Friends I’ve pushed a big patch that adds –fwarn-redundant-constraints (on by default). It tells you when a constraint in a signature is unnecessary, e.g. f :: Ord

RE: Redundant constraints

2015-01-08 Thread Simon Peyton Jones
: Redundant constraints | | One option for avoiding the warning without runtime overhead would be | to do something like this: | |f :: Ord a = a - a - Bool | f x y = True | where | _ = x y | | | On Wed, Jan 7, 2015 at 7:27 AM, Johan Tibell johan.tib

Re: Redundant constraints

2015-01-08 Thread Ross Paterson
On Wed, Jan 07, 2015 at 03:19:15PM +, Simon Peyton Jones wrote: I’ve pushed a big patch that adds –fwarn-redundant-constraints (on by default). It tells you when a constraint in a signature is unnecessary, e.g. f :: Ord a = a - a - Bool f x y = True I think I have done

Re: Redundant constraints

2015-01-08 Thread Lennart Kolmodin
2015-01-07 18:19 GMT+03:00 Simon Peyton Jones simo...@microsoft.com: Friends I’ve pushed a big patch that adds –fwarn-redundant-constraints (on by default). It tells you when a constraint in a signature is unnecessary, e.g. f :: Ord a = a - a - Bool f x y = True I think I

Re: Redundant constraints

2015-01-07 Thread Michael Sloan
One option for avoiding the warning without runtime overhead would be to do something like this:  f :: Ord a = a - a - Bool f x y = True where _ = x y On Wed, Jan 7, 2015 at 7:27 AM, Johan Tibell johan.tib...@gmail.com wrote: I think this probably makes sense,

Re: Redundant constraints

2015-01-07 Thread Johan Tibell
I think this probably makes sense, especially since you can silence the warning when you intend to add an unnecessary constraint. I had one thought though: consider an abstract data type with functions that operates over it. I might want to require e.g Ord in the definition of a function so I

RE: Redundant constraints

2015-01-07 Thread Simon Peyton Jones
; Ross Paterson Subject: Re: Redundant constraints I think this probably makes sense, especially since you can silence the warning when you intend to add an unnecessary constraint. I had one thought though: consider an abstract data type with functions that operates over it. I might want to require