diff options
Diffstat (limited to 'third_party/bazel/rules_haskell/tests/haddock')
9 files changed, 0 insertions, 190 deletions
diff --git a/third_party/bazel/rules_haskell/tests/haddock/BUILD.bazel b/third_party/bazel/rules_haskell/tests/haddock/BUILD.bazel deleted file mode 100644 index 6955285c87d2..000000000000 --- a/third_party/bazel/rules_haskell/tests/haddock/BUILD.bazel +++ /dev/null @@ -1,73 +0,0 @@ -load( - "@io_tweag_rules_haskell//haskell:haskell.bzl", - "haskell_doc", - "haskell_library", - "haskell_toolchain_library", -) - -package( - default_testonly = 1, - default_visibility = ["//visibility:public"], -) - -haskell_library( - name = "haddock-lib-deep", - srcs = ["Deep.hsc"], - deps = ["//tests/hackage:base"], -) - -haskell_library( - name = "haddock-lib-a", - srcs = [ - "LibA.hs", - "LibA/A.hs", - "header.h", - ], - compiler_flags = ["-I."], - deps = [ - ":haddock-lib-deep", - "//tests/hackage:base", - "//tests/hackage:template-haskell", - ], -) - -haskell_toolchain_library( - name = "haddock-lib-c", - package = "libc", -) - -haskell_library( - name = "haddock-lib-b", - srcs = [ - "LibB.hs", - "TH.hs", - ], - extra_srcs = [ - "unicode.txt", - ], - tags = [ - "requires_hackage", - "requires_zlib", - ], - deps = [ - ":haddock-lib-a", - "//tests/hackage:base", - "//tests/hackage:template-haskell", - "@hackage//:libc", - "@zlib", - ], -) - -haskell_doc( - name = "haddock", - index_transitive_deps = False, - tags = ["requires_hackage"], - deps = [":haddock-lib-b"], -) - -haskell_doc( - name = "haddock-transitive", - index_transitive_deps = True, - tags = ["requires_hackage"], - deps = [":haddock-lib-b"], -) diff --git a/third_party/bazel/rules_haskell/tests/haddock/Deep.hsc b/third_party/bazel/rules_haskell/tests/haddock/Deep.hsc deleted file mode 100644 index 6fb0482a1572..000000000000 --- a/third_party/bazel/rules_haskell/tests/haddock/Deep.hsc +++ /dev/null @@ -1,11 +0,0 @@ --- | "Deep" doc. -module Deep (deep_lib) where - --- | 'deep_lib' doc. - -#if __GLASGOW_HASKELL__ >= 700 -#ifndef _INTERNAL_HSC_DO_NOT_DEFINE_ME -deep_lib :: Int -deep_lib = 100 -#endif -#endif diff --git a/third_party/bazel/rules_haskell/tests/haddock/LibA.hs b/third_party/bazel/rules_haskell/tests/haddock/LibA.hs deleted file mode 100644 index 252c90ccc6d9..000000000000 --- a/third_party/bazel/rules_haskell/tests/haddock/LibA.hs +++ /dev/null @@ -1,19 +0,0 @@ --- | "LibA" header -{-# LANGUAGE CPP #-} -{-# LANGUAGE TemplateHaskell #-} - -#include "header.h" - -module LibA where - -import LibA.A (a) -import Deep (deep_lib) - --- | 'A' declaration. -data A = - -- | 'A' constructor. - A - --- | Doc for 'f' using 'a' and 'deep_lib'. -f :: Int -f = const $a deep_lib + MAGIC_NUMBER diff --git a/third_party/bazel/rules_haskell/tests/haddock/LibA/A.hs b/third_party/bazel/rules_haskell/tests/haddock/LibA/A.hs deleted file mode 100644 index 3be8dd5aadd3..000000000000 --- a/third_party/bazel/rules_haskell/tests/haddock/LibA/A.hs +++ /dev/null @@ -1,10 +0,0 @@ --- | "LibA.A" header -{-# LANGUAGE TemplateHaskell #-} - -module LibA.A where - -import Language.Haskell.TH - --- | 'a' doc -a :: Q Exp -a = [| 5 |] diff --git a/third_party/bazel/rules_haskell/tests/haddock/LibB.hs b/third_party/bazel/rules_haskell/tests/haddock/LibB.hs deleted file mode 100644 index b4df1ffcb9a2..000000000000 --- a/third_party/bazel/rules_haskell/tests/haddock/LibB.hs +++ /dev/null @@ -1,21 +0,0 @@ -{-# LANGUAGE TemplateHaskell #-} --- | "LibB" doc. - -module LibB where - -import LibA.A (a) -import LibA (f) -import LibC (mytype, LibCType) -import TH (foo) - --- | Doc for 'x' using 'f' and 'a' and 'Int'. -x :: Int -x = const f a - --- | This uses a type from an undocumented package -y :: LibCType -y = mytype - --- | A thing generated with TH. -z :: String -z = $foo diff --git a/third_party/bazel/rules_haskell/tests/haddock/TH.hs b/third_party/bazel/rules_haskell/tests/haddock/TH.hs deleted file mode 100644 index 6e791b09154e..000000000000 --- a/third_party/bazel/rules_haskell/tests/haddock/TH.hs +++ /dev/null @@ -1,7 +0,0 @@ -module TH (foo) where - -import Language.Haskell.TH -import Language.Haskell.TH.Syntax (lift) - -foo :: Q Exp -foo = runIO (readFile "tests/haddock/unicode.txt") >>= lift diff --git a/third_party/bazel/rules_haskell/tests/haddock/header.h b/third_party/bazel/rules_haskell/tests/haddock/header.h deleted file mode 100644 index ec5eddd2766e..000000000000 --- a/third_party/bazel/rules_haskell/tests/haddock/header.h +++ /dev/null @@ -1 +0,0 @@ -#define MAGIC_NUMBER 100 diff --git a/third_party/bazel/rules_haskell/tests/haddock/libC.nix b/third_party/bazel/rules_haskell/tests/haddock/libC.nix deleted file mode 100644 index d345178838f1..000000000000 --- a/third_party/bazel/rules_haskell/tests/haddock/libC.nix +++ /dev/null @@ -1,47 +0,0 @@ -# A trivial `haskellPackages` library that has haddock generation disabled -self: pkgs: -let - # pkgs = import ../../nixpkgs.nix {}; - - libC = pkgs.writeText "LibC.hs" '' - {-# language NoImplicitPrelude #-} - module LibC where - - data LibCType = LibCType - - -- | myfunction - mytype :: LibCType - mytype = LibCType - ''; - - cabal = pkgs.writeText "libc.cabal" '' - name: libc - version: 0.1.0.0 - build-type: Simple - cabal-version: >=1.10 - - library - default-language: Haskell2010 - exposed-modules: LibC - ''; - - src = pkgs.runCommand "libc-src" {} '' - mkdir $out - cp ${libC} $out/LibC.hs - cp ${cabal} $out/libc.cabal - ''; - -in - # This call means the `.haddock` file is not generated, - # even though the ghc package still references the location - # where it would ordinarily be. - pkgs.haskell.lib.dontHaddock - - (self.callPackage - ({ mkDerivation }: mkDerivation { - pname = "libc"; - version = "0.1.0.0"; - src = src; - license = pkgs.lib.licenses.mit; - isExecutable = false; - }) {}) diff --git a/third_party/bazel/rules_haskell/tests/haddock/unicode.txt b/third_party/bazel/rules_haskell/tests/haddock/unicode.txt deleted file mode 100644 index 74e5f2638d08..000000000000 --- a/third_party/bazel/rules_haskell/tests/haddock/unicode.txt +++ /dev/null @@ -1 +0,0 @@ -Некоторый текст на русском. |