You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I recently decided to take the jump and use witchcraft in one of my elixir project.
What made me decide this, is that I had a usual Elixir Agent managing some state.
But there are other processes around, and it can become easy to lose track of messages being passed around. Also I don’t really need the runtime characteristic of an extra process, I just want to keep some state between function calls.
If anyone manages to do that, please share your solutions :slight_smile:
Cheers !
PS: I am also guessing a “process-less agent” could be a good entrypoint to witchcraft for elixir devs, so maybe there could be a good place to post such “State Monad as Agent” example code…
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
[Ported from the old Wicthcrafters Discourse]
@asmodehn:
Hi everyone,
I recently decided to take the jump and use witchcraft in one of my elixir project.
What made me decide this, is that I had a usual Elixir Agent managing some state.
But there are other processes around, and it can become easy to lose track of messages being passed around. Also I don’t really need the runtime characteristic of an extra process, I just want to keep some state between function calls.
So here I am, trying to understand how to use Algae.State — Algae v1.3.0
I am practicing by attempting to implement these examples : State Monad - HaskellWiki 1 but I didn’t get any success just yet.
If anyone manages to do that, please share your solutions :slight_smile:
Cheers !
PS: I am also guessing a “process-less agent” could be a good entrypoint to witchcraft for elixir devs, so maybe there could be a good place to post such “State Monad as Agent” example code…
@asmodehn:
Here is the version I came up with : https://wiki.haskell.org/State_Monad with Elixir witchcraft · GitHub
Beta Was this translation helpful? Give feedback.
All reactions