Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ jobs:
# Overlay only what the rclone sync (prepare) placed:
# app/routes/**/*.mdx and public images from Google Drive.
# Code merges from main are handled by the promote workflow.
rsync -a --delete ../app/routes/ ./app/routes/
rsync -a --delete ../public/ ./public/
rsync -a ../app/routes/ ./app/routes/
rsync -a ../public/ ./public/

# Force-add the content files. They are intentionally gitignored on main
# (to avoid committing dev fixture copies), but we explicitly want them
Expand Down Expand Up @@ -83,7 +83,7 @@ jobs:
- name: Install Playwright browsers
run: npx playwright install chromium
- name: Run readability test on built site
run: npm run test:reading || echo "Skipped failing tests"
run: npm run test:reading
- if: failure()
uses: ./.github/actions/notify-failure
with:
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ dist

# MDX files copied from app/fixtures to app/routes during `npm run dev`
app/routes/**/*.mdx

!app/routes/essays/programming/functional/andthen-and-then-monad.mdx
# Change them to your taste:
wrangler.toml
# package-lock.json
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
26
24
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
title: "andThen and then Monad"
date: 2026-08-23
---

<article>

# andThen and then Monad

このエッセイでは、関数型プログラミングにおける `andThen` と `then` のモナド的な使い方について解説します。

## 背景

モナドは、`bind`(`>>=`)として知られる操作で、計算を連結します。`andThen` は JavaScript の `Promise` で同様の役割を果たします。

## 実例

```js
Promise.resolve(5)
.andThen(x => Promise.resolve(x * 2))
.then(y => console.log(y)); // 10
```

## まとめ

`andThen` と `then` は、モナドの法則を満たすように設計できます。

</article>
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@
"vitest": "^4.1.11"
},
"engines": {
"node": "26.x"
"node": ">=24"

},
"overrides": {
"@hono/node-server": "1.19.17"
Expand Down
Loading