Caterpillar

Daily Thought - 2024-07-08

< back to list

I've been talking about how I/O can be represented in functional languages, covering Haskell's monad-based approach, and the simpler approach based on values and linear types that I want to go with for Caterpillar. I've also said that I/O in Caterpillar is represented in the form of effects that are executed by the host.

Right now, this is an implementation detail. What's unclear to me, is whether those effects are going to be present in the type system, in the form of algebraic effects. Those are pretty neat, and they can be used for a lot of things; from I/O, to error handling, and much more. But in each of those areas, they compete with simpler language features, like plain values.

I'm sure I'll have more to say about algebraic effects in the future. (I have drafts for a whole series of daily thoughts about that.) For now, I just wanted to quickly mention them, as they relate to the topic of I/O in functional languages. If you want to learn more in the meantime, I recommend you check out the documentation of Koka, which provides a nice introduction.

<< previous thoughtnext thought >>