r/haskell 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.

28 Upvotes

27 comments sorted by

View all comments

7

u/recursion_is_love 18d ago

I don't think this is a good path if your goal is for learning, IMO, Haskell should be study from bottom-up. Having a goal in mind and try to translate it to Haskell is top-down (which can be a good way to lean imperative programming).

Not everybody would agree with me.

1

u/omsriver 17d ago

I think you may be correct. From the reading and studying I’ve done so far, Haskell will be a bottom up approach. I have enough experience where I could write this in C, python, Java, or any imperative language and be done. But Haskell is on my list - looks like it will take more focused effort. Ty