feat(third_party/bazel): Check in rules_haskell from Tweag
This commit is contained in:
parent
2eb1dc26e4
commit
f723b8b878
479 changed files with 51484 additions and 0 deletions
2
third_party/bazel/rules_haskell/tests/hs-boot/A.hs-boot.in
vendored
Normal file
2
third_party/bazel/rules_haskell/tests/hs-boot/A.hs-boot.in
vendored
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
module A where
|
||||
newtype TA = MkTA Int
|
||||
8
third_party/bazel/rules_haskell/tests/hs-boot/A.hs.in
vendored
Normal file
8
third_party/bazel/rules_haskell/tests/hs-boot/A.hs.in
vendored
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
module A where
|
||||
|
||||
import B (TB (..))
|
||||
|
||||
newtype TA = MkTA Int
|
||||
|
||||
f :: TB -> TA
|
||||
f (MkTB x) = MkTA x
|
||||
48
third_party/bazel/rules_haskell/tests/hs-boot/BUILD.bazel
vendored
Normal file
48
third_party/bazel/rules_haskell/tests/hs-boot/BUILD.bazel
vendored
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
load(
|
||||
"@io_tweag_rules_haskell//haskell:haskell.bzl",
|
||||
"haskell_library",
|
||||
"haskell_test",
|
||||
)
|
||||
|
||||
package(default_testonly = 1)
|
||||
|
||||
genrule(
|
||||
name = "gen-A-boot",
|
||||
srcs = ["A.hs-boot.in"],
|
||||
outs = ["srcs/A.hs-boot"],
|
||||
cmd = "cp $< $@",
|
||||
)
|
||||
|
||||
genrule(
|
||||
name = "gen-A",
|
||||
srcs = ["A.hs.in"],
|
||||
outs = ["srcs/A.hs"],
|
||||
cmd = "cp $< $@",
|
||||
)
|
||||
|
||||
haskell_library(
|
||||
name = "hs-boot-lib",
|
||||
srcs = [
|
||||
"srcs/B.hs",
|
||||
":gen-A",
|
||||
":gen-A-boot",
|
||||
],
|
||||
src_strip_prefix = "srcs",
|
||||
visibility = ["//visibility:public"],
|
||||
deps = ["//tests/hackage:base"],
|
||||
)
|
||||
|
||||
haskell_test(
|
||||
name = "hs-boot",
|
||||
srcs = [
|
||||
"MA.hs",
|
||||
"MA.hs-boot",
|
||||
"MB.hs",
|
||||
"Main.hs",
|
||||
],
|
||||
visibility = ["//visibility:public"],
|
||||
deps = [
|
||||
":hs-boot-lib",
|
||||
"//tests/hackage:base",
|
||||
],
|
||||
)
|
||||
8
third_party/bazel/rules_haskell/tests/hs-boot/MA.hs
vendored
Normal file
8
third_party/bazel/rules_haskell/tests/hs-boot/MA.hs
vendored
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
module MA where
|
||||
|
||||
import MB (TB (..))
|
||||
|
||||
newtype TA = MkTA Int
|
||||
|
||||
f :: TB -> TA
|
||||
f (MkTB x) = MkTA x
|
||||
2
third_party/bazel/rules_haskell/tests/hs-boot/MA.hs-boot
vendored
Normal file
2
third_party/bazel/rules_haskell/tests/hs-boot/MA.hs-boot
vendored
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
module MA where
|
||||
newtype TA = MkTA Int
|
||||
8
third_party/bazel/rules_haskell/tests/hs-boot/MB.hs
vendored
Normal file
8
third_party/bazel/rules_haskell/tests/hs-boot/MB.hs
vendored
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
module MB where
|
||||
|
||||
import {-# SOURCE #-} MA (TA (..))
|
||||
|
||||
data TB = MkTB !Int
|
||||
|
||||
g :: TA -> TB
|
||||
g (MkTA x) = MkTB x
|
||||
9
third_party/bazel/rules_haskell/tests/hs-boot/Main.hs
vendored
Normal file
9
third_party/bazel/rules_haskell/tests/hs-boot/Main.hs
vendored
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
module Main (main) where
|
||||
|
||||
import A ()
|
||||
import B ()
|
||||
import MA ()
|
||||
import MB ()
|
||||
|
||||
main :: IO ()
|
||||
main = putStrLn "hsboot"
|
||||
8
third_party/bazel/rules_haskell/tests/hs-boot/srcs/B.hs
vendored
Normal file
8
third_party/bazel/rules_haskell/tests/hs-boot/srcs/B.hs
vendored
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
module B where
|
||||
|
||||
import {-# SOURCE #-} A (TA (..))
|
||||
|
||||
data TB = MkTB !Int
|
||||
|
||||
g :: TA -> TB
|
||||
g (MkTA x) = MkTB x
|
||||
Loading…
Add table
Add a link
Reference in a new issue