From: Michael N. <mic...@ni...> - 2013-12-18 04:21:43
|
On 18/12/13 14:56, Bill Richter wrote: > I tried something like this when you first posted, but I didn't think to use > dest_comb. Do you have any general tips on how to recognize a term as say a > combination (which worked here) on an abstraction (not here)? Try using a match-expression: match tm with Var(_,_) -> "it's a var" | Const(_,_) -> "it's a const" | Comb(_,_) -> "it's an application" | Abs(_,_) -> "it's an abstraction" You can also use the helper functions is_comb, is_abs, is_const, and is_var. Michael |