Major and Melodic Minor in a diatonic context work together like yin & yang, dark vs. light, Adam & Eve, Abbott & Costello...................
This 4 bar line typifies everything bebop, and it's elements have been a staple of the vocabulary for about 75 years, so there's nothing new here, unless of course, you happen to be new to it!
In that case I would recommend checking out some of the earlier blog posts, starting here, on Melodic Minor harmony.
What still amazes me to no small degree, is and has been the historical misunderstanding and confusion on the subject, in both the available literature as well as our hallowed institutions of "higher learning".
In fact, to my knowledge, the first one to hit it right on the screws was Mark Levine in "The Jazz Piano Book", and in even more detail in the "Jazz Theory Book", published by Sher Music in 1989 and 1995 respectively. Both books contain short sub-chapters with examples explaining that, since Melodic Minor has no inherent "avoid notes" in the sense that exists in Major, then any Melodic Minor chord / scale is fully interchangeable with any other Melodic Minor chord / scale.
Wow! Talk about a paradigm shift, a revelation, an epiphany! Thank you, Mark!!
Up to that point, I had been playing things based on the "altered scale" without knowing or understanding that much about it, since, as mentioned earlier, this stuff had been part of the vocabulary since forever.
However, once I understood that the "altered scale" (the seventh mode of Melodic Minor), and any other of the Melodic Minor modes is mutually interchangeable in any situation, I then understood a lot more of what I heard guys like 'Trane, Joe Henderson and Michael Brecker, etc. were doing.
A lengthy period of experimentation and self discovery then ensued.
And, while I am not normally known as someone who habitually toots his own horn........................,
Since then, although the book hasn't made even the slightest dent in bringing me any closer to financial independence, I'm comforted by the thought that it has helped save many a wayward soul, in every corner of the globe, from the dreaded scourge, the ravages of Melodic Minor ignorance!!!