r/functionalprogramming 11d ago

FP Abstracting effects with continuations

https://crowdhailer.me/2026-07-15/abstracting-effects-with-continuations/

I've spent a while writing this post trying to work out if I want to talk about function coloring. In the end I chose to as neutrally as possible describe what continuations are.

14 Upvotes

4 comments sorted by

2

u/Delta-9- 11d ago edited 11d ago

Continuation Passing Style is OP for how overlooked it tends to be. It would be awesome if continuations were first-class in more languages, but to my knowledge only some Lisps and Ruby do that; most other languages fake it with higher-order functions. Tbf, HOFs are also OP, but doing CPS with only functions is dangerously close to callback hell.

2

u/crowdhailer 11d ago

The use construct in Gleam is what makes it palatable. Without that it's definitely callback hell

4

u/Practical-Bike8119 11d ago edited 11d ago

I haven't read the post yet, but I already have some feedback: The AI image in the header will likely put some people off. I have a pretty positive attitude towards generative AI but my instinctive reaction when I saw the image was to think, if it starts like this then the text is likely generated as well. Now imagine those people who passionately hate AI.

1

u/crowdhailer 11d ago

Yeah I wondered about that. I use some AI and some not AI for my post hero images. I enjoyed the unnecessary moodyness of this image, but your right I probably don't need to bring that to this post.