# 継続でエフェクトを抽象化する：Gleamによる実践ガイド

Original title: Abstracting Effects with Continuations

> Hacker News story 48932722 · language: ja · submitted 2026-07-16
> Web version: https://zeli.app/ja/story/48932722
> About this feed: https://zeli.app/llms.txt · Agent guide: https://zeli.app/skill.md

▲ 73 · by [crowdhailer](<https://news.ycombinator.com/user?id=crowdhailer>) · 💬 6
[original](<https://crowdhailer.me/2026-07-15/abstracting-effects-with-continuations/>) · [HN discussion](<https://news.ycombinator.com/item?id=48932722>)

## Summary

エラーを値として扱うResultや非同期を表すPromiseは、計算の特定の側面を追跡します。継続（continuation）を使うと、これらの詳細を一般化できます。Filinskiの証明（1994）によれば、継続は任意のモナドを表現可能です。この記事では、Gleamで継続を使って、直接・失敗可能・非同期など異なる種類の計算を扱うビジネスロジックを単一の関数に抽象化する方法を、具体例を通して解説します。fetch関数の実装を差し替える「ランナー」パターンにより、コードの重複を排除し、新しいエフェクトにも柔軟に対応できます。

## Key quote

> 継続を使うということは、「どうやって値を手に入れるかは知らないが、手に入れたら次にこれをやる」と言っているようなものです。

---

## Cite

- Page: https://zeli.app/ja/story/48932722
- Date: 2026-07-16
- Source: crowdhailer.me (https://crowdhailer.me/2026-07-15/abstracting-effects-with-continuations/)
- Hacker News: https://news.ycombinator.com/item?id=48932722

## Other languages

- en: https://zeli.app/story/48932722 · markdown: https://zeli.app/story/48932722.md
- zh: https://zeli.app/zh/story/48932722 · markdown: https://zeli.app/zh/story/48932722.md
- ko: https://zeli.app/ko/story/48932722 · markdown: https://zeli.app/ko/story/48932722.md
- de: https://zeli.app/de/story/48932722 · markdown: https://zeli.app/de/story/48932722.md
- es: https://zeli.app/es/story/48932722 · markdown: https://zeli.app/es/story/48932722.md
