<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Sep 2, 2010, at 11:30 AM, michael rice wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><table cellspacing="0" cellpadding="0" border="0"><tbody><tr><td valign="top" style="font: inherit; ">In each case, what does the notation<br><br>show:: ...<br><br>and<br><br>undefined:: ...<br><br>accomplish?</td></tr></tbody></table></span></blockquote></div><br><div>They're type annotations. &nbsp;show is a function in "many" types:</div><div><br></div><div><div><font class="Apple-style-span" face="Courier">Prelude&gt; :t show</font></div><div><font class="Apple-style-span" face="Courier">show :: (Show a) =&gt; a -&gt; String</font></div></div><div><br></div><div>If you want to see the type of a "specific" show function, you need to find a way to "determine" its type. &nbsp;This is a slightly different function, but it's equivalent in types and semantics:</div><div><br></div><div><div><font class="Apple-style-span" face="Courier">Prelude&gt; :t \x -&gt; show x</font></div><div><font class="Apple-style-span" face="Courier">\x -&gt; show x :: (Show a) =&gt; a -&gt; String</font></div></div><div><br></div><div>Now we have a named argument, and we can constraint its type with an annotation:</div><div><br></div><div><div><font class="Apple-style-span" face="Courier">Prelude&gt; :t \x -&gt; show (x :: Int)</font></div><div><font class="Apple-style-span" face="Courier">\x -&gt; show (x :: Int) :: Int -&gt; String</font></div></div><div><br></div></body></html>