| Been kicking around a similar idea in the back of my mind from the first moment "functional core / imperative shell" [0] and "sans-IO" [1] infected my brain. I've been chasing that high ever since. Unfortunately, whenever I try to apply this pattern 100%, I hit all kinds of walls: language isn't expressive enough to support what I want; the amount of wiring/glue to support it becomes a burden; the resulting code is spaghetti because the "declaration of intent" lives too far from "implementation of the intent"; "oops I invented my Nth leaky DSL"; and so on and so on. Part of the problem is certainly my own capabilities as a developer as well. I can't help but fantasize about the platonic ideal of a "perfect" system where all that nasty evil I/O is banished to the Shadow Realm and I can frolic in the Fields of Idempotency and Reproduciblity -- one of these days I'll bite the bullet and try Haskell. Nowadays I aim for 80% "perfection", and only in the areas where it matters. In addition, instead of effects I rely more on "reduce complexity as much as possible", which is (frustratingly) much harder to put into practice than "use X library/pattern to solve all problems". Though if I can model the system as a state machine and proptest it [2], that usually gets me where I want to be. Though my soul feels like I just woke up from a dream where I was perfectly content, and now I'm back in the real world with all of its imperfections [3]. --- As for your specific project, it heavily reminds me of the Crux [4] model, which is itself inspired by Elm [5]. Also Flawless [6]. I wish you the best of luck with it. [0]: https://www.destroyallsoftware.com/screencasts/catalog/funct... [1]: https://fasterthanli.me/articles/the-case-for-sans-io [2]: https://sled.rs/simulation.html [3]: https://xkcd.com/224/ [4]: https://github.com/redbadger/crux#architectural-overview [5]: https://guide.elm-lang.org/architecture/ [6]: https://flawless.dev/ |