Skip to content
Back to skills

Mutable

ASecurity

Avoid mutable variables like IORef, STRef, and ST in Haskell and prefer immutable records. Use STM variables such as TVar for thread communication. Use when writing or reviewing Haskell code that uses mutable state or concurrency.

  • 3 stars
  • 0 votes
  • 0 copies
  • 6 views
  • Added May 27, 2026
data-ai

Security analysis

A100/100

Scanned November 28, 2026

npx -y skills add ncaq/konoka --skill mutable --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Mutable?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Mutable
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/ncaq-mutable/badge)](https://www.skillsdirectory.com/skills/ncaq-mutable)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: mutable
description: Avoid mutable variables like IORef, STRef, and ST in Haskell and prefer immutable records. Use STM variables such as TVar for thread communication. Use when writing or reviewing Haskell code that uses mutable state or concurrency.
user-invocable: false
---

# mutableな変数

## 普段はmutableな変数を使わない

`IORef`、`STRef`、`ST`のような、mutableな変数を実現する機構は原則として使いません。
Haskellではレコードをimmutableなまま差分更新することを効率よく行えるので、
mutableな変数が欲しくなることは滅多にないためです。

## スレッド間の通信にはSTMのmutableな変数を使う

スレッド間の通信では、mutableな変数を使ったほうがスムーズなことがあります。
その場合は`TVar`、`TMVar`、`TChan`、`TQueue`、`TBQueue`のようなSTMの型を使います。

これらも低レイヤーの機構なので、
そのまま深く入り組ませずに、抽象化して使います。

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in data-ai →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.