<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<p>Hi,</p>
<p>You can easily write your own:<br>
</p>
<p>> import Control.Monad<br>
> import Data.List<br>
> let foo = flip (foldl' (>=>) return)<br>
> :t foo<br>
foo :: (Foldable t, Monad m) => b -> t (b -> m b) -> m
b<br>
> let g x = return (x*2)<br>
> foo 3 [g,g,g]<br>
24</p>
<p>-Sylvain<br>
</p>
<br>
<div class="moz-cite-prefix">On 24/08/2016 03:00, Dennis Raddle
wrote:<br>
</div>
<blockquote
cite="mid:CAKxLvoo=-+eXc=ZKktv9+Ys+rKHfDFsRUPU+nPmtgSK=dVuc1g@mail.gmail.com"
type="cite">
<div dir="ltr">Is there a function foo that does
<div><br>
</div>
<div>foo :: a -> [a -> m a] -> a</div>
<div><br>
</div>
<div>So </div>
<div><br>
</div>
<div>foo 3 [x,x,x] = return 3 >>= x >>= x >>=
x<br>
</div>
<div><br>
</div>
<div>I don't think replicateM and sequence do this. At least I
can't figure it out.</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
Beginners mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Beginners@haskell.org">Beginners@haskell.org</a>
<a class="moz-txt-link-freetext" href="http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners">http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners</a>
</pre>
</blockquote>
<br>
</body>
</html>