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
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe