I want to know if this represents a tail-recursion. And if it isn't how can I do it.
countP :: [a] -> (a->Bool) -> Int
countP [] _ = 0
countP (x:xs) p = countP_aux (x:xs) p 0
countP_aux [] _ _ = 0
countP_aux (x:xs) p acumul
|p x==True = (countP_aux xs p (acumul))+1
|otherwise = (countP_aux xs p (acumul))
countP [1,2,3] (>0)
3
(72 reductions, 95 cells)
This exercise show how many values in a list are verified by p condition. Thanks