Count nested applications for telescope compression.
(&self)
| 110 | |
| 111 | /// Count nested applications for telescope compression. |
| 112 | pub fn app_telescope_count(&self) -> u64 { |
| 113 | let mut count = 0u64; |
| 114 | let mut curr = self; |
| 115 | while let Expr::App(f, _) = curr { |
| 116 | count += 1; |
| 117 | curr = f.as_ref(); |
| 118 | } |
| 119 | count |
| 120 | } |
| 121 | |
| 122 | /// Count nested lambdas for telescope compression. |
| 123 | pub fn lam_telescope_count(&self) -> u64 { |