<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">I intuited that that's what the problem was.<br><br>Thanks,<br><br>Michael<br><br><br>--- On <b>Sat, 5/2/09, Rahul Kapoor <i>&lt;rk@trie.org&gt;</i></b> wrote:<br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"><br>From: Rahul Kapoor &lt;rk@trie.org&gt;<br>Subject: Re: [Haskell-cafe] Generating random enums<br>To: "michael rice" &lt;nowgate@yahoo.com&gt;<br>Cc: "John Van Enk" &lt;vanenkj@gmail.com&gt;, haskell-cafe@haskell.org<br>Date: Saturday, May 2, 2009, 2:00 PM<br><br><div class="plainMail">&gt; OK, I think what you're saying is to work with (random) integers and use<br>&gt; fromEnum and toEnum to get corresponding DayOfWeek. But I get this when I<br>&gt; try to use toEnum:<br>&gt;<br>&gt; *Main&gt; toEnum 2<br><br>ghci does not know what type of enum you want to create from the number 2.<br>Try: toEnum 2
 :: DayOfWeek<br><br>That said, I would expect "toEnum 2" to give an error like: 'Ambiguous<br>type variable `a'....'. So I am not sure why your error message says:<br>'** Exception: Prelude.Enum.().toEnum: bad argument'<br></div></blockquote></td></tr></table><br>