<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffee" text="#000000">
Vesa Karvonen wrote:<br>
<blockquote
cite="mid:9e43b9a0704180006w325dfe0dn22a0b3c3b0ca5df8@mail.gmail.com"
type="cite">OTOH, the type of repeatWith makes me think of tabulate.
<br>
Hmm... A simpler alternative could be Effect.tabulate
<br>
<br>
val tabulate : Int.t -> Int.t Effect.t
<br>
<br>
So, given
<br>
<br>
ef : 'a Effect.t
<br>
i2a : Int.t -> 'a
<br>
<br>
for some 'a, one could say
<br>
<br>
tabulate n (ef o i2a)
<br>
<br>
instead of
<br>
<br>
repeatWith ef n i2a
<br>
</blockquote>
<br>
Okay, I decided to go with just tabulate for now. However, shouldn't
its type be <br>
<br>
val tabulate : Int.t -> Int.t Effect.t Effect.t <br>
<br>
or<br>
<br>
val tabulate : Int.t Effect.t -> Int.t Effect.t<br>
<br>
? <br>
<br>
I went with the former because it ought to be more useful for partial
applications.<br>
<br>
<blockquote
cite="mid:9e43b9a0704180006w325dfe0dn22a0b3c3b0ca5df8@mail.gmail.com"
type="cite">Also note the existing function Basic.repeat:
<br>
<br>
val repeat : 'a UnOp.t -> Int.t -> 'a UnOp.t
<br>
</blockquote>
<br>
I had seen that but it didn't seem like the best solution at the time.<br>
<br>
<pre class="moz-signature" cols="72">--
[Geoff Washburn|<a class="moz-txt-link-abbreviated" href="mailto:geoffw@cis.upenn.edu">geoffw@cis.upenn.edu</a>|<a class="moz-txt-link-freetext" href="http://www.cis.upenn.edu/~geoffw/">http://www.cis.upenn.edu/~geoffw/</a>]
</pre>
</body>
</html>