create-haskell-bazel-target
Create a target for haskell application.
$ 安裝
git clone https://github.com/saw235/haskell-monorepo /tmp/haskell-monorepo && cp -r /tmp/haskell-monorepo/.agent/skills/create-haskell-bazel-targets ~/.claude/skills/haskell-monorepo// tip: Run this command in your terminal to install the skill
SKILL.md
name: create-haskell-bazel-target description: Create a target for haskell application.
Create Haskell Bazel Target
Instruction
- When creating a binary use haskell_binary
- When creating a test use haskell_test
- When creating a library use haskell_library
- Always want to include //:base for dependencies
- Any other 3rd party package from hackage, need to use either @stackage or @stackage_alt depending on the packages needed
Checklist
- Check if it is already declared in the MODULE.bazel
- Check if the target is build clean
- When adding data as a bazel dependencies, the relative path needs to be from the repository root,
haskell_test(
name = "hackage-doc-cli-test",
srcs = glob(["**/*.hs"]),
data = glob(["Fixtures/**/*"])
)
source code
haskell/app/hackage-doc-cli/test/Fixtures/aeson-package.json
Examples of Bazel Target
# Neural network from scratch application
haskell_binary(
name = "neural-network",
srcs = [":Main.hs"],
deps = [
"//:base",
"//haskell/libs/neural-network",
"@stackage//:mtl",
"@stackage//:random",
],
)
haskell_library(
name = "neural-network",
srcs = glob(["src/**/*.hs"]),
src_strip_prefix = "src",
ghcopts = ["-XRecordWildCards"],
deps = [
"//:base",
"@stackage//:vector",
"@stackage//:random",
"@stackage//:mtl",
],
visibility = ["//visibility:public"],
)
Repository

saw235
Author
saw235/haskell-monorepo/.agent/skills/create-haskell-bazel-targets
1
Stars
0
Forks
Updated5d ago
Added1w ago