I think I figured out..  I had to replace M.member with M.lookup..<div><br></div><div>Thanks,</div><div>Sunil.<br><br><div class="gmail_quote">On Thu, Aug 11, 2011 at 4:23 PM, Sunil S Nandihalli <span dir="ltr">&lt;<a href="mailto:sunil.nandihalli@gmail.com">sunil.nandihalli@gmail.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div>Hello everybody,</div><div>When I compile a file containing ... </div><div><br></div><div>plotAsString::(Integral a)=&gt;[(a,a)]-&gt;a-&gt;String</div>

<div>plotAsString locs ans = let xs = map fst locs</div><div>                            ys = map snd locs</div>

<div>                            locsmap = M.fromList (zip locs [0..])</div><div>                            bufsize=10</div><div>                            min&#39; = ((\x -&gt; x-bufsize) . minimum)</div><div>                            max&#39; = ((\x -&gt; x+bufsize) . maximum)</div>



<div>                            (bmin@(x0,y0),bmax@(x1,y1)) = ((min&#39; xs,min&#39; ys),(max&#39; xs,max&#39; ys))</div><div>                            plotString = foldl (\curStr newRowId -&gt; (foldl (\ccStr newColId -&gt; (ccStr++(case (M.member (newRowId,newColId) locsmap) of</div>



<div>                                                                                                         (Just v) -&gt; (&quot;.&quot; ++ (show v) ++ &quot;.&quot;)</div><div>                                                                                                         (Nothing) -&gt; &quot;   &quot;)))</div>



<div>                                                                           curStr [y0..y1])) &quot;&quot; [x0..x1]</div><div>                        in plotString</div><div><br></div><div>I get the following error..</div>



<div><br></div><div><div>main.hs:34:107:</div><div>    Couldn&#39;t match expected type `Bool&#39; with actual type `Maybe t0&#39;</div><div>    In the pattern: Just v</div><div>    In a case alternative: (Just v) -&gt; (&quot;.&quot; ++ (show v) ++ &quot;.&quot;)</div>



<div>    In the second argument of `(++)&#39;, namely</div><div>      `(case (M.member (newRowId, newColId) locsmap) of {</div><div>          (Just v) -&gt; (&quot;.&quot; ++ (show v) ++ &quot;.&quot;)</div><div>          (Nothing) -&gt; &quot;   &quot; })&#39;</div>



</div><div><br></div><div>can somebody help?<br><br>Thanks,<br><font color="#888888">Sunil.</font></div>
</blockquote></div><br></div>