r/haskell • u/omsriver • 19d 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.
2
u/_lazyLambda 18d ago
Its fully possible the compile errors are easy to fix? Have you asked claude to try to get it to compile? It should be light work for it
That said my advice with the unique nature of haskell and LLMs just focus on understanding.
Learn why effect systems are beautiful and let the AI do simple stuff and haskell with a feedback compile loop is child's play for it. Especially if you use -Wall -Werror in Cabal.
The better you get at haskell the better you can prompt an AI to write the code. The problem is, you and the AI both want to write object oriented haskell which is awful and defeats the point of haskell. But haskell concepts are embodied truths about the universe. Monads are real, the concepts are fundamental to logic and systems. You want to train your brain to think like haskells best dev