I think I figured out.. I had to replace M.member with M.lookup..
Hello everybody,When I compile a file containing ...plotAsString::(Integral a)=>[(a,a)]->a->StringplotAsString locs ans = let xs = map fst locsys = map snd locslocsmap = M.fromList (zip locs [0..])bufsize=10min' = ((\x -> x-bufsize) . minimum)max' = ((\x -> x+bufsize) . maximum)(bmin@(x0,y0),bmax@(x1,y1)) = ((min' xs,min' ys),(max' xs,max' ys))plotString = foldl (\curStr newRowId -> (foldl (\ccStr newColId -> (ccStr++(case (M.member (newRowId,newColId) locsmap) of(Just v) -> ("." ++ (show v) ++ ".")(Nothing) -> " ")))curStr [y0..y1])) "" [x0..x1]in plotStringI get the following error..main.hs:34:107:Couldn't match expected type `Bool' with actual type `Maybe t0'In the pattern: Just vIn a case alternative: (Just v) -> ("." ++ (show v) ++ ".")In the second argument of `(++)', namely`(case (M.member (newRowId, newColId) locsmap) of {(Just v) -> ("." ++ (show v) ++ ".")(Nothing) -> " " })'can somebody help?
Thanks,
Sunil.