Control.Monad proposal: Add whenJust

amindfv at gmail.com amindfv at gmail.com
Sun May 19 23:46:54 CEST 2013


Another +1, specifically on swapping in definitions from Foldable and Traversable. 

To address the concern of "more trouble for beginners," it's important to note that lots of functions are defined differently in the prelude than how they're explained in intro texts.

Haskell's becoming a language with excellent support for many different collection types, and imo it's almost old-fashioned to have so much in base defined as if lists are of much greater importance.

Tom


El May 19, 2013, a las 12:33 PM, Edward Kmett <ekmett at gmail.com> escribió:

> The main utility in removing the crippled versions entirely is that you don't wind up with conflict, but if they are already gone then there is no conflict (within base) in moving the existing Foldable and Traversable interfaces into the Prelude.
> 
> I did say when I made the suggestion that I didn't think it'd make it past the objections, though.
> 
> I'm personally against removing the existing mapM, etc. definitions from the Prelude without replacing them with the combinators from Foldable/Traversable as it would break strictly more code, and breaks a lot more combinators than you would think, concat, sum, product, etc. are all redefined in Foldable to be more general.
> 
> 5 +1 votes for just fixing the Prelude to swap in the definitions from Foldable and Traversable.
> 
> 3 +1 votes for removing everything that conflicts with Foldable and Traversable from the Prelude. 
> 
> And 2 votes against doing anything.
> 
> At this point it is clear that no position has won more than a plurality of the popular opinion, so I resignedly retract the proposal and let the vocal 20% win.
> 
> -Edward
> 
> 
> On Sat, May 18, 2013 at 8:02 PM, John Lato <jwlato at gmail.com> wrote:
>> 
>> On May 18, 2013 10:09 PM, "Ian Lynagh" <ian at well-typed.com> 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.
>> 
>> +1 to Ian's suggestion. 
>> 
>> _______________________________________________
>> Libraries mailing list
>> Libraries at haskell.org
>> http://www.haskell.org/mailman/listinfo/libraries
> 
> _______________________________________________
> Libraries mailing list
> Libraries at haskell.org
> http://www.haskell.org/mailman/listinfo/libraries
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/libraries/attachments/20130519/c2b3e033/attachment.htm>


More information about the Libraries mailing list