Thompson sampling beyond classical bandits