<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
--></style>
</head>
<body class='hmmessage'>
Thank you. Didn't know that you can supply type directly to a function, like "f :: Type".<br><br>&gt; From: gale@sefer.org<br>&gt; Date: Sun, 14 Mar 2010 13:44:39 +0200<br>&gt; Subject: Re: [Haskell-beginners] Randomly selecting a data constructor<br>&gt; To: tom.davie@gmail.com<br>&gt; CC: beginners@haskell.org; evgenij1@hotmail.com<br>&gt; <br>&gt; Sorry, hit "Send" too soon:<br>&gt; <br>&gt; &gt;&gt; data FigType = TR1 | TR2 | TR3 | TR4 | SQ | L1 | L2 | Z1 | Z2 | Z3 | Z4 |<br>&gt; &gt;&gt; NoFigure<br>&gt; &gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;deriving (Enum, Bounded)<br>&gt; &gt;&gt; randomFigure :: IO FigType<br>&gt; &gt;&gt; randomFigure = toEnum &lt;$&gt; randomRIO<br>&gt; &gt;&gt;   (fromEnum (minBound :: FigType),<br>&gt; &gt;&gt;    fromEnum (maxBound :: FigType))<br>&gt; <br>&gt; -Yitz<br>&gt; _______________________________________________<br>&gt; Beginners mailing list<br>&gt; Beginners@haskell.org<br>&gt; http://www.haskell.org/mailman/listinfo/beginners<br>                                               <br /><hr />Your E-mail and More On-the-Go. Get Windows Live Hotmail Free. <a href='https://signup.live.com/signup.aspx?id=60969' target='_new'>Sign up now.</a></body>
</html>