Stream: beginners

Topic: Transferring StateT IO knowledge from Haskell


view this post on Zulip Tristan Romanov (Mar 17 2025 at 00:58):

Hi, @Richard Feldman thanks for the UChicago MPCS guest lecture in December, I was there for that, I asked about how you would define FP, you said purity and immutability and that settled that question for me.

I am looking to learn Roc by translating my friend's typing test command line app from Go into Roc. In that FP class, we used the StateT monad transformer applied to the IO monad for the stateful apps we built that communicated with the command line. I scrolled through the Roc tutorial and I didn't see a way to maintain state in between iterations, i.e. one round of Stdin.line->processing->Stdout.line. What does Roc have to support this kind of app, besides reading and writing the state to disk at each iteration?

view this post on Zulip Luke Boswell (Mar 17 2025 at 01:04):

This might help? .. https://github.com/lukewilliamboswell/roc-ansi

view this post on Zulip Luke Boswell (Mar 17 2025 at 01:04):

I implemented a simple text editor using roc

view this post on Zulip Tristan Romanov (Mar 17 2025 at 01:15):

Ok thanks for the example, indeed the Go code uses ANSI escape codes.


Last updated: Jul 06 2025 at 12:14 UTC