On the Morse theory of attractors: A functional approach. (November 2021)