Back to list
saw235

create-haskell-bazel-target

by saw235

Monorepo for haskell, trying to build misc stuff under the sun,

1🍴 0📅 Dec 22, 2025

SKILL.md


name: create-haskell-bazel-target description: Create a target for haskell application.

Create Haskell Bazel Target

Instruction

  1. When creating a binary use haskell_binary
  2. When creating a test use haskell_test
  3. When creating a library use haskell_library
  4. Always want to include //:base for dependencies
  5. Any other 3rd party package from hackage, need to use either @stackage or @stackage_alt depending on the packages needed

Checklist

  1. Check if it is already declared in the MODULE.bazel
  2. Check if the target is build clean
  3. 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"],
)

Score

Total Score

50/100

Based on repository quality metrics

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

0/10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

Reviews

💬

Reviews coming soon