Your syntax is very convenient thanks for sharing.
And finally, I assume you're familiar with Scott Wlashin (of F# for fun and profit & "Domain Modeling Made Functional")[1][2]. If not you 100% should read it as it is right up your alley. It's the intersection of Functional Programing and DDD/EIP. (I have no affiliation).
[1] https://fsharpforfunandprofit.com/ddd/
[2] https://www.amazon.com/Domain-Modeling-Made-Functional-Domai...
[3] https://fsharpforfunandprofit.com/rop/ (Railway oriented programming)
Additionally he does a really great job of walking through two things that I don't think are covered well enough at all for beginning and intermediate programmers (and even experienced ones like myself may have missed parts of along the way).
1. How to effectively gather customer requirements, what questions to ask, what things to dig into, how to organize them. A simple walk through, better than the hand-wavy stuff most people do when requirements gathering.
2. How to model a domain / problem space before implementing. How to effectively reason about your entities, services and actions. And iterate on these with your customer before coding.
I seriously wish I had run across this when I first started coding. A really great collection of tangible, actionable advice.
I've never done it in javascript so won't try to guess, but the first two parts of the three part book are really applicable regardless of the language. Will have to finish the third to see how it is.
Domain Modeling Made Functional - Scott Wlaschin
https://pragprog.com/book/swdddf/domain-modeling-made-functional https://www.amazon.com/Domain-Modeling-Made-Functional-Domain-Driven/dp/1680502549 (I have zero affiliation with the author and get nothing from any links)His blog https://fsharpforfunandprofit.com/
Its tricky because these are patterns that are familiar in Haskell but are not really taught in other settings.
Additionally, to really learn these, you need to experiment with them. Use them. etc. That's pretty hard to do if the learning resources are mostly in haskell and you don't really understand it.
Alternatively, this might help: https://github.com/MostlyAdequate/mostly-adequate-guide
Also alternatively, what I would do is just go slowly through the fp-ts code. Look at it a piece at a time and slowly grow your understanding.
This may also help https://www.amazon.com/Domain-Modeling-Made-Functional-Domai...