GHC plugins
Bazel

GHC plugins


ghc_plugin_impl

ghc_plugin_impl(ctx)

Attributes

ctx

Unknown; Required


ghc_plugin

ghc_plugin(name, deps, args, module, tools)

Declare a GHC plugin.

Plugins to use during compilation by GHC are given by the plugins attribute to Haskell rules. Plugins are haskell libraries with some extra metadata, like the name of the module that acts as the entrypoint for the plugin and plugin options.

Attributes

name

Name; Required

A unique name for this rule.

deps

List of labels; Optional; Default is []

Plugin dependencies. These are compile-time dependencies only.

args

List of strings; Optional; Default is []

Plugin options.

module

String; Optional; Default is ''

Plugin entrypoint.

tools

List of labels; Optional; Default is []

Tools needed by the plugin when it used.

Examples

haskell_library(
    name = "plugin-lib",
    srcs = ["Plugin.hs"],
)

ghc_plugin(
    name = "plugin",
    module = "Plugin",
    deps = [":plugin-lib"],
)

haskell_binary(
    name = "some-binary",
    srcs = ["Main.hs"],
    plugins = [":plugin"],