Found in 4 comments on Hacker News
kirse · 2022-09-13 · Original thread
5yrs ago I was roughly the same, depends how much you commit up front. I had minimal FP experience, so I bought "Domain Modeling Made Functional" [1] by Scott Wlaschin and used it for side projects / class libs first. Took about 6 months to experience the full mental shift.

Even if you eventually decide you can't commit a team to F#, it's highly worth it because doing at least one app in F# will vastly improve your C# and how you structure applications. [2] I personally just got addicted to the expressive power, it's hard to replicate with any other ecosystem given the full power of .NET under the hood. Giraffe is also a great place to start if you know ASP.NET Core. [3]

[1] https://www.amazon.com/dp/1680502549

[2] https://www.youtube.com/watch?v=US8QG9I1XW0

[3] https://github.com/giraffe-fsharp/Giraffe

Funny enough someone actually wrote a book on it.

Data Modeling Made Functional

https://www.amazon.com/Domain-Modeling-Made-Functional-Domai...

It's one of the better and more useful software engineering books I've read. Even if you don't use a functional programming langauge. It's about using Algebraic Data Types do model common problems in the day-to-day business domain (not typical academic problems).

It's a really simple and awesome presentation, and by the end you're dying for the ability to use this more so in the day to day job. Honestly after reading through it, trying to model problems in OOP just seems so unnecessarily obtuse.

The Scott Wlaschin also runs https://fsharpforfunandprofit.com

https://fsharpforfunandprofit.com/ddd/ - a link to a talk on it which is decent, but the book is much better.

So, this is going to be an uphill battle for you. I suggest you actually learn Haskell first, and then you'll be able to apply its lessons to TypeScript.

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...

I like your approach to problem solving - it's very similar to mine and in domains I also think about.

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)

Fresh book recommendations delivered straight to your inbox every Thursday.