본문으로 건너뛰기
cccskills
무료GitHub에 공개

haddock

Read Haskell package documentation, Haddock HTML, Hackage pages, or dependency source for cabal nix-style projects. Prefer locally built/cached docs and source from the cabal store, dist-newstyle, plan.json, and repo-cache; fall back to Hackage only for packages outside the project dependency set or when local docs are unavailable.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

설치 방법 보기

포함된 파일(2)

  • SKILL.md3.6 KB
  • scripts/locate-dep.sh2.3 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

Haskell Haddock And Source Reader

Read documentation and source code for dependencies of a cabal nix-style project, preferring local files over the network. Exhaust local sources before fetching from Hackage.

Which Source To Use

  • Package is a dependency of the current project: read locally.
  • Package is outside the project's dependency set: fall back to Hackage.
  • Prefer the hoogle skill for symbol or type lookup before fetching full documentation pages.

One-Time Setup

If local docs are missing, enable documentation and build once after dependency changes:

cabal configure --enable-documentation
cabal build all

Resolving A Dependency

Run the bundled resolver from the project root:

.codex/skills/haddock/scripts/locate-dep.sh <package>

The resolver regenerates the build plan, reads cabal's store and repo-cache paths, looks up the package's exact UnitId in dist-newstyle/cache/plan.json, and prints JSON:

{
  "store_path": "<cabal-store>/<UnitId>",
  "doc_dir": "<store_path>/share/doc/html",
  "source": "<repo-cache>/.../<pkg>-<ver>.tar.gz"
}
  • store_path is the resolved unit directory in the cabal store.
  • doc_dir is the Haddock HTML directory, or null if docs were not built.
  • source is a Hackage/Stackage source tarball path, source-repository-package metadata, or null.

Do not construct store paths from package names. Cabal abbreviates and hashes store entries, so use the resolved UnitId.

Reading Docs

When doc_dir is non-null, module pages sit directly inside it. A module page is its dotted name with . replaced by - plus .html, for example System.Random.SplitMix becomes System-Random-SplitMix.html. Use index.html or list *.html files if the module name is uncertain.

Reading Source

For a string tarball path, stream a single file without unpacking everything:

tar -tzf <source>
tar -xzOf <source> <pkg>-<ver>/<path/to/File.hs>

For a source-repository-package object, use its { type, location, tag, subdir } metadata. Cabal checks the repo out under dist-newstyle/src/ in a directory named from the repo plus a content hash, not from the tag. Locate the source with a glob such as:

dist-newstyle/src/*/<subdir>/**/*.hs

Drop /<subdir> when absent or ".". If multiple checkouts match, pick the one whose git rev-parse HEAD matches git rev-parse "<tag>^{commit}" inside that checkout.

Resolver Misses

If the resolver prints null or exits non-zero, the package is not in the cabal store. Common cases:

  • GHC boot libraries such as base, ghc-prim, containers, and template-haskell ship docs with the compiler. Use ghc-pkg-<ver> field <pkg> haddock-html, deriving <ver> and the matching ghc-pkg path from cabal path --output-format=json.
  • Local packages should be read directly from their path in cabal.project.

Hackage Fallback

Use Hackage only when local lookup is not available:

https://hackage.haskell.org/package/<pkg>
https://hackage.haskell.org/package/<pkg>-<ver>/docs/<Module-With-Dashes>.html

If doc_dir is null for a real dependency, documentation: True is probably missing or cabal build all has not run since the dependency was added. Redo setup, then rerun the resolver.

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

haskell

무료

Super-skill for developing Haskell projects with cabal nix-style builds. Orchestrates HLS diagnostics, Haddock, Hoogle, source formatting, and cabal-gild into one workflow. Use when writing, editing, refactoring, building, typechecking, fixing compiler errors, renaming symbols, looking up APIs, or changing dependencies in Haskell projects. Treat cabal.project as the source of truth, prefer HLS before full builds, and prefer local docs over remote lookup.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

konn/tamagoh32026년 8월 2일 업데이트

Format Haskell package descriptions and cabal project files with cabal-gild: *.cabal, cabal.project, cabal.project.local, and cabal.project.freeze. Use after editing dependencies or stanzas, when refreshing cabal-gild discover module lists, or when checking cabal file formatting.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

konn/tamagoh32026년 8월 2일 업데이트

Format Haskell source files: *.hs, *.lhs, and *.hsig, with the project's configured formatter: fourmolu, ormolu, or stylish-haskell. Use before compiling, after source edits, and when applying project style.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

konn/tamagoh32026년 8월 2일 업데이트

hoogle

무료

Search Haskell APIs using Hoogle. Use when working with Haskell projects to look up function signatures, find functions by type, discover library documentation, or identify which module exports an item.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

konn/tamagoh32026년 8월 2일 업데이트

konn의 스킬 모두 보기

이 스킬의 문제 신고