In my opinion, the art of writing melodies can't be taught. It is something that should come within and it is often learnt subconsiously by listening to music and finding out what sounds you are looking for before you compose. If you want to leran how to write melodies you shouldn't look at what intervals others have used, you should study form and compose thereafter and move on with more complex stuff as you grow as a composer. Why should you write melodies if you don't have melodies in your head you want to write?