load("@fbcode_macros//build_defs/lib:haskell_rules.bzl", "haskell_rules")
load("@fbsource//tools/build_defs:fb_native_wrapper.bzl", "fb_native")

def haskell_binary(
        name,
        main = None,
        srcs = (),
        deps = (),
        external_deps = (),
        packages = (),
        compiler_flags = (),
        warnings_flags = (),
        lang_opts = (),
        enable_haddock = False,
        haddock_flags = None,
        enable_profiling = None,
        ghci_bin_dep = None,
        ghci_init = None,
        extra_script_templates = (),
        eventlog = None,
        link_whole = None,
        force_static = None,
        fb_haskell = True,
        allocator = "jemalloc",
        dlls = {},
        visibility = None):
    fb_native.haskell_binary(
        **haskell_rules.convert_rule(
            rule_type = "haskell_binary",
            base_path = native.package_name(),
            name = name,
            main = main,
            srcs = srcs,
            deps = deps,
            external_deps = external_deps,
            packages = packages,
            compiler_flags = compiler_flags,
            warnings_flags = warnings_flags,
            lang_opts = lang_opts,
            enable_haddock = enable_haddock,
            haddock_flags = haddock_flags,
            enable_profiling = enable_profiling,
            ghci_bin_dep = ghci_bin_dep,
            ghci_init = ghci_init,
            extra_script_templates = extra_script_templates,
            eventlog = eventlog,
            link_whole = link_whole,
            force_static = force_static,
            fb_haskell = fb_haskell,
            allocator = allocator,
            dlls = dlls,
            visibility = visibility,
        )
    )

load("@fbcode_macros//build_defs/lib:haskell_rules.bzl", "haskell_rules")
load("@fbsource//tools/build_defs:fb_native_wrapper.bzl", "fb_native")

def haskell_binary(
        name,
        main = None,
        srcs = (),
        deps = (),
        external_deps = (),
        packages = (),
        compiler_flags = (),
        warnings_flags = (),
        lang_opts = (),
        enable_haddock = False,
        haddock_flags = None,
        enable_profiling = None,
        ghci_bin_dep = None,
        ghci_init = None,
        extra_script_templates = (),
        eventlog = None,
        link_whole = None,
        force_static = None,
        fb_haskell = True,
        allocator = "jemalloc",
        dlls = {},
        visibility = None):
    fb_native.haskell_binary(
        **haskell_rules.convert_rule(
            rule_type = "haskell_binary",
            base_path = native.package_name(),
            name = name,
            main = main,
            srcs = srcs,
            deps = deps,
            external_deps = external_deps,
            packages = packages,
            compiler_flags = compiler_flags,
            warnings_flags = warnings_flags,
            lang_opts = lang_opts,
            enable_haddock = enable_haddock,
            haddock_flags = haddock_flags,
            enable_profiling = enable_profiling,
            ghci_bin_dep = ghci_bin_dep,
            ghci_init = ghci_init,
            extra_script_templates = extra_script_templates,
            eventlog = eventlog,
            link_whole = link_whole,
            force_static = force_static,
            fb_haskell = fb_haskell,
            allocator = allocator,
            dlls = dlls,
            visibility = visibility,
        )
    )
