Personally I consider fasting as a time to let the body rearrange itself. In doing so it rebalances hormone production etc so I don’t take anything during that time. Worth to note that my recent experiences have opened my mind about being strict though. So it’s not a hard no. Let’s say my immediate reaction to your question is, melatonin is a hormone, if you supplement during the fast, once the fast is done the body will feel a lack of external melatonin. Probably not a huge deal but it defeats the idea of fasting as a way to rebalance.