Skip to content
Back to skills

String

ASecurity

Prefer Text over String for text data, and use ByteString for binary or non-Unicode data. Use when writing or reviewing Haskell code that handles strings, text, or byte data.

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

Works with

  • api

Security analysis

A100/100

Scanned December 2, 2026

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

Installs into .claude/skills of the current project.

Are you the author of String?

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

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

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: string
description: Prefer Text over String for text data, and use ByteString for binary or non-Unicode data. Use when writing or reviewing Haskell code that handles strings, text, or byte data.
user-invocable: false
---

# 文字列型の使い分け

文字列にはなるべく`String`ではなく`Text`を使ってください。
`String`は`[Char]`のエイリアスなので非常に非効率的です。
古くからある型なのでライブラリに蔓延しているだけです。

- `Text`: Unicodeで正しく表現できる文字列に使います。
  基本的には`Text.Lazy`ではなくStrictな`Text`を優先します。
- `ByteString`: バイナリデータ、エンコードが不明なデータ、
  非Unicodeでやり取りされるネットワーク上の文字列データなどに使います。
- `String`: ライブラリのAPIが`String`を使っているときだけ使います。
  そのデータを長く使う場合は`Text`に変換します。

詳しく知りたい場合は、
[Haskellの文字列型: 分類と特徴 - Qiita](https://qiita.com/mod_poppo/items/740659702f31216fdade)
を参照してください。

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.