thanks, interesting input. I agree with you in general terms, but in real-world scenarios, especially for larger production systems, the “edges” are everywhere, you have side-effects all over the place, not necessarily in terms of internal (with respect to the app itself) states, but rather the world around it. db reads/writes/searches, logging to different outputs under different names, file upload/storage/download, user-interactions, authentication states, app configurations that sometimes needs to change for parts of the app.
if you have e.g. an api endpoint that needs to log, store a file, find a file, genreate ids and what have you, you’ll end up injecting 20 different functions instead of maybe 3 or 4 dependency objects (e.g. capability records). i don’t see how this is solved by things be internally immutable, because the world around the app sure as heck isn’t - and after all, if we don’t interact heavily with it, we can’t do anything useful at all.
if you grasp the concept of a composition root with dependency injection (coming from the OO paradigm, lets say), could you provide a relevant example of how it would look in terms of files/injections in rescript? keep in mind you still want to wire things up in one single place. i’d like to wrap my head around it as i feel that i currently cannot, but i’m also rather sure it’s mainly because of my lack of competence in the fp domain, but i’m also more and more sure that there aren’t any good real-world conventions yet (most of the ones i’ve seen are academic and/or contrived)