-
Notifications
You must be signed in to change notification settings - Fork 147
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Please include samples that use or explain the State monad #413
Comments
Hi, I'm willing to provide samples. Can you share your use case? In the meantime, I will provide a generic sample that shows how to read, write and execute the monad. |
Sure. I am doing an event-sourced aggregate. I'm new to the language and the Functional Programming paradigm in general and I'm sure I can abstract away a lot more than I am now (I need to learn more about monoids and the like; hence my question). I have 2 workflows that pass around state: one is validation and the other is actually updating the state by modifying an element of the list holding the types. I'm not even sure the state monad is the right way to do what I'm doing, honestly. |
Can you check the draft of the generic sample in https://github.com/gdziadkiewicz/FSharpx.Extras/tree/Fix_%23413_add_state_sample ? |
While working on it I noticed that the State monad functions are not fully documented - would be nice to fix that. |
Hey, sorry for the lack of communication. I see the replies to this thread and I've had my nose to the grindstone so to speak. The state sample really does clear things up for me. Thank you. Now that I see how it is used, I can make much more informed decisions on when and where (or if at all) to use it. I also thank you for the documented functions in that module. I would also really appreciate #411 getting the same treatment. I'm trying to learn all of this and think in a more functional manner, but I won't pretend that some of this stuff isn't mind-bending to me. |
Description
I feel like the State monad could be perfect for the code I'm writing, but I can't get it to to work for me. I don't understand it, and most of what I find out there is for Haskell.
Repro steps
Expected behavior
The text was updated successfully, but these errors were encountered: