←back to thread

115 points goless | 1 comments | | HN request time: 0.213s | source
Show context
goless ◴[] No.44351819[source]
Hi everyone, I developed an interesting library Polystate: Composable Finite State Machines

Since I only have experience in haskell and zig, I'm curious if there are other languages or libraries with similar implementations?

replies(6): >>44351895 #>>44352068 #>>44352576 #>>44352757 #>>44353562 #>>44353893 #
solomonb ◴[] No.44352068[source]
I'm having trouble reading zig code, so I'm not sure how much overlap there is but I have done some work with mealy and moore encoded as co-algebras in haskell:

https://blog.cofree.coffee/2025-03-05-chat-bots-revisited/ https://github.com/cofree-coffee/cofree-bot

Also using the lens library to encode moore machines as polynomial functors: https://blog.cofree.coffee/2024-07-02-lensy-moore/

replies(1): >>44352121 #
goless ◴[] No.44352121[source]
Thanks for your reply, I will try to understand your code carefully, which may take some time.

I have a raw haskell prototype of polystate here, maybe it will help you. https://github.com/sdzx-1/typed-gui/blob/main/examples/todoL...

replies(1): >>44352549 #
1. solomonb ◴[] No.44352549[source]
Right on, I'll take a look at your haskell code this week.