<div>Hello everybody,</div><div>When I compile a file containing ... </div><div><br></div><div>plotAsString::(Integral a)=>[(a,a)]->a->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' = ((\x -> x-bufsize) . minimum)</div><div> max' = ((\x -> x+bufsize) . maximum)</div>
<div> (bmin@(x0,y0),bmax@(x1,y1)) = ((min' xs,min' ys),(max' xs,max' ys))</div><div> plotString = foldl (\curStr newRowId -> (foldl (\ccStr newColId -> (ccStr++(case (M.member (newRowId,newColId) locsmap) of</div>
<div> (Just v) -> ("." ++ (show v) ++ ".")</div><div> (Nothing) -> " ")))</div>
<div> curStr [y0..y1])) "" [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't match expected type `Bool' with actual type `Maybe t0'</div><div> In the pattern: Just v</div><div> In a case alternative: (Just v) -> ("." ++ (show v) ++ ".")</div>
<div> In the second argument of `(++)', namely</div><div> `(case (M.member (newRowId, newColId) locsmap) of {</div><div> (Just v) -> ("." ++ (show v) ++ ".")</div><div> (Nothing) -> " " })'</div>
</div><div><br></div><div>can somebody help?<br><br>Thanks,<br>Sunil.</div>