Skip to content
Back to skills

Function Result

ASecurity

Do not discard a function's final value with return (), pure (), or void; adjust the type to return the value and let the caller discard it when unneeded. Use when writing or reviewing Haskell functions that return unit or discard results.

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

Security analysis

A100/100

Scanned November 28, 2026

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

Installs into .claude/skills of the current project.

Are you the author of Function Result?

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

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

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: function-result
description: Do not discard a function's final value with return (), pure (), or void; adjust the type to return the value and let the caller discard it when unneeded. Use when writing or reviewing Haskell functions that return unit or discard results.
user-invocable: false
---

# 関数の最後の値は捨てない

関数の最後で`return ()`、`pure ()`、`void`などを使って値を捨てないでください。
特に理由がなければ、最後の値をそのまま返すように関数の型のほうを合わせます。

今はその返り値が必要なくても、呼び出し側で捨てれば済み、その手間はわずかです。
返しておけば、後で必要になったときに大きく書き換えずに済みます。

関数の最後が`writeFile`のようにユニットを返す関数であれば、
関数の返り値もそのまま`MonadIO m => m ()`のようなユニットにして構いません。

最後に呼び出すのがちょっとした補助関数で、
その返り値を返すと関数全体の挙動が誤解されてしまう場合だけ、
最後の値を捨てることを検討してください。

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.