recognize functions that become tail-recursive after closure conversion

This commit is contained in:
Folkert 2022-01-19 20:09:20 +01:00
parent aecafe5c80
commit 4c445f9f24
2 changed files with 12 additions and 3 deletions

View file

@ -538,6 +538,11 @@ impl<'a> LambdaSet<'a> {
*self.representation
}
/// Does the lambda set contain the given symbol?
pub fn contains(&self, symbol: Symbol) -> bool {
self.set.iter().any(|(s, _)| *s == symbol)
}
pub fn is_represented(&self) -> Option<Layout<'a>> {
if let Layout::Struct(&[]) = self.representation {
None