<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><rk@trie.org></i></b> wrote:<br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"><br>From: Rahul Kapoor <rk@trie.org><br>Subject: Re: [Haskell-cafe] Generating random enums<br>To: "michael rice" <nowgate@yahoo.com><br>Cc: "John Van Enk" <vanenkj@gmail.com>, haskell-cafe@haskell.org<br>Date: Saturday, May 2, 2009, 2:00 PM<br><br><div class="plainMail">> OK, I think what you're saying is to work with (random) integers and use<br>> fromEnum and toEnum to get corresponding DayOfWeek. But I get this when I<br>> try to use toEnum:<br>><br>> *Main> 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>