Proposal: Adding Kleisli composition to Control.Monad

Bulat Ziganshin bulat.ziganshin at gmail.com
Fri Nov 17 07:56:16 EST 2006


Hello Donald,

Monday, November 13, 2006, 1:25:19 PM, you wrote:
>> > I'm we're going to use this forever more, then a name more meaningful
>> > than repeatM_ might be appropriate (personally, I have to check every
>> > time whether it is replicate or repeat that is :: Int -> a -> [a]).

> I'll resubmit 'repeatM_' as a separate patch.

i have one idea: this dispute between folks that prefer repeatM_ name
and whose preferring forever form may just reflect differences between
FP-oriented and imperative programming style. may be the best solution
will be to create new Control.Imperative module and put all this
imperative-alike stuff here. so, John Meacham can just ignore
existence of such module while we can continue to decorate our
imperative programs with such beautiful shortcuts:

foreach = flip mapM
for = flip mapM_
on = flip when
forever = sequence_ . repeat
new = newIORef
(=:) = writeIORef
......

i'm pretty sure that for novices learning Haskell studying these names
will be much simpler than studying Monad concepts and so on




-- 
Best regards,
 Bulat                            mailto:Bulat.Ziganshin at gmail.com



More information about the Libraries mailing list