<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">Thanks! I just copied the code from the PDF file. Whatever that character was it wasn't the correct one.<br><br>Michael<br><br>--- On <b>Thu, 5/28/09, Andrew Wagner <i>&lt;wagner.andrew@gmail.com&gt;</i></b> wrote:<br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"><br>From: Andrew Wagner &lt;wagner.andrew@gmail.com&gt;<br>Subject: Re: [Haskell-cafe] Problem w/YAHT code example<br>To: "michael rice" &lt;nowgate@yahoo.com&gt;<br>Cc: haskell-cafe@haskell.org<br>Date: Thursday, May 28, 2009, 10:01 PM<br><br><div id="yiv489990095">I'm not sure what you're using at the end of the identifier "search'", but it needs to be the single quote that's on the same key as the double quotes. I suspect that's where it's blowing up.<br>
<br><div class="gmail_quote">On Thu, May 28, 2009 at 9:56 PM, michael rice <span dir="ltr">&lt;<a rel="nofollow" ymailto="mailto:nowgate@yahoo.com" target="_blank" href="/mc/compose?to=nowgate@yahoo.com">nowgate@yahoo.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<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;" valign="top">
<span style="font-family: courier,monaco,monospace,sans-serif;">This code, from YAHT (Section 8.4.2, PDF pg. 119 of 192) seems to have a problem. Code below.<br><br>Michael<br><br>=================<br><br>[michael@localhost ~]$ ghci</span><br style="font-family: courier,monaco,monospace,sans-serif;">
<span style="font-family: courier,monaco,monospace,sans-serif;">GHCi, version 6.10.1: <a rel="nofollow" target="_blank" href="http://www.haskell.org/ghc/">http://www.haskell.org/ghc/</a>&nbsp; :? for help</span><br style="font-family: courier,monaco,monospace,sans-serif;">
<span style="font-family: courier,monaco,monospace,sans-serif;">Loading package ghc-prim ... linking ... done.</span><br style="font-family: courier,monaco,monospace,sans-serif;"><span style="font-family: courier,monaco,monospace,sans-serif;">Loading package integer ... linking ... done.</span><br style="font-family: courier,monaco,monospace,sans-serif;">
<span style="font-family: courier,monaco,monospace,sans-serif;">Loading package base ... linking ... done.</span><br style="font-family: courier,monaco,monospace,sans-serif;"><span style="font-family: courier,monaco,monospace,sans-serif;">Prelude&gt; :l graph</span><br style="font-family: courier,monaco,monospace,sans-serif;">
<span style="font-family: courier,monaco,monospace,sans-serif;">[1 of 1] Compiling Main&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ( graph.hs, interpreted )</span><br style="font-family: courier,monaco,monospace,sans-serif;"><br style="font-family: courier,monaco,monospace,sans-serif;">
<span style="font-family: courier,monaco,monospace,sans-serif;">graph.hs:6:24: lexical error at character '\8217'</span><br style="font-family: courier,monaco,monospace,sans-serif;"><span style="font-family: courier,monaco,monospace,sans-serif;">Failed, modules loaded: none.</span><br style="font-family: courier,monaco,monospace,sans-serif;">
<span style="font-family: courier,monaco,monospace,sans-serif;"><br>==============<br><br>Prelude&gt; data Graph v e = Graph [(Int,v)] [(Int,Int,e)]</span><br style="font-family: courier,monaco,monospace,sans-serif;"><br style="font-family: courier,monaco,monospace,sans-serif;">
<span style="font-family: courier,monaco,monospace,sans-serif;">search :: Graph v e -&gt; Int -&gt; Int -&gt; Maybe [Int]</span><br style="font-family: courier,monaco,monospace,sans-serif;"><span style="font-family: courier,monaco,monospace,sans-serif;">search g@(Graph vl el) src dst</span><br style="font-family: courier,monaco,monospace,sans-serif;">
<span style="font-family: courier,monaco,monospace,sans-serif;">&nbsp;&nbsp;&nbsp; | src == dst = Just [src]</span><br style="font-family: courier,monaco,monospace,sans-serif;"><span style="font-family: courier,monaco,monospace,sans-serif;">&nbsp;&nbsp;&nbsp; | otherwise = search’ el</span><br style="font-family: courier,monaco,monospace,sans-serif;">
<span style="font-family: courier,monaco,monospace,sans-serif;">&nbsp;&nbsp;&nbsp; where search’ [] = Nothing</span><br style="font-family: courier,monaco,monospace,sans-serif;"><span style="font-family: courier,monaco,monospace,sans-serif;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; search’ ((u,v,_):es)</span><br style="font-family: courier,monaco,monospace,sans-serif;">
<span style="font-family: courier,monaco,monospace,sans-serif;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | src == u =</span><br style="font-family: courier,monaco,monospace,sans-serif;"><span style="font-family: courier,monaco,monospace,sans-serif;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; case search g v dst of</span><br style="font-family: courier,monaco,monospace,sans-serif;">
<span style="font-family: courier,monaco,monospace,sans-serif;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Just p -&gt; Just (u:p)</span><br style="font-family: courier,monaco,monospace,sans-serif;"><span style="font-family: courier,monaco,monospace,sans-serif;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Nothing -&gt; search’ es</span><br style="font-family: courier,monaco,monospace,sans-serif;">
<span style="font-family: courier,monaco,monospace,sans-serif;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | otherwise = search’ es</span><br style="font-family: courier,monaco,monospace,sans-serif;"><br style="font-family: courier,monaco,monospace,sans-serif;">
<br style="font-family: courier,monaco,monospace,sans-serif;"><br style="font-family: courier,monaco,monospace,sans-serif;"><br></td></tr></tbody></table><br>

      <br>_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a rel="nofollow" ymailto="mailto:Haskell-Cafe@haskell.org" target="_blank" href="/mc/compose?to=Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a><br>
<a rel="nofollow" target="_blank" href="http://www.haskell.org/mailman/listinfo/haskell-cafe">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br>
<br></blockquote></div><br>
</div></blockquote></td></tr></table><br>