Adaptive dynamics in an infinite dimensional setting