<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
On 28/05/2009 04:33, michael rice wrote:
<blockquote cite="mid:339047.61698.qm@web31101.mail.mud.yahoo.com"
type="cite">
<table border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td
style="font-family: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; font-size: inherit; line-height: inherit; font-size-adjust: inherit; font-stretch: inherit; -x-system-font: none;"
valign="top">Still exploring monads. I don't understand why the type
signature for double is OK, but not the one for iota.<br>
<br>
Michael<br>
<br>
=================<br>
<br>
--double :: (Int a) => a -> Maybe b<br>
--double x = Just (x + x)<br>
<br>
iota :: (Int a) => a -> [b]<br>
iota n = [1..n]<br>
<br>
--usage: [3,4,5] >>= iota<br>
--should produce [1,2,3,1,2,3,4,1,2,3,4,5]</td>
</tr>
</tbody>
</table>
<br>
</blockquote>
iota is executed within the monad and as such must respect its law ?<br>
<br>
<blockquote cite="mid:339047.61698.qm@web31101.mail.mud.yahoo.com"
type="cite">
<pre wrap="">
<hr width="90%" size="4">
_______________________________________________
Haskell-Cafe mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a>
<a class="moz-txt-link-freetext" href="http://www.haskell.org/mailman/listinfo/haskell-cafe">http://www.haskell.org/mailman/listinfo/haskell-cafe</a>
</pre>
</blockquote>
<br>
</body>
</html>