I was wondering if funtions with guards can be tail recursively. Given this implementation elemfor example
elem' :: (Eq a) => a -> [a] -> Bool
elem' x [] = False
elem' x (y:ys)
| x == y = True
| otherwise = elem' x ys
Is this tail recursive? I would say yes, but somehow I’m not convinced.
source
share