一键导入
haskell-relude
Relude conventions and safe patterns. Use when setting up relude, migrating from Prelude, or working with relude-based projects.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Relude conventions and safe patterns. Use when setting up relude, migrating from Prelude, or working with relude-based projects.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Build a Haskell project, interpret GHC errors, and apply safe fixes. Use when the user asks Codex to build Haskell code, fix compilation errors, or run cabal/stack build workflows.
Expert Haskell code review for idiomatic patterns, type safety, purity, error handling, and performance. Use when reviewing Haskell source files or PR changes.
Run and interpret Haskell test suites. Use when the user asks Codex to run HSpec, QuickCheck, Tasty, cabal test, stack test, or diagnose failing Haskell tests.
Effectful library conventions and decision rules. Use when writing effectful code, designing effects, or migrating from mtl.
Servant client API wrapper conventions with two-layer error handling. Use when generating HTTP clients from Servant APIs, wrapping external service APIs, or integrating servant-client with effectful.
Servant web framework conventions using NamedRoutes record pattern. Use when building REST APIs, defining endpoints, writing handlers, or structuring Servant applications.
| name | haskell-relude |
| description | Relude conventions and safe patterns. Use when setting up relude, migrating from Prelude, or working with relude-based projects. |
Use cabal mixins for project-wide adoption (preferred over NoImplicitPrelude):
build-depends: base >= 4.14 && < 5, relude >= 1.2 && < 1.3
mixins: base hiding (Prelude)
, relude (Relude as Prelude)
, relude
String except for legacy interopviaNonEmpty to safely bridge from listsreadMaybe/readEither -- never readordNub/hashNub -- never nub (O(n^2))Set.member/HashMap.member -- never elem on Set/HashSet (compile error in relude)whenM/unlessM -- for monadic conditionalsone -- for singleton container constructionnewIORef, readIORef, etc. directly (no liftIO wrapper needed)encodeUtf8 / decodeUtf8 -- Text <-> ByteStringtoText / toLText / toString -- between string typestoStrict / toLazy -- strict <-> lazy TextString when Text is availablehead/tail on [a] instead of NonEmpty or viaNonEmptyliftIO . readIORef instead of lifted readIORefPrelude alongside Reludetrace calls in production codeFor migration guide and complete examples:
references/relude-migration.md