
15 Nov
2006
15 Nov
'06
6:08 p.m.
Robert Dockins wrote:
Or how about.... ??
lookupVarible target env = case [ v | (n,v) <- env, n==target ] of (x:_) -> x _ -> assert False $ "BUG: Unexpected variable out of scope "++(show target)++" in environment "++(show env)
Other have pointed out that, in the CURRENT Haskell semantics, the above is quite difficult to reason about. Note that the whole point of Wolfram Kahl's Pattern Matching Calculus is to restore equational reasoning to pattern-matches. http://www.cas.mcmaster.ca/~kahl/PMC/ Jacques