Control.Monad proposal: Add whenJust

Simon Hengel sol at typeful.net
Mon May 20 11:47:52 CEST 2013


On Sat, May 18, 2013 at 03:08:33PM +0100, Ian Lynagh wrote:
> On Wed, May 15, 2013 at 10:40:45PM +0200, Bas van Dijk wrote:
> > On 15 May 2013 18:14, Edward Kmett <ekmett at gmail.com> wrote:
> > > Personally, I'd be all for just moving Foldable (and Traversable) into the
> > > Prelude and retiring the monomorphic versions of the functions they supply.
> 
> I'd prefer to remove the monomorphic functions, but not to add anything
> to Prelude.

The issue here is that his would make it very hard to write backward
compatible code.  We already have seen this by removing Prelude.catch.
GHC HQ mitigated this by making a "hidden import" a warning.  But if you
want -Wall-sane code you still need to always import Control.Exception
qualified.

Personally I'm strongly against removing the monomorphic versions
without providing suitable alternatives.

Cheers,
Simon



More information about the Libraries mailing list