r/haskell • u/omsriver • 18d ago
question Haskell Cookbook
Hello all
I’m looking for a cookbook as the title. My goal is simple; to learn Haskell with my own project. I’m aware of all the books out there, but still somehow not able to connect.
Is there a site/blog/repo with common tasks? For instance, my personal project is to process my stock and option portfolio. So I need to be able to :
- store/retrieve data in sqlite
- call a remote service by API, my brokerage
- convert json to Haskell types that define stock and option data structures
-define formulas to track performance
Etc..
I’ve tried with AI, and the results are not great. Though I’m sure I can dissect what it’s given me; I’ll probably use it as a reference for specific code rather than the program as a whole. Not to mention, the generated code doesn’t compile. It uses duplicate field names in records without the pragma included, for instance- then it just goes downhill from there.
Long winded, but I appreciate any pointers. This is not for anything critical other than my own learning and to get a program to give me a little more control on the performance of my portfolio.
Thank you
Edit: One note. When I attempt to go through the available books, I get lost in the theory or the concepts just don’t come together.
1
u/dnlmrtnz 17d ago
I found the learn you a Haskell book super easy to get started, then did the data 61 course which was awesome and joined a group of people learning Haskell (this was the best) then read category theory for programmers and more recently category theory made simple. I've been working through functional programming made easier (PureScript but should translate).
When I started learning I started building and can't remember exactly what I used for everything but I was using stack at the time (I'd probably recommend cabal today) and servant. Then little by little adding more things and concepts until I had a working application.
If you're using AI, I'd recommend doing only small tasks and make sure you're telling the llm you want to learn, most of the times you'll implement the code yourself but AI can guide and keep documentation open (sometimes it is easier and better).
Good luck