Control.Monad proposal: Add whenJust

Ian Lynagh ian at well-typed.com
Mon May 20 13:40:50 CEST 2013


On Mon, May 20, 2013 at 11:47:52AM +0200, Simon Hengel wrote:
> 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.

I think the conclusion of the base splitting discussion was that we
should split base up, and make a new 'base' package that re-exports
things from the split-up packages.

Perhaps we should take this opportunity to slim down the Prelude,
putting the slimmed-down version in one of the split packages, but
leaving the current Prelude in the 'base' package. That way packages
will continue to be able to depend on base, and get the existing
Prelude, but when they switch to the split versions they will need to
add imports and resolve ambiguities as necessary.


Thanks
Ian
-- 
Ian Lynagh, Haskell Consultant
Well-Typed LLP, http://www.well-typed.com/



More information about the Libraries mailing list