Question: Do people who go to sleep before nightfall (e.g., night shift workers, the old and ill during the summer) recite Hamapil before going to sleep?
Answer: The gemara (Berachot 60b) mentions Hamapil for one “entering to sleep on his bed,” without noting time of day. However, the Rambam (Tefilla 7:1) writes “when one enters his bed to sleep at night.” Despite varied opinions of Rishonim (see Meiri, Berachot ad loc), this guideline is accepted (see Be’ur Halacha to 239:1; B’tzel Hachochma V:166). However, this position’s rationale impacts your question. The above gemara continues with the berachot upon awaking, starting with Elokai Neshama, which some see as a bookend along with Hamapil (see B’tzel Hachochma ibid.). We recite these berachot only once a day. In both cases (although some distinguish), there are questions as to whether the berachot are only for those who sleep or they are general praises to Hashem related to sleep and awaking at the classic times. Most poskim say that one recites Hamapil only before a serious sleep (see gemara above). The connection to night is that this is the average person’s time of serious sleep, based on which the beracha was instituted (which is apparently the Rambam’s basis). B’tzel Hachochma (ibid.) understands the element of night very formalistically – there is no obligation and thus no ability to say Hamapil before night, even if one is embarking on a full night’s sleep before nightfall. He compares Hamapil before night to a beracha on sitting in a sukka before Sukkot starts when one plans to remain there (a beracha is not made there). However, there are sources and logic that night is a criterion for Hamapil on practical rather than fundamental grounds. The Chayei Adam (35:4) says that regarding day sleep we are concerned he will not fall asleep, it is improper to sleep, and/or it is not effective sleep. These reasons do not apply to the cases you raise of one who has a valid reason to start sleeping before nightfall (although sometimes we say lo plug- see ibid.).
Several poskim (see Teshurat Shai I:82; Teshuvot V’hanhagot I:198) explain why it might be proper to recite Hamapil before one’s major sleep after dawn when one did not sleep at night (e.g., Shavuot morning). One could add to the equation the opinion that one may recite a birkat hashevach (of praise) even when there is a doubt whether it is necessary because the content of such berachot are never inappropriate (Halachot Ketanot I:264). However, the consensus is that safek berachot l’hakel (in doubt, refrain) applies to there as well (Yabia Omer VII, OC 29). However, in cases where the sleep is primarily at night, the argument to say Hamapil is much stronger. Notice that the Rambam (ibid.) talks about Hamapil preceding going to sleep at night. My reading is that the point is that sleep done at night defines it as justifying Hamapil, not that it is forbidden to recite Hamapil during the day. Thus, if the majority of one’s sleep will be during the night, the fact that it begins earlier need not preclude Hamapil. Whether the case for reciting Hamapil is stronger or not if one goes to sleep soon before nightfall is interesting. Many halachot of night begin at plag hamincha, so perhaps one who sleeps then for the night is considered to be just extending slightly the time of night sleep, which in summer nights in northern latitudes is also common. Note that one who wakes up after midnight may recite the morning berachot including Elokai Neshama (Shulchan Aruch, OC47:13), presumably because morning regarding wake up is flexible. Perhaps the same is true in the evening. On the other hand, perhaps Chazal would not have extended a beracha for going to sleep for the night at a time when one cannot fulfill the mitzva of Kri’at Shema of the night. The rules of practical p’sak point toward not risking reciting the beracha of Hamapil before nightfall, despite my inclination to the contrary. However, one who does so before his major sleep that extends well into the night has what to rely upon.
[Kollel Eretz Chemdah]