Redundant constraints

Simon Peyton Jones simonpj at microsoft.com
Fri Jan 9 10:47:22 UTC 2015


|  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 :: (ExceptionMonad m) =>
#endif

|  I think some of the changes already made are of this sort, exposing
|  details of the GHC implementation, e.g. the changes to the public
|  interface of Array and Ratio.  For example, it's probably reasonable
|  to remove the Ix constraint from Data.Array.bounds, but the portable
|  reference implementation of Data.Array.elems requires Ix, even though
|  the GHC implementation doesn't.  Similarly a portable implementation
|  of the Functor instance for Array i requires Ix, but the GHC
|  implementation doesn't.

Fair enough. If the Core Libraries Committee wants to add some of these constraints back in, that's fine with me.  They just need a comment to explain.  (We have a trick, now in the user manual, for how to add a redundant constraint without triggering a complaint.)

Simon


More information about the ghc-devs mailing list