26 Sep
2006
26 Sep
'06
5:06 p.m.
Lemmih wrote:
Change:
table :: [(String, Integer)] -> String -> Maybe Integer table ls str = Map.lookup str fm where fm = trace "Trace: making the map" $ Map.fromList ls
to:
table :: [(String, Integer)] -> String -> Maybe Integer table ls = \str -> Map.lookup str fm where fm = trace "Trace: making the map" $ Map.fromList ls
This did the trick, in both this toy example and in the more complicated real program. It turns out that the seq later on is not actually necessary. Thanks, Paul.