Hub rules-haskell

rules-haskell

v3 public Verified

Haskell

Haskell is an advanced, purely functional programming language with a strong static type system. These rules govern Haskell development, type safety, and purely functional idioms for AI agents.

@sigmashakeinc 2 pulls 7 rules published Apr 8, 2026 synced Nov 22, 2026 sigmashakeinc/rules/rulesets/rules-haskell →
Severity
5 error 2 warn 0 info
demo.cast
Haskell is an advanced, purely functional programming language with a strong static type system. These rules govern Haskell development, type safety, and purely functional idioms for AI agents.

Rules index

7 governance rules

Indexed from the repository's .rules files, grouped by technology. Expand any rule to read the raw source.

haskell

haskell-block-unsafe-patterns error block

unsafePerformIO breaks Haskell's referential transparency and IO safety guarantees. It can cause race conditions, inconsistent state, and undefined behaviour under optimization. Use a proper IO action and thread it through your computation instead.

Rule source requires an active Pro or Enterprise subscription.
haskell-no-shell-injection error block

Shell command constructed from runtime data enables OS command injection (CWE-78). Use System.Process.readProcess or createProcess with an explicit argument list instead of a shell string, and never interpolate untrusted data into a shell command.

Rule source requires an active Pro or Enterprise subscription.
haskell-no-template-haskell-eval error block

Template Haskell executes arbitrary Haskell at compile time and can access the filesystem, network, and environment. Treat TH splices like executed code — only use trusted, reviewed TH expressions and never pass runtime user data into a splice.

Rule source requires an active Pro or Enterprise subscription.
haskell-no-unsafe-coerce error block

unsafeCoerce reinterprets bits between arbitrary types with no runtime check — it is the Haskell equivalent of C's void* cast and causes undefined behaviour when types differ in representation or size. Use a safe conversion (coerce from Data.Coerce, newtype wrapping, or an explicit conversion function) instead.

Rule source requires an active Pro or Enterprise subscription.
haskell-no-unsafe-dupable-perform-io error block

unsafeDupablePerformIO may execute the action multiple times across threads, causing data corruption on mutable state. It is only safe for idempotent, pure-result foreign calls. Use unsafePerformIO with NOINLINE pragma if you need the single-execution guarantee, or restructure to use IO.

Rule source requires an active Pro or Enterprise subscription.
haskell-no-unsafe-interleave-io warning log

unsafeInterleaveIO defers IO actions lazily, making evaluation order unpredictable and error handling unreliable. It was commonly misused for lazy file reading (now replaced by streaming libraries). Use streaming-io, conduit, or pipes for lazy I/O instead.

Rule source requires an active Pro or Enterprise subscription.
haskell-no-unsafe-read warning log

read from the Prelude throws an imprecise exception (error) on invalid input, crashing the program. Use readMaybe or readEither from Text.Read to handle malformed input gracefully.

Rule source requires an active Pro or Enterprise subscription.

Version metadata

Published metadata

The hash-locked record of this published ruleset. When source contents change, the maintainer resyncs and the version bumps.

Version
v3
Published
Apr 8, 2026
Source commits
0
Synced
Nov 22, 2026
Hash
2ed3fc920cdefe3aaec1426ac2555de3e4d2e6a48da43952ea3044e7f51b57df
Signature
Verified (publisher key)
Tested with
claude-code@current
Plan
Starter (free)
Visibility
Public

Source history

Recent commits

Latest commits touching rulesets/rules-haskell/.sigmashake/rules in sigmashakeinc/rules/rulesets/rules-haskell. The published version only bumps when a maintainer resyncs.

No commit history available.