Count nested lambdas for telescope compression.
(&self)
| 121 | |
| 122 | /// Count nested lambdas for telescope compression. |
| 123 | pub fn lam_telescope_count(&self) -> u64 { |
| 124 | let mut count = 0u64; |
| 125 | let mut curr = self; |
| 126 | while let Expr::Lam(_, body) = curr { |
| 127 | count += 1; |
| 128 | curr = body.as_ref(); |
| 129 | } |
| 130 | count |
| 131 | } |
| 132 | |
| 133 | /// Count nested foralls for telescope compression. |
| 134 | pub fn all_telescope_count(&self) -> u64 { |